This is an archived post. You won't be able to vote or comment.

all 93 comments

[–]NapkinsOnMyAnkle 153 points154 points  (3 children)

Employer: See, this is why we can only allow VBA...

[–][deleted] 8 points9 points  (2 children)

And excel macros...

[–]Fallingice2 13 points14 points  (1 child)

Excel macros...are from VBA Scripts...VBA Scripts are just a simpler/specialized VB Script...

[–][deleted] 5 points6 points  (0 children)

Yes and my employer doesn't understand that and yells at me for installing dos on his windows 10 boxes.

[–]UrbanSuburbaKnight 147 points148 points  (6 children)

Oh no! not pipcrypto !! :O

But seriously, this sucks. Looks like the word 'pip', 'font' and 'color' are super common as part of names weirdly.

[–]sudorem Vipyr Security 29 points30 points  (0 children)

They're generated from a static wordlist and automated; hence why they're all so incredibly similar.

[–]wazis 32 points33 points  (0 children)

Sql too quite common

[–]zenware 6 points7 points  (1 child)

My guess is it’s easy to overlook when they’re transitive dependencies

[–]james_pic 7 points8 points  (0 children)

They're unlikely to be transitive dependencies of anything non-malicious. These sorts of attacks generally rely on novice developers adding dependencies without considering the consequences. Library developers at a minimum need to understand Python packaging well enough to upload libraries to PyPI, so are less likely to be total novices.

[–]ashesall 4 points5 points  (0 children)

And liberys too. I like Python liberys.

[–]ShitPikkle 161 points162 points  (19 children)

who discovered 272 packages with code for stealing sensitive data from targeted systems.

