@@ -3204,16 +3204,18 @@ def _fingerping(self, injector):
3204
3204
confidence = "Tentative"
3205
3205
print "Fingerping module was able to download", str(number_of_responses), \
3206
3206
"of", str(len(FingerpingImages.all_images)), "images as PNGs again"
3207
- if number_of_responses < 10:
3208
- # This is guesswork, no point in making an issue, stop here
3209
- print "Fingerping: Could download less than 10 images, not making a fingerping issue"
3210
- return
3211
- elif number_of_responses > 50:
3207
+ results, fingerprintScores = f.do_tests(downloads, True)
3208
+ text_score, total = f.get_results_table(fingerprintScores)
3209
+ highest_score = text_score[-1][1]
3210
+ score_percentage = float(highest_score) / total
3211
+
3212
+ if score_percentage > 0.6:
3212
3213
confidence = "Certain"
3213
- elif number_of_responses > 40 :
3214
+ elif score_percentage > 0.85 :
3214
3215
confidence = "Firm"
3215
- results, fingerprintScores = f.do_tests(downloads, True)
3216
- result_table = f.get_results_table(fingerprintScores)
3216
+
3217
+ result_table = "<br>".join([text + " " + str(score) + "/" + str(total) for text, score in text_score])
3218
+
3217
3219
title = "Fingerping Fingerprinting results"
3218
3220
desc = "The fingerping tool is able to fingerprint images libraries that modify a set of png files that are " \
3219
3221
"uploaded. The original project by Dominique Bongard is located at https://github.com/0xcite/fingerping " \
@@ -3231,7 +3233,7 @@ def _fingerping(self, injector):
3231
3233
"together with the exact version of the image library on the server. Please also make sure " \
3232
3234
"that the common error case does not apply." \
3233
3235
"<br><br>{}".format(str(number_of_responses), str(len(FingerpingImages.all_images)),
3234
- result_table.replace("\n", "<br>") , repr(results))
3236
+ result_table, repr(results))
3235
3237
issue = self._create_issue_template(injector.get_brr(), title, desc, confidence, "Information")
3236
3238
self._add_scan_issue(issue)
3237
3239
@@ -6755,12 +6757,9 @@ def do_tests(self, image_dict, warn):
6755
6757
6756
6758
def get_results_table(self, scores):
6757
6759
"""Show the fingerprinting result with the most likely library match at the bottom"""
6758
- res = ''
6759
6760
nb = len(self.all_tests)
6760
- ordered = sorted(scores.iteritems(), key=lambda x: x[1])
6761
- for result in ordered:
6762
- res += '{:20s} {:3d}/{:3d}'.format(result[0], result[1], nb) + "\n"
6763
- return res
6761
+ text_score = sorted(scores.iteritems(), key=lambda x: x[1])
6762
+ return text_score, nb
6764
6763
# end modules
6765
6764
6766
6765
0 commit comments