Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

List index out of range with ra0 #42

Open
jargij opened this issue Jul 1, 2014 · 9 comments
Open

List index out of range with ra0 #42

jargij opened this issue Jul 1, 2014 · 9 comments

Comments

@jargij
Copy link

jargij commented Jul 1, 2014

I'm using RAlink device, Right now i'm at school with a lot of wifi spots with 802.1x authentication.

And i'm getting these results after a scan.
wifi -i ra0 scan

Traceback (most recent call last):
  File "/usr/local/bin/wifi", line 5, in <module>
    pkg_resources.run_script('wifi==1.0.0', 'wifi')
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/local/lib/python2.7/dist-packages/wifi-1.0.0-py2.7.egg/EGG-INFO/scripts/wifi", line 202, in <module>
    args.func(args)
  File "/usr/local/lib/python2.7/dist-packages/wifi-1.0.0-py2.7.egg/EGG-INFO/scripts/wifi", line 51, in scan_command
    print_table([[cell.signal, cell.ssid, 'protected' if cell.encrypted else 'unprotected'] for cell in Cell.all(args.interface)])
  File "/usr/local/lib/python2.7/dist-packages/wifi-1.0.0-py2.7.egg/wifi/scan.py", line 34, in all
    cells = map(Cell.from_string, cells_re.split(iwlist_scan)[1:])
  File "/usr/local/lib/python2.7/dist-packages/wifi-1.0.0-py2.7.egg/wifi/scan.py", line 44, in from_string
    return normalize(cell_string)
  File "/usr/local/lib/python2.7/dist-packages/wifi-1.0.0-py2.7.egg/wifi/scan.py", line 116, in normalize
    while lines[0].startswith(' ' * 10):
IndexError: list index out of range

Results of a iwlist ra0 scan

ra0       Scan completed :
          Cell 01 - Address: 50:06:04:C3:4D:90
                    Protocol:11g/n BW20
                    ESSID:""
                    Mode:Managed
                    Frequency:2.412 GHz (Channel 1)
                    Quality=94/100  Signal level=-53 dBm  Noise level=-92 dBm
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : 802.1x
          Cell 02 - Address: 50:06:04:C3:4D:92
                    Protocol:11g/n BW20
                    ESSID:"eduroam"
                    Mode:Managed
                    Frequency:2.412 GHz (Channel 1)
                    Quality=94/100  Signal level=-53 dBm  Noise level=-92 dBm
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : 802.1x
          Cell 03 - Address: 50:06:04:C3:4D:91
                    Protocol:11g/n BW20
                    ESSID:""
                    Mode:Managed
                    Frequency:2.412 GHz (Channel 1)
                    Quality=89/100  Signal level=-55 dBm  Noise level=-92 dBm
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : 802.1x
          Cell 04 - Address: 50:06:04:C3:4D:93
                    Protocol:11g/n BW20
                    ESSID:""
                    Mode:Managed
                    Frequency:2.412 GHz (Channel 1)
                    Quality=94/100  Signal level=-53 dBm  Noise level=-92 dBm
                    Encryption key:off
                    Bit Rates:144 Mb/s
          Cell 05 - Address: 50:06:04:BB:BD:D2
                    Protocol:11g/n BW20
                    ESSID:"eduroam"
                    Mode:Managed
                    Frequency:2.437 GHz (Channel 6)
                    Quality=42/100  Signal level=-73 dBm  Noise level=-78 dBm
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : 802.1x
          Cell 06 - Address: 50:06:04:BB:BD:D0
                    Protocol:11g/n BW20
                    ESSID:""
                    Mode:Managed
                    Frequency:2.437 GHz (Channel 6)
                    Quality=52/100  Signal level=-69 dBm  Noise level=-92 dBm
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : 802.1x
          Cell 07 - Address: 50:06:04:C3:40:F3
                    Protocol:11g/n BW20
                    ESSID:""
                    Mode:Managed
                    Frequency:2.462 GHz (Channel 11)
                    Quality=47/100  Signal level=-71 dBm  Noise level=-75 dBm
                    Encryption key:off
                    Bit Rates:144 Mb/s
          Cell 08 - Address: 50:06:04:C3:40:F2
                    Protocol:11g/n BW20
                    ESSID:"eduroam"
                    Mode:Managed
                    Frequency:2.462 GHz (Channel 11)
                    Quality=47/100  Signal level=-71 dBm  Noise level=-76 dBm
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : 802.1x
          Cell 09 - Address: 50:06:04:BB:BD:D3
                    Protocol:11g/n BW20
                    ESSID:""
                    Mode:Managed
                    Frequency:2.437 GHz (Channel 6)
                    Quality=42/100  Signal level=-73 dBm  Noise level=-80 dBm
                    Encryption key:off
                    Bit Rates:144 Mb/s
          Cell 10 - Address: 50:06:04:BB:BD:D1
                    Protocol:11g/n BW20
                    ESSID:""
                    Mode:Managed
                    Frequency:2.437 GHz (Channel 6)
                    Quality=42/100  Signal level=-73 dBm  Noise level=-78 dBm
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : 802.1x
          Cell 11 - Address: 50:06:04:C3:40:F0
                    Protocol:11g/n BW20
                    ESSID:""
                    Mode:Managed
                    Frequency:2.462 GHz (Channel 11)
                    Quality=47/100  Signal level=-71 dBm  Noise level=-76 dBm
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : 802.1x
          Cell 12 - Address: 50:06:04:C3:40:F1
                    Protocol:11g/n BW20
                    ESSID:""
                    Mode:Managed
                    Frequency:2.462 GHz (Channel 11)
                    Quality=42/100  Signal level=-73 dBm  Noise level=-77 dBm
                    Encryption key:on
                    Bit Rates:144 Mb/s
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : 802.1x
@rockymeza
Copy link
Owner

