SO_BROADCAST, 34
SO_DONTROUT, 34
SO_TYPE, 34
recvfrom() function, 22
request IDs, 29
server and client, 24, 26
timeout, 26
unreliability, 26
web browser/SSH client, 21
SocketServer module, 124
SO_REUSEADDR socket option, 46
Spoofing, 29
SSH File Transfer Protocol (SFTP)
directory and fetching files, 313
output, 313
remote filesystem, 312
sftp and scp commands, 312
SFTPClient-class, 312
SSH protocol
authentication, 306
channels, 304
command-line automation
(see Command-line automation)
echo and exit commands, 309
exec_command() function, 309
features, 314
getpass(), 308
host keys
approaches, 305
certificate authority, 304
prompt, 305
implementation, 306
invoke_shell(), 309
missing_host_key() method, 306
MissingHostKeyPolicy class, 306
parallel, 310–311
paramiko library, 305
remote shell, 308
rlogin, 303
secure, 303
SFTP
directory and
fetching files, 313
output, 313
remote filesystem, 312
sftp and scp commands, 312
SFTPClient-class, 312
subprocess module, 309–310
UDP/TCP connection, 304
ssl.create_default_context() function, 99
storbinary() and
storlines() function, 323
submit_form() method, 221
T
Telnet
authentication, 300
command-line automation
(see Command-line automation)
expect() method, 301
interact() method, 302
process option codes, 302–303
read_until() method, 301
remote host logging, 300–301
set_debuglevel(1), 301
socket.error exceptions, 301
telnetlib method, 300
username and password prompts, 299–300
Top-level domain (TLD), 57
TRACE method, 155
Transmission Control Protocol (TCP), 10
application, 40
client and server
bind(), 43
coding, 42
connect(), 43
recv(), 45
send(), 44
sendall(), 44–45
send() and recv(), 44
socket operations order, 45
SO_REUSEADDR option, 46
connecting to network interfaces, 47
deadlock
buffers, 52
client–server pattern, 49
dangers involved in protocols, 52
processing fixed-length blocks, 51
processing large amounts of data, 53
half-close connection, 53
shutdown() call, 53
sockets, 41
treating socket as file object, 54
working principles, 39
Transport layer security (TLS), 254.
See also Secure sockets layer (SSL)
certificate
ca.crt certificate, 96
certificate authorities, 98
CSR, 96
definition, 94
encryption key, 95
OpenSSL command line, 96
PEM file, 97
signature, 95
subjectAltName field, 95
■ index
355