This file is indexed.

/usr/share/pyshared/twisted/web2/test/simple_client.py is in python-twisted-web2 8.1.0-3build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import socket, sys

test_type = sys.argv[1]
port = int(sys.argv[2])
socket_type = sys.argv[3]

s = socket.socket(socket.AF_INET)
s.connect(("127.0.0.1", port))
s.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 40000)

if socket_type == 'ssl':
    s2 = socket.ssl(s)
    send=s2.write
    recv=s2.read
else:
    send=s.send
    recv=s.recv
    
print >> sys.stderr, ">> Making %s request to port %d" % (socket_type, port)

send("GET /error HTTP/1.0\r\n")
send("Host: localhost\r\n")

if test_type == "lingeringClose":
    print >> sys.stderr, ">> Sending lots of data"
    send("Content-Length: 1000000\r\n\r\n")
    send("X"*1000000)
else:
    send('\r\n')

#import time
#time.sleep(5)
print >> sys.stderr, ">> Getting data"
data=''
while len(data) < 299999:
    try:
        x=recv(10000)
    except:
        break
    if x == '':
        break
    data+=x
sys.stdout.write(data)