Nmap Development mailing list archives

Re: gopher directory listing script


From: Toni Ruottu <toni.ruottu () iki fi>
Date: Thu, 30 Dec 2010 10:33:44 +0200

It is possible to show a url for each file/dir.
0About This Server      /About This Server.txt  gopher.quux.org 70      +
...translates to...
gopher://gopher.quux.org:70/0/About%20This%20Server.txt

I though that displaying a full url for each entry would be too much,
and decided then to hide even the filenames. What do you think. Should
I show the full urls or what? Maxlines makes sense to protect against
large (not to mention infinite) gopher listings. I might also add an
option for recursing into directories.

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
PORT   STATE SERVICE REASON
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

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: