diff --git a/log4j-finder.py b/log4j-finder.py index 8239d55..566c4bc 100755 --- a/log4j-finder.py +++ b/log4j-finder.py @@ -290,7 +290,6 @@ def main(): help="be more quiet, disables banner and summary", ) parser.add_argument("-b", "--no-banner", action="store_true", help="disable banner") - parser.add_argument("-f", "--fail", action="store_true", help="Exit with error status when vulnerability is found") parser.add_argument( "-V", "--version", action="version", version=f"%(prog)s {__version__}" ) @@ -366,10 +365,8 @@ def main(): print_summary(stats) print(f"\nElapsed time: {elapsed:.2f} seconds") - # If we find vulnerabilities and the args -f (or --fail), then exit with a string which cause a error status on the exit. - if args.fail: - if stats["vulnerable"]: - return "Vulnerabilities found." + # If we find vulnerabilities then exit with error code (True = 1) + return stats["vulnerable"] > 0 if __name__ == "__main__": try: