r/Python • • 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

1.1k Upvotes

220 comments sorted by

View all comments

96

u/novel_yet_trivial Mar 07 '17

I'd be a lot more surprised if they didn't.

15

u/[deleted] Mar 07 '17

Really? There are plenty of good reasons to use Python, but there are plenty of other good tools out there too with more or less equal reasons to use them.

17

u/zynix Cpt. Code Monkey & Internet of tomorrow Mar 07 '17

Quicker to iterate and then optimize with c/c++ as needed.

6

u/[deleted] Mar 08 '17

Sure, and that's a valid and common use of Python. I was just being pedantic and challenging the statement "I'd be surprised if they're not using it."

You can iterate quickly with dozens of languages and then optimize with C or C++. Python is a great choice, but not so unquestionably ahead of all possible competition that it would be surprising if they picked something else.

7

u/Ph0X Mar 08 '17

Yep, check out any CTF event, it's full of Python. It's the perfect tool for trying a lot of crazy ideas very rapidly and prototype.

6

u/JackOhBlades Mar 08 '17 edited Mar 08 '17

False. I iterate fast using C89 and optimise with Brainfuck as needed. ;)

66

u/novel_yet_trivial Mar 07 '17

I agree. I'd also be surprised if they didn't use java, c++, bash, etc...

This is a professional organization and I'd expect them to use the proper tool for every job.

176

u/[deleted] Mar 07 '17

This is a professional organization and I'd expect them to use the proper tool for every job.

import waterboarding

183

u/JohnLocksTheKey Mar 07 '17 edited Mar 08 '17

ImportError: No module named waterboarding.

# damn it! I always forget...

from Warcrimes import waterboarding

...

69

u/SteveDougson Mar 08 '17

from WarCrimes import waterboarding as enhanced_interrogation

21

u/stevarino Mar 07 '17

Unless you're using Python 3, in which case you need to specify the war_crimes library.

9

u/avball Mar 08 '17

PEP-8 would like a space after your hash.

6

u/JohnLocksTheKey Mar 08 '17 edited Mar 08 '17

That was actually bugging me all day!! Fine, I'll correct it...

EDIT: I was hoping no one would notice

1

u/asdfkjasdhkasd requests, bs4, flask Mar 08 '17

pip install waterboarding

→ More replies (5)

0

u/[deleted] Mar 07 '17

[deleted]

18

u/brtt3000 Mar 07 '17

Guantanamo started as a PHP hacker camp.

7

u/SchwarzerKaffee Mar 08 '17

The UN has declared that forcing people to code in PHP is a form of torture.

5

u/toyg Mar 07 '17

you forgot from rendition

3

u/Ph0X Mar 08 '17

"proper", somehow Python isn't proper?

If you go to any CTF event, you'll find Python everywhere. Exploring binaries and testing exploits is a very interactive process, which is why Python is the perfect fit. You want to try a lot of different approaches and prototype very rapidly.

You don't want to spend an hour just to see what you made is useless. Python is the perfect tool for quickly trying crazy ideas and see what works.

1

u/k10_ftw Mar 08 '17

Professional? Nope. Government!

0

u/[deleted] Mar 08 '17

Nope. Criminal!

1

u/k10_ftw Mar 08 '17

Except nothing the government does is considered illegal by the government.

-12

u/[deleted] Mar 07 '17

It's cuz OP only recognized .py file extension as "code". They use everything

4

u/desmoulinmichel Mar 08 '17

Yeah but Python is kinda the default tool in forensic and penetration testing.

2

u/[deleted] Mar 08 '17

Good point. I had assumed the CIA would prefer to make and use their own tools. But it makes as much sense for them to take open source tools and improve on them as it does for anyone else.

→ More replies (1)