netspionage icon indicating copy to clipboard operation
netspionage copied to clipboard

Issue when running recon on mac addresses

Open TotallyNotAHaxxer opened this issue 9 months ago • 0 comments

When running option 1 on the recon section in the tool, I got the following error when I selected a captured MAC.

SCANNING MAC ADDRESS...
Traceback (most recent call last):
  File "/home/totallynotahaxxer/netspionage/netspionage.py", line 6, in <module>
    from core import prompts
  File "/home/totallynotahaxxer/netspionage/core/__init__.py", line 1, in <module>
    from .prompts import *
  File "/home/totallynotahaxxer/netspionage/core/prompts.py", line 106, in <module>
    prompt_display()
  File "/home/totallynotahaxxer/netspionage/core/prompts.py", line 84, in prompt_display
    recon_choice(resp, target, manual_input)
  File "/home/totallynotahaxxer/netspionage/core/reconnaissance.py", line 11, in recon_choice
    choose_mac_address(target)
  File "/home/totallynotahaxxer/netspionage/core/reconnaissance.py", line 20, in choose_mac_address
    scan_addresses(target)
  File "/home/totallynotahaxxer/netspionage/core/reconnaissance.py", line 61, in scan_addresses
    display_picker(entries)
  File "/home/totallynotahaxxer/netspionage/core/reconnaissance.py", line 83, in display_picker
    address_api_call(option, element_entries[index]['ip'])
  File "/home/totallynotahaxxer/netspionage/core/reconnaissance.py", line 33, in address_api_call
    result=response.json()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 900, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3/dist-packages/simplejson/__init__.py", line 525, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I am assuming this is a decoding error from the API that is used on the backend which is called from one of the scanning functions.

def address_api_call(address, ip_address):
    print_output('\n SCANNING MAC ADDRESS...')
    url = ("https://macvendors.co/api/" + address)
    response=requests.get(url)
    result=response.json()
    if result["result"]:
        json_object=result['result']
        if "error" in json_object:
            print_output("\n No MAC Address Found!")
            return()
        transcribe_api_results(json_object, ip_address)
    else:
        print_output("\n ERROR: Something Went Wrong")

TotallyNotAHaxxer avatar Sep 15 '23 04:09 TotallyNotAHaxxer