pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/55446 (scapy function send() does not work)



The following reply was made to PR pkg/55446; it has been noted by GNATS.

From: tmp%bh0.amt.ru@localhost
To: gnats-bugs%netbsd.org@localhost, gutteridge%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
        pkgsrc-bugs%netbsd.org@localhost
Cc: tmp%bh0.amt.ru@localhost
Subject: Re: pkg/55446 (scapy function send() does not work)
Date: Fri, 3 Jul 2020 16:51:10 +0300

 On 07/03/20 15:50, David H. Gutteridge wrote:
 > # cat ./test.py
 >  > #! /usr/pkg/bin/python3.7
 >  > 
 >  > from scapy.all import *
 >  > 
 >  > p=IP(dst="127.0.0.1")/ICMP()/"test"
 >  > p.show2()
 >  > send(p)
 >  If you try this instead, what result do you get? (I don't have
 >  a NetBSD 8.x machine in front of me right now.)
 >  
 >  sendp(Ether()/IP(dst="127.0.0.1")/ICMP(), return_packets=True, realtime=True)
 
 # scapy
 INFO: Can't import matplotlib. Won't be able to plot.
 INFO: Can't import PyX. Won't be able to use psdump() or pdfdump().
 INFO: No IPv6 support in kernel
 WARNING: No route found for IPv6 destination :: (no default route?)
 INFO: Can't import python-cryptography v1.7+. Disabled WEP decryption/encryption. (Dot11)
 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 git-archive.dev304758016
  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   | Craft packets before they craft
        scccccp///pSP///p          p//Y   | you.
       sY/////////y  caa           S//P   |                      -- Socrate
        cayCyayP//Ya              pY/Ya   |
         sY/PsY////YCc          aC//Yp 
          sc  sccaCY//PCypaapyCP//YSs  
                   spCPY//////YPSps    
                        ccaacs         
                                       
 >>> sendp(Ether()/IP(dst="127.0.0.1")/ICMP(), return_packets=True, realtime=True)
 .
 Sent 1 packets.
 <PacketList: TCP:0 UDP:0 ICMP:1 Other:0>
 >>> sendp(Ether()/IP(dst="127.0.0.1")/ICMP(), return_packets=True, realtime=True)
 .
 Sent 1 packets.
 <PacketList: TCP:0 UDP:0 ICMP:1 Other:0>
 >>> 
 
 But the tcpdump saw the packets not on the lo0 interface but on the Wi-Fi interface iwi0:
 
 # tcpdump -s 1700 -l# -n -e -tttt -i lo0 icmp
 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
 listening on lo0, link-type NULL (BSD loopback), capture size 1700 bytes
 ^C
 0 packets captured
 49 packets received by filter
 0 packets dropped by kernel
 
 # tcpdump -s 1700 -l# -n -e -tttt -i iwi0 icmp 
 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
 listening on iwi0, link-type EN10MB (Ethernet), capture size 1700 bytes
     1  2020-07-03 16:46:08.442235 00:00:00:00:00:00 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 42: 127.0.0.1 > 127.0.0.1: ICMP echo request, id 0, seq 0, length 8
 ^C
 1 packet captured
 183 packets received by filter
 0 packets dropped by kernel
 # 
 
 
 --
 Alexei
 


Home | Main Index | Thread Index | Old Index