namnamir / domainia

Domainia helps to find subdomains, DNS records, IP addresses, SSL Certificates, HTTP info, etc. of domain by doing the passive reconnaissance.
https://irsec.eu
MIT License
10 stars 1 forks source link

Fix the issue of the empty HTTP Header key #51

Open namnamir opened 9 months ago

namnamir commented 9 months ago

In both of these conditions, the http_header is empty:

 [+]──┬── http://xxxxxxxxxxxxxxxx  (8/342 - 2%)  [2023-11-19 10:18:56]
      │
      ├─── General Info 
      │        └□ General Site Status function is calling
      │        ├─1─■ Could not parse the HTML page.
      │        ├─2─■ HTTP Status Code: 403
      │        ├─3─■ History: []
      │        ├─4─■ HTTP Headers: {'Date': 'Sun, 19 Nov 2023 09:19:00 GMT', 'Server': 'Apache', 'X-Content-Type-Options': 'nosniff', 'X-Frame-Options': 'sameorigin', 'X-XSS-Protection': '1; mode=block', 'Referrer-Policy': 'same-origin', 'Content-Length': '199', 'Keep-Alive': 'timeout=5, max=100', 'Connection': 'Keep-Alive', 'Content-Type': 'text/html; charset=iso-8859-1'}
      │        ├─5─■ Request Result: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access this resource.</p>
</body></html>

OR

 [+]──┬── http://xxxxxxxxxxxxxxxx   (128/342 - 37%)  [2023-11-19 10:18:56]
      │
      ├─── General Info 
      │        └□ General Site Status function is calling
      │        ├─1─■ Error in establishing the connection to the General Site Status function URL.
      │        ├─3─■ Status Code: 0  -  API call URL: http://xxxxxxxxxxxxxxxx
      │        ├─5─■ Exception Message: <class 'requests.exceptions.ConnectTimeout'> ➜ url_opener.py:57 ==   File "\url_opener.py", line 57, in url_opener
    request = requests.get(
  File "\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\adapters.py", line 553, in send
    raise ConnectTimeout(e, request=request)
 ⚊ HTTPConnectionPool(host='www.hendrik-ido-ambacht.nl', port=80): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x000001AE9CB38550>, 'Connection toxxxxxxxxxxxxxxxx timed out. (connect timeout=11)'))

Output:

{'city': 'xxxxxxxxxxxxxxxx',
  'state': '',
  'country': 'NL',
  'scan_date': '2023-11-19 10:18:56',
  'urn': 'http://xxxxxxxxxxxxxxxx',
  'hostname': None,
  'http': {
    'meta': {},
    'http_headers': [
      {'name': 'NON_EXITSTING_CSP', 'value': ''}
    ],
     'redirects': [],
     'analytics': {},
     'csp_nonces': [],
     'csp_hashes': []
  },
  'elapsed_time': '0:00:11.110998'
},