Pfft.. I got TCP/IP Down. SYN, SYN ACK, ACK… EASY!

Posted by Eric | General, on the wire | Friday 16 May 2008 4:38 pm

<meta name="GENERATOR" content="OpenOffice.org 2.0 (Linux)" /><meta name="CREATED" content="20080516;9570800" /><meta name="CHANGED" content="20080516;10252800" /><br /> <style> <!-- @page { size: 8.5in 11in; margin: 0.79in } P { margin-bottom: 0.08in } --> </style> <p style="margin-bottom: 0in">Roughly 6 months ago when I started a new position at my current company I was asked if I knew TCP/IP and OS Fingerprinting. I was quick to snap back “Sure, I was doing pen testing for 3 years before this I got that down.” I tell ya what, I couldn’t have been more naive in that answer. My actual understanding of TCP/IP and OS Fingerprinting was sub par but I had no idea. Grasping those basics of SYN – SYN ACK – ACK was lame, as was running Nmap, xprobe, or any other automated fingerprinting utility. Granted the knowledge I obtained from my last position doing pen testing helped me quite a bit in some of the stuff I’m doing these day’s. The bottom line however was, I didn’t know jACK!</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">Either way, in the last 6 months I’ve read RFC 793[1] and RFC 1180[2] about 10 times, RFC 1323 [3] about 4 times, and multiple other TCP / IP related RFC’s. I’ve read the TCP/IP Illustrated a few times over as well. Each time I grasp a little more. At this point I think I have a fairly good understanding of TCP/IP and a hell of a lot more knowledge on Nmap OS Fingerprints. After all, at this point I’ve read all of Fyoders old Phrack Articles, and can interpret an Nmap OS signature output and tell you what all the stuff means.</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">I’ve been absent from the blog over the last month because I’ve been fairly busy doing research into the internals of the BSD Operating System and Mac OSX, Embedded systems programming, debugging and analysis research, and learning the Instruction set for Power PC. If that weren’t enough, I also started up a new side company for personal finance, i’ve been trying to drive traffic towards that as well as write articles. If that wasn’t enough I also started back up on my graduate degree since I’m so close to the finish line. Which is where this post comes into play.</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">Last evening we were having a lecture about Authentication Mechanisms in Wireless networks, one thing I really enjoy about this class is it’s divergence from the normal curriculum my college seems to have which is either material from the prehistoric Internet ages, or it’s solid theory. No this course is different in the sense that it drives down into the RFC’s. So as the professor was lecturing I began wondering how many vendors had bad implementations of authentication protocols. Last year there was a lot of kernel vulnerabilities that came out in client side wireless drivers but I didn’t recall seeing too many from the Access Point, point of view. I started researching into a little and found there was a few things done but nothing that I saw having to do with the Protocols I wanted to test vendor implementations on. The Next step was Packet crafting. Despite how many pursuits I have going I’m actually pretty lazy and I’m not about reinventing wheels. Talking with Tebo he recalled Scapy[4] having some type of implementation for the protocol I was curious about. Running over and getting a feel for it… SCAPY KICKS ASS! You could really do some hard core OS Fingerprinting with this, Fuzzing, you name it!</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">>>> ls()</p> <p style="margin-bottom: 0in">ARP : ARP</p> <p style="margin-bottom: 0in">ASN1_Packet : None</p> <p style="margin-bottom: 0in">BOOTP : BOOTP</p> <p style="margin-bottom: 0in">CookedLinux : cooked linux</p> <p style="margin-bottom: 0in">DHCP : DHCP options</p> <p style="margin-bottom: 0in">DNS : DNS</p> <p style="margin-bottom: 0in">DNSQR : DNS Question Record</p> <p style="margin-bottom: 0in">DNSRR : DNS Resource Record</p> <p style="margin-bottom: 0in">Dot11 : 802.11</p> <p style="margin-bottom: 0in">Dot11ATIM : 802.11 ATIM</p> <p style="margin-bottom: 0in">Dot11AssoReq : 802.11 Association Request</p> <p style="margin-bottom: 0in">Dot11AssoResp : 802.11 Association Response</p> <p style="margin-bottom: 0in">Dot11Auth : 802.11 Authentication</p> <p style="margin-bottom: 0in">Dot11Beacon : 802.11 Beacon</p> <p style="margin-bottom: 0in">Dot11Deauth : 802.11 Deauthentication</p> <p style="margin-bottom: 0in">Dot11Disas : 802.11 Disassociation</p> <p style="margin-bottom: 0in">Dot11Elt : 802.11 Information Element</p> <p style="margin-bottom: 0in">Dot11ProbeReq : 802.11 Probe Request</p> <p style="margin-bottom: 0in">Dot11ProbeResp : 802.11 Probe Response</p> <p style="margin-bottom: 0in">Dot11QoS : 802.11 QoS</p> <p style="margin-bottom: 0in">Dot11ReassoReq : 802.11 Reassociation Request</p> <p style="margin-bottom: 0in">Dot11ReassoResp : 802.11 Reassociation Response</p> <p style="margin-bottom: 0in">Dot11WEP : 802.11 WEP packet</p> <p style="margin-bottom: 0in">Dot1Q : 802.1Q</p> <p style="margin-bottom: 0in">Dot3 : 802.3</p> <p style="margin-bottom: 0in">EAP : EAP</p> <p style="margin-bottom: 0in">EAPOL : EAPOL</p> <p style="margin-bottom: 0in">Ether : Ethernet</p> <p style="margin-bottom: 0in">GPRS : GPRSdummy</p> <p style="margin-bottom: 0in">GRE : GRE</p> <p style="margin-bottom: 0in">HCI_ACL_Hdr : HCI ACL header</p> <p style="margin-bottom: 0in">HCI_Hdr : HCI header</p> <p style="margin-bottom: 0in">HDLC : None</p> <p style="margin-bottom: 0in">HSRP : HSRP</p> <p style="margin-bottom: 0in">ICMP : ICMP</p> <p style="margin-bottom: 0in">ICMPerror : ICMP in ICMP</p> <p style="margin-bottom: 0in">IP : IP</p> <p style="margin-bottom: 0in">IPerror : IP in ICMP</p> <p style="margin-bottom: 0in">IPv6 : IPv6 not implemented here.</p> <p style="margin-bottom: 0in">ISAKMP : ISAKMP</p> <p style="margin-bottom: 0in">ISAKMP_class : None</p> <p style="margin-bottom: 0in">ISAKMP_payload : ISAKMP payload</p> <p style="margin-bottom: 0in">ISAKMP_payload_Hash : ISAKMP Hash</p> <p style="margin-bottom: 0in">ISAKMP_payload_ID : ISAKMP Identification</p> <p style="margin-bottom: 0in">ISAKMP_payload_KE : ISAKMP Key Exchange</p> <p style="margin-bottom: 0in">ISAKMP_payload_Nonce : ISAKMP Nonce</p> <p style="margin-bottom: 0in">ISAKMP_payload_Proposal : IKE proposal</p> <p style="margin-bottom: 0in">ISAKMP_payload_SA : ISAKMP SA</p> <p style="margin-bottom: 0in">ISAKMP_payload_Transform : IKE Transform</p> <p style="margin-bottom: 0in">ISAKMP_payload_VendorID : ISAKMP Vendor ID</p> <p style="margin-bottom: 0in">IrLAPCommand : IrDA Link Access Protocol Command</p> <p style="margin-bottom: 0in">IrLAPHead : IrDA Link Access Protocol Header</p> <p style="margin-bottom: 0in">IrLMP : IrDA Link Management Protocol</p> <p style="margin-bottom: 0in">L2CAP_CmdHdr : L2CAP command header</p> <p style="margin-bottom: 0in">L2CAP_CmdRej : L2CAP Command Rej</p> <p style="margin-bottom: 0in">L2CAP_ConfReq : L2CAP Conf Req</p> <p style="margin-bottom: 0in">L2CAP_ConfResp : L2CAP Conf Resp</p> <p style="margin-bottom: 0in">L2CAP_ConnReq : L2CAP Conn Req</p> <p style="margin-bottom: 0in">L2CAP_ConnResp : L2CAP Conn Resp</p> <p style="margin-bottom: 0in">L2CAP_DisconnReq : L2CAP Disconn Req</p> <p style="margin-bottom: 0in">L2CAP_DisconnResp : L2CAP Disconn Resp</p> <p style="margin-bottom: 0in">L2CAP_Hdr : L2CAP header</p> <p style="margin-bottom: 0in">L2CAP_InfoReq : L2CAP Info Req</p> <p style="margin-bottom: 0in">L2CAP_InfoResp : L2CAP Info Resp</p> <p style="margin-bottom: 0in">L2TP : None</p> <p style="margin-bottom: 0in">LLC : LLC</p> <p style="margin-bottom: 0in">MGCP : MGCP</p> <p style="margin-bottom: 0in">MobileIP : Mobile IP (RFC3344)</p> <p style="margin-bottom: 0in">MobileIPRRP : Mobile IP Registration Reply (RFC3344)</p> <p style="margin-bottom: 0in">MobileIPRRQ : Mobile IP Registration Request (RFC3344)</p> <p style="margin-bottom: 0in">MobileIPTunnelData : Mobile IP Tunnel Data Message (RFC3519)</p> <p style="margin-bottom: 0in">NBNSNodeStatusResponse : NBNS Node Status Response</p> <p style="margin-bottom: 0in">NBNSNodeStatusResponseEnd : NBNS Node Status Response</p> <p style="margin-bottom: 0in">NBNSNodeStatusResponseService : NBNS Node Status Response Service</p> <p style="margin-bottom: 0in">NBNSQueryRequest : NBNS query request</p> <p style="margin-bottom: 0in">NBNSQueryResponse : NBNS query response</p> <p style="margin-bottom: 0in">NBNSQueryResponseNegative : NBNS query response (negative)</p> <p style="margin-bottom: 0in">NBNSRequest : NBNS request</p> <p style="margin-bottom: 0in">NBNSWackResponse : NBNS Wait for Acknowledgement Response</p> <p style="margin-bottom: 0in">NBTDatagram : NBT Datagram Packet</p> <p style="margin-bottom: 0in">NBTSession : NBT Session Packet</p> <p style="margin-bottom: 0in">NTP : NTP</p> <p style="margin-bottom: 0in">NetBIOS_DS : NetBIOS datagram service</p> <p style="margin-bottom: 0in">NetflowHeader : Netflow Header</p> <p style="margin-bottom: 0in">NetflowHeaderV1 : Netflow Header V1</p> <p style="margin-bottom: 0in">NetflowRecordV1 : Netflow Record</p> <p style="margin-bottom: 0in">NoPayload : None</p> <p style="margin-bottom: 0in">PPP : PPP Link Layer</p> <p style="margin-bottom: 0in">PPP_ECP : None</p> <p style="margin-bottom: 0in">PPP_ECP_Option : PPP ECP Option</p> <p style="margin-bottom: 0in">PPP_IPCP : None</p> <p style="margin-bottom: 0in">PPP_IPCP_Option : PPP IPCP Option</p> <p style="margin-bottom: 0in">PPPoE : PPP over Ethernet</p> <p style="margin-bottom: 0in">PPPoED : PPP over Ethernet Discovery</p> <p style="margin-bottom: 0in">Packet : None</p> <p style="margin-bottom: 0in">Padding : Padding</p> <p style="margin-bottom: 0in">PrismHeader : Prism header</p> <p style="margin-bottom: 0in">RIP : RIP header</p> <p style="margin-bottom: 0in">RIPEntry : RIP entry</p> <p style="margin-bottom: 0in">RTP : RTP</p> <p style="margin-bottom: 0in">RadioTap : RadioTap dummy</p> <p style="margin-bottom: 0in">Radius : Radius</p> <p style="margin-bottom: 0in">Raw : Raw</p> <p style="margin-bottom: 0in">SMBMailSlot : SMB Mail Slot Protocol</p> <p style="margin-bottom: 0in">SMBNegociate_Protocol_Request_Header : SMBNegociate Protocol Request Header</p> <p style="margin-bottom: 0in">SMBNegociate_Protocol_Request_Tail : SMB Negociate Protocol Request Tail</p> <p style="margin-bottom: 0in">SMBNegociate_Protocol_Response_Advanced_Security : SMBNegociate Protocol Response Advanced Security</p> <p style="margin-bottom: 0in">SMBNegociate_Protocol_Response_No_Security : SMBNegociate Protocol Response No Security</p> <p style="margin-bottom: 0in">SMBNegociate_Protocol_Response_No_Security_No_Key : None</p> <p style="margin-bottom: 0in">SMBNetlogon_Protocol_Response_Header : SMBNetlogon Protocol Response Header</p> <p style="margin-bottom: 0in">SMBNetlogon_Protocol_Response_Tail_LM20 : SMB Netlogon Protocol Response Tail LM20</p> <p style="margin-bottom: 0in">SMBNetlogon_Protocol_Response_Tail_SAM : SMB Netlogon Protocol Response Tail SAM</p> <p style="margin-bottom: 0in">SMBSession_Setup_AndX_Request : Session Setup AndX Request</p> <p style="margin-bottom: 0in">SMBSession_Setup_AndX_Response : Session Setup AndX Response</p> <p style="margin-bottom: 0in">SNAP : SNAP</p> <p style="margin-bottom: 0in">SNMP : None</p> <p style="margin-bottom: 0in">SNMPbulk : None</p> <p style="margin-bottom: 0in">SNMPget : None</p> <p style="margin-bottom: 0in">SNMPinform : None</p> <p style="margin-bottom: 0in">SNMPnext : None</p> <p style="margin-bottom: 0in">SNMPresponse : None</p> <p style="margin-bottom: 0in">SNMPset : None</p> <p style="margin-bottom: 0in">SNMPtrapv1 : None</p> <p style="margin-bottom: 0in">SNMPtrapv2 : None</p> <p style="margin-bottom: 0in">SNMPvarbind : None</p> <p style="margin-bottom: 0in">STP : Spanning Tree Protocol</p> <p style="margin-bottom: 0in">SebekHead : Sebek header</p> <p style="margin-bottom: 0in">SebekV1 : Sebek v1</p> <p style="margin-bottom: 0in">SebekV2 : Sebek v3</p> <p style="margin-bottom: 0in">SebekV2Sock : Sebek v2 socket</p> <p style="margin-bottom: 0in">SebekV3 : Sebek v3</p> <p style="margin-bottom: 0in">SebekV3Sock : Sebek v2 socket</p> <p style="margin-bottom: 0in">Skinny : Skinny</p> <p style="margin-bottom: 0in">TCP : TCP</p> <p style="margin-bottom: 0in">TCPerror : TCP in ICMP</p> <p style="margin-bottom: 0in">TFTP : TFTP opcode</p> <p style="margin-bottom: 0in">TFTP_ACK : TFTP Ack</p> <p style="margin-bottom: 0in">TFTP_DATA : TFTP Data</p> <p style="margin-bottom: 0in">TFTP_ERROR : TFTP Error</p> <p style="margin-bottom: 0in">TFTP_OACK : TFTP Option Ack</p> <p style="margin-bottom: 0in">TFTP_Option : None</p> <p style="margin-bottom: 0in">TFTP_Options : None</p> <p style="margin-bottom: 0in">TFTP_RRQ : TFTP Read Request</p> <p style="margin-bottom: 0in">TFTP_WRQ : TFTP Write Request</p> <p style="margin-bottom: 0in">UDP : UDP</p> <p style="margin-bottom: 0in">UDPerror : UDP in ICMP</p> <p style="margin-bottom: 0in">X509Cert : None</p> <p style="margin-bottom: 0in">X509RDN : None</p> <p style="margin-bottom: 0in">X509v3Ext : None</p> <p style="margin-bottom: 0in">_IPv6OptionHeader : IPv6 not implemented here.</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">I’ve been playing with it a little today doing some packet manipulation but I can’t wait to take it for a drive with some protocol fuzzing for some of the wireless stuff. I did notice there are a few people out there that have existing fuzz scripts that use scapy, but I couldn’t seem to locate them. Anyway, its a far better learning experience when you play with it yourself versus using someone else’s scripts / fuzzers.</p> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in"> <p style="margin-bottom: 0in">[1] – <a href="http://www.faqs.org/rfcs/rfc793.html">http://www.faqs.org/rfcs/rfc793.html</a></p> <p style="margin-bottom: 0in">[2] – <a href="http://www.faqs.org/rfcs/rfc1180.html">http://www.faqs.org/rfcs/rfc1180.html</a></p> <p style="margin-bottom: 0in">[3] – http://tools.ietf.org/html/rfc1323</p> <p style="margin-bottom: 0in">[4] – http://www.secdev.org/projects/scapy/</p> </div> <div class="feedback"> <a href="http://hamsterswheel.com/techblog/?p=66#comments" title="Comment on Pfft.. I got TCP/IP Down. SYN, SYN ACK, ACK… EASY!">Comments (1)</a> </div> </div> </div> <div id="footer"> © Copyright 2009 | <a href="http://hamsterswheel.com/techblog">Phn1x – Hamsterswheel</a> | Theme by <a href="http://clubparexcellancetech.com/">Club Par Excellance</a> | All Rights Reserved | Sponsored by <a href="http://www.voipkit.ca/">VoIP</a> </div> </body> </html>