security compromised

This is a discussion on security compromised within the PHP Language forums, part of the PHP Programming Forums category; Hi newsgroup, it appears someone has broken into my site. This morning I found about 20 files (each called index....


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-04-2004
Ivo
 
Posts: n/a
Default security compromised

Hi newsgroup,

it appears someone has broken into my site. This morning I found about 20
files (each called index.htm) suddenly featured this line:

<IFRAME SRC="url-of-bad-site" WIDTH=1 HEIGHT=1></IFRAME>

and their last modified date was set to today between midnight and 1 GMT. In
some files, this line was placed directly after the body opening tag, in
others it was just before </body>. In one file where the whole document is
written in javascript, they had even escaped their quotes!

The malicious url is www.b00gle.com/fa/?d=get
I have no access to the raw server logs and my own log script shows no
strange hits around that time.
How have they done this? And what can I do about it? I ask here because the
site uses PHP a lot but I guess there are more appropriate places to ask.
Thanks
Ivo


Reply With Quote
  #2 (permalink)  
Old 06-04-2004
Filth
 
Posts: n/a
Default Re: security compromised

> How have they done this? And what can I do about it? I ask here because
the
> site uses PHP a lot but I guess there are more appropriate places to ask.
> Thanks
>


there is no way of telling if you do not provide more details. 1 thing tho
have you tried looking at the raw log files for that time period. It most
likely give you a clue.


Reply With Quote
  #3 (permalink)  
Old 06-04-2004
David Mackenzie
 
Posts: n/a
Default Re: security compromised

On Fri, 4 Jun 2004 15:29:08 +0200, "Ivo" <no@thank.you> wrote:

>Hi newsgroup,
>
>it appears someone has broken into my site. This morning I found about 20
>files (each called index.htm) suddenly featured this line:
>
><IFRAME SRC="url-of-bad-site" WIDTH=1 HEIGHT=1></IFRAME>
>
>and their last modified date was set to today between midnight and 1 GMT. In
>some files, this line was placed directly after the body opening tag, in
>others it was just before </body>. In one file where the whole document is
>written in javascript, they had even escaped their quotes!
>
>The malicious url is www.b00gle.com/fa/?d=get


That document itself contains an Iframe whose document caused my
browser to start downloading stuff from a porn site. Luckily I spotted
its dodgy url before any images appeared!

I think someone was trying to hijack hits to your site for themselves!

>I have no access to the raw server logs and my own log script shows no
>strange hits around that time.


If you are on a shared server, contact the webmaster - other people on
the same server could also have been compromised.

--
David ( @priz.co.uk )
Reply With Quote
  #4 (permalink)  
Old 06-04-2004
Ivo
 
Posts: n/a
Default Re: security compromised

"David Mackenzie" wrote
> "Ivo" wrote:
> >it appears someone has broken into my site. This morning I found about 20
> >files (each called index.htm) suddenly featured this line:
> >
> ><IFRAME SRC="url-of-bad-site" WIDTH=1 HEIGHT=1></IFRAME>
> >

> I think someone was trying to hijack hits to your site for themselves!


Sounds plausible.

> >I have no access to the raw server logs and my own log script shows no
> >strange hits around that time.

>
> If you are on a shared server, contact the webmaster - other people on
> the same server could also have been compromised.


That is a very good idea.

I have a PHP script which allows me to do everything without FTP, and live
in constant fear someone might find the password. The freakin' pimps have
been writing to my admin/index.htm file!
What more info would a newsgroup need to help identify the leak? The server
runs PHP/4.3.1 on Apache/1.3.27 (Unix).
Thanks
Ivo



Reply With Quote
  #5 (permalink)  
Old 06-06-2004
PhilM
 
Posts: n/a
Default Re: security compromised


"Ivo" <no@thank.you> wrote in message
news:40c07b6d$0$842$a344fe98@news.wanadoo.nl...
> Hi newsgroup,
>
> it appears someone has broken into my site. This morning I found about 20
> files (each called index.htm) suddenly featured this line:
>
> <IFRAME SRC="url-of-bad-site" WIDTH=1 HEIGHT=1></IFRAME>
>
> and their last modified date was set to today between midnight and 1 GMT.

In
> some files, this line was placed directly after the body opening tag, in
> others it was just before </body>. In one file where the whole document is
> written in javascript, they had even escaped their quotes!
>
> The malicious url is www.b00gle.com/fa/?d=get
> I have no access to the raw server logs and my own log script shows no
> strange hits around that time.
> How have they done this? And what can I do about it? I ask here because

the
> site uses PHP a lot but I guess there are more appropriate places to ask.
> Thanks
> Ivo
>
>

did a quick google. you are not the only victim...
Here is tiny url link to google results
http://tinyurl.com/39st6


Reply With Quote
  #6 (permalink)  
Old 06-07-2004
Ivo
 
Posts: n/a
Default Re: security compromised

"PhilM" wrote
> "Ivo" wrote
> > it appears someone has broken into my site. This morning I found about

20
> > files (each called index.htm) suddenly featured this line:
> >
> > <IFRAME SRC="url-of-bad-site" WIDTH=1 HEIGHT=1></IFRAME>

< snip >
> did a quick google. you are not the only victim...
> Here is tiny url link to google results
> http://tinyurl.com/39st6
>


My host has taken steps and reconfigured the server. The network status
page,
<URL: http://freeola.info/networkstatus.php > sais:
"An investigation has exposed a software vulnerability which, in certain
circumstances, may allow a malicious user to insert HTML code into other
users web files. Some customers have reported that their web site now
appears to launch extra windows and software installers."

As far as PHP is concerned, some functions are no longer possible,
particularly those that call remote content.
copy(remote file, local file);
now results in 'file does not exist' where it copied just fine last week.
Strange thing is, the 'allow_url_fopen' directive is still 'On' according to
phpinfo. I think I have just traded some freedom for some security.
Ivo



Reply With Quote
  #7 (permalink)  
Old 06-08-2004
Dan
 
Posts: n/a
Default Re: security compromised


"Ivo" <no@thank.you> wrote in message
news:40c3cb4e$0$1736$abc4f4c3@news.wanadoo.nl...
> "PhilM" wrote
> > "Ivo" wrote
> > > it appears someone has broken into my site. This morning I found about

> 20
> > > files (each called index.htm) suddenly featured this line:
> > >
> > > <IFRAME SRC="url-of-bad-site" WIDTH=1 HEIGHT=1></IFRAME>

> < snip >
> > did a quick google. you are not the only victim...
> > Here is tiny url link to google results
> > http://tinyurl.com/39st6
> >

>
> My host has taken steps and reconfigured the server. The network status
> page,
> <URL: http://freeola.info/networkstatus.php > sais:
> "An investigation has exposed a software vulnerability which, in certain
> circumstances, may allow a malicious user to insert HTML code into other
> users web files. Some customers have reported that their web site now
> appears to launch extra windows and software installers."
>
> As far as PHP is concerned, some functions are no longer possible,
> particularly those that call remote content.
> copy(remote file, local file);
> now results in 'file does not exist' where it copied just fine last week.
> Strange thing is, the 'allow_url_fopen' directive is still 'On' according

to
> phpinfo. I think I have just traded some freedom for some security.
> Ivo
>

I had something similar to this happen to me on a hosted site last year. My
root directory and all subdirectories had a "bad" index.php written in them.
The server administrator said it was an old, unpatched exploit on apache (I
don't know if this was the case or not). Nothing else appeared to have been
disturbed.



Reply With Quote
  #8 (permalink)  
Old 06-09-2004
Nathan Gardiner
 
Posts: n/a
Default Re: security compromised

Ivo wrote:
>
> I have a PHP script which allows me to do everything without FTP, and
> live in constant fear someone might find the password. The freakin'
> pimps have been writing to my admin/index.htm file!


Ivo,

Given that such a script exists, and is only protected by a simple password,
and you don't have access to the logs to determine what the method of
intrusion is, I'd say you have answered your own question. I couldn't be
sure, but if your PHP scripts allow some sort of PHP code injection, or your
admin script is found, it would be trivial for someone to write to the
filesystem.

Rather than asking for speculation as to the cause of this, you should
probabely practise a little better security policy.

Get access to the logs. Get rid of this script and use FTP/SFTP for file
transfer. Spend some time reading up on writing secure code.


Nathan


Reply With Quote
Reply
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

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




All times are GMT +1. The time now is 08:42 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0