Code python - Get cookie facebook trong ldplayer
![]() |
| Code python - Get cookie facebook trong ldplayer |
+ CODE:
from adbutils import adb
import time, subprocess, os
for d in adb.device_list():
tb = d.serial
subprocess.call("adb -s "+tb+" pull data/data/com.facebook.katana/app_light_prefs/com.facebook.katana/authentication Data/"+tb+".dat")
time.sleep(5)
file = open("Data/"+tb+".dat", "r")
doc_file = file.read()
if (doc_file.find('uid') != -1):
#get uid
xvv = doc_file.split(f"name", 5)
uid1 = xvv[1].find('uid')
uid2 = xvv[1].find('session_key')
uid_get = xvv[1][uid1+5:uid2-3]
#get cookie
xs1 = xvv[3].find('value')
xs2 = xvv[3].find('expires')
xs_get = xvv[3][xs1+8:xs2-3]
fr1 = xvv[4].find('value')
fr2 = xvv[4].find('expires')
fr_get = xvv[4][fr1+8:fr2-3]
datr1 = xvv[5].find('value')
datr2 = xvv[5].find('expires')
datr_get = xvv[5][datr1+8:datr2-3]
cookie = 'c_user=' + str(uid_get) + ';xs=' + str(xs_get) + ';fr=' + str(fr_get) + ';datr=' + str(datr_get)
#get token
tok1 = xvv[0].find('access_token')
tok2 = xvv[0].find('analytics_claim')
token_get = xvv[0][tok1+14:tok2-6]
#luu data
fb_ok= open("Data/nvr-full.txt","a")
fb_ok.write(str(uid_get) + '| pass |' + str(cookie) + '|' + str(token_get) + '\n')
fb_ok.close()
file.close()
os.remove("Data/"+tb+".dat")
print("done")
