密码破解不再神秘 教你搭建密码破解服务器(1)(10)
由于rcrack、 rcracki和john某种程度上需要从各自的程序目录下运行,于是我创建了几个别名,让用户可以轻松进入到合适的位置。另外,我们把大多数这些安装放到了一个集中位置/cracking/bin),那样我们就能轻松维护没有这些工具的实际程序包)。
user@ubuntu:~$ cat /etc/profile.d/pwserver.sh
#
# Set up all of the paths, directories, etc.. for password cracking
# by brad a.
#
alias john='cd /cracking/bin/john-bin; echo Changing directory - Please run john from here with ./john'
alias rcrack='cd /cracking/bin/rainbowcrack; echo -e "Changing directory - Please run rcrack from here with:\n./rcrack /path/to/tables/*.rt -f /path/to/pwdump"'
alias rcracki='cd /cracking/bin/rcracki_mt; echo -e "Changing directory - Please run rcracki from here with:\n./rcracki -f /path/to/pwdump /path/to/tables/"'
PATH=$PATH:/cracking/bin
export PATH
更改当日消息MOTD)
要是没有有意思的MOTD,Foundstone服务器会是什么样?我忽略了实际的欢迎信息存储在/etc/motd.tail中),因为它可能让人有点不快,以下是登录时启动的统计脚本。
user@ubuntu:~$ cd /etc/update-motd.d
user@ubuntu:/etc/update-motd.d$ sudo chmod -x *
user@ubuntu:/etc/update-motd.d$ sudo touch 10-pwserver
user@ubuntu:/etc/update-motd.d$ sudo chmod +x 10-pwserver
user@ubuntu:/etc/update-motd.d$ cat 10-pwserver
#!/bin/bash
#
#
# by Brad Antoniewicz
#
[ -f /etc/motd.tail ] && cat /etc/motd.tail || true
TMPFILE="/tmp/check.tmp"
ver="0.1"
isRunning=0;
processes="oclHashcat64.bin hashcat pyrit oclHash john rcrack rcracki rcracki_mt"
checkProc() {
ps ax -o pid,user,etime,command | grep -w $1 | grep -v grep | grep -v $0 | sed -e 's/^ //' > $TMPFILE
NUMPROC=`wc -l $TMPFILE | cut -d" " -f 1`
if [[ $NUMPROC != 0 ]]; then
for ((i=1; i<=$NUMPROC; i++))
do
# awk NR==$i "$TMPFILE"
PID=`awk NR==$i "$TMPFILE" | cut -d" " -f 1`
echo -e "\tUser: `awk NR==$i "$TMPFILE" | cut -d" " -f 2` - Process: $1 - PID: $PID - Running For: `awk NR==$i "$TMPFILE" | awk '{print $3}'`"
isRunning=1;
done
fi
}
echo Processes currently running
for i in $processes
do
checkProc $i
done
if [ $isRunning == 0 ]; then
echo -e "\tNone!"
fi
评论暂时关闭