Nmap Development mailing list archives

[NSE] smb-print-text


From: Aleksandar Nikolic <nikolic.alek () gmail com>
Date: Fri, 03 Aug 2012 09:38:22 +0200

Hi all,

it has been decided that this script could sometime
come in handy and that it should be added to trunk.

I've polished up the script, added documentation
and sample output. I've also added a "text" script
argument which lets you specify the text you
want to print.

Script calls Print Spooler Service RPC functions to a shared printer
to make it print text.

In order to use the script, at least one printer needs to be shared
over SMB. If no printer is specified, script tries to enumerate existing
ones by calling LANMAN API which might not be always available.
LANMAN is available by default on Windows XP, but not on Vista or Windows 7
for example. In that case, you need to specify printer share name manualy
using <code>printer</code> script argument. You can find out available
shares
by using smb-enum-shares script.

Later versions of Windows require valid credentials by default
which you can specify trough smb library arguments <code>smbuser</code> and
<code>smbpassword</code> or other options.

So with full script arguments it would be:
nmap -p 445 <target>
--script-args="printer=PrinterShare,text=0wn3d,smbuser=username,smbpassword=password"

If you test this, and find some problems, please send me the script
debug output.

Aleksandar

Attachment: smb-print-text.nse
Description:

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

Current thread: