Analyze the network traffic of an app in Colander
Advanced guide · written by Esther Onfroy
This guide shows how to import the results of a PiRogue experiment into Colander, decrypt and decode the network traffic of the app, apply detection rules to it and generate a report.
Prerequisites
- a PiRogue experiment: the output folder of
pirogue-intercept-gatedorpirogue-intercept-single, see Intercept and decrypt the TLS traffic of an app - a case in Colander to store the analysis
To understand what to look for in the traffic of an app, read Data collected by mobile apps. The screen displaying each transmission is described in Network transmission view.
- Instrument the mobile device:
pirogue-intercept-gated -o output - Wait until it says
Waiting for dataand start the application to be analyzed - Hit
Ctrl + Cwhen done with the app - Upload the experiment to Colander:
pirogue-colander collect-experiment -c "<ID of your case>" output/ - Upload an artifact to Colander:
pirogue-colander collect-artifact -c "<ID of your case>" <path of the file to be uploaded>
Connect your PiRogue to Colander
You only need to do this once per PiRogue. In Colander, click your username at the top right of the interface to find the exact command to run on your PiRogue.
This command looks like:
pirogue-colander config -u "<URL for your Colander server>" -k "<your API key>"
This command will configure the connector for Colander.
If the command pirogue-colander is not found, install the package pirogue-colander-connector by running the following commands on your PiRogue:
sudo apt update
sudo apt install -y pirogue-colander-connector
This will update the list of available packages and install the necessary tools to connect your PiRogue to Colander.
Import the experiment
Use the pirogue-colander command to upload all the files generated during the instrumentation of the app. As a reminder, the output folder typically contains the following files, described in Experiment files:
output/
|-- ad_ids.txt
|-- aes_info.json
|-- device.json
|-- experiment.json
|-- screen.mp4
|-- socket_trace.json
|-- sslkeylog.txt
`-- traffic.pcap
The command pirogue-colander uses the file experiment.json to determine the different files to be uploaded to Colander. In Colander, select or create the case you want to upload these artifacts into and click on Collect / PiRogue experiment. At the bottom of the PiRogue experiment creation form, you will find a command to be executed on your PiRogue.
This command looks like:
pirogue-colander collect-experiment -c "<ID of your case>" <path of the folder containing your experiment>
If you want to upload the APK or XAPK file corresponding you have used to install the app, specify its path in the -t parameter:
pirogue-colander collect-experiment -c "<ID of your case>" -t <path to the APK or XAPK file> <path of the folder containing your experiment>
The command pirogue-colander collect-experiment will automatically upload all the files to Colander and create a new PiRogue experiment with the name you provided when asked.
As an example, if the folder containing generated files is located at my_experiment/output and the APK at my_experiment/my_app.apk, the command to run on the PiRogue looks like:
pirogue-colander collect-experiment -c "<ID of your case>" -t my_experiment/my_app.apk my_experiment/output
This command will ask for the name of the experiment and, if you specified an (X)APK file, it will ask you to choose a type for this artifact, select Android sample. After completion, go back in Colander, in the Collect workspace, select PiRogue experiment and check the details of the newly created one.
If you want to upload other artifacts stored on your PiRogue, use the command:
pirogue-colander collect-artifact -c "<ID of your case>" <path of the file to be uploaded>
You can find this command listed in Colander Collect / Artifact at the bottom of the artifact creation form.

Decrypt the network traffic
In Colander, open the details of your newly created PiRogue experiment and click on the button Decrypt. This will start the automatic traffic decryption in background, this could take a few minutes depending on the amount of traffic.
After a few minutes, refresh the details of your experiment: the decrypted transmissions are listed, see Network transmission view.
PiRogue does not support all TLS libraries. This means that the PiRogue and Colander may not be able to capture some TLS traffic. Colander only displays HTTP traffic, do not forget to check the other protocols by opening your PCAP file with Wireshark.
You can open the PCAP file with Wireshark and specify the key log file in Settings > Protocols > TLS. This way, Wireshark will automatically decrypt TLS traffic.
Decode payloads
The next step is to go through all network transmissions and manually decode the data/payload/content that has not been automatically decoded. To make easier for you, Colander can send the raw data (encoded in hex) or the decrypted data (if encrypted before transmission) to CyberChef. By default, the data is encoded in hexadecimal.
Write your recipe and once you are happy with its result, copy it, go back in Colander, click on Import decoded content, paste the output of your recipe and click on Save. Keep in mind that the detection rules will be applied on the decoded content your imported.
In some cases, Colander is not capable of identifying payloads that have been encrypted before been transmitted. If you encounter a payload you are not able to decode or you suspect it is encrypted, check the content of the file aes_info.json you uploaded at the first step of this guide.
Write detection rules
Once you have decoded all the transmissions, it is time for you to write your Yara detection rules. To do so, in Collect / Detection rules create a new Yara rule. You can declare as many rules as you want in the Content section. All the Yara rules you have added to your case will be applied on:
- the URL/URI
- the HTTP headers
- the HTTP decoded payload
As an example, here follows are 2 simple rules detecting the model and the brand of the mobile device:
rule device_model
{
strings:
$s = "SM-G965F" nocase
condition:
$s
}
rule device_brand
{
strings:
$s = "samsung" nocase
condition:
$s
}
Once you are happy if your detection rules, in the details of your PiRogue experiment, click on Detect. It will automatically apply all your rules.
Please note you have to reapply your detection rules each time you modify them. Changes on the detection rules are not automatically taken into account.
Generate the report
When comes the time to generate the detection report, in the details of your PiRogue experiment, click on View report. It will open in another tab and you can use the print functionality of your web browser to save it as PDF.
This report contains:
- all artifacts such as PCAP file containing traffic data or screen recording and their digital signatures
- the definition of the detection rules and the detection summary
- the list of all transmissions listing the source and destination host, IP address and organization, the technical part of the application that has been handling the given data transmission (internal application code or 3rd-party SDKs)
- the identification and classification of the transmitted data such as advertising ID, location data etc.
- when applicable, the inferred purpose (such as analytics or advertisement) of the data collection using Exodus Privacy tracker classification to identify the recipient company
Colander analysis and detection accuracy can be assessed by opening the PCAP file and the SSL keylog file in Wireshark and manually verifying each data transmission.