Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facedancer v3.0.0 #78

Merged
merged 24 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
adba8c2
repo: phase 1 - move legacy facedancer code into deprecated
antoinevg Dec 18, 2023
14d00f1
repo: phase 2 - move facedancer future code into package root
antoinevg Dec 19, 2023
a91d890
repo: phase 3 - remove all references to deprecated code
antoinevg Dec 19, 2023
a4b13b5
examples: add USB Mass Storage example
antoinevg Dec 20, 2023
9c02294
repo: phase 4 - remove all deprecated code from the repository
antoinevg Dec 21, 2023
13afae3
Update usages of deprecated USBEndpoint.direction_in to USBDirection.IN
antoinevg Jan 9, 2024
fad0648
moondancer: add support for 'get_nak_status' api
antoinevg Jan 12, 2024
e57ce30
Add instructions to mass storage example for creating a disk image
antoinevg Jan 17, 2024
6baf7c7
goodfet: Fix serial import and device naming
antoinevg Jan 22, 2024
c11898a
goodfet: remove duplicate definition of GoodFETMonitorApp
antoinevg Jan 22, 2024
a7b24cf
request handlers decorated with @to_this_endpoint did not work
mrh1997 Jul 30, 2020
71384d2
request handlers decorated with @to_this_interface did not work with …
mrh1997 Jul 30, 2020
b15826f
Refactored handle_generic_get_descriptor_request() to static method
mrh1997 Jul 30, 2020
3e14f05
only check if handler index matches if the caller supports multiple i…
antoinevg Jan 22, 2024
e46251f
Move facedancer logging to a sub-logger of the python root
antoinevg Jan 23, 2024
4015c10
fix a small typo in endpoint log message
antoinevg Jan 23, 2024
86d6016
docs: add getting started documentation
antoinevg Jan 29, 2024
7685c95
Update FacedancerUSBHost for Facedancer v3
antoinevg Feb 1, 2024
66d00b9
Break required backend callbacks into an abstract FacedancerBackend c…
antoinevg Feb 6, 2024
34d599f
docs: Add documentation on writing a new Facedancer backend
antoinevg Feb 6, 2024
51c1662
Deprecate stall_ep0 from backend API
antoinevg Feb 6, 2024
adf8eb2
Add support for setting the USB speed of a Facedancer board
antoinevg Feb 7, 2024
b870154
Replace call to 'logging' with 'log' in moondancer backend
antoinevg Feb 20, 2024
c33b5aa
repo: update readme
antoinevg Feb 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 34 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,43 @@
# Facedancer 2.9
# Facedancer 3.0

This repository houses the next generation of Facedancer software. Descended from
the original GoodFET-based Facedancer, this repository provides a python module
that provides expanded Facedancer support-- including support for multiple boards
that provides expanded Facedancer support -- including support for multiple boards
and some pretty significant new features.


## Installation

Install this package with the following command:
```
pip install .
```

pip install .

After that you can import the facedancer package as usual:
```
$ python
>>> import facedancer
```

$ python
>>> import facedancer


## Where are my scripts?

In preparation for the 3.0 release of Facedancer, scripts in the "old" style have
been moved to `legacy-applets`. Their functionality should be unchanged.
The Facedancer 3.0 core features a ground-up rewrite of the original
emulation core which does not support legacy scripts.

If you're using scripts or training materials that depend on features
or APIs deprecated in `v3.0.x` you can install the latest `v2.9.x`
release of Facedancer with:

pip install "facedancer<=3"

