mirror of
https://github.com/simon987/vanwanet_scrape.git
synced 2025-04-19 18:36:47 +00:00
Run in vm
This commit is contained in:
parent
1c86a781e3
commit
d4839360cb
2
setup.py
2
setup.py
@ -2,7 +2,7 @@ from setuptools import setup
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="vanwanet_scrape",
|
name="vanwanet_scrape",
|
||||||
version="1.1",
|
version="1.2",
|
||||||
description="VanwaTech DDoS protection bypass",
|
description="VanwaTech DDoS protection bypass",
|
||||||
author="simon987",
|
author="simon987",
|
||||||
author_email="me@simon987.net",
|
author_email="me@simon987.net",
|
||||||
|
@ -58,13 +58,14 @@ class Scraper:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def _transform_js(js):
|
def _transform_js(js):
|
||||||
# Print cookie to console instead
|
# Print cookie to console instead
|
||||||
challenge = SUB_PATTRN.sub(r'console.log("\1");', js)
|
challenge = SUB_PATTRN.sub(r'res="\1";', js)
|
||||||
return AES + challenge
|
return AES + challenge
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _execute_challenge(js):
|
def _execute_challenge(js):
|
||||||
|
js = js.replace("`", "")
|
||||||
|
js = "let sb={};vm = require('vm');vm.runInNewContext(`" + js + "`, sb, {timeout: 3000});console.log(sb.res)"
|
||||||
|
|
||||||
# TODO: run in some kind of sandbox
|
|
||||||
node = subprocess.Popen(
|
node = subprocess.Popen(
|
||||||
["node", "-e", js], stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
["node", "-e", js], stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||||
universal_newlines=True
|
universal_newlines=True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user