Coder Social home page Coder Social logo

how-to-install-pret-on-termux's Introduction

The source code of PRET can be found here: https://github.com/RUB-NDS/PRET

This guide is licensed under the MIT license, you can view the license here: https://github.com/Hugo22O/A-Guide-To-Install-PRET-on-Termux/blob/master/LICENSE

You can download the guide here: https://github.com/Hugo22O/A-Guide-To-Install-PRET-on-Termux/releases, however reading with markup is recommended.

How-To Install PRET On Termux?

A guide helping you install PRET on Termux.

When installing PRET on Termux I faced some problems and it didn't go as smooth as I though it 'd go, as there wasn't a guide avaible I decided to make my own and spare you time trying to figure out how to install PRET on Termux. :D

Requirements: (Will be discussed and installed later in the tutorial.)

  • Android Device with Termux.
  • A working internet connection.
  • Some common sense & brain power.

Table of contents

Installing Termux on your android device

If you have termux installed already, go ahead and skip this step.

Termux is an Android terminal emulator and Linux environment app that works directly with no rooting or setup required, we will be using Termux to run PRET. Download & install Termux from the playstore: https://play.google.com/store/apps/details?id=com.termux or F-Droid: https://f-droid.org/packages/com.termux/ After having Termux installed open up the app.

Installing Python 2 & Git

Alright, you now have Termux session open and it will look like this:

Type in the following: pkg upgrade Then type in:pkg update

After you've done that install Python 2 (not version 3) by typing: pkg install python2 Then install git by typing: pkg install git

If you've done everything correctly you have now installed python 2 and git.

Installing colorama & pysnmp

For colored output and SNMP support we need to install the third party modules colorama and pysnmp which can be done by typing in: pip2 install colorama pysnmp

Colorama and pysnmp should now be installed, we can now get into the last 2 steps of installing PRET!

Downloading PRET with Git.

Now we've installed Python2, colorama & pysnmp it is time to download PRET, you can do so by typing: git clone https://github.com/RUB-NDS/PRET PRET should now be ready for use.

How to run PRET on Termux?

Open a Termux session and type in cd PRET, you should now be in the PRET folder. Once you're there type in python2 pret.py this will scan for printers on your local network that have an open port 9100. You can also add the following arguments to the command:

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

positional arguments:
  target                printer device or hostname
  {ps,pjl,pcl}          printing language to abuse

optional arguments:
  -h, --help            show this help message and exit
  -s, --safe            verify if language is supported
  -q, --quiet           suppress warnings and chit-chat
  -d, --debug           enter debug mode (show traffic)
  -i file, --load file  load and run commands from file
  -o file, --log file   log raw data sent to the target

For more information on how to use PRET and the official source you can take a look here: https://github.com/RUB-NDS/PRET

Troubleshooting

  • Make sure you followed all steps listed above and installed the correct dependencies.
  • Make sure you type python2 instead of python otherwise pret.py won't run.
  • If you're still getting an error/shebang try this: export LD_PRELOAD=${PREFIX}/lib/libtermux-exec.so and then restart the Termux session.

If you expierience any problems you can always make an issue ticket here and I'll get back to you ASAP. https://github.com/Hugo22O/A-Guide-To-Install-PRET-on-Termux/issues

Sources, notes and/or referentions

how-to-install-pret-on-termux's People

Contributors

hugo22o avatar

Stargazers

 avatar  avatar

how-to-install-pret-on-termux's Issues

PRET using

Hello author! Thank you thery much for PRET, but i had this problem: when me needs print file, i writing "print /storage/emulated/name_file" (i don't know how need use command print, please, maybe you can tell me how?)
Screenshot_20220816-233206
Thank you
p.s. more, i have been converted jpg to pcl format and written "text" what showed in usage example (print|"text")

Hi hugo220

Hey, so how do I fix this error when I use the "cd" command to change the directory to a different file system and I got this error code ,NameError: name 'reload' is not defined, any solutions??

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.