Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #3018

Re: PHP script to only be accessed by cron

From "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid>
Newsgroups comp.lang.php
Subject Re: PHP script to only be accessed by cron
Date 2011-08-31 08:34 +0200
Organization http://alvaro.es/
Message-ID <j3kklp$o6d$1@dont-email.me> (permalink)
References <04759979-6bc8-4946-8a96-6e85775bc155@19g2000vbv.googlegroups.com>

Show all headers | View raw


El 31/08/2011 2:23, jwcarlton escribió/wrote:
> I'm writing a PHP script that I want to ONLY be accessed by a
> predefined cron. Can you guys suggest a way to prevent non-cron
> accesses?
>
> I wouldn't mind encoding the page, too, JUST in case I have a root
> breach (not expected, of course, but not impossible). Since I would
> only need to encode one page, once, would it be reasonable to use the
> free trial of Zend Guard? Or would you guys suggest something
> different?

I'm sure you can get the process tree, find out whether the parent of 
your script's PID belongs to the cron binary and abort otherwise. 
However, the second paragraph talks about hackers and encoding, which 
gives the impression that non-cron execution is not the problem itself 
but you solution to some unmentioned problem.

I say so because it's pretty common that non-root users are allowed to 
schedule cron tasks and, of course, root is able to run any script on 
disc no matter the file permissions. Are those situations acceptable?

-- 
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

PHP script to only be accessed by cron jwcarlton <jwcarlton@gmail.com> - 2011-08-30 17:23 -0700
  Re: PHP script to only be accessed by cron "Peter H. Coffin" <hellsop@ninehells.com> - 2011-08-30 19:44 -0500
    Re: PHP script to only be accessed by cron jwcarlton <jwcarlton@gmail.com> - 2011-08-30 19:16 -0700
      Re: PHP script to only be accessed by cron "Peter H. Coffin" <hellsop@ninehells.com> - 2011-08-31 07:15 -0500
        Re: PHP script to only be accessed by cron The Natural Philosopher <tnp@invalid.invalid> - 2011-08-31 17:48 +0100
  Re: PHP script to only be accessed by cron "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2011-08-31 08:34 +0200
  Re: PHP script to only be accessed by cron Goran <goran@nospam.com> - 2011-08-31 08:43 +0200
  Re: PHP script to only be accessed by cron The Natural Philosopher <tnp@invalid.invalid> - 2011-08-31 09:20 +0100
    Re: PHP script to only be accessed by cron jwcarlton <jwcarlton@gmail.com> - 2011-08-31 02:14 -0700
      Re: PHP script to only be accessed by cron "Peter H. Coffin" <hellsop@ninehells.com> - 2011-08-31 07:53 -0500
        Re: PHP script to only be accessed by cron The Natural Philosopher <tnp@invalid.invalid> - 2011-08-31 17:58 +0100
      Re: PHP script to only be accessed by cron The Natural Philosopher <tnp@invalid.invalid> - 2011-08-31 17:45 +0100
      Re: PHP script to only be accessed by cron "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2011-09-01 10:55 +0200
    Re: PHP script to only be accessed by cron Luuk <Luuk@invalid.lan> - 2011-08-31 20:37 +0200
      Re: PHP script to only be accessed by cron The Natural Philosopher <tnp@invalid.invalid> - 2011-08-31 20:49 +0100
        Re: PHP script to only be accessed by cron Luuk <Luuk@invalid.lan> - 2011-09-01 19:11 +0200
          Re: PHP script to only be accessed by cron The Natural Philosopher <tnp@invalid.invalid> - 2011-09-01 20:25 +0100
            Re: PHP script to only be accessed by cron Luuk <Luuk@invalid.lan> - 2011-09-01 21:45 +0200
              Re: PHP script to only be accessed by cron The Natural Philosopher <tnp@invalid.invalid> - 2011-09-02 00:30 +0100
  Re: PHP script to only be accessed by cron Denis McMahon <denis.m.f.mcmahon@gmail.com> - 2011-09-01 10:42 +0000

csiph-web