Hi, Im trying to write a syn-scanner in perl and Im struck in not being able to get the return packet with syn-ack bits set from the destination host. The problem is Im getting a packet with source and destination IP as loop back address (127.0.0.1). and only the syn bit set. I dont know where I went wrong. I have generated the packet setting the syn_flag_bit=1. I have created two socket handles s_sock and r_sock for sending and recieving respectively with protocol number as 6 for both of them.
The send() command also works well and I get the number of bits sent (40 bytes, tcp and ip header together) as the return value. The segment looks like...
can u please tell me what is happening and why i get that return packet with loop back ip?+ ...... ..... .... send($s_sock,$packet,0,$dest); $read = new IO::Select(); $read->add($r_sock); ($return)=IO::Select->select($read,undef,undef,5); + if ($return) { recv($r_sock,$buff,256,0); ........ ..... ... }
thanks, Abaya.
Edited by Chady -- minor formatting and code tags.
In reply to perl network programming some problem in send and recv. by Abaya
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |