Mostrar mensagens com a etiqueta ip packet. Mostrar todas as mensagens
Mostrar mensagens com a etiqueta ip packet. Mostrar todas as mensagens

domingo, 16 de novembro de 2008

Protocolos alem do 06 (TCP)

Aqui estão uma lista de protocolos alem do 06 só para matar a curiosidade.
E ... Estão em decimal por isso há que fazer contas... :)


0 HOPOPT, IPv6 Hop-by-Hop Option.RFC 1883
1 ICMP, Internet Control Message Protocol.RFC 792
2 IGAP, IGMP for user Authentication Protocol.IGMP, Internet Group Management Protocol.RGMP, Router-port Group Management Protocol.

3 GGP, Gateway to Gateway Protocol.

4 IP in IP encapsulation.

5 ST, Internet Stream Protocol.

6 TCP, Transmission Control Protocol.

7 UCL, CBT.

8 EGP, Exterior Gateway Protocol.

9 IGRP, Interior Gateway Routing Protocol.

10 BBN RCC Monitoring.

11 NVP, Network Voice Protocol.

12 PUP.

13 ARGUS.

14 EMCON, Emission Control Protocol.

15 XNET, Cross Net Debugger.

16 Chaos.

17 UDP, User Datagram Protocol.

18 TMux, Transport Multiplexing Protocol.

19 DCN Measurement Subsystems.

20 HMP, Host Monitoring Protocol.

21 Packet Radio Measurement.

22 XEROX NS IDP.

23 Trunk-1.

24 Trunk-2.

25 Leaf-1.

26 Leaf-2.

27 RDP, Reliable Data Protocol.

28 IRTP, Internet Reliable Transaction Protocol.

29 ISO Transport Protocol Class 4.

30 NETBLT, Network Block Transfer.

31 MFE Network Services Protocol.

32 MERIT Internodal Protocol.

33 DCCP, Datagram Congestion Control Protocol.

34 Third Party Connect Protocol.

35 IDPR, Inter-Domain Policy Routing Protocol.

36 XTP, Xpress Transfer Protocol.

37 Datagram Delivery Protocol.

38 IDPR, Control Message Transport Protocol.

39 TP++ Transport Protocol.

40 IL Transport Protocol.

41 IPv6 over IPv4.

42 SDRP, Source Demand Routing Protocol.

43 IPv6 Routing header.

44 IPv6 Fragment header.

45 IDRP, Inter-Domain Routing Protocol.

46 RSVP, Reservation Protocol.

47 GRE, General Routing Encapsulation.

48 DSR, Dynamic Source Routing Protocol.

49 BNA.

50 ESP, Encapsulating Security Payload.

51 AH, Authentication Header.

52 I-NLSP, Integrated Net Layer Security TUBA.

53 SWIPE, IP with Encryption.

54 NARP, NBMA Address Resolution Protocol.

55 Minimal Encapsulation Protocol.

56 TLSP, Transport Layer Security Protocol using Kryptonet key management.

57 SKIP.

58 ICMPv6, Internet Control Message Protocol for IPv6.MLD, Multicast Listener Discovery.

59 IPv6 No Next Header.

60 IPv6 Destination Options.

61 Any host internal protocol.

62 CFTP.

63 Any local network.

64 SATNET and Backroom EXPAK.

65 Kryptolan.

66 MIT Remote Virtual Disk Protocol.

67 Internet Pluribus Packet Core.

68 Any distributed file system.

69 SATNET Monitoring.

70 VISA Protocol.

71 Internet Packet Core Utility.

72 Computer Protocol Network Executive.

73 Computer Protocol Heart Beat.

74 Wang Span Network.

75 Packet Video Protocol.

76 Backroom SATNET Monitoring.

77 SUN ND PROTOCOL-Temporary.

78 WIDEBAND Monitoring.

79 WIDEBAND EXPAK.

80 ISO-IP.

81 VMTP, Versatile Message Transaction Protocol.

82 SECURE-VMTP

83 VINES.

84 TTP.

85 NSFNET-IGP.

86 Dissimilar Gateway Protocol.

87 TCF.

88 EIGRP.

89 OSPF, Open Shortest Path First Routing Protocol.MOSPF, Multicast Open Shortest Path First.

90 Sprite RPC Protocol.

91 Locus Address Resolution Protocol.

