1,
<?php
if( isset( $_GET['Login'] ) ) {
$user = $_GET['username'];
$pass = $_GET['password'];
$pass = md5($pass);
$qry = "SELECT * FROM `users` WHERE user='$user' AND password='$pass';";
$result = mysql_query( $qry ) or die( '<pre>' . mysql_error() . '</pre>' );
if( $result && mysql_num_rows( $result ) == 1 ) {
// Get users details
$i=0; // Bug fix.
$avatar = mysql_result( $result, $i, "avatar" );
// Login Successful
echo "<p>Welcome to the password protected area " . $user . "</p>";
echo '<img src="' . $avatar . '" />';
} else {
//Login failed
echo "<pre><br>Username and/or password incorrect.</pre>";
}
mysql_close();
}
?>
通过分析原码知道的这是典型的万能密码
输入'or 1=1 limit 1,1 -- 可以绕过
方法二
通过爆破
2,Command Injection(命令注入)
命令注入攻击的常见模式为:仅仅需要输入数据的场合,却伴随着数据同时输入了恶意代码,而装载数据的系统对此并未设计良好的过滤过程,导致恶意代码也一并执行,最终导致信息泄露或者正常数据的破坏。(以上摘自百度百科)
命令连接符:
command1 && command2 先执行command1后执行command2
command1 | command2 只执行command2
command1 & command2 先执行command2后执行command1
以上三种连接符在windows和linux环境下都支持
如果程序没有进行过滤,那么我们就可以通过连接符执行多条系统命令。
net user 查看用户名和密码 但是我看不了 必须在windows nt以上的系统ms-dos模式下才可以运行
3,csrf跨站脚本伪造
4, 文件包含命令
http://192.168.83.134/dvwa/vulnerabilities/fi/?page=../../phpinfo.php
通过 ../ 跨目录包含了phpinfo.php这个文件
将相对路径改为绝对路径 就可以修复漏洞 或者限制使用【./】防止目录跳转
5,File Inclusion(任意文件上传)
6,xxs
弹框警告:
<script>alert('yangge')</script>
<script>alert(document.cookie)</script>
页面重定向:
<script>location.href="http://www.baidu.com"</script>
补充Google搜索方法