Sunday, November 9, 2008

ARP spoofing

Address Resolution Protocol (ARP) spoofing, also known as ARP poisoning or ARP Poison Routing (APR), is a technique used to attack an Ethernet wired or wireless network which may allow an attacker to sniff data frames on a local area network (LAN), modify the traffic, or stop the traffic altogether (known as a denial of service attack). The attack can obviously only happen on networks that indeed make use of ARP and not another method.

The principle of ARP spoofing is to send fake, or "spoofed", ARP messages to an Ethernet LAN. Generally, the aim is to associate the attacker's MAC address with the IP address of another node (such as the default gateway). Any traffic meant for that IP address would be mistakenly sent to the attacker instead. The attacker could then choose to forward the traffic to the actual default gateway (passive sniffing) or modify the data before forwarding it (man-in-the-middle attack). The attacker could also launch a denial-of-service attack against a victim by associating a nonexistent MAC address to the IP address of the victim's default gateway.

ARP spoofing attacks can be run from a compromised host, a jack box, or a hacker's machine that is connected directly onto the target Ethernet segment.

Application

ARP is a Layer 2 protocol। ARP request is considered broadcast traffic, while legitimate ARP Replies are not. As such, it is not designed to allow for any ID validation on the transaction. While ARP spoofing can occur in the course of ARP transactions, creating a race condition, the more common utilization is the distribution of unsolicited ARP responses which are cached by the clients creating the ARP cache poison scenario.

Defenses

An open source solution is ArpON "Arp handler inspectiON". It is a portable ARP handler which detects and blocks all ARP poisoning and spoofing attacks with static ARP inspection (SARPI) and dynamic ARP inspection (DARPI) approach on switched or hubbed LANs with or without DHCP.

Another method, such as DHCP snooping, can be utilised on larger networks. Via DHCP, the network device keeps a record of the MAC addresses that are connected to each port, so it can readily detect if a spoofed ARP has been received. This method is implemented on networking equipment by vendors such as Cisco, ProCurve, Extreme Networks, Dlink and Allied Telesis.

Detection is another avenue for defending against ARP spoofing. Arpwatch is a Unix program which listens for ARP replies on a network, and sends a notification via email when an ARP entry changes. Under Windows the GUI-driven software XArp v2 is available. It performs ARP packet inspection on a per network interface basis with configurable inspection filters and active verification modules. anti-arpspoof creates static ARP entries in the client and default gateway cache, and cleans poisoned dynamic entries.

Checking for the existence of MAC address cloning may also provide a clue as to the presence of ARP spoofing, though there are legitimate uses of MAC address cloning. Reverse ARP (RARP) is a protocol used to query the IP address(es) associated to one MAC address. If more than one IP address is returned, MAC cloning is present.

A simple defense that only works for simple ARP spoofing attacks is the use of static IP-MAC mappings। However, this only prevents simple attacks and does not scale on a large network as the mapping has to be set for each pair of machines, resulting in n*n ARP caches that have to be configured.

Legitimate usage

ARP spoofing can also be used for legitimate reasons. For instance, network registration tools may redirect unregistered hosts to a signup page before allowing them full access to the network.

Another legitimate implementation of ARP spoofing is used in hotels to allow traveling laptop users to access the Internet from their room, using a device known as a head end processor (HEP), regardless of their IP address.

ARP spoofing can also be used to implement redundancy of network services. A backup server may use ARP spoofing to take over a defective server and transparently offer redundancy.


ARP spoofing tools

Arpspoof (part of the DSniff suite of tools), Arpoison, Cain and Abel, Ettercap, and netcut are some of the tools that can be used to carry out ARP poisoning attacks।

See also

External links


Arabic subtitle, how to make it work under Ubuntu.

I had been using dual boot of Microsoft windows and linux for a long time as I couldn't completely migrate to Linux because of immature Arabic support. booting to windows to watch subtitled movies was not uncommon thing I was doing.
Now with complete linux arabic subtitle support , I rarely boot to windows only to play MS flight simulator.
Most of arabic subtitles files are written in windows-1256 character set encoding and very scarse of them are written UTF-8 encoding.

Totem:

Ubuntu comes with Totem media player that already support arabic subtitles out of the box
just select Edit > Preferences > General > Encoding > Arabic (WINDOWS-1256)
and make sure to select a font that support arabic, mine is set to "Nimbus sans L". Also make sure that the .sub or .srt file has the same file name as the media files without extensionp; ie. foo.srt for foo.avi .

Mplayer:

Mplayer and VLC require fribidi liberary to support arabic, but the stable version is not mature enough to support arabic joining, that why you will get unjoined arabic charcters on subtitles, so you have to install version 2 of fribidi from CVS repository and compile it yourself or if you are using ubuntu or debian , you can download and install a .deb package from here or zshare mirror here.
Then edit $HOME/.mplayer/gui.conf with your favourite text editor and append the following line at the end of the file

sub_cp = "cp1256"


Now subtitles should properly work, just make sure the video file foo.avi has foo.sub, or foo.srt subtitle file in the same directory.

VLC

For VLC you have to install fribidi version 2 as mentioned before and edit $HOME/.vlc/vlcrc with your favourite text editor, and find the following line and comment it

subsdec-autodetect-utf8=1


and change the line that begins with "subsdec-encoding" to

subsdec-encoding=windows-1256


save your file and fireup your vlc opening a subtitled media now you should have a working subtitle with arabic joining.
I have VLC 0.8.6e Janus (wxWidgets interface) installed from ubuntu hardy repository and it looks that it suffer from a bug preventing it from loading subtitles having charcters other than letters and numbers in its location and its filename, for example a file location includes something like this "Chaos.Theory[2007]DvDrip[cut].AC3-aXXo" will not work, just rename the video and subtitles filenames and directory names if needed.

P.S.

A good thing about fridbidi version 2 is that it will fix arabic shaping/joining problems for other applications that use it like amsn.

Install the arabic fonts package ttf-arabeyes from repository by

sudo apt-get install ttf-arabeyes

Simple Anti Netcut for linux

netcut is an arp spoofing/poisoning program that can disconnect other people from the lan.

so , i've been suffering from disconnects because of netcut since they started using it ,
on windows there is a small tool called anti netcut that can fix the arp table and resume the network connection.

but on linux there isn't any (or at least I didn't find it) , so I made this small app to do the same job of anti netcut.

it is written in python , and can work under both linux and windows.

I'm a python beginner , so any help/criticize is happily welcomed , also any attempt to make a simple gui for it is also welcome .

just make sure to run is as root .

في أمان الله
Attached Files
File Type: py antiNetCut.py (2.1 KB, 178 views)

Changing hostname in linux

to change the hostname:
Method 1:

from terminal run this command

$sudo echo "your_new_hostname" > /etc/hostname



Method 2"

System > Administration > Network > General (tab)

and change "Host name" value to whatever you want

p.s.
a good tip is to add your new hostname to /etc/hosts

$sudo echo "127.0.0.1 your_new_hostname" >> /etc/hosts