http://conference.hackinthebox.org/hitbsecconf2010kul/



hackinthebox
 ::  hitb portal  ::  hitb portal (SSL)  ::  hitb forum (SSL)  ::  hitb security conference  ::  hitb training ::  hitb irc  ::  hitb photos  ::  hitb videos :: 
Who's Online
There are 207 unregistered users and 0 registered users on-line.

You can log-in or register for a user account here.



Main Menu

Top Stories for Today
[411] How to Design a Secure DMZ
[400] German ID cards hacked by the CCC
[355] Malware hosted on Google Code project site
[251] Apple's elephant in the cloud
[227] Algerian Hackers Attack Wrong Website
[226] Russian cops cuff 10 ransomware Trojan suspects
[209] How Google attacks changed the security game
[197] Feds crack phone clone scam that cost Sprint $15m
[197] PSJailbreak code leaked online
[189] How Your Cloud Dream Is Becoming a Security Nightmare
[189] Heartland to pay Discover $5M for 2008 data breach
[187] Apple's iOS 4.1 ships Sept. 8
[181] US undergrads crash NASA satellite into Arctic
[180] Malaysian National Institute of Public Administration suffers cyber attack
[160] DARPA launches insider threat detection effort for military
[143] China demands real names from mobile phone users
[137] VMWare Sees Big Business In Becoming The Internet Operating System
[125] Windows Phone 7: Done

View the Top 50 articles

Top 20 of the Last 2 Weeks

Past Articles
Wednesday, September 01
·Moscow police investigate alleged ransomware gang
·Novell rolls cloud-security service
·More IT managers plan to spend less, survey finds
·Twitter Turns to OAuth for Application Authentication
·Verizon Uses VMware for Enterprise Cloud Service
·Five Things You Need To Know About IPv6
·iPhone 4 with New Antenna Coming Soon?
·Mark Zuckerberg fights to keep life private
·Android Tablet flood is imminent
·Hackers Steal $600,000 from Catholic Diocese
·Pirate Bay secures documentary funding from fans in just 3 days
·Darpa’s Star Hacker Looks to WikiLeak-Proof Pentagon
·Hackers Focus on Misconfigured Networks, Survey Finds
·Australian ban on PS3 hack extended to September 3
·Apple to offer live video stream of Wednesday's keynote
·US finally reforming its high-tech export control system
Tuesday, August 31
·Wikileaks moves servers to an underground nuclear bunker
·Indian e-voting critic released on bail
·Skype might be bought by Cisco
·Commonwealth Bank of Australia security upgrade causes ATM outage
·Google aims to wipe smile off Facebook
·Will Intel's Sandy Bridge pose a threat to discrete GPUs?
·3M to buy security firm Cogent for $943 million
·Microsoft to build giant data center
·Apple still hasn't fixed iPhone 4 proximity sensor bug
·7 skills every IT manager needs to survive the 2010s
·Intel buys wireless chip tech in mobile-phone push
·Hackers Port Android to Nokia Phones
·Old Apple QuickTime code puts IE users in harm's way
·India Could Face Onslaught of Pakistani Hackers, Say Intelligence Officials
 Older articles

MAC Addressing and ARP Functionality
Posted by L33tdawg on Wednesday, October 09, 2002 - 09:54 AM (Reads: 59822)
Source:



By: Resolution Note: This article first appeared over at our affiliates site Security-Protocols. The original article can be found here.



The Media Access Control (MAC) address, also known as an Ethernet address, is the physical/hardware address for devices that are connected to a network, usually a LAN. Each node connected to the network has it’s own unique MAC address hard coded (burned) into its Network Interface Card (NIC) by the manufacturer and uses this address to find and communicate with other devices on the same network domain or wire.

The MAC address is stored in the Serial EEPROM of the Ethernet card. In addition to holding the MAC address, the EEPROM stores a backup copy of the MAC address and ID information, user configurable parameters, serial numbers for devices, checksums, type of interphase, and other bits of backed up information.


