getting root acccess without sudo

Dec 29
2007
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "sys/types.h"
#include "unistd.h"
#include "stdlib.h"
#include "stdio.h"
 
int main(int argc, char** argv)
{
    int root_id = 0;
    char *command = argv[1];
 
    if(!command)
        command = "/bin/bash";
 
    setuid(root_id);
    system(command);
    exit(0);
}

root# gcc -o temproot temproot.c
root# chmod +s temproot
nobody$ alias root=’temproot “su – root”’
nobody$ root

bashrc

Dec 29
2007
export PATH=$PATH:$HOME/bin:/usr/sbin:/sbin:$HOME/network
export TERM=linux
export gemdoc=`gem environment gemdir`/doc
 
function prompt_set {
 
 local GRAY="\[\033[1;30m\]"
 local LIGHT_GRAY="\[\033[0;37m\]"
 local CYAN="\[\033[0;36m\]"
 local LIGHT_CYAN="\[\033[1;36m\]"
 local NO_COLOUR="\[\033[0m\]"
 
 case $TERM in
    xterm*|rxvt*)
        local TITLEBAR='\[\033]0;\u@\h:\w\007\]'
        ;;
    *)
        local TITLEBAR=""
        ;;
 esac
 
local temp=$(tty)
local GRAD1=${temp:5}
PS1="$GRAY-$CYAN-$LIGHT_CYAN(\
$CYAN\u$GRAY@$CYAN\h$LIGHT_CYAN)$CYAN-$LIGHT_CYAN(\
$CYAN\$(date +%H:%M)$GRAY:$CYAN\w\
$LIGHT_CYAN)$CYAN-$GRAY-$LIGHT_GRAY "
PS2="$LIGHT_CYAN-$CYAN-$GRAY-$NO_COLOUR "
}
 
prompt_set
 
alias get_visits="ssh l 'tail /home/postgres/stats.txt'"
alias __='history | tail -2 | head -1'
alias r="temproot `id -u`'"
alias sql='mysql --password=pass'
alias ..='cd ..';
alias ...='cd ../..';
alias ,='cd -'
alias e=exit
alias e=exit
alias v=vim
alias l='ls -lc -h --color=yes'
alias c=clear
alias top='top -d1'
alias hc='history -c'
alias gre=grep
alias gr=gre
alias gpre=gr
alias grp=gpre
alias le=less
alias mroe=more
alias mreo=mroe
alias h=history
alias pe='perl -e'
alias pc='perl -c'
alias t=date
alias d=date
 
function FOR {
        local count=$1
        start=0
        shift
        while [ $start -lt $count ]
        do
        $*
        sleep 1
                clear
                let start=$start+1
        done
}

nmap cleaner in Perl

Dec 29
2007
$”=@ARGV;/^\D+/||print for`nmap$”`

Calendar

December 2007
M T W T F S S
« Nov   Jan »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Tags