forked from robertdavidgraham/masscan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c82dd51
commit 7f94576
Showing
13 changed files
with
272 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
#ifndef IN_BINARY_H | ||
#define IN_BINARY_H | ||
struct Masscan; | ||
|
||
/** | ||
* Read that output of previous scans that were saved in the binary format | ||
* (i.e. using the -oB parameter or the '--output-format binary' parameter). | ||
* The intent is that the user can then re-output in another format like | ||
* JSON or XML. | ||
*/ | ||
void | ||
convert_binary_files(struct Masscan *masscan, int arg_first, int arg_max, char *argv[]); | ||
read_binary_scanfile(struct Masscan *masscan, | ||
int arg_first, int arg_max, char *argv[]); | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#include "output.h" | ||
#include "masscan-app.h" | ||
#include "masscan-status.h" | ||
#include "string_s.h" | ||
#include <ctype.h> | ||
|
||
|
||
/**************************************************************************** | ||
****************************************************************************/ | ||
static void | ||
cert_out_open(struct Output *out, FILE *fp) | ||
{ | ||
} | ||
|
||
|
||
/**************************************************************************** | ||
****************************************************************************/ | ||
static void | ||
cert_out_close(struct Output *out, FILE *fp) | ||
{ | ||
fprintf(fp, "{finished: 1}\n"); | ||
} | ||
|
||
/****************************************************************************** | ||
******************************************************************************/ | ||
static void | ||
cert_out_status(struct Output *out, FILE *fp, time_t timestamp, int status, | ||
unsigned ip, unsigned ip_proto, unsigned port, unsigned reason, unsigned ttl) | ||
{ | ||
|
||
} | ||
|
||
|
||
/****************************************************************************** | ||
******************************************************************************/ | ||
static void | ||
cert_out_banner(struct Output *out, FILE *fp, time_t timestamp, | ||
unsigned ip, unsigned ip_proto, unsigned port, | ||
enum ApplicationProtocol proto, | ||
unsigned ttl, | ||
const unsigned char *px, unsigned length) | ||
{ | ||
unsigned i; | ||
if (length > 5 && memcmp(px, "cert:", 5) == 0) { | ||
px += 5; | ||
length -= 5; | ||
} | ||
|
||
printf("-----BEGIN CERTIFICATE-----\n"); | ||
for (i=0; i<length; i += 72) { | ||
unsigned len = length - i; | ||
if (len > 72) | ||
len = 72; | ||
printf("%.*s\n", len, px+i); | ||
} | ||
printf("-----END CERTIFICATE-----\n"); | ||
} | ||
|
||
/**************************************************************************** | ||
****************************************************************************/ | ||
const struct OutputType certs_output = { | ||
"cert", | ||
0, | ||
cert_out_open, | ||
cert_out_close, | ||
cert_out_status, | ||
cert_out_banner | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.