I am trying to launch scapy using Mininet and get this error:
IOError : [Errno 99] Cannot assign requested address
Error happens in
linux.py,line 151, in read_routes
ifreq = ioctl(s, SIOCGIFADDR,struct.pack("16s16x",LOOPBACK_NAME))
Any solutions or ideas?
note: host was added into existed network,may be this cause some misconfiguration
No loopback interface was added. Solution (from terminal):
ifconfig lo up
ifconfig lo 127.0.0.1
Related
when try to send an ipv6 packet i get
WARNING: Mac address to reach destination not found. Using broadcast.
Finished sending 1 packets
when i send a packet to specific destination using ipv6 as following:
syn = IPv6(dst=destination,src=source) / TCP(sport=555,dport=80,flags="S")
syn_ack = sr1(syn,timeout=11)
this happend if i use the ipv6 while on ipv4 i dont see this issue
scapy version :2.4.3
platform: windows server 2019
I'm struggling starting Cassandra cluster with 'ccm start' command.
I created a cluster named Gdelt, with 3 nodes, as follow:
ccm status gives:
Cluster: 'Gdelt'
-------------------
node1: DOWN (Not initialized)
node3: DOWN (Not initialized)
node2: DOWN (Not initialized)
node4: DOWN (Not initialized)
but ccm start raises the following error:
Traceback (most recent call last):
File "/usr/local/bin/ccm", line 112, in <module>
cmd.run()
File "/usr/local/lib/python2.7/dist-packages/ccmlib/cmds/cluster_cmds.py", line 510, in run
allow_root=self.options.allow_root) is None:
File "/usr/local/lib/python2.7/dist-packages/ccmlib/cluster.py", line 390, in start
common.assert_socket_available(itf)
File "/usr/local/lib/python2.7/dist-packages/ccmlib/common.py", line 521, in assert_socket_available
raise UnavailableSocketError("Inet address %s:%s is not available: %s; a cluster may already be running or you may need to add the loopback alias" % (addr, port, msg))
ccmlib.common.UnavailableSocketError: Inet address 127.0.0.1:9042 is not available: [Errno 98] Address already in use; a cluster may already be running or you may need to add the loopback alias
Traceback (most recent call last):
File "/usr/local/bin/ccm", line 112, in <module>
cmd.run()
File "/usr/local/lib/python2.7/dist-packages/ccmlib/cmds/cluster_cmds.py", line 510, in run
allow_root=self.options.allow_root) is None:
File "/usr/local/lib/python2.7/dist-packages/ccmlib/cluster.py", line 390, in start
common.assert_socket_available(itf)
File "/usr/local/lib/python2.7/dist-packages/ccmlib/common.py", line 521, in assert_socket_available
raise UnavailableSocketError("Inet address %s:%s is not available: %s; a cluster may already be running or you may need to add the loopback alias" % (addr, port, msg))
ccmlib.common.UnavailableSocketError: Inet address 127.0.0.1:9042 is not available: [Errno 98] Address already in use; a cluster may already be running or you may need to add the loopback alias
I've tried creating loopback aliases, with bash script as following, and executing it:
#!/bin/bash
sudo ifconfig lo0 alias 127.0.0.2 up
sudo ifconfig lo0 alias 127.0.0.3 up
sudo ifconfig lo0 alias 127.0.0.4 up
sudo ifconfig lo0 alias 127.0.0.5 up
sudo ifconfig lo0 alias 127.0.0.6 up
which raises the following error upon bash script execution:
alias: Host name lookup failure
ifconfig: `--help' gives usage information.
I've tried the ifconfig directly in the command line as following:
sudo ifconfig lo:0 127.0.0.1 up
which gives the following error:
SIOCSIFADDR: File exists
SIOCSIFFLAGS: Cannot assign requested address
SIOCSIFFLAGS: Cannot assign requested address
Is this clear, tell me please if not, so that I clarify more
I don't know finally how to run my cluster in Cassandra.
Thank you very much for your help.
Habib
So Cassandra users port 9042 by default. However, as your output shows, something appears to be using that port already when you try to start you node. That is evident from the following message:
Inet address 127.0.0.1:9042 is not available: [Errno 98] Address already in use
In this scenario you have a couple of options:
Find the process using port 9042 and kill it (assuming it's something unimportant)
Use a different port to start the node
For (1), you can use:
netstat -nap | grep 9042 | grep LISTEN
You may need to be the "root" user to find the process as netstat will only display things that your current user "owns". If you're root, you'll see all processes.
For (2), you can simply change the port in the cassandra.yaml file (native_transport_port). You should also change the "listen_address" parameter and the "native_transport_broadcast_address" to your host IP address so you're not using the loopback address (You can use "hostname -i" to find your IP address of your local host) - and set your "native_transport_address" to "0.0.0.0" if you want it to listen on all interfaces. That's what we do. Hopefully that will get you node up and running.
Cassandra uses the following ports for different processes:
thrift=('127.0.0.1', 9160)
binary=('127.0.0.1', 9042)
storage=('127.0.0.1', 7000)
Make sure all these ports are not being used for any of the IP of your cluster.
Got strange stuff. Setup: VirtualBox + CentOs7 + python3.6 + scapy2.4.0
Got network with only 4-5 hosts active: gateway, CentOs in VirtualBos, PC on which VirtualBox running and something else.
Trying to do:
ans, unans = sr(IP(dst='10.10.10.1-100')/ICMP(), iface = 'enp0s3', retry=0, timeout=1)
Begin emission: ...
Received 1822 packets, got 99 answers, remaining 1 packets
ans
Results: TCP:0 UDP:0 ICMP:99 Other:0
unans
Unanswered: TCP:0 UDP:0 ICMP:1 Other:0
ans[x] - are legit ICMP Reply packets.
unans[0] - no ICMP reply from CentOs VM itself
So looks like everything is alive instead of 4-5 hosts which actually are alive
What could be the possible reason ?
You want to know the possible reason, but scapy is not giving you enough details. So use tcpdump:
$ sudo tcpdump -e -c 200 icmp
Send the probe packets while tcpdump is running, in order to view address and timing details. It is possible you are seeing lots of perfectly normal ICMPs, for example port unreachable, or network unreachable. Tcpdump will tell you exactly what went over the network interface.
I am new to scapy and was trying to send an icmp packet using my wireless interface. I keep getting following error. I am using the latest scapy version on python3. When i try to send packet using python3 shell i keep getting segmentation fault 11 error. Both sr and send is failing.
bash-3.2$ ifconfig en1
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 24:a0:74:ef:c2:0a
inet6 fe80::1421:2877:9b9f:8b7e%en1 prefixlen 64 secured scopeid 0x5
inet 192.168.0.56 netmask 0xffffff00 broadcast 192.168.0.255
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
bash-3.2$ ping -S 192.168.0.56 www.google.com
PING www.google.com (172.217.166.68) from 192.168.0.56: 56 data bytes
64 bytes from 172.217.166.68: icmp_seq=0 ttl=55 time=26.458 ms
64 bytes from 172.217.166.68: icmp_seq=1 ttl=55 time=21.927 ms
bASH-3.2$ scapy
WARNING: Cannot read wireshark manuf database
WARNING: Crypto-related methods disabled for IPsec, Dot11 and TLS
layers (needs python-cryptography v1.7+).
WARNING: No route found for IPv6 destination :: (no default route?)
INFO: Can't import python-cryptography v1.7+. Disabled WEP
decryption/encryption.
INFO: Can't import python-cryptography v1.7+. Disabled IPsec
encryption/authentication.
WARNING: IPython not available. Using standard Python shell instead.
AutoCompletion, History are disabled.
aSPY//YASa
apyyyyCY//////////YCa |
sY//////YSpcs scpCY//Pp | Welcome to Scapy
ayp ayyyyyyySCP//Pp syY//C | Version 2.4.0rc4
AYAsAYYYYYYYY///Ps cY//S |
pCCCCY//p cSSps y//Y | https://github.com/secdev/scapy
SPPPP///a pP///AC//Y |
A//A cyP////C | Have fun!
p///Ac sC///a |
P////YCpc A//A | To craft a packet, you have to be a
scccccp///pSP///p p//Y | packet, and learn how to swim in
sY/////////y caa S//P | the wires and in the waves.
cayCyayP//Ya pY/Ya | -- Jean-Claude Van Damme
sY/PsY////YCc aC//Yp |
sc sccaCY//PCypaapyCP//YSs
spCPY//////YPSps
ccaacs
>>> sr(IP(dst='www.google.com')/ICMP())
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Library/Python/2.7/site-packages/scapy-2.4.0rc4-
py2.7.egg/scapy/sendrecv.py", line 364, in sr
s = conf.L3socket(promisc=promisc, filter=filter, iface=iface,
nofilter=nofilter)
File "/Library/Python/2.7/site-packages/scapy-2.4.0rc4-
py2.7.egg/scapy/arch/bpf/supersocket.py", line 57, in __init__
(self.ins, self.dev_bpf) = get_dev_bpf()
File "/Library/Python/2.7/site-packages/scapy-2.4.0rc4-
py2.7.egg/scapy/arch/bpf/core.py", line 98, in get_dev_bpf
raise Scapy_Exception("No /dev/bpf handle is available !")
Scapy_Exception: No /dev/bpf handle is available
Try it with sudo scapy, it worked for me.
Here where I found the solution:
https://github.com/secdev/scapy/issues/1343
guedou commented on 8 Sep Scapy needs to be run as root to send
packets.
I ran into this same issue, but also for just sniffing packets (i.e., not to send, which I know needs root). So just starting scapy and running >>> sniff() would return Scapy_Exception: No /dev/bpf handle is available.
It turns out that by default the /dev/bpf* devices are owned by wheel, which my regular user is not part of. This is why sudo scapy works. The issue is that running under sudo is not always convenient.
I don't know if the /dev/bpf* devices be owned by any other group, but a quick workaround indicates that they can ...
Just install Wireshark! Once wireshark is installed, the /dev/bpf* devices are owned by access_bpf, a group that the non-root user is added into.
I got the same issue running with scapy as user with admin rights on Mac.
The solution is to run as super user - sudo
I tried it on both python 2.7.17 and 3.7.6.
Make sure you have the updated scapy package, see installation instruction on https://scapy.readthedocs.io/en/latest/installation.html
The root admin rights for scapy are listed in the following github issue doc https://github.com/secdev/scapy/issues/1851
Try configure SRX FW , try set static arp
[edit interfaces ge-0/0/3 unit 0 family inet address 10.1.1.1/24]
user#host# set arp 10.1.1.3 mac 01:ff:85:7f:78:03
return :
Invalid unicast address at '01:ff:85:7f:78:03'
Why is this invalid?
Solved , happened IP is a Cluster IP which is Multicast mac
as simply say "mac" JunOS assumed unicast which is invalid
So say "multicast mac" and should be OK
Fun
Regards
Brian