The MAC address is part of the Data-Link layer of the Open Systems 
Interconnection (OSI) model, which is a telecommunications standard issued by 
the Institute of Electrical and Electronics Engineers (IEEE). The Data-Link 
layer is part of layer 2 of the OSI model and serves the purpose of error 
detection and notification, dividing data into frames, adding headers to the 
frames, and ensuring that incoming data has been received successfully.
The format for a MAC address is a 6-byte (octet) hardware address consisting of 
12 hexadecimal numbers, which also consist of units of 4 bits separated by a 
semicolon, period, or hyphen (on some occasions none). An example would be 
00:04:9B:E9:C4:A8 or 00.04.9B.E9.C4.A8, or 00-04-9B-E9-C4-A8. The numbers may 
range from 0-9 and the letters may range from A-F (letter casing does not 
matter). The first 3 bytes (00:04:9B) of the MAC address are called the (OUI) or 
Organizationally Unique Identifier. The OUI identifies the name of the 
manufacturer and the last 3 bytes (E9:C4:A8) is a unique ID serial number 
provided by the manufacturer, which are assigned and administered by the IEEE. 
For this example MAC address, the vendor is Cisco Systems, Inc. You can find out 
the vendor for any MAC address by visiting http://standards.ieee.org/regauth/oui/index.shtml. 
Here you will find that the IEEE has set up a publicly accessible vendor search 
form for MAC OUIs. If you add the OUI of the example MAC address (00049B without 
the semicolons) in the search field on that link, the output should be… 

00-04-9B (hex)              Cisco Systems, Inc. 
00049B    (base 16)            Cisco Systems,Inc.                               
                         170 West Tasman Dr. 
                              San Jose CA 95134 
                             UNITED STATES 


There are many ways to find out the MAC address of your system if you are 
connected to an Ethernet card. The address is normally printed on the card 
itself somewhere but an easier way to find out is right from your computer’s GUI 
or shell prompt. On some systems there is more than one command to do this. 
Commands to look up your MAC address, however, vary from system to system so a 
number of different operating systems and their commands will be provided. 

Operating System        Commands To Enter At The Command/Shell Prompt 

1. Windows 95             Start, Run, then type WINIPCFG. In the pull-down 
                        box do not choose PPP Adapter. Choose your Ethernet 
                        adapter and your MAC address will be your Adapter 
                        Address.                                         
                                                 
2. Windows (all)        ipconfig /all (located next to Physical Address) 

3. Linux                ifconfig –a (located next to Hwaddr) 

4. SunOS/Solaris        ifconfig –a (leading zeros on MAC are not printed) 

5. HP-UX                lanscan (located under Address without semicolons) 

6. Free/Open/NetBSD     netstat –i (located under Address) 



Remember, if these commands do not work for your system for whatever reason, you 
can always look on the Ethernet card itself for the MAC address. 

As stated earlier, one of the main uses for the MAC address is to uniquely 
identify a device that is connected to a local area network. When one computer 
wishes to connect to another computer on the same network, a protocol called the 
Address Resolution Protocol (ARP) is used to map network IP addresses to MAC 
addresses. 

If a source computer wishes to send an IP packet to another computer on the same 
LAN, already knowing the destination computer’s IP address, it must first find 
out the destination computer’s MAC address. To do this, the source computer will 
check and see if it already has a mapping of the destination computer’s MAC 
address already located within its ARP cache. The ARP cache holds mappings of IP 
addresses and MAC addresses of computers on the source computer’s subnet. The 
command to find the subnet on Windows and *nix computers is “arp –a”. Here is an 
example of an arp cache when viewed from a DOS Prompt… 

C:WINDOWS>arp -a 

Interface: 68.11.226.140 on Interface 0x2000003 
Internet Address     Physical Address     Type 
68.11.226.129         00-04-9b-e9-c4-a8     dynamic 

To add to this cache we would have to attempt to send a packet to a computer on 
the same subnet as the source computer. The subnet for this computer would be 
68.11.226.255. So any computer with the last octets being 1-254 on the subnet 
68.11.226 would be temporarily added to the source computer’s ARP cache. To test 
this we can ping a computer on the subnet to see if its IP and MAC address get 
added to the ARP cache. So if we ping, for instance, 68.11.226.145, it will add 
a mapping of that computer’s IP and MAC address to the ARP cache. Now that we 
have pinged the address we can now check the ARP cache again. 

C:WINDOWS>arp -a 

Interface: 68.11.226.140 on Interface 0x2000003 
Internet Address     Physical Address     Type 
68.11.226.129         00-04-9b-e9-c4-a8     dynamic 
68.11.226.145         00-04-5a-f5-d3-f7     dynamic 

