Skip to content

Non interactive Mode

Marco Lancini edited this page Jun 5, 2017 · 3 revisions

needle-cli.py is the non-interactive interface of needle, which can be used to completely script the framework.

Supported options include:

Switch Description
-G show available global options
-g set a global option (e.g., -g DEBUG=True)
-M show modules
-C runs a command at the global context (e.g., -C "exec_command id")
-m specify the modules to run and their options.
The format accepted is: -m <module_name>#<list of options>
(e.g., -m binary/info/metadata -m device/agent_client#COMMAND=OS_VERSION)
--no-check disable version check

Putting all together:

python needle-cli.py -g DEBUG=True -g SKIP_OUTPUT_FOLDER_CHECK=True -g APP=mwr.ios.dvia -G -C "exec_command id" -m binary/info/metadata -m device/agent_client#COMMAND=OS_VERSION

The command above will, in order:

  • set few global options (DEBUG, SKIP_OUTPUT_FOLDER_CHECK, APP)
  • list all the global options
  • run a global command (exec_command id)
  • run some modules (binary/info/metadata, and device/agent_client with the COMMAND=OS_VERSION option)

As always, you will find all the collected artifacts (and issues) in the folder specified by the global OUTPUT_FOLDER.

CI Integration

Non-interactive mode (together with the automatic issue detection feature) enabled needle to be integrated in a CI pipeline.

For an example on how to integrate needle with Jenkins, please see the related blog post: