What is data packet ? What is TCP Header? What is UDP Header?

folder as data packet

You guys all know that while we some data over # tcp /udp its cut down into packets.
And you can use this for Hacking, by capture data packets.

Now in UDP when (person1) send A video to (person2) then it will cut down video into many packets and it will number every packets for identification, then it will be sent to (person2), now (person2) will receive allpackets in diffirent forms like (3,4,5,2,1), he just have to arrange them according to the number(1,2,3,4,5) and video is ready to play.
.
Now in TCP, Both person must establish a connection between them, then (person1) send A video to (person2) then it will cut down video into many packets and send packets, one by one, [IF person1 SEND Packet1 then after confim by person2 that packet1 has been recived, then it will send packet2]
.
Now How can you Take advantage of this method for hacking ?
.
You can hack your victim if he/she is on same wifi network. You know While some one send data its strip into packets huh ?

Now you can make use of sniffing tool in kali linux or on windows use wireshark, and capture those data packets, (note: in https  or ssl website data encrypted so you cannot capture data, some software provide feature to strip form https to http ) if your firend open any website without https and login in that website, then while sending that data to isp you can capture it in between as a plain text. And you get his/her password.
.
TCP AND UDP HEADER

(Just Need to Understand basics only) So when a client/user request some data from a server/computer, the server breaks down the data in smaller parts which are called data packets.
.
Now we have to carry those packets, Headers come into play. A data packet has to carry some information which is necessary for the transmission and this information is what we call a Header.
.
§# TCP_HEADER

Each TCP header has 11 required fields totaling 20 bytes(160 bits) in size.
They can also optionally include an additional data section up to 40 bytes in size.
.
This is the layout of TCP headers:
.
1) Source TCP port number (2 bytes)
.
2) Destination TCP port number (2 bytes)
.
3) Sequence number (4 bytes)
.
4)Acknowledgment number (4 bytes)
.
5)TCP data offset (4 bits)
.
6)Reserved data (3 bits)
.
7)Control flags (up to 9 bits)
.
8)Window size (2 bytes)
.
9) TCP checksum(2 bytes)
.
10)Urgent pointer (2 bytes)
.
11)TCP optional data (0-40 bytes)
.
TCP inserts header fields into the message
stream in the order listed above.
.
§# UDP_HEADER

UDP Header Format

Because UDP is significantly more limited in capability than TCP, its headers are much
smaller.
A UDP header contains 8 bytes, divided into the following four required fields:
.
1) Source port number (2 bytes)
.
2) Destination port number (2 bytes)
.
3)Length of data (2 bytes)
.
4) UDP checksum (2 bytes)
.
5) UDP inserts header fields into its message stream in the order listed above.
.
6) Source and destination UDP port numbersare the communication endpoints for sending and receiving devices.
.
7)Thelength field in UDP represents the total size of each datagram including both
header and data. This field ranges in value from a minimum of 8 bytes (the required
header size) to sizes above 65,000 bytes.
.
8)Similar to TCP, a UDPchecksum allows receivers to cross-check incoming data for
any corrupted bits of the message.

TCP_3_WAY_HANDSHAKE or TCP_HANDSHAKE

A Three way handshake is a method used in a TCP/IP network to create a connection between a local host/client and server. It is a three-step method that requires both the client and server to exchange SYN and ACK (acknowledgment) packets before actual data communication begins.
A three-way handshake is also known as a TCP handshake.
.
The control bits are listed as follows:
.
URG: Urgent Pointer field significant
.
ACK: Acknowledgement field significant
.
PSH: Push Function
.
RST: Reset the connection
.
SYN: Synchronize sequence numbers
.
FIN: No more data from sender
.
HERE IS HOW 3 WAY HANDSHARE GOES.
.
1. Computer xyz sends a TCP data packet with SYN flag.
.
2. Computer abc receives the TCP data packet and by looking at SYN flag it finds out that xyz wants to connect.
.
3.Computer abc sends a TCP data packet with two flags, SYN and ACK.
.
4.Computer xyz receives the TCP data packet and with the SYN-ACK Flags it finds out that abc has confirmed the connection.
.
5. Computer xyz sends a TCP data packet with ACK Flag on it.
.
6.Computer abc receives the TCP data packet and by looking at the ACK flag it finds out xyz received its SYN-ACK Packet successfully.
.
7. TCP connection is established.
.
Now why need handshake ?

In order for the connection to work, each side needs to verify that it can send packets to the other side.The only way to be sure that you got a packet to the other side is by getting a packet from them that, would not have been sent unless the packet you sent got through. TCP essentially uses two kinds
of messages for this: SYN (to request proof that this packet got through) and ACK (which only gets sent after a SYN gets through, to prove that the SYN got through).
.
Some Examples:
TCP/IP protocols are used by Website like facebook, google etc. UDP protocols are used by VOIP(voice over internet protocol) video chat, like skype, imo etc

Post a Comment

0 Comments