mirror of
https://github.com/simon987/vanwanet_scrape.git
synced 2025-04-10 14:06:43 +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(
|
||||
name="vanwanet_scrape",
|
||||
version="1.1",
|
||||
version="1.2",
|
||||
description="VanwaTech DDoS protection bypass",
|
||||
author="simon987",
|
||||
author_email="me@simon987.net",
|
||||
|
@ -58,13 +58,14 @@ class Scraper:
|
||||
@staticmethod
|
||||
def _transform_js(js):
|
||||
# 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
|
||||
|
||||
@staticmethod
|
||||
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", "-e", js], stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||
universal_newlines=True
|
||||
|
Loading…
x
Reference in New Issue
Block a user