agent-bypass 2.11.5 → 2.11.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,44 @@
1
+ """平台自适配探测(轻量:仅 os/sys,import 成本近零)。
2
+ 被 fastrecon / dirbrute / basicauth_brute 共用。"""
3
+ import os
4
+ import sys
5
+
6
+ _ENV = None
7
+
8
+
9
+ def env():
10
+ global _ENV
11
+ if _ENV is not None:
12
+ return _ENV
13
+ e = {"platform": "linux", "mobile": False, "scan_workers": 512,
14
+ "http_workers": 96, "dns_workers": 48, "timeout_min": 0.5,
15
+ "engine_hint": "auto", "lazy": False}
16
+ if os.path.exists("/proc/ish"):
17
+ e.update(platform="ish", mobile=True, scan_workers=256,
18
+ http_workers=48, dns_workers=32, timeout_min=0.8, lazy=True)
19
+ elif os.environ.get("TERMUX_VERSION") or os.path.exists("/data/data/com.termux"):
20
+ e.update(platform="termux", mobile=True, scan_workers=512,
21
+ http_workers=64, dns_workers=48, timeout_min=0.6)
22
+ elif os.path.exists("/proc/device-tree/model"):
23
+ try:
24
+ m = open("/proc/device-tree/model", "rb").read().decode("utf-8", "ignore")
25
+ if "Raspberry Pi" in m:
26
+ e.update(platform="rpi", scan_workers=768, http_workers=64)
27
+ except OSError:
28
+ pass
29
+ if sys.platform == "darwin":
30
+ e.update(platform="macos")
31
+ elif os.name == "nt":
32
+ e.update(platform="windows")
33
+ _ENV = e
34
+ return e
35
+
36
+
37
+ def env_line():
38
+ e = env()
39
+ return "env=%s scan/http/dns=%d/%d/%d" % (
40
+ e["platform"], e["scan_workers"], e["http_workers"], e["dns_workers"])
41
+
42
+
43
+ if __name__ == "__main__":
44
+ print(env_line())
@@ -3,6 +3,8 @@
3
3
  """
4
4
  并发端口扫描(无需 nmap)
5
5
 
6
+ 提示: 手机环境(iSH/Termux)优先用 fastrecon.py scan —— selectors 并发实测快 5-45 倍
7
+
6
8
  用法:
7
9
  python3 portscan.py <host> [--ports 1-65535] [--conc 500] [--timeout 2]
8
10
  python3 portscan.py 1.2.3.4 --ports top100