Skip to content

Commit 96e96fe

Browse files
committed
Fix code style
1 parent 6fa17ab commit 96e96fe

File tree

14 files changed

+410
-415
lines changed

14 files changed

+410
-415
lines changed

CHANGELOG.md

+64-63
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,65 @@
1-
# gods_eye changelog
2-
3-
## 1.2.0
4-
5-
- Add ProbivApiPhoneInfo class for searching information by phone number using probivapi.com
6-
7-
## 1.1.2
8-
- Changed README
9-
10-
## 1.1.1
11-
- Remove unused dependencies
12-
13-
## 1.1.0
14-
- Update pipeline
15-
16-
## 1.0.9
17-
- Add one_sec_mail tool.
18-
- Update README
19-
20-
## 1.0.8
21-
- Add status badge Markdown
22-
23-
## 1.0.7
24-
- Fix release job to publish release package.
25-
26-
## 1.0.6
27-
- Add pipeline.
28-
Add deploy to PyPI.
29-
Add tests and code check.
30-
31-
## 1.0.5
32-
- Pylint check code style
33-
34-
## 1.0.4
35-
- `phone_info` modification.
36-
Now the map can be saved in the specified path.
37-
38-
## 1.0.3
39-
- Added tools:
40-
- phone_info
41-
Gets country, operator and location by phone number.
42-
43-
## 1.0.2
44-
- Added tools:
45-
- pwned
46-
Checks if your password has been compromised in a data breach.
47-
48-
## 1.0.1
49-
- Added tools:
50-
- ip_info_finder
51-
This tool works for Domain or IP addresses
52-
53-
- Added error handler
54-
55-
## 1.0.0
56-
- Added tools:
57-
- clickjacking
58-
- exec_shell_command
59-
- http_headers_grabber
60-
- ip
61-
- logger
62-
- nmap_scanner
63-
- robots_scaner
1+
# gods_eye changelog
2+
3+
## 1.2.0
4+
5+
- Add ProbivApiPhoneInfo class for searching information by phone number using probivapi.com
6+
- Fix code style
7+
8+
## 1.1.2
9+
- Changed README
10+
11+
## 1.1.1
12+
- Remove unused dependencies
13+
14+
## 1.1.0
15+
- Update pipeline
16+
17+
## 1.0.9
18+
- Add one_sec_mail tool.
19+
- Update README
20+
21+
## 1.0.8
22+
- Add status badge Markdown
23+
24+
## 1.0.7
25+
- Fix release job to publish release package.
26+
27+
## 1.0.6
28+
- Add pipeline.
29+
Add deploy to PyPI.
30+
Add tests and code check.
31+
32+
## 1.0.5
33+
- Pylint check code style
34+
35+
## 1.0.4
36+
- `phone_info` modification.
37+
Now the map can be saved in the specified path.
38+
39+
## 1.0.3
40+
- Added tools:
41+
- phone_info
42+
Gets country, operator and location by phone number.
43+
44+
## 1.0.2
45+
- Added tools:
46+
- pwned
47+
Checks if your password has been compromised in a data breach.
48+
49+
## 1.0.1
50+
- Added tools:
51+
- ip_info_finder
52+
This tool works for Domain or IP addresses
53+
54+
- Added error handler
55+
56+
## 1.0.0
57+
- Added tools:
58+
- clickjacking
59+
- exec_shell_command
60+
- http_headers_grabber
61+
- ip
62+
- logger
63+
- nmap_scanner
64+
- robots_scaner
6465
- whois_lookup

src/clickjacking/clickjacking.py

