@@ -218,6 +218,7 @@ print_nmap_help(void)
218218" -oL/-oJ/-oD/-oG/-oB/-oX/-oU <file>: Output scan in List/JSON/nDjson/Grepable/Binary/XML/Unicornscan format,\n"
219219" respectively, to the given filename. Shortcut for\n"
220220" --output-format <format> --output-file <file>\n"
221+ " --output-flush: Flushes output per host found (recommended for real-time reading).\n"
221222" -v: Increase verbosity level (use -vv or more for greater effect)\n"
222223" -d: Increase debugging level (use -dd or more for greater effect)\n"
223224" --open: Only show open (or possibly open) ports\n"
@@ -1627,6 +1628,18 @@ static int SET_output_append(struct Masscan *masscan, const char *name, const ch
16271628 return CONF_OK ;
16281629}
16291630
1631+ static int SET_output_flush (struct Masscan * masscan , const char * name , const char * value )
1632+ {
1633+ UNUSEDPARM (name );
1634+ if (masscan -> echo ) {
1635+ if (masscan -> output .is_output_flush || masscan -> echo_all )
1636+ fprintf (masscan -> echo , "output-flush = %s\n" , masscan -> output .is_output_flush ?"true" :"false" );
1637+ return 0 ;
1638+ }
1639+ masscan -> output .is_output_flush = parseBoolean (value );
1640+ return CONF_OK ;
1641+ }
1642+
16301643static int SET_output_filename (struct Masscan * masscan , const char * name , const char * value )
16311644{
16321645 UNUSEDPARM (name );
@@ -2395,6 +2408,7 @@ struct ConfigParameter config_parameters[] = {
23952408 {"output-noshow" , SET_output_noshow , 0 , {"noshow" ,0 }},
23962409 {"output-show-open" ,SET_output_show_open , F_BOOL , {"open" , "open-only" , 0 }},
23972410 {"output-append" , SET_output_append , 0 , {"append-output" ,0 }},
2411+ {"output-flush" , SET_output_flush , F_BOOL , {"output-flush" ,0 }},
23982412 {"rotate" , SET_rotate_time , 0 , {"output-rotate" , "rotate-output" , "rotate-time" , 0 }},
23992413 {"rotate-dir" , SET_rotate_directory , 0 , {"output-rotate-dir" , "rotate-directory" , 0 }},
24002414 {"rotate-offset" , SET_rotate_offset , 0 , {"output-rotate-offset" , 0 }},
0 commit comments