by cookiengineer · 1y ago · 0 comments
The reason Go got so popular is not because of its type system, but because it also has a mode of programming "good enough" prototypes.
Python for exploit development is also great due to the gdb fork that can generate python payloads, offsets etc, but it sucks for deployment on targets.
If I would compare the three language choices I don't see why anyone would choose Rust over the other two in terms of efficiency and not having to fight the language. I don't even know whether it would be possible to write an exploit that overflows something in an external ABI binary in Rust without sacrificing everything that Rust stands for. After all, the binary would have to be statically linked for deployment, have to support invalid types, have to support invalid control flows etc.
On the other hand, in Go that's what CGo is made for. The VM and GC in Go doesn't care about what CGo does.
Edit: nevermind, the only example that is using Rust for this type of exploits is a sudo cli argument exploit, lol. I would have expected a little more than a char array generator that's using the FFI package. [1]
[1] https://github.com/skerkour/black-hat-rust/blob/main/ch_07/e...
You can Grug program in any language. Including Rust.
Just clone, Arc, and unwrap everything.
The reason why Go got popular is:
A) It's backed by Google (this is essential, there are many languages simpler/easier than it)
B) It's easy to pickup
The real reason Go is a success is the Go team, and engineering prowess they brought to the table.
Go is the language where people get shit done; now, Rust may be "the most loved language" or whatever, but the overwhelming success of Go as a programming platform (which is Rust community is supposedly obsessed with) cannot be attributed to anything else but engineering reasons. People like it. Why do they like it? Because it's easy to use, gets out the way, and it gets the job done. You find a library on Github, read the godoc, and you're literally seconds away from incorporating it in your program. This is not something you can get by accident, by means of investment, or otherwise by making bad design decisions.
The only other project that comes close to what you can do with Go when it comes to mutating binaries is in my opinion the APE/cosmopolitan ecosystem. But those binaries tend to get flagged immediately because there's no major software that's being used that requires APE binaries to run.
On the other hand, the static parts of any Go binary (the head/runtime part) can't be flagged because of so many devops tools rely on Go binaries to work. There was the Ebowla incident in 2016, where all go binaries (including docker) were flagged as malware because the static parts were added as yara rules in Kaspersky and other Antivirus tools. They had to revert those changes after a week.
Why would you fight Rust? It is decent for prototyping.
I used to steer clear of Rust for a lot of problems because of its complexity, now I use it for almost everything and it’s great