92 MTP, Multicast Transport Protocol.

93 AX.25.

94 IP-within-IP Encapsulation Protocol.

95 Mobile Internetworking Control Protocol.

96 Semaphore Communications Sec. Pro.

97 EtherIP.

98 Encapsulation Header.

99 Any private encryption scheme.

100 GMTP.

101 IFMP, Ipsilon Flow Management Protocol.

102 PNNI over IP.

103 PIM, Protocol Independent Multicast.

104 ARIS.

105 SCPS.

106 QNX.

107 Active Networks.

108 IPPCP, IP Payload Compression Protocol.

109 SNP, Sitara Networks Protocol.

110 Compaq Peer Protocol.

111 IPX in IP.

112 VRRP, Virtual Router Redundancy Protocol.

113 PGM, Pragmatic General Multicast.

114 any 0-hop protocol.

115 L2TP, Level 2 Tunneling Protocol.

116 DDX, D-II Data Exchange.

117 IATP, Interactive Agent Transfer Protocol.

118 ST, Schedule Transfer.

119 SRP, SpectraLink Radio Protocol.

120 UTI.
121 SMP, Simple Message Protocol.
122 SM.
123 PTP, Performance Transparency Protocol.
124 ISIS over IPv4.
125 FIRE.
126 CRTP, Combat Radio Transport Protocol.
127 CRUDP, Combat Radio User Datagram.
128 SSCOPMCE.

129 IPLT.

130 SPS, Secure Packet Shield.

131 PIPE, Private IP Encapsulation within IP.

132 SCTP, Stream Control Transmission Protocol.

133 Fibre Channel.

134 RSVP-E2E-IGNORE.

135 Mobility Header.

136 UDP-Lite, Lightweight User Datagram Protocol.

137 MPLS in IP.

138 MANET Protocols.

139 HIP, Host Identity Protocol.

140-252


253254
Experimentation and testing.

255
reserved.

Descodificar um Pacote TCP/IP (IP apenas)

Bem aqui fica uma informação de como descodificar um pacote TCP/IP.

Vamos imaginar que com um TCPDUMP temos um pacote capturado e queremos ler a sua informação...

Este é um exemplo de uma frame que navegava na rede em exadecimal.

00 4f 4e 0e b2 45 00 1a 80 d8 43 ef 08 00 45 00
00 28 5a b1 40 00 80 06 00 00 c0 a8 64 65 c0 a8
64 01 c0 43 1f 90 b0 d8 c2 30 ea 48 e1 3a 50 10
40 29 49 d2 00 00

Ora bem o inicio da frame indica-nos qual o MAC de Destino.

00 4f 4e 0e b2 45 00 1a 80 d8 43 ef 08 00 45 00
00 28 5a b1 40 00 80 06 00 00 c0 a8 64 65 c0 a8
64 01 c0 43 1f 90 b0 d8 c2 30 ea 48 e1 3a 50 10
40 29 49 d2 00 00

O segundo indica-nos qual o MAC de Origem

00 4f 4e 0e b2 45 00 1a 80 d8 43 ef 08 00 45 00
00 28 5a b1 40 00 80 06 00 00 c0 a8 64 65 c0 a8
64 01 c0 43 1f 90 b0 d8 c2 30 ea 48 e1 3a 50 10
40 29 49 d2 00 00

O proximo valor indica-nos o tipo de pacote que vai dentro da frame.
Neste caso 0x0800 que representa o IP.

00 4f 4e 0e b2 45 00 1a 80 d8 43 ef 08 00 45 00
00 28 5a b1 40 00 80 06 00 00 c0 a8 64 65 c0 a8
64 01 c0 43 1f 90 b0 d8 c2 30 ea 48 e1 3a 50 10
40 29 49 d2 00 00

Bem agora chegamos ao protocolo ip.
O protocolo ip é representado pelo conjunto em baixo indicado.

00 4f 4e 0e b2 45 00 1a 80 d8 43 ef 08 00 45 00
00 28 5a b1 40 00 80 06 00 00 c0 a8 64 65 c0 a8
64 01
c0 43 1f 90 b0 d8 c2 30 ea 48 e1 3a 50 10
40 29 49 d2 00 00

