Get geographical and domain registration data about given ip addresses Python Challenge for Swimlane!
The system is run through a commandline-like interface, with multiple commands for processing the data.
Command | Description | Example Usage |
find | Finds a given ip address given a regex, and stores it in a var | find 71\.. |
load | Loads a file into memory, containing ip addresses | load list_of_ips.txt |
Prints info about a given query var | print $0 | |
rdap | Loads registration data for a given query var | rdap $0 |
geo | Loads geographic data for a given query var | geo $0 |
data | Prints the raw data of a given var | data $0 |
search | Search a given query var's data for a given regex | search $0 US. |
script | Runs a script file, more info about this in the scripts section | script test.script |
save | Saves the data for a query var into a file, raw | save $0 data.txt |
help | Prints help message | help |
exit | Exits, same as CTRL + C | exit |
Scripts can be made an automated easily, and can have any extension. Each line of the script is a command you would normally run in the terminal, and will exit on any error
Example Script:
load ips.txt
find 77\..
geo $0
rdap $0
summary $0
search $0 KPN.
save $0 script_save.txt
exit
Scripts can be run from within the terminal with the command
script <filename>
Or Via commandline with
python DoScript.py <filename>
To run this python challenge, you need a couple of dependencies, and must be running on a linux distribution. This is because certain python libraries used are not available on other platforms.
- bs4
- lxml
- readchar
- blessings
You can install these dependencies with
sudo apt-get install python-dev libxml2-dev libxslt1-dev zlib1g-dev
sudo pip install bs4 lxml readchar blessings