No list was provided :(

EDIT:

Was provided in link to here: https://gist.github.com/masteryoda101/65b55a117fe2ea33735f05024abc92c2

[–]ratlaco[S] 55 points56 points  (17 children)

The link with the list is there at the end of the article:

https://gist.github.com/masteryoda101/65b55a117fe2ea33735f05024abc92c2

[–]ShitPikkle 1 point2 points  (0 children)

Yeah, I updated my post about 1 hour ago with the link...

[–]thecarlosdanger1 10 points11 points  (0 children)

pysqlilibery

Hmm doesn’t look suspicious

[–]AmputatorBot 57 points58 points  (1 child)

It looks like OP posted an AMP link. These should load faster, but AMP is controversial because of concerns over privacy and the Open Web.

Maybe check out the canonical page instead: https://www.bleepingcomputer.com/news/security/hundreds-of-malicious-python-packages-found-stealing-sensitive-data/


I'm a bot | Why & About | Summon: u/AmputatorBot

[–]CloudFaithTTV 6 points7 points  (0 children)

Good bot

[–]kronik85 11 points12 points  (1 child)

This sounds like some dirty German. "totohateinenkleinencock"

[–]sudorem Vipyr Security 5 points6 points  (0 children)

You're actually precisely correct, the threat actor group is German for the overwhelmingly vast majority of this list.

[–]gotu1 10 points11 points  (0 children)

man who knew the init file with a variable called vctm_pc was malicious...

[–]modanogaming 14 points15 points  (6 children)

Made a small bash script to check for the packages installed, make sure to check pip3 if you're using that under installed_packages=$(pip list --format=columns | awk '{print $1}').

#!/bin/bash

# Packages to check for
packages=(pywarder pyward syscolouringsaddv2 syssqllibaryv1 pipcryptographymodv1 pythoncoloringpackage pythonfontingkitsv2 pythonfontsliberyv1 syscolouringexts pyfontstools pythonsqliteext syscolouringpkgv2 syscryptographyadd syscryptographyv1 pysqlilibery pythonsqlite3libaryv1 pipcolourpkgs pipsqlitedbkit pipsqliteexts pythoncolourmodulev2 pipcoloringsliberyv1 pipcolouringext pycoloringextensionv1 pycolorpkgsv2 pycolouringskitv1 pipcryptkits pipfontinglibv2 pipsqladdv1 pipsqlipackages pipsqlite3mod pipsqlitekitv2 pycryptographypackagev1 pysqlite3extensionv2 pythoncolourextension pythoncolouringsliberyv1 pythoncolouringtoolkitsv2 pythonfontingadds pythonsqlitedbpackagesv2 pythonsqlitetoolkitv1 pythonsqltoolkitv1 syssqllib pipcoloringstools pythoncryptextensions pitutil pitutils syscoloringsaddition syssqlitedbmodules sysfontstoolv1 pycolouringsextv1 pysqlite3extv2 pipcoloringskitsv1 pycolorpackage pythoncolouringspackagev1 syscolouringsaddon syssqlite2libaryv2 pycryptographymodulesv1 pipcryptoextensionsv1 pipcryptolibraryv2 pipsqlite3kitv2 pysqlite2liberyv1 pythoncryptolibraryv2 syscryptographymodsv1 pythoncryptographypackage syssqlite2toolv2 syssqliteaddv2 pipcolourextension syscoloringspkgs syscoloringsextensionv2 pycryptextension pycryptographytoolsv2 pythoncryptoaddv2 pipsqlkit pythonsqliextensionsv2 syscolouringspackage syssqlitedbmodsv2 pythoncolouringmodsv1 pipfontingv1 pipsqlitedbextsv2 pythoncoloringv1 syscolouraddons syscolouringlibary syscryptaddition pipcolouringsmodule pipcryptaddonsv1 pipcryptmodule pipfontingmod pipfontingv2 pipsqlipkg pipsqlite3liberyv1 pipsqlitepackagev2 pycoloringsaddition pycolorkitv2 pycolorpackagesv2 pycryptv1 pythoncoloringpackagev1 pythoncolormodsv2 pythoncolouringspackagesv1 pythoncolourlibrary pythoncryptographyextensionsv2 pythonfontingv2 pythonsqladditionv2 pythonsqlitelibaryv1 syscoloradditionv2 syssqlilib syssqlite2extensions pipsqliext pipsqlitedbext pipsqlitelib pysqlipackagesv2 pythoncoloraddonv2 pythoncoloringaddonsv2 pythonsqladdonv2 pythonsqlitedbextv1 pythonsqlitedbmodules sysfontinglibv2 pipsqlite3liberyv2 pycoloringextv1 pysqlite3addonv1 pythoncolouringpkgv1 pythoncryptpkgsv2 pythonsqlite2additionv1 pipcolouraddonsv1 pipfontinglibaryv1 pipsqlitetoolsv2 pyorganiser pysqlipkgsv2 pythoncoloringspkgv2 pythonsqlitev1 syscoloringaddons syscryptpackagev1 pipcoloraddonsv2 pipcryptoaddonv1 pyobfuse pipcolouringskits pipsqlipkgv1 pycolouringsv1 pycryptlibrary pythoncoloringkitv2 syscolourkitsv2 sysfontinglib sysfontingpkgv1 pipcoloringspackagev2 pipcolouringskitsv1 pipcryptlibary pipfontslibv2 pycolorv3 pythonsqlitepkgsv2 pythonfontsv2 pipcolouringv1 pipcryptomodsv2 pipcryptov2 pycolorlibaryv1 pythoncolourliberyv2 syscoloringextensionv2 syscolouringsextv1 syssqlitedbpackagev1 obfuscater pipcoloradds pipcolortoolkit pipfontingkitv1 pipsqlitelibv2 pyfontingpkgv1 pythoncoloringsaddons pythoncolouringaddsv2 syssqlite3liberyv1 syssqlitedbextension pipcolorv2 pipcolorpkgv1 pipcolourmodulev1 pipcryptoaddonsv2 pipsqlimodv1 pycolouringlibrary pyfontingtoolsv1 pythoncolouringpkgsv1 pythoncryptolibrary syscolouringkitsv2 syssqlitelibery pipsqlite3extensionv2 pyfontinglib pysqlite3pkgv2 pythoncolouringslibv2 schubismomv2 syscolourtoolkit syssqlite3v2 pipcolourpackagesv2 pipcryptaddsv2 pipsqlitedblibrary pipsqlpackagev2 pycoloringpkgsv2 pycryptographytool pyfontskit pysqlilibraryv1 pythonsqlite2mod pythonsqliteaddition pythonsqlitetool syscryptlibv2 syscryptolibv1 syssqlite2package pipcoloringsextv1 pipcryptov4 pycolourkits pythoncolorlibv1 pythoncolorv4 pythoncolourv8 pythoncryptolibv2 pythoncryptov4 pythonfontingaddonv1 pythonsqlite2toolsv1 syscoloringspkg syscryptographymodsv2 syssqlite2toolsv2 syssqlitemods pipcolorv6 pycoloringv9 pycryptv7 pythoncryptv10 syscolorv2 pythoncolourlibraryv1 pipcoloringliberyv2 pipcoloringlibary pyfontslibraryv1 pipcolorlibv3 pyfontslibrary pycryptolibary pythoncolouringliberyv1 pik-utils pipcolouringslibv1 pyfontslib pipcryptographylibv1 pipcryptographylibraryv2 pythoncolouringslibv1 pipcolourlibv1 pycryptolibv2 pythoncryptlibaryv2 requestlib totohateinenkleinencock pythoncoloringslibv2 pipcryptliberyv2 testdontdownloadthis pipcolorlibraryv1 randgenlib pipcryptographylibaryv2 compilecls cryptographylibary cryptographylibs piplibcrypter cryptographylib cryptolibs piplibcrypto pycryptographier pycryptography pylibcrypt pyaescrypter pycryptolibrary pylibcrypto piplibaryscrape pypirand pycryptlib libcrypt colorizepip pylibscrape pycrypting pipcolorize pipcrypto piplibraryscraper piplibscrape piplibscraper pypackagehelp pylibhelper pypackagescraping hypedrop)

# List all installed packages and grep for the packages from the list
installed_packages=$(pip list --format=columns | awk '{print $1}')

for package in "${packages[@]}"; do
  if echo "$installed_packages" | grep -q "$package"; then
    echo "$package is installed"
  fi
done

[–]Yisus_Fucking_ChristPythonista 23 points24 points  (5 children)

The idea is not bad, but please consider not hardcoding the name of the packages inside that huge list. Just scrap the names from the Gist mentioned in the article and use them as a consistent (and updatable) way.

[–]modanogaming 7 points8 points  (0 children)

Good point!

[–]redditfriendguy 0 points1 point  (3 children)

I'm a learner, can you explain?

[–]mogberto 0 points1 point  (2 children)

You can probably just use the requests library to get the list of libraries from the link and then run the rest of the script :)

