Get Information about IPAddress
This is a simple python script to get information about an IP Address. It uses the ipinfo.io API to get the information.
- Clone the repository or download the code.
git clone https://github.com/faresemad/dPhish-Challenge.git
- Create a virtual environment and install the requirements.
# Create and activate a virtual environment (optional)
python3 -m venv venv
# For Windows:
venv\Scripts\activate
# For Unix/macOS:
source venv/bin/activate
- Install the requirements.
pip install -r requirements/local.txt
- Install
make
anddocker
if not already installed.
- install make for Windows
https://gnuwin32.sourceforge.net/packages/make.htm
- install make for linux
- On Ubuntu:
sudo apt-get install make
- On Ubuntu:
- install docker for Windows
https://docs.docker.com/docker-for-windows/install/
- install docker for linux
https://docs.docker.com/engine/install/ubuntu/
- Build Project
- Build the project using the following command:
- With
make
:make build
- Without
make
:docker-compose -f docker-compose.yml build
- With
- Run the code
- Run the code using the following command:
- With
make
:make run
- Without
make
:docker-compose -f docker-compose.yml up
- With
-
api/scanner/ip-addresses/
- Method: POST
- Description: Get information about an IP Address.
- Request:
- Content-Type: application/json
- Body:
{ "address": "<IP Address>, e.g." }
- Response:
- Content-Type: application/json
- Body:
{ "message": "IPs are being processed" }
-
api/scanner/ip-addresses/<id>/
- Method: GET
- Description: Get information about an IP Address.
- Request:
- Content-Type: application/json
- Response:
- Content-Type: application/json
- Body:
{ "ip": "<IP Address>", "loc": "<Latitude, Longitude>", "org": "<Organization>", "city": "<City>", "readme": "<Readme>", "region": "<Region>", "country": "<Country>", "timezone": "<Timezone>" }