Python3 scapy failed to get the MAC address
I am learning "Python Black Hat". I will not respond when I use scapy to get the IP address of ip. I have not received any reply from the sent packet. I found a simple example from the Internet and the effect is the same. Why is that?
from scapy.all import srp,Ether,ARP,conf
ipscan='127.0.0.1'
try:
ans,unans=
srp(Ether(dst="FF:FF:FF:FF:FF:FF")/ARP(pdst=ipscan),timeout=2,verbose=False)
except Exception as e:
print(str(e))
else:
for snd,rcv in ans:
list_mac=rcv.sprintf("%Ether.src% - %ARP.psrc%")
print(list_mac)
I learned ARP spoofing in the book, experimented with my win7 virtual machine, but failed to get the MAC address.
scapy
add a comment |
I am learning "Python Black Hat". I will not respond when I use scapy to get the IP address of ip. I have not received any reply from the sent packet. I found a simple example from the Internet and the effect is the same. Why is that?
from scapy.all import srp,Ether,ARP,conf
ipscan='127.0.0.1'
try:
ans,unans=
srp(Ether(dst="FF:FF:FF:FF:FF:FF")/ARP(pdst=ipscan),timeout=2,verbose=False)
except Exception as e:
print(str(e))
else:
for snd,rcv in ans:
list_mac=rcv.sprintf("%Ether.src% - %ARP.psrc%")
print(list_mac)
I learned ARP spoofing in the book, experimented with my win7 virtual machine, but failed to get the MAC address.
scapy
I would say you need to use a net range as ipscan. For instance,192.168.0.1/24
(if your network up really is 192.168.0.x)
– Cukic0d
Nov 11 at 14:18
My IP address is in the range of 192.168.155.1/24. I have tried to specify the range of ipscan before, but the effect is still the same. The 256 packets sent out are not responding.
– L.gen
Nov 12 at 12:21
add a comment |
I am learning "Python Black Hat". I will not respond when I use scapy to get the IP address of ip. I have not received any reply from the sent packet. I found a simple example from the Internet and the effect is the same. Why is that?
from scapy.all import srp,Ether,ARP,conf
ipscan='127.0.0.1'
try:
ans,unans=
srp(Ether(dst="FF:FF:FF:FF:FF:FF")/ARP(pdst=ipscan),timeout=2,verbose=False)
except Exception as e:
print(str(e))
else:
for snd,rcv in ans:
list_mac=rcv.sprintf("%Ether.src% - %ARP.psrc%")
print(list_mac)
I learned ARP spoofing in the book, experimented with my win7 virtual machine, but failed to get the MAC address.
scapy
I am learning "Python Black Hat". I will not respond when I use scapy to get the IP address of ip. I have not received any reply from the sent packet. I found a simple example from the Internet and the effect is the same. Why is that?
from scapy.all import srp,Ether,ARP,conf
ipscan='127.0.0.1'
try:
ans,unans=
srp(Ether(dst="FF:FF:FF:FF:FF:FF")/ARP(pdst=ipscan),timeout=2,verbose=False)
except Exception as e:
print(str(e))
else:
for snd,rcv in ans:
list_mac=rcv.sprintf("%Ether.src% - %ARP.psrc%")
print(list_mac)
I learned ARP spoofing in the book, experimented with my win7 virtual machine, but failed to get the MAC address.
scapy
scapy
asked Nov 10 at 14:30
L.gen
135
135
I would say you need to use a net range as ipscan. For instance,192.168.0.1/24
(if your network up really is 192.168.0.x)
– Cukic0d
Nov 11 at 14:18
My IP address is in the range of 192.168.155.1/24. I have tried to specify the range of ipscan before, but the effect is still the same. The 256 packets sent out are not responding.
– L.gen
Nov 12 at 12:21
add a comment |
I would say you need to use a net range as ipscan. For instance,192.168.0.1/24
(if your network up really is 192.168.0.x)
– Cukic0d
Nov 11 at 14:18
My IP address is in the range of 192.168.155.1/24. I have tried to specify the range of ipscan before, but the effect is still the same. The 256 packets sent out are not responding.
– L.gen
Nov 12 at 12:21
I would say you need to use a net range as ipscan. For instance,
192.168.0.1/24
(if your network up really is 192.168.0.x)– Cukic0d
Nov 11 at 14:18
I would say you need to use a net range as ipscan. For instance,
192.168.0.1/24
(if your network up really is 192.168.0.x)– Cukic0d
Nov 11 at 14:18
My IP address is in the range of 192.168.155.1/24. I have tried to specify the range of ipscan before, but the effect is still the same. The 256 packets sent out are not responding.
– L.gen
Nov 12 at 12:21
My IP address is in the range of 192.168.155.1/24. I have tried to specify the range of ipscan before, but the effect is still the same. The 256 packets sent out are not responding.
– L.gen
Nov 12 at 12:21
add a comment |
1 Answer
1
active
oldest
votes
Since every network interface only answer for address that bound to them and You're sending your packet to yourself (127.0.0.1), nobody answer your request. change the ipscan then it works fine
My IP address is in the range of 192.168.155.1/24. I have tried to specify the range of ipscan before, but the effect is still the same. The 256 packets sent out are not responding.
– L.gen
Nov 12 at 12:22
If you set a correct IP range like 192.168.155.0/24 or a specific IP like 192.168.155.1 and still getting NOTHING, then it's not your code, because I checked and it works fine, it's in your network settings. you're missing something.
– Ali Kargar
Nov 12 at 13:35
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53239946%2fpython3-scapy-failed-to-get-the-mac-address%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Since every network interface only answer for address that bound to them and You're sending your packet to yourself (127.0.0.1), nobody answer your request. change the ipscan then it works fine
My IP address is in the range of 192.168.155.1/24. I have tried to specify the range of ipscan before, but the effect is still the same. The 256 packets sent out are not responding.
– L.gen
Nov 12 at 12:22
If you set a correct IP range like 192.168.155.0/24 or a specific IP like 192.168.155.1 and still getting NOTHING, then it's not your code, because I checked and it works fine, it's in your network settings. you're missing something.
– Ali Kargar
Nov 12 at 13:35
add a comment |
Since every network interface only answer for address that bound to them and You're sending your packet to yourself (127.0.0.1), nobody answer your request. change the ipscan then it works fine
My IP address is in the range of 192.168.155.1/24. I have tried to specify the range of ipscan before, but the effect is still the same. The 256 packets sent out are not responding.
– L.gen
Nov 12 at 12:22
If you set a correct IP range like 192.168.155.0/24 or a specific IP like 192.168.155.1 and still getting NOTHING, then it's not your code, because I checked and it works fine, it's in your network settings. you're missing something.
– Ali Kargar
Nov 12 at 13:35
add a comment |
Since every network interface only answer for address that bound to them and You're sending your packet to yourself (127.0.0.1), nobody answer your request. change the ipscan then it works fine
Since every network interface only answer for address that bound to them and You're sending your packet to yourself (127.0.0.1), nobody answer your request. change the ipscan then it works fine
answered Nov 12 at 5:34
Ali Kargar
1444
1444
My IP address is in the range of 192.168.155.1/24. I have tried to specify the range of ipscan before, but the effect is still the same. The 256 packets sent out are not responding.
– L.gen
Nov 12 at 12:22
If you set a correct IP range like 192.168.155.0/24 or a specific IP like 192.168.155.1 and still getting NOTHING, then it's not your code, because I checked and it works fine, it's in your network settings. you're missing something.
– Ali Kargar
Nov 12 at 13:35
add a comment |
My IP address is in the range of 192.168.155.1/24. I have tried to specify the range of ipscan before, but the effect is still the same. The 256 packets sent out are not responding.
– L.gen
Nov 12 at 12:22
If you set a correct IP range like 192.168.155.0/24 or a specific IP like 192.168.155.1 and still getting NOTHING, then it's not your code, because I checked and it works fine, it's in your network settings. you're missing something.
– Ali Kargar
Nov 12 at 13:35
My IP address is in the range of 192.168.155.1/24. I have tried to specify the range of ipscan before, but the effect is still the same. The 256 packets sent out are not responding.
– L.gen
Nov 12 at 12:22
My IP address is in the range of 192.168.155.1/24. I have tried to specify the range of ipscan before, but the effect is still the same. The 256 packets sent out are not responding.
– L.gen
Nov 12 at 12:22
If you set a correct IP range like 192.168.155.0/24 or a specific IP like 192.168.155.1 and still getting NOTHING, then it's not your code, because I checked and it works fine, it's in your network settings. you're missing something.
– Ali Kargar
Nov 12 at 13:35
If you set a correct IP range like 192.168.155.0/24 or a specific IP like 192.168.155.1 and still getting NOTHING, then it's not your code, because I checked and it works fine, it's in your network settings. you're missing something.
– Ali Kargar
Nov 12 at 13:35
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53239946%2fpython3-scapy-failed-to-get-the-mac-address%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I would say you need to use a net range as ipscan. For instance,
192.168.0.1/24
(if your network up really is 192.168.0.x)– Cukic0d
Nov 11 at 14:18
My IP address is in the range of 192.168.155.1/24. I have tried to specify the range of ipscan before, but the effect is still the same. The 256 packets sent out are not responding.
– L.gen
Nov 12 at 12:21