|
Menu |
|
|
Home |
| |
|
Discussions |
| |
|
Tools |
| |
|
Affiliates |
| |
|
Content |
| |
|
Info |
| | |
|
|
|
|
|
User Info |
|
Membership:
Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9144
People Online:
Visitors: 144
Members: 0
Total: 144
|
|
|
|
|
|
Full disclosure |
|
|
|
|
|
|
|
|
|
IT Security and Insecurity Portal |
|
|
please decpde 2 file (ioncube) |
|
Posted: Wed Dec 12, 2012 10:38 pm |
|
|
erick |
Regular user |
|
|
Joined: Aug 03, 2012 |
Posts: 9 |
|
|
|
|
|
|
|
|
Last edited by erick on Wed Dec 26, 2012 5:24 am; edited 1 time in total |
|
|
|
|
|
|
|
Posted: Wed Dec 12, 2012 11:32 pm |
|
|
vv456 |
Advanced user |
|
|
Joined: Aug 24, 2012 |
Posts: 190 |
|
|
|
|
|
|
|
Hello my friend follows your files:
danginxvhost.php
Code: | <?php
include( "lib.php" );
$lines = file( "/etc/danginx/data.conf" );
foreach ( $lines as $key )
{
$term = explode( ":", trim( $key ) );
if ( $term[0] == "LICENSE" )
{
$key = $term[1];
break;
break;
}
}
$licensekey = $key;
$localkey = shell_exec( "/bin/cat /etc/danginx/localkey.txt" );
$results = check_license( $licensekey, $localkey );
if ( $results['status'] == "Active" )
{
$vhostDate = "#Auto generated vhost configuration by Da Nginix. Any customization will be lost\n";
$DBINO = array( );
$GLOBIP = "";
if ( $handle = opendir( "/usr/local/directadmin/data/users" ) )
{
$_file_list = "";
while ( false !== ( $file = readdir( $handle ) ) )
{
if ( $file != "." && $file != ".." )
{
$_file_list .= $file.":";
}
}
closedir( $handle );
}
$cPuser = explode( ":", $_file_list );
sort( $cPuser );
$ArrLen = count( $cPuser );
$cpUsernumber = $ArrLen - 1;
$i = 1;
while ( $i <= $cpUsernumber )
{
$USER = $cPuser[$i];
$domain = file( "/usr/local/directadmin/data/users/{$USER}/domains.list" );
$dom_count = count( $domain );
$j = 0;
while ( $j < $dom_count )
{
$DOMAIN = trim( $domain[$j] );
$ux = file( "/usr/local/directadmin/data/users/{$USER}/user.conf" );
foreach ( $ux as $line_num => $line )
{
if ( preg_match( "/^ip=/", $line ) )
{
$ipdata = explode( "=", $line );
$GLOBIP = trim( $ipdata[1] );
break;
break;
}
}
if ( file_exists( "/usr/local/directadmin/data/users/{$USER}/domains/{$DOMAIN}.conf" ) )
{
$uf = file( "/usr/local/directadmin/data/users/{$USER}/domains/{$DOMAIN}.conf" );
foreach ( $uf as $line_num => $line )
{
if ( preg_match( "/^ip=/", $line ) )
{
$ipdata = explode( "=", $line );
$DOMIP = trim( $ipdata[1] );
break;
}
$DOMIP = $GLOBIP;
}
$DOMDOCROOT = "/home/{$USER}/domains/{$DOMAIN}/public_html";
$ACCESSLOG = "/var/log/httpd/domains/{$DOMAIN}.log";
}
if ( file_exists( "/etc/danginx/expires/{$DOMAIN}" ) && filesize( "/etc/danginx/expires/{$DOMAIN}" ) != 0 )
{
$exp_line = file( "/etc/danginx/expires/{$DOMAIN}" );
$EXPIRE = trim( $exp_line[0] );
}
else
{
$EXPIRE = "24h";
}
if ( file_exists( "/etc/danginx/custom/{$DOMAIN}" ) && filesize( "/etc/danginx/custom/{$DOMAIN}" ) != 0 )
{
$CUSTOM = "include \"/etc/danginx/custom/".$DOMAIN."\"";
}
else
{
$CUSTOM = "#include \"/etc/danginx/custom/".$DOMAIN."\"";
}
$fval = "{$DOMAIN}"."|"."{$DOMIP}"."|"."{$DOMDOCROOT}"."|"."{$ACCESSLOG}"."|"."{$EXPIRE}"."|"."{$CUSTOM}";
$DBINO[] = $fval;
$POINTERFILE = "/usr/local/directadmin/data/users/{$USER}/domains/{$DOMAIN}.pointers";
if ( file_exists( $POINTERFILE ) && filesize( "{$POINTERFILE}" ) != 0 )
{
$PDOMAIN = array( );
$pfile = file( $POINTERFILE );
foreach ( $pfile as $line_num => $line )
{
$tmx = explode( "=alias", $line );
$PDOMAIN[$line_num] = trim( $tmx[0] );
}
foreach ( $PDOMAIN as $XDOMAIN )
{
$fval = "{$XDOMAIN}"."|"."{$DOMIP}"."|"."{$DOMDOCROOT}"."|"."{$ACCESSLOG}"."|"."{$EXPIRE}"."|"."{$CUSTOM}";
$DBINO[] = $fval;
}
}
if ( file_exists( "/usr/local/directadmin/data/users/{$USER}/domains/{$DOMAIN}.subdomains" ) )
{
$subdomain = file( "/usr/local/directadmin/data/users/{$USER}/domains/{$DOMAIN}.subdomains" );
$subdom_count = count( $subdomain );
if ( 0 < $subdom_count )
{
$k = 0;
while ( $k < $subdom_count )
{
$sub = trim( $subdomain[$k] );
$SUBDOMAIN = "{$sub}"."."."{$DOMAIN}";
$SUBDOCROOT = "/home/{$USER}/domains/{$DOMAIN}/public_html/{$sub}";
$SUBACCESSLOG = "/var/log/httpd/domains/{$DOMAIN}.{$sub}.log";
if ( file_exists( "/etc/danginx/expires/{$SUBDOMAIN}" ) && filesize( "/etc/danginx/expires/{$Var_8904}" ) != 0 )
{
$exp_line = file( "/etc/danginx/expires/{$SUBDOMAIN}" );
$EXPIRE = trim( $exp_line[0] );
}
else
{
$EXPIRE = "24h";
}
if ( file_exists( "/etc/danginx/custom/{$SUBDOMAIN}" ) && filesize( "/etc/danginx/custom/{$SUBDOMAIN}" ) != 0 )
{
$CUSTOM = "include \"/etc/danginx/custom/".$SUBDOMAIN."\"";
}
else
{
$CUSTOM = "#include \"/etc/danginx/custom/".$SUBDOMAIN."\"";
}
$fval = "{$SUBDOMAIN}"."|"."{$DOMIP}"."|"."{$SUBDOCROOT}"."|"."{$SUBACCESSLOG}"."|"."{$EXPIRE}"."|"."{$CUSTOM}";
$DBINO[] = $fval;
++$k;
}
}
}
++$j;
}
++$i;
}
$vhlines = file( "/etc/danginx/vhost.conf" );
$PROXYCONF = "\n";
foreach ( $vhlines as $key )
{
$PROXYCONF .= " ".$key;
}
$linesext = file( "/etc/danginx/fileextensions.txt" );
foreach ( $linesext as $key )
{
if ( preg_match( "/\\|/", $key ) )
{
$file_est = trim( $key );
}
}
foreach ( $DBINO as $DB )
{
$tmpar = explode( "|", $DB );
$DOMAIN = $tmpar[0];
$DOMIP = $tmpar[1];
$DOMDOCROOT = $tmpar[2];
$ACCESSLOG = $tmpar[3];
$EXPIRETIME = $tmpar[4];
$CUSTOMINCLUDE = $tmpar[5];
if ( !file_exists( "/etc/danginx/direct/{$DOMAIN}" ) )
{
$Var_12000 .= "#################################################################\n########### Vhost configuration of {$DOMAIN}\n#################################################################\nserver {\naccess_log off;\nerror_log logs/vhost-error_log warn;\nlisten 80;\nserver_name {$DOMAIN} www.{$DOMAIN};\nlocation ~* ^.+.({$file_est})$ {\n expires {$EXPIRETIME};\n root {$DOMDOCROOT};\n error_page 404 = @apache;\n access_log {$ACCESSLOG};\n log_not_found off;\n }\nlocation ~ /\\.ht {\n deny all;\n }\n\nlocation / {\n log_not_found off;\n{$PROXYCONF}\n proxy_redirect http://www.{$DOMAIN}:8888 http://www.{$DOMAIN};\n proxy_redirect http://{$DOMAIN}:8888 http://{$DOMAIN};\n proxy_pass http://{$DOMIP}:8888/;\n proxy_set_header Host \$host;\n proxy_set_header X-Real-IP \$remote_addr;\n proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;\n }\nlocation @apache {\n internal;\n{$PROXYCONF}\n proxy_redirect http://{$DOMAIN}:8888 http://{$DOMAIN};\n proxy_pass http://{$DOMIP}:8888;\n proxy_set_header Host \$host;\n proxy_set_header X-Real-IP \$remote_addr;\n proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;\n }\n{$CUSTOMINCLUDE};\n}\n";
}
else
{
$vhostDate .= "#################################################################\n########### Vhost configuration of {$DOMAIN} in Direct Proxy\n#################################################################\nserver {\naccess_log off;\nerror_log logs/vhost-error_log warn;\nlisten 80;\nserver_name {$DOMAIN} www.{$DOMAIN};\nlocation ~ /\\.ht {\n deny all;\n }\nlocation / {\n log_not_found off;\n{$PROXYCONF}\n proxy_redirect http://www.{$DOMAIN}:8888 http://www.{$DOMAIN};\n proxy_redirect http://{$DOMAIN}:8888 http://{$DOMAIN};\n proxy_pass http://{$DOMIP}:8888/;\n proxy_set_header Host \$host;\n proxy_set_header X-Real-IP \$remote_addr;\n proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;\n }\n{$CUSTOMINCLUDE};\n\n}\n";
}
}
$fh = fopen( "/usr/local/nginx/conf/vhost.conf", "w" );
fwrite( $fh, $vhostDate );
fclose( $fh );
system( "/etc/init.d/nginx reload" );
if ( $results['localkey'] )
{
$localkeydata = $results['localkey'];
$cachekeyfile = "/etc/danginx/localkey.txt";
if ( !( $fh = fopen( $cachekeyfile, "w" ) ) )
{
exit( "can't open file" );
}
$stringData = $localkeydata;
fwrite( $fh, $stringData );
fclose( $fh );
}
}
else if ( $results['status'] == "Invalid" )
{
print "License key not found. If you already have the license key, please update the key ";
$fh = fopen( "/usr/local/nginx/conf/vhost.conf", "w" );
fwrite( $fh, "#Invalid license" );
fclose( $fh );
}
else
{
if ( $results['status'] == "Expired" )
{
print "Your License key Expired . Please purchase the key and reactivate it.";
$fh = fopen( "/usr/local/nginx/conf/vhost.conf", "w" );
fwrite( $fh, "#License Expired" );
fclose( $fh );
}
else
{
if ( $results['status'] == "Suspended" )
{
print "Your License key is Suspended. Please contact our support team from https://portal.syslint.com/supporttickets.php";
$fh = fopen( "/usr/local/nginx/conf/vhost.conf", "w" );
fwrite( $fh, "#License Suspended" );
fclose( $fh );
}
}
}
?>
|
lib.php
Code: | <?php
function check_license( $licensekey, $localkey )
{
$chy = curl_init( );
curl_setopt( $chy, CURLOPT_URL, "http://portal.syslint.com/modules/servers/licensing/wimip.php" );
curl_setopt( $chy, CURLOPT_RETURNTRANSFER, 1 );
$ip = curl_exec( $chy );
$HIP = $ip;
curl_close( $chy );
$whmcsurl = "http://portal.syslint.com/";
$licensing_secret_key = "cs+PWxyjyprot4pc4xebwzkbf";
$checkdate = date( "Ymd" );
$usersip = $ip;
$localkeydays = 7;
$allowcheckfaildays = 2;
$localkeyvalid = false;
if ( $localkey )
{
$localkey = str_replace( "\n", "", $localkey );
$localdata = substr( );
$md5hash = substr( $localkey, strlen( $localkey ) - 32 );
if ( $md5hash == md5( $localdata.$licensing_secret_key ) )
{
$localdata = strrev( $localdata );
$md5hash = substr( $localdata, 0, 32 );
$localdata = substr( $localdata, 32 );
$localdata = base64_decode( $localdata );
$localkeyresults = unserialize( $localdata );
$originalcheckdate = $localkeyresults['checkdate'];
if ( $md5hash == md5( $originalcheckdate.$licensing_secret_key ) )
{
$localexpiry = date( "Ymd", mktime( 0, 0, 0, date( "m" ), date( "d" ) - $localkeydays, date( "Y" ) ) );
if ( $localexpiry < $originalcheckdate )
{
$localkeyvalid = true;
$results = $localkeyresults;
$validdomains = explode( ",", $results['validdomain'] );
if ( !in_array( $_SERVER['SERVER_NAME'], $validdomains ) )
{
$localkeyvalid = false;
$localkeyresults['status'] = "Invalid";
$results = array( );
}
$validips = explode( ",", $results['validip'] );
if ( !in_array( $usersip, $validips ) )
{
$localkeyvalid = false;
$localkeyresults['status'] = "Invalid";
$results = array( );
}
if ( $results['validdirectory'] != dirname( __FILE__ ) )
{
$localkeyvalid = false;
$localkeyresults['status'] = "Invalid";
$results = array( );
}
}
}
}
}
if ( !$localkeyvalid )
{
if ( isset( $_SERVER['HOSTNAME'] ) )
{
$hostname = trim( $_SERVER['HOSTNAME'] );
}
else
{
$hostname = "localhost";
}
$postfields['licensekey'] = $licensekey;
$postfields['domain'] = $hostname;
$postfields['ip'] = $HIP;
$postfields['dir'] = "/usr/local/directadmin/plugins/danginx";
if ( function_exists( "curl_exec" ) )
{
$ch = curl_init( );
curl_setopt( $ch, CURLOPT_URL, $whmcsurl."modules/servers/licensing/verify.php" );
curl_setopt( $ch, CURLOPT_POST, 1 );
curl_setopt( $ch, CURLOPT_POSTFIELDS, $postfields );
curl_setopt( $ch, CURLOPT_TIMEOUT, 30 );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
$data = curl_exec( $ch );
curl_close( $ch );
}
else
{
$fp = fsockopen( $whmcsurl, 80, $errno, $errstr, 5 );
if ( $fp )
{
$querystring = "";
foreach ( $postfields as $k => $v )
{
$querystring .= "{$k}=".urlencode( $v )."&";
}
$header = "POST ".$whmcsurl."modules/servers/licensing/verify.php HTTP/1.0\r\n";
$header .= "Host: ".$whmcsurl."\r\n";
$header .= "Content-type: application/x-www-form-urlencoded\r\n";
$header .= "Content-length: ".@strlen( @$querystring )."\r\n";
$header .= "Connection: close\r\n\r\n";
$header .= $querystring;
$data = "";
@stream_set_timeout( @$fp, 20 );
@fputs( @$fp, @$header );
$status = @socket_get_status( @$fp );
while ( !feof( @$fp ) && $status )
{
$data .= @fgets( @$fp, 1024 );
$status = @socket_get_status( @$fp );
}
@fclose( @$fp );
}
}
if ( !$data )
{
$localexpiry = date( "Ymd", mktime( 0, 0, 0, date( "m" ), date( "d" ) - ( $localkeydays + $allowcheckfaildays ), date( "Y" ) ) );
if ( $localexpiry < $originalcheckdate )
{
$results = $localkeyresults;
}
else
{
$results['status'] = "Remote Check Failed";
return $results;
}
}
preg_match_all( "/<(.*?)>([^<]+)<\\/\\1>/i", $data, $matches );
$results = array( );
foreach ( $matches[1] as $k => $v )
{
$results[$v] = $matches[2][$k];
}
if ( $results['status'] == "Active" )
{
$results['checkdate'] = $checkdate;
$data_encoded = serialize( $results );
$data_encoded = base64_encode( $data_encoded );
$data_encoded = md5( $checkdate.$licensing_secret_key ).$data_encoded;
$data_encoded = strrev( $data_encoded );
$data_encoded = $data_encoded.md5( $data_encoded.$licensing_secret_key );
$data_encoded = wordwrap( $data_encoded, 80, "\n", true );
$results['localkey'] = $data_encoded;
}
$results['remotecheck'] = true;
}
unset( $postfields );
unset( $data );
unset( $matches );
unset( $whmcsurl );
unset( $licensing_secret_key );
unset( $checkdate );
unset( $usersip );
unset( $localkeydays );
unset( $allowcheckfaildays );
unset( $md5hash );
return $results;
}
?>
|
|
|
|
|
|
|
www.waraxe.us Forum Index -> PHP script decode requests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT
Page 1 of 1
|
|
|
Powered by phpBB © 2001-2008 phpBB Group
|
|
|
|
|
|