souleaper Newbie cheater
  Reputation: 0
  Joined: 08 Jul 2012 Posts: 24
 
  | 
		
			
				 Posted: Thu Aug 23, 2018 11:15 pm    Post subject: About calculating packet checksum | 
				       | 
			 
			
				
  | 
			 
			
				i am following a guide in 
 
securitynik  calculating-udp-checksum-with-taste-of_3 (since i can't post link)
 
 
50 C7 BF 65 B5 CA 70 F3 95 00 A0 AF 08 00 45 00 00 28 3F 1C 40 00 80 06 00 00 C0 A8 01 A3 D2 F2 F3 65 C2 00 1A 4C 9F 5E 98 B7 70 8A A9 B8 50 10 40 18 88 BE 00 00
 
 
This is my packet..
 
 
source Ip 192.168.1.163     1100 0000 1010 1000          C0 A8 
 
                            0000 0001 1010 0011                       01 A3
 
dest   IP 210.242.243.101   1101 0010 1111 0010          D2 F2                 
 
                            1111 0011 0110 0101                       F3 65              
 
 
TCP pro      0/6            0000 0000 0000 0110                00 06                        
 
 
Padding
 
Length                      0000 0000 0001 1110                  00 14                       
 
 
S-Port       49664          1100 0010 0000 0000               C2 00                         
 
 
D-Port       6732           0001 1010 0100 1100               1A 4C                        
 
 
Seq #        2673776823     1001 1111 0101 1110          9F 5E                   
 
                            1001 1000 1011 0111                      98 B7              
 
 
Ack #        1888135608     0111 0000 1000 1010          70 8A                   
 
                            1010 1001 1011 1000                     A9 B8                
 
 
Flag #                      0101 0000 0001 0000                 50 10                          
 
		  
 
Window #     16408          0100 0000 0001 1000          40 18                      
 
                                                     Sum:                 5 86 49     
 
                             Adding first byte:                           86 4E
 
                                          in Binary:               1000 0110 0100 1110
 
                                           Flip bit:                 0111 1001 1011 0001 
 
                                       My checksum is           79B1
 
                                            but the packet checksum is 88 BE
 
 
the only info i was not sure of is the padding length..  which it was not explained well.. My understanding is.. it is either 
 
 
by adding header length which in this case is 20 bytes + any payload bytes.. which there is none.. so 14 in hex is 20..  or maybe adding the flag number to it.. which 20 + 10 is 30.. i also tried that and the checksum doesn't match?
 
 
Is my math wrong? or logic wrong.. 
 
 
Thanks for your help..
 
 
Chelvan.
 | 
			 
		  |