-
-
Notifications
You must be signed in to change notification settings - Fork 92
REST API
Simone Margaritelli edited this page Dec 18, 2024
·
2 revisions
Since v0.10.0 Legba has a REST API feature that can be activated by using the --api address:port
command line argument.
To start the API (it is recommended to always bind it to localhost) on a given port:
legba --api 127.0.0.1:8080
Returns a list of available plugins and their options:
[
{
"name": "amqp",
"description": "AMQP password authentication (ActiveMQ, RabbitMQ, Qpid, JORAM and Solace).",
"strategy": "username_and_password",
"options": {
"amqp_ssl": {
"name": "amqp_ssl",
"description": "Enable SSL for AMQP",
"value": false
}
},
"override_payload": null
},
... etc etc ...
]
POSTs an array of command line arguments to start a new Legba session.
[
"http",
"-T",
"localhost",
"-U", "admin",
"-P", "admin"
]
The new session identifier:
54e54b44-db39-4b1d-819a-dd12926a59bf
Returns a session status given its identifier:
{
"id": "54e54b44-db39-4b1d-819a-dd12926a59bf",
"plugin_name": "http",
"targets": [
"localhost"
],
"process_id": 45178,
"client": "127.0.0.1:64829",
"argv": [
"http",
"-T",
"localhost",
"-U",
"admin",
"-P",
"admin"
],
"started_at": 1734528859,
"statistics": {
"tasks": 12,
"memory": "24.8 MiB",
"targets": 1,
"attempts": 1,
"errors": 0,
"done": 0,
"done_percent": 0.0,
"reqs_per_sec": 0
},
"loot": [],
"output": [
"legba v0.10.0",
"[INFO ] target: localhost",
"[INFO ] username -> string 'admin'",
"[INFO ] password -> string 'admin'",
"[ERROR] [localhost] attempt 5/5: error sending request for url (http://localhost/): error trying to connect: tcp connect error: Connection refused (os error 61)",
"[INFO ] runtime 5.009478792s"
],
"completed": {
"completed_at": 1734528864,
"exit_code": 0,
"error": null
}
}
Stops a session given its identifier.
List all available sessions.
- Installation and Building
- Usage & Main Options
- REST API
- Recipes
- Plugins
- AMQP (ActiveMQ, RabbitMQ, Qpid, JORAM and Solace)
- DNS
- FTP
- HTTP
- IMAP
- Kerberos
- LDAP
- MongoDB
- MQTT
- Microsoft SQL
- MySQL
- Oracle
- Port Scanner
- PostgreSQL
- POP3
- RDP
- Redis
- Samba
- ScyllaDB / Cassandra
- SSH / SFTP
- SMTP
- SOCKS5
- STOMP (ActiveMQ, RabbitMQ, HornetQ and OpenMQ)
- Telnet
- VNC
- Custom Binary