Exploit databaseDownload repository ZIP
GH-c303cd19cf2ce91c5c8438a664734ec9
opathedane/php2shell
Sources for CVE-2026-109618
412 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files120
opathedane/php2shellRevision a4b37af49ff5
- ↑..Parent directory
- advisory_session_upload.go
- advisory_session_upload_test.go
- apache.go
- apache_test.go
- audit_test.go
- binary_version.go
- binary_version_test.go
- buildinfo.go
- compat.go
- compat_other.go
- compat_test.go
- compat_windows.go
- deep_discover.go
- deep_discover_coverage_test.go
- deep_discover_reparse_test.go
- deep_discover_test.go
- demo_process_telemetry_test.go
- demo_reports_test.go
- demo_webroot_investigation_test.go
- diagnostics.go
- diagnostics_test.go
- discovery_coverage.go
- error_logs.go
- example_reports_gen_test.go
- file_birthtime_darwin.go
- file_birthtime_freebsd.go
- file_birthtime_linux.go
- file_birthtime_stub.go
- file_birthtime_unix.go
- file_birthtime_windows.go
- files.go
- files_symlink_test.go
- fixture_times_darwin_test.go
- fixture_times_other_test.go
- fixture_times_windows_test.go
- fleet_csv.go
- fleet_csv_test.go
- fleet_rollup.go
- gen_readme_asset_test.go
- host.go
- host_options.go
- iis.go
- iis_e2e_regression_test.go
- iis_handler.go
- iis_handler_test.go
- iis_site_test.go
- indicator_test.go
- indicators.go
- install_alias.go
- investigation.go
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
internal/audit/windows_process_test.go
Go · 2,980 bytespackage audit
import (
"testing"
"time"
)
func TestWalkWindowsProcessListAlwaysAdvances(t *testing.T) {
const n = 5000
entries := make([]windowsProc, n)
for i := 0; i < n; i++ {
entries[i] = windowsProc{PID: uint32(i + 1), Name: "svchost.exe"}
}
entries[0] = windowsProc{PID: 42, Name: "php2shell-windows-amd64.exe"} // self
entries[10] = windowsProc{PID: 100, Name: "php-cgi.exe"}
entries[11] = windowsProc{PID: 101, Name: "php.exe"}
entries[12] = windowsProc{PID: 102, Name: "w3wp.exe"}
entries[13] = windowsProc{PID: 103, Name: "phpunit"} // must not match
done := make(chan struct{})
var visited int
var matched []windowsProc
go func() {
visited = walkWindowsProcessList(entries, func(p windowsProc) {
if int(p.PID) == 42 {
return
}
if !IsPHPRuntimeProcessName(p.Name) {
return
}
matched = append(matched, p)
})
close(done)
}()
select {
case <-done:
case <-time.After(2 * time.Second):
t.Fatal("process walk hung — advancement likely skipped on continue paths")
}
if visited != n {
t.Fatalf("visited %d want %d", visited, n)
}
if len(matched) != 3 {
t.Fatalf("matched=%+v", matched)
}
}
func TestSelectWindowsPHPProcessesExcludesSelfAndNonPHP(t *testing.T) {
entries := []windowsProc{
{PID: 1, Name: "php2shell.exe"},
{PID: 2, Name: "chrome.exe"},
{PID: 3, Name: "php-cgi.exe"},
{PID: 4, Name: "php.exe"},
{PID: 5, Name: "w3wp.exe"},
{PID: 6, Name: "phpmyadmin"},
}
recorded, count := selectWindowsPHPProcesses(entries, 1, 256)
if count != 3 {
t.Fatalf("count=%d", count)
}
if len(recorded) != 3 {
t.Fatalf("%+v", recorded)
}
for _, p := range recorded {
if int(p.PID) == 1 || p.Name == "phpmyadmin" || p.Name == "chrome.exe" {
t.Fatalf("unexpected %+v", p)
}
}
}
func TestSelectWindowsPHPProcessesRespectsMaxRecord(t *testing.T) {
var entries []windowsProc
for i := 0; i < 10; i++ {
entries = append(entries, windowsProc{PID: uint32(100 + i), Name: "php.exe"})
}
recorded, count := selectWindowsPHPProcesses(entries, 0, 3)
if count != 10 || len(recorded) != 3 {
t.Fatalf("count=%d recorded=%d", count, len(recorded))
}
}
func TestBuggyContinueBeforeAdvanceWouldHang(t *testing.T) {
// Documents the CI failure mode: continue before Next never advances.
entries := []windowsProc{
{PID: 1, Name: "svchost.exe"},
{PID: 2, Name: "php.exe"},
}
i := 0
steps := 0
for {
steps++
if steps > 100 {
// Expected for the buggy pattern when the first entry is skipped.
break
}
e := entries[i]
if e.Name != "php.exe" {
continue // BUG: skips i++
}
i++
if i >= len(entries) {
break
}
}
if steps <= 100 {
t.Fatal("expected buggy pattern to spin; rewrite failed to demonstrate the hazard")
}
// Fixed pattern finishes in len(entries) steps.
steps = 0
i = 0
for {
steps++
_ = entries[i]
i++ // always advance
if i >= len(entries) {
break
}
}
if steps != len(entries) {
t.Fatalf("fixed pattern steps=%d", steps)
}
}