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 09-21-2010, 11:46 AM   #1 (permalink)
The Contributor
 
Tim Dobson's Avatar
 
Join Date: Feb 2010
Posts: 69
Thanks: 16
Tim Dobson is on a distinguished road
Default site bein messed up by some noob

guys needa bit of help some pranny thinks its smart to do some stuff to my site... i keep goin there and i keep gettin these annoying message boxes and redirected... here is a screen shot.




how would i go about stoping this? thanks
Tim Dobson is offline  
Reply With Quote
Old 09-21-2010, 02:25 PM   #2 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 335
Thanks: 2
Enfernikus is on a distinguished road
Default

Either your CP/FTP information is very easy to guess or most likely you have a remote file exploit somewhere on your site.

Funny thing is I know the owner of Guysthatgame
__________________
My Blog
Enfernikus is offline  
Reply With Quote
Old 09-21-2010, 05:03 PM   #3 (permalink)
The Contributor
 
Tim Dobson's Avatar
 
Join Date: Feb 2010
Posts: 69
Thanks: 16
Tim Dobson is on a distinguished road
Default

ok well its definatly not my ftp so how do i stop this file?
Tim Dobson is offline  
Reply With Quote
Old 09-21-2010, 05:06 PM   #4 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

Do you run backups? I'd look at restoring to some time before the exploit occurred, and running a full security audit immediately. Lock down SSH if you have it, turn off FTP at least temporarily (you should be using sFTP anyways) and scan for XSS vulnerabilities asap.
__________________
uʍop ǝpısdn sı ɹǝʇndɯoɔ ɹnoʎ sıɥʇ pɐǝɹ uɐɔ noʎ ɟı
delayedinsanity is offline  
Reply With Quote
Old 09-21-2010, 05:13 PM   #5 (permalink)
The Contributor
 
Tim Dobson's Avatar
 
Join Date: Feb 2010
Posts: 69
Thanks: 16
Tim Dobson is on a distinguished road
Default

nah iv found out what there doing.. there is a form where people can submit and what is being submited is this

<a href='arlnk://asdasdasd'><script>alert('TK=NOOBS')</script></a><hr /><a href='arlnk://dfsdfsdfsdf'><script>alert('SANITIZE YOUR FUCKING INPUTS YOU SKIDDIE!')</script></a><hr /><a href='arlnk://gsdfsdfsdf'><meta http-equiv="REFRESH" content="0;url=http://www.guysthatgame.co.uk/gtgshop/product_images/q/jnx1119__58496.jpg"></a><hr />

which is clearly displaying an alert and redirecting.... i just spoted it in one of the files which is a text file that is writen to on submit and read by the main index page. How would i filter out stuff like this?
Tim Dobson is offline  
Reply With Quote
Old 09-21-2010, 06:11 PM   #6 (permalink)
The Contributor
 
Tim Dobson's Avatar
 
Join Date: Feb 2010
Posts: 69
Thanks: 16
Tim Dobson is on a distinguished road
Default

poor guy is spying on this post he is just posting a bit of js in to an open field he must think he is real clever. Its all filtered now anyway
Tim Dobson is offline  
Reply With Quote
Old 09-21-2010, 10:59 PM   #7 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

Well, although not very eloquently put, he has a point. Sanitize your inputs. ;)
__________________
uʍop ǝpısdn sı ɹǝʇndɯoɔ ɹnoʎ sıɥʇ pɐǝɹ uɐɔ noʎ ɟı
delayedinsanity is offline  
Reply With Quote
Old 09-22-2010, 09:38 AM   #8 (permalink)
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

Repeat after me: Filter input, escape output.

Now I want 400 lines of that by monday!
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote
Old 09-22-2010, 02:32 PM   #9 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 335
Thanks: 2
Enfernikus is on a distinguished road
Default

From a programming perspective, it's normally best to consider the user a malicious idiot. If you remember this, you always know to validate your data for any sort of incorrect input and then filter it.

The first because he's an idiot.
The second because he's malicious.
__________________
My Blog
Enfernikus is offline  
Reply With Quote
Old 09-22-2010, 07:35 PM   #10 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Quote:
Originally Posted by sketchMedia View Post
Now I want 400 lines of that by monday!
PHP Code:
echo implode(
    
PHP_EOL,
    
array_fill(0400"Filter input, escape output.")
); 
Salathe is offline  
Reply With Quote
Old 09-22-2010, 11:09 PM   #11 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

zomg bbq! Salathe is still alive!

And here I was thinking everybody who ran this site had been eaten by mutated Oreo's bent on revenge.
__________________
uʍop ǝpısdn sı ɹǝʇndɯoɔ ɹnoʎ sıɥʇ pɐǝɹ uɐɔ noʎ ɟı
delayedinsanity is offline  
Reply With Quote
Old 09-23-2010, 04:59 AM   #12 (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

Thats a typical XSS attack, escape your outputs. That was my thought before I got to the bottom of the image you gave. I assure you it could be worse, I once saw a case where the cracker injected code that downloaded a virus to the users machine. It was a mortgage banker so less technical clients would do whatever the site said and got infected.

I personally use the sanitize feature in the Savant template engine to escape my outputs.
__________________

Village Idiot is offline  
Reply With Quote
Old 09-23-2010, 03:24 PM   #13 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Quote:
Originally Posted by delayedinsanity View Post
And here I was thinking everybody who ran this site had been eaten by mutated Oreo's bent on revenge.
They were. I've never ran this site.
Salathe is offline  
Reply With Quote
Old 09-28-2010, 11:48 PM   #14 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Default

Quote:
Originally Posted by delayedinsanity View Post
And here I was thinking everybody who ran this site had been eaten by mutated Oreo's bent on revenge.

we lurk in the shadows and only come out to play every 30 days ;)
codefreek is offline  
Reply With Quote
Old 09-29-2010, 02:11 AM   #15 (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 codefreek View Post
we lurk in the shadows and only come out to play every 30 days ;)
So basically you're a menstrual cycle?
__________________

Village Idiot is offline  
Reply With Quote
Old 09-29-2010, 03:03 AM   #16 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Default

Lets say 25 days then so we don't get associate with menstrual cycle :P
codefreek 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
Redirecting site to temporary folder Jmz General 6 10-09-2009 07:49 AM
Pulling values from one site as reference 9three Absolute Beginners 4 02-17-2009 02:37 PM
How to make an RSS aggregator site ? vuthcam Advanced PHP Programming 1 02-03-2009 10:12 PM
Gaming Site Redux obolus Show Off 3 02-25-2008 09:52 PM
Recently rebuilt site obolus Show Off 6 10-30-2007 02:24 AM


All times are GMT. The time now is 08:57 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