As you can see, since both computers are on the same subnet, the source computer 
added the destination computer’s IP and MAC address to its ARP cache. Pinging 
68.11.226.150 then pinging 68.11.226.151 will add their entries to the ARP cache 
as well. To check and see issue the arp –a command again… 

C:WINDOWS>arp -a 

Interface: 68.11.226.140 on Interface 0x2000003 
Internet Address     Physical Address     Type 
68.11.226.129         00-04-9b-e9-c4-a8     dynamic 
68.11.226.145         00-04-5a-f5-d3-f7     dynamic 
68.11.226.150         00-10-60-c1-4a-ff     dynamic 
68.11.226.151         00-e0-29-9f-37-3e     dynamic 

Again, the IP and MAC addresses of the two pinged addresses were added to the 
ARP cache. These dynamic entries are only temporary and have a set “time to 
live” (TTL) period before they are erased (timeout). The TTL period varies from 
system to system, usually from 2 to 20 minutes, and will increase to a greater 
number of minutes if more data from these temporary entries is requested within 
the allotted TTL period. The TTL period for Windows NT has a default of two 
minutes, Windows 2000 has a default of 10 minutes, and Solaris has a default of 
5 minutes. ARP caches of routers can be much longer which is the case with the 
Cisco IOS router having a cache time of 4 hours. For some computers, entries 
that are static usually remain on the cache table permanently or until the 
computer is rebooted. The TTL periods can be adjusted on most systems as well.


For security consciousness on networks, it would be best to set your ARP caches 
on your switches to hold static entries. However, not all that convenient for a 
LAN administrator, this will prevent ARP spoofing, (an intruder sending spoofed 
ARP packets to Host A and Host B so that the two hosts will think the intruder’s 
computer is the intended host/router and send their data traffic through the 
intruder’s host to allow sniffing and packet manipulation/editing) also called 
man-in-the-middle attacks, since static ARP tables cannot be updated, hence, 
making the use of spoofed arp packets useless. 

The usefulness of the ARP cache comes into play when it is shown how two hosts 
send packets back and forth to one another on a LAN. If a source computer, on a 
LAN, with the IP address of 10.23.34.5 wishes to send data to the destination 
computer with an IP of 10.23.34.99 on the same local network, the source 
computer will first check its ARP cache to see if it has a mapping of the 
destination computer’s MAC address. If no mapping of the address is found in the 
computer’s cache, the source computer will then attempt to send a broadcast ARP 
request, with the destination IP attached to it, to all hosts on the local 
network. This ARP request is seen by all the hosts on the LAN and allows them to 
cross-reference the destination IP with entries found in their ARP cache. If the 
IP address of the destination computer does not match the IP address located in 
the ARP cache of the intended remote host, then the ARP request is discarded. If 
the IP matches the IP of a host on the network, then the destination host has 
been found and it will add the IP and MAC address of the source computer to its 
ARP cache and send the source computer back an ARP reply containing the MAC 
address of the destination computer. Once the source computer receives the ARP 
reply, it will then add the destination computer’s IP and MAC address to its ARP 
cache. Now that the source computer knows the IP and the MAC address of the 
destination computer and vice versa, the two hosts will now be able to 
participate using the IP protocol method of transfer. Since both hosts have one 
another’s IP and MAC addresses in their ARP caches, the next time one of these 
systems need to send data, it will simply search its own ARP cache for the 
necessary information on the other host (if no time-out has occurred), which 
will eliminate the need for broadcasting another ARP request throughout the 
network. This process can be explained better with a step-by-step diagram… 


                                                 +--------------------+
                                                 +3)Des. Found.     + 
                                                 +4)Adds source IP, +
                                        |->->->->-+ MAC to Cache.     +     
                                     /|        +5)Send ARP Reply to +
                                     /|        + source.         + 
Source Computer                     /|        +--------------------+ 
+--------------------+                 /|
+1)Checks Cache.     +                 /|        +--------------------+
+2)Broadcasts ARP    +                 /|        +3)Des. IP not found.+
+ req. to all hosts.+->->->->->->->->->|->->->->-+ Discard request. +
+6)Add Des. IP, Mac +                 |/        +                    +
+ to Arp cache.     +                 |/        +--------------------+
+--------------------+          |/
                                     |/        +--------------------+
                                     |/        +3)Des. IP not found.+
                                        |->->->->-+ Discard request. + 
                                                 +                    +
                                                 +--------------------+ 



When taking an even closer look into this protocol transaction of ARP requests 
and replies, one will notice that the Address Resolution Protocol does not use 
an IP header. Instead, it has its own packet format that is encapsulated within 
an Ethernet frame. To further understand as to what an ARP packet is composed of 
and what exactly is being sent and received when a packet travels along the 
wire, here is a diagram of an Ethernet frame (as defined by IEEE 802.3) with an 
enlarged view of the encapsulated ARP request packet… 


                             ETHERNET FRAME

+--------+------+-------+-------+-----+--------------+-----+--------+
|Preamble|Start | Des. |Source |Frame|             |     |        |
|7 bytes |Frame | MAC | MAC |Type | Encapsulated | Pad |Ethernet|
|        |Del. |6 bytes|6 bytes| 2B | ARP Packet | 18B | CRC |
|        | 1B |     |     |0x806| 28 bytes |     |4 bytes |
+--------+------+-------+-------+-----+-||-----------+-----+--------+
                                     _||_
                                      /
                                        /
                             
                 ARP REQUEST PACKET

0         8            16                     31
+------------------------+------------------------+
|     Hardware Type     |     Protocol Type     |
+     1          |         0x806         +
|                        |                        |
+-----------+------------+------------------------+
|Hardware |Protocol    |                        |
+Address =6 |Address = 4 | Operation Code = 1 +
|Length     |Length     |                        |
+-----------+------------+------------------------+ 
|            Source Hardware Address             |
+-------------------------------------------------+ 
|            Source Protocol Address             |
+-------------------------------------------------+ 
|         Destination Hardware Address         |
+-------------------------------------------------+ 
|         Destination Protocol Address         |
+-------------------------------------------------+


The diagrams show that ARP request/reply packets are encapsulated within the 
Ethernet frame. The frame itself begins with a Preamble for synchronization, a 
Start of Frame Delimiter to signify the start of the frame, the destination and 
source MAC addresses, the frame type (ARP), the encapsulated ARP packet, padding 
incase extra data bytes need to be appended to bring the Ethernet frame to a 
minimized size, and a CRC (cyclical redundancy check) to provide error checking. 
The diagram of the ARP packet is shown to have a Hardware/MAC address type as 1 
for Ethernet. The Protocol Type is 0x806, which is the value for an ARP request. 
If it were 0x835 then it would be for an ARP reply and if it were 0x800 it would 
be for an IP address. The Hardware Address Length is 6 bytes for Ethernet while 
the Protocol Address Length is 4 bytes for TCP/IP. The Operation code value is 1 
for ARP reply and if the value was 2, then it would be for an ARP request (ARP 
request and ARP reply use the same packet format). The rest is self-explanatory.


There is also the Reverse Address Resolution Protocol (RARP), as outlined in RFC 
903, which does the opposite of ARP in that it will allow a host to find its IP 
address if only its MAC address is known. This protocol uses the same packet 
format as the Address Resolution Protocol (except now the MAC address is the 
known parameter/frame instead of the IP address and the Protocol Type is 0x8036 
for RARP), but is a completely different protocol all together. RARP works by 
allowing diskless nodes, that are connected to an Ethernet network and do not 
know their own IP addresses when booting up, to request their protocol addresses 
by broadcasting a RARP request (in the Operation Code parameter of the ARP 
packet diagram, a RARP request would be a value of 3) packet to special RARP 
servers on the network that contain databases that store mappings of MAC address 
to IP addresses. The RARP servers will cross-reference the MAC address found in 
the RARP request packet with mappings found in its database. If a match is found 
the RARP server will then send the IP address back to the host by using a RARP 
reply (in the Operation Code parameter of the ARP packet diagram, a RARP reply 
would be a value of 4) packet. RARP has been since superseded by the Bootstrap 
Protocol (BOOTP), as defined in RFC 951, where by a host would connect to a 
BOOTP server in the same manner it would with a RARP server, and BOOTP and RARP 
have both been superseded by the Dynamic Host Configuration Protocol (DHCP), 
which allows a device to have a different protocol address each time it connects 
to the network. 

