From 52b46f30a814a8c9b5ded929657606b6a24ca3c3 Mon Sep 17 00:00:00 2001 From: Antoine van Gelder Date: Wed, 26 Jun 2024 14:17:47 +0200 Subject: [PATCH] docs: update facedancer and usbproxy guides --- docs/source/getting_started_facedancer.rst | 32 ++++++++-------------- docs/source/getting_started_usbproxy.rst | 20 +++++++++++++- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/docs/source/getting_started_facedancer.rst b/docs/source/getting_started_facedancer.rst index 615b80fd..c136be93 100644 --- a/docs/source/getting_started_facedancer.rst +++ b/docs/source/getting_started_facedancer.rst @@ -76,36 +76,26 @@ Connect Hardware :width: 800 :alt: Connection diagram for using Cynthion with Facedancer. +Make sure that the target device is running a program that can receive keyboard input such as a terminal or text editor and that it has focus. 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(): - # Wait for device to connect - await asyncio.sleep(2) - - # Type a string with the device - await device.type_string("echo hello, facedancer\n") - - main(device, type_letters()) - +.. literalinclude:: ../../cynthion/python/examples/facedancer-rubber-ducky.py + :language: python + :linenos: Open a terminal and run: .. code-block :: sh - cd facedancer/examples python ./rubber-ducky.py + +If all goes well, you should see the string ``hello, facedancer`` typed into the target device. + +More Information +---------------- + +For further information, see the `Facedancer documentation `_. diff --git a/docs/source/getting_started_usbproxy.rst b/docs/source/getting_started_usbproxy.rst index 0894aab7..c104fb2f 100644 --- a/docs/source/getting_started_usbproxy.rst +++ b/docs/source/getting_started_usbproxy.rst @@ -13,7 +13,25 @@ Connect Hardware :alt: Connection diagram for using Cynthion with Facedancer. + Run a USBProxy example ---------------------- -TODO +Create a new Python file called ``usbproxy.py`` with the following content: + +.. literalinclude:: ../../cynthion/python/examples/facedancer-usbproxy.py + :language: python + :linenos: + +Open a terminal and run: + +.. code-block :: sh + + python ./usbproxy.py + +If all goes well you should see the output from device enumeration in your terminal and the proxied USB device should be detected by the target computer. + +More Information +---------------- + +For further information, see the `Facedancer USB Proxy documentation `_.