Hey! Thanks for the bug report. I'm in the middle of finals, but I think I
could take a look at this after my tests.

-rocky
2014年7月1日 下午8:10于 "Jacek Smit" notifications@github.com写道:

I'm using RAlink device, Right now i'm at school with a lot of wifi spots
with 802.1x authentication.

And i'm getting these results after a scan.
wifi -i ra0 scan

Traceback (most recent call last):
File "/usr/local/bin/wifi", line 5, in
pkg_resources.run_script('wifi==1.0.0', 'wifi')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/wifi-1.0.0-py2.7.egg/EGG-INFO/scripts/wifi", line 202, in
args.func(args)
File "/usr/local/lib/python2.7/dist-packages/wifi-1.0.0-py2.7.egg/EGG-INFO/scripts/wifi", line 51, in scan_command
print_table([[cell.signal, cell.ssid, 'protected' if cell.encrypted else 'unprotected'] for cell in Cell.all(args.interface)])
File "/usr/local/lib/python2.7/dist-packages/wifi-1.0.0-py2.7.egg/wifi/scan.py", line 34, in all
cells = map(Cell.from_string, cells_re.split(iwlist_scan)[1:])
File "/usr/local/lib/python2.7/dist-packages/wifi-1.0.0-py2.7.egg/wifi/scan.py", line 44, in from_string
return normalize(cell_string)
File "/usr/local/lib/python2.7/dist-packages/wifi-1.0.0-py2.7.egg/wifi/scan.py", line 116, in normalize
while lines[0].startswith(' ' * 10):
IndexError: list index out of range

Results of a iwlist ra0 scan

