You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello i have Improved the Script and updated to Version 1.0 i made the following updates
Update the print statements to use parentheses for the print function.
Update the exception handling from StandardError to Exception.
Replace the if url[-1:] is "/" with if url[-1:] == "/".
Change the httplib import to http.client.
Update the imports to reflect Python 3-style imports.
Replace the except StandardError with except Exception.
Update the urllib import to requests.
Change conn.headers["content-length"] to conn.headers.get("content-length").
and heres' the new sourcecode
#!/usr/bin/env python3
import sys
import http.client
import requests
import argparse
from bs4 import BeautifulSoup
import threading
import time
dbarray = []
url = ""
useragentdesktop = {"User-Agent": "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)",
"Accept-Language": "it"}
timeoutconnection = 5
pool = None
aliversion = "1.0 Ready"
def hello():
print("-------------------------------------------")
print(" Joomla Scan ")
print(" Usage: python joomlascan.py ")
print(" Version " + aliversion + " - Updates " + str(len(dbarray)))
print("created by Andrea Draghetti , Edited By AliElTop")
print("-------------------------------------------")
def load_component():
with open("comptotestdb.txt", "r") as f:
for line in f:
dbarray.append(line[:-1]) if line[-1] == "\n" else dbarray.append(line)
Hello i have Improved the Script and updated to Version 1.0 i made the following updates
import sys
import http.client
import requests
import argparse
from bs4 import BeautifulSoup
import threading
import time
dbarray = []
url = ""
useragentdesktop = {"User-Agent": "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)",
"Accept-Language": "it"}
timeoutconnection = 5
pool = None
aliversion = "1.0 Ready"
def hello():
print("-------------------------------------------")
print(" Joomla Scan ")
print(" Usage: python joomlascan.py ")
print(" Version " + aliversion + " - Updates " + str(len(dbarray)))
print("created by Andrea Draghetti , Edited By AliElTop")
print("-------------------------------------------")
def load_component():
with open("comptotestdb.txt", "r") as f:
for line in f:
dbarray.append(line[:-1]) if line[-1] == "\n" else dbarray.append(line)
def check_url(url, path="/"):
fullurl = url + path
try:
conn = requests.get(fullurl, headers=useragentdesktop, timeout=timeoutconnection)
if conn.headers.get("content-length") != "0":
return conn.status_code
else:
return 404
except Exception:
return None
def check_url_head_content_length(url, path="/"):
fullurl = url + path
try:
conn = requests.head(fullurl, headers=useragentdesktop, timeout=timeoutconnection)
return conn.headers.get("content-length")
except Exception:
return None
def check_readme(url, component):
if check_url(url, "/components/" + component + "/README.txt") == 200:
print("\t README file found \t > " + url + "/components/" + component + "/README.txt")
def check_license(url, component):
if check_url(url, "/components/" + component + "/LICENSE.txt") == 200:
print("\t LICENSE file found \t > " + url + "/components/" + component + "/LICENSE.txt")
def check_changelog(url, component):
if check_url(url, "/components/" + component + "/CHANGELOG.txt") == 200:
print("\t CHANGELOG file found \t > " + url + "/components/" + component + "/CHANGELOG.txt")
def check_mainfest(url, component):
if check_url(url, "/components/" + component + "/MANIFEST.xml") == 200:
print("\t MANIFEST file found \t > " + url + "/components/" + component + "/MANIFEST.xml")
def check_index(url, component):
if check_url_head_content_length(url, "/components/" + component + "/index.htm") == 200 and check_url_head(url,
"/components/" + component + "/index.htm") > 1000:
print("\t INDEX file descriptive found \t > " + url + "/components/" + component + "/index.htm")
def index_of(url, path="/"):
fullurl = url + path
try:
page = requests.get(fullurl, headers=useragentdesktop, timeout=timeoutconnection)
soup = BeautifulSoup(page.text, "html.parser")
if soup.title:
titlepage = soup.title.string
if titlepage and "Index of /" in titlepage:
return True
else:
return False
else:
return False
except:
return False
def scanner(url, component):
if check_url(url, "/index.php?option=" + component) == 200:
print("Component found: " + component + "\t > " + url + "/index.php?option=" + component)
def main(argv):
load_component()
if name == "main":
main(sys.argv[1:])
The text was updated successfully, but these errors were encountered: