Lab7 Windows Shellcoding
Lab7 Windows Shellcoding
• Create a shellcode that will create a window that looks like the above
• Make it exit without any error
Username: elsadmin
Password: elsadmin1
Develop shellcode that will produce the window presented above. Be reminded, that you can
hardcode addresses.
Use the shellcode-tester.c to compile your shellcode into an application and check if it works
as expected.
int MessageBoxA(
HWND hWnd,
LPCSTR lpText,
LPCSTR lpCaption,
UINT uType
);
MessageBoxA is exported by user32.dll which is not loaded into the shellcode tester
application by default. You need to modify its source code and add a call to
LoadLibrary(“user32.dll”), as follows.
BITS 32
"\xb8\x76\x64\xd6\x77\x31\xc9\xbb\x76\x23\x02\x02\x81\xeb\x02"
"\x02\x02\x02\x53\x68\x68\x20\x6f\x75\x68\x57\x61\x74\x63\x89"
"\xe3\xba\x68\x24\x03\x03\x81\xea\x03\x03\x03\x03\x52\x68\x6c"
"\x63\x6f\x64\x68\x73\x68\x65\x6c\x68\x69\x74\x65\x20\x68\x6e"
"\x20\x77\x72\x68\x49\x20\x63\x61\x89\xe2\x51\x53\x52\x51\xff"
"\xd0\x51\xb8\xfd\x98\xe7\x77\xff\xd0"