LegendarySaiyan

0x001

Nov 20th, 2022 (edited)
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.70 KB | Cybersecurity | 0 0
  1. /*
  2. filename o1.c -> o1.exe
  3.  
  4. Original Buffer Overflow was targeted at overwriting the memory. My objective went a tad further to possibly cause an exhuastion of resources. The python source is :
  5.  
  6. #!/usr/bin/python3
  7. import os
  8. exploit = '0xSaiyanGodwash3re:#uRp4wned'
  9. os.system(f"./o1 {exploit}")
  10.  
  11. the python file is named t28.py, any guesses why?
  12. */
  13. #include <stdio.h>
  14. #include <string.h>
  15.  
  16. int main(int argc, char *argv[]) {
  17.    int value = 5;
  18.    char b1[8], b2[8];
  19.    
  20.    strcpy(b1, "length");
  21.    strcpy(b2, "iseight");
  22.    
  23.    printf(".. deadly data is at %p for now", b2);
  24.    strcpy(b2, argv[1]);
  25.    
  26.    printf("you are being overflowed at %p ", b2);
  27.    printf(value);
  28.    printf("%s",b2);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment