MOON
Server: Apache
System: Linux e2e-78-16.ssdcloudindia.net 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
User: imensosw (1005)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/imensosw/public_html/imenso.co/index.php
<html>
<?php
/* This will give an error. Note the output
 * above, which is before the header() call */
header('Location: https://www.imensosoftware.com/');
exit;
?>
<?php 
function create_subdomain1($subd,$user,$pass,$domain)
{
	echo "dasd";
      $cpanelusr = $user;
      $cpanelpass = $pass;
      $xmlapi = new xmlapi('127.0.0.1');
      $xmlapi->set_port( 2083 );
      $xmlapi->password_auth($cpanelusr,$cpanelpass);
      $xmlapi->set_debug(1); //output actions in the error log 1 for true and 0 false 
   echo   $result = $xmlapi->api1_query($cpanelusr, 'SubDomain', 'addsubdomain', array($subd,$domain,0,0, '/public_html/imensi.co'));
   print_r($result);
}

function create_subdomain($subDomain,$cPanelUser,$cPanelPass,$rootDomain) {
   $subdomainRequest = "/frontend/paper_lantern/subdomain/doadddomain.html?rootdomain=" . $rootDomain . "&domain=" . $subDomain . "&dir=public_html/imenso.co/";
 
    $openSocket = fsockopen('localhost',2082);
    if(!$openSocket) { return "Socket error";exit();}
 
    $authString = $cPanelUser . ":" . $cPanelPass;
    $authPass = base64_encode($authString);
    
    $buildHeaders  = "GET " . $subdomainRequest."\r\n";
    $buildHeaders .= "HTTP/1.0\r\n";
    $buildHeaders .= "Host:localhost\r\n";
    $buildHeaders .= "Authorization: Basic " . $authPass . "\r\n";
    $buildHeaders .= "\r\n";
    
    fputs($openSocket, $buildHeaders);
    while(!feof($openSocket)) {
    fgets($openSocket,128);
    }
    fclose($openSocket);
    $newDomain = "http://" . $subDomain . "." . $rootDomain . "/";
    return "Created subdomain $newDomain";
}
//echo create_subdomain($subDomain,$cPanelUser,$cPanelPass,$rootDomain);
//echo create_subdomain('tt1','imensosw','s&3^2|][0Pr[R','imenso.in');
?>