Legacy applets and examples can be found in the [`v2.9.x`](https://github.com/greatscottgadgets/facedancer/tree/v2.9.x)
branch.


## What is a Facedancer?

Facedancer boards are simple hardware devices that act as "remote-controlled" USB
controllers. With the proper software, you can use these boards to quickly and
easily emulate USB devices-- and to fuzz USB host controllers!
easily emulate USB devices -- and to fuzz USB host controllers!

This particular software repository currently allows you to easily create emulations
of USB devices in Python. Control is fine-grained enough that you can cause all
Expand All @@ -39,9 +51,9 @@ For more information, see:
## USBProxy 'Nouveau' and Protocol Analysis

A major new feature of the newer Facedancer codebase is the ability to man-in-the
middle USB connections-- replacing one of the authors' original [USBProxy](https://github.com/dominicgs/usbproxy)
project. This opens up a whole new realm of applications-- including protocol analysis
and live manipulation of USB packets-- and is especially useful when you don't control
middle USB connections -- replacing one of the authors' original [USBProxy](https://github.com/dominicgs/usbproxy)
project. This opens up a whole new realm of applications -- including protocol analysis
and live manipulation of USB packets -- and is especially useful when you don't control
the software running on the target device (e.g. on embedded systems or games consoles).

```
Expand Down Expand Up @@ -82,33 +94,33 @@ export BACKEND=greatfet

## What boards are currently supported?

* All GoodFET-based Facedancers, including the common Facedancer21 (```BACKEND=goodfet```)
* The [Cynthion USB Test Instrument](http://greatscottgadgets.com/cyntion/) (```BACKEND=cynthion```)
* The [GreatFET One](http://greatscottgadgets.com/greatfet/) (```BACKEND=greatfet```)
* The NXP LPC4330 Xplorer board. (```BACKEND=greatfet```)
* The CCCamp 2015 rad1o badge with GreatFET l0adable (```BACKEND=greatfet```)
* All GoodFET-based Facedancers, including the common Facedancer21 (```BACKEND=goodfet```)
* RPi + Max3241 Raspdancer boards (```BACKEND=raspdancer```)

Note that hardware restrictions prevent the MAX3420/MAX3421 boards from emulating
more complex devices-- there's limitation on the number/type of endpoints that can be
set up. The LPC4330 boards-- such as the GreatFET-- have fewer limitations.
more complex devices -- there's limitation on the number/type of endpoints that can be
set up. The LPC4330 boards -- such as the GreatFET -- have fewer limitations.

For a similar reason, the MAX3420/MAX3421 boards (`BACKEND=goodfet` or `BACKEND=raspdancer`)
currently cannot be used as USBProxy-nv MITM devices. All modern boards (`BACKEND=greatfet`)
should be fully functional.

## What boards could be supported soon?

* The [LUNA USB multitool](https://github.com/greatscottgadgets/luna).
* Any Linux computer with gadgetfs support (e.g. the Pi Zero or Beaglebone Black)
* Anything supporting USB-over-IP.

## What features do you plan on adding?

The roadmap is hazy, but in addition to multi-board support, this repository
eventually will be home to some cool new features, such as:
The roadmap is under development, but in addition to multi-board support, this repository
will eventually be home to some cool new features, including:

* High-speed ("USB 2.0") device emulation on devices with USB 2.0 PHYs.
* On-the-fly
* On-the-fly generation of USB device controllers in gateware.

## Whose fault _is_ this?

Expand Down
113 changes: 0 additions & 113 deletions SPIFlash.py

This file was deleted.

2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sphinx==7.2.6
sphinx_rtd_theme==1.3.0
sphinx_rtd_theme==2.0.0
readthedocs-sphinx-search==0.3.2
jinja2==3.1.3
8 changes: 4 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

# -- Project information -----------------------------------------------------

project = 'Project name'
copyright = '2023, Person writing this'
author = 'Person writing this'
project = 'Facedancer'
copyright = '2023, Great Scott Gadgets'
author = 'Great Scott Gadget'

version = ''
release = ''
Expand All @@ -24,7 +24,7 @@
exclude_patterns = ['_build']
source_suffix = '.rst'
master_doc = 'index'
language = None
language = "en"
exclude_patterns = []
pygments_style = None

Expand Down
3 changes: 0 additions & 3 deletions docs/source/documentation_intro.rst

This file was deleted.

68 changes: 68 additions & 0 deletions docs/source/getting_started.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
================================================
Getting started with Facedancer
================================================


Install the Facedancer library
------------------------------

You can install the Facedancer library from the `Python Package Index (PyPI) <https://pypi.org/project/facedancer/>`__, a `release archive <https://github.com/greatscottgadgets/Facedancer/releases>`__ or directly from `source <https://github.com/greatscottgadgets/Facedancer/>`__.


Install From PyPI
^^^^^^^^^^^^^^^^^

You can use the `pip <https://pypi.org/project/pip/>`__ tool to install the Facedancer library from PyPI using the following command:

.. code-block :: sh
pip install facedancer
For more information on installing Python packages from PyPI please refer to the `"Installing Packages" <https://packaging.python.org/en/latest/tutorials/installing-packages/>`__ section of the Python Packaging User Guide.


Install From Source
^^^^^^^^^^^^^^^^^^^

.. code-block :: sh
git clone https://github.com/greatscottgadgets/facedancer.git
cd facedancer/
Once you have the source code downloaded you can install the Facedancer library with:

.. code-block :: sh
pip install .
Run a Facedancer example
------------------------

Create a new Python file called `rubber-ducky.py` with the following content:

.. code-block :: python
import asyncio
import logging
from facedancer import main
from facedancer.devices.keyboard import USBKeyboardDevice
from facedancer.classes.hid.keyboard import KeyboardModifiers
device = USBKeyboardDevice()
async def type_letters():
await asyncio.sleep(2)
await device.type_string("echo hello, facedancer\n")
main(device, type_letters())
Open a terminal and run:

.. code-block :: sh
python ./rubber-ducky.py
Loading