Generate packet like HTTP Request

Sep 18, 2010 at 1:37 PM

Hi,

Is it possible to generate packet to pretend it was a HTTP Request ?

Thank you.

Coordinator
Sep 18, 2010 at 1:45 PM
Edited Sep 18, 2010 at 2:03 PM

Yes.

HTTP request packets are usually TCP packets with destination port 80 and HTTP request in the TCP payload.

So you can generate an HTTP packet by generating such TCP packet.

Remember that in order for a server to listen to such request you must first open a TCP connection with that server.

 

The next version of Pcap.Net will support HTTP by providing parsing and building HTTP packets over TCP.

Since this is already implemented and now in the final testing phase, you are welcome to download the latest sources from the Source Code tab and build a Pcap.Net version that support HTTP.

 

Boaz.

Sep 19, 2010 at 5:24 AM

Thanks again Boaz.

I'll do this.

Would you have a simple example like ping command here with port 80 and TCP payload ?

Sep 20, 2010 at 7:19 PM

I'm downloading Visual Studio 2010 to work with lastest Pcap.Net version.

Pending, I found this :

Packet packet =
	PacketBuilder.Build(DateTime.Now,
						new EthernetLayer
						{
							Source = new MacAddress("1:1:1:1:1:1"),
							Destination = new MacAddress("2:2:2:2:2:2"),
						},
						new IpV4Layer
						{
							Source = new IpV4Address("192.168.0.4"),
							Destination = new IpV4Address("178.33.42.77"),
							Ttl = 64,
							Identification = 100,
						},
						new TcpLayer
						{
							DestinationPort = 80;
						});
communicator.SendPacket(packet);

 

 

also :

 

packet.Ethernet.IpV4.Tcp.Payload

 

Is it possible to fill payload with http request like this, or just on Pcap.Net 0.7.0 version ?

Coordinator
Sep 21, 2010 at 1:53 PM

It is possible. You should just give another PayloadLayer after the TcpLayer.

In the next version you'll be able to give HttpLayer.

Coordinator
Jan 5, 2011 at 8:42 PM

HttpLayer are now available - Pcap.Net version 0.8.0.