Giter Site home page Giter Site logo

iphone-tools's Introduction

iPhone-Tools

Collection of tooling related to iOS/iPhones All of these tools require the device to be connected to a PC via USB, and you must trust the PC from the iPhone.

Dependencies

You pymobiledevice3 is required for these tools to work. After cloning the repository, you can install it via python3 -m pip install -r requirements.txt

iPhone-ntop.py

This script is designed to be useful for detecting malware or other abnormal processes sending traffic on Apple iOS. By building a baseline of which process names have network activity, one can look for outliers. This is a similar technique that is used in the Mobile Verification Toolkit, which uses very similar logs (datausage.sqlite), except this is run in real time on the device instead of using logs extracted from backups. The script opens a syslog stream from the target device. It then scans the logs for Data Usage events generated by symptomsd, parses the log, and monitors which processes are using WiFi/Cellular data. It displays this data in a CLI interface similar to the top command. This could be used in some cases to detect malware present on an iPhone. Fullscreen your terminal before running, the curses interface doesn't display properly in a small terminal.

usage: iPhone-ntop.py [-h] [--jsonfile JSONFILE] [--output OUTPUT]
                      [--sortby SORTBY]

Monitor iPhone syslog stream for data usage events, and create a live table of
processes using WiFi/Cellular data.

options:
  -h, --help           show this help message and exit
  --jsonfile JSONFILE  File path to load a json state file previously saved
                       with --output
  --output OUTPUT      File path to save the current state of the network
                       process table upon exiting the application. Can be
                       loaded later with the --jsonfile argument.
  --sortby SORTBY      Select which field to sort by when displaying
                       information. Can be uniqueFlowIds, wifiRx, wifiTx,
                       cellRx, cellTx, wifiDeltaRx, wifiDeltaTx, cellDeltaRx,
                       or cellDeltaTx.

The fields that are defined are as follows

Process Name - Name of the process making network connections

uniqueFlowIds/# Unique Flows - There is a field called Flow ID in the Data Usage events, this appears to correspond to unique flows for a specific network request. A larger number of these may indicate the process is opening a large number of sockets. The script keeps tally of the total number of unique flow IDs observed for a given process name.

wifiRx - Bytes received via the WiFi interface for the given process name

wifiTx - Bytes sent via the WiFi interface for the given process name

cellRx - Bytes received via the cellular interface for the given process name

cellTx - Bytes sent via the cellular interface for the given process name

wifiDeltaRx - Every time a Data Usage event is generated for a process, this field indicates the number of bytes that has increased in the wifiRx field since the last observed event for a given process name.

wifiDeltaTx - Every time a Data Usage event is generated for a process, this field indicates the number of bytes that has increased in the wifiTx field since the last observed event for a given process name.

cellDeltaRx - Every time a Data Usage event is generated for a process, this field indicates the number of bytes that has increased in the cellRx field since the last observed event for a given process name.

cellDeltaTx - Every time a Data Usage event is generated for a process, this field indicates the number of bytes that has increased in the cellTx field since the last observed event for a given process name.

Save the output to a json file when exiting the application by using the --output parameter. It is possible to load those same json files back into the program using the --jsonfile parameter. Choose which field to sort by using the --sortby parameter.

iPhoneDNS-monitor.py

This is currently a crude script in development that monitors DNS requests/IP connections by specific processes on an iPhone, and keeps track and makes a state table of which processes have connected to which domains/IP addreses. This requires scapy.

procList.py

This script gets a process listing from the target device. This includes process ID and process name

logger.py

This script extracts saved logs from the device's storage, and saves them to a directory named iPhoneLogs-TIMESTAMP . These logs are in a Unified Log format. You can parse these binary log files using a tool such as Mandiant's unifiedlog_parser

iphone-tools's People

Contributors

gwillgues avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.