packETH發包工具使用教程
測試環境:
在vmware上執行兩臺Ubuntu虛擬機器。
Ubuntu1:Ubuntu14.04,安裝packETH
Ubuntu2:Ubuntu16.04,gnome版
Feature:
•you can create and send any ethernet packet. Supported protocols:
•ethernet II, ethernet 802.3, 802.1q, QinQ, user defined ethernet frame
•ARP, IPv4, IPv6, user defined network layer payload
•UDP, TCP, ICMP, ICMPv6, IGMP, user defined transport layer payload
•RTP (payload with options to send sin wave of any frequency for G.711)
•JUMBO frames (if network driver supports it)
•sending sequence of packets
•delay between packets, number of packets to send
•sending with max speed, approaching the theoretical boundary
•change parameters while sending (change IP & mac address, UDP payload, 2 user defined bytes, etc.)
•saving configuration to a file and load from it - pcap format supported
官網:http://packeth.sourceforge.net/packeth/Home.html
注:
-
支援windows,packETH.exe
-
支援CLI,但是feature不完善,本文描述GUI
-
支援載入pcap format檔案
1. 安裝packETH
在Ubuntu1執行:sudo apt-get install packeth
2. 使用packETH
2.1 IP地址和MAC地址
Ubuntu1:
baoli@ubuntu:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:0c:29:ed:54:0c
inet addr:192.168.0.108 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:feed:540c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:15577 errors:0 dropped:0 overruns:0 frame:0
TX packets:12129 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1946776 (1.9 MB) TX bytes:21812885 (21.8 MB)
Ubuntu2:
baoli@ubuntu:~$ ifconfig
ens33 Link encap:Ethernet HWaddr 00:0c:29:66:c6:ed
inet addr:192.168.0.106 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::6e4d:8ec3:9dfe:5e89/64 Scope:Link
inet6 addr: fe80::215d:ec74:acce:2ef1/64 Scope:Link
inet6 addr: fe80::8c01:a61f:27a4:d469/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:111370 errors:0 dropped:0 overruns:0 frame:0
TX packets:6327 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:57839751 (57.8 MB) TX bytes:687101 (687.1 KB)
2.2 構建ping包測試
ubuntu1 ping ubuntu2
Ubuntu1執行:sudo packeth,彈出GUI介面。
1)在builder中構建ping包,填寫以下資料:
-
L2 Link layer,填寫源和目的MAC地址,選擇IPv4
-
L3 IPv4 data,填寫源和目的IP地址,選擇ICMP協議
-
L4 ICMP data,Type選擇Echo request
-
其它保持預設即可
2)ping包構建完後點選interface選擇eth0,最後點選send。
3)在點選send前可以執行tcpdump抓包工具。
新建終端視窗,執行:sudo tcpdump -i eth0 icmp
baoli@ubuntu:~$ sudo tcpdump -i eth0 icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
14:26:54.774623 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
14:26:54.775197 IP 192.168.0.106 > 192.168.0.108: ICMP echo reply, id 1, seq 1, length 8
14:26:54.978150 IP 192.168.0.108 > local0: ICMP 192.168.0.108 udp port 60529 unreachable, length 107
14:26:59.412684 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
14:26:59.413310 IP 192.168.0.106 > 192.168.0.108: ICMP echo reply, id 1, seq 1, length 8
注:可以點選save將設定儲存為檔案,load載入設定。
2.3 Gen-s
可以自定義發包數量、包間隔等,在packet contents中可以看到builder中構建的資料包的二進位制內容。
1)設定:傳送10個ping包,包間隔10ms(10000us)
2)點選send,在tcpdump抓包,可以觀察到一瞬間便發出了10個ping包!!
baoli@ubuntu:~$ sudo tcpdump -i eth0 icmp
[sudo] password for baoli:
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
14:57:35.397134 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
14:57:35.397864 IP 192.168.0.106 > 192.168.0.108: ICMP echo reply, id 1, seq 1, length 8
14:57:35.403706 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
14:57:35.406920 IP 192.168.0.106 > 192.168.0.108: ICMP echo reply, id 1, seq 1, length 8
14:57:35.413699 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
14:57:35.414335 IP 192.168.0.106 > 192.168.0.108: ICMP echo reply, id 1, seq 1, length 8
14:57:35.423931 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
14:57:35.424916 IP 192.168.0.106 > 192.168.0.108: ICMP echo reply, id 1, seq 1, length 8
14:57:35.433708 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
14:57:35.434466 IP 192.168.0.106 > 192.168.0.108: ICMP echo reply, id 1, seq 1, length 8
14:57:35.443770 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
14:57:35.445575 IP 192.168.0.106 > 192.168.0.108: ICMP echo reply, id 1, seq 1, length 8
14:57:35.453961 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
14:57:35.456399 IP 192.168.0.106 > 192.168.0.108: ICMP echo reply, id 1, seq 1, length 8
14:57:35.463696 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
14:57:35.464473 IP 192.168.0.106 > 192.168.0.108: ICMP echo reply, id 1, seq 1, length 8
14:57:35.473946 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
14:57:35.474884 IP 192.168.0.106 > 192.168.0.108: ICMP echo reply, id 1, seq 1, length 8
14:57:35.483701 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
14:57:35.485729 IP 192.168.0.106 > 192.168.0.108: ICMP echo reply, id 1, seq 1, length 8
對於測試效能來說是個很有用的工具。
2.4 GEN-b
用來構建發包序列、發包速率等。
1)先在builder中構建好包,然後save,比如儲存為packet_ping
2)點選select選擇packet_ping
3)設定傳送速率,這裡設為10Mbit/s
4)點選calculate,計算Delay betwen、Delay to Next
5)最後點選send
6)tcpdump抓包,可以看到包間隔非常短。
15:05:21.589072 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
15:05:21.589143 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
15:05:21.589344 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
15:05:21.589414 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
15:05:21.589560 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
15:05:21.589630 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
15:05:21.589775 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
15:05:21.589845 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
15:05:21.590102 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
15:05:21.590177 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
15:05:21.590307 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
15:05:21.590497 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
15:05:21.590630 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
15:05:21.590703 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
15:05:21.590827 IP 192.168.0.108 > 192.168.0.106: ICMP echo request, id 1, seq 1, length 8
2.5 構建UDP包
1)構建UDP包,填寫以下資料:
-
L2 Link layer,填寫源和目的MAC地址,選擇IPv4
-
L3 IPv4 data,填寫源和目的IP地址,選擇UDP協議
-
L4 UDP data,填寫source port和destination port,勾選“udp payload 0x”
-
填寫payload data,要以十六進位制格式填寫
2)最後點選send
3)執行:sudo tcpdump -i eth0 udp 抓包
15:29:19.288359 IP 192.168.0.108.10001 > 192.168.0.106.10002: UDP, length 10
15:29:19.467634 IP 192.168.0.108.10001 > 192.168.0.106.10002: UDP, length 10
15:29:19.624197 IP 192.168.0.108.10001 > 192.168.0.106.10002: UDP, length 10
相關文章
- 【Buildroot】工具包使用UI
- wireshark抓包新手使用教程
- Selenium系列教程-02 使用Chrome開發者工具Chrome
- 使用前端開發工具包WijmoJS - 建立自定義DropDownTre前端JS
- Qtum Electrum輕錢包使用教程QT
- Fiddler 抓包詳細使用教程
- chrome開發者工具使用教程-02-console皮膚Chrome
- chrome 開發者工具使用教程-01-element皮膚Chrome
- 【Linux工具】-yum/gdb使用教程!Linux
- 最安全的SRM錢包,SRM冷錢包使用教程
- 最安全的PMEER錢包,PMEER冷錢包使用教程
- 發現使用 Laravel 的許可權工具包不會使用,有同感的?Laravel
- iproute2工具包的使用
- bundletool工具使用(Android aab包安裝)Android
- Selenium系列教程-03使用開發者工具進行元素定位
- golang 中 time 包使用教程之基礎使用篇Golang
- ftp工具,ftp工具怎麼使用,如何操作?使用教程圖解。FTP圖解
- python 包之 selenium 自動化使用教程Python
- 【Java GUI 程式設計】Swing 使用者介面開發工具包JavaGUI程式設計
- 如何使用 SDKMAN管理 Linux 系統上的Java 開發工具包LinuxJava
- 雲端計算學習路線教程大綱課件:使用RPM工具管理RPM包
- 從1開始的PHPStorm+Xdebug包搭建不包使用教程PHPORM
- 綠色ftp工具,綠色ftp工具下載,使用教程。FTP
- Java併發工具類:深入理解Concurrent包Java
- 開源線上表單工具 HeyForm 使用教程ORM
- 【Linux工具】yum和gdb詳細使用教程。Linux
- Linux yum 包管理工具使用教程Linux
- Windows 服務設定工具 WinSW 使用教程Windows
- Linux dnf 包管理工具使用教程Linux
- 關於soapUi工具的安裝使用教程UI
- 前端工具 | JS編譯器Monaco使用教程前端JS編譯
- 【精選】atoken錢包詳細使用教程 - atoken錢包安全嗎,atoken錢包靠譜嗎
- Qt開發工具使用QT
- 2024Webstorm安裝使用教程(JS開發工具,附啟用小妙招)WebORMJS
- percona-toolkit工具包的安裝和使用
- [開發教程]第33講:Bootstrap工具提示boot
- Charles 抓取移動裝置資料包基本使用教程
- critters 開發包的使用案例分享