+19-19
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,15 @@
77
▒▐█░░░▐█─░▐█░▒▀▄▀░░▐█▄▄▒██▄▄█░▐█▄█▀░▐█─░▐█░▒▄█▄░
88
"""
99

10-
import sys
1110
import logging
11+
import sys
1212

13-
sys.path.insert(
14-
0,
15-
'src'
16-
)
13+
sys.path.insert(0, "src")
1714

18-
from logger.logger import Logger
1915
from http_headers_grabber.http_headers_grabber import HttpHeadersGrabber
16+
from logger.logger import Logger
2017

21-
22-
logger = Logger('ClickJacking')
18+
logger = Logger("ClickJacking")
2319

2420

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

4642
if not isinstance(target, str):
47-
logger.raise_fatal(BaseException(f'Target must be a string not {type(target)}. '
48-
f'Got target: {target}'))
43+
logger.raise_fatal(
44+
BaseException(
45+
f"Target must be a string not {type(target)}. "
46+
f"Got target: {target}"
47+
)
48+
)
4949

5050
target = target.lower()
51-
if not (target.startswith('http://') or target.startswith('https://')):
52-
target = 'http://' + target
51+
if not (target.startswith("http://") or target.startswith("https://")):
52+
target = "http://" + target
5353

54-
logger.info(f'Testing ClickJacking for {target}')
54+
logger.info(f"Testing ClickJacking for {target}")
5555

5656
try:
5757
headers = HttpHeadersGrabber.http_headers_grabber(target)
5858

59-
if 'X-Frame-Options' in headers.keys():
60-
logger.debug('ClickJacking Header is present')
61-
logger.debug('You can\'t clickjack this domain')
59+
if "X-Frame-Options" in headers.keys():
60+
logger.debug("ClickJacking Header is present")
61+
logger.debug("You can't clickjack this domain")
6262
return False
63-
logger.debug('ClickJacking Header is missing')
64-
logger.debug('This domain is vulnerable to ClickJacking')
63+
logger.debug("ClickJacking Header is missing")
64+
logger.debug("This domain is vulnerable to ClickJacking")
6565
return True
6666
except Exception as ex:
67-
logger.raise_fatal(BaseException(f'Error occurred: {ex}'))
67+
logger.raise_fatal(BaseException(f"Error occurred: {ex}"))

src/dns_lookup/dns_lookup.py

+15-16
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,16 @@
77
▒▐█░░░▐█─░▐█░▒▀▄▀░░▐█▄▄▒██▄▄█░▐█▄█▀░▐█─░▐█░▒▄█▄░
88
"""
99

10-
11-
import sys
1210
import logging
11+
import sys
12+
1313
import dns.resolver
1414

15-
sys.path.insert(
16-
0,
17-
'src'
18-
)
15+
sys.path.insert(0, "src")
1916

2017
from logger.logger import Logger
2118

22-
23-
logger = Logger('DnsLookup')
19+
logger = Logger("DnsLookup")
2420

2521