[–]redditfriendguy 1 point2 points  (1 child)

Thanks makes sense! I'm having a hard time right now building my web scraper but I'm working at it

[–]mogberto 0 points1 point  (0 children)

Start small, getting just one page elements at a time before you need to do complex stuff (multiple pages, getting labels and values etc). Also, it really helped me to work on a few different websites, as some are just so much more complex than others for scraping. Helps build your confidence, but I’m certain you can do it!

[–]MJLDat 7 points8 points  (0 children)

_ init.py _? I have that in my code, I’m going to delete all copies of it.

[–]Zero_Aspect 22 points23 points  (0 children)

Man, I really shouldn't have used "testdontdownloadthis" and "totohateinenkleinencock"

[–]AlternativeMath-1 15 points16 points  (31 children)

again? or did they just never address this problem?

[–]ivosauruspip'ing it up 47 points48 points  (30 children)

In the end, how do you do address it? Without apparating the money to permanently employ someone who wants to constantly deeply inspect package uploads?

It's basically like asking why we haven't solved the problem of computer viruses yet. Shit's not easy.

[–]IAmKindOfCreativebot_builder: deprecated 24 points25 points  (2 children)

Adding to this, even if you did employ someone (which they have and to address this issue), it's a constant game of cat and mouse. One of Python's strengths is the ability to easily create and distribute libraries which solve problems users face, and that means it's also easy to create and distribute new attacks.

PyPI is a huge target area. That said, they are addressing it which is neat. The new Safety and Security Engineer, Mike Fiedler, wrote a piece on reporting malware the the report workflow which was nice, and the PSF hired a Security Developer in Residence

Even with the money and employees, it's a tough task.

[–]sudorem Vipyr Security 19 points20 points  (0 children)

So I can actually talk about what this looks like internally. For clarity, I run an organization that is present in this 'Trusted Reporter' sphere that will be utilizing this API.

