Skip to content

Instantly share code, notes, and snippets.

@gmastrokostas
gmastrokostas / get_http.py
Created November 25, 2015 09:21
This script generates simple GET requests from a web server. Threading is used in order to generate multiple GET requests at the same time. Note that this script cannot create significant stress on a Web Server.
import requests
import threading
def get_thrasher():
req_get = requests.get('http://192.168.56.101/')
threads = []
@gmastrokostas
gmastrokostas / IP_geoip_location.py
Last active November 25, 2015 09:22
The script collects the IP addresses from the apache log file. It then uses the geoip2 database in order to find the geographical location of the IP. More information for the geoip2 database can be found at http://dev.maxmind.com/geoip/geoip2/downloadable/ The module used to capture the IPs from the apache log file requires a CustomLog format. I…
#The script collects the IP addresses from the apache log file.
#It then uses the geoip2 database in order to find the geographical location of the IP.
#More information for the geoip2 database can be found at http://dev.maxmind.com/geoip/geoip2/downloadable/
#The module used to capture the IPs from the apache log file requires a CustomLog format. It needs to be specified in the apache config file and in the script. The string used is
#("%h <<%P>> %t %Dus \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %l %u"
import geoip2.database
import apache_log_parser
#specify the log file we will capture the IP from.