Here's my code (I've posted it a few times already :) )
 
# Sending raw packets
 
seq = 2056759790;
 
data1 = "GET /cgi-bin/ph";
 
ip1 = forge_ip_packet (
 ip_hl:5,
 ip_v:4,
 ip_tos:0,
 ip_len:40,
 ip_id:99,
 ip_off:0,
 ip_ttl:200,
 ip_p:IPPROTO_TCP,
 ip_src:this_host()
 );
tcp1 = forge_tcp_packet (
 ip:ip1,
 th_sport:1234,
 th_dport:80,
 th_flags:TH_SYN,
 th_seq:seq,
 th_ack:0,
 th_x2:0, 
 th_off:5,
 th_win:2048,
 th_urp:0 
 th_sum:31302, 
 data:data1
 );
 
reply = send_packet(tcp1,pcap_active:TRUE);
 
==============================================
 
When I send this code, the packet is hand calculated, and works fine. If I take out that 'th_sum' state in the tcp packet, and allow nasl to calculate it, Ethereal reports incorrect checksum, and states what it should be.
 
Is there a problem with the checksum calculation?
 
 
Paul Bobby

Reply via email to