RUB-NDS / PRET

Printer Exploitation Toolkit - The tool that made dumpster diving obsolete.
http://hacking-printers.net
GNU General Public License v2.0
3.81k stars 605 forks source link

SNMP Error when running #4

Open L4bF0x opened 7 years ago

L4bF0x commented 7 years ago

After following instructions and installing PRET on a Kali Linux VM, I get the following error:

root@kali:/opt/pret# ./pret.py No target given, discovering local printers SNMP Error (setComponentByType() got multiple values for keyword argument 'verifyConstraints')

usage: pret.py [-h] [-s] [-q] [-d] [-i file] [-o file] target {ps,pjl,pcl} pret.py: error: too few arguments

pysnmp version: 4.3.2

jensvoid commented 7 years ago

Thanks for the info. Seems to be an issue with the pyasn1/pysnmp modules with the workaround to downgrade pyasn1: http://stackoverflow.com/questions/42514292/pysnmp-typeerror-setcomponentbytype-got-multiple-values-for-keyword-argumen

Really bad, if that's the default behavior in current Kali. However, you don't need SNMP functionality to run PRET. It just optionally uses SNMP broadcast to list printers in your local subnet if no argument is given. If you really require discovery before connecting to a printer device, you can use something like

$ nmap -p 9100 --open ip-range

L4bF0x commented 7 years ago

Thank you for the info!

BenjaminDeuter commented 7 years ago

According to the Stack Overflow post by @jensvoid, this is now fixed upstream since pysnmp version 4.3.4. Therefore, this issue might be closed now.

In case your distribution's package manager still provides an older version, you can uninstall the python2-pysnmp package provided by your package manager and then get a current version via pip:

python2 -m pip install --user pysnmp

This fixed the issue for me.

dardano commented 6 years ago

4.3.4 don't work for me,. error is even worse. PyASN1Error,..... updated to 4.4.2 without any success with the same error as 4.3.4

dudeisbrendan03 commented 5 years ago

Works on Linux fine, on Windows I had to run as administrator and the issue disappeared.

dudeisbrendan03 commented 5 years ago

Just realised this is a two year old issue... oops.