This file is indexed.

/usr/share/doc/python-dpkt/examples/dhcprequest.py is in python-dpkt 1.6+svn54-1.

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
44
45
46
47
48
49
50
51
52
#!/usr/bin/env python

import dnet
from dpkt import dhcp
from dpkt import udp
from dpkt import ip
from dpkt import ethernet

sysintf = 'eth0'
hw = dnet.eth(sysintf)
intf = dnet.intf()

# build a dhcp discover packet to request an ip
d = dhcp.DHCP(
        chaddr = hw.get(),
        xid = 1337,
        op = dhcp.DHCPDISCOVER,
        opts = (
            (dhcp.DHCP_OP_REQUEST, ''),
            (dhcp.DHCP_OPT_REQ_IP, ''),
            (dhcp.DHCP_OPT_ROUTER, ''),
            (dhcp.DHCP_OPT_NETMASK, ''),
            (dhcp.DHCP_OPT_DNS_SVRS, '')
        )
    )

# build udp packet
u = udp.UDP(
        dport = 67,
        sport = 68,
        data = d
    )
u.ulen = len(u)

# build ip packet
i = ip.IP(
        dst = dnet.ip_aton('255.255.255.255'),
        src = intf.get(sysintf)['addr'].ip,
        data = u,
        p = ip.IP_PROTO_UDP
    )
i.len = len(i)

# build ethernet frame
e = ethernet.Ethernet(
        dst = dnet.ETH_ADDR_BROADCAST,
        src = hw.get(),
        data = i
    )

# send the data out
hw.send(str(e))