JnetPcap enviando pacotes TCP/HTTP

olá, pessoal.

Alguém sabe como envio pacotes http/TCP utilizando o jnetpcap ou alguma lib que funcione? já usei pcap e não funcionou, agora usando jnetpcap também não funciona.
não da erro, o método de envio executa sem aparentar algum erro, mas por algum motivo o pacote enviado não chega no destino.
então suspeito que estou montando o pacote errado.

usando socket eu faço dessa forma:

[code]/* api socket nativa java code */
InetAddress add = InetAddress.getByAddress(new byte[]{ Integer.valueOf(“75”).byteValue(), Integer.valueOf(“101”).byteValue(), Integer.valueOf(“143”).byteValue(), Integer.valueOf(“131”).byteValue() });
InetSocketAddress socketAdds = new InetSocketAddress(add, 80);
Socket socket = new Socket();
socket.setReuseAddress(true);
socket.connect(socketAdds);
String requestLine = “GET / HTTP/1.1”;
BufferedWriter connectionWriters = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));

connectionWriters.write(requestLine);
connectionWriters.write("\r\n");
connectionWriters.write(“Host: test.myserver.net\r\n”);
connectionWriters.write(“User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36\r\n”);
connectionWriters.write(“Connection: Keep-Alive\r\n”);
connectionWriters.write("\r\n");
connectionWriters.write(“http://meuip.datahouse.com.br”);
connectionWriters.write("\r\n");
connectionWriters.flush();
[/code]

então, preciso fazer a mesma coisa usando o jnetpcap ou qualquer outra api que me possibilite realizar spoofing do ip de origem.

meu código com jnetpcap é:

JMemoryPacket packet = new JMemoryPacket(1024);
packet.order(ByteOrder.BIG_ENDIAN);

packet.setUShort(12, 0x0800);
packet.scan(JProtocol.ETHERNET_ID);

Ethernet ethernet = packet.getHeader(new Ethernet());

byte[] destinationIP = { Integer.valueOf("75").byteValue(), Integer.valueOf("101").byteValue(), Integer.valueOf("143").byteValue(), Integer.valueOf("131").byteValue() };
byte[] sourceIP = { Integer.valueOf("127").byteValue(), Integer.valueOf("0").byteValue(), Integer.valueOf("0").byteValue(), Integer.valueOf("1").byteValue() };
ethernet.destination(destinationIP);
ethernet.source(sourceIP);

packet.setUByte(14, 0x40 | 0x05);
packet.scan(JProtocol.ETHERNET_ID);

Ip4 ip4 = packet.getHeader(new Ip4());
ip4.type(Ip4Type.TCP);
ip4.length(1024 - ethernet.size());
ip4.source(sourceIP);
ip4.destination(destinationIP);
ip4.ttl(100);

packet.setUByte(46, 0x50);
packet.scan(JProtocol.ETHERNET_ID);

Tcp tcp = packet.getHeader(new Tcp());
tcp.source(2666);
tcp.destination(80);
byte[] content = ("GET / HTTP/1.1\r\n" + "Host: test.myserver.net\r\n"
+ "User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36\r\n" + "Connection: Keep-Alive\r\n").getBytes();

Payload payload = packet.getHeader(new Payload());
payload.setByteArray(0, content);

System.out.println(packet);
ByteBuffer b = ByteBuffer.wrap(packet.getByteArray(0, ethernet.size()));

if (pcap.sendPacket(b) != Pcap.OK) {
System.err.println(pcap.getErr());
}

pcap.close();

e como disse acima, não funciona!
uso Windows XP e segundo jnetpcap deveria funcionar.
o pacote fica dessa forma:

Frame:
Frame: number = 2
Frame: timestamp = 2013-07-22 16:02:50.964
Frame: wire length = 1024 bytes
Frame: captured length = 1024 bytes
Frame:
Eth: ******* Ethernet - "Ethernet" - offset=0 (0x0) length=14
Eth:
Eth: destination = 4b:65:8f:83:78:01
Eth: .... ..0. .... .... = [0] LG bit
Eth: .... ...0 .... .... = [2] IG bit
Eth: source = 7f:00:00:01:00:00
Eth: .... ..0. .... .... = [0] LG bit
Eth: .... ...0 .... .... = [2] IG bit
Eth: type = 0x800 (2048) [ip version 4]
Eth:
Ip: ******* Ip4 - "ip version 4" - offset=14 (0xE) length=20 protocol suite=NETWORK
Ip:
Ip: version = 4
Ip: hlen = 5 [5 * 4 = 20 bytes, No Ip Options]
Ip: diffserv = 0x0 (0)
Ip: 0000 00.. = [0] code point: not set
Ip: .... ..0. = [0] ECN bit: not set
Ip: .... ...0 = [0] ECE bit: not set
Ip: length = 1010
Ip: id = 0x0 (0)
Ip: flags = 0x0 (0)
Ip: 0.. = [0] reserved
Ip: .0. = [0] DF: do not fragment: not set
Ip: ..0 = [0] MF: more fragments: not set
Ip: offset = 0
Ip: ttl = 100 [time to live]
Ip: type = 6 [next: Transmission Control]
Ip: checksum = 0x0 (0) [incorrect: 0xF91C]
Ip: source = 127.0.0.1
Ip: destination = 75.101.143.131
Ip:
Tcp: ******* Tcp offset=34 (0x22) length=20
Tcp:
Tcp: source = 2666
Tcp: destination = 80
Tcp: seq = 0x0 (0)
Tcp: ack = 0x0 (0)
Tcp: hlen = 5
Tcp: reserved = 0
Tcp: flags = 0x0 (0)
Tcp: 0... .... = [0] cwr: reduced (cwr)
Tcp: .0.. .... = [0] ece: ECN echo flag
Tcp: ..0. .... = [0] ack: urgent, out-of-band data
Tcp: ...0 .... = [0] ack: acknowledgment
Tcp: .... 0... = [0] ack: push current segment of data
Tcp: .... .0.. = [0] ack: reset connection
Tcp: .... ..0. = [0] ack: synchronize connection, startup
Tcp: .... ...0 = [0] fin: closing down connection
Tcp: window = 0
Tcp: checksum = 0x0 (0) [incorrect: 0xEE07]
Tcp: urgent = 0
Tcp:
Data: ******* Payload offset=54 (0x36) length=970
Data:
0036: 47 45 54 20 2f 20 48 54 54 50 2f 31 2e 31 0d 0a GET / HTTP/1.1..
0046: 48 6f 73 74 3a 20 74 65 73 74 2e 6d 79 73 65 72 Host: test.myser
0056: 76 65 72 2e 6e 65 74 0d 0a 55 73 65 72 2d 41 67 ver.net..User-Ag
0066: 65 6e 74 3a 20 4d 6f 7a 69 6c 6c 61 2f 35 2e 30 ent: Mozilla/5.0
0076: 20 28 57 69 6e 64 6f 77 73 20 4e 54 20 35 2e 31 (Windows NT 5.1
0086: 29 20 41 70 70 6c 65 57 65 62 4b 69 74 2f 35 33 ) AppleWebKit/53
0096: 37 2e 33 36 20 28 4b 48 54 4d 4c 2c 20 6c 69 6b 7.36 (KHTML, lik
00a6: 65 20 47 65 63 6b 6f 29 20 43 68 72 6f 6d 65 2f e Gecko) Chrome/
00b6: 32 38 2e 30 2e 31 35 30 30 2e 37 32 20 53 61 66 28.0.1500.72 Saf
00c6: 61 72 69 2f 35 33 37 2e 33 36 0d 0a 43 6f 6e 6e ari/537.36..Conn
00d6: 65 63 74 69 6f 6e 3a 20 4b 65 65 70 2d 41 6c 69 ection: Keep-Ali
00e6: 76 65 0d 0a 00 00 00 00 00 00 00 00 00 00 00 00 ve..............
00f6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0106: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0116: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0126: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0136: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0146: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0156: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0166: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0176: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0186: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0196: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
01a6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
01b6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
01c6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
01d6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
01e6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
01f6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0206: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0216: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0226: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0236: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0246: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0256: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0266: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0276: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0286: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0296: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
02a6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
02b6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
02c6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
02d6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
02e6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
02f6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0306: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0316: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0326: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0336: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0346: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0356: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0366: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0376: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0386: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0396: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
03a6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
03b6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
03c6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
03d6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
03e6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
03f6: 00 00 00 00 00 00 00 00 00 00 ..........

estou utilizando a última versão do wincap, conforme recomendado no site do jnetpcap.

Boa noite gambazinho.

Preciso de uma ajuda para rodar a biblioteca JNETPCAP no SO e como demonstra sua dificuldade você soube rodar a biblioteca normalmente.

Estou precisando de uma ajuda para esse sentido.
Será que você conseguiria me dar um “norte” de como fazer a lib rodar?

Obs.: Estou efetuado N testes que li no JNETPCAP.COM. Testei a lib tanto no Linux Ubuntu quanto no Windows 7 e não obtive sucesso em nenhum SO. Tanto um quanto outro apresentam o mesmo problema.

A saída do erro no netbeans é: run:
Erro: Não foi possível localizar nem carregar a classe principal =
Java Result: 1
CONSTRUÍDO COM SUCESSO (tempo total: 0 segundos)

Dois Links que segui de cabo a rabo e não funcionaram.
http://jnetpcap.com/compile/debian
http://jnetpcap.com/netbeans

Fico muito grato caso possa me ajudar.