Note that there are some explanatory texts on larger screens.

plurals
  1. PORetrieve ack after syn
    primarykey
    data
    text
    <p>I've coded a small tool which just throws a syn packet at any ip and port number you give it -- and when I popped up Wireshark, the sent packet appears fine, no errors or anything, it looks just like your typical TCP SYN packet.</p> <p>For some reason, the ACK isn't sent by the server. So, there's two problems; one, no ACK response. Two, I don't even know how to receive the ack response via my program (bind()?).</p> <p>I modified some code from a syn flooder I found online because it seemed like to me some script-kiddie code would be easy to follow, but I'm afraid it may be missing something, and may be the result of the server's ACK denial. The code has been modified so the syn request is sent from the legitimate IP address. The following code shows my ip+tcp headers:</p> <pre><code> iph-&gt;ihl = 5; iph-&gt;version = 4; iph-&gt;tos = 0; iph-&gt;tot_len = sizeof (struct ip) + sizeof (struct tcphdr); iph-&gt;id = htonl (54321); //Id of this packet iph-&gt;frag_off = 0; iph-&gt;ttl = 255; iph-&gt;protocol = 6; iph-&gt;check = 0; //Set to 0 before calculating checksum iph-&gt;saddr = 0; //Source ip filled in by kernel iph-&gt;daddr = sin.sin_addr.s_addr; //TCP Header tcph-&gt;source = htons (9999); tcph-&gt;dest = htons (atoi(argv[2])); tcph-&gt;seq = random (); // tcph-&gt;ack_seq = 0; tcph-&gt;doff = 5; /* first and only tcp segment */ tcph-&gt;syn = 1; tcph-&gt;window = htonl (65555); /* maximum allowed window size */ tcph-&gt;check = 0;/* if you set a checksum to zero, your kernel's IP stack should fill in the correct checksum during transmission */ tcph-&gt;urg_ptr = 0; //Now the IP checksum iph-&gt;check = csum ((unsigned short *) datagram, iph-&gt;tot_len &gt;&gt; 1); </code></pre> <p>So, I send that, no ack back. What am I missing?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload