/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Getting Hacked need some help.

I know a little php to get me by but I must have vulnarbilities. Someone keeps adding small pieces of code to my index page and to a header file for the rest of my site. Somehow there adding a line like this right after the body tag.

[CODE]<!– ~ –><iframe src=’http://some-url-that-says-my-ip-is-blocked’ width=1 height=1 style=’visibility: hidden;’></iframe><!– ~ –>[/CODE]

Can anyone explain to me how they are doing this or at least what I should look for in my php code to prevent this? Thanks

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@NogDogApr 04.2007 — The first thing to do is to change your login and FTP passwords that you use to access the webserver. Secondly, if on a UNIX/Linux web server, you can change the permissions on any directories that do not need to be written to by your scripts to 755 (read/write/execute by owner, read/execute by others). This will help prevent anyone else who has an account on the same webserver from having a script write to your directories. If you should have to allow others to have write permission on a given directory, you can still set permissions on specific files that you don't want the world to have write access on.

You probably should also alert the web host administrator (assuming it's not you) that you were hacked, as it's possible it was done by someone hacking into the server as root (though hopefully they only allow root access from specific IP's, but you never know).

PS: As to whether any of your scripts have security loopholes, it's pretty hard to say without seeing the scripts, though my first guess would be that they're not the problem (but it's still a possibility).
Copy linkTweet thisAlerts:
@ToeBeeauthorApr 04.2007 — Thank you for the quik reply ? I will do what you recommend in the above post. Thanks again.
Copy linkTweet thisAlerts:
@ToeBeeauthorApr 04.2007 — Quik question about the permissions. Right now there all set to 644 would you still recommend 755?
Copy linkTweet thisAlerts:
@NogDogApr 04.2007 — 644 is OK for files. Normally directories also have execute permission, which would make them 755, but the files within those directories should be OK at 644.
Copy linkTweet thisAlerts:
@ToeBeeauthorApr 04.2007 — Ok great thanks. All of the directories are at 755 except the public_html which was set to 750. I imagine that is fine as well. Hopefully it was the password then. We shall see. Thanks for your quik responses again, very helpful.
×

Success!

Help @ToeBee spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...