phenotypic / WiFiCrackPy

Automated Wi-Fi cracker for macOS
MIT License
150 stars 17 forks source link

Error `TypeError: expected str, bytes or os.PathLike object, not NoneType` on selecting network to crack zizzania handshake #28

Closed 1mehdifaraji closed 3 months ago

1mehdifaraji commented 3 months ago

After selecting the network to crach, it throws the error TypeError: expected str, bytes or os.PathLike object, not NoneType.

Mac M1 Ventura 13.3.1.

Screenshot 1403-05-04 at 23 37 57

Screenshot 1403-05-04 at 23 38 06

phenotypic commented 3 months ago

For CoreWLAN-related bugs, please refer to issue #19.

If you receive the Unable to obtain authorisation, exiting... error, ensure Python has been granted Location Services permissions by going to System Settings > Privacy & Security > Location Services and checking next to Python.

1mehdifaraji commented 3 months ago

@phenotypic

I don't think it's a location permission issue, can you confirm it by the logs below?

Screenshot 1403-05-05 at 02 00 10

Screenshot 1403-05-05 at 02 01 26

Initiating zizzania to capture handshake...

Traceback (most recent call last):
  File "/Users/mehdi/Desktop/WiFiCrackPy/WiFiCrackPy.py", line 159, in <module>
    scan_networks()
  File "/Users/mehdi/Desktop/WiFiCrackPy/WiFiCrackPy.py", line 99, in scan_networks
    capture_network(networks_sorted[x]['bssid'], networks_sorted[x]['channel_object'])
  File "/Users/mehdi/Desktop/WiFiCrackPy/WiFiCrackPy.py", line 118, in capture_network
    subprocess.run(['sudo', zizzania_path, '-i', iface, '-b', bssid, '-w', 'capture.pcap', '-q'] + ['-n'] * args.d)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1754, in _execute_child
    self.pid = _posixsubprocess.fork_exec(
TypeError: expected str, bytes or os.PathLike object, not NoneType
1mehdifaraji commented 3 months ago

It turns out python version 3.9.6 won't get BSSID of the networks so I did install version 3.9.13 and for some reason it worked and now it reveals the BSSID of networks. However now I get the error FileNotFoundError: [Errno 2] No such file or directory: 'hcxpcapngtool'

Full error log

Select a network to crack: 2

Initiating zizzania to capture handshake...

sudo: /Users/mehdi/zizzania/src/zizzania: command not found
Traceback (most recent call last):
  File "/Users/mehdi/Desktop/WiFiCrackPy/WiFiCrackPy.py", line 159, in <module>
    scan_networks()
  File "/Users/mehdi/Desktop/WiFiCrackPy/WiFiCrackPy.py", line 99, in scan_networks
    capture_network(networks_sorted[x]['bssid'], networks_sorted[x]['channel_object'])
  File "/Users/mehdi/Desktop/WiFiCrackPy/WiFiCrackPy.py", line 121, in capture_network
    subprocess.run(['hcxpcapngtool', '-o', 'capture.hc22000', 'capture.pcap'], stdout=subprocess.PIPE)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'hcxpcapngtool'

Update: FIxed the issue by installing brew install hcxtools.