Dec 17, 2025 12:32 PM
(This post was last modified: Dec 17, 2025 12:41 PM by jfK0699.)
OK so I have written a very simple and basic C program (console app) that makes use of strcpy routine and want to exploit it by feeding it more data by way of the command line. Here is the program below and what I want is for it to execute a payload that opens a hello world message box or better opens up calc.exe.
Unfortunately I've tried passing more 1000 bytes of input characters at the command line but the program just gracefully shuts down no errors no messages no nothing. I'm using Visual Studio 2019 Community as my compiler. I understand Windows 11 makes use of several security techniques such as DEP, ASLR, Stack Canaries and etc. I want to be able to bypass these measures and execute my payload. The payload works as I've tested it that is the message box and calc.exe both open and display inside a separate C program but do not open via a stack overflow.
Any pointers would be greatly appreciated.
Unfortunately I've tried passing more 1000 bytes of input characters at the command line but the program just gracefully shuts down no errors no messages no nothing. I'm using Visual Studio 2019 Community as my compiler. I understand Windows 11 makes use of several security techniques such as DEP, ASLR, Stack Canaries and etc. I want to be able to bypass these measures and execute my payload. The payload works as I've tested it that is the message box and calc.exe both open and display inside a separate C program but do not open via a stack overflow.
Any pointers would be greatly appreciated.
Code
int main(int argc, char** argv)
{
int age;
char buffer[500];
strcpy(buffer, argv[1]);
printf("strcpy gives %s\n", buffer);
while (1)
{
printf("Enter your age: ");
scanf_s("%d", &age); // No size parameter needed for integers
printf("You are %d years old.\n", age);
}
return 0;
}


![[Image: 3.gif]](https://i.ibb.co/zH0GQ122/3.gif)