Waraxe IT Security Portal
Login or Register
June 17, 2025
Menu
Home
Logout
Discussions
Forums
Members List
IRC chat
Tools
Base64 coder
MD5 hash
CRC32 checksum
ROT13 coder
SHA-1 hash
URL-decoder
Sql Char Encoder
Affiliates
y3dips ITsec
Md5 Cracker
User Manuals
AlbumNow
Content
Content
Sections
FAQ
Top
Info
Feedback
Recommend Us
Search
Journal
Your Account
User Info
Welcome, Anonymous
Nickname
Password
(Register)

Membership:
Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9144

People Online:
Visitors: 61
Members: 0
Total: 61
Full disclosure
SEC Consult SA-20250604-0 :: Local Privilege Escalation and Default Credentials in INDAMED - MEDICAL OFFICE (Medical practice management) Demo version
Full Disclosure: CVE-2025-31200 & CVE-2025-31201 – 0-Click iMessage Chain ? Secure Enclave Key Theft, Wormable RCE, Crypto Theft
Defense in depth -- the Microsoft way (part 89): user grouppolicies don't deserve tamper protection
CVE-2025-45542: Time-Based Blind SQL Injection in CloudClassroom PHP Project v1.0
ERPNext v15.53.1 Stored XSS in bio Field Allows Arbitrary Script Execution in Profile Page
ERPNext v15.53.1 Stored XSS in user_image Field Allows Script Execution via Injected Image Path
Local information disclosure in apport and systemd-coredump
Stored XSS via File Upload - adaptcmsv3.0.3
IDOR "Change Password" Functionality - adaptcmsv3.0.3
Stored XSS "Send Message" Functionality - adaptcmsv3.0.3
Authenticated File Upload to RCE - adaptcmsv3.0.3
Stored XSS in "Description" Functionality - cubecartv6.5.9
Multiple Vulnerabilities in SAP GuiXT Scripting
CVE-2024-47081: Netrc credential leak in PSF requests library
Exploit CVE-2019-9978: Remote Code Execution in Social Warfare WordPress Plugin (<= 3.5.2)
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> PHP script decode requests -> SOlved
Post new topicReply to topic View previous topic :: View next topic
SOlved
PostPosted: Fri Jan 04, 2013 8:13 pm Reply with quote
david
Advanced user
Advanced user
Joined: Jan 04, 2013
Posts: 58




Solved


Last edited by david on Thu Mar 07, 2013 10:53 pm; edited 1 time in total
View user's profile Send private message Visit poster's website
Can somebody help please
PostPosted: Sat Jan 05, 2013 8:48 pm Reply with quote
david
Advanced user
Advanced user
Joined: Jan 04, 2013
Posts: 58




solved


Last edited by david on Thu Mar 07, 2013 10:53 pm; edited 1 time in total
View user's profile Send private message Visit poster's website
PostPosted: Mon Jan 07, 2013 10:30 am Reply with quote
vv456
Advanced user
Advanced user
Joined: Aug 24, 2012
Posts: 190




Decoded

