Script smb-print-text

Script types: hostrule
Categories: intrusive

Script Summary

Attempts to print text on a shared printer by calling Print Spooler Service RPC functions.

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 manually using printer 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 smbuser and smbpassword or other options.

Script Arguments


Text to print. Either text or filename need to be specified.


File to read text from (ASCII only).


Printer share name. Optional, by default script tries to enumerate available printer shares.

randomseed, smbbasic, smbport, smbsign

See the documentation for the smb library.

smbdomain, smbhash, smbnoguest, smbpassword, smbtype, smbusername

See the documentation for the smbauth library.

Example Usage

nmap  -p 445 <target> --script=smb-print-text  --script-args="text=0wn3d"

Script Output

|_smb-print-text: Printer job started using MyPrinter printer share.



  • Aleksandar Nikolic

License: Same as Nmap--See