Download the target environment (Come and challenge! Emergency Response Target Machine Training â Web1) and set up the environment. You can directly access the Administrator account of the target machine without a password. Additionally, locate the webshell path to ensure complete control over the environment.
/>
I. Attackerâs Shell Password
On the desktop, youâll see phpStudy. Right-click and select âOpen file locationâ to get the phpStudy path: C:\phpStudy_pro.
/>
Use DShield to search for webshells in the phpStudy path, obtaining the webshell path: C:\phpStudy_pro\WWW\content\plugins\tips\shell.php.
Open the webshell file and obtain the first 16 bits of the 32-bit MD5 value of the connection password: e45e329feb5d925b.
Reverse lookup the plaintext using the MD5 value to get the webshell connection password: rebeyond.
Therefore, the answer to the first question, âAttackerâs shell password,â is: rebeyond.
Another solution is to find the webshell path through the web access log (accesslog).
In the phpStudy C:\phpStudy_pro\Extensions path, we find Apache and Nginx middleware. Checking each, we find the Nginx accesslog is empty, while the Apache accesslog is nearly 15MB.
Copy the Apache accesslog to Kali for analysis. Using the command cat access.log.1708905600 | cut -d ' ' -f 7 | sort | uniq -c | sort -nr
, we find the /content/plugins/tips/shell.php file was accessed 140,000 times, confirming itâs a webshell file.
II. Attackerâs IP Address
Using the Apache accesslog from the first question, use the command in Kali: cat access.log.1708905600 | grep shell.php | cut -d ' ' -f 1 | sort | uniq -c | sort -nr
to get the attackerâs IP address that accessed the webshell: 192.168.126.1.
Therefore, the answer to the second question, âAttackerâs IP address,â is: 192.168.126.1.
III. Attackerâs Hidden Account Name
Use the command compmgmt.msc to access Computer Management. Under System Tools -> Local Users and Groups -> Users, we find:
Therefore, the answer to the third question, âAttackerâs hidden account name,â is: hack168$.
IV. Attackerâs Mining Programâs Mining Pool Domain (Domain Only)
First, we need to find the mining program. Browsing the hidden account hack168âs user directory, we find the Kuang.exe program in the C:\Users\hack168\Desktop directory.
Running the program shows the CPU running at full capacity and malicious outbound IP activity, confirming itâs a mining program.
Using the DIE
tool, we identify the mining program as being packaged by PyInstaller.
We use pyinstxtractor
to unpack the mining program, extracting the exe file into pyc files.
We use uncompyle6
to decompile the pyc files into py files.
In the py code, the mining program makes a request to the mining pool domain wakuang.zhigongshanfang.top.
Therefore, the answer to the fourth question, âAttackerâs mining programâs mining pool domain (domain only),â is: wakuang.zhigongshanfang.top.
V. For those with the skills, attempt to fix the webshell path vulnerability
In Kali, use the command cat access.log.1708905600 | grep 192.168.126.1 | cut -d ' ' -f 7 | uniq -c | grep -v "css\|js" | less
to view the URLs accessed by the attacker.
First, the attacker accessed â/admin/account.php?action=dosignin&s=â 5736 times. The address contains keywords like âadmin,â âaccount,â and âdosignin,â suggesting a brute-force attack on the admin panelâs weak password.
Second, the attacker accessed addresses under the admin path, such as â/admin/plugin.php,â suggesting a successful brute-force attack. The address contains the keyword âplugin,â and plugin functionality often has file upload vulnerabilities, suggesting vulnerability exploitation.
Third, the attacker accessed the webshell address â/content/plugins/tips/shell.php,â suggesting successful vulnerability exploitation and webshell backdoor upload.
Searching for vulnerabilities related to the â/admin/plugin.phpâ address reveals the EMLOG blog systemâs CVE-2023-44974 file upload vulnerability.
Opening the website file âC:\phpStudy_pro\WWW\admin\plugin.phpâ confirms the website is EMLOG. This confirms that the attack was due to a CVE-2023-44974 file upload vulnerability in the EMLOG blog systemâs admin panel, where the attacker brute-forced a weak password to access the admin panel and then uploaded a webshell to control the server.
Reproducing the vulnerability: Start Apache and MySQL in phpStudy. Access the EMLOG blog system via http://127.0.0.1/.
First, manually brute-force the admin panelâs weak password. The first attempt, admin/admin, failed; however, the second attempt, admin/123456, succeeded.
Second, in the Plugins section, select âInstall Pluginâ and upload a pre-prepared plugin containing a webshell.
The plugin is a muma.zip archive with the structure muma.zip\muma\muma.php, where muma.php is the webshell file.
Third, accessing the webshell grants server access.
The recommended fix is to upgrade to the latest version and change the admin panelâs weak password.