Our Feeds

Thursday 24 March 2016

Ajith KP

Environment Variable Addresse Finder for Linux

Hi GuyZ,
     This is a useful tool which you have to need in Buffer Overflow vulnerability exploitation and exploit development. I got this tool from here.

Source Code

#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);
}

1 comments :

Write comments
Unknown
AUTHOR
1 May 2018 at 17:37 delete This comment has been removed by the author.
avatar