Results 1 to 5 of 5

Thread: Building a script to update the version of snort on the system

  1. #1
    Just burned his ISO
    Join Date
    Aug 2012
    Location
    Somewhere in the ether
    Posts
    6

    Default Building a script to update the version of snort on the system

    Hello,

    I'm building a shell script that updates the woefully out of date version of snort that ships with BT5r*. I want to know if there's a foolproof command I can run via command line to verify that the user running this script is running the script on a backtrack system, and prompts them if we fail to successfully identify the OS as running backtrack.

    couple of ideas I have:

    cut the text bt from uname -a or the motd
    check for the existence of the /usr/share/wallpapers/backtrack directory

    neither of these really seem foolproof. Any ideas?

    Thanks in advance,

    Also I plan on releasing this script via github when it's done, so if you have even a cursory interest, you can make it yours.

  2. #2
    Member ColForbin's Avatar
    Join Date
    Jan 2010
    Posts
    93

    Default Re: Building a script to update the version of snort on the system

    Would
    Code:
    #!/bin/bash
    
    # Define what we're looking for.
    string='backtrack'
    
    # Dump the first nine characters, from the /etc/issue file, into a test file.
    cat /etc/issue | cut -c 1-9 > test.txt
    
    # Test our test file, to see if our string exists.
    # If our string exists, do one thing.
    # If not, do something else.
    if grep -q -i $string test.txt;
    then
            echo "BackTrack detected."
    else
            echo "This is probably not a BackTrack system."
    fi
    
    # Delete our test file.
    rm test.txt
    work? That's probably not the best way to do it, but it's a start. Here's another
    Code:
    if [ `cat /etc/issue | cut -c 1-9` != "BackTrack" ];then echo "BackTrack not detected."; fi

    P.S. Why not just submit a ticket to Redmine?
    Last edited by ColForbin; 08-23-2012 at 05:13 AM.
    "Whatever happened to playing a hunch, Scully? The element of surprise, random acts of unpredictability? If we fail to anticipate the unforeseen or expect the unexpected in a universe of infinite possibilities, we may find ourselves at the mercy of anyone or anything that cannot be programmed, categorized or easily referenced."

  3. #3
    Just burned his ISO
    Join Date
    Aug 2012
    Location
    Somewhere in the ether
    Posts
    6

    Default Re: Building a script to update the version of snort on the system

    Quote Originally Posted by ColForbin View Post
    Would:
    Code:
    cat /etc/issue | grep -i backtrack | cut -c 1-10
    work?
    Thanks ColForbin, and thank you for your time. I suppose for now that this will work, but I was looking for something a little bit more foolproof, something that isn't easily modifiable by root or any other user for that matter. Root can just rm issue, issue.net or motd and our way of identifying the OS as backtrack is gone. In the end, the os check isn't truly THAT important, so long as I give the user a chance to cancel the script if we try an OS check and cannot definitely identify the OS as being backtrack.

    Thanks for the help! hope to have this script out soon.

  4. #4
    Just burned his ISO
    Join Date
    Aug 2012
    Location
    Somewhere in the ether
    Posts
    6

    Default Re: Building a script to update the version of snort on the system

    Quote Originally Posted by ColForbin View Post
    Would[CODE]#!/bin/bash
    -snip-

    P.S. Why not just submit a ticket to Redmine?
    That code will likely serve the purpose. All I want to do is double check that the user is in fact running the script on backtrack and prompt them with a 10 second delay saying "I wasn't able to determine whether or not this is backtrack. You can keep running this script or hit ctrl+c to cancel."

    In regards to submitting a ticket to redmine, I'm a former Sourcefire employee (e.g. the guys who make snort) the project is updated so frequently, that it makes no sense to put in a ticket to update it when, as soon as it's updated and put into the distro repos, or added to the default install, it'll be outdated again. I'd rather just give the open-source community a script that allows them to update it themselves.

  5. #5
    Member ColForbin's Avatar
    Join Date
    Jan 2010
    Posts
    93

    Default Re: Building a script to update the version of snort on the system

    Quote Originally Posted by da667 View Post
    ...the project is updated so frequently, that it makes no sense to put in a ticket to update it when, as soon as it's updated and put into the distro repos, or added to the default install, it'll be outdated again. I'd rather just give the open-source community a script that allows them to update it themselves.
    Good point. Your script looks awesome, by the way. I can't wait to try out the version you're working on here. Thanks!
    "Whatever happened to playing a hunch, Scully? The element of surprise, random acts of unpredictability? If we fail to anticipate the unforeseen or expect the unexpected in a universe of infinite possibilities, we may find ourselves at the mercy of anyone or anything that cannot be programmed, categorized or easily referenced."

Similar Threads

  1. update Snort
    By joker5bb in forum Tool Requests
    Replies: 0
    Last Post: 11-25-2010, 09:01 PM
  2. How to update system and FireFox ?
    By pirat in forum Beginners Forum
    Replies: 1
    Last Post: 08-15-2010, 09:20 AM
  3. Xplico version 0.5.8 - update
    By SWFu64 in forum Tool Requests
    Replies: 0
    Last Post: 06-30-2010, 11:05 AM
  4. update system ??
    By Dissident85 in forum OLD BackTrack 3 Final
    Replies: 3
    Last Post: 09-24-2008, 03:27 AM
  5. Help! USB version without update option?
    By ProDigit in forum OLD BT3final Support
    Replies: 3
    Last Post: 06-21-2008, 04:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •