Sign inSign up

suezawa/exploit-example1

By suezawa

•Updated almost 7 years ago

Image
0

489

suezawa/exploit-example1 repository overview

⁠Example1: Hello World!

⁠Run
docker run --rm -it suezawa/exploit-example1 bash
⁠Hello World (use syscall wrapper directly)
./hello
⁠Confirm System call
# see all system calls
strace ./hello

# see write only
strace -e trace=write ./hello
⁠See each file
  • Assembly
file hello.s
cat hello.s
  • Object file
file hello.o
  • ELF (Executable, Dynamically Linked)
file hello
  • ELF (Executable, Statically Linked)
file static_hello
⁠Confirm linked library (dynamically linked)
# ldd hello
	linux-vdso.so.1 (0x00007ffdbc983000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff9c6614000)
	/lib64/ld-linux-x86-64.so.2 (0x00007ff9c6a05000)

# ldd static_hello
  	not a dynamic executable
⁠How each file was created
# Assembly
gcc -S hello.c -masm=intel -o hello.s

# Object file
gcc -g -c hello.c -o /hello.o

# Dynamic Link ELF
gcc -fno-stack-protector -z execstack hello.c -o /hello

# Static Link ELF
RUN gcc -static -fno-stack-protector -z execstack hello.c -o /static_hello

Tag summary

Content type

Image

Digest

Size

207.5 MB

Last updated

almost 7 years ago

docker pull suezawa/exploit-example1