Nmap Development mailing list archives

Updated output for scripts


From: Ron <ron () skullsecurity net>
Date: Mon, 09 Nov 2009 20:02:37 -0600

Hey guys,

I started working on this last night and just finished. Basically, I
cleaned up and updated the output of every script I've touched. The
current version is in
svn://svn.insecure.org/nmap-exp/ron/nmap-smb

I wrote a function in stdnse.lua called format_output(). It basically
takes a table and converts it to a human-readable string. The (HUGE)
advantage to using this is that everything is formatted basically the
same. Previously, among my own scripts, all of which were written by me,
there were all kinds of different indenting methods. Now, everything
looks the same.

I'm hoping everybody starts using this when they're writing scripts with
multi-line output.

Here is how it looks:
|  smb-check-vulns:
|  |  MS08-067: NOT VULNERABLE
|  |  Conficker: Likely CLEAN
|  |  regsvc DoS: CHECK DISABLED (add '--script-args=unsafe=1' to run)
|_ |_ SMBv2 DoS (CVE-2009-3103): CHECK DISABLED (add
'--script-args=unsafe=1' to run)

|  smb-enum-users:
|  |  WINDOWS2003\Administrator (RID: 500)
|  |  |  Description: Built-in account for administering the computer/domain
|  |  |_ Flags:       Password does not expire, Normal user account
|  |  WINDOWS2003\ASPNET (RID: 1008)
|  |  |  Full name:   ASP.NET Machine Account
|  |  |  Description: Account used for running the ASP.NET worker
process (aspnet_wp.exe)
|  |  |_ Flags:       Password not required, Password does not expire,
Normal user account
|  |  WINDOWS2003\Guest (RID: 501)
|  |  |  Description: Built-in account for guest access to the
computer/domain
|  |  |_ Flags:       Password not required, Password does not expire,
Account disabled, Normal user account

|  smb-system-info:
|  |  OS Details
|  |  |  Microsoft Windows Server 2003 Service Pack 2 (ServerNT 5.2
build 3790)
|  |  |  Installed on 2009-10-17 20:14:19
|  |  |  Registered to Ron (organization: MJ-12)
|  |  |  Path: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem
|  |  |  Systemroot: C:\WINDOWS
|  |  |_ Page files: C:\pagefile.sys 384 768 (cleared at shutdown => 0)
|  |  Hardware
|  |  |  CPU 0: Intel(R) Core(TM)2 Duo CPU T7500@ 2.20GHz [2194mhz
GenuineIntel]
|  |  |  |_ Identifier 0: x86 Family 6 Model 15 Stepping 11
|  |  |_ Video driver: VMware SVGA II
|  |  Browsers
|  |  |  Internet Explorer 8.0000
|_ |_ |_ Firefox 3.5.4 (en-US)


|  smb-server-stats:
|  |  Server statistics collected since 2009-11-05 08:08:27 (4d11h48m24s):
|  |  |  1388558 bytes (3.58 b/s) sent, 2156012 bytes (5.56 b/s) received
|_ |_ |_ 8772 failed logins, 0 permission errors, 0 system errors, 0
print jobs, 276 files opened


|  smb-enum-domains:
|  |  WINDOWS2003
|  |  |  SID: S-1-5-21-4146152237-3614947961-1862238888
|  |  |  Users: Administrator, ASPNET, Guest, IUSR_WINDOWS2003,
IWAM_WINDOWS2003, ron, SUPPORT_388945a0, test
|  |  |  Creation time: 2009-10-17 12:46:43
|  |  |  Passwords: min length: n/a; min age: n/a; max age: 42 days;
history: n/a
|  |  |_ Account lockout disabled
|  |  Builtin
|  |  |  SID: S-1-5-32
|  |  |  Users: n/a
|  |  |  Creation time: 2009-10-17 12:46:43
|  |  |  Passwords: min length: n/a; min age: n/a; max age: 42 days;
history: n/a
|_ |_ |_ Account lockout disabled


I think they look a lot nicer now.

Any thoughts?

If not, I'll merge this back into the trunk.

Thanks!
Ron

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


Current thread: