mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 14:11:29 +00:00
Update scripts to support new test point system
This commit is contained in:
@@ -128,6 +128,7 @@ int main(int argc, char *argv[]) {
|
|||||||
double accuracy;
|
double accuracy;
|
||||||
char sourcefile[MAXPATHLEN];
|
char sourcefile[MAXPATHLEN];
|
||||||
int sourceline=-1;
|
int sourceline=-1;
|
||||||
|
FingerPrintDB *DB = NULL;
|
||||||
char referenceFPString[8192];
|
char referenceFPString[8192];
|
||||||
char observedFPString[8192];
|
char observedFPString[8192];
|
||||||
char line[512];
|
char line[512];
|
||||||
@@ -135,6 +136,7 @@ int main(int argc, char *argv[]) {
|
|||||||
int i, rc;
|
int i, rc;
|
||||||
int done=0;
|
int done=0;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
FingerPrint *MatchPoints = NULL;
|
||||||
|
|
||||||
if (argc < 1 || argc > 2)
|
if (argc < 1 || argc > 2)
|
||||||
usage(NULL);
|
usage(NULL);
|
||||||
@@ -162,6 +164,11 @@ int main(int argc, char *argv[]) {
|
|||||||
if (readFP(fp, referenceFPString, sizeof(referenceFPString)) == -1)
|
if (readFP(fp, referenceFPString, sizeof(referenceFPString)) == -1)
|
||||||
usage("Failed to read in supposed fingerprint in %s line %d\n", sourcefile, sourceline);
|
usage("Failed to read in supposed fingerprint in %s line %d\n", sourcefile, sourceline);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
|
/* Try to parse the file as an nmap-DB to get the matchpoints */
|
||||||
|
DB = parse_fingerprint_file(sourcefile);
|
||||||
|
if (DB) MatchPoints = DB->MatchPoints;
|
||||||
|
|
||||||
printf("STEP ONE: Reading REFERENCE FINGERPRINT from %s line %d:\n%s\n"
|
printf("STEP ONE: Reading REFERENCE FINGERPRINT from %s line %d:\n%s\n"
|
||||||
,sourcefile, sourceline, referenceFPString);
|
,sourcefile, sourceline, referenceFPString);
|
||||||
} else {
|
} else {
|
||||||
@@ -191,7 +198,7 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* OK, now I've got the fingerprints -- I just need to compare them ... */
|
/* OK, now I've got the fingerprints -- I just need to compare them ... */
|
||||||
accuracy = compare_fingerprints(referenceFP, observedFP, 1);
|
accuracy = compare_fingerprints(referenceFP, observedFP, MatchPoints, 1);
|
||||||
if (accuracy == 1)
|
if (accuracy == 1)
|
||||||
printf("PERFECT MATCH!\n");
|
printf("PERFECT MATCH!\n");
|
||||||
else printf("Accuracy of the two prints is %d%% -- see differences above.\n",
|
else printf("Accuracy of the two prints is %d%% -- see differences above.\n",
|
||||||
|
|||||||
@@ -107,7 +107,7 @@
|
|||||||
#include "osscan.h"
|
#include "osscan.h"
|
||||||
#include "fingerlib.h"
|
#include "fingerlib.h"
|
||||||
|
|
||||||
#define FINGERMATCH_GUESS_THRESHOLD 0.75 /* How low we will still show guesses for */
|
#define FINGERMATCH_GUESS_THRESHOLD 0.80 /* How low we will still show guesses for */
|
||||||
|
|
||||||
void usage() {
|
void usage() {
|
||||||
printf("Usage: fingermatch <fingerprintfilename>\n"
|
printf("Usage: fingermatch <fingerprintfilename>\n"
|
||||||
@@ -118,7 +118,7 @@ void usage() {
|
|||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
char *fingerfile = NULL;
|
char *fingerfile = NULL;
|
||||||
FingerPrint **reference_FPs = NULL;
|
FingerPrintDB *reference_FPs = NULL;
|
||||||
FingerPrint *testFP;
|
FingerPrint *testFP;
|
||||||
struct FingerPrintResults FPR;
|
struct FingerPrintResults FPR;
|
||||||
char fprint[8192];
|
char fprint[8192];
|
||||||
|
|||||||
Reference in New Issue
Block a user