usr bin env python made in mobnet import cgitb cgitb enable import sys

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env python
# made in mobnet:)
import cgitb
cgitb.enable()
import sys
import os
from mimetypes import guess_type
cgitb.enable()
name = os.environ['DOCUMENT_ROOT'] + os.environ['REDIRECT_URL']
if not os.path.exists(name):
print 'Content-Type: text/html\n\n<b>404 not found!</b>'
sys.exit('EX_OK')
else:
length = os.path.getsize(name)
type_ = guess_type(name)[0]
print 'Content-Type: %s\nAccept-Ranges: bytes\nContent-Length: %s\n' % (length, type_)
print open(name).read()