Смехотворец
Зарегистрирован: 28 March 2005
Сообщения: 1134
Примеры кода: 1
|
RE[3]: C# подмена source IP в UDP пакете |
09 July 2008 00:10 |
|
|
|
|
Даже если этот пример заработает, он не подойдет. По причине того, что нельзя поставить адрес 192.168.х.х, а именно из этого диапазона нужно "слать" пакеты.
Неужели нет никакого другого пути решения (
Ну вот на такое наткнулся:
In order to provide your own IP & TCP header you need to use RAW sockets. These are supported in the .Net Framework, but Windows has limited the ability to send via RAW sockets for security reasons, please see:
Creating and using RAW sockets is similar to TCP/UDP based sockets. The fact you want to create a RAW socket is specified at socket construction time.
What new functionality is added to this feature in Windows XP Service Pack 2?
Restricted traffic over raw sockets
Detailed description
A very small number of Windows applications make use of raw IP sockets, which provide an industry-standard way for applications to create TCP/IP packets with fewer integrity and security checks by the TCP/IP stack. The Windows implementation of TCP/IP still supports receiving traffic on raw IP sockets. However, the ability to send traffic over raw sockets has been restricted in two ways:
• TCP data cannot be sent over raw sockets.
• UDP datagrams with invalid source addresses cannot be sent over raw sockets. The IP source address for any outgoing UDP datagram must exist on a network interface or the datagram is dropped.
Из этого следует, что в XP SP 2 нельзя слать UDP, если ее адрес не совпадает с адресом сетевой карты. Но это не официальная документация. Программирую за еду.
|
|