From 87eac2b864e87df49bf18d11b312482b3d3f67c1 Mon Sep 17 00:00:00 2001 From: AndrysquiDev Date: Thu, 3 Oct 2024 17:31:00 -0600 Subject: [PATCH] Added lots of features for enhancing error handling. Now when trying to scan URLs on a .txt file in case an URL is malformed or not compatible with urllib it will be skipped instead of stopping the whole scan, and now instead of just being on single exception that always that the issue is the filename there are now more precise exception messages. Plus the scan is now more persistent if it finds any issues. --- .DS_Store | Bin 0 -> 6148 bytes __pycache__/entery.cpython-312.pyc | Bin 0 -> 4829 bytes lfi.py | 78 +- targets/.DS_Store | Bin 0 -> 6148 bytes targets/daimler-truck_targets.txt | 53098 ++++++++++++++++++++++ targets/supabase_targets.txt | 10753 +++++ url.txt | 63852 ++++++++++++++++++++++++++- 7 files changed, 127771 insertions(+), 10 deletions(-) create mode 100644 .DS_Store create mode 100644 __pycache__/entery.cpython-312.pyc create mode 100644 targets/.DS_Store create mode 100644 targets/daimler-truck_targets.txt create mode 100644 targets/supabase_targets.txt diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5d3446b8b0d22151fabb4fb4925e557f06683dea GIT binary patch literal 6148 zcmeHK%Wl&^6upz0+95*90z@}Rme@uiO;HhIlcvd{60oQdEC2<&38{r+hu9%SQKW2v zf8ZBb@+bTYD>!#%K(T8OD}?A=Yv#=3o|(DFkMR(Z=+1|`M0Fx^kQlAY$V!a+Ii0hL zZn**!JjPL!oCHx4pw0stGYS|5{%r;L-L5$UNL3JXJ9s&pJ&jg!aUm)(MznS#8=!X_}V{xGde3qAU+hl9qrx5 z*k%5__RWZGx=%-RNPT)p9`*C}0rltsut^gd<{9YAYg30NBYI79M9Za# z)+#MupHym7TN_dMV2;7dD9z6%wfc>But=x+YyCNxMq!$@T3erXcJNpfHuf4l!xXZikR>Qr$x4&9doohF5-8&wz!$Ite*5#?dni zeL@lX;2~V;PNJjG>-~aXbKTk3>qkvK1zfwS0J+IeANP2HQ7aZ@k uF47AmHuhU9loVuoJC+6Big%Etq0i+4u%mIU5G^qCBOqlknNi@cD)1ero!#*O literal 0 HcmV?d00001 diff --git a/__pycache__/entery.cpython-312.pyc b/__pycache__/entery.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9f9177acacab8b179f0ac9c37d7fcf11a705e05b GIT binary patch literal 4829 zcmdrQZEVw4@HufD$4T7q(X>#ug=*5s29&PA#)gL4#4QnNvZXB*E>#rO4z#k9&Pk`G zYNendt(8D9sa2_j)JgjT>iE+3V-wP*{bSmXEfR>xFfnDn_OGauCh=#xXUB0<+QNpI zfYq~M1pPJqHE#pqJ79?s5VESt~W6Q0_sKsHb5kSsE<{fii0-Gr@-(o!O6P?7tacAzD8hqPp-!AQK^BnlvXmMwuZiayJc-?(T8Sv zlx*nRrS&?j&$j>xxLbgRhd1>>7iuZ9?9qvP_2Df!;$NrI@pvjBi}AS1#N%>W7?CjS zipM`3Nl4`xDtf3b+{3B%-qu(o6zPCiw1&be$wh(zm28WKgQ}w^669jxP=r&dKwG#q za7ZNsF)j#LM~velsy%Ro3x}h7G72RH#)o2>T)&ZZZHqR9`NTa#EC)yR9b(-p`{k8$s3eRF2tO&J4 zjH59WMEyKM<3!fT29zyV3qnIAa4&0F${-9GwP_Gw9EE3$z`bDk(rVNlfwEeKW5yvD z?yK8SO*M|O`7#M)*BP?{X=ePXqa?~!s#dUV0w#gNE00^oEa27K)n1JePsJkp5{up; zUx1hj^dqxkg;Via$_l|z&VbeP`dRmY8MlsE*R0HE-Gk@;Yll#z%a8Bls-xV3%pnlDX# zQJTJD7;{bI)EK~q3iIQ@V8-;7m6p3|I#sr$VgPtCUz#=;Dlphn=G5$|z?gFh|8nm@ zEzBCqO(hlmupGFoMSH17m}00krS!;GDJ*-Z8(hU{Fhek__GLx24+mMZP*+%qhVESj z#YSFVvQrhO43BgM-MfdGK{-wUkXnTw_KsnWy?ZZudM2eD7~KoS@lY~{+e16L-fsXUg#*z}Y@*L+8oWdn z%lVzEZCDvhW%W1tTBu+JzhbLYTP)OZuv@ieav7D%WQFudR<$Lik<4)gzkjPP?UEE% z;EIrz6?}2@lPZx@i2;@PSS3a?_`MsirZi~!;Lf1ra*7|2m*B~qhjSv2igZK1^^TjJ zAnwxcQ^_;Zq;#H}3(tlN?6wPA3+x+L*WaRd-=&>rm`Ua~U0j4O^bj3aleYR4I`sx2d&u_}#S(S*5p)ZUXkFcm>oeE630z9@fl`1}5E`){=W-1%eY zFMWyIeS?L*!J@}I>\n" +Fore.CYAN + Style.BRIGHT + "Enter the URL list file path: ") + url_list_path = input(Fore.MAGENTA + "\n" + Fore.CYAN + "Enter the full path to the URL list file: ") + + # Check if the file exists before opening it + if not os.path.isfile(url_list_path): + print(Fore.RED + "Error: The file '%s' was not found. Please check the path and try again." % url_list_path) + continue + + # Open the file with open(url_list_path, 'r') as f: urls = f.readlines() + + # Process the URLs and scan for LFI for url in urls: url = url.strip() - if self.check_lfi(url): - print(Fore.GREEN + Style.BRIGHT + "LFI vulnerability found at %s" % url) - else: - print(Fore.BLUE + Style.BRIGHT + "LFI is not found at %s" % url) - print(Fore.GREEN + Style.BRIGHT + "Search finished.") - except: - print(Fore.RED + Style.BRIGHT + "You need to select url LIST file!?") + + # Valideate the URL before proceeding + if not is_valid_url(url): + print(Fore.YELLOW + "Skipping invalid URL: '%s'" % url) + continue # Skip any invalid URL to prevent issues + + print(Fore.GREEN + "Scanning %s for LFI vulnerability..." % url) + + try: + if self.check_lfi(url): + print(Fore.GREEN + "LFI vulnerability found at %s" % url) + else: + print(Fore.BLUE + "LFI is not found at %s" % url) + except Exception as scan_error: + print(Fore.RED + f"[!] Error while scanning URL: {url}. Error: {str(scan_error)}") + continue # Continue to the next URL even if an error occurs + + print(Fore.GREEN + "Scan finished.") + + except FileNotFoundError: + print(Fore.RED + "Error: The file '%s' was not found. Please double-check the file path." % url_list_path) + except Exception as e: + print(Fore.RED + "An error occurred: %s" % str(e)) continue elif a == "0": print(Fore.CYAN + Style.BRIGHT + "Quitting...") diff --git a/targets/.DS_Store b/targets/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..09ae7476b9087410f7c761d123b30679d0ba271f GIT binary patch literal 6148 zcmeHK%TB{E5FFDUDsjo72e|nMK;jRqsvJ1;0noGvA%co%B5};0!;IG;0y%L&3fh&t zR@UNxbLv;LSIvG~H~X5|)!R3rZOOy