|
| 1 | +.. _bettercap: |
| 2 | + |
| 3 | +========= |
| 4 | +bettercap |
| 5 | +========= |
| 6 | + |
| 7 | +This command communicates with the bettercap rest-api. It supports all |
| 8 | +endpoints of the official api. Please see `Bettercap Rest-Api Docs <https://www.bettercap.org/modules/core/apirest/>`_ |
| 9 | +for additional information. All commands return a json-formatted string. |
| 10 | + |
| 11 | +All commands support the setting: `connection`. This settings allows to query a api-command on a specific host. The name |
| 12 | +of the connection must be set in attackmate.yml. If connection is not set, the command will be executed on the first |
| 13 | +connection in attackmate.yml: |
| 14 | + |
| 15 | +.. code-block:: yaml |
| 16 | +
|
| 17 | + # .attackmate.yml: |
| 18 | + bettercap_config: |
| 19 | + default: |
| 20 | + url: "http://localhost:8081" |
| 21 | + username: btrcp |
| 22 | + password: secret |
| 23 | + remote: |
| 24 | + url: "http://somehost:8081" |
| 25 | + username: user |
| 26 | + password: secret |
| 27 | +
|
| 28 | + # bettercap-playbook.yml: |
| 29 | + commands: |
| 30 | + # this is executed on the remote host: |
| 31 | + - type: bettercap |
| 32 | + cmd: post_api_session |
| 33 | + data: |
| 34 | + cmd: "net.sniff on" |
| 35 | + connection: remote |
| 36 | + # this is executed on localhost: |
| 37 | + - type: bettercap |
| 38 | + cmd: get_events |
| 39 | +
|
| 40 | +.. note:: |
| 41 | + |
| 42 | + To configure the connection to the bettercap rest-api see :ref:`bettercap_config` |
| 43 | + |
| 44 | + |
| 45 | +post_api_session |
| 46 | +---------------- |
| 47 | + |
| 48 | +Post a command to the interactive session. |
| 49 | + |
| 50 | +.. code-block:: yaml |
| 51 | +
|
| 52 | + ### |
| 53 | + commands: |
| 54 | + - type: bettercap |
| 55 | + cmd: post_api_session |
| 56 | + data: |
| 57 | + cmd: "net.sniff on" |
| 58 | +
|
| 59 | +.. confval:: data |
| 60 | + |
| 61 | + Dict(key/values) of post-data: |
| 62 | + |
| 63 | + :type: Dict[str,str] |
| 64 | + |
| 65 | +get_file |
| 66 | +-------- |
| 67 | + |
| 68 | +Get a file from the api-server. |
| 69 | + |
| 70 | +.. code-block:: yaml |
| 71 | +
|
| 72 | + ### |
| 73 | + commands: |
| 74 | + - type: bettercap |
| 75 | + cmd: get_file |
| 76 | + filename: "/etc/passwd" |
| 77 | +
|
| 78 | +.. confval:: filename |
| 79 | + |
| 80 | + Full path of the filename on the api-server. |
| 81 | + |
| 82 | + :type: str |
| 83 | + |
| 84 | + |
| 85 | +delete_api_events |
| 86 | +----------------- |
| 87 | + |
| 88 | +Clear the events buffer. |
| 89 | + |
| 90 | +.. code-block:: yaml |
| 91 | +
|
| 92 | + ### |
| 93 | + commands: |
| 94 | + - type: bettercap |
| 95 | + cmd: delete_api_events |
| 96 | +
|
| 97 | +
|
| 98 | +get_events |
| 99 | +---------- |
| 100 | + |
| 101 | +Get all events |
| 102 | + |
| 103 | +.. code-block:: yaml |
| 104 | +
|
| 105 | + ### |
| 106 | + commands: |
| 107 | + - type: bettercap |
| 108 | + cmd: get_events |
| 109 | +
|
| 110 | +
|
| 111 | +get_session_modules |
| 112 | +------------------- |
| 113 | + |
| 114 | +Get session modules |
| 115 | + |
| 116 | +.. code-block:: yaml |
| 117 | +
|
| 118 | + ### |
| 119 | + commands: |
| 120 | + - type: bettercap |
| 121 | + cmd: get_session_modules |
| 122 | +
|
| 123 | +get_session_env |
| 124 | +--------------- |
| 125 | + |
| 126 | +Get session environment |
| 127 | + |
| 128 | +.. code-block:: yaml |
| 129 | +
|
| 130 | + ### |
| 131 | + commands: |
| 132 | + - type: bettercap |
| 133 | + cmd: get_session_env |
| 134 | +
|
| 135 | +get_session_gateway |
| 136 | +------------------- |
| 137 | + |
| 138 | +Get session gateway |
| 139 | + |
| 140 | +.. code-block:: yaml |
| 141 | +
|
| 142 | + ### |
| 143 | + commands: |
| 144 | + - type: bettercap |
| 145 | + cmd: get_session_gateway |
| 146 | +
|
| 147 | +get_session_interface |
| 148 | +--------------------- |
| 149 | + |
| 150 | +Get session interface |
| 151 | + |
| 152 | +.. code-block:: yaml |
| 153 | +
|
| 154 | + ### |
| 155 | + commands: |
| 156 | + - type: bettercap |
| 157 | + cmd: get_session_interface |
| 158 | +
|
| 159 | +get_session_options |
| 160 | +------------------- |
| 161 | + |
| 162 | +Get session options |
| 163 | + |
| 164 | +.. code-block:: yaml |
| 165 | +
|
| 166 | + ### |
| 167 | + commands: |
| 168 | + - type: bettercap |
| 169 | + cmd: get_session_options |
| 170 | +
|
| 171 | +get_session_packets |
| 172 | +------------------- |
| 173 | + |
| 174 | +Get session packets |
| 175 | + |
| 176 | +.. code-block:: yaml |
| 177 | +
|
| 178 | + ### |
| 179 | + commands: |
| 180 | + - type: bettercap |
| 181 | + cmd: get_session_packets |
| 182 | +
|
| 183 | +get_session_started_at |
| 184 | +---------------------- |
| 185 | + |
| 186 | +Get session started at |
| 187 | + |
| 188 | +.. code-block:: yaml |
| 189 | +
|
| 190 | + ### |
| 191 | + commands: |
| 192 | + - type: bettercap |
| 193 | + cmd: get_session_started_at |
| 194 | +
|
| 195 | +get_session_hid |
| 196 | +--------------- |
| 197 | + |
| 198 | +Get a JSON of the HID devices in the current session |
| 199 | + |
| 200 | +.. code-block:: yaml |
| 201 | +
|
| 202 | + ### |
| 203 | + commands: |
| 204 | + - type: bettercap |
| 205 | + cmd: get_session_hid |
| 206 | +
|
| 207 | +.. confval:: mac |
| 208 | + |
| 209 | + Optional parameter to return the info of a specific endpoint |
| 210 | + |
| 211 | + :type: str |
| 212 | + |
| 213 | +.. code-block:: yaml |
| 214 | +
|
| 215 | + ### |
| 216 | + commands: |
| 217 | + - type: bettercap |
| 218 | + cmd: get_session_hid |
| 219 | + mac: "32:26:9f:a4:08" |
| 220 | +
|
| 221 | +get_session_ble |
| 222 | +--------------- |
| 223 | + |
| 224 | +Get a JSON of the BLE devices in the current session. |
| 225 | + |
| 226 | +.. code-block:: yaml |
| 227 | +
|
| 228 | + ### |
| 229 | + commands: |
| 230 | + - type: bettercap |
| 231 | + cmd: get_session_ble |
| 232 | +
|
| 233 | +.. confval:: mac |
| 234 | + |
| 235 | + Optional parameter to return the info of a specific endpoint |
| 236 | + |
| 237 | + :type: str |
| 238 | + |
| 239 | +.. code-block:: yaml |
| 240 | +
|
| 241 | + ### |
| 242 | + commands: |
| 243 | + - type: bettercap |
| 244 | + cmd: get_session_ble |
| 245 | + mac: "32:26:9f:a4:08" |
| 246 | +
|
| 247 | +get_session_lan |
| 248 | +--------------- |
| 249 | + |
| 250 | +Get a JSON of the lan devices in the current session |
| 251 | + |
| 252 | +.. code-block:: yaml |
| 253 | +
|
| 254 | + ### |
| 255 | + commands: |
| 256 | + - type: bettercap |
| 257 | + cmd: get_session_lan |
| 258 | +
|
| 259 | +.. confval:: mac |
| 260 | + |
| 261 | + Optional parameter to return the info of a specific endpoint |
| 262 | + |
| 263 | + :type: str |
| 264 | + |
| 265 | +.. code-block:: yaml |
| 266 | +
|
| 267 | + ### |
| 268 | + commands: |
| 269 | + - type: bettercap |
| 270 | + cmd: get_session_lan |
| 271 | + mac: "32:26:9f:a4:08" |
| 272 | +
|
| 273 | +get_session_wifi |
| 274 | +---------------- |
| 275 | + |
| 276 | +Get a JSON of the wifi devices (clients and access points) in the current session |
| 277 | + |
| 278 | +.. code-block:: yaml |
| 279 | +
|
| 280 | + ### |
| 281 | + commands: |
| 282 | + - type: bettercap |
| 283 | + cmd: get_session_wifi |
| 284 | +
|
| 285 | +.. confval:: mac |
| 286 | + |
| 287 | + Optional parameter to return the info of a specific endpoint |
| 288 | + |
| 289 | + :type: str |
| 290 | + |
| 291 | +.. code-block:: yaml |
| 292 | +
|
| 293 | + ### |
| 294 | + commands: |
| 295 | + - type: bettercap |
| 296 | + cmd: get_session_wifi |
| 297 | + mac: "32:26:9f:a4:08" |
0 commit comments