Nmap Development mailing list archives

Re: [NSE] DB2 library and scripts


From: Patrik Karlsson <patrik () cqure net>
Date: Tue, 11 May 2010 19:57:34 +0200

Hi again,

I'm attaching yet another version of the DB2-brute script.
In this version, I've used the excellent code provided by Patrick (thanks!) and changed the behavior/design according 
to Fyodor's suggestions [1].
I'm also providing some *very* simple benchmarking of this new script and the old single threaded one running against 
DB2 on Linux.

The benchmarking was performed against a Linux DB2 installation running in Virtualbox. 
The default usernames and passwords files were used, which results in 50840 username and password combinations.

These are the results of the old single threaded script:
abuse:nmap-dev patrik$ ./nmap -p 60000 192.168.56.5 --script db2-brute-st --script-args db2-brute.dbname=haxxoree 
Nmap done: 1 IP address (1 host up) scanned in 142.75 seconds
Nmap done: 1 IP address (1 host up) scanned in 135.33 seconds
Nmap done: 1 IP address (1 host up) scanned in 125.51 seconds
Average: 134,53
TPS: 377,91

These are the results of the new attached script (running 10 threads):
abuse:nmap-dev patrik$ ./nmap -p 60000 192.168.56.5 --script db2-brute --script-args db2-brute.dbname=haxxoree 
Nmap done: 1 IP address (1 host up) scanned in 107.44 seconds
Nmap done: 1 IP address (1 host up) scanned in 105.29 seconds
Nmap done: 1 IP address (1 host up) scanned in 110.32 seconds
Average: 107,68
TPS: 472,14

So this rudimentary benchmark suggests a 25% performance increase when running with 10 threads.
Increasing the threads to 20 by using the db2-brute.threads argument did not show any additional performance increase. 

[1] http://seclists.org/nmap-dev/2010/q2/407

//Patrik

Attachment: db2-brute.nse
Description:



On 11 maj 2010, at 03.12, Patrick Donnelly wrote:

On Mon, May 10, 2010 at 6:19 PM, Patrick Donnelly <batrick () batbytes com> wrote:
-- at the file chunk level of db2-brute
local function new_usrpwd_iterator (usernames, passwords)
 local function next_username_password ()
  coroutine.yield(true) -- ignore first call, it sets up usernames/passwords
  for username in usernames do
    for password in passwords do
      coroutine.yield(username, password)
    end
  end
  while true do coroutine.yield(nil, nil) end
 end
 return coroutine.wrap(next_username_password);
end

Sorry, there was a small error in the above code from an earlier
thought. Remove this line:

 coroutine.yield(true) -- ignore first call, it sets up usernames/passwords

and it should work.

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

--
Patrik Karlsson
http://www.cqure.net
http://www.twitter.com/nevdull77





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

Current thread: