News for hackers. Stuff that matters.
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by belinder on Friday February 24, 2023 @03:51PM (#34929960)
How is the rust part relevant?
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by throwthere on Friday February 24, 2023 @03:52PM (#34929974)
Chatgpt recommended it for the upvotes.
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by wheelerof4te on Friday February 24, 2023 @04:01PM (#34930068)
"The most beloved programming language used to build and ship malware (PHOTO/VIDEO/NSFW)"
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by yabones on Friday February 24, 2023 @04:02PM (#34930084)
We like when malware is written in a memory-safe language.
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by dtgriscom on Friday February 24, 2023 @07:15PM (#34932178)
Encrypt my files, but please don't waste my RAM while you do so.
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by lost_tourist on Friday February 24, 2023 @10:12PM (#34933443)
"it's amazing what they were able to do with that old pentium linux server that someone forgot in the server room, so much damage! rust is truly the future"
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by sidlls on Friday February 24, 2023 @04:22PM (#34930329)
We should only refer to Rust when it's included in positive events? How is it not relevant here? It was used to build executables to inject, likely for malicious purposes. Given its newness and all the other hype around it, I'd say it's very relevant.
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by puffoflogic on Friday February 24, 2023 @09:13PM (#34933099)
Why not also be sure to mention what OS was used for the build, and what linker, and what file format, and what model of computer was used, and what its default ui language was set to? What is so special about programming language used that sets it apart from those other factors that could be mentioned?
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by muraiki on Friday February 24, 2023 @09:50PM (#34933328)
The use of Rust has particular implications for malware analysis: https://c3rb3ru5d3d53c.github.io/2022/08/malware-reversing-r...

So yes, it's relevant.

Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by puffoflogic on Friday February 24, 2023 @11:46PM (#34933989)
That article is nonsense and the author could not even complete it. It is buried in a shallow grave of irrelevance.
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by muraiki on Saturday February 25, 2023 @08:20AM (#34936459)
Here's an article from the SEI covering the problems with using Ghidra for malware analysis of Rust code. See "Binary Analysis Without Source Code" https://insights.sei.cmu.edu/blog/rust-vulnerability-analysi...
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by puffoflogic on Saturday February 25, 2023 @04:04PM (#34940460)
You cite yet another article which you clearly don't understand, and whose authors have questionable understanding themselves.

This article cites CVEs of a certain type, which were especially popular in the 2021 timeframe. These CVEs do not correspond to real vulnerabilities in real executables. Rather, they are reporting instances of rust programs violating the strictest possible interpretation of the rules of the rust language. For comparison, quite literally every single C program ever written would have to receive a CVE if C were judged by the same rules, because it isn't possible to write a C program which conforms to the standard as strictly as these Rust CVEs were requiring. CVEs of this nature are a bit of a meme in the rust community now, and no one takes them seriously as vulnerabilities. They are reporting ordinary, non-vulnerability bugs and should have been reported to issue trackers.

The whole discussion about layout order is completely irrelevant. When RE'ing unknown code you don't know the corresponding source anyways, so the one-to-many correspondence of source to layout is irrelevant. You are given the layout. You can always write a repr(C) which corresponds to it if you're trying to produce reversed source. This is no different than not knowing the original names of variables and having to supply your own.

The next objection is literally that rust does not use null-terminates strings, except the authors are so far out of their depth that they don't even identify this obvious root cause of their tools failing. Again, this has absolutely nothing to do with the reversibility of rust programs, except perhaps preventing some apparent script kiddies from figuring it out.

The authors do manage to struggle to shore, as it were, by the end of the article, and somehow they end up correctly identifying their tools and understanding and the root cause of their troubles, not Rust. I take it you didn't make it that far when you read it?

Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by timeon on Saturday February 25, 2023 @03:44AM (#34935036)
I hope you do not often feed your knowledge with shallow and manipulative content like this one.
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by muraiki on Saturday February 25, 2023 @08:14AM (#34936424)
Ok, here's a better article from CMU's SEI. See "Binary Analysis Without Source Code".

> In general, the layout used by the Rust compiler depends on other factors in memory, so even having two different structs with the exact same size fields does not guarantee that the two will use the same memory layout in the final executable. This could cause difficulty for automated tools that make assumptions about layout and sizes in memory based on the constraints imposed by C. To work around these differences and allow interoperability with C via a foreign function interface, Rust does allow a compiler macro, #[repr(C)] to be placed before a struct to tell the compiler to use the typical C layout. While this is useful, it means that any given program might mix and match representations for memory layout, causing further analysis difficulty. Rust also supports a few other types of layouts including a packed representation that ignores alignment.

> We can see some effects of the above discussion in simple binary-code analysis tools, including the Ghidra software reverse engineering tool suite... Loading the resulting executable into Ghidra 10.2 results in Ghidra incorrectly identifying it as gcc-produced code (instead of rustc, which is based on LLVM). Running Ghidra’s standard analysis and decompilation routine takes an uncharacteristically long time for such a small program, and reports errors in p-code analysis, indicating some error in representing the program in Ghidra’s intermediate representation. The built-in C decompiler then incorrectly attempts to decompile the p-code to a function with about a dozen local variables and proceeds to execute a wide range of pointer arithmetic and bit-level operations, all for this function which returns a reference to a string. Strings themselves are often easy to locate in a C-compiled program; Ghidra includes a string search feature, and even POSIX utilities, such as strings, can dump a list of strings from executables. However, in this case, both Ghidra and strings dump both of the "Hello, World" strings in this program as one long run-on string that runs into error message text.

https://insights.sei.cmu.edu/blog/rust-vulnerability-analysi...

Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by mftb on Friday February 24, 2023 @04:08PM (#34930169)
If a payload is native it's potentially more of a problem than a script. If the payload had been c or c++, I wouldn't have been surprised if they noted that either.
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by HL33tibCe7 on Friday February 24, 2023 @03:52PM (#34929980)
It’s unusual for malware.
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by j-krieger on Friday February 24, 2023 @04:30PM (#34930401)
Yes, but only for the time being. I‘ve recently published a paper on the topic. Rust and Golang are getting immensely popular with malware authors.
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by hoppla on Friday February 24, 2023 @05:24PM (#34931001)
I would love a link so I could read your paper.
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by arthurcolle on Friday February 24, 2023 @05:46PM (#34931252)
Same! Please share GP
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by Godel_unicode on Friday February 24, 2023 @05:31PM (#34931074)
I mean, not really? There’s a lot of legacy stuff written in other languages, but malware authors have realized that people are less skeptical of rust and are actively taking advantage of that fact.
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by baguettefurnace on Friday February 24, 2023 @04:03PM (#34930099)
just like if a tesla is involved in a car crash, headline must mention Tesla
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by butterNaN on Friday February 24, 2023 @04:52PM (#34930622)
Isn't that because sometimes the tesla software might be at fault?
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by baguettefurnace on Friday February 24, 2023 @07:33PM (#34932337)
The software is rarely at fault if you follow up on the stories. If every time a human driver crashed a car it was the lead story in whatever news you consume, you'd likely never drive.
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by hoppla on Friday February 24, 2023 @05:19PM (#34930946)
Because everywhere it’s used, it has to be explicitly mentioned, like clothing that use GoreTex™.
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by abeyer on Friday February 24, 2023 @06:21PM (#34931642)
The first rule of rust club is that you must talk about rust club.
Re:Aggressive Attack on PyPI Attempting to Deliver Rust Exec... by anon4242 on Friday February 24, 2023 @06:45PM (#34931904)
At least we know the malware wasn't produced in Switzerland, because if it were, it would've told us.