Irish SEO,  Marketing & Webmaster Discussion

 

WTF - Some PHP Obfuscation.

This is a discussion on WTF - Some PHP Obfuscation. within the General Chat forums, part of the Lounge category; Today I was messing about in PHP and wondered how confusing you could make some PHP code. I had seen ...


Go Back   Irish SEO, Marketing & Webmaster Discussion > Lounge > General Chat

Register Forum Rules FAQDonate Members List Calendar Search Today's Posts Mark Forums Read


Notices

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 15-02-2007, 08:44 PM
daviddoran's Avatar
Wannabe Geek
Recent Blog: iMSISS
 
Join Date: Aug 2006
Location: Meath, Ireland
Posts: 342
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
daviddoran will become famous soon enough
Default WTF - Some PHP Obfuscation.

Today I was messing about in PHP and wondered how confusing you could make some PHP code. I had seen (as many may have) very obfuscated Perl code and the like but I never thought you could do it with PHP.
So, here is something I put together which outputs a little message.

I have removed one character below, can you find which character is missing and what message is displayed?

Code:
$_='ca';${$_{1}}=8;${$_{0}}=chr(ord($_)-1);$_;${${$_{0}}{0}}=
ord('l')-100;$c{0}=chr(116>>$b-7);*$_;$a<<=($b%8==0);$_; $c.=
chr((2<<2<<($b>>2)<<2>>2)+13).chr(-7+(-$b+2*$a<<1));echo $c ;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 15-02-2007, 10:25 PM
georgiecasey's Avatar
Member
 
Join Date: Jul 2006
Location: Galway / Ennis
Posts: 277
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
georgiecasey will become famous soon enough
Send a message via ICQ to georgiecasey
Default

I tried for a while but then gave up. Me PHP knowledge is too limited for that.
__________________

My Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 15-02-2007, 10:39 PM
daviddoran's Avatar
Wannabe Geek
Recent Blog: iMSISS
 
Join Date: Aug 2006
Location: Meath, Ireland
Posts: 342
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
daviddoran will become famous soon enough
Default

It's logical enough, but yes it is pretty weird looking.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 16-02-2007, 12:32 PM
ph3n0m's Avatar
Webmonkey
 
Join Date: Jan 2006
Location: Ireland
Posts: 300
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
ph3n0m will become famous soon enough
Default

Code:
$_='ca';${$_{1}}=8;${$_{0}}=chr(ord($_)-1);$_;${${$_{0}}{0}}=
ord('l')-100;$c{0}=chr(116>>$b-7);*$_;$a<<=($b%8==0);$_; $c.=
chr((2<<2<<($b>>2)<<2>>2)+13).chr(-7+(-$b+2*$a<<1));echo $c ;
[/quote]

well based on the code above - I removed a character and got

Code:
:-)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 16-02-2007, 05:20 PM
daviddoran's Avatar
Wannabe Geek
Recent Blog: iMSISS
 
Join Date: Aug 2006
Location: Meath, Ireland
Posts: 342
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
daviddoran will become famous soon enough
Default

Very good.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 17-02-2007, 03:53 PM
georgiecasey's Avatar
Member
 
Join Date: Jul 2006
Location: Galway / Ennis
Posts: 277
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
georgiecasey will become famous soon enough
Send a message via ICQ to georgiecasey
Default

Damn, I thought you had to add in a character. I knew that * looked out of place.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 17-02-2007, 03:56 PM
daviddoran's Avatar
Wannabe Geek
Recent Blog: iMSISS
 
Join Date: Aug 2006
Location: Meath, Ireland
Posts: 342
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
daviddoran will become famous soon enough
Default

Yes, you can just remove the * because the *$_; part is simply padding for that line. In the original code I had 7*$_; to pad out the line without any spaces, but there is a few uneccesary $_; just to pad out the lines.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 20-02-2007, 04:48 PM
Member
 
Join Date: Jan 2006
Location: Dublin
Posts: 134
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
rsynnott will become famous soon enough
Send a message via MSN to rsynnott Send a message via Skype™ to rsynnott
Default

Surely a bit of a waste of resources to actually RUN such a thing, though?
__________________
Blog | FindMeATune.com - Mysterious generator of money | politicsInIreland.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 20-02-2007, 05:45 PM
daviddoran's Avatar
Wannabe Geek
Recent Blog: iMSISS
 
Join Date: Aug 2006
Location: Meath, Ireland
Posts: 342
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
daviddoran will become famous soon enough
Default

Definitely, I've got resources to burn.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
obfuscation, php, wtf

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Apache, PHP ziycon Coding Help 2 15-02-2007 10:54 AM
php, mysql & .asp from same laptop alex Server / Technical Administration Tips and Queries 11 16-10-2006 06:01 PM
Do Php Accelerators Make Any Difference? blacknight Coding Help 2 13-09-2006 11:28 PM
Ioncube encoded PHP Scripts georgiecasey Coding Help 3 29-08-2006 11:49 AM
PHP on windows louie Coding Help 20 22-02-2006 06:25 PM


Sponsored links

Paid On Results


All times are GMT +1. The time now is 01:40 PM.


Powered by: vBulletin Version 3.7.3, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
Hosted in Ireland by Blacknight - Test your ISP |Irish Hosting Directory| Armchair.ie|Logo by Eden Web Design|Avatars by Afterglow |Latest Blog Entries | VPS HostingAd Management by RedTyger

Search Engine Friendly URLs by vBSEO 3.2.0