当前位置:网站首页>SQL injection vulnerability (XIII) Base64 injection
SQL injection vulnerability (XIII) Base64 injection
2022-06-22 06:16:00 【A τθ】
One 、base64 Code injection
base64 It is generally used for data encoding for transmission , E.g. mail , It is also used to encrypt images stored in web pages . The benefits of data encoding are , Prevent data loss , There are also many websites that use
base64 Data transfer , Such as search bar perhaps id Receiving parameters may use base64 Handle passed parameters . stay php in base64_encode() Function on string
Conduct base64 Encoding can also be decoded .
Coding and decoding process :
1 ->base64 code ->MQ==->base64 Decrypt ->1
base64 Code injection , To bypass gpc Inject intercept , Because there are no special characters in the encoded string . The encoded string , To be decoded again in a program , And then splice it into
SQL Attack statement , Re execution , Thus form SQL Inject .
Two 、 The code analysis
From vulnerable code , First of all, judge whether there is POST Of submit Parameters come here , If used $_COOKIE['uname'] obtain cookis The account number passed , Again
Joining together to SQL Bring in the query .
What this code means $cookee = base64_decode($cookee); take $cookee Decode the transmitted parameters , therefore $cookee The data transmitted must be advanced
Line code , Otherwise, failure to decode will result in an error .

3、 ... and 、base64 Code for injection
1、 Test injection point
First observe whether the website exists base64 Encoded data , For example, passing id value , Search module .
If there is something like == etc. , It can be used base64 Decode and test .
admin'and 1=1-- code YWRtaW4nYW5kIDE9MS0tIA== admin'and 1=2-- code YWRtaW4nYW5kIDE9Mi0tIA==
The test page is cookie , So we need to cookie Submit , And there are parentheses that need to be closed .
Original string base64 code
admin') and 1=1-- YWRtaW4nKSBhbmQgMT0xLS0gIA== admin') and 1=2-- YWRtaW4nKSBhbmQgMT0yLS0gIA==





The first submission page returns to exist admin, The second submission did not admin, The two pages return different results , So there is SQL Inject .
2、 Query sensitive information
This code exists mysqli_error function , So we can use error injection to further obtain sensitive information .
admin') and (updatexml(1,concat(0x7e,(select user()),0x7e),1))--
Conduct base64 code
YWRtaW4nKWFuZCAodXBkYXRleG1sKDEsY29uY2F0KDB4N2UsKHNlbGVjdCB1c2VyKCkpLDB4N2UpLDEpKS0tICA=
Submit for sensitive information .


边栏推荐
- 【雲計算重點複習】
- MiniGUl 1.1.0版本引入的新GDI功能和函数(二)
- 用蒙特卡洛法求圆周率pi
- pip升级难题(已解决)You are using pip version 19.0.3, however version 22.1.2 is available.
- 单细胞文献学习(part2)--stPlus: a reference-based method for the accurate enhancement of ST
- 从入门到精通之专家系统CLIPS(一)CLIPS初识与概述
- Discrete PID control based on MATLAB
- R语言观察日志(part24)--writexl包
- 生信可视化(part3)--小提琴图
- Swagger common annotation summary
猜你喜欢

Ptrade trading program code - from zero to firm offer 19

生信可视化(part3)--小提琴图

单球机器人动力学与控制研究

反射操作注解

simulink中搭建专家pid控制

SQL 注入漏洞(十四)xff 注入攻击

单细胞论文记录(part11)--ClusterMap for multi-scale clustering analysis of spatial gene expression

pip升级难题(已解决)You are using pip version 19.0.3, however version 22.1.2 is available.

单细胞论文记录(part13)--SpaGCN: Integrating gene expression, spatial location and histology to ...

四大函数式接口(必需掌握)
随机推荐
Single cell paper record (Part14) -- costa: unsupervised revolutionary neural network learning for St analysis
【云计算重点复习】
Bathymetry along Jamaica coast based on Satellite Sounding
Expert PID control in Simulink
Single precision, double precision and precision (Reprint)
reduce_ Reduction in sum()_ indices
四大函数式接口(必需掌握)
CMake 入门级别语法
【Rust笔记】03-引用
PyG教程(7):剖析邻域聚合
Lock锁(重点)
Unity encrypts ASE game data
富设备平台突破:基于RK3568的DAYU200进入OpenHarmony 3.1 Release主干
TiDB 社区线下交流会,天津 & 石家庄的小伙伴看过来~
GeoSwath plus 技术和数据采集处理
Shengxin visualization (Part2) -- box diagram
生信文献学习(part1)--PRECISE: a ... approach to transfer predictors of drug response from pre-clinical ...
Bat common batch script record
pgsql批量插入
为什么我选择 Rust