Skip to content

Instantly share code, notes, and snippets.

@non-descript
Created August 3, 2013 00:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save non-descript/6144567 to your computer and use it in GitHub Desktop.
Save non-descript/6144567 to your computer and use it in GitHub Desktop.
This will download all of the documents released by The Guardian and The Washington Post in exposure of NSA surveilance overreach. Run it in the directory you want to download to.
#! /bin/sh
# This will download all of the documents released by The Guardian and The Washington Post in exposure of NSA surveilance overreach. Run it in the directory you want to download to.
rootDir=$(eval pwd)
quality="normal" # guardian sources allow large, normal, small
get_docs () {
#Parameters
# $1: Directory Name
# $2: Page Count
# $3: Path To Doc (with the string 'XX' in place of number to increment)
cd $rootDir
mkdir $1
cd $1
for i in $(eval echo {1..$2});
do
path=$(eval make_path $3 $i)
curl -O $path
done
}
make_path () {
local toReplace="XX"
echo "$1" | sed "s/$toReplace/$2/g"
}
get_docs \
NSA_XKeyscore_2008 \
32 \
"http://s3.documentcloud.org/documents/743252/pages/nsa-pdfs-redacted-ed-pXX-$quality.gif"
echo "Training materials for the XKeyscore program detail how analysts can use it and other systems to mine enormous agency databases and develop intelligence from the web" >> Description.txt
get_docs \
NSA_Memo_proposing_broader_powers_2007 \
16 \
"https://s3.amazonaws.com/s3.documentcloud.org/documents/717974/pages/nsa-memo-pXX-$quality.gif"
echo "Correspondence involving attorney general Michael Mukasey in 2007 requesting permission for the NSA to expand its 'contact chains' deeper into Americans' email records" >> Description.txt
get_docs \
NSA_report_on_collection_under_Stellar_Wind \
51 \
"https://s3.amazonaws.com/s3.documentcloud.org/documents/719116/pages/doc03-pXX-$quality.gif"
echo "Top-secret draft report from 2009 by the NSA's inspector general shows development of 'collection of bulk internet metadata' under program launched under Bush" >> Description.txt
get_docs \
NSA_Procedures_used_to_target_non_US_persons \
9 \
"http://s3.documentcloud.org/documents/716633/pages/exhibit-a-pXX-$quality.gif"
echo "Top-secret documents show Fisa judges have signed off on broad orders allowing the NSA to make use of information 'inadvertently' collected from domestic US communications without a warrant" >> Description.txt
get_docs \
NSA_Procedures_to_minimize_collection_from_US_persons \
9 \
"https://s3.amazonaws.com/s3.documentcloud.org/documents/716634/pages/exhibit-b-pXX-$quality.gif"
echo "The documents detail the procedures the NSA is required to follow to target 'non-US persons' under its foreign intelligence powers – and what the agency does to minimize data collected on US citizens and residents" >> Description.txt
get_docs \
NSA_Boundless_Informant_Explanation \
3 \
"https://s3.amazonaws.com/s3.documentcloud.org/documents/710558/pages/doc01187620130608104422-pXX-$quality.gif"
echo "View the three-page explanation document, which showed the NSA collected almost 3 billion pieces of intelligence from US computer networks over a 30-day period ending in March" >> Description.txt
get_docs \
NSA_Boundless_Informant_Key_Slides \
4 \
"https://s3.amazonaws.com/s3.documentcloud.org/documents/710559/pages/doc01187820130608104742-pXX-$quality.gif"
echo "The top-secret Boundless Informant tool details and maps by country the voluminous amount of information it collects from computer and telephone networks" >> Description.txt
get_docs \
NSA_Verizon_FISA_Court_Order \
4 \
"http://s3.documentcloud.org/documents/709012/pages/verizon-pXX-$quality.gif"
echo "The US government is collecting the phone records of millions of US customers of Verizon under a top secret court order. Read the Foreign Intelligence Surveillance Court order" >> Description.txt
get_docs \
NSA_Prism_Overview \
9 \
"http://www.washingtonpost.com/wp-srv/special/politics/prism-collection-documents/images/prism-slide-XX.jpg"
echo "The top-secret PRISM program allows the U.S. intelligence community to gain access from nine Internet companies to a wide range of digital information, including e-mails and stored data, on foreign targets operating outside the United States. The program is court-approved but does not require individual warrants. Instead, it operates under a broader authorization from federal judges who oversee the use of the Foreign Intelligence Surveillance Act (FISA). Some documents describing the program were first released by The Washington Post on June 6. The newly released documents below give additional details about how the program operates, including the levels of review and supervisory control at the NSA and FBI. The documents also show how the program interacts with the Internet companies. These slides, annotated by The Post, represent a selection from the overall document, and certain portions are redacted." >> Description.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment