forked from sonya75/pooky-bypass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pooky.py
62 lines (57 loc) · 2.09 KB
/
pooky.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
from Crypto.Cipher import AES
import random,time,os
def decwithiv(key,data,iv):
m=AES.new(key,AES.MODE_ECB)
data=m.decrypt(data)
data="".join([chr(ord(data[i])^iv[i]) for i in range(0,16)])
return data
def decrypt(u):
u=u.decode('hex')
iv=[ord(u[i]) for i in range(0,16)]
u=u[16:]
key='\xf2 \xc2k\x92\xa0!\xaa\xaf\x86(\x0c\xb3\x9d\xeev\x1eu\xef\xa8\xa1\xe2NP\xd3i\xe1\x1d7\xc9\xd1P'
j=0
dat=""
while j<len(u):
d=decwithiv(key,u[j:(j+16)],iv)
dat+=d
iv=[ord(u[j+i]) for i in range(0,16)]
j+=16
return dat
# The last 2 functions are for decrypting the hex encoded data from any cookie or the bogus post data.
def aeswithiv(key,data,iv):
m=AES.new(key,AES.MODE_ECB)
dat="".join([chr(ord(data[i])^iv[i]) for i in range(0,16)])
return m.encrypt(dat)
def encrypt(u,iv):
pad=16-(len(u)%16)
u+=(chr(pad)*pad)
key='\xf2 \xc2k\x92\xa0!\xaa\xaf\x86(\x0c\xb3\x9d\xeev\x1eu\xef\xa8\xa1\xe2NP\xd3i\xe1\x1d7\xc9\xd1P'
j=0
dat=""
while j<len(u):
d=aeswithiv(key,u[j:(j+16)],iv)
dat+=d
j+=16
iv=[ord(d[i]) for i in range(0,16)]
return ("".join(chr(s) for s in iv)+dat).encode('hex')
def generate_cookies():
cookies={}
l=[239, 222, 190, 173]
random.shuffle(l)
k="".join(chr(u) for u in l)
items=[("pooky_telemetry",45),("pooky_recaptcha",87),("pooky_recaptcha_coherence",40),("pooky_data",195),("pooky_settings",200)]
item=random.choice(items)
cookies["pooky_electric"]=encrypt(chr(item[1]),[ord(j) for j in os.urandom(16)])
for p,q in items:
if p!=item[0]:
cookies[p]=encrypt("".join(chr(random.randint(1,199)) for i in range(0,16)),[ord(j) for j in os.urandom(16)])
else:
cookies[p]=encrypt("".join(chr(s) for s in l),[ord(j) for j in os.urandom(16)])
x=str(int(time.time()*1000))
y=""
for p in x:
y+=str(random.randint(0,8))
y+=p
cookies["pooky_mouse"]=encrypt(y.decode('hex'),[ord(j) for j in os.urandom(16)])
return cookies