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

283

u/Frog_and_Toad Mar 07 '17

I'm ok with it as long as they are following PEP8.

84

u/ikkebr Mar 07 '17

They leaked the coding standards too

57

u/synae Mar 07 '17

As far as I can tell it's just a copy of Google's python style guide.

68

u/Eurynom0s Mar 08 '17

Wouldn't shock me, in a lot of classified or airgapped computing environments it's common to copy open literature websites/etc onto a local intranet so that people don't have to leave the room to use an unclassified computer to look something up constantly.

12

u/[deleted] Mar 08 '17

I know someone at $giantTechCompany who did this with internal wiki pages because his team managed the core infrastructure. If something is going wrong, having to rely on documents on a flash drive was a real worst scenario

20

u/manueslapera Mar 08 '17

didnt Google use 2 spaces instead of 4 for a long time?

9

u/DetN8 Mar 08 '17

Do they not anymore?

26

u/Fylwind Mar 08 '17

Just checked: it says 4 spaces now!

11

u/muad_dib Mar 08 '17 edited Jun 18 '23

Comment has been removed because /u/spez is a terrible person.

2

u/heybart Mar 09 '17

Don't be evil!

1

u/pm-me-big-boobies python-priest Aug 02 '17

How about three spaces??

→ More replies (11)

2

u/lengau Mar 08 '17

Their external style guide was changed to match more closely with PEP8 several years ago.

Internally I doubt they changed it.

0

u/[deleted] Mar 08 '17

[deleted]

3

u/k10_ftw Mar 08 '17 edited Mar 08 '17

I like the guy who suggests creating a database of which tools use which exploit to help tracking issues.

42

u/alcalde Mar 08 '17

Screw PEP 8. Now we need a PEP 007!

-38

u/wolf2600 Mar 07 '17

TABS NOT SPACES!!

165

u/can_dry Mar 07 '17

Indentation

Indent your code blocks with 4 spaces.

Never use tabs or mix tabs and spaces.

Sorry, you're just not CIA material.

10

u/[deleted] Mar 07 '17

Question from a not so experienced programmer: what's wrong with tabs?

62

u/nickbob00 Mar 07 '17 edited Jun 03 '25

cake physical direction wise fanatical march tap mountainous melodic station

This post was mass deleted and anonymized with Redact

18

u/DonaldPShimoda Mar 07 '17

The right answer is to use smart tabs, where you get a feature where your editor tab button makes 4 spaces in the file, but it works like a tab as far as you care.

Nah, I think it's much better to actually press the space bar the requisite number of times.

→ More replies (4)
→ More replies (3)
→ More replies (18)
→ More replies (1)
→ More replies (1)