packet-sniffers

writing a http sniffer

无人久伴 提交于 2019-12-04 17:27:40
I would like to write a program to extract the URLs of websites visited by a system (an IP address) through packet capture.. I think this URL will come in the data section ( ie not in any of the headers - ethernet / ip / tcp-udp ).. ( Such programs are sometimes referred to as http sniffers , i'm not supposed to use any available tool ). As a beginner , I've just now gone through this basic sniffer program : sniffex.c .. Can anyone please tell me in which direction i should proceed.. Note: In the info below, assume that GET also includes POST and the other HTTP methods too. It's definitely

How to sniff http requests

大兔子大兔子 提交于 2019-12-04 14:46:44
I want to sniff a local HTTP request to an ASP.NET web application. Is telnet an option? How do you capture packets to a web application? Depending on your exact requirements, Fiddler may be sufficient. http://www.wireshark.org/ is a very advanced and free sniffer/protocol analyzer. I use it on our servers to monitor things from sip protocol info to raw http data. Its all you need and you can add filter rules to just get the data from certain IP etc. ie: ip.addr == 192.168.1.1 Raw packets and headers all included. For ease of setup, I personally would use either the Tamper Data ( https:/

Don't know why I'm getting Error Code 10022 (Invalid Argument) when setting socket options in my C# sniffer

て烟熏妆下的殇ゞ 提交于 2019-12-04 11:52:07
I'm writing a packet sniffer as an exercise in learning .Net 4 socket development on in C#. My goal is to sniff IP packets coming in and out out my computer. My problem is that I'm getting error code 10022, invalid argument, on my call to SetSocketOption. I don't see where I have an invalid argument. I have some admin privs on my computer, but perhaps I don't have enough. It's my work computer and the IT department is pretty strict. With that said, if it was a permissions problem I would expect a different exception. I'm not sure what my next step should be to debug this problem. Anyone have

c# - how to sniff packets in an app without relying on WinPCap?

落花浮王杯 提交于 2019-12-04 07:51:11
问题 BACKGROUND : I now understand how to write a C# application that can monitor packets going in/out of the network card on the PC the application is running on. The approach I know relies on http://www.winpcap.org/ being already installed on the PC however, and then I use a C# wrapper such as http://pcapdotnet.codeplex.com/ or http://sourceforge.net/projects/sharppcap/ . QUESTION : My question however, what would I need to do to be able to have a C# application that can sniff packets that does

http trace utility

倖福魔咒の 提交于 2019-12-04 06:19:19
问题 I need to trace/sniff http traffic from other machines (for example from my android phone or ios device). In the past I used MSSOAPT (described here http://www.devproconnections.com/article/net-framework2/microsoft-soap-trace-tool) and it was perfect, I need something similar, and now it should have syntax highlighting for json and be able to unzip content :). I would like to tell my android to go to http://my.machine.home/Foo?bar and this proxy should forward this to other server such as

Simple Raw Packet Sniffer In Python

为君一笑 提交于 2019-12-03 20:40:32
First, I'm a beginner in python. I developed a simple raw packet sniffer utilizing the PF_PACKET interface that operates at layer 2. The sniffer simply figures out the following... - Ethernet Header (Source - Destination - Protocol) - IP Header (Source IP - Destination IP) - TCP Header(Source Port - Destination Port) Here's the code I've written so far... #!/usr/bin/env python import struct import socket import binascii rawSocket=socket.socket(socket.PF_PACKET,socket.SOCK_RAW,socket.htons(0x0800)) #ifconfig eth0 promisc up receivedPacket=rawSocket.recv(2048) #Ethernet Header... ethernetHeader

when is the push flag set in tcp segment

纵饮孤独 提交于 2019-12-03 14:26:35
i asked this previous question here: tcp two sides trying to connect simultaneously i tried the method given in the solution and while sending while using netcat and sniffing packets with ethereal i observed that when i sent a "hello" string from one side to the other it was sent in a segment with the push flag set. who decides to set the push flag? what are the rules for setting the push or urgent flag in a tcp segment? is it possible to do it using the sockets api? The PUSH flag is used by the tcp stack to basically say "i'm done for now". It's just indicating the data segment is fully

Capture network traffic programmatically (no root)

余生长醉 提交于 2019-12-03 09:41:06
问题 I'm trying to find resources or library which could permit me to capture the traffic of all the network packets of a device programmatically either it be from wifi or mobile network. I believe there no need to be root to be in this promiscuous mode as shark for root would request because there is this app on the play store which can capture all network traffic (even decrypt SSL with MITM) without needing to be root. I simply cannot figure out how to do the same. My question is: How did this

Understanding Tcpdump filter & bit-masking

♀尐吖头ヾ 提交于 2019-12-03 06:31:54
I am trying to sniff the http headers by using tcpdump. This filter works well but I can't understand it - (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0) I've googled it but I can't find any useful info Here is the whole tcpdump command sudo tcpdump -A 'dst [dest host] or src [src host] and tcp and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' -i eth0 It's not the BPF filter that gets http headers but the "-A" switch on your tcpdump command. Your tcpdump command looks for tcp traffic to certain destination or from a certain source on eth0 where the final BPF filter

Capture network traffic programmatically (no root)

女生的网名这么多〃 提交于 2019-12-03 00:11:25
I'm trying to find resources or library which could permit me to capture the traffic of all the network packets of a device programmatically either it be from wifi or mobile network. I believe there no need to be root to be in this promiscuous mode as shark for root would request because there is this app on the play store which can capture all network traffic (even decrypt SSL with MITM) without needing to be root. I simply cannot figure out how to do the same. My question is: How did this app achieve this capture? What API did they use? Thank you for your help. The de-facto appraoch to