mirror of
https://github.com/simon987/vanwanet_scrape.git
synced 2025-04-10 14:06:43 +00:00
Fix scraper
This commit is contained in:
parent
d4839360cb
commit
9f0e306477
48
example.html
Normal file
48
example.html
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<body>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
<meta name="description" content="">
|
||||||
|
<meta name="keywords" content="">
|
||||||
|
<title>VanwaNet DDoS Mitigation</title>
|
||||||
|
<!-- Styles -->
|
||||||
|
<link href="https://vanwanet.com/assets/css/page.min.css" rel="stylesheet">
|
||||||
|
<link href="https://vanwanet.com/assets/css/style.css" rel="stylesheet">
|
||||||
|
<!-- Favicons -->
|
||||||
|
<link rel="apple-touch-icon" href="https://vanwanet.com/assets/img/apple-touch-icon.png">
|
||||||
|
<link rel="icon" href="https://vanwanet.com/assets/img/favicon.png">
|
||||||
|
</head>
|
||||||
|
<body class="layout-centered bg-gray">
|
||||||
|
<!-- Main Content -->
|
||||||
|
<main class="main-content text-center pb-lg-8">
|
||||||
|
<div class="container">
|
||||||
|
<h1 class="display-1 text-muted mb-7">Verifying Your Browser</h1>
|
||||||
|
<p class="lead">DDoS Mitigation by <a href="https://vanwanet.com" target="_blank">VanwaNet</a></p>
|
||||||
|
</div>
|
||||||
|
</main><!-- /.main-content -->
|
||||||
|
<!-- Scripts -->
|
||||||
|
<script src="https://vanwanet.com/assets/js/page.min.js"></script>
|
||||||
|
<script src="https://vanwanet.com/assets/js/script.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
<script type="text/javascript" src="https://vanwanet.com/aes.js"></script>
|
||||||
|
<script>function toNumbers(d) {
|
||||||
|
var e = [];
|
||||||
|
d.replace(/(..)/g, function (d) {
|
||||||
|
e.push(parseInt(d, 16))
|
||||||
|
});
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
|
||||||
|
function toHex() {
|
||||||
|
for (var d = [], d = 1 == arguments.length && arguments[0].constructor == Array ? arguments[0] : arguments, e = "", f = 0; f < d.length; f++) e += (16 > d[f] ? "0" : "") + d[f].toString(16);
|
||||||
|
return e.toLowerCase()
|
||||||
|
}
|
||||||
|
|
||||||
|
var a = toNumbers("ddddbeefeadbeefffadebfeaaaadbeef"), b = toNumbers("ddddbeefeadbeefffadebfeaaaadbeef"),
|
||||||
|
c = toNumbers("a1f65df65c31e8b63ca3be6e1d90c140");
|
||||||
|
document.cookie = "VanwaNetDDoSMitigation=" + toHex(slowAES.decrypt(c, 2, a, b)) + "; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/";
|
||||||
|
location.href = "https://sys.8kun.top/board-search.php?page=0";</script>
|
||||||
|
</body>
|
2
setup.py
2
setup.py
@ -2,7 +2,7 @@ from setuptools import setup
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="vanwanet_scrape",
|
name="vanwanet_scrape",
|
||||||
version="1.2",
|
version="1.3",
|
||||||
description="VanwaTech DDoS protection bypass",
|
description="VanwaTech DDoS protection bypass",
|
||||||
author="simon987",
|
author="simon987",
|
||||||
author_email="me@simon987.net",
|
author_email="me@simon987.net",
|
||||||
|
@ -46,14 +46,14 @@ class Scraper:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _is_challenge_page(r):
|
def _is_challenge_page(r):
|
||||||
if r.text.startswith("<iframe ") and "VanwaNetDDoSMitigation=" in r.text:
|
if "VanwaNetDDoSMitigation=" in r.text:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_js(r):
|
def _get_js(r):
|
||||||
soup = BeautifulSoup(r.text, "html.parser")
|
soup = BeautifulSoup(r.text, "html.parser")
|
||||||
return soup.find("script", src=lambda x: not x).text
|
return soup.find("script", src=lambda x: not x).string
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _transform_js(js):
|
def _transform_js(js):
|
||||||
|
35
vanwanet_scrape/test_scraper.py
Normal file
35
vanwanet_scrape/test_scraper.py
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
import logging
|
||||||
|
import unittest
|
||||||
|
from logging import DEBUG
|
||||||
|
from unittest import TestCase
|
||||||
|
|
||||||
|
from vanwanet_scrape.scraper import Scraper
|
||||||
|
|
||||||
|
|
||||||
|
class TestScraper(TestCase):
|
||||||
|
|
||||||
|
def test_challenge(self):
|
||||||
|
log = logging.getLogger("default")
|
||||||
|
log.setLevel(DEBUG)
|
||||||
|
scraper = Scraper(
|
||||||
|
headers={
|
||||||
|
"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0",
|
||||||
|
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
|
||||||
|
"Referer": "https://8kun.top/index.html"
|
||||||
|
},
|
||||||
|
domains=[
|
||||||
|
"8kun.top",
|
||||||
|
"media.8kun.top",
|
||||||
|
"sys.8kun.net"
|
||||||
|
],
|
||||||
|
logger=log
|
||||||
|
)
|
||||||
|
|
||||||
|
r = scraper.get("https://sys.8kun.top/board-search.php?page=0")
|
||||||
|
|
||||||
|
self.assertTrue(r.status_code == 200)
|
||||||
|
self.assertTrue("VanwaNet DDoS Mitigation" not in r.text)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
Loading…
x
Reference in New Issue
Block a user