Code:
<?php class template { public $tplpath = './templates/'; public $currenttpl = 'clipcms'; public $cache = true; private $variables = array(); private $blockvars = array(); public function reparse($str) { $return = $this->parser($str); return $return; } public function display($filename) { global $url; $file = $this->tplpath . $this->currenttpl . '/' . $filename; $this->assignarray(array( 'TPL_PATH' => $url."/".$this->tplpath . $this->currenttpl, 'TPL_PATH_COMMON' => $url."/".$this->tplpath . "common" )); if(!file_exists($file)) { $error = debug_backtrace(); echo "<html><head><title>Error in file "; print_r($error[0]['file']); echo " ;;on line "; @print_r($error[0]['line']); echo "</title></head><body><font face='Arial'><h4 title='File ";@print_r($error[0]['file']);echo " line ";@print_r($error[0]['line']);echo "'>Template Error in file '";@print_r($error[0][file]);echo "' on line '";@print_r($error[0]['line']);echo "':</h4><div title='File $file' style='border:1px solid grey;padding:0.2em;text-align:justify;font-size:9pt'>File <b>$file</b> does not exists!</div></font></body></html>"; exit; } $lastmodify = filemtime($file); $cacher = new tplcacher($filename, $lastmodify, $this->currenttpl); if($cacher->checkvalid() === true && $this->cache) { $tpl = $cacher->getdata(); } else { $tpl = $this->parser(file_get_contents($file)); if($this->cache){ $cacher->write($tpl); $cache_file = dirname(__FILE__) . "/../cache/".$filename.".php"; if(file_exists($cache_file)) touch($cache_file, $lastmodify); } } if($this->cache){ include($cacher->getfile()); }else{ eval('?>'.$tpl); } } private function parser($data) { preg_match_all('/<!-- BEGIN (.*) -->(.*)<!-- END \\1 -->/Usi',$data,$blockvars); foreach($blockvars[1] as $key => $value) { $tmpdata = $blockvars[2][$key]; $tmpdata = preg_replace('/{'.preg_quote($value,'/').'\.([a-zA-Z0-9_\-]+)}/Ui','<?php echo $row["\\1"]; ?>',$tmpdata); $tmpdata = preg_replace('/<!--\s*IF\s*'.preg_quote($value,'/').'\.([a-zA-Z0-9_\-]+)\s*-->/Ui','<?php if(isset($row["\\1"]) && $row["\\1"]) { ?>',$tmpdata); $tmpdata = preg_replace('/<!--\s*IF\s*NOT\s*'.preg_quote($value,'/').'\.([a-zA-Z0-9_\-]+)\s*-->/Ui','<?php if(!isset($row["\\1"]) || !$row["\\1"]) { ?>',$tmpdata); $tmpdata = preg_replace('/<!--\s*IF\s*'.preg_quote($value,'/').'\.([a-zA-Z0-9_\-]+)\s*=\s*\'([^\']+)\'\s*-->/Ui','<?php if(isset($row["\\1"]) && $row["\\1"] == \'\\2\') { ?>',$tmpdata); $tmpdata = preg_replace('/<!--\s*IF\sNOT\s*'.preg_quote($value,'/').'\.([a-zA-Z0-9_\-]+)\s*=\s*\'([^\']+)\'\s*-->/Ui','<?php if(isset($row["\\1"]) && $row["\\1"] != \'\\2\') { ?>',$tmpdata); $tmpdata = preg_replace('/<!--\s*ELSEIF\s*'.preg_quote($value,'/').'\.([a-zA-Z0-9_\-]+)\s*-->/Ui','<?php } else if(isset($row["\\1"]) && $row["\\1"]) { ?>',$tmpdata); $tmpdata = preg_replace('/<!--\s*ELSEIF\s*NOT\s*'.preg_quote($value,'/').'\.([a-zA-Z0-9_\-]+)\s*-->/Ui','<?php } else if(!isset($row["\\1"]) || !$row["\\1"]) { ?>',$tmpdata); $tmpdata = preg_replace('/<!--\s*ELSEIF\s*'.preg_quote($value,'/').'\.([a-zA-Z0-9_\-]+)\s*=\s*\'([^\']+)\'\s*-->/Ui','<?php } else if(isset($row["\\1"]) && $row["\\1"] == \'\\2\') { ?>',$tmpdata); $tmpdata = preg_replace('/<!--\s*ELSEIF\sNOT\s*'.preg_quote($value,'/').'\.([a-zA-Z0-9_\-]+)\s*=\s*\'([^\']+)\'\s*-->/Ui','<?php } else if(isset($row["\\1"]) && $row["\\1"] != \'\\2\') { ?>',$tmpdata); $data = preg_replace('/'.preg_quote($blockvars[0][$key],'/').'/','<?php foreach($this->blockvars["'.preg_quote($value, '/').'"] as $row) { ?>' . $tmpdata . '<?php } ?> ',$data); } $data = preg_replace('#<!--\s*PHP\s*-->(.*)<!--\s*ENDPHP\s*-->#Usi','<?php \\1 ?>',$data); $data = preg_replace('/{([a-zA-Z0-9_\-]+)}/iU','<?php echo isset($this->variables["\\1"]) ? $this->variables["\\1"] : "{\\1}"; ?>',$data); $data = preg_replace('/<!--\s*INCLUDE\s+([^"]*)\s*-->/Usi','<?php echo $this->display("\\1"); ?>',$data); $data = preg_replace('/<!--\s*DEFINE\s+([^"]*)\s*=\s*\'([^\']*)\'\s*-->/Usi','<?php $this->variables["\\1"] = \'\\2\' ?>',$data); $data = preg_replace('/<!--\s*IF\s([a-zA-Z0-9_]*)\s+=\s+([^"]+)\s*-->/Usi','<?php if($this->variables[\'\\1\'] == "\\2") { ?>',$data); $data = preg_replace('/<!--\s*IF\s([a-zA-Z0-9_]*)\s*-->/Usi','<?php if(isset($this->variables[\'\\1\']) && $this->variables[\'\\1\']) { ?>',$data); $data = preg_replace('/<!--\s*IF\sNOT\s([a-zA-Z0-9_]*)\s+=\s+([^"]+)\s*-->/Usi','<?php if(isset($this->variables[\'\\1\']) && $this->variables[\'\\1\'] != "\\2") { ?>',$data); $data = preg_replace('/<!--\s*IF\sNOT\s([a-zA-Z0-9_]*)\s*-->/Usi','<?php if(!isset($this->variables[\'\\1\']) || !$this->variables[\'\\1\']) { ?>',$data); $data = preg_replace('/<!--\s*IF\sNOT\s([a-zA-Z0-9_]*)\s*AND\s*NOT\s*([a-zA-Z0-9_]*)\s*-->/Usi','<?php if((!isset($this->variables[\'\\1\']) || !$this->variables[\'\\1\']) && (!isset($this->variables[\'\\2\']) || !$this->variables[\'\\2\'])) { ?>',$data); $data = preg_replace('/<!--\s*IF\s([a-zA-Z0-9_]*)\s*AND\s*([a-zA-Z0-9_]*)\s*-->/Usi','<?php if((isset($this->variables[\'\\1\']) && $this->variables[\'\\1\']) && isset($this->variables[\'\\2\']) && $this->variables[\'\\2\']) { ?>',$data); $data = preg_replace('/<!--\s*IF\s([a-zA-Z0-9_]*)\s+is\s+([^"]+)\s*-->/Usi','<?php if (strcasecmp($this->variables[\'\\1\'],"\\2")==0) { ?>',$data); $data = preg_replace('/<!--\s*IF\sNOT\s([a-zA-Z0-9_]*)\s*OR\s*NOT\s*([a-zA-Z0-9_]*)\s*-->/Usi','<?php if((!isset($this->variables[\'\\1\']) OR !$this->variables[\'\\1\']) OR (!isset($this->variables[\'\\2\']) || !$this->variables[\'\\2\'])) { ?>',$data); $data = preg_replace('/<!--\s*IF\s([a-zA-Z0-9_]*)\s*OR\s*([a-zA-Z0-9_]*)\s*-->/Usi','<?php if((isset($this->variables[\'\\1\']) OR isset($this->variables[\'\\2\']) )) { ?>',$data); $data = preg_replace('/<!--\s*IF\s([a-zA-Z0-9_]*)\s*OR\s*([a-zA-Z0-9_]*)\sOR\s*([a-zA-Z0-9_]*)\s*-->/Usi','<?php if((isset($this->variables[\'\\1\']) OR isset($this->variables[\'\\2\']) OR isset($this->variables[\'\\3\']) )) { ?>',$data); $data = preg_replace('/<!--\s*ELSEIF\s([a-zA-Z0-9_]*)\s*-->/Usi','<?php }elseif(isset($this->variables[\'\\1\']) && $this->variables[\'\\1\']) { ?>',$data); $data = preg_replace('/<!--\s*ELSE\s*-->/Usi','<?php }else{ ?>',$data); $data = preg_replace('/<!--\s*ENDIF\s(.*)\s*-->/Usi','<?php } ?>',$data); if(isset($GLOBALS['tplrules'])) { foreach($GLOBALS['tplrules'] as $pattern => $repl) { $data = preg_replace($pattern, $repl, $data); } } return $data; } public function assign($name, $value) { $this->variables[$name] = $value; } public function assignarray($array) { foreach($array as $key => $value) { $this->variables[$key] = $value; } } public function assign_vars($name, $array) { $this->blockvars[$name][] = $array; } public function __construct () { $this->license_check(); } public function license_check() { global $database, $db, $admin, $querycount, $host; if(empty($db)) { include(__DIR__."/../config.php"); define('DB_PREFIX', $database['prefix']); $querycount = 0; $db = new errorhandler_mysqli($database['location'], $database['username'], $database['password'], $database['database']); if (mysqli_connect_errno()) { error_handler("Couldn't establish connection to the database."); } } if(ini_get('allow_url_fopen') != 1){ error_handler("You need 'allow_url_fopen' to be set to '1' (i.e. it needs to be enabled).\n<br />Without that, this script won't work - sorry."); } $last_check_db = $db->query("SELECT content FROM ".DB_PREFIX."settings WHERE `name` = 'last_check'")->fetch_assoc(); $last_check_db = $last_check_db['content']; $timestamp_last = @simple_crypt($database['password'], $last_check_db, "decrypt"); if(!isValidTimestamp($timestamp_last)){ $timestamp_last = 0; } $now = new DateTime(); $now->setTimestamp(time()); $last_check = new DateTime(); $last_check->setTimestamp($timestamp_last); $interval = $now->diff($last_check); $diff = (int)$interval->format('%a'); if($diff >= 1){ $reachable = urlOK("http://licensing.clipcms.de/check.php?ping=1"); if($host == ""){ $host = preg_replace("/^(.*\.)?([^.]*\..*)$/", "$2", $_SERVER['HTTP_HOST']); } if($reachable){ $result = file_get_contents_curl("http://licensing.clipcms.de/check.php", array("host" => $host)); if($result != "1"){ error_handler("Your license file is invalid.<br />\nPlease contact me.<br /><br /><span style='font-size: 11px;'>Response:<br />".$result."</span>"); }else{ $db->query("UPDATE ".DB_PREFIX."settings SET `content` = '".@simple_crypt($database['password'], time(), "encrypt")."' WHERE `name` = 'last_check'"); } }else{ error_handler("The license server is not reachable.<br />Please check your firewall settings or contact me."); } }else{ return; } } } class tplcacher { private $filename; private $lastmodify; private $clastmodify; private $data; private $valid; public function __construct($name, $lastmodify, $currenttpl) { $name = str_replace("../", "", $name); $name = str_replace("./", "", $name); $name = str_replace('/','_', $name); $this->filename = dirname(__FILE__) . "/../cache/".$currenttpl."_".$name.".php"; $this->lastmodify = $lastmodify; if(file_exists($this->filename)) { $this->clastmodify = filemtime($this->filename); if($this->clastmodify > $this->lastmodify) { $this->valid = true; $this->data = file_get_contents($this->filename); } else { $this->valid = false; } } else { $this->valid = false; } } public function checkvalid() { return $this->valid; } public function getdata() { return $this->data; } public function write($data) { if($dh = @fopen($this->filename, 'w')) { fwrite($dh, $data); fclose($dh); } } public function getfile() { return $this->filename; } }
?>
View user's profile Send private message
SOlved
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

Post new topicReply to topic


Powered by phpBB © 2001-2008 phpBB Group



PCWizardHub - Helping you fix, build, and optimize your PC life
All logos and trademarks in this site are property of their respective owner. The comments and posts are property of their posters, all the rest (c) 2004-2024 Janek Vind "waraxe"
Page Generation: 0.053 Seconds