Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ####################################################################################################
- ## ##
- ## Estella Mystagic ##
- ## ##
- ####################################################################################################
- ## Honeyshell -- a tatical network landmine for brute force SSH
- readonly HISTHOSTNAME="$(hostname)" 2>/dev/null
- readonly HISTTIME="$(date +%s)" 2>/dev/null
- readonly HISTDATE="$(date +'%d%h%y' | tr '[:lower:]' '[:upper:]')" 2>/dev/null
- if [ ! -n "$HISTIP" ]; then
- if [ -n "$SSH_CLIENT" ]; then
- readonly HISTIP="${SSH_CLIENT%% *}" 2>/dev/null
- else
- readonly HISTIP="127.0.0.1" 2>/dev/null
- fi
- else
- readonly HISTIP 2>/dev/null
- fi
- if [ -n "$SSH_TTY" ]; then
- readonly HISTTTY=$(/bin/echo $SSH_TTY | /usr/bin/sed -E 's/.*((pts|tty).+)/\1/') 2>/dev/null
- else
- readonly HISTTTY="notty" 2>/dev/null
- fi
- export HISTIP HISTTTY HISTDATE
- mildate="$(date +'%d%h%y' | tr '[:lower:]' '[:upper:]')"
- #if [ $(/usr/bin/id -u) -ne $(/usr/bin/id -g) ]; then /bin/kill -11 $$ ; fi
- #if [ `/usr/bin/groups | /usr/bin/grep -c "honeyshell"` -eq 1 ] ; then echo "#$mildate -- ${HISTIP}" >> $HOME/.honeykills ; fi
- #if [ `/usr/bin/id -u` -ge 9000 -a `/usr/bin/id -u` -le 9100 ] ; then /honeyshells/honeyshell; fi
- #if [ `/usr/bin/groups | /usr/bin/grep -c "honeyshell"` -eq 1 ] ; then exit; fi
- ####################################################################################################
- if [[ $- != *i* ]] ; then return; fi
- ####################################################################################################
- #export LANG="en_US"
- #export LANG="en_US.UTF-8"
- #export MM_CHARSET="UTF-8"
- #export LC_CTYPE="en_US.UTF-8"
- #export LC_NUMERIC="en_US.UTF-8"
- #export LC_TIME="en_US.UTF-8"
- #export LC_COLLATE="en_US.UTF-8"
- #export LC_MONETARY="en_US.UTF-8"
- #export LC_MESSAGES="en_US.UTF-8"
- #export LC_PAPER="en_US.UTF-8"
- #export LC_NAME="en_US.UTF-8"
- #export LC_ADDRESS="en_US.UTF-8"
- #export LC_TELEPHONE="en_US.UTF-8"
- #export LC_MEASUREMENT="en_US.UTF-8"
- #export LC_IDENTIFICATION="en_US.UTF-8"
- export LANG="en_US.ISO8859-1"
- export LC_CTYPE="C"
- export LC_COLLATE="C"
- export LC_TIME="C"
- export LC_NUMERIC="C"
- export LC_MONETARY="C"
- export LC_MESSAGES="C"
- export LC_ALL=C
- # :) @ this fun 01APR2009
- whoami=$(/usr/bin/whoami)
- if [ "$whoami" = "lyratester" ]; then
- export A2l8="1"
- elif [ "$whoami" = "2l8" ]; then
- export A2l8="1"
- else
- export A2l8="0"
- fi
- readonly A2l8;
- ##
- if [ `/usr/bin/id -u` -gt 1000 -a `/usr/bin/id -u` -lt 2000 ] ; then
- if [ -f "/scripts/landmine" ] ; then /scripts/landmine; fi
- fi
- ####################################################################################################
- # No core files by default
- ulimit -S -c 0 > /dev/null 2>&1
- #Not running interactively via 'bash', don't display motd.
- if [ -z $BASHRC ]; then
- readonly BASHRC=0 2>/dev/null
- fi
- ####################################################################################################
- if [ `/usr/bin/id -u` != 0 ] ; then
- readonly HISTFILE=$HOME/.history
- readonly HISTIGNORE
- readonly HISTCONTROL
- readonly HOME
- readonly LESSSECURE=1
- enable -n enable
- # alias gcc='/usr/bin/gcc -D__MYST_FORENSICS -DMYST_USER=$(echo ${USER}) -DMYST_EUID=$(echo ${EUID}) -DMYST_PPID=$(echo ${PPID}) -DMYST_TTY=$(echo ${HISTTY}) -DMYST_IP=$(echo ${HISTIP}) -DMYST_HOSTNAME=$(echo ${HISTHOSTNAME}) -DMYST_TIME=$(echo ${HISTTIME}) -DMYST_DATE=$(echo ${HISTDATE})'
- alias ifconfig='/scripts/ifconfig'
- alias last='/scripts/last'
- # alias w='/scripts/w'
- alias who='/scripts/who'
- alias su='/scripts/su'
- alias df='/scripts/df'
- alias sudo='/scripts/sudo'
- fi
- ####################################################################################################
- if [ `/usr/bin/id -u` = 0 ] ; then
- if [ -d /root ]; then
- chmod 700 /root
- fi
- alias getsrc='/usr/local/bin/cvsup -g -L 2 /usr/sup/cvsup.conf'
- alias nukeports='rm -fr /usr/ports/*'
- alias perlshell='perl -MCPAN -e shell'
- alias newports='portsnap fetch && portsnap extract'
- alias updports='portsnap fetch && portsnap update'
- alias paudit='portaudit -Fda'
- alias jps='/usr/local/bin/jps -Zauxww'
- alias ircdports='/usr/bin/sockstat -4l -p 5555,6660-6669,6697,7000-7010 -P tcp'
- alias hsocks='/usr/bin/sockstat -4l -p 1024-49151 -P tcp'
- alias lsocks='/usr/bin/sockstat -4l -p 1-1023 -P tcp'
- alias dsocks='/usr/bin/sockstat -4l -p 49151-65535 -P tcp'
- alias histfind='/bin/cat /root/.bash_history | grep '
- export CCACHE_DIR="/var/ccache/"
- fi
- ####################################################################################################
- if [ `/usr/bin/id -u` -eq 0 -a `/usr/bin/groups | /usr/bin/grep -c "angelic"` -eq 1 ] ; then exit; fi
- if [ `/usr/bin/id -u` = 0 -o `/usr/bin/groups | /usr/bin/grep -c "staff"` -eq 1 ] ; then
- alias last='/usr/bin/last'
- # alias w='/usr/bin/w -n'
- alias who='/usr/bin/who'
- alias mailque='/usr/bin/mailq -Ac'
- alias diffit='/usr/bin/diff -urNp'
- alias sysinfo='/scripts/sysinfo.pl'
- alias trafshow='trafshow -n -a 32 -i em0'
- # alias nload='nload -t 500 -s 7 -i 2048 -o 2048 -u h em0'
- alias nload='nload -t 500 -s 7 -i 8192 -o 8192 -u H em0'
- alias lintree='/linux/pstree -upG'
- alias treeit='/usr/local/bin/pstree -g 2'
- alias fsup='fastest_cvsup -q -r -c us'
- alias hlist='pciconf -lv'
- alias eve='env | sort; set;'
- alias rscp='/usr/local/bin/rsync --partial --progress --rsh=ssh'
- alias rmuser='/usr/sbin/pw deluser'
- if [ -n "$SUDO_USER" ]; then
- if [ -f "/scripts/sulog" ] ; then /scripts/sulog; fi
- fi
- alias df='/bin/df -H'
- alias su='/usr/bin/su -l -s'
- alias msu='/usr/bin/su -s'
- alias suhsroot='/usr/sbin/setpmac mls/high\(equal-equal\) /usr/local/bin/sudo /usr/bin/su - root'
- alias suroot='/usr/local/bin/sudo /usr/bin/su -s -l root'
- o () { /bin/chmod o= $1 ; /bin/ls -alo $1 ; } ; readonly o
- fi
- ####################################################################################################
- shopt -s histappend #makes bash append to history rather than overwrite
- bash () { /bin/bash --login ; } ; readonly bash
- fixlink() { /bin/chflags schg $1 && /bin/chflags -h 0 $1 && /bin/chflags 0 $1 ; } ; readonly fixlink
- if [ `/usr/bin/groups | /usr/bin/grep -c "python"` -ne 1 ]; then
- python () { /usr/local/bin/python -S ; } ; readonly python
- fi
- #if [ $(/usr/bin/id -u) -ge 1000 -a $(/usr/bin/id -u) -le 2000 ]; then
- # env () { /usr/bin/env -SENV=/etc/shrc ; } ; readonly env
- #fi
- multikill () { kill -1 $1;kill -2 $1;kill -3 $1;kill -6 $1;kill -9 $1;kill -14 $1;kill -15 $1; } ; readonly multikill
- lf () { file=`whereis $1 | cut -f2 -d ' '` ; /bin/ls -aliohGF $file ; } ; readonly lf
- ####################################################################################################
- if [ `/usr/bin/groups | /usr/bin/grep -c "infosec4"` -eq 1 ]; then
- readonly INFOSEC="4";
- elif [ `/usr/bin/groups | /usr/bin/grep -c "infosec3"` -eq 1 -o `/usr/bin/getpmac | /usr/bin/grep -c "mls/high"` -eq 1 ]; then
- readonly INFOSEC="3";
- elif [ `/usr/bin/groups | /usr/bin/grep -c "infosec2"` -eq 1 ]; then
- readonly INFOSEC="2";
- elif [ `/usr/bin/groups | /usr/bin/grep -c "infosec1"` -eq 1 -o `/usr/bin/getpmac | /usr/bin/grep -c "mls/2"` -eq 1 ]; then
- readonly INFOSEC="1";
- else
- readonly INFOSEC="0";
- fi
- export INFOSEC
- #if [ `/usr/bin/groups | /usr/bin/grep -c "staff"` -eq 1 -a `/usr/bin/groups | /usr/bin/grep -c "infosec1"` -ne 1 ] ; then exit; fi
- #if [ `/usr/bin/id -u` -eq 0 -a `/usr/bin/groups | /usr/bin/grep -c "infosec2"` -ne 1 ] ; then exit; fi
- ####################################################################################################
- # Primping the prompt for beauty
- if [ -f "/scripts/primp" ]; then /scripts/primp ; fi
- whoami=$(/usr/bin/whoami)
- if [ "$whoami" = "root" ] ; then
- readonly PROMPT_COMMAND='history -a;'
- else
- hop=1
- readonly PROMPT_COMMAND='if [ $? = 0 ]; then C0=32; else C0=35; fi;history -a'
- # readonly PROMPT_COMMAND='history -a;if [ $hop -eq 0 ]; then /scripts/whiterabbit; fi; hop=0;'
- fi
- readonly HISTTIMEFORMAT='%s - %D %T %z - '
- readonly HISTSIZE=10000000000000
- readonly HISTFILESIZE=10000000000000
- readonly FCEDIT=/dev/null
- shopt -s histappend
- readonly ENV=/etc/shrc > /dev/null 2>&1
- export TMOUT=172800
- readonly TMOUT
- readonly PPID
- export HISTCONTROL HISTTIMEFORMAT HISTSIZE HISTFILESIZE FCEDIT PROMPT_COMMAND ENV PPID EUID
- #Give one free ^D before dropping shell
- IGNOREEOF=1
- # check the window size after each command and, if necessary,
- # update the values of LINES and COLUMNS.
- shopt -s checkwinsize
- ####################################################################################################
- if [ -d /scripts -a -d /scripts/myst ]; then
- if [ -f /scripts/myst/colors.conf ]; then
- . /scripts/myst/colors.conf
- if [ -f /scripts/scrs ]; then
- if [ -n "$SHLVL" ]; then
- SLEVEL="$(echo $SHLVL)" 2>/dev/null
- else
- SLEVEL=0
- fi
- if [ "$SLEVEL" -gt 0 -a `/scripts/scrs` -gt 0 ]; then
- TB="-"; BB="-"; SB="-"
- else
- TB="\[\016\]l\[\017\]"; BB="\[\016\]m\[\017\]"; SB="\[\016\]q\[\017\]"
- fi
- fi
- if [ `/usr/bin/id -u` -eq 0 -a `/usr/bin/getpmac | /usr/bin/grep -c "mls/high"` -ne 1 ]; then
- X="${RED}"; Y="${LRED}"
- if [ -d "/usr/bin" ]; then
- if [ `/usr/bin/tty` = "/dev/ttyv0" -o $PWD = "/root/rbnc" ]; then
- PS1="\[\033[0;31m\][\[\033[0;37m\]\u\[\033[1;31m\]@\[\033[0;37m\]\h\[\033[1;30m\](\[\033[1;37m\]\w\[\033[1;30m\])\[\033[0;31m\]]\[\033[0;0m\]>"
- export PS1="\n$PS1${NCOLOR} "
- else
- PS1="${X}${TB}${SB}${Y}[${GREY}\u${Y}@${GREY}\H${Y}]${X}${SB}${Y}[${GREY}\T${Y}]${X}${SB}-${Y}[${GREY}\j${Y}]${X}${SB}-${Y}-\n${X}${BB}${Y}[${GREY}\w${Y}]${X}${SB}>"
- export PS1="\n$PS1${NCOLOR} "
- fi
- else
- PS1="\[\033[0;31m\][\[\033[0;37m\]\u\[\033[1;31m\]@\[\033[0;37m\]\h\[\033[1;30m\](\[\033[1;37m\]\w\[\033[1;30m\])\[\033[0;31m\]]\[\033[0;0m\]>"
- export PS1="\n$PS1${NCOLOR} "
- fi
- elif [ `/usr/bin/id -u` -eq 0 -a `/usr/bin/getpmac | /usr/bin/grep -c "mls/high"` -eq 1 ]; then
- X="\[\033[38;5;202m\]"; Y="\[\033[38;5;208m\]"
- PS1="${X}${TB}${SB}${Y}[${GREY}\u${Y}@${GREY}\H${Y}]${X}${SB}${Y}[${GREY}\T${Y}]${X}${SB}-${Y}[${GREY}\j${Y}]${X}${SB}-${Y}-\n${X}${BB}${Y}[${GREY}\w${Y}]${X}${SB}>"
- export PS1="\n$PS1${NCOLOR} "
- elif [ `/usr/bin/groups | /usr/bin/grep -c "staff"` -eq 1 ]; then
- X="${BLUE}"; Y="${LBLUE}"
- PS1="${X}${TB}${SB}${Y}(${GREY}\u${Y}@${GREY}\H${Y})${X}${SB}${Y}(${GREY}\T${Y})${X}${SB}-${Y}(${GREY}\j${Y})${X}${SB}-${Y}-\n${X}${BB}${Y}(${GREY}\w${Y})${X}${SB}>"
- export PS1="\n$PS1${NCOLOR} "
- else
- X="${GREEN}"; Y="${LGREEN}"
- # PS1="${X}${TB}${SB}${Y}(${GREY}\u${Y}@${GREY}\h${Y})${X}${SB}${Y}(${GREY}\T${Y})${X}${SB}-${Y}-\n${X}${BB}${Y}(${GREY}\w${Y})${X}${SB}>"
- PS1="\`if [ \$? != 0 ]; then echo ; echo \[\e#6\]\[\e[1\;35m\]SYSTEM ERROR\[\e[0m\]; fi\`\n\[\e[0;\${C0}m\]\[\016\]l\[\017\]\[\016\]q\[\017\]\[\e[1;\${C0}m\](\[\e[1;30m\]\u\[\e[1;\${C0}m\]@\[\e[1;30m\]\h\[\e[1;\${C0}m\])\[\e[0;\${C0}m\]\[\016\]q\[\017\]\[\e[1;\${C0}m\](\[\e[1;30m\]\T\[\e[1;\${C0}m\])\[\e[0;\${C0}m\]\[\016\]q\[\017\]\[\e[1;\${C0}m\](\[\e[1;30m\]\j\[\e[1;\${C0}m\])\[\e[0;\${C0}m\]\[\016\]q\[\017\]-\[\e[1;\${C0}m\]-\n\[\e[0;\${C0}m\]\[\016\]m\[\017\]\[\e[1;\${C0}m\](\[\e[1;30m\]\w\[\e[1;\${C0}m\])\[\e[0;\${C0}m\]\[\016\]q\[\017\]>\[\e[0m\] "
- export PS1;
- fi
- # if [ "$A2l8" -eq "1" ]; then
- # X="${RED}"; Y="${LRED}"
- # PS1="${X}${TB}${SB}${Y}[${GREY}root${Y}@${GREY}\H${Y}]${X}${SB}${Y}[${GREY}\T${Y}]${X}${SB}-${Y}[${GREY}\j${Y}]${X}${SB}-${Y}-\n${X}${BB}${Y}[${GREY}\w${Y}]${X}${SB}>"
- # id() { /bin/echo 'uid=0(root) gid=0(wheel) groups=0(wheel),5(operator)' ; } ; readonly id;
- # whoami() { /bin/echo "root" ; } ; readonly whoami;
- # users() { /bin/echo "root ihaq iroot iwatch" ; } ; readonly users;
- # w() {
- # /bin/echo "`/usr/bin/uptime`" ;
- # /bin/echo "USER TTY FROM LOGIN@ IDLE WHAT" ;
- # /bin/echo "root p0 $HISTIP `/bin/date +%I:%M%p` - rm -fr *" ;
- # } ; readonly w;
- # who() { /bin/echo "root ttyp0 `date "+%b %d %H:%M"` ($HISTIP) " ; } ; readonly who;
- # finger() {
- # /bin/echo "Login Name TTY Idle Login Time Office Phone" ;
- # /bin/echo "root 2l8 *p0 `/bin/date "+%a %H:%M"`" ;
- # } ; readonly finger;
- # ps() { /bin/ps -axugw ; } ; readonly ps;
- # if [ ! -f "$HOME/2l8_gift.tar.gz" ]; then
- # cp /master.passwd.tar.gz $HOME/2l8_gift.tar.gz
- # fi
- # if [ ! -f "$HOME/2l8_was_here.txt" ]; then
- # cp /2l8.txt $HOME/2l8_was_here.txt
- # fi
- # fi
- fi
- if [ -f /scripts/myst/box.conf ]; then
- . /scripts/myst/box.conf
- export TZ
- fi
- fi
- ####################################################################################################
- if [ `/usr/bin/id -u` -eq 0 ]; then
- alias w='/usr/bin/w -n'
- export PATH=$HOME/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/gbin:/scripts
- elif [ `/usr/bin/groups | /usr/bin/grep -c "staff"` -eq 1 ]; then
- alias w='/usr/bin/w -n'
- export PATH=$HOME/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/gbin:/scripts
- else
- export PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin:/gbin:/scripts
- fi
- # export PATH=$HOME/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/gbin:/scripts
- export TERM="xterm-256color"
- #export TERM=putty
- export EDITOR="nano"
- export LESS="R E"
- export PAGER="less"
- export BLOCKSIZE="K"
- export LSCOLORS=ExGxFfdxCxegDxBbGeDdCc
- export CLICOLOR=1
- ####################################################################################################
- if [ -f "/etc/dircolors.conf" ] ; then
- if [ "$SHELL" = "/usr/local/bin/bash" -o "$SHELL" = "/bin/sh" -o "$SHELL" = "/bin/bash" ]; then
- eval $(/gbin/gdircolors -b /etc/dircolors.conf)
- fi
- if [ "$SHELL" = "/bin/csh" ]; then
- eval $(/gbin/gdircolors -c /etc/dircolors.conf)
- fi
- if [ -f "$HOME/.dircolors" ] ; then
- if [ "$SHELL" = "/usr/local/bin/bash" -o "$SHELL" = "/bin/sh" -o "$SHELL" = "/bin/bash" ]; then
- eval $(/gbin/gdircolors -b $HOME/.dircolors)
- fi
- if [ "$SHELL" = "/bin/csh" ]; then
- eval $(/gbin/gdircolors -c $HOME/.dircolors)
- fi
- fi
- fi
- ####################################################################################################
- alias ll='/gbin/gls --color -Falh'
- nano() { /usr/local/bin/nano -w $1 && /usr/bin/clear || /usr/bin/clear ; } ; readonly nano
- pico() { /usr/local/bin/pico -w $1 && /usr/bin/clear || /usr/bin/clear ; } ; readonly pico
- alias lo='/bin/ls -GFalohZ'
- alias lio='/bin/ls -GFaloihZ'
- alias ls='/gbin/gls --color -GFah'
- alias sysinfo='/scripts/sysinfo'
- alias vhosts='/scripts/vhosts'
- alias vhosts6='/scripts/vhosts6'
- alias dhd='/usr/bin/du -h -d 0'
- alias dhd1='/usr/bin/du -h -d 1'
- alias h='history'
- alias make='cd .;make'
- alias gmake='cd .;gmake'
- alias man='LESS=C PAGER=most man'
- ####################################################################################################
- if [ `/usr/bin/id -u` -ge 1000 -a `/usr/bin/id -u` -le 2000 ] ; then
- if [ -d $HOME ]; then
- # if [ "$whoami" = "lyra" ] ; then
- # if [ -f "/lib/libtesla.so" ] ; then
- # export LD_PRELOAD=/tmp/w00t.so.1.0 2>/dev/null
- # fi
- # fi
- readonly LD_PRELOAD
- chmod 710 $HOME
- if [ -f $HOME/.history ] ; then
- if [ ! -s $HOME/.history ] ; then
- echo "User added on `date`" >> $HOME/.history
- fi
- fi
- if [ -f $HOME/.last ] ; then
- if [ ! -s $HOME/.last ] ; then
- echo "User added on `date`" >> $HOME/.last
- fi
- fi
- if [ -d $HOME/public_html ] ; then
- chmod 750 $HOME/public_html
- fi
- if [ -d $HOME/bin ] ; then
- chmod 700 $HOME/bin
- fi
- if [ -d $HOME/tmp ] ; then
- chmod 700 $HOME/tmp
- fi
- fi
- if [ -f /scripts/logo -a ! -f ${HOME}/.nomotd ]; then
- if [ ! -f ${HOME}/.hushlogin ]; then
- export LOGO=0
- export BLACKLIST=1
- /scripts/logo
- readonly BLACKLIST=1
- readonly LOGO=1
- else
- export LOGO=1
- export BLACKLIST=0
- /scripts/blacklist
- readonly LOGO=1
- readonly BLACKLIST=1
- fi
- else
- export LOGO=1
- export BLACKLIST=0
- /scripts/blacklist
- readonly LOGO=1
- readonly BLACKLIST=1
- fi
- if [ -f /scripts/motd -a ! -f ${HOME}/.nomotd ]; then
- if [ ! -f ${HOME}/.hushlogin ]; then
- /scripts/motd
- fi
- fi
- if [ -f /scripts/bsdhelp -a ! -f ${HOME}/.hushlogin ]; then
- /scripts/bsdhelp
- fi
- if [ -f "/scripts/romulus" ] ; then
- /scripts/romulus
- fi
- fi
- if [ -f "/scripts/infosec" ]; then /scripts/infosec ; fi
- ####################################################################################################
- if ! [ 4 -eq `uname -r | awk -F. {'print $1'}` -o 5 -eq `uname -r | awk -F. '{print $1}'` ] ; then
- alias grep='grep --color=auto'
- fi
- ####################################################################################################
Add Comment
Please, Sign In to add comment