You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Oskar 'Zoot' Lindgren <os...@home.se> on 2003/01/20 16:42:44 UTC

[users@httpd] Killing apache(bugg?)

Hello everyone(first post),

Last night was I playing some with the killall command, and figure
out that the apache server could easly be stopped by just writing
a php or perl script. I think there has to be a way to prevent this
since this isn´t really a "bugg", has anyone got an idea how?

Php script code: <?php system("killall -STOP apache"); ?>

Oskar Lindgren
oskar.lindgren@home.se


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Killing apache(bugg?)

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, 20 Jan 2003, Joshua Slive wrote:

>
> On Mon, 20 Jan 2003, Oskar 'Zoot' Lindgren wrote:
>
> > SHTML also needs one line to do it:
> >
> >
> > <!--#exec cmd="killall -STOP apache" -->
>
> Not if you are running through suexec of IncludesNoExec.

Ummm... suexec OR IncludesNoExec.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Killing apache(bugg?)

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, 20 Jan 2003, Oskar 'Zoot' Lindgren wrote:

> SHTML also needs one line to do it:
>
>
> <!--#exec cmd="killall -STOP apache" -->

Not if you are running through suexec of IncludesNoExec.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Killing apache(bugg?)

Posted by Ben Ricker <br...@wellinx.com>.
On Mon, 2003-01-20 at 13:57, Oskar 'Zoot' Lindgren wrote:
> Apache dosn´t get killed, it is but to sleep so the webpage is impossible to
> access. If you killed the process it would be restarted like a DoS attack as
> you said.

If you stopped a http child process, would it stop any NEW processes
from being created? I have not tested this out, but my educated guess is
that a stopped process does do ANY processing, so the parent process
will restart the children processes, Of course, if the hacker keeps
sending the calls for the script, then the game will be afoot untill one
hits the maximum number of prcesses. Again, a DoS.

>  The jail is the only option left, but you only need to upload your
> own copy of killall... any more ideas?

Ummmm, no. The jailing will occur AFTER the root binary suids to the
unpriveledged user. One cannot kill a process that one does not have any
access to; there is no 'ps' in a root jail. There is no way to get the
PID file from the jail (if done right). No killall binary is available.


> ----- Original Message -----
> From: "Ben Ricker" <br...@wellinx.com>
> To: <us...@httpd.apache.org>
> Sent: Monday, January 20, 2003 8:34 PM
> Subject: Re: [users@httpd] Killing apache(bugg?)
> 
> 
> > The problems you are seeing are not a problem with Apache, per se, but
> > rather a problem with ANY remote access by possibly hostile users.
> >
> > The end to all the problems you suggest is to root jail Apache (not
> > foolproof, but would take a skillful hack to break). There will be no
> > kill anything available, nor any other of the possibly pernicious
> > commands <!--#exec cmd="mv ~/passwd /etc/passwd" -->. Killing Apache
> > would be a sort of benign DoS attack. I would be more worried about
> > someone moving a file to override the password file or replacing a
> > binary with a trojan.
> >
> > Ben Ricker
> > Web Security System Administrator
> > Wellinx.com
> >
> >
> > On Mon, 2003-01-20 at 12:40, Oskar 'Zoot' Lindgren wrote:
> > > SHTML also needs one line to do it:
> > >
> > >
> > > <!--#exec cmd="killall -STOP apache" -->
> > >
> > > ----- Original Message -----
> > > From: "Joshua Slive" <jo...@slive.ca>
> > > To: <us...@httpd.apache.org>
> > > Sent: Monday, January 20, 2003 6:02 PM
> > > Subject: Re: [users@httpd] Killing apache(bugg?)
> > >
> > >
> > > >
> > > > On Mon, 20 Jan 2003, Chris Meadors wrote:
> > > >
> > > > > Joshua Slive wrote:
> > > > >
> > > > > > Take a look at running php as a cgi and using suexec.
> > > > >
> > > > > That kinda breaks PHP.  Also the original poster said that the
> students
> > > > > would also be working with SHTML.
> > > >
> > > > I'm not sure why you say that breaks PHP.  Many people run PHP as a
> CGI.
> > > >
> > > > As far as shtml, that is relatively safe.  It is hard to break very
> much
> > > > with ssi, especially if any cgi includes are run through suexec.
> > > >
> > > > Joshua.
> > > >
> > > > ---------------------------------------------------------------------
> > > > The official User-To-User support forum of the Apache HTTP Server
> Project.
> > > > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > > > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> > > >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > > > For additional commands, e-mail: users-help@httpd.apache.org
> > > >
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > The official User-To-User support forum of the Apache HTTP Server
> Project.
> > > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> > >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > > For additional commands, e-mail: users-help@httpd.apache.org
> > --
> > Ben Ricker <br...@wellinx.com>
> > Wellinx.com
> >
> >
> > ---------------------------------------------------------------------
> > The official User-To-User support forum of the Apache HTTP Server Project.
> > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> >
> >
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
-- 
Ben Ricker <br...@wellinx.com>
Wellinx.com


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Killing apache(bugg?)

Posted by Oskar 'Zoot' Lindgren <os...@home.se>.
Apache dosn´t get killed, it is but to sleep so the webpage is impossible to
access. If you killed the process it would be restarted like a DoS attack as
you said. The jail is the only option left, but you only need to upload your
own copy of killall... any more ideas?

I have uploaded the php, perl and shtml source here:
http://zoot.aegd.net/ApacheStop/

----- Original Message -----
From: "Ben Ricker" <br...@wellinx.com>
To: <us...@httpd.apache.org>
Sent: Monday, January 20, 2003 8:34 PM
Subject: Re: [users@httpd] Killing apache(bugg?)


> The problems you are seeing are not a problem with Apache, per se, but
> rather a problem with ANY remote access by possibly hostile users.
>
> The end to all the problems you suggest is to root jail Apache (not
> foolproof, but would take a skillful hack to break). There will be no
> kill anything available, nor any other of the possibly pernicious
> commands <!--#exec cmd="mv ~/passwd /etc/passwd" -->. Killing Apache
> would be a sort of benign DoS attack. I would be more worried about
> someone moving a file to override the password file or replacing a
> binary with a trojan.
>
> Ben Ricker
> Web Security System Administrator
> Wellinx.com
>
>
> On Mon, 2003-01-20 at 12:40, Oskar 'Zoot' Lindgren wrote:
> > SHTML also needs one line to do it:
> >
> >
> > <!--#exec cmd="killall -STOP apache" -->
> >
> > ----- Original Message -----
> > From: "Joshua Slive" <jo...@slive.ca>
> > To: <us...@httpd.apache.org>
> > Sent: Monday, January 20, 2003 6:02 PM
> > Subject: Re: [users@httpd] Killing apache(bugg?)
> >
> >
> > >
> > > On Mon, 20 Jan 2003, Chris Meadors wrote:
> > >
> > > > Joshua Slive wrote:
> > > >
> > > > > Take a look at running php as a cgi and using suexec.
> > > >
> > > > That kinda breaks PHP.  Also the original poster said that the
students
> > > > would also be working with SHTML.
> > >
> > > I'm not sure why you say that breaks PHP.  Many people run PHP as a
CGI.
> > >
> > > As far as shtml, that is relatively safe.  It is hard to break very
much
> > > with ssi, especially if any cgi includes are run through suexec.
> > >
> > > Joshua.
> > >
> > > ---------------------------------------------------------------------
> > > The official User-To-User support forum of the Apache HTTP Server
Project.
> > > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> > >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > > For additional commands, e-mail: users-help@httpd.apache.org
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > The official User-To-User support forum of the Apache HTTP Server
Project.
> > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> --
> Ben Ricker <br...@wellinx.com>
> Wellinx.com
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Killing apache(bugg?)

Posted by Ben Ricker <br...@wellinx.com>.
The problems you are seeing are not a problem with Apache, per se, but
rather a problem with ANY remote access by possibly hostile users. 

The end to all the problems you suggest is to root jail Apache (not
foolproof, but would take a skillful hack to break). There will be no
kill anything available, nor any other of the possibly pernicious
commands <!--#exec cmd="mv ~/passwd /etc/passwd" -->. Killing Apache
would be a sort of benign DoS attack. I would be more worried about
someone moving a file to override the password file or replacing a
binary with a trojan.

Ben Ricker
Web Security System Administrator
Wellinx.com


On Mon, 2003-01-20 at 12:40, Oskar 'Zoot' Lindgren wrote:
> SHTML also needs one line to do it:
> 
> 
> <!--#exec cmd="killall -STOP apache" -->
> 
> ----- Original Message -----
> From: "Joshua Slive" <jo...@slive.ca>
> To: <us...@httpd.apache.org>
> Sent: Monday, January 20, 2003 6:02 PM
> Subject: Re: [users@httpd] Killing apache(bugg?)
> 
> 
> >
> > On Mon, 20 Jan 2003, Chris Meadors wrote:
> >
> > > Joshua Slive wrote:
> > >
> > > > Take a look at running php as a cgi and using suexec.
> > >
> > > That kinda breaks PHP.  Also the original poster said that the students
> > > would also be working with SHTML.
> >
> > I'm not sure why you say that breaks PHP.  Many people run PHP as a CGI.
> >
> > As far as shtml, that is relatively safe.  It is hard to break very much
> > with ssi, especially if any cgi includes are run through suexec.
> >
> > Joshua.
> >
> > ---------------------------------------------------------------------
> > The official User-To-User support forum of the Apache HTTP Server Project.
> > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> >
> >
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
-- 
Ben Ricker <br...@wellinx.com>
Wellinx.com


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Killing apache(bugg?)

