Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Python for Networking and Security

You're reading from   Mastering Python for Networking and Security Leverage Python scripts and libraries to overcome networking and security issues

Arrow left icon
Product type Paperback
Published in Sep 2018
Publisher Packt
ISBN-13 9781788992510
Length 426 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
José Manuel Ortega José Manuel Ortega
Author Profile Icon José Manuel Ortega
José Manuel Ortega
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Working with Python Scripting 2. System Programming Packages FREE CHAPTER 3. Socket Programming 4. HTTP Programming 5. Analyzing Network Traffic 6. Gathering Information from Servers 7. Interacting with FTP, SSH, and SNMP Servers 8. Working with Nmap Scanners 9. Connecting with the Metasploit Framework 10. Interacting with the Vulnerabilities Scanner 11. Identifying Server Vulnerabilities in Web Applications 12. Extracting Geolocation and Metadata from Documents, Images, and Browsers 13. Cryptography and Steganography 14. Assessments 15. Other Books You May Enjoy

Chapter 3: Socket Programming

  1. Which method of the sockets module allows a domain name to be obtained from an IP address?

With the gethostbyaddr(address) method, we can obtain a domain name from an IP address.

  1. Which method of the socket module allows a server socket to accept requests from a client socket from another host?

socket.accept() is used to accept the connection from the client. This method returns two values: client_socket and client_address, where client_socket is a new socket object used to send and receive data over the connection.

  1. Which method of the socket module allows the sending of data to a given address?

socket.sendto(data, address) is used to send data to a given address.

  1. Which method of the socket module allows you to associate a host and a port with a specific socket?

The bind(IP,PORT) method allows you to associate a host and a port with a...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime