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


Groups > comp.os.linux.security > #341

Re: suexec error

Newsgroups comp.os.linux.security
Date 2013-05-31 05:42 -0700
References (2 earlier) <8738t4man5.fsf@araminta.anjou.terraraq.org.uk> <b6440746-7c60-4482-99f5-a5dc1020b7f9@googlegroups.com> <87y5avshcl.fsf@araminta.anjou.terraraq.org.uk> <e8942bca-2c7b-43e7-b2bc-5ae97b8f238f@googlegroups.com> <87mwrbtsol.fsf@araminta.anjou.terraraq.org.uk>
Message-ID <ff108d02-764b-4b72-a171-dda32cdce4b8@googlegroups.com> (permalink)
Subject Re: suexec error
From nikos.gr33k@gmail.com

Show all headers | View raw


[QUOTE=zxq9]On CentOS the Apache server is guarded by a pretty huge set of SELinux protections. These are almost certainly denying access to stuff in /home from scripts run by Apache.

suexec is an Apache plugin that lets the part of Apache that executes scripts run another program as a user other than "apache". In this case it is trying to execute your .py script as your username.

I hate to sound paternal here, but you should read the Apache and RHEL/CentOS/SL docs to understand what you're getting into.

That said, what problem are you actually trying to solve? What is the overall thing you are trying to do or effect you are trying to achieve?[/QUOTE]

I have created a python 3 script to actually try to set up a cooki, nothign special or somethign that need some extra access. here is the code:


[code]
#!/usr/bin/python3
# coding=utf-8

import cgitb; cgitb.enable()
import cgi, os, sys
from http import cookies

# initialize cookie
cookie = cookies.SimpleCookie( os.environ.get('HTTP_COOKIE') )
cookie.load( cookie )
nikos = cookie.get('nikos')

# if visitor cookie does exist
if nikos:
	msg = "ΑΠΟ ΤΗΝ ΕΠΟΜΕΝΗ ΕΠΙΣΚΕΨΗ ΣΟΥ ΘΑ ΣΕ ΥΠΟΛΟΓΙΖΩ ΩΣ ΕΠΙΣΚΕΠΤΗ ΑΥΞΑΝΟΝΤΑΣ ΤΟΝ ΜΕΤΡΗΤΗ!"
	cookie['nikos'] = 'admin'
	cookie['nikos']['path'] = '/'
	cookie['nikos']['expires'] = -1		#this cookie will expire now
else:
	msg = "ΑΠΟ ΔΩ ΚΑΙ ΣΤΟ ΕΞΗΣ ΔΕΝ ΣΕ ΕΙΔΑ, ΔΕΝ ΣΕ ΞΕΡΩ, ΔΕΝ ΣΕ ΑΚΟΥΣΑ! ΘΑ ΕΙΣΑΙ ΠΛΕΟΝ Ο ΑΟΡΑΤΟΣ ΕΠΙΣΚΕΠΤΗΣ!!"
	cookie['nikos'] = 'admin'
	cookie['nikos']['path'] = '/'
	cookie['nikos']['expires'] = 60*60*24*30*12		#this cookie will expire in a year


#needed line, script does *not* work without it
sys.stdout = os.fdopen(1, 'w', encoding='utf-8')

print( cookie )
print ( "Content-type: text/html; charset=utf-8\n" )
print( msg )

sys.exit(0)
[/code]

is till wonder how the other scripts which they do more stuff dont provide me this suecec error.

Should i delete and recreate the koukos.py file?

Back to comp.os.linux.security | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

suexec error nikos.gr33k@gmail.com - 2013-05-30 06:30 -0700
  Re: suexec error Jeff Long <long@ku.edu> - 2013-05-30 10:11 -0500
  Re: suexec error Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2013-05-30 13:04 -0400
    Re: suexec error nagia.retsina@gmail.com - 2013-05-30 13:09 -0700
    Re: suexec error Richard Kettlewell <rjk@greenend.org.uk> - 2013-05-30 22:16 +0100
      Re: suexec error nagia.retsina@gmail.com - 2013-05-30 21:40 -0700
        Re: suexec error nikos.gr33k@gmail.com - 2013-05-31 01:00 -0700
        Re: suexec error Richard Kettlewell <rjk@greenend.org.uk> - 2013-05-31 09:07 +0100
          Re: suexec error nikos.gr33k@gmail.com - 2013-05-31 01:29 -0700
            Re: suexec error Richard Kettlewell <rjk@greenend.org.uk> - 2013-05-31 10:16 +0100
              Re: suexec error nikos.gr33k@gmail.com - 2013-05-31 05:42 -0700
                Re: suexec error Richard Kettlewell <rjk@greenend.org.uk> - 2013-05-31 13:53 +0100
                Re: suexec error nikos.gr33k@gmail.com - 2013-05-31 06:03 -0700

csiph-web