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

struct.error: argument for 's' must be a string #232

Closed
nubbix opened this issue Jun 3, 2017 · 7 comments
Closed

struct.error: argument for 's' must be a string #232

nubbix opened this issue Jun 3, 2017 · 7 comments
Labels

Comments

@nubbix
Copy link

nubbix commented Jun 3, 2017

Using Ubuntu latest version
wlan1 - alpha

Getting this issue

Loading GUI...
Traceback (most recent call last):
File "wifi-pumpkin.py", line 53, in
app = Initialize()
File "/usr/share/WiFi-Pumpkin/core/main.py", line 94, in init
self.form_widget = WifiPumpkin(self,self,self.FSettings)
File "/usr/share/WiFi-Pumpkin/core/main.py", line 160, in init
self.UpdateSoftware = frm_githubUpdate(version)
File "/usr/share/WiFi-Pumpkin/core/helpers/update.py", line 32, in init
super(frm_githubUpdate, self).init(parent)
File "/usr/share/WiFi-Pumpkin/core/loaders/models/PackagesUI.py", line 40, in init
self.interfaces = Refactor.get_interfaces()
File "/usr/share/WiFi-Pumpkin/core/utils.py", line 260, in get_interfaces
interfaces['IPaddress'] = Refactor.get_Ipaddr(interfaces['activated'][0])
File "/usr/share/WiFi-Pumpkin/core/utils.py", line 296, in get_Ipaddr
return get_if_addr(card)
File "/usr/lib/python2.7/dist-packages/scapy/arch/init.py", line 36, in get_if_addr
return socket.inet_ntoa(get_if_raw_addr(iff))
File "/usr/lib/python2.7/dist-packages/scapy/arch/linux.py", line 86, in get_if_raw_addr
return get_if(iff, SIOCGIFADDR)[20:24]
File "/usr/lib/python2.7/dist-packages/scapy/arch/linux.py", line 269, in get_if
ifreq = ioctl(s, cmd, struct.pack("16s16x",iff))
struct.error: argument for 's' must be a string

@ylot0
Copy link

ylot0 commented Jun 4, 2017

ubuntu 16.04LTS

struct.error: argument for 's' must be a string

@okazymyrov
Copy link

An intermediate fix... In "/usr/share/WiFi-Pumpkin/core/utils.py" (function get_Ipaddr) change the second return to:
return get_if_addr("{0}".format(card))

@mh4x0f
Copy link
Member

mh4x0f commented Jun 5, 2017

@okazymyrov thanks for suggestion.

@mh4x0f mh4x0f changed the title Issues upon start struct.error: argument for 's' must be a string Jun 6, 2017
@AcidMand04
Copy link

did u guys update the main distro ?

@eisyeisy
Copy link

eisyeisy commented Jun 6, 2017

After I rewrite the function get_Ipaddr, I become the following issue:
.................................................................................................................................
Traceback (most recent call last):
File "wifi-pumpkin.py", line 39, in
from core.loaders.checker.networkmanager import CLI_NetworkManager,UI_NetworkManager
File "/usr/share/WiFi-Pumpkin/core/loaders/checker/networkmanager.py", line 3, in
from core.utils import Refactor
File "/usr/share/WiFi-Pumpkin/core/utils.py", line 296
return get_if_addr("{0}".format(card))
^
IndentationError: unindent does not match any outer indentation level
...........................................................................................................................................

In the file it's look like this:

@staticmethod
def get_Ipaddr(card):
''' get ipadress from send arg None or interface name '''
if card == None:
return get_if_addr(Refactor.get_interfaces()['activated'][0])
return get_if_addr("{0}".format(card))

@okazymyrov
Copy link

okazymyrov commented Jun 6, 2017 via email

@eisyeisy
Copy link

eisyeisy commented Jun 6, 2017

@okazymyrov thank you!
but now I became this issue:

Traceback (most recent call last):
File "wifi-pumpkin.py", line 39, in
from core.loaders.checker.networkmanager import CLI_NetworkManager,UI_NetworkManager
File "/usr/share/WiFi-Pumpkin/core/loaders/checker/networkmanager.py", line 3, in
from core.utils import Refactor
File "/usr/share/WiFi-Pumpkin/core/utils.py", line 9, in
from scapy.all import *
File "/usr/lib/python2.7/dist-packages/scapy/all.py", line 28, in
from scapy.route6 import *
File "/usr/lib/python2.7/dist-packages/scapy/route6.py", line 273, in
conf.route6 = Route6()
File "/usr/lib/python2.7/dist-packages/scapy/route6.py", line 31, in init
self.resync()
File "/usr/lib/python2.7/dist-packages/scapy/route6.py", line 44, in resync
self.routes = read_routes6()
File "/usr/lib/python2.7/dist-packages/scapy/arch/linux.py", line 283, in read_routes6
cset = scapy.utils6.construct_source_candidate_set(d, dp, devaddrs, LOOPBACK_NAME)
File "/usr/lib/python2.7/dist-packages/scapy/utils6.py", line 50, in construct_source_candidate_set
if in6_isgladdr(addr) or in6_isuladdr(addr):
File "/usr/lib/python2.7/dist-packages/scapy/utils6.py", line 708, in in6_isgladdr
return in6_isincluded(str, '2000::', 3)
File "/usr/lib/python2.7/dist-packages/scapy/utils6.py", line 651, in in6_isincluded
temp = inet_pton(socket.AF_INET6, addr)
File "/usr/lib/python2.7/dist-packages/scapy/pton_ntop.py", line 40, in inet_pton
raise Exception("Illegal syntax for IP address")
Exception: Illegal syntax for IP address

@mh4x0f mh4x0f added the solved label Jun 6, 2017
@mh4x0f mh4x0f closed this as completed Jun 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants