Skip to content

Commit 5c2fcd6

Browse files
committed
Merge pull request #25 from iSECPartners/dev
push it
2 parents 556595e + 23fe6d4 commit 5c2fcd6

File tree

95 files changed

+255
-13125
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+255
-13125
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Introspy-iOS Changelog
2+
======================
3+
4+
## v 0.4
5+
* Added support for iOS 7, including fixes to accommodate with seatbelt profile changes for System and AppStore apps in iOS 7.
6+
* Clarified output for arguments and return values Introspy-iOS cannot serialize (such as NSError).
7+
* Various bug fixes.
8+
9+
10+
## v 0.3
11+
Initial public release.

README.md

Lines changed: 47 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
1-
Introspy
2-
========
1+
Introspy-iOS
2+
============
33

44
Blackbox tool to help understand what an iOS application is doing at runtime
55
and assist in the identification of potential security issues.
66

7+
See http://isecpartners.github.io/Introspy-iOS/ for a quick introduction.
8+
79

810
Description
911
-----------
1012

11-
Introspy comprises two separate modules: a tracer and an analyzer.
13+
This is the repository for the Introspy-iOS tracer.
1214

13-
The tracer component can be installed on a jailbroken device and dynamically
14-
configured to hook security-sensitive iOS APIs at run-time. The tool records
15-
details of relevant API calls made by the application, including function
16-
calls, arguments and return values and persists them in a database.
17-
Additionally, the calls can optionally be sent to the Console for real-time
18-
analysis.
15+
The tracer can be installed on a jailbroken device to hook and log
16+
security-sensitive iOS APIs called by applications running on the device. The
17+
tool records details of relevant API calls, including arguments and return
18+
values and persists them in a database.
19+
Additionally, the calls are also sent to the Console for real-time analysis.
1920

20-
The Introspy analyzer can then be used to analyze a database generated by the
21-
tracer, and generate HTML reports containing the list of logged function calls
22-
as well as a list of potential vulnerabilities affecting the application.
21+
The database can then be fed to Introspy-Analyzer, a Python script to generate
22+
HTML reports containing the list of logged function calls as well as a list of
23+
potential vulnerabilities affecting the application. Introspy-Analyzer is hosted
24+
on a separate repository:
25+
https://github.com/iSECPartners/Introspy-Analyzer
2326

24-
See http://isecpartners.github.io/Introspy-iOS/ for a quick introduction.
2527

26-
Introspy Tracer
27-
---------------
28+
Installation
29+
------------
2830

29-
Users should first download the right pre-compiled Debian package:
30-
- https://www.dropbox.com/s/z5cwqk5wti3zsvd/com.isecpartners.introspy-v0.3-iOS_6.1.deb?dl=1
31+
Users should first download the latest pre-compiled Debian package available
32+
in the release section of the project page at:
33+
https://github.com/iSECPartners/Introspy-iOS/releases
3134

3235
### Dependencies
3336

@@ -60,132 +63,50 @@ Finally, kill and restart the App you want to monitor.
6063

6164
dpkg -r com.isecpartners.introspy
6265

