From 55736012f57a99be1e1af295471bbf2acd58cca2 Mon Sep 17 00:00:00 2001 From: ummthespruce <130300985+ummthespruce@users.noreply.github.com> Date: Mon, 24 Feb 2025 11:20:06 +0200 Subject: [PATCH 1/3] Update README.md Signed-off-by: ummthespruce <130300985+ummthespruce@users.noreply.github.com> --- labs/lab-10/tasks/read-stdin-gets/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labs/lab-10/tasks/read-stdin-gets/README.md b/labs/lab-10/tasks/read-stdin-gets/README.md index 52ad147b7..9f85bfdc7 100644 --- a/labs/lab-10/tasks/read-stdin-gets/README.md +++ b/labs/lab-10/tasks/read-stdin-gets/README.md @@ -47,7 +47,7 @@ This is a string that occupies `8` bytes. > For example, to generate a payload that overwrites a value in the code with the value `0xDEADBEEF`, you can execute the following command: ```python -python2.7 -c 'print "A" * 32 + "\xEF\xBE\xAD\xDE"' > payload +python3 -c 'import sys; sys.stdout.buffer.write("A" * 32 + "\xEF\xBE\xAD\xDE")' > payload ``` > **NOTE** number `32` is only an example and it represents the size of buffer that needs to be bypassed. From a44e20848a8c73427b936e79d64f628feb248e5f Mon Sep 17 00:00:00 2001 From: ummthespruce <130300985+ummthespruce@users.noreply.github.com> Date: Mon, 24 Feb 2025 11:22:57 +0200 Subject: [PATCH 2/3] Updated README.md with bytes Signed-off-by: ummthespruce <130300985+ummthespruce@users.noreply.github.com> --- labs/lab-10/tasks/read-stdin-gets/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labs/lab-10/tasks/read-stdin-gets/README.md b/labs/lab-10/tasks/read-stdin-gets/README.md index 9f85bfdc7..ab381664a 100644 --- a/labs/lab-10/tasks/read-stdin-gets/README.md +++ b/labs/lab-10/tasks/read-stdin-gets/README.md @@ -47,7 +47,7 @@ This is a string that occupies `8` bytes. > For example, to generate a payload that overwrites a value in the code with the value `0xDEADBEEF`, you can execute the following command: ```python -python3 -c 'import sys; sys.stdout.buffer.write("A" * 32 + "\xEF\xBE\xAD\xDE")' > payload +python3 -c 'import sys; sys.stdout.buffer.write(b"A" * 32 + b"\xEF\xBE\xAD\xDE")' > payload ``` > **NOTE** number `32` is only an example and it represents the size of buffer that needs to be bypassed. From 85a4b97f08fe92cb6878222499d1e23a93cadfdc Mon Sep 17 00:00:00 2001 From: ummthespruce <130300985+ummthespruce@users.noreply.github.com> Date: Mon, 24 Feb 2025 11:24:24 +0200 Subject: [PATCH 3/3] Update README.md Signed-off-by: ummthespruce <130300985+ummthespruce@users.noreply.github.com> --- labs/lab-10/tasks/overwrite-ret-addr/solution/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labs/lab-10/tasks/overwrite-ret-addr/solution/README.md b/labs/lab-10/tasks/overwrite-ret-addr/solution/README.md index 7640dcf66..beb0b67c1 100644 --- a/labs/lab-10/tasks/overwrite-ret-addr/solution/README.md +++ b/labs/lab-10/tasks/overwrite-ret-addr/solution/README.md @@ -33,5 +33,5 @@ size_t i, len; // 16 bytes (8 each one) Sum that up and add another 4 for `ebp` => 92 ``` Bash -python2.7 -c 'print "100\n" + "A" * 92 + "\x96\x85\x04\x08"' > payload +python3 -c 'import sys; sys.stdout.buffer.write(b"100\n" + b"A" * 92 + b"\x96\x85\x04\x08")' > payload ```