ra0 Scan completed :
Cell 01 - Address: 50:06:04:C3:4D:90
Protocol:11g/n BW20
ESSID:""
Mode:Managed
Frequency:2.412 GHz (Channel 1)
Quality=94/100 Signal level=-53 dBm Noise level=-92 dBm
Encryption key:on
Bit Rates:144 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : 802.1x
Cell 02 - Address: 50:06:04:C3:4D:92
Protocol:11g/n BW20
ESSID:"eduroam"
Mode:Managed
Frequency:2.412 GHz (Channel 1)
Quality=94/100 Signal level=-53 dBm Noise level=-92 dBm
Encryption key:on
Bit Rates:144 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : 802.1x
Cell 03 - Address: 50:06:04:C3:4D:91
Protocol:11g/n BW20
ESSID:""
Mode:Managed
Frequency:2.412 GHz (Channel 1)
Quality=89/100 Signal level=-55 dBm Noise level=-92 dBm
Encryption key:on
Bit Rates:144 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : 802.1x
Cell 04 - Address: 50:06:04:C3:4D:93
Protocol:11g/n BW20
ESSID:""
Mode:Managed
Frequency:2.412 GHz (Channel 1)
Quality=94/100 Signal level=-53 dBm Noise level=-92 dBm
Encryption key:off
Bit Rates:144 Mb/s
Cell 05 - Address: 50:06:04:BB:BD:D2
Protocol:11g/n BW20
ESSID:"eduroam"
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality=42/100 Signal level=-73 dBm Noise level=-78 dBm
Encryption key:on
Bit Rates:144 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : 802.1x
Cell 06 - Address: 50:06:04:BB:BD:D0
Protocol:11g/n BW20
ESSID:""
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality=52/100 Signal level=-69 dBm Noise level=-92 dBm
Encryption key:on
Bit Rates:144 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : 802.1x
Cell 07 - Address: 50:06:04:C3:40:F3
Protocol:11g/n BW20
ESSID:""
Mode:Managed
Frequency:2.462 GHz (Channel 11)
Quality=47/100 Signal level=-71 dBm Noise level=-75 dBm
Encryption key:off
Bit Rates:144 Mb/s
Cell 08 - Address: 50:06:04:C3:40:F2
Protocol:11g/n BW20
ESSID:"eduroam"
Mode:Managed
Frequency:2.462 GHz (Channel 11)
Quality=47/100 Signal level=-71 dBm Noise level=-76 dBm
Encryption key:on
Bit Rates:144 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : 802.1x
Cell 09 - Address: 50:06:04:BB:BD:D3
Protocol:11g/n BW20
ESSID:""
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality=42/100 Signal level=-73 dBm Noise level=-80 dBm
Encryption key:off
Bit Rates:144 Mb/s
Cell 10 - Address: 50:06:04:BB:BD:D1
Protocol:11g/n BW20
ESSID:""
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality=42/100 Signal level=-73 dBm Noise level=-78 dBm
Encryption key:on
Bit Rates:144 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : 802.1x
Cell 11 - Address: 50:06:04:C3:40:F0
Protocol:11g/n BW20
ESSID:""
Mode:Managed
Frequency:2.462 GHz (Channel 11)
Quality=47/100 Signal level=-71 dBm Noise level=-76 dBm
Encryption key:on
Bit Rates:144 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : 802.1x
Cell 12 - Address: 50:06:04:C3:40:F1
Protocol:11g/n BW20
ESSID:""
Mode:Managed
Frequency:2.462 GHz (Channel 11)
Quality=42/100 Signal level=-73 dBm Noise level=-77 dBm
Encryption key:on
Bit Rates:144 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : 802.1x


Reply to this email directly or view it on GitHub
#42.

@rockymeza
Copy link
Owner

Hi @jargij,

