Skip to content

Commit

Permalink
更新ip66最新代码
Browse files Browse the repository at this point in the history
  • Loading branch information
xianyucoder committed Aug 3, 2019
1 parent d0c764f commit b6bf8c1
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 0 deletions.
Binary file modified 66ip/.DS_Store
Binary file not shown.
35 changes: 35 additions & 0 deletions 66ip/proxy_ip66_js/ip66_3.js
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)
49 changes: 49 additions & 0 deletions 66ip/proxy_ip66_py/ip66-0803.py
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()
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ JS解密案例
├── 66ip // -----66ip代理----
│   ├── ip66_1.js // 无cookie状态或cookie过期状态返回的js
│   ├── ip66_2.js // 解析页面返回的js中 生成cookie的js
│   ├── ip66_3.js // 解析页面返回的js中 生成cookie的js(测试于20190803)
│   ├── ip66.py // Python 版完整demo
│   ├── ip66-0803.py // Python 版完整demo(测试于20190803)
├── aqi // -----中国空气质量在线监测分析平台-----
│   ├── aqi.js // js加密逻辑
│   ├── aqi_spider.py // 中国空气质量在线监测分析平台爬取demo
Expand Down

0 comments on commit b6bf8c1

Please sign in to comment.