vanhoefm / krackattacks-scripts

Other
3.3k stars 768 forks source link

./krack-ft-test.py Problem #34

Closed satrancali closed 3 years ago

satrancali commented 6 years ago

What I must ? Traceback (most recent call last): File "./krack-ft-test.py", line 11, in from libwifi import * File "/root/Masaüstü/krackattacks-scripts/krackattack/libwifi.py", line 6, in from Cryptodome.Cipher import AES File "/usr/lib/python2.7/dist-packages/Cryptodome/Cipher/init.py", line 3, in from Cryptodome.Cipher._mode_ecb import _create_ecb_cipher File "/usr/lib/python2.7/dist-packages/Cryptodome/Cipher/_mode_ecb.py", line 29, in from Cryptodome.Util._raw_api import (load_pycryptodome_raw_lib, File "/usr/lib/python2.7/dist-packages/Cryptodome/Util/_raw_api.py", line 106, in Array = ffi.new("uint8_t[1]").class.bases File "/usr/local/lib/python2.7/dist-packages/cffi/api.py", line 249, in new cdecl = self._typeof(cdecl) File "/usr/local/lib/python2.7/dist-packages/cffi/api.py", line 169, in _typeof result = self._typeof_locked(cdecl) File "/usr/local/lib/python2.7/dist-packages/cffi/api.py", line 154, in _typeof_locked type = self._parser.parse_type(cdecl) File "/usr/local/lib/python2.7/dist-packages/cffi/cparser.py", line 461, in parse_type return self.parse_type_and_quals(cdecl)[0] File "/usr/local/lib/python2.7/dist-packages/cffi/cparser.py", line 464, in parse_type_and_quals ast, macros = self._parse('void __dummy(\n%s\n);' % cdecl)[:2] File "/usr/local/lib/python2.7/dist-packages/cffi/cparser.py", line 271, in _parse self.convert_pycparser_error(e, csource) File "/usr/local/lib/python2.7/dist-packages/cffi/cparser.py", line 300, in convert_pycparser_error raise CDefError(msg) cffi.error.CDefError: cannot parse "typedef int uint8_t;" :1:13: before: uint8_t

DaniLuMa commented 6 years ago

Hi Satrancali:

In order to help you, we need to know what did you do. In what step did you have this error? Read the next simple and small guide:

Hi: This is a small guide to test your client wifi. I bought TL-WN722N v1 device but I will test it with anothers... I used Kali 2017.1. 1.- Install kali. 2.- Execute: $ apt-get update $ apt-get install libnl-3-dev libnl-genl-3-dev pkg-config libssl-dev net-tools git sysfsutils python-scapy python-pycryptodome 3.- Clone krack-attack scripts $ git clone https://github.com/vanhoefm/krackattacks-scripts.git 4.- Compile hostapd: $ cd krackattacks-scripts/krackattack --> We are in "krackattacks-scripts/krackattack" directory $ pwd /root/krackattacks-scripts/krackattack $ cd ../hostapd $ cp defconfig .config $ make -j 2 5.- Disable hardware network $ cd ../krackattack/ $ chmod 777 disable-hwcrypto.sh $ ./disable-hwcrypto.sh $ rfkill unblock wifi $ ifconfig wlan0mon down $ ifconfig wlan0 down $ nmcli networking off $ reboot 6.- Test client: $ python2 krack-test-client.py --> It will be waiting for connections to his own ESSID. It is "testnetwork" and psk is "abcdefgh". When you connect (with other device, not with this machine Kali 2017.1) the client you will see if your client has or hasnt the vulnerability in both, normal or group. Best regards Perico

satrancali commented 6 years ago

I did it , but no work.... error message: Traceback (most recent call last): File "krack-test-client.py", line 12, in from libwifi import * File "/root/krackattacks-scripts/krackattack/libwifi.py", line 6, in from Cryptodome.Cipher import AES File "/usr/lib/python2.7/dist-packages/Cryptodome/Cipher/init.py", line 3, in from Cryptodome.Cipher._mode_ecb import _create_ecb_cipher File "/usr/lib/python2.7/dist-packages/Cryptodome/Cipher/_mode_ecb.py", line 29, in from Cryptodome.Util._raw_api import (load_pycryptodome_raw_lib, File "/usr/lib/python2.7/dist-packages/Cryptodome/Util/_raw_api.py", line 106, in Array = ffi.new("uint8_t[1]").class.bases File "/usr/local/lib/python2.7/dist-packages/cffi/api.py", line 249, in new cdecl = self._typeof(cdecl) File "/usr/local/lib/python2.7/dist-packages/cffi/api.py", line 169, in _typeof result = self._typeof_locked(cdecl) File "/usr/local/lib/python2.7/dist-packages/cffi/api.py", line 154, in _typeof_locked type = self._parser.parse_type(cdecl) File "/usr/local/lib/python2.7/dist-packages/cffi/cparser.py", line 461, in parse_type return self.parse_type_and_quals(cdecl)[0] File "/usr/local/lib/python2.7/dist-packages/cffi/cparser.py", line 464, in parse_type_and_quals ast, macros = self._parse('void __dummy(\n%s\n);' % cdecl)[:2] File "/usr/local/lib/python2.7/dist-packages/cffi/cparser.py", line 271, in _parse self.convert_pycparser_error(e, csource) File "/usr/local/lib/python2.7/dist-packages/cffi/cparser.py", line 300, in convert_pycparser_error raise CDefError(msg) cffi.error.CDefError: cannot parse "typedef int uint8_t;" :1:13: before: uint8_t

vanhoefm commented 6 years ago

Have you tried using the scripts on Kali Linux? This seems to be an issue specific to your Linux distribution. Which distribution are you used? Where did you download the cryptodome package from?

DaniLuMa commented 6 years ago

Sorry Satrancali, I though that you was speaking about "krack-test-client.py" but you are talking about "krack-ft-test.py". I tested this script too but It didnt work for me a cause of I haven't any device that support FT (Fast. Transition).

By the way, I found one video about krack-test-client.py, but it is in Spanish. https://www.youtube.com/watch?v=dH9tTLx9bSM Regards Perico

satrancali commented 6 years ago

I downloaded here https://www.kali.org/downloads/ and if you want to connect with team viewer to my pc, it is okay. ( my english is bad, sorry )

harpyja commented 6 years ago

Emmmmm,it seems does not work on my kali.HELP! root@kali:~ /Documents/attack/research/krackattack# nmcli radio wifi disabled root@kali:~/Documents/attack/research/krackattack# ./krack-test-client.py --tptk-rand [15:26:55] Note: disable Wi-Fi in network manager & disable hardware encryption. Both may interfere with this script. [15:26:56] Starting hostapd ... Configuration file: /root/Documents/attack/research/krackattack/hostapd.conf Using interface wlan0 with hwaddr bc:f6:85:20:7e:75 and ssid "new_crack_ap" wlan0: interface state UNINITIALIZED->ENABLED wlan0: AP-ENABLED hostapd_ctrl/wlan0 9877 [Errno -2] Name or service not known connect exception hostapd_ctrl/wlan0 9877 [15:26:57] It seems hostapd did not start properly, please inspect its output. [15:26:57] Did you disable Wi-Fi in the network manager? Otherwise hostapd won't work.

annascaria commented 6 years ago

Hi there, I have gone through the code and I have tried a couple of times to run it, but I am been thrown back with errors. I am just a beginner and i am not sure if the way I am running the command is right or not. Please help me out here. It would be really kind of you if you can guide me through the command line execution. For a about 2 to 3 weeks or so, I have been trying to figure this out (in the following way) ./krack-ft-attack.py ./krack-ft-attack.py -i wlan0 python krack-ft-attack.py -i wlan0 And so on...

While trying one of these commands i was thrown errors on run, configure_interfaces and subprocess.check_output.

And with my little knowledge, i am trying not to use internet, but just use my access point and my pc to be connected as client and AP, plus a sniffer capabilities enabled laptop as mitm for setting up the scenario entities.

I am just a beginner, i was really excited when my professor asked me to try this out. But on trying this for about this long I started losing hope. He was the one who adviced me to try out with the source code and get help through this forum, so that I gain confidence.(P.S. this is NOT a homework or class assignment).

Hoping to hear from you soon.

annascaria commented 6 years ago

This is binitha here again, i forgot to mention- the sniffer laptop that the college provided has ubuntu in it. So i am using ubuntu instead of kali. I really hope I get help soon from here.

mohamedhany123 commented 6 years ago

Traceback (most recent call last): File "./krack-test-client.py", line 11, in from scapy.all import File "/usr/local/lib/python2.7/dist-packages/scapy/all.py", line 10, in from .config import File "/usr/local/lib/python2.7/dist-packages/scapy/config.py", line 11, in from .data import * File "/usr/local/lib/python2.7/dist-packages/scapy/data.py", line 184, in TCP_SERVICES,UDP_SERVICES=load_services("/etc/services") File "/usr/local/lib/python2.7/dist-packages/scapy/data.py", line 109, in load_services f=open(filename, errors='ignore')

r3dw0lf commented 5 years ago

I guess you guys have a missing python module called cryptodome, use pip to install it:

pip install cryptodomex

hope this one solves both of your problems: @satrancali and @annascaria

vanhoefm commented 3 years ago

Hopefully this is avoided in the new version that uses a virtual python environment with specific versions of all used python libraries.