Posted by Oskar 'Zoot' Lindgren <os...@home.se>.
SHTML also needs one line to do it:


<!--#exec cmd="killall -STOP apache" -->

----- Original Message -----
From: "Joshua Slive" <jo...@slive.ca>
To: <us...@httpd.apache.org>
Sent: Monday, January 20, 2003 6:02 PM
Subject: Re: [users@httpd] Killing apache(bugg?)


>
> On Mon, 20 Jan 2003, Chris Meadors wrote:
>
> > Joshua Slive wrote:
> >
> > > Take a look at running php as a cgi and using suexec.
> >
> > That kinda breaks PHP.  Also the original poster said that the students
> > would also be working with SHTML.
>
> I'm not sure why you say that breaks PHP.  Many people run PHP as a CGI.
>
> As far as shtml, that is relatively safe.  It is hard to break very much
> with ssi, especially if any cgi includes are run through suexec.
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Killing apache(bugg?)

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, 20 Jan 2003, Chris Meadors wrote:

> Joshua Slive wrote:
>
> > Take a look at running php as a cgi and using suexec.
>
> That kinda breaks PHP.  Also the original poster said that the students
> would also be working with SHTML.

I'm not sure why you say that breaks PHP.  Many people run PHP as a CGI.

As far as shtml, that is relatively safe.  It is hard to break very much
with ssi, especially if any cgi includes are run through suexec.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Killing apache(bugg?)

Posted by Chris Meadors <cl...@hereintown.net>.
Joshua Slive wrote:

> Take a look at running php as a cgi and using suexec.

That kinda breaks PHP.  Also the original poster said that the students 
would also be working with SHTML.

> Other that, the only way to deal with malicious users is to give them each
> their own apache (perhaps running on different ports).

That would work.

> The perchild mpm might help somewhat, but I think it is still not quite
> production ready.

That could work very well, almost like their own apache, but they all 
are on the same port.  But as you said, the PerChild MPM isn't exactly 
ready for prime time.

-- 
Chris


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Killing apache(bugg?)

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, 20 Jan 2003, Oskar 'Zoot' Lindgren wrote:

> Hello everyone(first post),
>
> Last night was I playing some with the killall command, and figure
> out that the apache server could easly be stopped by just writing
> a php or perl script. I think there has to be a way to prevent this
> since this isn´t really a "bugg", has anyone got an idea how?
>
> Php script code: <?php system("killall -STOP apache"); ?>

Take a look at running php as a cgi and using suexec.

Other that, the only way to deal with malicious users is to give them each
their own apache (perhaps running on different ports).

The perchild mpm might help somewhat, but I think it is still not quite
production ready.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Killing apache(bugg?)

Posted by Oskar 'Zoot' Lindgren <os...@home.se>.
Hmm, I think this is a apache issue, since it works in nearly all script
languages. And apache is the allways target that gets stoped.

----- Original Message -----
From: "Jon Steer" <jo...@da-group.co.uk>
To: <us...@httpd.apache.org>
Sent: Monday, January 20, 2003 5:03 PM
Subject: Re: [users@httpd] Killing apache(bugg?)


Hi Oskar

> Last night was I playing some with the killall command, and figure
> out that the apache server could easly be stopped by just writing
> a php or perl script. I think there has to be a way to prevent this
> since this isn´t really a "bugg", has anyone got an idea how?

This is not really an apache issue but can be solved by using the
disable_functions directive in your php.ini file. You can define a list of
php commands that you consider unsafe and these commands will then not be
usable by scripts on your server.

Jon


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Killing apache(bugg?)

Posted by Jon Steer <jo...@da-group.co.uk>.
Hi Oskar

> Last night was I playing some with the killall command, and figure
> out that the apache server could easly be stopped by just writing
> a php or perl script. I think there has to be a way to prevent this
> since this isn´t really a "bugg", has anyone got an idea how?

This is not really an apache issue but can be solved by using the disable_functions directive in your php.ini file. You can define a list of php commands that you consider unsafe and these commands will then not be usable by scripts on your server. 

Jon


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org