In closing, I would hope, by having read this, you now have a better 
understanding of the MAC address and the utilization of the Address Resolution 
Protocol. The purpose of putting this paper together was purely along the lines 
of a learning aspect for the reader, as well as myself, and I hope that this 
paper and I have succeeded in my goal of doing just that. 



References and Related Documents: 

(RFC 826) An Ethernet Address Resolution Protocol or Converting Network Protocol 
Addresses to 48.bit Ethernet Address for Transmission on Ethernet Hardware 
ftp://ftp.isi.edu/in-notes/rfc826.txt 

(RFC 903) Reverse Address Resolution Protocol 
ftp://ftp.isi.edu/in-notes/rfc903.txt 

Address Resolution Protocol (ARP) 
http://www.microsoft.com/windows2000/en/datacenter/help/sag_tcpip_und_arp.htm
 



1.) MAC Address & ARP Functionality - Resolution
2.) SOTHA #8 - madsaxon
3.) Spyware: The Evolution - JesterS
4.) Demystifying Remote Host - Abhisek Datta
5.) Wireless Security & Hacking - Dr. T
6.) When Code Goes Wrong - DangerDuo
7.) Phone lines, wardialing, laptops & the like - zaxil
8.) The Dangers of SetUID - zaxil
9.) Introduction to Buffer Overflows - Ghost_Rider

(Printer-friendly page Send this story to someone)

 
Top 10 Articles from the last 2 weeks for Articles

· Articles Postings

· Postings by L33tdawg


Login
 



 


 Log in Problems?
 New User? Sign Up!

HITB eZine Issue 003

Last 15 Postings to HITB Forum

Topics
· All topics
· AMD News (Aug 10, 2010)
· Apple News (Sep 02, 2010)
· Articles (Mar 03, 2009)
· Ask Us (Feb 01, 2003)
· Audio/Video (Sep 01, 2010)
· Encryption (Aug 30, 2010)
· Games (Aug 27, 2010)
· Hardware (Sep 01, 2010)
· HITB News (Aug 19, 2010)
· Industry News (Sep 02, 2010)
· Intel News (Aug 31, 2010)
· Law and Order (Sep 02, 2010)
· Linux (Aug 30, 2010)
· Microsoft (Sep 02, 2010)
· Networking (Sep 01, 2010)
· PDAs (Feb 09, 2007)
· Privacy (Sep 02, 2010)
· Red Hat (Mar 30, 2010)
· Science (Aug 30, 2010)
· Security (Sep 02, 2010)
· Software & Programming (Sep 02, 2010)
· Spam (Sep 01, 2010)
· Technology (Aug 30, 2010)
· Transmeta (Jul 07, 2007)
· Viruses & Malware (Sep 02, 2010)
· Wireless (Aug 26, 2010)

Packet Storm Security Latest
· nullconGoa2011-CFP.txt
The Call For Papers for nullcon Dwitiya 2.0 is now open. It takes place February 25th through the 26th, 2011 in Goa, India.
· amirocmsfaq-xss.txt
Amiro.CMS version 5.8.4.0 suffers from a stored cross site scripting vulnerability.
· advanced-xss.pdf
Whitepaper called Advanced XSS. Written in Arabic.
· moaub01-cpanel.pdf
Month Of Abysssec Undisclosed Bugs - Cpanel suffers from a PHP restriction bypass vulnerability. Versions 11.25 and below are affected.
· moaub01-adobe.pdf
Month Of Abysssec Undisclosed Bugs - Adobe Acrobat Reader and Flash Player suffer from a newclass invalid pointer vulnerability.
· MDVSA-2010-168.txt
Mandriva Linux Security Advisory 2010-168 - Double free vulnerability in the ssl3_get_key_exchange function in the OpenSSL client in OpenSSL 1.0.0a, 0.9.8, 0.9.7, and possibly other versions, when using ECDH, allows context-dependent attackers to cause a denial of service and possibly execute some sources refer to this as a use-after-free issue. The updated packages have been patched to correct this issue.
· ZSL-2010-4961.txt
LEADTOOLS version 16.5.0.2 suffers from buffer overflow, integer overflow and denial of service vulnerabilities related to Active-X Common Dialogs.
· cpanelcp-xss.txt
cPanel Customer Portal suffers from a cross site scripting vulnerability.

Follow us
Join our Facebook Group

Follow us on Twitter

Follow our RSS feed


HITB Affiliates

Page created in 0.9442050457 seconds.