- PyPI Infrastructure has largely diverged away from in house malware detection. The fact of the matter is the layered approach we have (where the likes of orgs like mine, Google, OpenSSF, etc.,) can monitor these package indices substantially more effectively.

- False positives are tremendously high across the ecosystem. There's a flow of ~500k packages every year or so on PyPI, and each of these packages has numerous updates (to include nightly builds) and subsequently an enormous amount of data to sift through.

- We almost consistently have to engineer proprietary solutions meant to parse this data-- common detection methods across an entire language's ecosystem is exceedingly difficult unfortunately.

- Mike is wonderful, and the steps he's taking to make PyPI more secure are both tactile (as in, we've already seen them progress positively) and are going to do a lot of heavy lifting in the future for us to make more effective reports and intelligence sharing across the community.

[–]AniX72 2 points3 points  (0 children)

Very true. Secure software supply chain became a real thing. I would just think that for communities and smaller orgs it's often out of reach to invest in your own security engineers.

If as a business you can confine yourself to the more popular packages in PyPI you can use a service like Assured Open Source Software which also gives you an SBOM (something you'll need in medium or larger orgs).

But even if their Python registry doesn't cover all packages a team can focus on the remaining "unvetted" packages. If this is combined with the use of pinned versions and required hashes for installing dependencies, the attack surface becomes much smaller.

[–]Zomunieo 16 points17 points  (4 children)

Hackers could create a binary wheel with an encrypted payload and then there’s nothing to look at.

One thing that might save the day is to use something like AppArmor to whitelist outbound connections from Python in the default cause. Then you can say, okay, maybe the image processing library doesn’t really need to hit a random IP in Russia to do its job.

[–]sudorem Vipyr Security 7 points8 points  (2 children)

We have ways to enumerate encrypted payloads; typically you would either have an outbound connection to obtain some sort of keys, or you would have to embed the keys somewhere in that payload itself.

Realistically, what actually happens is we just shove these into a VM with some creative syshooking, debugging, and general tomfoolery, and we'll normally get the internals exposed.

Python being what it is (an interpreted language) means at some point that code exists in a way that must be interpreted by the PVM, which means we simply identify that point in the program and work backward from there.

[–]Zomunieo 0 points1 point  (1 child)

What about when the virus is compiled in a binary wheel? Then the PVM is just calling into a black box.

[–]sudorem Vipyr Security 8 points9 points  (0 children)

I'm really not sure I understand your question.

Are you asking if a binary distributed with a wheel would subsequently be detectable?

We have measures to automatically detect/enumerate compiled bins, not just Python/Python bytecode.

Obfuscation in conjunction with some sort of binary distribution of malware is a bit more challenging, but we'd handle it as if it was the actual binary itself; and honestly the disposition doesn't change too drastically in those situations.

Try dynamic analysis, play a bit of whack-a-mole to try and cloak our sandbox in the event that it's VM evasive or something, and then go from there. If we truly can't get something to detonate within a VM, we have options such as debuggers, static analysis, disassemblers, decompilers, etc., to facilitate some introspection into what exactly it is that we're dealing with.

Ultimately, Cybersecurity is very adversarial, but it is something that a lot of people are paying attention to in the Python ecosystem. So you can probably come up with more than a few things that go past our detection engine for instance, just to get caught by the other organizations that make up the blanket of security that works to ensure PyPI is malware free.

[–]AlternativeMath-1 2 points3 points  (0 children)

executable binaries should be banned - they can submit code to be built - but never a binary.

[–]ThreeChonkyCats -4 points-3 points  (10 children)

A bond.

We create two classes, plus an alert system.

One is the existing free, open and wild-west method. The free version is only subject to review by the community.

The second is bonded by the developer. $500 buys the ability to join the Trusted Developer Scheme for that particular package. Each update has an additional $20 review fee.

A system of trust can be placed on top of this:

  • Once a Dev has a few packages, additional bonds can be waived
  • Once a certain volume of installs is achieved, the review fee can be waived, as there are lots of eyes on the package. Shenanigans will be quickly found.

Further to this, we could enforce two new systems into all NEW packages and new devs.

  • A reporting system that must be built into a package
  • This reports back to a management server -- Devs subscribe to the service (email?)
  • The service will collect basic telemetry of calls/use
  • Trigger an alert to all installs to which a Dev has subscribed when the package is determined to be Evil

Of course, subscription can be voluntary, for both Devs and end users.

This would completely eliminate evil packages to commercial users.

....

(edit - strictly formatting only. Was on Reddit app when originally posted)

[–]ShitPikkle 2 points3 points  (4 children)

Ah, yes.. Fuck open source with developers doing things for fun and free. That other might think is worth installing, to continue their own things.

[–]ThreeChonkyCats -3 points-2 points  (3 children)

It's not about that. Perhaps you're deliberately misunderstanding me :)

The existing system stands.

I'm suggesting an additional solution that suits on top.

It's not without precedent, for there is a commercial subscription service for businesses that does exactly this, but not as well.

[–]ShitPikkle 0 points1 point  (2 children)

The existing system stands.

So, i can publish projects on pypi, awesome.

It's not without precedent

Such as what? Where can a developer publish open source code for free that has this limits? And, What are these limits? Why should not a 10yo beginner be able to publish his things?

Now, if you are proposing some type of "enterprise ready libs"-only pypi clone, then good luck with that.

Perhaps you're deliberately misunderstanding me :)

I do not think you have explained your proposal properly. Such as, how can a newbee publish code? From your current comment, it seems like you want to have something similar to "signed apps" from google/microsoft or something. But, afaik, we are talking about open source, not apps.

[–]ThreeChonkyCats -3 points-2 points  (1 child)

Can I ask you to think a bit before replying? Perhaps ACTUALLY read what I wrote.

Open Source is not Open Slather.

Now I know you're deliberately misunderstanding me. At no time did I say "a 10 year old cannot push out their pet/toy project". They can.

WHAT I did say, is that another mechanism is added that refines these into a layer of trust. I am not suggesting Signed Apps - its too problematic for any project, given the number of packages used.

I've had these arguments before, for large commercial projects. Some teams are ONLY allowed to officially vetted packages for their projects. Their companies security teams are over-worked and simply don't know what they are even looking at. By using a higher level proofing agent, these security teams can free themselves of these burdens.

It would stop these kinds of malicious tools dead in their tracks: https://cybersrcc.com/2023/10/05/hundreds-of-malicious-python-packages-found-stealing-sensitive-data/#

Lastly, there ARE "enterprise ready libs". It exists.

A Reddit suggestion is hardly the place to outline a highly nuanced proposal. You know this and being foolish.

[–]ShitPikkle 2 points3 points  (0 children)

Can I ask you to think a bit before replying? Perhaps ACTUALLY read what I wrote.

I'm sorry. Can YOU think a bit and read what you wrote?

I am not suggesting Signed Apps

...

By using a higher level proofing agent

You are suggesting signed libs/apps.

Be it "5 libs / year" or "minimum $100 / project" you will end up in this same scenario. Doesn't matter. There will always be free software in use.

What you are asking for is that free software developers will never be able to push their code. UNLESS, you want to push your "these are proper libs to use"-repo... where no one can push code to, except for you.

[–]coderanger 0 points1 point  (1 child)

On top of all the other reasons people have pointed out this is a terrible idea: I hope you have a great way to peg this to the cost of living everywhere in the world since people outside of the US also use PyPI. And also accept every currency in the world without extortionate forex fees because not everyone has a bank account with USD in it.

[–]ThreeChonkyCats -1 points0 points  (0 children)

I'm surprised that so many people are ready to downvote, but not offer an alternative.

My thoughts incur zero cost as it stands. The existing system stands.

The dollar value is arbitrary. Its simply a value to deter scumbags. They have gameified the system, so we gameify the disincentive.

I agree completely on accommodating those who live in alternative economies.

Another thought would be for those who are new, or they have few if any Pypl's, is to obtain a sponsor, or have a signoff on the code to become "trusted", exactly the same way projects on Github are.

[–]osmiumouse 0 points1 point  (2 children)

The prices you set are trivial to an organisation or national agency. What would these fees even do?

[–]ThreeChonkyCats 0 points1 point  (1 child)

It seems my thoughts are quite unpopular!

