Skip to content

Instantly share code, notes, and snippets.

@BoboTiG
Created January 20, 2021 15:24
Show Gist options
  • Save BoboTiG/f88c659cda7ffc311953945deff78889 to your computer and use it in GitHub Desktop.
Save BoboTiG/f88c659cda7ffc311953945deff78889 to your computer and use it in GitHub Desktop.
Medium - The Mystery of the Endless HTTPS Call
$ gdb -i <PID>
(gdb) info threads
Id Target Id Frame
* 1 Thread 0x7fad2abbe680 (LWP 17394) "python" 0x00007fad2a189081 in __GI___libc_read (fd=5, buf=0x56395f61e5d3, nbytes=5) at ../sysdeps/unix/sysv/linux/read.c:27
(gdb) t
[Current thread is 1 (Thread 0x7fad2abbe680 (LWP 17394))]
(gdb) bt
#0 0x00007fad2a189081 in __GI___libc_read (fd=5, buf=0x56395f61e5d3, nbytes=5) at ../sysdeps/unix/sysv/linux/read.c:27
#1 0x00007fad2824db7e in ?? () from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
#2 0x00007fad28248fba in ?? () from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
#3 0x00007fad28247e53 in ?? () from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
#4 0x00007fad28248403 in BIO_read () from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
#5 0x00007fad26d66913 in ?? () from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
#6 0x00007fad26d6afbd in ?? () from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
#7 0x00007fad26d686c2 in ?? () from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
#8 0x00007fad26d6f995 in ?? () from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
#9 0x00007fad26d7a232 in ?? () from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
#10 0x00007fad26d7a353 in SSL_read () from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
#11 0x00007fad26fe3247 in _ssl__SSLSocket_read_impl (buffer=0x7ffc9eef3300, buffer=0x7ffc9eef3300, group_right_1=<optimized out>, len=8192, self=0x7fad26a8e440)
at /tmp/python-build.20201030105347.4623/Python-3.7.9/Modules/_ssl.c:2535
#12 _ssl__SSLSocket_read (self=0x7fad26a8e440, args=<optimized out>) at /tmp/python-build.20201030105347.4623/Python-3.7.9/Modules/clinic/_ssl.c.h:281
...
(gdb) py-list
924 self._checkClosed()
925 if self._sslobj is None:
926 raise ValueError("Read on closed or unwrapped SSL socket.")
927 try:
928 if buffer is not None:
>929 return self._sslobj.read(len, buffer)
930 else:
931 return self._sslobj.read(len)
932 except SSLError as x:
933 if x.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs:
934 if buffer is not None:
(gdb) py-bt
Traceback (most recent call first):
File "/.../lib/python3.7/ssl.py", line 929, in read
return self._sslobj.read(len, buffer)
File "/.../lib/python3.7/ssl.py", line 1071, in recv_into
return self.read(nbytes, buffer)
File "/.../lib/python3.7/socket.py", line 589, in readinto
return self._sock.recv_into(b)
File "/.../lib/python3.7/http/client.py", line 271, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/.../lib/python3.7/http/client.py", line 310, in begin
version, status, reason = self._read_status()
File "/.../lib/python3.7/http/client.py", line 1369, in getresponse
response.begin()
File "python-http-client.py", line 27, in <module>
req = conn.getresponse()
(gdb) py-locals
self = <SSLSocket(_context=<SSLContext at remote 0x7fad27228280>, _session=None, _sslobj=<_ssl._SSLSocket at remote 0x7fad26a8e440>, server_side=False, server_hostname='<HOST>', do_handshake_on_connect=True, suppress_ragged_eofs=True, _connected=True) at remote 0x7fad26ade830>
len = 8192
buffer = <memoryview at remote 0x7fad26af8120>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment