-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreport.c
60 lines (48 loc) · 1.36 KB
/
report.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include<stdio.h>
#include<string.h>
#include<ctype.h>
#include"cgiaudit.h"
void report(const REPORTINFO*reportinfo)
{
char*p,*oldhost=NULL,*oldpath=NULL;
putchar('\n');
if(reportinfo)
puts("Vulnerabilities found!");
else
puts("No vulnerabilities found..");
for(;reportinfo;reportinfo=reportinfo->next)
{
if((oldhost&&strcmp(reportinfo->urlinfo->host,oldhost))||(oldpath&&strcmp(reportinfo->urlinfo->path,oldpath)))
{
putchar('\n');
fputs(reportinfo->urlinfo->scheme,stdout);
fputs("://",stdout);
fputs(oldhost=reportinfo->urlinfo->host,stdout);
fputs(oldpath=reportinfo->urlinfo->path,stdout);
}
printf("%-16.16s%-16.16s%-16.16s%-16.16s%-16.16s\n","Form name","Tag type","Tag name","Attack type","Success string");
printf("%-16.16s",reportinfo->forminfo->name?reportinfo->forminfo->name:"null");
switch(reportinfo->fieldinfo->type)
{
case 'i':
printf("%-16.16s","INPUT");
break;
case 's':
printf("%-16.16s","SELECT");
break;
case 't':
printf("%-16.16s","TEXTAREA");
break;
default:
bug("Unknown form field type!");
}
p=get_field_name(reportinfo->fieldinfo);
printf("%-16.16s",p?p:"null");
printf("%-16.16s",reportinfo->attack);
p=reportinfo->string+strlen(reportinfo->string);
while(isspace(*p)&&p--!=reportinfo->string);
*p=0;
printf("%-16.16s\n",reportinfo->string);
}
return;
}