int main(int argc, char **argv)
{
        long shell;
        shell = 0x4006b498;  
        while(memcmp((void*)shell,"/bin/sh",8)) shell++;
        printf("\"/bin/sh\" is at 0x%x\n",shell);
        printf("print %s\n",shell);
}

'Programming > C' 카테고리의 다른 글

find_binsh.c  (0) 2016.09.02
getenvaddr.c  (0) 2015.07.25
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char *argv[]) {
	char *ptr;

	if(argc < 3) {
		printf("Usage: %s <environment variable> <target program name>\n", argv[0]);
		exit(0);
	}
	ptr = getenv(argv[1]); /* get env var location */
	ptr += (strlen(argv[0]) - strlen(argv[2]))*2; /* adjust for program name */
	printf("%s will be at %p\n", argv[1], ptr);
}

'Programming > C' 카테고리의 다른 글

find_binsh.c  (0) 2016.09.02
getenvaddr.c  (0) 2015.07.25

+ Recent posts