Happy New Year 2018

Shellcode with Chinese characters, win32/64 windows 7

2018


/*

               __
               /\/'-,
       ,--'''''   /"
 ____,'.  )       \___
'"""""------'"""`-----'

Happy New Year -  新年快樂

*/
#include<stdio.h>
#include<string.h>


char shellcode[] = "\x31\xd2\xb2\x30\x64\x8b\x12\x8b\x52\x0c\x8b\x52\x1c\x8b\x42\x08"
                   "\x8b\x72\x20\x8b\x12\x80\x7e\x0c\x33\x75\xf2\x89\xc7\x03\x78\x3c"
                   "\x8b\x57\x78\x01\xc2\x8b\x7a\x20\x01\xc7\x31\xed\x8b\x34\xaf\x01"
                   "\xc6\x45\x81\x3e\x46\x61\x74\x61\x75\xf2\x81\x7e\x08\x45\x78\x69"
                   "\x74\x75\xe9\x8b\x7a\x24\x01\xc7\x66\x8b\x2c\x6f\x8b\x7a\x1c\x01" 
                   "\xc7\x8b\x7c\xaf\xfc\x01\xc7\x68\x61\x72\x20\x01\x68\x77\x20\x59"
                   "\x65\x68\x79\x20\x4e\x65\x68\x48\x61\x70\x70\x89\xe1\xfe\x49\x0f"
                   "\x31\xc0\x51\x50\xff\xd7"
                   "\新\年\快\樂\狗\年\行\大\運\好\運\旺\旺\來";  
 
int main()
{
 
printf("shellcode length %ld\n",(unsigned)strlen(shellcode));
(* (int(*)()) shellcode) ();
}

Pepsi World Shellcode x64 Linux

;nasm -f elf64 pepsi.asm
;ld -s -o pepsi pepsi.o
;for i in $(objdump -d pepsi|grep “^ ” |cut -f2); do echo -n ‘\x’$i; done; echo
;gcc pepsi.c -o pepsi -fno-stack-protector -z execstack -no-pie

lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.2 LTS
Release:	16.04
Codename:	xenial
#include <stdio.h>
#include <string.h>


unsigned char shellcode[] =
"\xeb\x1e\x5e\x48\x31\xc0\xb0\x01\x48\x89"
"\xc7\x48\x89\xfa\x48\x83\xc2\x0e\x0f\x05"
"\x48\x31\xc0\x48\x83\xc0\x3c\x48\x31\xff"
"\x0f\x05\xe8\xdd\xff\xff\xff\x50\x65\x70"
"\x73\x69\x20\x57\x6f\x72\x6c\x64\x21\x0a";


void main(){
   int (*ret)() = (int(*)())shellcode;
   ret();
}

🙂