Skip to Content
Mastering Python for Networking and Security
book

Mastering Python for Networking and Security

by José Manuel Ortega
September 2018
Intermediate to advanced
426 pages
10h 46m
English
Packt Publishing
Content preview from Mastering Python for Networking and Security

Chapter 6: Gathering Information from Servers

  1. What do we need to access the Shodan Developer API?

Register at the Shodan website and use API_KEY, which gives you access to their services.

  1. Which method should be called in the Shodan API to obtain information about a given host and what data structure does that method return?

The method is the host() method, and it returns the dictionary data structure.

  1. Which module can be used to obtain the banner of a server?

We need to create a socket with the sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) instruction, send a GET request with the sock.sendall(http_get) instruction, and finally receive data with the data = sock.recvfrom(1024) instruction.

  1. Which method should be called ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Python for Networking and Security - Second Edition

Mastering Python for Networking and Security - Second Edition

José Manuel Ortega
Python for Cybersecurity

Python for Cybersecurity

Howard E. Poston, III

Publisher Resources

ISBN: 9781788992510Supplemental Content