Skip to content

Commit

Permalink
Add ProbivApiPhoneInfo class (#23)
Browse files Browse the repository at this point in the history
* Add ProbivApiPhoneInfo class for searching information by phone number using probivapi.com

* Fix code style
  • Loading branch information
paveldat authored Oct 12, 2024
1 parent 8ff75f9 commit d254092
Show file tree
Hide file tree
Showing 17 changed files with 531 additions and 442 deletions.
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[MESSAGES CONTROL]
disable = C0413, W1203, W0703, R1710, R0903, R1732,
R0201, W1508, R0801, R0902
R0201, W1508, R0801, R0902, R0914
123 changes: 64 additions & 59 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,65 @@
# gods_eye changelog

## 1.1.2
- Changed README

## 1.1.1
- Remove unused dependencies

## 1.1.0
- Update pipeline

## 1.0.9
- Add one_sec_mail tool.
- Update README

## 1.0.8
- Add status badge Markdown

## 1.0.7
- Fix release job to publish release package.

## 1.0.6
- Add pipeline.
Add deploy to PyPI.
Add tests and code check.

## 1.0.5
- Pylint check code style

## 1.0.4
- `phone_info` modification.
Now the map can be saved in the specified path.

## 1.0.3
- Added tools:
- phone_info
Gets country, operator and location by phone number.

## 1.0.2
- Added tools:
- pwned
Checks if your password has been compromised in a data breach.

## 1.0.1
- Added tools:
- ip_info_finder
This tool works for Domain or IP addresses

- Added error handler

## 1.0.0
- Added tools:
- clickjacking
- exec_shell_command
- http_headers_grabber
- ip
- logger
- nmap_scanner
- robots_scaner
# gods_eye changelog

## 1.2.0

- Add ProbivApiPhoneInfo class for searching information by phone number using probivapi.com
- Fix code style

## 1.1.2
- Changed README

## 1.1.1
- Remove unused dependencies

## 1.1.0
- Update pipeline

## 1.0.9
- Add one_sec_mail tool.
- Update README

## 1.0.8
- Add status badge Markdown

## 1.0.7
- Fix release job to publish release package.

## 1.0.6
- Add pipeline.
Add deploy to PyPI.
Add tests and code check.

## 1.0.5
- Pylint check code style

## 1.0.4
- `phone_info` modification.
Now the map can be saved in the specified path.

## 1.0.3
- Added tools:
- phone_info
Gets country, operator and location by phone number.

## 1.0.2
- Added tools:
- pwned
Checks if your password has been compromised in a data breach.

## 1.0.1
- Added tools:
- ip_info_finder
This tool works for Domain or IP addresses

- Added error handler

## 1.0.0
- Added tools:
- clickjacking
- exec_shell_command
- http_headers_grabber
- ip
- logger
- nmap_scanner
- robots_scaner
- whois_lookup
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = gods_eye
version = 1.1.2
version = 1.2.0
author = Pavel Dat
author_email = [email protected]
description = A set of tools which should be used in Gods Eye
Expand Down
38 changes: 19 additions & 19 deletions src/clickjacking/clickjacking.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,15 @@
▒▐█░░░▐█─░▐█░▒▀▄▀░░▐█▄▄▒██▄▄█░▐█▄█▀░▐█─░▐█░▒▄█▄░
"""

import sys
import logging
import sys

sys.path.insert(
0,
'src'
)
sys.path.insert(0, "src")

from logger.logger import Logger
from http_headers_grabber.http_headers_grabber import HttpHeadersGrabber
from logger.logger import Logger


logger = Logger('ClickJacking')
logger = Logger("ClickJacking")


class ClickJacking:
Expand All @@ -44,24 +40,28 @@ def click_jacking(target: str, debug: bool = False) -> bool:
logger.setLevel(logging.DEBUG)

if not isinstance(target, str):
logger.raise_fatal(BaseException(f'Target must be a string not {type(target)}. '
f'Got target: {target}'))
logger.raise_fatal(
BaseException(
f"Target must be a string not {type(target)}. "
f"Got target: {target}"
)
)

target = target.lower()
if not (target.startswith('http://') or target.startswith('https://')):
target = 'http://' + target
if not (target.startswith("http://") or target.startswith("https://")):
target = "http://" + target

logger.info(f'Testing ClickJacking for {target}')
logger.info(f"Testing ClickJacking for {target}")

try:
headers = HttpHeadersGrabber.http_headers_grabber(target)

if 'X-Frame-Options' in headers.keys():
logger.debug('ClickJacking Header is present')
logger.debug('You can\'t clickjack this domain')
if "X-Frame-Options" in headers.keys():
logger.debug("ClickJacking Header is present")
logger.debug("You can't clickjack this domain")
return False
logger.debug('ClickJacking Header is missing')
logger.debug('This domain is vulnerable to ClickJacking')
logger.debug("ClickJacking Header is missing")
logger.debug("This domain is vulnerable to ClickJacking")
return True
except Exception as ex:
logger.raise_fatal(BaseException(f'Error occurred: {ex}'))
logger.raise_fatal(BaseException(f"Error occurred: {ex}"))
31 changes: 15 additions & 16 deletions src/dns_lookup/dns_lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,16 @@
▒▐█░░░▐█─░▐█░▒▀▄▀░░▐█▄▄▒██▄▄█░▐█▄█▀░▐█─░▐█░▒▄█▄░
"""


import sys
import logging
import sys

import dns.resolver

sys.path.insert(
0,
'src'
)
sys.path.insert(0, "src")

from logger.logger import Logger


logger = Logger('DnsLookup')
logger = Logger("DnsLookup")


class DnsLookup:
Expand All @@ -35,8 +31,7 @@ class DnsLookup:
"""

@staticmethod
def dns_lookup(target: str, record_type: str = 'A',
debug: bool = False) -> list:
def dns_lookup(target: str, record_type: str = "A", debug: bool = False) -> list:
"""
Looks for dns lookup information for IP or Domain.
Expand All @@ -53,16 +48,20 @@ def dns_lookup(target: str, record_type: str = 'A',
logger.setLevel(logging.DEBUG)

if not isinstance(target, str):
logger.raise_fatal(BaseException(f'Target must be a string not {type(target)}. '
f'Got target: {target}'))
logger.raise_fatal(
BaseException(
f"Target must be a string not {type(target)}. "
f"Got target: {target}"
)
)

ipvs = []
logger.info(f'DNS Lookup: {target.lower()}')
logger.info(f'Records to find out: {record_type}')
logger.info(f"DNS Lookup: {target.lower()}")
logger.info(f"Records to find out: {record_type}")
try:
for ipval in dns.resolver.resolve(target.lower(), record_type):
ipvs.append(ipval.to_text())
logger.debug(record_type + ' : ' + ipval.to_text())
logger.debug(record_type + " : " + ipval.to_text())
return ipvs
except Exception as ex:
logger.raise_fatal(BaseException(f'Error occurred: {ex}'))
logger.raise_fatal(BaseException(f"Error occurred: {ex}"))
14 changes: 5 additions & 9 deletions src/exec_shell_command/exec_shell_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,15 @@
▒▐█░░░▐█─░▐█░▒▀▄▀░░▐█▄▄▒██▄▄█░▐█▄█▀░▐█─░▐█░▒▄█▄░
"""

import sys
import logging
from subprocess import Popen, PIPE
import sys
from subprocess import PIPE, Popen

sys.path.insert(
0,
'src'
)
sys.path.insert(0, "src")

from logger.logger import Logger


logger = Logger('exec_commands')
logger = Logger("exec_commands")


def exec_shell_command(command: str, debug: bool = False) -> str:
Expand All @@ -38,7 +34,7 @@ def exec_shell_command(command: str, debug: bool = False) -> str:
if debug:
logger.setLevel(logging.DEBUG)

logger.info(f'Executing command: `{command}`')
logger.info(f"Executing command: `{command}`")
with Popen(command, shell=True, stdout=PIPE, stderr=PIPE) as proc:
status = proc.wait()
output = proc.stdout.read().decode(sys.stdout.encoding)
Expand Down
29 changes: 15 additions & 14 deletions src/http_headers_grabber/http_headers_grabber.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@
▒▐█░░░▐█─░▐█░▒▀▄▀░░▐█▄▄▒██▄▄█░▐█▄█▀░▐█─░▐█░▒▄█▄░
"""

import sys
import logging
import sys

import requests

sys.path.insert(
0,
'src'
)
sys.path.insert(0, "src")

from logger.logger import Logger


logger = Logger('HttpGrabber')
logger = Logger("HttpGrabber")


class HttpHeadersGrabber:
Expand All @@ -44,15 +41,19 @@ def http_headers_grabber(target: str, debug: bool = False) -> dict:
logger.setLevel(logging.DEBUG)

if not isinstance(target, str):
logger.raise_fatal(BaseException(f'Target must be a string not {type(target)}. '
f'Got target: {target}'))
logger.raise_fatal(
BaseException(
f"Target must be a string not {type(target)}. "
f"Got target: {target}"
)
)

try:
if not (target.startswith('http://') or target.startswith('https://')):
target = 'http://' + target
if not (target.startswith("http://") or target.startswith("https://")):
target = "http://" + target
response = requests.get(target.lower())
logger.info(f'Got {target} request: {response.status_code}')
logger.debug(f'Headers:\n {response.headers}')
logger.info(f"Got {target} request: {response.status_code}")
logger.debug(f"Headers:\n {response.headers}")
return response.headers
except Exception as ex:
logger.raise_fatal(BaseException(f'Error occurred: {ex}'))
logger.raise_fatal(BaseException(f"Error occurred: {ex}"))
Loading

0 comments on commit d254092

Please sign in to comment.