packet

Sniffing and displaying TCP packets in UTF-8

不问归期 提交于 2019-12-03 14:19:59
I am trying to use tcpdump to display the content of tcp packets flowing on my network. I have something like: tcpdump -i wlan0 -l -A The -A option displays the content as ASCII text, but my text seems to be UTF-8. Is there a way to display UTF-8 properly using tcpdump? Do you know any other tools which could help? Many thanks Make sure your terminal supports outputting UTF-8 and pipe the output to something which replaces non printable characters: tcpdump -lnpi lo tcp port 80 -s 16000 -w - | tr -t '[^[:print:]]' '' tcpdump -lnpi lo tcp port 80 -s 16000 -w - | strings -e S -n 1 If your

Track a packet as it goes through the kernel (linux)

a 夏天 提交于 2019-12-03 13:27:52
问题 I have two machines which are set up to use Ip-Security and machine A (lets call them A and B) has a socket which is bound to a particular UDP port on the local machine and it polls it frequently to see if anything is received on it. When I disable Ip-security, the data between the two machines goes through fine and I send and receive the packets fine. But when Ip-Security is enabled, the packet doesn't get to that socket on machine A sent by machine B. I do a tcpdump on both the machines and

how does teamviewer find my computer even if my comp. behind of the firewall and firewall isn't configured?

心已入冬 提交于 2019-12-03 05:09:11
问题 Did you use teamviewer? (comic question i know... Who doesn't use it?) Do you have any idea how does teamviewer make connection even if i am behind the router, firewall, switch and my local firewall..? I'm trying to imagine a connection that is between remote machinge and my computer. Remote machine is sending the packets (and its header (for instance, destination IP, message body)) to me but it only knows my id number(which is given by my local teamviewer application). And this packets are

What happens after a packet is captured?

风流意气都作罢 提交于 2019-12-03 04:34:57
问题 I've been reading about what happens after packets are captured by NICs, and the more I read, the more I'm confused. Firstly, I've read that traditionally, after a packet is captured by the NIC, it gets copied to a block of memory in the kernel space, then to the user space for whatever application that then works on the packet data. Then I read about DMA, where the NIC directly copies the packet into memory, bypassing the CPU. So is the NIC -> kernel memory -> User space memory flow still

Track a packet as it goes through the kernel (linux)

落花浮王杯 提交于 2019-12-03 02:53:25
I have two machines which are set up to use Ip-Security and machine A (lets call them A and B) has a socket which is bound to a particular UDP port on the local machine and it polls it frequently to see if anything is received on it. When I disable Ip-security, the data between the two machines goes through fine and I send and receive the packets fine. But when Ip-Security is enabled, the packet doesn't get to that socket on machine A sent by machine B. I do a tcpdump on both the machines and I can see the (encrypted) packet being sent out from machine B and being received on machine A. But

Bluetooth Low Energy - updating a characteristic value repeatedly

匆匆过客 提交于 2019-12-03 00:57:07
问题 Follow-Up question on Electrical Engineering Stackexchange I want to write the value of a Bluetooth Low Energy characteristic repeatedly in a short amount of time (as a possible use case, imagine a mouse). The characteristic with a 128bit UUID is 20 bytes long. Therefore, it can be written in a single Low Energy transaction. Writes occur at a rate of 50 Hz, that is equal to a write once every 20ms . Therefore, 20 * 50 * 8 = 8 kbit/s are written. I am using the Command / Write without response

Python 3.4: Unknown format code 'x'

北城余情 提交于 2019-12-02 15:16:16
问题 I have issue about packet sniffer in Python3. version of python: 3.4 I followed some tutorial that works, but not on my computer. This code has to get mac address, convert it to string and in main() method should print to me destination mac, source mac and protocol. code: sniffer_demo.py import socket import struct import textwrap def main(): conn = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.ntohs(3)) while True: raw_data, addr = conn.recvfrom(65536) # one's and zero's put to the

Bluetooth Low Energy - updating a characteristic value repeatedly

谁说我不能喝 提交于 2019-12-02 14:19:05
Follow-Up question on Electrical Engineering Stackexchange I want to write the value of a Bluetooth Low Energy characteristic repeatedly in a short amount of time (as a possible use case, imagine a mouse). The characteristic with a 128bit UUID is 20 bytes long. Therefore, it can be written in a single Low Energy transaction. Writes occur at a rate of 50 Hz, that is equal to a write once every 20ms . Therefore, 20 * 50 * 8 = 8 kbit/s are written. I am using the Command / Write without response mode to write the characteristic. Therefore, no acknowledgments happen on the attribute layer. No

How to use structure with dynamically changing size of data?

霸气de小男生 提交于 2019-12-02 10:14:44
Question for C only, C++ and vectors do not solve problem. I have such structure: typedef __packed struct Packet_s { U8 head; U16 len; U32 id; U8 data; U8 end; U16 crc; } Packet_t, *Packet_p; ( EDIT : U8 is uint8_t (unsigned char) and so on) For example, I've received packet(hex): 24 0B 00 07 00 00 00 AA 0D 16 1C where head = 0x24 len = 0x0B 0x00 id = 0x07 0x00 0x00 0x00 data = 0xAA end = 0x0D crc = 0x16 0x1C I can copy it from incoming buffer like this U8 Buffer[SIZE]; // receives all bytes here memcpy(&Packet, &Buffer, buffer_len); and work futher with it. Is it possible to use my structure

scapy packet manipulation and original pkt.time

孤者浪人 提交于 2019-12-02 09:49:41
问题 I have python, scapy peace of code that store my data into database (IP src and dst, ports, ..) which i use for some statistics. On some packets i am doing some manipulation (changing dst port) and then send them back out on interface. Problem is that this packet i was manipulating with have different pkt.time value than original one and if I store those packets into database they have different packet time then they have originally. Is there and option within creating UDP packet to put