5 Python Libraries for Cyber Security

Chris Doucette
3 min readDec 10, 2018
Photo by Marius Masalar on Unsplash

Introduction

Python is currently one of the fastest growing and most in demand languages. It’s usefulness has been proven in software engineering and data science. Another useful application of the language is for building cyber security tools. In this article, I would like to share with you some of my favorite libraries for building cyber security tools.

Requests

Requests is one of my most used libraries by far and it is for many others as it is one of the most downloaded Python libraries at 400,000 downloads each day. Requests is used for crafting HTTP requests within your Python scripts. This is useful for calling public APIs and grabbing HTML pages.

Installation:

$ pip install requests

Example:

import requestsurl = 'https://haveibeenpwned.com/api/v2/breachedaccount/test@example.com'result = requests.get(url)print(result.text)# [{"Name":"000webhost","Title":"000webhost"...}]

Scapy

Scapy is a useful libary for interacting with packets. It is able to forge or decode packets of a wide number of protocols, send them on the wire, capture them…

--

--