SCCMhunter v1.0.10
I've just run into a very similar error to #43 but this errored on the line find.py:404 in add_computer_to_db.
Specifically the line:
cursor.execute('''select * from Computers where Hostname = ?''', (hostname,))
Full traceback:
/opt/sccmhunter/lib/commands/find.py:33 in main │
│ │
│ 30 │ logs_dir = init_logger(debug) │
│ 31 │ sccmhunter = SCCMHUNTER(username=username, password=password, domain=domain, target_ │
│ 32 │ │ │ │ │ │ │ kerberos=kerberos, no_pass=no_pass, hashes=hashes, aes=aes, │
│ ❱ 33 │ sccmhunter.run() │
│ 34 │
│ │
│ /opt/sccmhunter/lib/attacks/find.py:120 in run │
│ │
│ 117 │ │ │ self.search_base = get_dn(self.domain) │
│ 118 │ │ self.check_schema() #check for AD extension info │
│ 119 │ │ self.check_dps() #check for potential DPs │
│ ❱ 120 │ │ self.check_strings() #if they're using DNS only: thoughts and prayers │
│ 121 │ │ if self.all_computers: │
│ 122 │ │ │ self.check_all_computers() │
│ 123 │ │ if self.debug: │
│ │
│ /opt/sccmhunter/lib/attacks/find.py:324 in check_strings │
│ │
│ 321 │ │ │ │ │ │ │ │ │ if (result['sAMAccountType']) == 805306369: │
│ 322 │ │ │ │ │ │ │ │ │ │ hostname = str(result['dNSHostname']) │
│ 323 │ │ │ │ │ │ │ │ │ │ if hostname: │
│ ❱ 324 │ │ │ │ │ │ │ │ │ │ │ self.add_computer_to_db(result) │
│ 325 │ │ │ │ │ │ │ │ │ if (result['sAMAccountType']) == 268435456: │
│ 326 │ │ │ │ │ │ │ │ │ │ self.add_group_to_db(result) │
│ 327 │ │ │ │ except ldap3.core.exceptions.LDAPAttributeError as e: │
│ │
│ /opt/sccmhunter/lib/attacks/find.py:404 in add_computer_to_db │
│ │
│ 401 │ │ dp = '' │
│ 402 │ │ wsus = '' │
│ 403 │ │ mssql = '' │
│ ❱ 404 │ │ cursor.execute('''select * from Computers where Hostname = ?''', (hostname,)) │
│ 405 │ │ exists = cursor.fetchone() │
│ 406 │ │ if exists: │
│ 407 │ │ │ logger.debug(f"[*] Skipping already known host: {hostname}")
Looks like a computer in this environment didn't return a hostname, and this edge case isn't being checked for?
SCCMhunter v1.0.10
I've just run into a very similar error to #43 but this errored on the line
find.py:404 in add_computer_to_db.Specifically the line:
Full traceback:
Looks like a computer in this environment didn't return a hostname, and this edge case isn't being checked for?