Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -x
sudo ln -sfr pret /usr/local/bin/.
6 changes: 6 additions & 0 deletions pret
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
SCRIPT_DIR=$(dirname "$(realpath "$0")")
VENV_PATH="$SCRIPT_DIR/.venv"
source "$VENV_PATH/bin/activate"
python "$SCRIPT_DIR/pret.py" "$@"
deactivate
26 changes: 13 additions & 13 deletions pret.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ def usage():

def intro(quiet):
if not quiet:
print(" ________________ ")
print(" _/_______________/| ")
print(" /___________/___//|| PRET | Printer Exploitation Toolkit v0.40")
print(" |=== |----| || by Jens Mueller <jens.a.mueller@rub.de> ")
print(" | | ô| || ")
print(" |___________| ô| || ")
print(" | ||/.´---.|| | || 「 pentesting tool that made ")
print(" |-||/_____\||-. | |´ dumpster diving obsolete‥ 」 ")
print(" |_||=L==H==||_|__|/ ")
print(" ")
print(" (ASCII art by ")
print(" Jan Foerster) ")
print(" ")
print(r" ________________ ")
print(r" _/_______________/| ")
print(r" /___________/___//|| PRET | Printer Exploitation Toolkit v0.40")
print(r" |=== |----| || by Jens Mueller <jens.a.mueller@rub.de> ")
print(r" | | ô| || ")
print(r" |___________| ô| || ")
print(r" | ||/.´---.|| | || 「 pentesting tool that made ")
print(r" |-||/_____\||-. | |´ dumpster diving obsolete‥ 」 ")
print(r" |_||=L==H==||_|__|/ ")
print(r" ")
print(r" (ASCII art by ")
print(r" Jan Foerster) ")
print(r" ")

# ----------------------------------------------------------------------

Expand Down
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
requests
colorama
win_unicode_console
pysnmp-lextudio==5.0.31
pyasn1==0.6.0
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This particular version requirements and one above was the key insight that made discovery work for me. Thank you!

39 changes: 39 additions & 0 deletions setup-venv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash

create_venv() {
command=$1
echo "Attempting to create virtual environment with $command..."
if $command -m venv .venv; then
source .venv/bin/activate
echo "Virtual environment created and activated with $command"
return 0
else
echo "Failed to create virtual environment with $command"
return 1
fi
}

if create_venv python; then
echo "Virtual environment created with python"
elif create_venv python3; then
echo "Virtual environment created with python3"
else
echo "Failed to create virtual environment with both python and python3"
exit 1
fi

if [ -z "$VIRTUAL_ENV" ]; then
echo "Not inside a virtual environment. Exiting..."
exit 1
else
echo "Inside a virtual environment. Proceeding..."
fi

pip install --upgrade pip

if [ -f requirements.txt ]; then
pip install -r requirements.txt
else
echo "requirements.txt not found"
exit 1
fi
2 changes: 2 additions & 0 deletions uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
sudo sudo rm /usr/local/bin/pret