I have finally had some free time to work on this. I fixed the bug in 22c10be and have released a new version of wifi (https://pypi.python.org/pypi/wifi/0.3.2).

I'm really sorry that it took so long to get to. I have been travelling lately and just haven't had the time to get around to it. I hope it's not too late.

@rockymeza
Copy link
Owner

I'm going to go ahead and close this bug out. Please reopen it if you run into any more problems.

@zgoda
Copy link

zgoda commented Mar 10, 2016

I'm still getting this error.

@rockymeza rockymeza reopened this Mar 10, 2016
@rockymeza
Copy link
Owner

Hi, can you try wifi 0.3.7? Thanks

@zgoda-mobica
Copy link
Contributor

No change. Offending iwlist output:

wlan0     Scan completed :
          Cell 01 - Address: 8C:04:FF:B9:9F:70
                    ESSID:"vnet-6628E6"
                    Mode:Managed
                    Frequency:2.412 GHz (Channel 1)
                    Quality:5/5  Signal level:2/56  Noise level:164/56
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                              24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s
                              12 Mb/s; 48 Mb/s
          Cell 02 - Address: F8:D1:11:64:EF:04
                    ESSID:"mefisto"
                    Mode:Managed
                    Frequency:2.422 GHz (Channel 3)
                    Quality:5/5  Signal level:-38 dBm  Noise level:-92 dBm
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    IE: Unknown: DD990050F204104A0001101044000101103B0001031047001000000000000010000000F8D11164EF101021000754502D4C494E4B10230009544C2D57523734304E10240003342E3010420003312E301054000800060050F204000110110019576972656C65737320526F7574657220544C2D57523734304E100800020086103C000101104900140024E26002000101600000020001600100020001
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s
          Cell 03 - Address: 74:85:2A:00:A6:35
                    ESSID:"vnet-0C8196"
                    Mode:Managed
                    Frequency:2.422 GHz (Channel 3)
                    Quality:2/5  Signal level:-74 dBm  Noise level:-92 dBm
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    IE: Unknown: DD790050F204104A0001101044000102103B00010310470010D96C7EFC2F8938F1EFBD6E5148BFA81210210005436973636F10230005436973636F1024000631323334353610420007303030303030311054000800060050F204000110110006306338313936100800022008103C0001011049000600372A000120
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                              24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s
                              12 Mb/s; 48 Mb/s
          Cell 04 - Address: D0:03:4B:D8:7F:B6
                    ESSID:"citan"
                    Mode:Managed
                    Frequency:2.462 GHz (Channel 11)
                    Quality:5/5  Signal level:-12 dBm  Noise level:-92 dBm
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                              24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s
                              12 Mb/s; 48 Mb/s
          Cell 05 - Address: B0:48:7A:B5:C5:5C
                    ESSID:"Gargoyle"
                    Mode:Managed
                    Frequency:2.442 GHz (Channel 7)
                    Quality:3/5  Signal level:-69 dBm  Noise level:-92 dBm
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s
          Cell 06 - Address: 00:12:17:D5:17:5F
                    ESSID:"327918.A2"
                    Mode:Managed
                    Frequency:2.484 GHz (Channel 14)
                    Quality:3/5  Signal level:-69 dBm  Noise level:-92 dBm
                    IE: WPA Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                              24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s
                              12 Mb/s; 48 Mb/s

@zgoda-mobica
Copy link
Contributor

wifi version 0.3.8, traceback:

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-8-cdc4f547803e> in <module>()
----> 1 cells = map(Cell.from_string, cells_re.split(s)[1:])

/home/jazg/v/coup/lib/python2.7/site-packages/wifi/scan.pyc in from_string(cls, cell_string)
     52         object for it.
     53         """
---> 54         return normalize(cell_string)
     55 
     56     @classmethod

/home/jazg/v/coup/lib/python2.7/site-packages/wifi/scan.pyc in normalize(cell_block)
    135             # different lines, sometimes...
    136             if lines:
--> 137                 while lines[0].startswith(' ' * 10):
    138                     values += lines.pop(0).strip().split('; ')
    139 

IndexError: list index out of range

@rockymeza
Copy link
Owner

Are you manually feeding the output of iwlist scan into the parser?

Does this happen from the CLI?

@zgoda
Copy link

zgoda commented Mar 14, 2016

Yes, this time it was from manual feeding to get traceback output when I got IndexError from the application that uses wifi as library.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants