|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Senior Member
Iscritto dal: Mar 2009
Messaggi: 753
|
[C] socket raw su windows
Stò realizzando una utility che usa i socket raw sotto windows 7.
![]() E' una mia impressione oppure c'è una limitazione al loro utilizzo nei moderni sistemi windows? ![]() L'errore che ho è sempre su sendto() che torna 10014 --> "bas address". Vi risulta? Facendo una ricerchina in rete mi sembra di si... Non c'è modo di ovviare vero? Thanks. |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Jul 2009
Città: Varès
Messaggi: 658
|
hai controllato il firewall di sistema ?
|
![]() |
![]() |
![]() |
#3 |
Senior Member
Iscritto dal: Mar 2009
Messaggi: 753
|
grazie,
disabilitato, ma non credo che questo sia il punto. la funzione sendto() fallisce e WSAGetLastError() mi ritorna quel tipo di errore, stavo leggendo ora che da NT 6.0 in avanti ci sono restruizioni sui socket raw e non credo si possano bypassare.... |
![]() |
![]() |
![]() |
#4 | |
Senior Member
Iscritto dal: Oct 2005
Messaggi: 3306
|
Quote:
|
|
![]() |
![]() |
![]() |
#5 |
Senior Member
Iscritto dal: Mar 2009
Messaggi: 753
|
già
![]() da MSDN: Codice:
Limitations on Raw Sockets On Windows 7, Windows Server 2008 R2, Windows Vista, and Windows XP with Service Pack 2 (SP2), the ability to send traffic over raw sockets has been restricted in several ways: TCP data cannot be sent over raw sockets. UDP datagrams with an invalid source address 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. This change was made to limit the ability of malicious code to create distributed denial-of-service attacks and limits the ability to send spoofed packets (TCP/IP packets with a forged source IP address). A call to the bind function with a raw socket is not allowed. These above restrictions do not apply to Windows Server 2008 , Windows Server 2003, or to versions of the operating system earlier than Windows XP with SP2. |
![]() |
![]() |
![]() |
#6 |
Senior Member
Iscritto dal: Jul 2005
Città: Bologna
Messaggi: 1130
|
Ma con WinPcap non riesci?
__________________
-> The Motherfucking Manifesto For Programming, Motherfuckers |
![]() |
![]() |
![]() |
#7 |
Senior Member
Iscritto dal: Mar 2009
Messaggi: 753
|
certo, libpcap ha i suoi driver quindi non ci dovrebbero essere problemi.
Questa è un'altra alternativa che si può usare, oppure libnet. Mi sposto su linux perchè volevo vedere subito un risultato senza stare a modificare ora il codice. Su windows invece dovrò fare come hai giustamente indicato. ![]() Grazie. |
![]() |
![]() |
![]() |
#8 |
Senior Member
Iscritto dal: Mar 2009
Messaggi: 753
|
per informazione sull'ultimo kernel linux tutto OK!
![]() |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 14:58.