O primeiro valor deste conjunto exadecimal indica qual a versão de IP (versão 4).
00 4f 4e 0e b2 45 00 1a 80 d8 43 ef 08 00 45 000
00 28 5a b1 40 00 80 06 00 00 c0 a8 64 65 c0 a8
64 01 c0 43 1f 90 b0 d8 c2 30 ea 48 e1 3a 50 10
40 29 49 d2 00 00

O segundo caracter indica-nos qual o IHL. (Internet Header Lenght)
Que nos indica qual o tamanho do Header do Pacote IP. Significa também que é de 20bytes e é o valor minimo para um pacote IP.

00 4f 4e 0e b2 45 00 1a 80 d8 43 ef 08 00 45 00
00 28 5a b1 40 00 80 06 00 00 c0 a8 64 65 c0 a8
64 01 c0 43 1f 90 b0 d8 c2 30 ea 48 e1 3a 50 10
40 29 49 d2 00 00

O campo 00 logo de seguida é utilizado para serviços diferenciados ou como alguem lhe gosta de chamar tipo de serviços. RFC 1349... não vou falar muito deste hoje :)

Depois vem o tamanho do "datagram" que é de 0028 em exadecimal que transformado para decimal é de 40bits. (Podem usar a calculadora do windows para isto).

00 4f 4e 0e b2 45 00 1a 80 d8 43 ef 08 00 45 00
00 28 5a b1 40 00 80 06 00 00 c0 a8 64 65 c0 a8
64 01 c0 43 1f 90 b0 d8 c2 30 ea 48 e1 3a 50 10
40 29 49 d2 00 00

A identificação é indicada por 5a b1 logo no conjunto seguinte. É usado para distinguir um datagram de outro.

Depois vem o indicador de "flags" o :
00 4f 4e 0e b2 45 00 1a 80 d8 43 ef 08 00 45 00
00 28 5a b1 40 00 80 06 00 00 c0 a8 64 65 c0 a8
64 01 c0 43 1f 90 b0 d8 c2 30 ea 48 e1 3a 50 10
40 29 49 d2 00 00

é utilizado para a fragmentação dos pacotes.

Agora vem o tempo de vida do datagram.
Neste caso é:

00 4f 4e 0e b2 45 00 1a 80 d8 43 ef 08 00 45 00
00 28 5a b1 40 00 80 06 00 00 c0 a8 64 65 c0 a8
64 01 c0 43 1f 90 b0 d8 c2 30 ea 48 e1 3a 50 10
40 29 49 d2 00 00
E quanto é 80 de hexa para decimal?
é 128...
Quando este valor chega a zero é descartado.

Depois vem o TCP Ou pelo menos o indicador que dentro do ip vem o protocolo TCP...

00 4f 4e 0e b2 45 00 1a 80 d8 43 ef 08 00 45 00
00 28 5a b1 40 00 80 06 00 00 c0 a8 64 65 c0 a8
64 01 c0 43 1f 90 b0 d8 c2 30 ea 48 e1 3a 50 10
40 29 49 d2 00 00

Quase no fim vem o headerCheck Sum que é representado pelos seguintes numeros:
00 00 logo a seguir ao protocolo.

E por fim o que nos faltava para isto ser válido o ip de origem.... Que é
00 4f 4e 0e b2 45 00 1a 80 d8 43 ef 08 00 45 00
00 28 5a b1 40 00 80 06 00 00 c0 a8 64 65 c0 a8
64 01 c0 43 1f 90 b0 d8 c2 30 ea 48 e1 3a 50 10
40 29 49 d2 00 00

que fazendo as contas em decimal é de 192.168.100.101

e o ip de Destino que fazendo as contas é o 192.168.100.1
00 4f 4e 0e b2 45 00 1a 80 d8 43 ef 08 00 45 00
00 28 5a b1 40 00 80 06 00 00 c0 a8 64 65 c0 a8
64 01
c0 43 1f 90 b0 d8 c2 30 ea 48 e1 3a 50 10
40 29 49 d2 00 00

E acabamos a parte do IP num proximo post vem a parte do TCP que são o resto dos numeros hexadecimais que faltam analizar.

00 4f 4e 0e b2 45 00 1a 80 d8 43 ef 08 00 45 00
00 28 5a b1 40 00 80 06 00 00 c0 a8 64 65 c0 a8
64 01 c0 43 1f 90 b0 d8 c2 30 ea 48 e1 3a 50 10
40 29 49 d2 00 00