Home page logo

nmap-dev logo Nmap Development mailing list archives

Re: gopher directory listing script
From: Toni Ruottu <toni.ruottu () iki fi>
Date: Fri, 7 Jan 2011 17:43:38 +0200

This patch adds the limiting you requested. Ten files will be shown by
default, but this can be changed with a script argument. The patch
also adds support for showing filenames. As a minor fix I changed a
variable name from "type" to "gtype". "type" seems to be a reserved
word in Lua and I wanted to be on the safe side.

On Wed, Dec 29, 2010 at 8:54 PM, David Fifield <david () bamsoftware com> wrote:
On Fri, Dec 17, 2010 at 06:42:03PM +0200, Toni Ruottu wrote:
  hello again folks

This time I wrote a script that lists files and directories published
at the root of a gopher server. Try it out on some public gopher
server. It should just use the protocol as intended, so it should not
be too intrusive. For example try the following...

nmap --script=gopher-ls.nse -p 70 gopher.quux.org

Looks good. I've committed it.

I changed it to put newlines in between entries instead of commas.

I want you to add a script argument, gopher-ls.maxlist, to prevent
flooding the output if there are thousands of files. Take a look at
ftp-anon and nfs-ls for examples.

When I connect directly to a Gopher server I see what look like
filenames that aren't shown in the script output. I think the script
should show them too.

$ ./nmap --datadir . --script gopher-ls gopher.quux.org -p70 -d
70/tcp open  gopher  syn-ack
| gopher-ls:
| [txt] About This Server
| [dir] Archives
| [dir] Books
| [dir] Communication
| [txt] Gopher's 10th Anniversary

$ echo $'\r\n' | ncat gopher.quux.org 70 | grep '^[01]'
0About This Server      /About This Server.txt  gopher.quux.org 70      +
1Archives       /Archives       gopher.quux.org 70      +
1Books  /Books  gopher.quux.org 70      +
1Communication  /Communication  gopher.quux.org 70      +
0Gopher's 10th Anniversary      /3.0.0.txt      gopher.quux.org 70

You might find the tab library useful (http://nmap.org/nsedoc/lib/tab).
See nfs-ls for an example of using it.

David Fifield

Attachment: gopher-ls-limit.patch

Sent through the nmap-dev mailing list
Archived at http://seclists.org/nmap-dev/

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]