Status | ||||
---|---|---|---|---|
|
Info |
---|
This documentation explains how to use the tcpdump module. This enables collect data exchanged on a smartphone. This module is not compatible with Windows. |
Note |
---|
This module is not compatible with Windows. |
Table of Contents | ||||
---|---|---|---|---|
|
...
Global pre-requisites
Functional testrunner
JobTestrunner downloaded and placed in the PATH
Measurement folder including :
configuration files config.yml and
job.yml
a gdsl script with the ‘testgb’ extension
Computer connected via Ethernet.
Expand | |||||||
---|---|---|---|---|---|---|---|
| |||||||
If the package is not installed, run the following command:
|
Expand | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
If the package is not installed, run the following command:
|
Modification of job.yml
Code Block | ||||
---|---|---|---|---|
| ||||
job: modules: tcpdump: true |
Modifications of config.yml
Code Block | ||||
---|---|---|---|---|
| ||||
target: tcpdump: # tcpdump module used to get data deviceIP: x.x.x.x # IP of the device to measure gatewayIP: x.x.x.x # IP of the gateway used to filter data networkInterface: xxxx # Network interface used to detect data (wlp2s0...) keepPcap: false # If true, it keeps the pcap file at the end of the measures ipFilters: # Other IP addresses used to filter data apple: false # If true, it filters data related with 17.0.0.0/8 |
...
deviceIP : The IP address of the phone in the network shared by your PC. Normally this is an address of the type
10.42.0.x
(replace the x with the correct number)gatewayIP : This is the IP address of your PC (which acts as a gateway) in the shared network. This can be found using the
ifconfig
command. Normally it is :10.42.0.1
networkInterface : The name of the network interface on the shared network. This can be found using the
ifconfig
command. You can also obtain it by typing the commandsudo tcpdump -D
. The network interface corresponding to the shared connection begins with "wl" (Wireless Lan) on Linux.keepPcap : If the boolean is set to true, the pcap file is saved at the end of the measurements.
ipFilters : These are filters to remove certain network exchanges from the measurement. For measurements on iOS, set the "apple" boolean to true to filter IP addresses corresponding to 17.0.0.0/8 (Apple).
Note |
---|
The IP of the telephone and the IP of the gateway must be in the same network. Normally the IPs are of the type |
Launch of measures
Run the testrunner as usual:
...
If the tcpdump module has been activated in the job.yml file, the root password will be requested on Linux and Mac OS when the testrunner is initialised.
Add rights to run tcpdump without password on Linux [optional]
The procedure comes from this website : https://askubuntu.com/questions/530920/tcpdump-permissions-problem
Create a pcap group and add yourself to it
Code Block | ||
---|---|---|
| ||
sudo groupadd pcap
sudo usermod -a -G pcap $USER |
Change the group of tcpdump and set permissions. You may need to change the path by
/usr/bin/tcpdump
.
Code Block | ||
---|---|---|
| ||
sudo chgrp pcap /usr/sbin/tcpdump
sudo chmod 750 /usr/sbin/tcpdump |
Use
setcap
to givetcpdump
the necessary permissions
Code Block | ||
---|---|---|
| ||
sudo setcap cap_net_raw,cap_net_admin=eip /usr/sbin/tcpdump |
Restart your PC. You should be able to run the tcpdump command without sudo.
Schema of situation
...