Posts: 13
Threads: 3
Joined: Oct 2020
12-28-2020, 01:38 PM
(This post was last modified: 12-28-2020, 03:18 PM by enmafia2.)
Hope someone can help me here, I’m getting the same TypeError: 'IP' object is not callable error with 2 different scapy scripts
The first script I’m sending packet to my router:
Code: sr(IP(dst="192.168.1.254")/TCP(dport=[21,22,23,80]))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-50-42d44e8df85e> in <module>()
----> 1 sr(IP(dst="192.168.1.254")/TCP(dport=[21,22,23,80]))
TypeError: 'IP' object is not callable
The second script I’m sending packet to a domain:
a,b =sr(IP(dst="[url=http://www.danscourses.com/]www.danscourses.com[/url]")/TCP(sport=[RandShort()]*10))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-60-84b1eab0d90c> in <module>()
----> 1 a,b =sr(IP(dst="[url=http://www.danscourses.com/]www.danscourses.com[/url]")/TCP(sport=[RandShort()]*10))
TypeError: 'IP' object is not callable
Am I getting these errors I’m using a usb live persistence and not an Ethernet ?
Thanks
Posts: 111
Threads: 6
Joined: Jun 2020
Out of curiosity, what's the output of print(IP)?
Posts: 158
Threads: 30
Joined: Apr 2020
12-29-2020, 02:00 AM
(This post was last modified: 12-29-2020, 02:01 AM by DeepLogic.)
(12-28-2020, 01:38 PM)FancyBear Wrote: Hope someone can help me here, I’m getting the same TypeError: 'IP' object is not callable error with 2 different scapy scripts
The first script I’m sending packet to my router:
Code: sr(IP(dst="192.168.1.254")/TCP(dport=[21,22,23,80]))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-50-42d44e8df85e> in <module>()
----> 1 sr(IP(dst="192.168.1.254")/TCP(dport=[21,22,23,80]))
TypeError: 'IP' object is not callable
The second script I’m sending packet to a domain:
a,b =sr(IP(dst="[url=http://www.danscourses.com/]www.danscourses.com[/url]")/TCP(sport=[RandShort()]*10))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-60-84b1eab0d90c> in <module>()
----> 1 a,b =sr(IP(dst="[url=http://www.danscourses.com/]www.danscourses.com[/url]")/TCP(sport=[RandShort()]*10))
TypeError: 'IP' object is not callable
Am I getting these errors I’m using a usb live persistence and not an Ethernet ?
Thanks
No, I don't think the live usb has anything to do with it. So tbh I have no idea what you did wrong from what info you've given. I did the exact same thing you did on my Debian 10, python 3.7.3. I just did Code: from scapy.all import IP, sr, TCP
Then I did the same thing you did with no issue. Make sure you're not importing it right. If there's no issue there, try reinstalling scapy.
Posts: 13
Threads: 3
Joined: Oct 2020
Thanks I’ll give it a try and let you know how I get on
Posts: 13
Threads: 3
Joined: Oct 2020
(12-29-2020, 02:00 AM)DeepLogic Wrote: No, I don't think the live usb has anything to do with it. So tbh I have no idea what you did wrong from what info you've given. I did the exact same thing you did on my Debian 10, python 3.7.3. I just did Code: from scapy.all import IP, sr, TCP
Then I did the same thing you did with no issue. Make sure you're not importing it right. If there's no issue there, try reinstalling scapy.
OK I tried from scapy.all import IP, sr, TCP and it worked like a charm Thanks for the suggestion, what’s puzzling me now is I rebooted my pc and I tried it the way I was getting issues with and now this way is working also, I haven’t reinstalled or anything don’t know what happened
Posts: 158
Threads: 30
Joined: Apr 2020
(12-30-2020, 01:02 PM)FancyBear Wrote: (12-29-2020, 02:00 AM)DeepLogic Wrote: No, I don't think the live usb has anything to do with it. So tbh I have no idea what you did wrong from what info you've given. I did the exact same thing you did on my Debian 10, python 3.7.3. I just did Code: from scapy.all import IP, sr, TCP
Then I did the same thing you did with no issue. Make sure you're not importing it right. If there's no issue there, try reinstalling scapy.
OK I tried from scapy.all import IP, sr, TCP and it worked like a charm Thanks for the suggestion, what’s puzzling me now is I rebooted my pc and I tried it the way I was getting issues with and now this way is working also, I haven’t reinstalled or anything don’t know what happened
Scapy is kind of different than other python libraries lol. Glad you got it resolved.
Posts: 1,416
Threads: 377
Joined: Jun 2015
(12-30-2020, 01:02 PM)FancyBear Wrote: OK I tried from scapy.all import IP, sr, TCP and it worked like a charm Thanks for the suggestion, what’s puzzling me now is I rebooted my pc and I tried it the way I was getting issues with and now this way is working also, I haven’t reinstalled or anything don’t know what happened
Sometimes it's just magic  I hear rebooting your PC solves 20% of all IT-problems haha.
Posts: 158
Threads: 30
Joined: Apr 2020
(12-30-2020, 11:08 PM)Insider Wrote: (12-30-2020, 01:02 PM)FancyBear Wrote: OK I tried from scapy.all import IP, sr, TCP and it worked like a charm Thanks for the suggestion, what’s puzzling me now is I rebooted my pc and I tried it the way I was getting issues with and now this way is working also, I haven’t reinstalled or anything don’t know what happened
Sometimes it's just magic I hear rebooting your PC solves 20% of all IT-problems haha.
Lol that's true
Posts: 13
Threads: 3
Joined: Oct 2020
(12-30-2020, 11:08 PM)Insider Wrote: Sometimes it's just magic I hear rebooting your PC solves 20% of all IT-problems haha. I remember a place I used to work The IT guys first response to any issue was to ask “Have you tried turning it off and turning it back on again
|