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

Access USB printer on windows (Shared printer) #18

Open guy032 opened 6 years ago

guy032 commented 6 years ago

Hello, I'm trying to reach a USB printer while using Windows environment using your python tool PRET. I shared the usb printer over network and checked using net use command that I receive a connection:

Local name Remote name \GUY\6201 Resource type Print Status OK Opens 0 Connections 1 The command completed successfully.

I repeatedly get with you tool: Connection to \GUY\6201 failed (getaddrinfo failed) Connection closed.

I suspect the problem is here: if os.path.exists(target) \ and stat.S_ISCHR(os.stat(target).st_mode): self._file = os.open(target, os.O_RDWR)

treat target as ipv4 socket

else: self._sock.connect((target, 9100))

because on Windows the target shared printer has no real path at the system. Can you offer me what shall be done?

whatamithinking commented 2 years ago

I have the same problem and cannot find a solution for Windows USB printers.

Any help on this?