Questions tagged [raw-sockets]

An internet socket that allows direct sending and receiving of raw network packets that contain all headers. They differ from protocols like TCP/IP or UDP.

Raw sockets differ from standard sockets where the payload is encapsulated according to the transport layer protocol (TCP, UDP, HTTP, ..). Raw sockets can be used to implement completely new transport-layer protocols or to send messages through some less common protocol like ICMP.

Most socket APIs, especially those based on Berkeley sockets, support raw sockets. Support under Windows XP is intentionally limited due security concerns.

490 questions
0
votes
1 answer

difference between the destination IP of a crafted packet and the destination ip argument of raw socket send()

I want to use raw socket to send a packet. if I create a IP packet(icmp, tcp or udp packet), then the source and destination IP is in the IP packet. now I want to send it via the following lines: memset(&sin, 0, sizeof(sin)); sin.sin_family…
misteryes
  • 2,167
  • 4
  • 32
  • 58
0
votes
2 answers

usng libpcap to implement tcp listen()

I have a research work which requires tcp modification and I want to implement my version of TCP listen() function my idea is to use libpcap to capture all TCP SYN packet from a specific port and then use raw socket to create/send SYN/ACK and the…
misteryes
  • 2,167
  • 4
  • 32
  • 58
0
votes
1 answer

how to get the tcp header of a received packet in socket programming?

I want to get the TCP header of each received TCP packet (destined for a specific program,namely, a port) it seems not possible to use recv() or recvfrom() to get the TCP header using regular socket. So, I want to use raw socket with raw socket, I…
user138126
  • 953
  • 3
  • 14
  • 29
0
votes
1 answer

PacketDotNet problems with CalculateTCPChecksum, ValidTCPChecksum and ValidChecksum

I am trying to do some raw socket programming with TCP protocol, however I am running into an issue with PacketDotNet and TCP checksum. I am getting nullpointer exceptions within the PacketDotNet.TCPPacket. The exception I get is the…
Automatico
  • 12,420
  • 9
  • 82
  • 110
0
votes
1 answer

Raw socket programming - Why does printf() affect the packet sending?

Ok, it is a very weird problem. I was trying to create a raw socket ICMP packet to spoof the ping request. int s; s = socket(PF_INET, SOCK_RAW, IPPROTO_RAW); And then int one; // I should initialize it as 1, but I didn't. const int *val =…
0
votes
4 answers

Wireshark doesn't detect any packet sent. sendto return 0

I have been trying to send packets using raw socket in following code.This code I found somewhere in the internet. I created my own ipheader and udp header. The whole data packet is sent using sendto() function on raw socket. sendto() returns 0.…
Shashi Bhushan
  • 1,481
  • 3
  • 16
  • 20
0
votes
1 answer

Ctrl-c no longer kills my program

I'm writing a ruby back door program that uses PacketFu to listen for packets. The application works properly, but for some reason it will not exit on interrupt (ctrl+c) This is the section of code which seems immune to interrupts. It does not…
Bryce W
  • 123
  • 1
  • 7
0
votes
1 answer

how does winpcap work?

as you know windows has stopped supporting raw_sockets therefore there is no real solution to use raw_sockets to build a network sniffer. so my question is how exactly Winpcap and similar libraries provide network sniffing on windows? does it…
sia
  • 401
  • 3
  • 8
  • 20
0
votes
1 answer

IPv6 Raw sockets. Cannot receive any packet on SIO_RCVALL socket. Win2008

I'm using Windows Server 2008 R2 for production purposes, so it must be no problem for me to utilize raw socket functionality. But instead I got a problem receiving data on inbound RCVALL socket. What am I doing: m_recv_socket = socket( AF_INET6 ,…
0
votes
3 answers

Raw Sockets : Receiver printing garbage values

I am trying to send across a character array using a transmitter and a receiver program using raw sockets. I am able to get the correct number of bytes sent at the receiver side, but the values printed out are garbage. Could someone help me out…
hektor
  • 1,017
  • 3
  • 14
  • 28
0
votes
2 answers

Raw socket NOT sending

I am trying to write a sample Raw socket program to clear my understanding of raw sockets. I create a Raw UDP socket and then call sendto. My sendto succeeds but I never see the packet received by the other side. I don't have any receive side…
Aditya Sehgal
  • 2,867
  • 3
  • 27
  • 37
-1
votes
1 answer

Detect if client is using RAW socket to send packet to server

Detect if client is using RAW socket to send packet to server. Sometimes client uses WPE and other tool to send data to server.
Anoop Kumar
  • 137
  • 10
-1
votes
1 answer

How to properly unpack a RAW socket on Win10 using Python?

I have working code for Linux, but on Windows I got unexpected result. Code: import socket import sys from struct import unpack import platform def main(): local_ip = socket.gethostbyname(socket.gethostname()) print local_ip try: …
stahh
  • 149
  • 5
-1
votes
1 answer

How I can grant permission for Pcap library in Windows 10 from C#?

I use SharpPcap library for realise GOOSE protocol listener (EtherType = 0x88B8). It works well, but only if I run Wireshark in parallel, otherwise my program does not catch GOOSE packets. SharpPcap examples also don't capture GOOSE packets while…
Papayaved
  • 103
  • 1
  • 1
  • 11
-1
votes
3 answers

Sending raw internet packets using C

I want to send a raw packet using raw sockets in C language. I made a header file which i can use in my projects. It's named "Inet.h". The Code: #include #include #include #include int…
1 2 3
32
33