securewebsite / wifite

Automatically exported from code.google.com/p/wifite
GNU General Public License v2.0
0 stars 0 forks source link

IndexError: list index out of range #128

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Do you have any idea what may have caused this bug?  Guesses are helpful!
It does not happen every time, but I think when I select manually from the list 
of targets ( 1,2,3,6,etc.. all valid targets numbers) sooner or later it 
happens, but never sow it if I use -all, not 100% sure thou...
Also bug is some how related to switching form WPS PIN to WPA handshake capture 
duo timeout, then sometimes it crashes... 

What operating system are you running? Backtrack 5 R2? 32 or 64 bit?
Blackbuntu?
Kali 1.0.4 x64 up-to date + AWUS036NH under VMWare Fusion Pro 5.x 

What version of the wifite are you using?
WiFite v2 (r85)

Please provide any additional information below.  A paste of the error is
very helpful!
[0:00:00] initializing WPS PIN attack on SSID_NAME (38:83:45:xx:xx:xx)
 [3:17:39] WPS attack, 1952/2104 success/ttl, 18.95% complete (5 sec/att)   
 [!] unable to complete successful try in 660 seconds
 [+] skipping SSID_NAME
 [0:08:20] starting wpa handshake capture on "SSID_NAME"
Traceback (most recent call last):...                     
  File "/usr/bin/wifite", line 2966, in <module>
    main()
  File "/usr/bin/wifite", line 323, in main
    if wpa_get_handshake(iface, t, ts_clients):
  File "/usr/bin/wifite", line 1883, in wpa_get_handshake
    if has_handshake(target, temp + 'wpa-01.cap.temp'):
  File "/usr/bin/wifite", line 2104, in has_handshake
    valid_handshake = has_handshake_tshark(target, capfile)
  File "/usr/bin/wifite", line 2006, in has_handshake_tshark
    msg = fields[9][0]      # The message number (1, 2, 3, or 4)
IndexError: list index out of range

Original issue reported on code.google.com by fsh3...@gmail.com on 13 Aug 2013 at 12:07

GoogleCodeExporter commented 9 years ago
I can confirm only happens when do wpa handshake capture
 [0:08:20] starting wpa handshake capture on "WIFI"
 [0:08:15] new client found: 00:87:31:XX:XX:XX                         
Traceback (most recent call last):87:31:XX:XX:XX...  sent 
  File "/usr/bin/wifite", line 2966, in <module>
    main()
  File "/usr/bin/wifite", line 323, in main
    if wpa_get_handshake(iface, t, ts_clients):
  File "/usr/bin/wifite", line 1883, in wpa_get_handshake
    if has_handshake(target, temp + 'wpa-01.cap.temp'):
  File "/usr/bin/wifite", line 2104, in has_handshake
    valid_handshake = has_handshake_tshark(target, capfile)
  File "/usr/bin/wifite", line 2006, in has_handshake_tshark
    msg = fields[9][0]      # The message number (1, 2, 3, or 4)
IndexError: list index out of range

Original comment by fsh3...@gmail.com on 13 Aug 2013 at 1:45

GoogleCodeExporter commented 9 years ago
Okay another update the second comment it's not quite true, it also happens 
using -all. The only thing in common is it does it when try to switch form WPS 
PIN attack to "starting wpa handshake capture". It does it right away after 
switching to "wpa handshake capture" : And the trace is always the same lines 
of code.. 

[0:08:20] starting wpa handshake capture on "SSID3"
Traceback (most recent call last):...                     
  File "/usr/bin/wifite", line 2966, in <module>
    main()
  File "/usr/bin/wifite", line 323, in main
    if wpa_get_handshake(iface, t, ts_clients):
  File "/usr/bin/wifite", line 1883, in wpa_get_handshake
    if has_handshake(target, temp + 'wpa-01.cap.temp'):
  File "/usr/bin/wifite", line 2104, in has_handshake
    valid_handshake = has_handshake_tshark(target, capfile)
  File "/usr/bin/wifite", line 2006, in has_handshake_tshark
    msg = fields[9][0]      # The message number (1, 2, 3, or 4)
IndexError: list index out of range

Original comment by fsh3...@gmail.com on 15 Aug 2013 at 7:52

GoogleCodeExporter commented 9 years ago
On Kali x86 1.0.7
using wifite V2 r85 with default options.

Got this error:

[0:08:20] starting wpa handshake capture on "******"
[0:08:15] new client found: 00:25:22:4C:A0:CF                         
Traceback (most recent call last):...                     
  File "/usr/bin/wifite", line 2966, in <module>
    main()
  File "/usr/bin/wifite", line 323, in main
    if wpa_get_handshake(iface, t, ts_clients):
  File "/usr/bin/wifite", line 1883, in wpa_get_handshake
    if has_handshake(target, temp + 'wpa-01.cap.temp'):
  File "/usr/bin/wifite", line 2104, in has_handshake
    valid_handshake = has_handshake_tshark(target, capfile)
  File "/usr/bin/wifite", line 2006, in has_handshake_tshark
    msg = fields[9][0]      # The message number (1, 2, 3, or 4)
IndexError: list index out of range

Original comment by DN.Produ...@gmail.com on 27 Jun 2014 at 5:20

GoogleCodeExporter commented 9 years ago
I also get this error. This happens when I select a WPA2 target and it finds a 
WPA Handshake during "wpa handshake capture".

Original comment by CPress.S...@gmail.com on 1 Jul 2014 at 10:33

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I found a potential cause of this error.

I noticed that when I set my home wifi to "WPA/WPA2 Enterprise", I get this 
exact same error (that's how I found this page). However, I set it back to 
"WPA2-PSK [AES]" and the capture went just fine.

I'm not 100% positive that's the only thing going on here, I'd like some more 
people to test it and report back if you see the same thing.

I have a theory that the error is caused by Wifite attempting to deauth devices 
on the network in order to get a handshake, but... not getting back what it 
expects due to stronger standards?

Something else that's curious. Enabling WPA Enterprise should disable WPS (in 
fact, I get the following message "WPA/WPA2 Enterprise cannot work with WPS. 
WPS is going to become inaccessible. Do you want to continue?"). However, 
Wifite still reports WPS enabled and attempts the PIN attack first.

Original comment by BeanBagK...@gmail.com on 31 Oct 2014 at 1:14

GoogleCodeExporter commented 9 years ago
Has anyone fixed this yet?

Original comment by WilliamS...@gmail.com on 12 Jan 2015 at 4:59

GoogleCodeExporter commented 9 years ago
Hello,
near row 2007 I found this: 
msg = fields[-1][0]
I suspect the -1 is causing the error, can anyone confirm and suggest how to 
fix?
Thanks!

Original comment by fabripc on 25 Jan 2015 at 9:37

GoogleCodeExporter commented 9 years ago
The trouble is in the line:

msg = fields[9][0]      # The message number (1, 2, 3, or 4)

because there are some packets that are of 9 elements (range 0,8), so that 
instruction goes out of range: I have modified the code and now it works.

                                if len(fields) < 10:
                    msg = fields[8][0]
                else:
                    msg = fields[9][0]      # The message number (1, 2, 3, or 4)

Original comment by ngl...@gmail.com on 26 Feb 2015 at 11:34

GoogleCodeExporter commented 9 years ago
In alternative you can discard wrong packets:

if len(fields) < 10: continue

Original comment by ngl...@gmail.com on 26 Feb 2015 at 2:39