• Viewing Files
  • L in u X ba sics for h acke rs g e t t I n g s t a r t e d w I t h




    Download 7,3 Mb.
    Pdf ko'rish
    bet38/115
    Sana27.11.2023
    Hajmi7,3 Mb.
    #106243
    1   ...   34   35   36   37   38   39   40   41   ...   115
    Bog'liq
    linuxbasicsforhackers

    2
    T E X T M A N I P U L AT I O N
    In Linux, nearly everything you deal with 
    directly is a file, and most often these will 
    be text files; for instance, all configuration 
    files in Linux are text files. So to reconfigure 
    an application, you simply open the configuration 
    file, change the text, save the file, and then restart 
    the application—your reconfiguration is complete.
    With so many text files, manipulating text becomes crucial in manag-
    ing Linux and Linux applications. In this chapter, you’ll use several com-
    mands and techniques for manipulating text in Linux.
    For illustrative purposes, I’ll use files from the world’s best network 
    intrusion detection system (NIDS), Snort, which was first developed by 
    Marty Roesch and is now owned by Cisco. NIDSs are commonly used to 
    detect intrusions by hackers, so if you want to be a successful hacker, you 
    must be familiar with the ways NIDSs can deter attacks and the ways you 
    can abuse them to avoid detection.


    20
    Chapter 2
    N O T E
     
    If the version of Kali Linux you’re using doesn’t come preinstalled with Snort, you 
    can download the files from the Kali repository by entering 
    apt-get install snort
    .
    Viewing Files
    As demonstrated in Chapter 1, the most basic text display command is 
    probably 
    cat
    , but it has its limitations. Use 
    cat
    to display the Snort config 
    file (snort.conf ) found in/etc/snort (see Listing 2-1).
    kali >cat /etc/snort/snort.conf
    Listing 2-1: Displaying snort.conf in the terminal window
    Your screen should now display the entire snort.conf file, which will 
    stream until it comes to the end of the file, and should look something like 
    the following code. This isn’t the most convenient or practical way to view 
    and work with this file.
    #-------------------------------------------------
    # VRT Rule Packages Snort.conf
    #
    # For more information visit us at:
    # HYPERLINK “http://www.snort.org/” http://www.snort.org Snort Website
    --snip--
    # event thresholding or suppressions commands...
    kali >
    In the following two sections, I will show you the 
    head
    and 
    tail
    com-
    mands, which are two methods for displaying just part of a file’s content 
    in order to more easily view the key content.

    Download 7,3 Mb.
    1   ...   34   35   36   37   38   39   40   41   ...   115




    Download 7,3 Mb.
    Pdf ko'rish

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    L in u X ba sics for h acke rs g e t t I n g s t a r t e d w I t h

    Download 7,3 Mb.
    Pdf ko'rish