63-
Introspy Analyzer
64-
-----------------
65-
66-
The analyzer requires Python 2.6 or 2.7.
67-
68-
### Command-line Usage
69-
70-
The Introspy tracer should be first used on the application to be tested, i.e.,
71-
by selecting it within the "Introspy - Apps" Settings menu on the iOS device.
72-
Then simply specify the device IP address when you run the analysis tool and
73-
select the appropriate application database. This will store a local copy of the
74-
database, which you can analyze again by specifying the database name as opposed
75-
to the device IP address.
76-
77-
$ python introspy.py 192.168.1.127 --outdir e-bank
78-
[email protected]'s password:
79-
0. ./Applications/94656731-0259-4AE9-9EEE-BADC9244AD82/introspy-com.isecpartners.e-bank.db
80-
1. ./introspy-com.apple.mobilemail.db
81-
2. ./introspy-com.isecpartners.introspytestapp.db
82-
Select the database to analyze: 0
83-
84-
The example above will generate an HTML report for the com.isecpartners.e-bank
85-
application within the newly created "e-bank" directory (specified by the
86-
`--outdir` option). The HTML report is intended to be the most common interface to
87-
the call database and allows users to browse the full call list or filter the
88-
list to view only those calls flagged by specific signatures.
89-
90-
#### Reporting
91-
92-
While the HTML formatted report is the most digestable format, the analysis tool
93-
can also be used directly from the command-line. Just as the HTML report allows
94-
you to show/hide signature groups and subgroups, you can specify groups (-g) as
95-
well as subgroups (-s) when running the analysis to limit the output to only
96-
those calls that match the filtering criteria.
97-
98-
$ python introspy.py introspy-com.isecpartners.e-bank.db -g IPC -s Schemes
99-
Specific URL schemes are implemented by the application.
100-
CFBundleURLTypes:CFBundleURLSchemes
101-
arguments =>
102-
CFBundleURLIsPrivate => nil
103-
CFBundleURLName => transfer-money
104-
CFBundleURLScheme => transfer-money
105-
106-
This example shows analysis of a local database with filtering options to limit
107-
the output to only display registered URL schemes. We can see here that URL
108-
requests with the transfer-money:// scheme will be handled by the application.
109-
110-
The analysis tool also allows users to print the entire call list similarly to
111-
the HTML report's "Traced Calls" view by specifiying the `--list` option,
112-
although this will print an undigestable amount of data to stdout and as such is
113-
not recommended.
114-
115-
#### Enumerations
116-
117-
The command-line tool also allows users to enumerate various data from the list
118-
of traced calls (via `--info`), inlcuding a list of all of the unique URLs
119-
accessed by the application (urls), all files accessed (files), as well as
120-
Keychain items that were added or modified (keys).
121-
122-
$ python introspy.py introspy-com.isecpartners.e-bank.db --info keys
123-
token = MGJiNzg1NGRkNzBkNGMyZTExNzc4NTA3OTdjNjNkNjFiY2Q1
124-
consumerKey = YzAwNzE4ZDZlYjYzOTM4NGM2NTc56j
125-
consumerSecret = NmUzYmNjNmQ2YjJjNWU1MDE0Zjk3NGI4MzU4ZWRl
126-
127-
### Programmatic Usage
128-
129-
>>> from analyzer import DBAnalyzer
130-
>>> analyzedDB = DBAnalyzer.DBAnalyzer('introspy-com.isecpartners.e-bank.db')
131-
>>> print analyzedDB.get_findings_as_JSON()
132-
...
133-
{"class": "CFBundleURLTypes",
134-
"method": "CFBundleURLSchemes"},
135-
"arguments":
136-
{"CFBundleURLName": "transfer-money",
137-
"CFBundleURLScheme": "transfer-money",
138-
"CFBundleURLIsPrivate": "nil"}
139-
}
140-
141-
### Signatures
142-
143-
Beyond simply listing the calls recorded by the Introspy tracer, the analysis
144-
tool allows you to apply predefined signatures to the call list and flag
145-
potential vulnerabilities or insecure configurations. Users can browse the list
146-
of flagged calls simply by browsing to the "Potential Findings" view within the
147-
generated HTML report and expanding the desired signature group.
148-
149-
The signatures themselves are defined in `analyzer/IOS_SIGNATURES.py` and can be
150-
easily extended.
151-
152-
Doing It Yourself
153-
-----------------
154-
155-
### Building the iOS Tracer From Source
66+
67+
Generating HTML Reports
68+
-----------------------
69+
70+
The tracer will store data about API calls made by applications in a database
71+
stored on the device (actually one in each application's folder). This database
72+
can be fed to a Python script call Introspy-Analyzer in order to generate HTML
73+
reports that make it a lot easier to review the data collected by the tracer.
74+
The script will also analyze and flag dangerous API calls in order to facilitate
75+
the process of identifying vulnerabilities within iOS applications.
76+
77+
Introspy-Analyzer is hosted on a separate repository:
78+
https://github.com/iSECPartners/Introspy-Analyzer
79+
80+
81+
Building Introspy-iOS
82+
---------------------
15683

15784
Most users should just download and install the pre-compiled Debian package.
15885
However, if you want to modify the library's functionality you will have to
159-
clone the source repository and build the debian package yourself.
86+
build the Debian package yourself.
16087

161-
git clone https://github.com/iSECPartners/introspy.git
88+
The build requires rpetrich's fork of the Theos suite, available at
89+
https://github.com/rpetrich/theos.
90+
For general instructions on how to install Theos, see
91+
http://www.iphonedevwiki.net/index.php/Theos/Getting\_Started but make sure
92+
you're using rpetrich's fork, not the official Theos.
16293

163-
The build requires the Theos suite to be installed;
164-
see http://www.iphonedevwiki.net/index.php/Theos/Getting\_Started .
16594
You first have to create a symlink to your theos installation:
16695

167-
cd introspy/ios-tracer/
96+
cd Introspy-iOS/src/
16897
ln -s /opt/theos/ ./theos
16998

17099
Then, the package can be built using:
171100

172101
make package
173102

174-
### Installing the iOS Tracer From Source
175-
176-
Once you've successfully created the debian package, you can use the Theos
177-
Makefiles to automatically install the package and respring the device:
103+
Once you've successfully created the debian package, you can use Theos to
104+
automatically install the package and re-spring the device by specifying the
105+
device's IP address in the THEOS_DEVICE_IP environment variable:
178106

179107
export THEOS_DEVICE_IP=192.168.1.127
180108
make install
181109

182-
Group and Subgroup Filtering
183-
----------------------------
184-
185-
The groups and subgroups correlate to filtering via the Settings menu as well as
186-
during offline analysis using the command-line. For details on exactly which
187-
methods correspond to each group and subgroup, refer to the wiki
188-
[documentation](https://github.com/iSECPartners/introspy/wiki).
189110

190111
License
191112
-------

analyzer/.gitignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)