2622
class DnsLookup:
@@ -35,8 +31,7 @@ class DnsLookup:
3531
"""
3632

3733
@staticmethod
38-
def dns_lookup(target: str, record_type: str = 'A',
39-
debug: bool = False) -> list:
34+
def dns_lookup(target: str, record_type: str = "A", debug: bool = False) -> list:
4035
"""
4136
Looks for dns lookup information for IP or Domain.
4237
@@ -53,16 +48,20 @@ def dns_lookup(target: str, record_type: str = 'A',
5348
logger.setLevel(logging.DEBUG)
5449

5550
if not isinstance(target, str):
56-
logger.raise_fatal(BaseException(f'Target must be a string not {type(target)}. '
57-
f'Got target: {target}'))
51+
logger.raise_fatal(
52+
BaseException(
53+
f"Target must be a string not {type(target)}. "
54+
f"Got target: {target}"
55+
)
56+
)
5857

5958
ipvs = []
60-
logger.info(f'DNS Lookup: {target.lower()}')
61-
logger.info(f'Records to find out: {record_type}')
59+
logger.info(f"DNS Lookup: {target.lower()}")
60+
logger.info(f"Records to find out: {record_type}")
6261
try:
6362
for ipval in dns.resolver.resolve(target.lower(), record_type):
6463
ipvs.append(ipval.to_text())
65-
logger.debug(record_type + ' : ' + ipval.to_text())
64+
logger.debug(record_type + " : " + ipval.to_text())
6665
return ipvs
6766
except Exception as ex:
68-
logger.raise_fatal(BaseException(f'Error occurred: {ex}'))
67+
logger.raise_fatal(BaseException(f"Error occurred: {ex}"))

src/exec_shell_command/exec_shell_command.py

+5-9
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,15 @@
77
▒▐█░░░▐█─░▐█░▒▀▄▀░░▐█▄▄▒██▄▄█░▐█▄█▀░▐█─░▐█░▒▄█▄░
88
"""
99

10-
import sys
1110
import logging
12-
from subprocess import Popen, PIPE
11+
import sys
12+
from subprocess import PIPE, Popen
1313

14-
sys.path.insert(
15-
0,
16-
'src'
17-
)
14+
sys.path.insert(0, "src")
1815

1916
from logger.logger import Logger
2017

21-
22-
logger = Logger('exec_commands')
18+
logger = Logger("exec_commands")
2319

2420

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

41-
logger.info(f'Executing command: `{command}`')
37+
logger.info(f"Executing command: `{command}`")
4238
with Popen(command, shell=True, stdout=PIPE, stderr=PIPE) as proc:
4339
status = proc.wait()
4440
output = proc.stdout.read().decode(sys.stdout.encoding)

src/http_headers_grabber/http_headers_grabber.py

+15-14
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,16 @@
77
▒▐█░░░▐█─░▐█░▒▀▄▀░░▐█▄▄▒██▄▄█░▐█▄█▀░▐█─░▐█░▒▄█▄░
88
"""
99

10-
import sys
1110
import logging
11+
import sys
12+
1213
import requests
1314

14-
sys.path.insert(
15-
0,
16-
'src'
17-
)
15+
sys.path.insert(0, "src")
1816

1917
from logger.logger import Logger
2018

21-
22-
logger = Logger('HttpGrabber')
19+
logger = Logger("HttpGrabber")
2320

2421

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

4643
if not isinstance(target, str):
47-
logger.raise_fatal(BaseException(f'Target must be a string not {type(target)}. '
48-
f'Got target: {target}'))
44+
logger.raise_fatal(
45+
BaseException(
46+
f"Target must be a string not {type(target)}. "
47+
f"Got target: {target}"
48+
)
49+
)
4950

5051
try:
51-
if not (target.startswith('http://') or target.startswith('https://')):
52-
target = 'http://' + target
52+
if not (target.startswith("http://") or target.startswith("https://")):
53+
target = "http://" + target
5354
response = requests.get(target.lower())
54-
logger.info(f'Got {target} request: {response.status_code}')
55-
logger.debug(f'Headers:\n {response.headers}')
55+
logger.info(f"Got {target} request: {response.status_code}")
56+
logger.debug(f"Headers:\n {response.headers}")
5657
return response.headers
5758
except Exception as ex:
58-
logger.raise_fatal(BaseException(f'Error occurred: {ex}'))
59+
logger.raise_fatal(BaseException(f"Error occurred: {ex}"))

src/ip/ip.py

+11-16
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,17 @@
77
▒▐█░░░▐█─░▐█░▒▀▄▀░░▐█▄▄▒██▄▄█░▐█▄█▀░▐█─░▐█░▒▄█▄░
88
"""
99

10-
import sys
11-
import socket
1210
import logging
1311
import re as r
12+
import socket
13+
import sys
1414
from urllib.request import urlopen
1515

16-
sys.path.insert(
17-
0,
18-
'src'
19-
)
16+
sys.path.insert(0, "src")
2017

2118
from logger.logger import Logger
2219

23-
24-
logger = Logger('GetHostname')
20+
logger = Logger("GetHostname")
2521

2622

2723
class GetHostname:
@@ -37,9 +33,9 @@ def get_hostname(self) -> str:
3733
* Hostname
3834
"""
3935

40-
logger.info('Getting hostname')
36+
logger.info("Getting hostname")
4137
hostname = socket.gethostname()
42-
logger.debug(f'Hostname: {hostname}')
38+
logger.debug(f"Hostname: {hostname}")
4339
return hostname
4440

4541
def get_ip(self) -> str:
@@ -50,11 +46,10 @@ def get_ip(self) -> str:
5046
* Local IP
5147
"""
5248

53-
logger.info('Getting IP')
54-
request = str(urlopen('http://checkip.dyndns.com/').read())
55-
local_ip = r.compile(r'Address: (\d+\.\d+\.\d+\.\d+)').search(
56-
request).group(1)
57-
logger.debug(f'IP: {local_ip}')
49+
logger.info("Getting IP")
50+
request = str(urlopen("http://checkip.dyndns.com/").read())
51+
local_ip = r.compile(r"Address: (\d+\.\d+\.\d+\.\d+)").search(request).group(1)
52+
logger.debug(f"IP: {local_ip}")
5853
return local_ip
5954

6055
@staticmethod
@@ -76,4 +71,4 @@ def get_hostname_ip(debug: bool = False) -> tuple:
7671
hostname_ip = GetHostname()
7772
return hostname_ip.get_hostname(), hostname_ip.get_ip()
7873
except Exception as ex:
79-
logger.raise_fatal(BaseException(f'Error occurred: {ex}'))
74+
logger.raise_fatal(BaseException(f"Error occurred: {ex}"))

0 commit comments

Comments
 (0)