Coding a SYN Scanner guide ( source included )

V13 v13 at it.teithe.gr
Fri Mar 30 02:05:42 EEST 2007


On Friday 30 March 2007 01:01, Giorgos Keramidas wrote:
> Το linux έχει αρκετά πιο "περίεργες" ιδέες για το networking.

  Gia na to doyme ligo mazi:

typedef u_int tcp_seq;

struct sniff_tcp {
        u_short th_sport;               /* source port */
        u_short th_dport;               /* destination port */
        tcp_seq th_seq;                 /* sequence number */
        tcp_seq th_ack;                 /* acknowledgement number */
        u_char  th_offx2;               /* data offset, rsvd */
        u_char  th_flags;
        u_short th_win;                 /* window */
        u_short th_sum;                 /* checksum */
        u_short th_urp;                 /* urgent pointer */
};

u_short: 16bit
tcp_seq: 32bit
u_char: 8bit

Ara exoyme:
th_sport: offset 0
th_dport: 2
th_seq: 4
th_ack: 8
th_offx2: 12
th_flags: 13
th_win: 14
th_sum: 16
th_urp: 18

  Sta prota 4 byte exei 2 16bitoys, opote einai 'packed' by default.
Sth synexeia exei 2 32bitoys, opote epeisis no prob..
sth synexeia exei 2 8bitoys kai enan 16bito
kai telos exei 2 16bitoys...

  Ola mia xara! Ola einai se sostes theseis mias kai den tygxanei na yparxei 
kapoio melos poy na ofeleitai apo peretero alignment... Epeisis, ayto paizei 
kai me 64bit mias kai exei metablites poy ksekinane sta offset 0, 8, 16...

  An pas sto /usr/src/linux/include/linux ths geitonias soy tha deis oti se 
kapoia merh, h packed xrhsimopoieitai (esto kai xoris logo)... Kai telos 
panton, 29.000.000 xristes toy linux[1] den mporei na min exoyn antimetopisei 
ayto to problima :-P

<<V13>>

[1] http://counter.li.org/




More information about the unix-admin-gr mailing list