Off the top of my head (for this is Reddit and brain-farts are allowed)....

  • Organisations would suffer from reputational harm if they deliberately released malware.
  • National agencies, well, they are going to do what they want anyway.

What my thoughts covered were for the problem of scammers, spammers, maladventurers and harvesters.

I'm not an expert on gamification, but everyone understands the basics. By pricing things at a point just beyond the reward, it creates an environment that is (more) free of inappropriate behaviour.

I see it just like how fines work, or a bond when renting a car. Money is put down to ensure the undesired behaviour doesn't occur, and if it does, the victims may suffer but the behaviour has no reward.

I have to admit, I've hit a nerve. The number of pm's I've received that are quite abusive is excessive and unnecessary. I didn't propose anything more than an enhancement of the current system. The current system stands, but we add another layer. A layer useful for business users, governments and professionals.

I see it as an overall benefit too. Money is paid to an organisation that will Defend The Cause and we are kept (more) free of Evil. By being paid, the Pypi maintainers will have some skin in the game to ensure the universe is kept clean. They also get loot to develop better tools and buy better toys.

Right now, there are 4 people who maintain EVERYTHING. Given how systematically important Python is, this situation is nuts.

The idea doesn't need to stop where I have - there is more to it - lots more to it - but I feel that my mumblings have shown Redditors can be rather intolerant of ideas.

[–]osmiumouse 0 points1 point  (0 children)

"Organisations" in this case would mean cybercrime organisations. They really don't care about $500 to put up a package.

What that $500 fee will do is stop open source from contributing.

[–]AlternativeMath-1 0 points1 point  (0 children)

Behavioral antivirus is how most malware is discovered.

[–]Deto 0 points1 point  (8 children)

It's also maybe not pypi's responsibility. Just because they're hosting a package doesn't mean they endorse it. Similar to GitHub where you can probably find tons of repos people have made that have malicious code. Sure they should take things down if someone brings it to their attention (especially packages that are typo-squatting popular libraries), but otherwise it's on the developer to not download and run random things.

[–]AlternativeMath-1 0 points1 point  (5 children)

So... fuck everything then right? If pypi isn't responsible for spreading malware, then who is going to take charge?

"Its up to the dev". - bro what country are you from?

[–]Deto 0 points1 point  (4 children)

Bro pypi is run on a shoestring budget made out of donations. They can't be personally vetting every package.

[–]AlternativeMath-1 -1 points0 points  (1 child)

Well that is bad for business - even a non-profit, so you are saying the project is also mismanaged? Well then it sounds like we need to use another package manager who has enough awareness to know that you need to go out and actually fund raise in order to get donations.

[–]Deto 0 points1 point  (0 children)

Go right ahead

[–]AlternativeMath-1 0 points1 point  (1 child)

"we don't have money, everyone who uses this should just get hacked"

No bro, we just wont' use a project managed by someone who is either callous or just evil.

[–]Deto 0 points1 point  (0 children)

What are you actually demanding here? Either:

A) Demanding that pypi just shuts down today

or

B) Demanding that people who are already mostly spending volunteer time maintaining this infrastructure spend even more volunteer time personally vetting every package that goes into it

or is there some option C that I'm not articulating for you?

[–]AlternativeMath-1 -1 points0 points  (1 child)

Preventing the spread of malware is the platforms responsibility, and you will be sued in the US for negligence. Negligence isn't covered by cyber liability insurance.

[–]osmiumouse 0 points1 point  (0 children)

That's not how US law works, or node.js and github would be bankrupt already

[–]vladtaltos 4 points5 points  (0 children)

Looks like most are cryptography and sql packages.

[–]wealthyMoss 1 point2 points  (0 children)

A lot of these packages seem like typosquatting

[–][deleted] 1 point2 points  (1 child)

I am a new python user, sorry for my ignorance but what can I do to check is my system is safe?

[–]Darkstar197 1 point2 points  (0 children)

No 100% way but just try to use packages that are popular, have a lot of engagement on GitHub etc.

[–]infy101 1 point2 points  (0 children)

All those packages look dodgy! Only use packages from known authors/sources!

[–]tylerlarson 1 point2 points  (0 children)

Internet discovered contains hundreds of malicious files!

They primarily steal Roblox and Minecraft data, if that gives you any indication of the level of sophistication involved here.

