Waraxe IT Security Portal
Login or Register
May 1, 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: 100
Members: 0
Total: 100
Full disclosure
Microsoft Windows .XRM-MS File / NTLM Information DisclosureSpoofing
[IWCC 2025] CfP: 14th International Workshop on Cyber Crime -Ghent, Belgium, Aug 11-14, 2025
Inedo ProGet Insecure Reflection and CSRF Vulnerabilities
Ruby on Rails Cross-Site Request Forgery
Microsoft ".library-ms" File / NTLM Information Disclosure (Resurrected 2025)
HNS-2025-10 - HN Security Advisory - Local privilege escalation in Zyxel uOS
APPLE-SA-04-16-2025-4 visionOS 2.4.1
APPLE-SA-04-16-2025-3 tvOS 18.4.1
APPLE-SA-04-16-2025-2 macOS Sequoia 15.4.1
APPLE-SA-04-16-2025-1 iOS 18.4.1 and iPadOS 18.4.1
Business Logic Flaw: Price Manipulation - AlegroCartv1.2.9
Stored XSS in "Message" Functionality - AlegroCartv1.2.9
XSS via SVG Image Upload - AlegroCartv1.2.9
BBOT 2.1.0 - Local Privilege Escalation via Malicious ModuleExecution
83 vulnerabilities in Vasion Print / PrinterLogic
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> PHP script decode requests -> de-obfuscator Fopo
Post new topicReply to topic View previous topic :: View next topic
de-obfuscator Fopo
PostPosted: Fri Dec 18, 2015 11:16 am Reply with quote
goldorak
Regular user
Regular user
Joined: Feb 07, 2013
Posts: 10




Code:
#!/usr/bin/php
<?php
fwrite(STDOUT, "

/**
* ----------------------------------------------------------------------------
* 'De-Obfuscator for http://fopo.com
* ----------------------------------------------------------------------------

");
if($argv[1]!=""){

$contents = file_get_contents($argv[1]);
$eval = explode('(',$contents);
$base64 = explode ('"',$eval[2]);
list($i,$wanted) = explode("eval",base64_decode($base64[1]));
list($ni,$wanted2) = explode("))))",$wanted);
list($nni,$obfuscated) = explode('"',$ni);
$decoded = "<?php ".gzinflate(base64_decode(str_rot13($obfuscated)));
$beautified = indent_proper($decoded);
$result = preg_split('/"/', $beautified);
foreach ($result as $r){
if(preg_match("/^\\\\/", $r, $matches)){
//TODO
$beautified = str_ireplace('"'.$r.'"','"'.stripcslashes($r).'"',$beautified);
$beautified = str_ireplace("'".$r."'","'".stripcslashes($r)."'",$beautified);
}
};
$out = write_to_file($beautified,$argv[2]);
$link = basename($out);
echo "File Wrote to ".$link."\n\n";

}else{
echo "\nPlease provide the input file name,RTFM Dude,RTFM.!\n\n";
}
exit(0);

/*Helper functions-Not many though*/
function indent_proper($text){
$v1= str_replace("}","\n}\n",str_replace("{","{\n",str_replace(";",";\n",$text)));
return str_replace("return","\n return",str_replace("<?php","\n<?php",$v1));
}
function write_to_file($string_data,$outname){
if($outname=="")
$outname = "decoded.php";
$fh = fopen($outname, 'w') or die("can't open file");
fwrite($fh, $string_data);
fclose($fh);
return $outname;
}
?>
View user's profile Send private message
de-obfuscator Fopo
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.042 Seconds