Skip to content

Commit 91ac4c3

Browse files
authored
Merge pull request #942 from acerjt/patch-4
Update README.md
2 parents 9389000 + 49db41f commit 91ac4c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

binary-exploitation/format-strings/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ printf("%4$x")
9292

9393
and read directly the forth.
9494

95-
Notice that the attacker controls the `pr`**`intf` parameter, which basically means that** his input is going to be in the stack when `printf` is called, which means that he could write specific memory addresses in the stack.
95+
Notice that the attacker controls the `printf` **parameter, which basically means that** his input is going to be in the stack when `printf` is called, which means that he could write specific memory addresses in the stack.
9696

9797
{% hint style="danger" %}
9898
An attacker controlling this input, will be able to **add arbitrary address in the stack and make `printf` access them**. In the next section it will be explained how to use this behaviour.
@@ -167,7 +167,7 @@ Arbitrary reads can be useful to:
167167

168168
## **Arbitrary Write**
169169

170-
The formatter **`$<num>%n`** **writes** the **number of written bytes** in the **indicated address** in the \<num> param in the stack. If an attacker can write as many char as he will with printf, he is going to be able to make **`$<num>%n`** write an arbitrary number in an arbitrary address.
170+
The formatter **`%<num>$n`** **writes** the **number of written bytes** in the **indicated address** in the \<num> param in the stack. If an attacker can write as many char as he will with printf, he is going to be able to make **`%<num>$n`** write an arbitrary number in an arbitrary address.
171171

172172
Fortunately, to write the number 9999, it's not needed to add 9999 "A"s to the input, in order to so so it's possible to use the formatter **`%.<num-write>%<num>$n`** to write the number **`<num-write>`** in the **address pointed by the `num` position**.
173173

0 commit comments

Comments
 (0)