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_psv2_final.py

Python · 2,127 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 wmic to run commands and capture to file
# Check PSv2 Windows Feature availability
stdin,stdout,stderr = ssh.exec_command(
    'dism /online /get-featureinfo /featurename:MicrosoftWindowsPowerShellV2 2>&1 | findstr /i "State"',
    timeout=15)
r = stdout.read().decode('utf-8', errors='replace')
print('PSv2 feature:', r[:300])

# Check PowerShell engine version in registry  
stdin,stdout,stderr = ssh.exec_command(
    'reg query "HKLM\\SOFTWARE\\Microsoft\\PowerShell\\1\\PowerShellEngine" /v PowerShellVersion',
    timeout=10)
r = stdout.read().decode('utf-8', errors='replace')
print('\nPS1 engine:', r[:300])

# Check PowerShell 3+ engine
stdin,stdout,stderr = ssh.exec_command(
    'reg query "HKLM\\SOFTWARE\\Microsoft\\PowerShell\\3\\PowerShellEngine" /v PowerShellVersion',
    timeout=10)
r = stdout.read().decode('utf-8', errors='replace')
print('\nPS3 engine:', r[:300])

# Check what -version 2 actually does
stdin,stdout,stderr = ssh.exec_command(
    'powershell -version 2 -c "& { $v = $PSVersionTable; Write-Host ($v.PSVersion -join \".\") }"',
    timeout=15)
r = stdout.read().decode('utf-8', errors='replace')
err = stderr.read().decode('utf-8', errors='replace').strip()
print('\nPSv2 version cmd:', repr(r[:200]))
if err: print('PSv2 err:', repr(err[:200]))

# Write PS1 that checks version and writes to file
script = '''$v = $PSVersionTable.PSVersion
$v.ToString() | Out-File C:\\Users\\Public\\psver.txt
'''
sftp = ssh.open_sftp()
with sftp.open('C:\\Users\\Public\\psver.ps1', 'w') as f:
    f.write(script)
sftp.close()

ssh.exec_command('powershell -version 2 -File C:\\Users\\Public\\psver.ps1', timeout=10)
time.sleep(2)

stdin,stdout,stderr = ssh.exec_command(
    'powershell -Command "Write-Host ([System.IO.File]::ReadAllText(\"C:\\Users\\Public\\psver.txt\"))"',
    timeout=10)
r = stdout.read().decode('utf-8', errors='replace')
print('\nPSv2 version from file:', repr(r[:200]))

ssh.close()