scapy

SCAPY PYTHON - Get 802.11 DS Status

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to use SCAPY to create a sniffing program to demonstrate 802.11 device association[s] and roles within an 802.11 network. SCAPY has simple functions to identify Beacon frames, probe requests and probe responses. I'm trying to dig a bit deeper than that and do my own evaluation based upon the DS status to show all other traffic association[s]. What I cannot do it determine how to get the value of the DS status (00, 01,10,11). If determined, then I can handle the frame accordingly to get SOURCE, BSSID, RECEIVER, TRANSMITTER and

scapy: error sending packets

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am new to scapy and I am following some online tutorial, but I am stuck at this problem. I am able to send packets through a wired connection but when I try this with wireless, I face this error. I tried searching google but it was of no help. I hope to find a solution. Thanks in advance. I am using windows 8.1, python 2.7 >>> p=IP(dst="192.168.1.1")/ICMP() >>> sr1(p) Begin emission: ERROR: --- Error sending packets Traceback (most recent call last): File "c:\Python27\lib\site-packages\scapy\arch\windows\__init__.py", line 374, in sndrcv

sending ICMP packets in scapy and choosing the correct interface

匿名 (未验证) 提交于 2019-12-03 08:44:33
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Can we use the srp() function for a Layer 3 ICMP packet? I see that when we craft an ICMP echo-request packet and use the sr() to send/receive, we do NOT see it getting sent out of the interface , hence no response from the destination. But the same packet if we use the srp() function we see the response. When should we use sr() and when srp()? In the documentation it states sr() is to be used for L3 packet and srp() to be used for L2? But in my case I am not sure why sr() is not working for an ICMP packet? Can some experts please help me

How to pickle a scapy packet?

匿名 (未验证) 提交于 2019-12-03 08:35:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I need to pickle a scapy packet. Most of the time this works, but sometimes the pickler complains about a function object. As a rule of thumb: ARP packets pickle fine. Some UDP packets are problematic. 回答1: My solution (as inspired by the scapy mailing list) is as follows: class PicklablePacket : """A container for scapy packets that can be pickled (in contrast to scapy packets themselves).""" def __init__ ( self , pkt ): self . contents = bytes ( pkt ) self . time = pkt . time def __call__ ( self ): """Get the original scapy

HTTP GET packet sniffer in Scapy

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am trying to code a simple sniffer in Scapy, which only prints HTTP packets with GET method only. Here's the code: #!/usr/bin/python from scapy . all import * def http_header ( packet ): http_packet = str ( packet ) if http_packet . find ( 'GET' ): print GET_print ( packet ) print packet def GET_print ( packet1 ): print "***************************************GET PACKET****************************************************" print packet1 print "****************************************************************************************

Raw sockets and sendto in python

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 02:22:37
I am working on integrating scapy with twisted, but I ran into this very weird bug on OSX that I can't seem to figure out. Basically I am unable to send a valid TCP packet (inclusive of IP headers) via a raw socket. This is what I am doing: import socket from scapy.all import IP, TCP pkt = IP(src='0.0.0.0', dst='127.0.0.1')/TCP() spkt1 = str(pkt) outs = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_RAW) outs.setsockopt(socket.SOL_IP, socket.IP_HDRINCL, 1) outs.sendto(spkt1, ('127.0.0.1', 0)) When I run this I get the following error: outs.sendto(spkt1, ('127.0.0.1', 0)) socket

Scapy error: no module names pcapy

我的未来我决定 提交于 2019-12-03 02:17:31
The code given below is for sniffing a packet from the IP address provided. from scapy.all import * sniff(filter="tcp and host 192.168.0.90", count=10) On running this code the error I am getting is: Traceback (most recent call last): File ".\sample.py", line 1, in <module> from scapy.all import * File "C:\Python27\lib\site-packages\scapy\all.py", line 16, in <module> from arch import * File "C:\Python27\lib\site-packages\scapy\arch\__init__.py", line 79, in <module> from windows import * File "C:\Python27\lib\site-packages\scapy\arch\windows\__init__.py", line 23, in <module> from scapy.arch

Change TCP Payload with nfqueue/scapy

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Hello I am using nfqueue and scapy and I my goal is to recieve packets at my NFQUEUE, change the payload and resend them. I can change fields like the TTL without any kind of problem, but when it comes to change the payload, I am encoutering problems. When I change the payload, I sniff the packet with wireshark and apparently I send the packet with the payload modified, but the server doesn't answer. This is my code: #!/usr/bin/env python import nfqueue from scapy.all import * def callback(payload): data = payload.get_data() pkt = IP(data)

Why in scapy packet.payload.proto == 17 is UDP and packet.payload.proto ==6 TCP?

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I saw this code in github. I dont uderstand why packet.payload.proto == 17 is UDP and packet.payload.proto ==6 TCP. packets = scapy.all.rdpcap('data/dns.cap') for packet in packets: print('----------') print('src_mac: {0}'.format(packet.src)) print('dst_mac: {0}'.format(packet.dst)) ip = packet.payload print('src_ip: {0}'.format(ip.src)) print('dst_ip: {0}'.format(ip.dst)) if ip.proto == 17: udp = ip.payload print('udp_sport: {0}'.format(udp.sport)) print('udp_dport: {0}'.format(udp.dport)) if ip.proto == 6: tcp = ip.payload print('tcp_sport

Scapy installation fails due to invalid token

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 选择语言 中文(简体) 日语 英语 中文(繁体) 由 翻译 强力驱动 问题: I have recently taken up learning networks, and I want to install scapy. I have downloaded the latest version (2.2.0), and have two versions of python on my computer- 2.6.1 and 3.3.2. My OS is windows 7 64 bit. After extracting scapy and navigating to the correct folder in the terminal, I was instructed to run "python setup.py install". I get the following error- File "setup.py", line 35 os.chmod(fname,0755) ................................^ ......................invalid token (dots for alignment) How do I