#!/usr/local/bin/perl use CGI qw/:standard/; # # User interface to set initial options for nmap3d.wrl # # J.Adams # # # where your scan files are $SCANFILEROOT="/usr/local/apache/cgi-bin/scans"; # defaults # Spacing between 'host' boxes $spacing = 2.25; # Where the ring of services is $ringradius = 25; # size in meters $ringheight = 15; # height in Y (meters) sub list_services { # show TCP open(X,"\n"; while () { chomp; next if /^\#/; next if $_ eq ""; # TCP only in this release if (/tcp/i) { ($descr,$port,$rest) = split(/[ \t]+/); $ports{$port} = $descr; $buf .= "\n"; } } $buf .= "\n"; close (X); return $buf; } print header; print start_html("nmap3d - Generation Options Page"); print start_form(-method=>"GET",-action=>"nmap3d.wrl"); print "

NMAP3d

Select options for VRML world generation:

Scan File: " . list_scanfiles() . "
Grid spacing: " . textfield("spacing",$spacing,4,4) . "
Ring Radius: " . textfield("ringradius",$ringradius,4,4) . " meters
Ring Height: " . textfield("ringheight",$ringheight,4,4) . "
Draw Hostnames
(note: dramatic increase in polygon usage):
" . checkbox("DRAW_HOSTNAME","checked",1,"") . "
Draw IP address: " . checkbox("DRAW_IPADDR","checked",1,"") . "
Draw Hosts that are not Up: " . checkbox("DRAW_DOWNED","checked",1,"") . "
Ports: " . list_services() . "
" . submit() . "

John Adams - jna\@retina.net
"; # --- subroutines --- sub list_scanfiles { opendir(DIR,$SCANFILEROOT) || die "can't opendir $SCANFILEROOT: $!"; while ($x = readdir(DIR)) { if ( $x =~ ! /^\./ ) { $files{$x} = $x; } } closedir(DIR); return popup_menu(-name => 'scanfile', -labels=>\%files,-values=>\%files); }