r/Python • u/ikkebr • Mar 07 '17
CIA uses Python (a lot)
From the latest Vault 7 leaks from Wikileaks, we can see that CIA uses a lot of Python in its secret hacking tools.
Most notably in the Assassin, Caterpillar, MagicViking and Hornet projects.
Unfortunatelly, no files from these projects have been released yet. But if you look at the dump that was released, there are plenty of .py files, and even PIL is included.
There are even Coding Conventions: https://wikileaks.org/ciav7p1/cms/page_26607631.html
You can see more Python-related stuff here: https://search.wikileaks.org/?query=python&exact_phrase=&any_of=&exclude_words=&document_date_start=&document_date_end=&released_date_start=&released_date_end=&publication_type%5B%5D=51&new_search=False&order_by=most_relevant#results
17
u/cdrootrmdashrfstar Mar 08 '17 edited Mar 08 '17
I'm currently enrolled in an undergrad practical fundamentals of cybersecurity course at my uni, and last week, we used angr to script what we'd normally use gdb for in what's called a "capture the flag" assignment.
The creator of the binary will hide away a specific string, like "flag{th1s_1$_th3_fl4g}", purposefully deep within the binary and only obtainable (normally) through some modification to the execution order of the binary.
Originally, we learned to use the GNU debugger GDB for many weeks of CTF assignments, but last week we used Angr to script a way to explore many, many paths of execution in a program. Through adding constraints to inputs and explicting marking some parts of the binary as "avoid", angr would eventually navigate it's way to the end of execution (and hopefully result in a flag!) through some sort of either statistical model (maybe similar to sqlmap?) or through simply brute forcing all possible routes of execution. It's a very complex tool with lots of depth, and I've only really scratched the surface.
We might be doing more of this in the later weeks, but this week moving onto forensics, buffer overflow attacks, shellcode, and circumventing stack protections by compilers. In relation to python, we're using a library called pwntools (in addition to the obvious and incredibly useful set of tools provided by Linux and GNU).