Python CGI

提供された情報を表示する

Content-type: text/html

Current Working Directory:

/home/shichigatsu/knightstyle.info/public_html/lab/python

Command Line Arguments:

['cgi_test.cgi']

Form Contents:

No form fields.

Shell Environment:

CONTEXT_DOCUMENT_ROOT
/home/shichigatsu/knightstyle.info/public_html/lab
CONTEXT_PREFIX
DOCUMENT_ROOT
/home/shichigatsu/knightstyle.info/public_html/lab
GATEWAY_INTERFACE
CGI/1.1
HTTP_ACCEPT
*/*
HTTP_CONNECTION
close
HTTP_HOST
lab.knightstyle.info
HTTP_USER_AGENT
Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_X_ACCEL_EXPIRES
60
HTTP_X_FAILURE_CACHE_TIME
0
HTTP_X_FILE_TYPE
normal
HTTP_X_FORWARDED_FOR
3.128.198.90
HTTP_X_FORWARDED_HOST
lab.knightstyle.info
HTTP_X_FORWARDED_PORT
80
HTTP_X_FORWARDED_PROTO
http
HTTP_X_REAL_IP
3.128.198.90
HTTP_X_SERVER_ADDRESS
120.136.10.68
HTTP_X_UA_DEVICE
pc
HTTP_X_WP_ACCESS
0
PATH
/usr/local/bin:/usr/bin:/bin
QUERY_STRING
REMOTE_ADDR
3.128.198.90
REMOTE_PORT
49482
REQUEST_METHOD
GET
REQUEST_SCHEME
http
REQUEST_URI
/python/cgi_test.cgi
SCRIPT_FILENAME
/home/shichigatsu/knightstyle.info/public_html/lab/python/cgi_test.cgi
SCRIPT_NAME
/python/cgi_test.cgi
SERVER_ADDR
120.136.10.68
SERVER_ADMIN
webmaster@knightstyle.info
SERVER_NAME
lab.knightstyle.info
SERVER_PORT
80
SERVER_PROTOCOL
HTTP/1.1
SERVER_SIGNATURE
SERVER_SOFTWARE
Apache
UNIQUE_ID
Z0cQUwt93q-BzJDbjKKflgAAAEs

These environment variables could have been set:

  • AUTH_TYPE
  • CONTENT_LENGTH
  • CONTENT_TYPE
  • DATE_GMT
  • DATE_LOCAL
  • DOCUMENT_NAME
  • DOCUMENT_ROOT
  • DOCUMENT_URI
  • GATEWAY_INTERFACE
  • LAST_MODIFIED
  • PATH
  • PATH_INFO
  • PATH_TRANSLATED
  • QUERY_STRING
  • REMOTE_ADDR
  • REMOTE_HOST
  • REMOTE_IDENT
  • REMOTE_USER
  • REQUEST_METHOD
  • SCRIPT_NAME
  • SERVER_NAME
  • SERVER_PORT
  • SERVER_PROTOCOL
  • SERVER_ROOT
  • SERVER_SOFTWARE
In addition, HTTP headers sent by the server may be passed in the environment as well. Here are some common variable names:
  • HTTP_ACCEPT
  • HTTP_CONNECTION
  • HTTP_HOST
  • HTTP_PRAGMA
  • HTTP_REFERER
  • HTTP_USER_AGENT

What follows is a test, not an actual exception:

Traceback (most recent call last):

  File "/usr/lib64/python2.7/cgi.py", line 904, in test
    g()
  File "/usr/lib64/python2.7/cgi.py", line 902, in g
    f()
  File "/usr/lib64/python2.7/cgi.py", line 900, in f
    exec "testing print_exception() -- <I>italics?</I>"
  File "<string>", line 1
    testing print_exception() -- <I>italics?</I>
                          ^
SyntaxError: invalid syntax

Second try with a small maxlen...

Current Working Directory:

/home/shichigatsu/knightstyle.info/public_html/lab/python

Command Line Arguments:

['cgi_test.cgi']

Form Contents:

No form fields.

Shell Environment:

CONTEXT_DOCUMENT_ROOT
/home/shichigatsu/knightstyle.info/public_html/lab
CONTEXT_PREFIX
DOCUMENT_ROOT
/home/shichigatsu/knightstyle.info/public_html/lab
GATEWAY_INTERFACE
CGI/1.1
HTTP_ACCEPT
*/*
HTTP_CONNECTION
close
HTTP_HOST
lab.knightstyle.info
HTTP_USER_AGENT
Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_X_ACCEL_EXPIRES
60
HTTP_X_FAILURE_CACHE_TIME
0
HTTP_X_FILE_TYPE
normal
HTTP_X_FORWARDED_FOR
3.128.198.90
HTTP_X_FORWARDED_HOST
lab.knightstyle.info
HTTP_X_FORWARDED_PORT
80
HTTP_X_FORWARDED_PROTO
http
HTTP_X_REAL_IP
3.128.198.90
HTTP_X_SERVER_ADDRESS
120.136.10.68
HTTP_X_UA_DEVICE
pc
HTTP_X_WP_ACCESS
0
PATH
/usr/local/bin:/usr/bin:/bin
QUERY_STRING
REMOTE_ADDR
3.128.198.90
REMOTE_PORT
49482
REQUEST_METHOD
GET
REQUEST_SCHEME
http
REQUEST_URI
/python/cgi_test.cgi
SCRIPT_FILENAME
/home/shichigatsu/knightstyle.info/public_html/lab/python/cgi_test.cgi
SCRIPT_NAME
/python/cgi_test.cgi
SERVER_ADDR
120.136.10.68
SERVER_ADMIN
webmaster@knightstyle.info
SERVER_NAME
lab.knightstyle.info
SERVER_PORT
80
SERVER_PROTOCOL
HTTP/1.1
SERVER_SIGNATURE
SERVER_SOFTWARE
Apache
UNIQUE_ID
Z0cQUwt93q-BzJDbjKKflgAAAEs
None