RUB-NDS / PRET

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

Incompatibilty of PRET on Kali Linux and Python3 #42

Open thomsoe opened 3 years ago

thomsoe commented 3 years ago

Hi everybody! So I clone PRET on my Kali Linux and I obviously get this error because Python 2 has been removed of Kali but it will mess the execution of PRET : python -m pip install colorama pysnmP /usr/bin/python: No module named pip

So when I start ./pret.py, I get : ./pret.py Please install the 'colorama' module for color support. Please install the 'pysnmp' module for SNMP support. usage: pret.py [-h] [-s] [-q] [-d] [-i file] [-o file] target {ps,pjl,pcl} pret.py: error: too few arguments

So I try with Python 3 and get these following errors (because it's not written to work with Python 2 ig) : Traceback (most recent call last): File "./pret.py", line 8, in from discovery import discovery File "/home/thoms/Bureau/AdventOfCyber/PRET/PRET/discovery.py", line 7, in from helper import output, conv File "/home/thoms/Bureau/AdventOfCyber/PRET/PRET/helper.py", line 130 def discover(self, (ipaddr, (device, uptime, status, prstat))): ^ SyntaxError: invalid syntax`

How can I make PRET fully functionnal??

PS : when I use "python3 -m pip install colorama pysnmP", I get this : python3 -m pip install colorama pysnmP Requirement already satisfied: colorama in /usr/lib/python3/dist-packages (0.4.3) Requirement already satisfied: pysnmP in /usr/lib/python3/dist-packages (4.4.6)

SlothDotEXE commented 3 years ago

Hi,

I couldn't find a simple solution to having multiple interpreters, so I made a Docker solution and posted the repo a few hours ago.

https://github.com/SlothDotEXE/PRET-Docker

thomsoe commented 3 years ago

Okay thanks, I'll test it but I really want to know how to make it fully functionnal without a docker. If a distribution like Kali has python2 disabled it means that we can't use PRET....

SlothDotEXE commented 3 years ago

Okay thanks, I'll test it but I really want to know how to make it fully functionnal without a docker. If a distribution like Kali has python2 disabled it means that we can't use PRET....

Understandable. It's possible by changing the $PATH environments or by using a dedicated environment manager like Anaconda, although my experience in that is limited.

https://docs.anaconda.com/anaconda/user-guide/tasks/switch-environment/

Einstein2150 commented 3 years ago

Install python2 ...

OlegXio commented 2 months ago

same issue for windows. Except for colorama, everything is fine from it:

D:\Python\PRET\pret.py:55: SyntaxWarning: invalid escape sequence '\|'
  print("  |-||/_____\||-.  | |´         dumpster diving obsolete‥ 」       ")
Please install the 'pysnmp' module for SNMP support.

usage: pret.py [-h] [-s] [-q] [-d] [-i file] [-o file] target {ps,pjl,pcl}
pret.py: error: the following arguments are required: target, mode

However, if you specify the command in full, along the lines of python pret.py 1.1.1.1 pjl, it's fine (I haven't tested this on a really real IP of a real network printer, though)