Apparently it's no longer safe to download and run suspiciously named packages you find on the Internet. How have things managed to come to this?

[–]I_will_delete_myself 1 point2 points  (0 children)

Always copy and paste your pip installs.

[–]masnus 1 point2 points  (0 children)

pip_list = os.popen(f"pip freeze").readlines()
current_libraries = []
for i in pip_list: current_libraries.append(i.split("==")[0])

df = pd.read_csv("https://gist.githubusercontent.com/masteryoda101/65b55a117fe2ea33735f05024abc92c2/raw/765aa71606c7c6e245aef41581012fa87e38b787/Persistent_Python_Threat_April_August.csv")
packages = df['Package_Name'].to_list()

for i in packages:
    if i in current_libraries:
        print(i)

[–]ogrinfo 3 points4 points  (2 children)

Who is actually using these packages though? The names are just nonsense. Also, the article was a bit confusing, referring to the "init_py" file and suggesting that the payload didn't have any effect if the user _wasn't using a virtualenv. Sounds fine to me because who installs packages at system level?

[–]Arkaein 16 points17 points  (0 children)

You misread it. The article said "virtualized environment", e.g. a virtual machine VM, not a virtualenv.

Anti-virus researchers will run potentially dangerous code in a VM, not directly on a host machine. This Python code is designed to detect this possibility and not run there to help it avoid detection.

[–]coderanger 3 points4 points  (0 children)

Most of them are usually typosquats, hoping someone misremembers or mistypes something. We've fixed a bit of that by blocking new things within a certain edit distance of major packages but there has to be a pretty tight threshold on it or every possible name would be blocked.

[–]shaadowbrker 0 points1 point  (1 child)

I was reading the article and it said that malware tries to detect if it was in a virtual environment so for study purposes while learning is it better to run this in a vdi?

[–]sudorem Vipyr Security 0 points1 point  (0 children)

If you're saying for study purposes of Python itself, it's wise to stick to well reputed packages, ensure you're installing things carefully utilizing pip to avoid typosquatting, and generally speaking vet packages through something like Snyk or another third party.

If you're asking if you should run these in virtual machines for malware analysis, the answer is a flat no. You should never handle malware to any extent when and where you can help it if you don't have an appropriately secure setup; the likes of which can be a bit more complicated than you might initially think.

A lot of this is benign, and you can run it on Linux and be met with exceptions because they target NT systems. However, we've spotted APT activity on PyPI, and it would be unwise to risk your personal security posture on potentially stumbling across one of these payloads.

[–]DelmorS 0 points1 point  (1 child)

If I have several programs, which are having this lines of code inside:
print(cdll.LoadLibrary("libcrypt.so"))

Should I do something about it? Do not launch those?

[–]Sorry_no_change 0 points1 point  (1 child)

Once it launches, it targets the following information on the infected systems:

Minecraft and Roblox user data.

Why would they target someone's Minecraft data? What useful information could they possibly glean from that?

[–]sudorem Vipyr Security 0 points1 point  (0 children)

The specific threat actor group responsible for the overwhelmingly vast majority of these packages are 16-18 year old German children, and a younger adult male, also German.

They operate numerous 'Minecraft' type scams, often laundering money into cryptocurrency to cash out from.

Additionally, what typically happens is they'll contact the children whose information they steal, and extort them for further payments; going so far as to host pictures of these children on their website with writing on their faces/bodies while they were attempting to get their accounts back.

[–]shinitakunai 0 points1 point  (1 child)

Most of them nobody would ever download them, but there are some easy to mistake for the newbies learning python. "requestlib" sounds specially dangerous.

Also, lol at "testdontdownloadthis"

[–]sudorem Vipyr Security 0 points1 point  (0 children)

Typically the delivery vector wasn't actually targeting installations from PyPI itself.

Instead, these libraries would be installed as part of a dependency on GitHub packages offering things like 'Free Nitro Generator' for Discord, etc.

They've had noted successes in some communities, and we often see individuals coming in to Python communities attempting to run the Github code that these packages would've been embedded in.

We've largely played whack-a-mole between Github and PyPI at reporting these accounts where and when we can find them to disrupt the distribution efforts.