åµå¯ï¼ã¹ãã£ã³
nmapã§ã¹ãã£ã³ãã¾ãã
âââ(kaliã¿kali)-[~] ââ$ nmap -P0 -sC -sV -A -p- 10.10.11.104 Starting Nmap 7.93 ( https://nmap.org ) Nmap scan report for 10.10.11.104 Host is up (0.18s latency). Not shown: 65533 closed tcp ports (conn-refused) PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 2048 53ed4440116e8bda698579c081f23a12 (RSA) | 256 bc5420ac1723bb5020f4e16e620f01b5 (ECDSA) |_ 256 33c189ea5973b1788438a421100c91d8 (ED25519) 80/tcp open http Apache httpd 2.4.29 | http-cookie-flags: | /: | PHPSESSID: |_ httponly flag not set | http-title: Previse Login |_Requested resource was login.php |_http-server-header: Apache/2.4.29 (Ubuntu) Service Info: Host: 127.0.1.1; OS: Linux; CPE: cpe:/o:linux:linux_kernel Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
TCP/22,80ãéãã¦ãããã¨ããããã¾ããããã©ã¦ã¶ã§ã¢ã¯ã»ã¹ããã¨ä»¥ä¸ã®ãããªç»é¢ã表示ããã¾ãã
dirbãniktoãªã©ãå®è¡ãã¾ãããç¹ã«ææããã«ãªãæ å ±ãè¦ã¤ãããã¾ããã§ããã
Â
ã¢ã¯ã»ã¹åå¾
対象ãµã¤ãã«curlãå®è¡ããã¨ããã©ã¦ã¶ã§è¡¨ç¤ºãããªãã£ããããªå 容ãåå¾ã§ãã¾ãããcurlã¯ãªãã¤ã¬ã¯ãã«å¾ããªããããEARã®èå¼±æ§ããããã¼ã¸ã«ã¢ã¯ã»ã¹ããã¨ãèªè¨¼ãããã¦ã¼ã¶ã¼ã«è¡¨ç¤ºãããã¯ãã®ã³ã³ãã³ãã表示ããããã¨ãããã¾ãã
Â
â»ä»åã®ãµã¤ãã¯PHPã使ç¨ãã¦ãã¾ãããPHPã®å ´åã¯die()é¢æ°ãå¼ã³åºããã¨ã§ä¸è¨ã®èå¼±æ§ã¸ã®å¯¾å¿ãã§ããããã§ãã
Â
ä¸è¨ãã¼ã¸ã®ã¢ã¯ã»ã¹ãBurpSuiteã§èª¿ã¹ã¦ã¿ã¾ãã
ãªãã¤ã¬ã¯ãããã¦ãã¾ããã¬ã¹ãã³ã¹ã«ãã¼ã¸ã®å 容ãå«ã¾ãã¦ãã¾ãã
BurpSuiteã§ã¹ãã¼ã¿ã¹ã³ã¼ãã200ã«å¤æ´ããã¨ã¢ã¯ã»ã¹ã§ãã¾ããã
BurpSuiteã使ç¨ãã¦ã¢ã«ã¦ã³ãä½æãå¯è½ã§ãã
ä½æããã¢ã«ã¦ã³ãã使ç¨ãããã¨ã§ãã°ã¤ã³ãããã¨ãã§ãã¾ããã
ãã°ã¤ã³å¾ã®ãã¼ã¸ããããFILESãã«ã¢ã¯ã»ã¹ããã¨ãµã¤ãã®ããã¯ã¢ãããè¦ã¤ããã¾ããã
ããã¯ã¢ãããã¡ã¤ã«ã®ä¸ã«ã¯config.phpã¨ãããã¡ã¤ã«ããããããã«ã¯SQLã®ã¢ã«ã¦ã³ãæ å ±ãå«ã¾ãã¦ãã¾ããã
â»ãã®ã¢ã«ã¦ã³ãã¯å¾ç¨ä½¿ç¨ãã¾ãã
Â
ã¾ãããlogs.phpãã§ã¯ã³ãã³ãå®è¡ããã¦ããã³ã¼ãã確èªããã¾ããã
æå³æ·±ãªã³ã¡ã³ããããã¾ããããã³ã¡ã³ããããã®ã¯ãã®ãã¡ã¤ã«ã ãã§ããã
logs.phpã¸ã®ã¢ã¯ã»ã¹ãBrup Suiteã§è¦ã¦ã¿ãã¨ãdelimã¨ãããã©ã¡ã¼ã¿ã使ç¨ãã¦ããããã§ããã
logs.phpã«æ¸ããã¦ããexecé¢æ°ã¯ã³ãã³ããè¨è¼ããã¦ããã ãã®ããã§ããããµãã¿ã¤ãºãªã©ããªãã®ã§ã;ãã«ç¶ãã¦pingã®ã³ãã³ããå ¥ãã¦åä½ãããã確èªãã¾ãã
å¾ ã¡åãå´ã®ã¿ã¼ããã«ã§icmpã®åä¿¡ã確èªããã¾ããã
ããã§Previseä¸ã§ã³ãã³ããå®è¡ã§ãããã¨ã確èªã§ãã¾ããã
â»python3 -c 'import pty;pty.spawn("/bin/bash")'ã§ã·ã§ã«ãã¢ããã°ã¬ã¼ããã¾ãã
Â
ç¹æ¨©ææ ¼
åå¾ããã·ã§ã«ã使ç¨ãã¦ç¹æ¨©ææ ¼ãã¾ãã
å ç¨åå¾ããMySQLã®ã¢ã«ã¦ã³ãã使ç¨ãã¦ã¿ã¾ãã
â»-pã®å¾ã¯ã¹ãã¼ã¹ãªã
Â
MySQLã¸æ¥ç¶ã§ããã®ã§æç¨ãªæ å ±ããªããæ¢ãã¦ã¿ã¾ãã
Previseã¨ããDatabaseãããã®ã§ç¢ºèªãã¦ã¿ã¾ãã
accountsã¨ãããã¼ãã«å ã«ãm4lwhereãã¨ããã¦ã¼ã¶ã確èªã§ãã¾ããã
ãã¹ã¯ã¼ãã¯ããã·ã¥åããã¦ããããã§ãã
以ä¸ã®ãµã¤ãã§ç¢ºèªããã¨ã¢ã¼ã500ã®ä¾ã®ããã«è¦ãã¾ãã
Â
以ä¸ã®ã³ãã³ããå®è¡ããã¨ãã¹ã¯ã¼ããåå¾ã§ãã¾ããã
hashcat -m 500 hash.txt /usr/share/wordlists/rockyou.txt
åå¾ãããã¹ã¯ã¼ãã§ãm4lwhereãã«å¤æ´ãã¾ãã
ãã®ã¦ã¼ã¶ã¯root権éã§ãaccess_backup.shããå®è¡ã§ããããã§ãã
ãaccess_backup.shãã®ä¸èº«ãè¦ã¦ã¿ã¾ãã
ã·ã§ã«ã¹ã¯ãªããã®ä¸ã§ãgzipãã¨ããã³ãã³ããå®è¡ãã¦ããããã§ãããå®å
¨ãªãã¹åã§ã¯ãªããããgzipãæ°ãã«ä½æãããã¨ã§root権éãåå¾ã§ãã¾ãã
Â
gzipã¨ãããã¡ã¤ã«ãä½æãã¾ãã
â»root権éã§åä½ããã®ã§ãroot.txtãã®ä¸èº«ã表示ããcatã³ãã³ããè¨è¼ããæ¹æ³ãããã¾ãã
ã¾ãããããã¦ä½æããgzipãé ç½®ããã¦ããç°å¢ãã¹ãæå®ããå¿ è¦ãããã¾ãã
m4lwhere@previse:/tmp$ export PATH=/tmp:$PATH
ä¸è¨ã®å¾ã§ãaccess_backup.shããå®è¡ãããã¨ã§root権éãåå¾ã§ãããã©ã°ãã¨ããã¨ãã§ãã¾ãã
Â
åèã«ããã¦ããã ãããµã¤ã
è²´éãªæ å ±ããããã¨ããããã¾ãã
Â
Â
Â