Commit Graph

56 Commits

Author SHA1 Message Date
adfoster-r7 7ebe8f207d Update modules/post/hardware/zigbee/zstumbler.rb 2025-04-28 20:12:59 +01:00
bcoles 04e1424e31 modules/post/hardware: Resolve RuboCop violations 2025-04-29 01:52:00 +10:00
adfoster-r7 a81a71c5df Run rubocop on post modules 2023-02-08 13:47:34 +00:00
Jay Turla 613d26743a Update diagnostic_state.rb 2021-10-04 07:31:06 +08:00
Jay Turla 8bdbf99c80 Add Diagnostic State Module
## Introduction
This module will keep the vehicle in a diagnostic state on rounds by sending tester present packet.

## Verification Steps

Fire up virtual CAN bus:

1. `sudo modprobe can`
2. `sudo modprobe vcan`
3. `sudo ip link add dev vcan0 type vcan`
4. `sudo ip link set up vcan0`

Launch msf:

5. Start `msfconsole`
6. `use auxiliary/server/local_hwbridge`
7. `set uripath testbus`
8. `run`
9. `use auxiliary/client/hwbridge/connect`
10. `set targeturi testbus`

## Options

```
Module options (post/hardware/automotive/diagnostic_state):

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   ARBID    0x7DF            no        CAN ID to perform ECU Hard Reset
   CANBUS                    no        CAN Bus to perform scan on, defaults to connected bus
   ROUNDS   500              yes       Number of executed rounds
   SESSION                   yes       The session to run this module on.
```

## Scenarios
You can test this module doing a candump and you should receive a response for each can frame in a loop at 0x7E8 when running UDS Simulator.

```
msf5 auxiliary(client/hwbridge/connect) > run
[*] Running module against 127.0.0.1

[*] Attempting to connect to 127.0.0.1...
[*] Hardware bridge interface session 1 opened (127.0.0.1 -> 127.0.0.1) at 2019-09-11 04:59:40 -0700
[+] HWBridge session established
[*] HW Specialty: {"automotive"=>true}  Capabilities: {"can"=>true, "custom_methods"=>true}
[!] NOTICE:  You are about to leave the matrix.  All actions performed on this hardware bridge
[!]          could have real world consequences.  Use this module in a controlled testing
[!]          environment and with equipment you are authorized to perform testing on.
[*] Auxiliary module execution completed
msf5 auxiliary(client/hwbridge/connect) > sessions

Active sessions
===============

  Id  Name  Type                   Information  Connection
  --  ----  ----                   -----------  ----------
  1         hwbridge cmd/hardware  automotive   127.0.0.1 -> 127.0.0.1 (127.0.0.1)

msf5 auxiliary(client/hwbridge/connect) > sessions -i 1
[*] Starting interaction with 1...

hwbridge > run post/hardware/automotive/diagnostic_state canbus=vcan0

[*] Putting the vehicle in a diagnostic state...
[*] In order to keep the vehicle in this state, you need to continuously send a packet to let the vehicle know that a diagnostic technician is present.
hwbridge >
```

You can use candump to verify the CAN messages being sent:

```
─$ candump vcan0
└─$ candump vcan0
  vcan0  7DF   [2]  01 3E
  vcan0  7E8   [4]  03 7E 00 00
  vcan0  7DF   [2]  01 3E
  vcan0  7E8   [4]  03 7E 00 00
  vcan0  7DF   [2]  01 3E
  vcan0  7E8   [4]  03 7E 00 00
  vcan0  7DF   [2]  01 3E
  vcan0  7E8   [4]  03 7E 00 00
  vcan0  7DF   [2]  01 3E
  vcan0  7E8   [4]  03 7E 00 00
  vcan0  7DF   [2]  01 3E
  vcan0  7E8   [4]  03 7E 00 00
  vcan0  7DF   [2]  01 3E
  vcan0  7E8   [4]  03 7E 00 00
  vcan0  7DF   [2]  01 3E
  vcan0  7E8   [4]  03 7E 00 00
  vcan0  7DF   [2]  01 3E
  vcan0  7E8   [4]  03 7E 00 00
  vcan0  7DF   [2]  01 3E
  vcan0  7E8   [4]  03 7E 00 00
  vcan0  7DF   [2]  01 3E
  vcan0  7E8   [4]  03 7E 00 00
  vcan0  7DF   [2]  01 3E
  vcan0  7E8   [4]  03 7E 00 00
  vcan0  7DF   [2]  01 3E
  vcan0  7E8   [4]  03 7E 00 00
  vcan0  7DF   [2]  01 3E
  vcan0  7E8   [4]  03 7E 00 00
  vcan0  7DF   [2]  01 3E
  vcan0  7E8   [4]  03 7E 00 00
  vcan0  7DF   [2]  01 3E
  vcan0  7E8   [4]  03 7E 00 00
  vcan0  7DF   [2]  01 3E

-- snippet --
```

UDS Server Output
```
└─$ ./uds-server -v -V "PWN3D" vcan0
Using CAN interface vcan0
Fuzz level set to: 0
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E
Pkt: 7DF#01 3E

-- snippet --
```
2021-10-04 01:35:31 +08:00
adfoster-r7 230c7b5e82 Remove repeatable session metadata 2021-09-28 18:51:51 +01:00
Jay Turla 70c400e883 Update ecu_hard_reset.rb 2021-09-27 19:39:06 +08:00
Jay Turla 9dc315094c Update ecu_hard_reset.rb 2021-09-27 19:30:36 +08:00
Jay Turla f60c492cf1 Add ECU Hard Reset for hwbridge 2021-09-27 18:58:39 +08:00
Jay Turla 31262ef807 Update ecu_hard_reset.rb 2021-09-25 11:12:34 +08:00
Jay Turla 2091f9c715 Update ecu_hard_reset.rb 2021-09-24 23:50:25 +08:00
Jay Turla b84f05c5ef Update ecu_hard_reset.rb 2021-09-24 23:41:29 +08:00
Jay Turla b5daf312e4 Update ecu_hard_reset.rb 2021-09-24 23:15:34 +08:00
Jay Turla b672d0246e Update ecu_hard_reset.rb 2021-09-24 22:59:39 +08:00
Jay Turla a38f27d157 Create ecu_hard_reset.rb 2021-09-24 22:50:44 +08:00
dwelch-r7 1617b3ec9b Use zeitwerk for lib/msf/core folder 2020-12-07 10:31:45 +00:00
Jay Turla b879a888f8 Indent everything in super to 2 spaces 2019-09-13 09:32:21 +08:00
Jay Turla 5fa9c5e21a Update mazda_ic_mover.rb
Changed ```0x10``` to ```0x01```
2019-09-12 12:49:45 +08:00
Jay Turla b3240a1819 Add mazda_ic_mover module that moves the instrument cluster
This module moves the needle of the accelorometer and speedometer of the Mazda 2 instrument cluster
2019-09-12 00:07:42 +08:00
William Vu 32334c2386 Update all module splats from http:// to https:// 2019-08-15 18:10:44 -05:00
William Vu f5f4c4bec2 Clean up module 2019-04-01 12:24:35 -05:00
PietroBiondi 2afd27a671 1)Fixed documentation format 2)Refactoring and more efficient loop 2019-03-30 17:12:15 +01:00
PietroBiondi cb7b9080bd 1) changed print_status with vprint_status 2) Fix iterations and line splits 3) Changed name of the module 4) removed DisclosureDate 2019-03-20 15:13:41 +01:00
PietroBiondi ce218fc86a Add can_flood post exploitation for CAN and added example list of frames 2019-03-20 13:17:41 +01:00
Pearce Barry 8344401484 Add docs, minor tweaks. 2017-12-17 18:15:49 -06:00
Pearce Barry 048b39ccd6 Initial commit of pdt module. 2017-12-14 09:23:21 -06:00
Craig Smith ad9329993d Added better padding and flowcontrol support. 2017-09-11 18:20:57 -07:00
Pearce Barry cfd377fbd4 Support padding on the CAN bus.
Also use a hash for passing options around instead of individual params.
2017-08-06 18:05:59 -05:00
Brent Cook 6300758c46 use https for metaploit.com links 2017-07-24 06:26:21 -07:00
g0tmi1k b8d80d87f1 Remove last newline after class - Make @wvu-r7 happy 2017-07-19 11:19:49 +01:00
g0tmi1k 3d4feffc62 OCD - Spaces & headings 2017-07-19 11:04:15 +01:00
g0tmi1k 4720d1a31e OCD fixes - Spaces 2017-07-14 08:46:59 +01:00
Corey Harding 50339289a7 Update rfpwnon.rb 2017-07-09 05:12:35 -04:00
Pearce Barry af3f1fbc37 Land #8332, Canprobe Module 2017-05-07 12:20:27 -05:00
Pearce Barry c05e7b3b58 Minor corrections and a tweak to appease msftidy. 2017-05-07 11:55:20 -05:00
Pearce Barry e3d3fa8e45 Tweak internal description formatting. 2017-05-07 11:31:36 -05:00
Pearce Barry b965bdcdae Appease msftidy and Travis. 2017-05-07 11:19:32 -05:00
William Vu 64452de06d Fix msf/core and self.class msftidy warnings
Also fixed rex requires.
2017-05-03 15:44:51 -05:00
Craig Smith 9877aa9ef9 Added documentation and cleand up how STOPID worked 2017-05-02 18:57:32 -07:00
Craig Smith 3519adbaef A basic CAN fuzzer. It probes the data regions of different CAN IDs.
The default is to use a set value but can iterate the full range.  It can
also add padding if necessary.  Not checks on returns or results of fuzzing.
2017-05-02 14:19:29 -07:00
Pearce Barry 31c03840bb Style fixes for HWBridge RF and a couple small bug fixes
I should have tweaked these earlier, my bad.
2017-03-26 13:45:19 -05:00
Pearce Barry c4279a837a Minor formatting/spelling/verbiage changes. 2017-03-20 17:37:12 -05:00
Craig Smith 2fde287424 Initial patch for rftransceiver (RfCat / YardstickOne) 2017-03-20 17:36:16 -05:00
Pearce Barry 2acd941b16 Merge branch 'master' into dtc_fix 2017-03-20 14:10:01 -05:00
Craig Smith 0be6b8c905 Fixes #8022
Adds detection for ELM327 chips reporting CAN ERROR when vehicle is off.
Addes some enhanced UDS Error codes.
Cleaned up reporting from getvinfo if the vehicle is off or not connected.
2017-03-20 13:49:39 -05:00
Pearce Barry 06ebb22a8f Land #8065, Zigbee Hardware Bridge Extension 2017-03-20 10:44:15 -05:00
Pearce Barry 095a110e65 Code and doc tweaks (minor).
Only one behavior change in the scan loop of zstumbler.rb to, when doing a scan across all the channels, keep it from retrying channel 11 again one last time just before it exits.
2017-03-16 21:43:36 -05:00
Craig Smith 78586f0dc9 Fixed an extra space at the EOL 2017-03-16 09:22:01 -07:00
Craig Smith f60dae0917 Lots of syntax fixups from rubocop 2017-03-08 09:21:33 -08:00
Craig Smith 4e9b8946d8 Fixed some small msftidy issues 2017-03-06 22:47:37 -08:00