forked from xianyucoder/Crack-JS
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
xianyucoder
committed
Aug 3, 2019
1 parent
d0c764f
commit b6bf8c1
Showing
4 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// 测试于20190803 | ||
|
||
window = {}; | ||
data2 = '__jsl_clearance=1564827478.776|0|' + (function () { | ||
var _c = [function (_e) { | ||
return _e | ||
}, function (_c) { | ||
return _c | ||
}, (function () { | ||
var _e = "http://www.66ip.cn/"; | ||
var _c = "http://"; | ||
_e = _e.substr(_c.length).toLowerCase(); | ||
return function (_c) { | ||
for (var _4 = 0; _4 < _c.length; _4++) { | ||
_c[_4] = _e.charAt(_c[_4]) | ||
} | ||
; | ||
return _c.join('') | ||
} | ||
})(), function (_e) { | ||
for (var _c = 0; _c < _e.length; _c++) { | ||
_e[_c] = parseInt(_e[_c]).toString(36) | ||
} | ||
; | ||
return _e.join('') | ||
}], | ||
_e = ['y2', [(-~[] - ~[] + []) + [-~[] - ~[] + ((-~~~[] << -~~~[]) << -~[])], [((-~~~[] << -~~~[]) ^ -~~~[])] + ((+[]) + [] + [])], 'S%', (-~[] - ~[] + []), 'BW', [[-~{}] + [-~[] - ~[] + ((-~~~[] << -~~~[]) << -~[])]], 'sSK', [+[~~{}, ~~{}] + [[]][0]][0].charAt(~~[]), 'R', [(-~[] - ~[] + []) + [-~[] - ~[] + (-~[] + [-~[] - ~[]]) / [-~[] - ~[]]]], 'J', [[-~{}] + ((+[]) + [] + [])], '4', [[-~{}] + (-~!!window.headless - ~[-~[] - ~[]] + [] + [])], '%2B', [(+!-[]) + [(+!/!/)] - ((+!-[]))], '%', (-~[] - ~[] + []), 'BiAC', [(-~!!window.headless - ~[-~[] - ~[]] + [] + []), [-~[] - ~[] + ((-~~~[] << -~~~[]) << -~[])]], 'U%', [((-~~~[] << -~~~[]) ^ -~~~[])], 'D']; | ||
for (var _4 = 0; _4 < _e.length; _4++) { | ||
_e[_4] = _c[[1, 3, 1, 0, 1, 3, 1, 0, 1, 3, 1, 3, 1, 3, 1, 0, 1, 0, 1, 2, 1, 0, 1][_4]](_e[_4]) | ||
} | ||
; | ||
return _e.join('') | ||
})() + ';Expires=Sat, 03-Aug-19 11:17:58 GMT;Path=/;' | ||
|
||
console.log(data2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import requests | ||
import execjs | ||
import re | ||
|
||
def process_cookies(): | ||
url_ = 'http://www.66ip.cn/areaindex_35/index.html' | ||
base_url = 'http://www.66ip.cn/' | ||
headers = { | ||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.17763", | ||
} | ||
res = requests.get(base_url, headers=headers) | ||
cookies = res.headers['Set-Cookie'] | ||
print(res.text) | ||
res = re.findall('<script>(.*?)</script', res.text)[0] | ||
js = res.replace('{eval(', '{var params_1 = (') | ||
print(js) | ||
js_1 = js.replace(chr(0), chr(32)) | ||
print(js_1) | ||
node = execjs.get() | ||
ctx = node.compile(js_1) | ||
bbb = ctx.eval('params_1') | ||
print('==================b', bbb) | ||
index1 = bbb.find("document.") | ||
index2 = bbb.find("};if((") | ||
print(index1, index2) | ||
js_temp_b = bbb[index1:index2].replace("document.cookie", "data2") | ||
other_param = 'window={};' + js_temp_b | ||
print(other_param) | ||
name = re.findall(r",\(function\(\){var (.*?)=document.createElement\('div'\)", other_param)[0] | ||
print(name) | ||
other_param = other_param.replace("document.createElement('div')", '"http://www.66ip.cn/"') | ||
print(other_param) | ||
other_param = re.sub(r"{}.innerHTML=.*;{}={}.firstChild.href;".format(name, name, name), '', other_param) | ||
print(other_param) | ||
other_param = other_param.replace("{}.match(/https?:\/\//)[0]".format(name), '"http://"') | ||
print(other_param) | ||
ctx = node.compile(other_param) | ||
ccc = ctx.eval('data2') | ||
print(ccc) | ||
cookies += ";" + ccc | ||
headers['Cookie'] = cookies | ||
res = requests.get(url_, headers=headers) | ||
if res.status_code == 200: | ||
res.encoding = res.apparent_encoding | ||
print(res.text) | ||
|
||
|
||
if __name__ == '__main__': | ||
process_cookies() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters