Search:  

 
 
   All ForumsHot TopicsGallery






how-to block ads


 
Forums » Up and Running » Security » Security » How To Remember Your TCP Flags
Uniqs:
676
Share Topic:
RSS topic:
toggle:
flat / full
normal / watch
Posting:
Post a:
Post a:
Found New Security Flaw in Cingular VM »
« ConsumerReports WebWatch poll results  

Daniel
Premium,MVM
join:2000-06-26
Pleasanton, CA
clubs:


2 edits

How To Remember Your TCP Flags

Many people are familiar with the concept of a mnemonic [nəˈmɑnɪk] -- a memory device that uses a phrase based on the first letter of words in a list. Perhaps the most popular of these in the field of networking is the one for the OSI Model. The mnemonic is:

All People Seem To Need Data Processing.

Well, for those that deal with TCP a lot, I thought it might be helpful to have a mnemonic for the TCP flags as well. What I've come up with is:

Unskilled Attackers Pester Real Security Folks

Unskilled = URG
Attackers = ACK
Pester = PSH
Real = RST
Security = SYN
Folks = FIN

The way this helps me the most is when isolating traffic to capture using Tcpdump. It's possible, for example, to capture only SYNs (new connection requests), only RSTs (immediate session teardowns), or any combination of the six flags really. As noted in my own little Tcpdump tutorial, you can capture these various flags like so:

Find all SYN packets
tcpdump 'tcp[13] & 2 != 0'

Find all RST packets
tcpdump 'tcp[13] & 4 != 0'

Find all ACK packets
tcpdump 'tcp[13] & 16 != 0'

Notice the SYN example has the number 2 in it, the RST the number 4, and the ACK the number 16. These numbers correspond to where the TCP flags fall on the binary scale. So when you write out:

U A P R S F

...that corresponds to:

32 16 8 4 2 1

So as you read the SYN capture (tcpdump 'tcp[13] & 2 != 0'), you're saying find the 13th byte in the TCP header, and only grab packets where the flag in the 2nd bit is not zero. Well if you go from right to left in the UAPRSF string, you see that the spot where 2 falls is where the S is, and that's how why you're capturing only SYN packets when you apply that filter.

Remembering these flags and how to isolate them can go a long way in helping low-level network troubleshooting/security work by isolating what it is you want to see and/or capture. And of course the more you can isolate what you want to see, the faster you can solve the problem. I encourage anyone not making use of this powerful feature already to go ahead and add it to their repertoire.
--
dmiessler.com - grep understanding knowledge

Daniel
Premium,MVM
join:2000-06-26
Pleasanton, CA
clubs:

Re: How To Remember Your TCP Flags

Here's a nice collection of filters:
»www.rdrs.net/document/src/tcpdump.filters
--
dmiessler.com - grep understanding knowledge

Da Geek Kid

join:2003-10-11
Mclean, VA
Just a quick update... the link to the filters is dead..
any updates on that...

TIA...

PetePuma
How many lumps do you want
Premium,MVM
join:2002-06-13
Arlington, VA

Re: How To Remember Your TCP Flags

»www.rdrs.net/document/tcpdump.filters

Da Geek Kid

join:2003-10-11
Mclean, VA
LOL ROF... Feel like an AR$$$ ...

"I shoulda thunk a DAT"

Thanks PetePuma See Profile
Forums » Up and Running » Security » SecurityFound New Security Flaw in Cingular VM »
« ConsumerReports WebWatch poll results  


Thursday, 10-Dec 17:10:21 Terms of Use | Privacy Policy | Hosting by www.nac.net - DSL,Hosting & Co-lo | feedback | contact
over 10 years online! © 1999-2009 dslreports.com.republican-creole
page compression OFF
Most commented news this week
· [200] Sprint Sued For Distracted Driving Death
· [131] AT&T Launching New 24 Mbps U-Verse Tier
· [85] AT&T Hints At Usage-Based iPhone Data Pricing
· [82] 3G Network Test Says AT&T Is Tops
· [72] Mediacom Unveils 105 Mbps Pricing
· [71] WPA Cracker: Test WPA-PSK Networks In 20 Minutes
· [66] Sprint Poised For A Turnaround?
· [51] The Future Of Wi-Fi Is Bright
· [50] Average American Consumes 34 Gigabytes Daily
· [47] Site Leaks Yahoo, Verizon Fed Data Share Pricing
Most people now reading
· [WIN7] Well, I was dumb, but do I have recourse? [Microsoft Help]
· New Mediacom Email [Mediacom]
· malware has been found hidden inside an Ubuntu screensaver [Security]
· Windows 7 boot manager editing questions [Microsoft Help]
· Connecting to Google Voice Via SIP [VOIP Tech Chat]
· Icecrown 5-man strats [World of Warcraft]
· IMG 1.7 (IMG Updates and Discussion) [Verizon FIOS TV]
· Lawyers Claim Palin Hack Suspect's PC Had Spyware [Security]
· 3.x Feral Druid - Bear Tanking Guide [World of Warcraft]
· New 5 mans full walk through [World of Warcraft]