Skip to content

Commit

Permalink
Improve the README
Browse files Browse the repository at this point in the history
  • Loading branch information
oleavr committed Aug 11, 2019
1 parent e9de760 commit b940623
Showing 1 changed file with 78 additions and 4 deletions.
82 changes: 78 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,89 @@
### How to build and run
# AirSpy

Tool for exploring Apple's AirDrop protocol implementation on i/macOS,
from the server's perspective.

Dumps requests and responses along with a linear code coverage trace
of the code processing each request.

## Building

```sh
$ git clone git://github.com/nowsecure/airspy.git
$ git clone https://github.com/nowsecure/airspy.git
$ cd airspy/
$ npm install
```

## Running

To spy on the implementation:

```sh
# On a local macOS system:
$ node dist/bin/airspy.js

# Or on a USB-connected iOS device:
$ node dist/bin/airspy.js -U
```

Output files are written to `out/`.
Then pop open the AirDrop UI on a nearby i/macOS device. This should
result in data being captured and written to `out/$serial/events.log`,
where `$serial` is a zero-based number incrementing with each run.
Each request/response also gets written out to separate files for
easy inspection and diffing.

It is also possible to replay an `events.log` from a previous run,
which will re-generate the other output files:

```sh
$ node dist/bin/airspy.js -r out/0/events.log
```

This is also useful if you want to tweak the parsing of the requests
to generate better or additional output artifacts. (PRs welcome!)

Sample output directory:

```sh
$ ls -1 out/0/
001-post-discover-coverage-modules.log
001-post-discover-coverage-symbols.log
001-post-discover-request-body.plist
001-post-discover-request-head.txt
001-post-discover-response-body.plist
001-post-discover-response-head.txt
002-post-ask-coverage-modules.log
002-post-ask-coverage-symbols.log
002-post-ask-request-body.plist
002-post-ask-request-head.txt
002-post-ask-response-body.plist
002-post-ask-response-head.txt
003-post-upload-request-head.txt
003-post-upload-response-head.txt
events.log
$
```

Then you may want to compare the code coverage traces for two requests.

For example to compare the modules involved, and in which order:

```sh
$ diff -u 001-post-discover-coverage-modules.log 002-post-ask-coverage-modules.log
```

And to compare the basic blocks involved, and in which order:

```sh
$ diff -u 001-post-discover-coverage-symbols.log 002-post-ask-coverage-symbols.log
```

One example is that by looking at where execution first diverges, you
immediately know where the implementation decides what kind of request
it's dealing with, so you can inspect that code with r2. Or, you might
want to use it to guide a fuzzer.

### Development workflow
## Development workflow

To continuously recompile on change, keep this running in a terminal:

0 comments on commit b940623

Please sign in to comment.