1.28b - added host IP to stats screen, -u for quiet mode, handle forms with now action= URL

- Forms with no action= URL are now handled correctly.
- New option (-u) to suppress realtime info,
- Destination host displayed on stats screen.
This commit is contained in:
Steve Pinkham 2010-04-02 09:45:44 -04:00
parent 5918f62bbc
commit c9b575c01e
6 changed files with 40 additions and 7 deletions

View File

@ -1,3 +1,12 @@
Version 1.28b:
- Forms with no action= URL are now handled correctly.
- New option (-u) to suppress realtime info,
- Destination host displayed on stats screen.
--------------
Version 1.27b:
--------------

2
README
View File

@ -385,6 +385,8 @@ Lastly, -f controls the maximum number of consecutive HTTP errors you are
willing to see before aborting the scan; and -s sets the maximum length of a
response to fetch and parse (longer responses will be truncated).
Runtime stats can be suppressed with -u to run skipfish in quiet mode.
--------------------------------
5. But seriously, how to run it?
--------------------------------

View File

@ -741,6 +741,10 @@ void scrape_response(struct http_request* req, struct http_response* res) {
if (tolower(method[0]) == 'p') parse_form = 2;
}
/* Forms with no URL submit to current location. */
if (!dirty_url) dirty_url = req->orig_url;
} else {
/* All other tags - other <link> types, <a>, <bgsound> -
@ -788,6 +792,13 @@ void scrape_response(struct http_request* req, struct http_response* res) {
if (parse_form == 2) {
ck_free(n->method);
n->method = ck_strdup((u8*)"POST");
} else {
/* On GET forms, strip existing query params to get a submission
target. */
u8* qmark = (u8*)strchr((char*)clean_url, '?');
if (qmark) *qmark = 0;
}
/* Don't collect form fields, etc, if target is not within the

View File

@ -23,7 +23,7 @@
#ifndef _HAVE_CONFIG_H
#define _HAVE_CONFIG_H
#define VERSION "1.27b"
#define VERSION "1.28b"
#define USE_COLOR 1 /* Use terminal colors */

View File

@ -92,6 +92,9 @@ log all external URLs and e-mails seen
.TP
.B \-Q
completely suppress duplicate nodes in reports
.TP
.B \-u
be quiet, do not display realtime scan statistics
.SS Dictionary management options:
.TP

View File

@ -87,7 +87,8 @@ void usage(char* argv0) {
" -M - log warnings about mixed content\n"
" -E - log all HTTP/1.0 / HTTP/1.1 caching intent mismatches\n"
" -U - log all external URLs and e-mails seen\n"
" -Q - completely suppress duplicate nodes in reports\n\n"
" -Q - completely suppress duplicate nodes in reports\n"
" -u - be quiet, disable realtime progress stats\n\n"
"Dictionary management options:\n\n"
@ -139,7 +140,7 @@ static void resize_handler(int sig) {
int main(int argc, char** argv) {
s32 opt;
u32 loop_cnt = 0, purge_age = 0, seed;
u8 dont_save_words = 0, show_once = 0;
u8 dont_save_words = 0, show_once = 0, be_quiet = 0;
u8 *wordlist = (u8*)DEF_WORDLIST, *output_dir = NULL;
struct timeval tv;
@ -160,7 +161,7 @@ int main(int argc, char** argv) {
SAY("skipfish version " VERSION " by <lcamtuf@google.com>\n");
while ((opt = getopt(argc, argv,
"+A:F:C:H:b:Nd:c:r:p:I:X:S:D:PJOYQMUEW:LVT:G:R:B:q:g:m:f:t:w:i:s:o:h")) > 0)
"+A:F:C:H:b:Nd:c:r:p:I:X:S:D:PJOYQMUEW:LVT:G:R:B:q:g:m:f:t:w:i:s:o:hu")) > 0)
switch (opt) {
@ -375,6 +376,10 @@ int main(int argc, char** argv) {
break;
case 'u':
be_quiet = 1;
break;
default:
usage(argv[0]);
@ -424,11 +429,12 @@ int main(int argc, char** argv) {
gettimeofday(&tv, NULL);
st_time = tv.tv_sec * 1000 + tv.tv_usec / 1000;
SAY("\x1b[H\x1b[J");
if (!be_quiet) SAY("\x1b[H\x1b[J");
else SAY(cLGN "[*] " cBRI "Scan in progress, please stay tuned...\n");
while ((next_from_queue() && !stop_soon) || (!show_once++)) {
if ((loop_cnt++ % 20) && !show_once) continue;
if (be_quiet || ((loop_cnt++ % 20) && !show_once)) continue;
if (clear_screen) {
SAY("\x1b[H\x1b[2J");
@ -436,7 +442,9 @@ int main(int argc, char** argv) {
}
SAY(cYEL "\x1b[H"
"skipfish version " VERSION " by <lcamtuf@google.com>\n\n" cNOR);
"skipfish version " VERSION " by <lcamtuf@google.com>\n\n"
cBRI " -" cPIN " %s " cBRI "-\n\n" cNOR,
allow_domains[0]);
http_stats(st_time);
SAY("\n");