Skip to content

Commit fe89313

Browse files
committed
refactor(direct): improve IP resolution handling in task method
1 parent ac422f8 commit fe89313

File tree

1 file changed

+5
-5
lines changed
  • bugscanx/modules/scanners_pro/scanners

1 file changed

+5
-5
lines changed

bugscanx/modules/scanners_pro/scanners/direct.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ def task(self, payload):
9898
host = payload['host']
9999
port = payload['port']
100100

101+
try:
102+
ip = socket.gethostbyname(host)
103+
except socket.gaierror:
104+
return
105+
101106
response = self.request(method, self.get_url(host, port), verify=False, allow_redirects=False)
102107

103108
if response is None:
@@ -111,11 +116,6 @@ def task(self, payload):
111116
if location and location in EXCLUDE_LOCATIONS:
112117
return
113118

114-
try:
115-
ip = socket.gethostbyname(host)
116-
except socket.gaierror:
117-
ip = 'N/A'
118-
119119
data = {
120120
'method': method,
121121
'host': host,

0 commit comments

Comments
 (0)