fortify-source

Fortify integration with Maven - install

醉酒当歌 提交于 2019-12-09 18:15:16
问题 I want to run a Fortify scan against a Maven Eclipse project. Where should I start? I understand that I need to update my pom.xml file to include the Fortify plugin however do I also require to have Fortify SCA installed on my machine? (I'm running MacOS X). I have been trying to find a place to download Fortify SCA but have not been able find it. I would appreciate it if someone could share some links to point me in the right direction in getting the setup complete. 回答1: I don't think the

Disable using __sprintf_chk()

北战南征 提交于 2019-12-09 13:13:30
问题 I observe that a c++ program uses sprintf , where this sprintf implicitly invokes __sprintf_chk() . This __sprintf_chk() seems to check buffer overflow by examining stack frames. For my research purpose, I wonder if it is possible to disable using __sprintf_chk() ? 回答1: Try to replace all calls to sprintf in your program from this: sprintf(params...); into (sprintf)(params...); This will disable any preprocessor-based sprintf-changing (* only if sprintf was changed using function-like macro

sprintf function's buffer overflow?

淺唱寂寞╮ 提交于 2019-12-09 00:30:28
问题 { char buf[8]; sprintf(buf,"AAAA%3s","XXXXXXXX"); printf("%s\n",buf); } what will happen? The buffer have 8 characters space and only 3 free characters left, however, "XXXXXXXX" is 8 characters long. I take a test with Visual Studion 2008 on Windows 7. As a result, the program printed:AAAXXXXXXX, and a run-time error happened. 回答1: It makes a lot of sense to consider what happens in your and, more importantly, similar, cases. As other posters have noted, it invokes UB. That's probably true.

Buffer Overflow - SegFaults in regular user

我的梦境 提交于 2019-12-05 14:15:55
Below is my code, both the vulnerable program (stack.c) and my exploit (exploit.c). This code works on a pre-packaged Ubuntu 9 that the prof sent out for windows users (I had a friend test it on his computer), but on Ubuntu 12 that I run on my iMac, i get segfaults when I try and do this in a normal user. here's stack: //stack.c #include <stdio.h> int bof(char *str) { char buffer[12]; //BO Vulnerability strcpy(buffer,str); return 1; } int main(int argc, char* argv[]) { char str[517]; FILE *badfile; badfile = fopen("badfile","r"); fread(str, sizeof(char),517, badfile); bof(str); printf(

performing simple buffer overflow on Mac os 10.6

好久不见. 提交于 2019-12-05 03:18:37
问题 I'm trying to learn about stack base overflow and write a simple code to exploit stack. But somehow it doesn't work at all but showing only Abort trap on my machine (mac os leopard) I guess Mac os treats overflow differently, it won't allow me to overwrite memory through c code. for example, strcpy(buffer, input) // lets say char buffer[6] but input is 7 bytes on Linux machine, this code successfully overwrite next stack, but prevented on mac os (Abort trap) Anyone know how to perform a

Fortify integration with Maven - install

◇◆丶佛笑我妖孽 提交于 2019-12-04 05:29:23
I want to run a Fortify scan against a Maven Eclipse project. Where should I start? I understand that I need to update my pom.xml file to include the Fortify plugin however do I also require to have Fortify SCA installed on my machine? (I'm running MacOS X). I have been trying to find a place to download Fortify SCA but have not been able find it. I would appreciate it if someone could share some links to point me in the right direction in getting the setup complete. I don't think the Fortify installation is required, but it's pretty hard to get the maven sca plugin without it. If you install

performing simple buffer overflow on Mac os 10.6

大憨熊 提交于 2019-12-03 16:24:36
I'm trying to learn about stack base overflow and write a simple code to exploit stack. But somehow it doesn't work at all but showing only Abort trap on my machine (mac os leopard) I guess Mac os treats overflow differently, it won't allow me to overwrite memory through c code. for example, strcpy(buffer, input) // lets say char buffer[6] but input is 7 bytes on Linux machine, this code successfully overwrite next stack, but prevented on mac os (Abort trap) Anyone know how to perform a simple stack-base overflow on mac machine? include int main(int argc, char **argv) { char buffer[4]; puts(

sprintf function's buffer overflow?

拥有回忆 提交于 2019-11-30 18:13:16
{ char buf[8]; sprintf(buf,"AAAA%3s","XXXXXXXX"); printf("%s\n",buf); } what will happen? The buffer have 8 characters space and only 3 free characters left, however, "XXXXXXXX" is 8 characters long. I take a test with Visual Studion 2008 on Windows 7. As a result, the program printed:AAAXXXXXXX, and a run-time error happened. It makes a lot of sense to consider what happens in your and, more importantly, similar, cases. As other posters have noted, it invokes UB. That's probably true. However, the world does not stop simply because someone did not define what exactly should happen next. And

Format String Attack

故事扮演 提交于 2019-11-30 15:21:07
I have a small C program to be exploited. And I also understood the logic behind the attack to be performed. However, as much as I try, it is just not working for me. #include <stdio.h> #include <stdlib.h> #define SECRET1 0x44 #define SECRET2 0x55 int main(int argc, char *argv[]) { char user_input[100]; int *secret; int int_input; int a, b, c, d; /* other variables, not used here.*/ /* The secret value is stored on the heap */ secret = (int *) malloc(2*sizeof(int)); /* getting the secret */ secret[0] = SECRET1; secret[1] = SECRET2; printf("Please enter a decimal integer\n"); scanf("%d", &int

Format String Attack

旧街凉风 提交于 2019-11-29 22:01:07
问题 I have a small C program to be exploited. And I also understood the logic behind the attack to be performed. However, as much as I try, it is just not working for me. #include <stdio.h> #include <stdlib.h> #define SECRET1 0x44 #define SECRET2 0x55 int main(int argc, char *argv[]) { char user_input[100]; int *secret; int int_input; int a, b, c, d; /* other variables, not used here.*/ /* The secret value is stored on the heap */ secret = (int *) malloc(2*sizeof(int)); /* getting the secret */