diff --git a/src/main-conf.c b/src/main-conf.c index e1394375..cc5bf945 100644 --- a/src/main-conf.c +++ b/src/main-conf.c @@ -1247,6 +1247,7 @@ static int SET_output_format(struct Masscan *masscan, const char *name, const ch case Output_NDJSON: fprintf(fp, "output-format = ndjson\n"); break; case Output_Certs: fprintf(fp, "output-format = certs\n"); break; case Output_None: fprintf(fp, "output-format = none\n"); break; + case Output_Hostonly: fprintf(fp, "output-format = hostonly\n"); break; case Output_Redis: fprintf(fp, "output-format = redis\n"); fprintf(fp, "redis = %s %u\n", @@ -1273,6 +1274,7 @@ static int SET_output_format(struct Masscan *masscan, const char *name, const ch else if (EQUALS("certs", value)) x = Output_Certs; else if (EQUALS("none", value)) x = Output_None; else if (EQUALS("redis", value)) x = Output_Redis; + else if (EQUALS("hostonly", value)) x = Output_Hostonly; else { LOG(0, "FAIL: unknown output-format: %s\n", value); LOG(0, " hint: 'binary', 'xml', 'grepable', ...\n"); @@ -2686,6 +2688,9 @@ masscan_command_line(struct Masscan *masscan, int argc, char *argv[]) case 'U': masscan_set_parameter(masscan, "output-format", "unicornscan"); break; + case 'H': + masscan_set_parameter(masscan, "output-format", "hostonly"); + break; default: fprintf(stderr, "nmap(%s): unknown output format\n", argv[i]); exit(1); @@ -2864,7 +2869,7 @@ masscan_command_line(struct Masscan *masscan, int argc, char *argv[]) fprintf(stderr, "[-] WARNING: the shard number must be less than the total shard count: %u/%u\n", masscan->shard.one, masscan->shard.of); } - if (masscan->shard.of && masscan->seed == 0) { + if (masscan->shard.of > 1 && masscan->seed == 0) { fprintf(stderr, "[-] WARNING: --seed is not specified\n HINT: all shards must share the same seed\n"); } } diff --git a/src/masscan.h b/src/masscan.h index a78ab567..58a0478e 100644 --- a/src/masscan.h +++ b/src/masscan.h @@ -58,6 +58,7 @@ enum OutputFormat { Output_Unicornscan = 0x0200, /* -oU, "unicornscan" */ Output_None = 0x0400, Output_Certs = 0x0800, + Output_Hostonly = 0x1000, /* -oH, "hostonly" */ Output_All = 0xFFBF, /* not supported */ }; diff --git a/src/output.c b/src/output.c index 44bc8157..c15a7bbe 100644 --- a/src/output.c +++ b/src/output.c @@ -441,6 +441,9 @@ output_create(const struct Masscan *masscan, unsigned thread_index) case Output_Redis: out->funcs = &redis_output; break; + case Output_Hostonly: + out->funcs = &hostonly_output; + break; case Output_None: out->funcs = &null_output; break; diff --git a/src/output.h b/src/output.h index 34e591de..41682014 100644 --- a/src/output.h +++ b/src/output.h @@ -141,6 +141,7 @@ extern const struct OutputType certs_output; extern const struct OutputType binary_output; extern const struct OutputType null_output; extern const struct OutputType redis_output; +extern const struct OutputType hostonly_output; extern const struct OutputType grepable_output; /** diff --git a/vs10/masscan.vcxproj b/vs10/masscan.vcxproj index dda27bf2..a64cce14 100644 --- a/vs10/masscan.vcxproj +++ b/vs10/masscan.vcxproj @@ -38,6 +38,7 @@ + diff --git a/vs10/masscan.vcxproj.filters b/vs10/masscan.vcxproj.filters index 951778f5..ac4d71a2 100644 --- a/vs10/masscan.vcxproj.filters +++ b/vs10/masscan.vcxproj.filters @@ -375,6 +375,9 @@ Source Files\massip + + Source Files\output +