From b4fcad617dbaffe241bac84298ea51b458da9ce6 Mon Sep 17 00:00:00 2001 From: /XNL-h4ck3r Date: Thu, 9 Feb 2023 20:14:20 +0000 Subject: [PATCH] v3.3 - see CHANGELOG.md --- CHANGELOG.md | 6 ++++++ README.md | 2 +- xnLinkFinder.py | 27 +++++++++++++++++++++++++++ xnLinkFinder/__init__.py | 2 +- 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddf0ef2..7686a1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ ## Changelog +- v3.3 + + - Changed + + - If the output filename value passed to argument `-o`, `-op` or `-owl` has a "/" in it, remove the contents after the last one to just get the path and create the directories if necessary. + - v3.2 - New diff --git a/README.md b/README.md index 6a85c85..ccf8b51 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
-## About - v3.2 +## About - v3.3 This is a tool used to discover endpoints (and potential parameters) for a given target. It can find them by: diff --git a/xnLinkFinder.py b/xnLinkFinder.py index e83bae3..d01d9aa 100644 --- a/xnLinkFinder.py +++ b/xnLinkFinder.py @@ -1086,6 +1086,15 @@ def processLinkOutput(): # If -o (--output) argument was not "cli" then open the output file if args.output != "cli": try: + # If the filename has any "/" in it, remove the contents after the last one to just get the path and create the directories if necessary + try: + f = os.path.basename(args.output) + p = args.output[:-(len(f))-1] + if p != "" and not os.path.exists(p): + os.makedirs(p) + except Exception as e: + if verbose(): + writerr(colored("ERROR processLinkOutput 5: " + str(e), "red")) outFile = open(os.path.expanduser(args.output), "w") except Exception as e: if vverbose(): @@ -1177,6 +1186,15 @@ def processParamOutput(): # If -op (--output_params) argument was not "cli" then open the output file if args.output_params != "cli": try: + # If the filename has any "/" in it, remove the contents after the last one to just get the path and create the directories if necessary + try: + f = os.path.basename(args.output_params) + p = args.output_params[:-(len(f))-1] + if p != ""''"" and not os.path.exists(p): + os.makedirs(p) + except Exception as e: + if verbose(): + writerr(colored("ERROR processParamOutput 5: " + str(e), "red")) outFile = open(os.path.expanduser(args.output_params), "w") except Exception as e: if vverbose(): @@ -1295,6 +1313,15 @@ def processWordsOutput(): # If -owl (--output_wordlist) argument was not "cli" then open the output file if args.output_wordlist != "cli": try: + # If the filename has any "/" in it, remove the contents after the last one to just get the path and create the directories if necessary + try: + f = os.path.basename(args.output_wordlist) + p = args.output_wordlist[:-(len(f))-1] + if p != "" and not os.path.exists(p): + os.makedirs(p) + except Exception as e: + if verbose(): + writerr(colored("ERROR processWordsOutput 5: " + str(e), "red")) outFile = open(os.path.expanduser(args.output_wordlist), "w") except Exception as e: if vverbose(): diff --git a/xnLinkFinder/__init__.py b/xnLinkFinder/__init__.py index dde4fc7..29f0d8a 100644 --- a/xnLinkFinder/__init__.py +++ b/xnLinkFinder/__init__.py @@ -1 +1 @@ -__version__="3.2" \ No newline at end of file +__version__="3.3" \ No newline at end of file