LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 12-02-2004, 02:48 AM   #1
dominant
Member
 
Registered: Jan 2004
Posts: 409

Rep: Reputation: 30
coping neccesary python files to chroot area


I lately installed the python and mod_python for my apache.
Now i am wondering what are the necessary files (python, mod_python related) that must be copied to the chrooted area.
 
Old 12-03-2004, 04:18 PM   #2
zatriz
Member
 
Registered: Aug 2003
Location: Seattle, Wa
Distribution: Fedora,Trustix,Debian
Posts: 290

Rep: Reputation: 30
if you type "rpm -ql mod_python" it will list all the files that the module installed
The files that i would probably copy over are


/etc/httpd/conf.d/python.conf
/usr/lib/httpd/modules/mod_python.so
/usr/lib/python2.2/site-packages/mod_python
/usr/lib/python2.2/site-packages/mod_python/__init__.py
/usr/lib/python2.2/site-packages/mod_python/__init__.pyc
/usr/lib/python2.2/site-packages/mod_python/__init__.pyo
/usr/lib/python2.2/site-packages/mod_python/apache.py
/usr/lib/python2.2/site-packages/mod_python/apache.pyc
/usr/lib/python2.2/site-packages/mod_python/apache.pyo
/usr/lib/python2.2/site-packages/mod_python/cgihandler.py
/usr/lib/python2.2/site-packages/mod_python/cgihandler.pyc
/usr/lib/python2.2/site-packages/mod_python/cgihandler.pyo
/usr/lib/python2.2/site-packages/mod_python/publisher.py
/usr/lib/python2.2/site-packages/mod_python/publisher.pyc
/usr/lib/python2.2/site-packages/mod_python/publisher.pyo
/usr/lib/python2.2/site-packages/mod_python/util.py
/usr/lib/python2.2/site-packages/mod_python/util.pyc
/usr/lib/python2.2/site-packages/mod_python/util.pyo


you can skip the html files
 
Old 12-04-2004, 04:36 AM   #3
linux_terror
Member
 
Registered: Aug 2004
Location: Northbrook, Illinois
Distribution: CentOS-5
Posts: 311

Rep: Reputation: 30
it may just point at some of the files in the previous post but do a
Code:
ldd /usr/lib/httpd/modules/mod_python.so
if its in a true chroot jail you'll need to copy all the files ldd finds into the jail.

just for shits 'n' giggles here's the output from mine on RHAS3 with apache 2.0.51

[root@linuxtorrents modules]# ldd mod_python.so
libdl.so.2 => /lib/libdl.so.2 (0xb7513000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb7503000)
libutil.so.1 => /lib/libutil.so.1 (0xb7500000)
libm.so.6 => /lib/tls/libm.so.6 (0xb74de000)
libc.so.6 => /lib/tls/libc.so.6 (0xb73a7000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)


linux_terror

Last edited by linux_terror; 12-04-2004 at 04:39 AM.
 
Old 12-04-2004, 10:04 AM   #4
dominant
Member
 
Registered: Jan 2004
Posts: 409

Original Poster
Rep: Reputation: 30
well, copied that files that the ldd indicates, but most of the files are links to another shared library.

If i copy a link (to anothery library) do i copy that actual library?
 
Old 12-04-2004, 03:51 PM   #5
linux_terror
Member
 
Registered: Aug 2004
Location: Northbrook, Illinois
Distribution: CentOS-5
Posts: 311

Rep: Reputation: 30
yes, copy the actual libraries into the jail, remember that the user has no priveleges to do anything above the chroot. you basically have to in effect build its own little OS inside the jail.

linux_terror
 
Old 12-05-2004, 07:09 AM   #6
dominant
Member
 
Registered: Jan 2004
Posts: 409

Original Poster
Rep: Reputation: 30
I am wondering if the lost link can cause any failure?

I mean when mod_python.so looks for /lib/libpyth.so.1
which is a link to /lib/libpyth.so.9 and it finds (a renamed file
in practice) (/lib/libpyth.so.1 with the content of /lib/libpyth.so.9).
 
Old 12-17-2004, 03:30 AM   #7
dominant
Member
 
Registered: Jan 2004
Posts: 409

Original Poster
Rep: Reputation: 30
Hello again

I can run python in chrooted are now

Code:
/usr/sbin/chroot /chroot /usr/local/bin/python
but when i try to integrate python with apache through mod_python then apache crases after creating many idle servers (140 approximately).

I have also copied the mod_python.so and the libraries that ldd indecates concerning mod_python.so
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Permission Denied while coping files busaussie Linux - General 5 01-05-2006 11:26 AM
Is a firewall neccesary? anti.corp Linux - Newbie 8 11-18-2005 12:21 PM
Suse 9.2 Pro - Network dies after a while (also while coping large files) Za_medic Linux - Networking 2 03-05-2005 11:57 PM
Gentoo 2004.2 chroot/pulling files ghazz Linux - Distributions 2 01-25-2005 05:10 PM
is SASL neccesary? mooreted Linux - Software 1 02-22-2004 12:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration