Commit Graph

4093 Commits

Author SHA1 Message Date
Grant Willcox e21812fa5c Land #15864, fix #15856, fix shell_to_meterpreter to detect x64 windows and return an x64 meterpreter session 2021-11-24 17:41:31 -06:00
Grant Willcox 1b9f9f0620 Add in final review fixes to handle Windows ARM if ever encountered 2021-11-24 16:37:21 -06:00
Jeffrey Martin 21a6a18d92 trade URI.encode & URI.escape for Ruby 3
Ruby 3 removed the `URI.escape` methods however access to
the a parse for the same RFC is stil available at `URI::DEFAULT_PARSER.escape`.

Per the Ruby forum [comment](https://bugs.ruby-lang.org/issues/17309#note-1) this should equal.
2021-11-22 14:11:03 -06:00
Tim W 423810ca5c fix shell_to_meterpreter cmd_exec powershell 2021-11-22 03:11:26 +00:00
Tim W f2d7f33280 run rubocop on shell_to_meterpreter 2021-11-11 16:00:05 +00:00
Tim W 7a2eb1cbcb fix #15856, fix shell_to_meterpreter to detect x64 windows and return an x64 meterpreter session 2021-11-11 14:40:18 +00:00
dwelch-r7 73e55fcaee Land #15665, Add Meterpreter compatibility metadata 2021-10-29 12:45:26 +01:00
Christophe De La Fuente 1befd545e3 Land #15558, add module to access a sessions filesystem in a browser 2021-10-25 18:37:42 +02:00
Tim W 86d1e3cb0a fix get_drives format 2021-10-25 17:30:47 +01:00
adfoster-r7 9f0804cbfb Fix Meterpreter spelling mistake 2021-10-12 23:40:43 +01:00
adfoster-r7 28eab4d871 Add Meterpreter compatibility metadata 2021-10-06 13:54:51 +01: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 26e317d093 Land #15707, Add ECU Hard Reset for hwbridge 2021-09-28 19:18:46 +01:00
adfoster-r7 230c7b5e82 Remove repeatable session metadata 2021-09-28 18:51:51 +01:00
bwatters ded4401b2b More rubocop fixes.... 2021-09-27 12:34:07 -05:00
bwatters 082948f8d9 Fix references to new global and fix a forgotten module 2021-09-27 12:26:53 -05:00
bwatters 6e08c6087e Rubocop corrections 2021-09-27 12:26:53 -05:00
Kazuyoshi Maruta 77e144b668 Add a method to check if the folder containing the artifact exists 2021-09-27 12:26:53 -05:00
Kazuyoshi Maruta 0d021deb0c Update modules with rubocop 2021-09-27 12:26:53 -05:00
Kazuyoshi Maruta e6d2c01ad2 Run Rubocop for aim.rb 2021-09-27 12:26:53 -05:00
KazuCyber aa9598cd20 Rename ICQ.rb to icq.rb 2021-09-27 12:26:53 -05:00
Kazuyoshi Maruta 09ed5b671e Add xchat.rb, Add kmeleon.md 2021-09-27 12:26:53 -05:00
KazuCyber 81719f6613 Update aim.rb
Bug fix.
2021-09-27 12:26:52 -05:00
Kazuyoshi Maruta 37cc6e540e Add modules, Rename a module 2021-09-27 12:26:52 -05:00
Kazuyoshi Maruta c1742a23b9 Update wording on Module documentation. Replace EXTRACT_CREDENTIALS_FROM_FILE with EXTRACT_DATA 2021-09-27 12:26:52 -05:00
Kazuyoshi Maruta e582c15f56 Update & and & to 'and' 2021-09-27 12:26:52 -05:00
Kazuyoshi Maruta 94d3f87461 Update artifact description in line.rb 2021-09-27 12:26:52 -05:00
Kazuyoshi Maruta dc6f6a8f25 Packrat: 29 post exploitation modules 2021-09-27 12:26:52 -05:00
adfoster-r7 959527a4c4 Land #15669, Add meterpreter compatibility metadata to screenshare module 2021-09-27 15:18:01 +01:00
Jay Turla 70c400e883 Update ecu_hard_reset.rb 2021-09-27 19:39:06 +08:00
adfoster-r7 06762d0934 Update references to railgun to be consistent 2021-09-27 12:37:14 +01: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
adfoster-r7 e81f1b5687 Gracefully fallback to sesion.ui.screenshot when espia is not supported 2021-09-23 21:10:40 +01:00
Tim W 4d3dda67ea fix msftidy 2021-09-23 13:02:17 +01:00
Tim W 18015e5a0e add support for powershell sessions 2021-09-23 13:02:17 +01:00
Tim W d3a372e92b add support for shell sessions 2021-09-23 13:02:17 +01:00
Tim W fad8aef5f7 add support for 404 and 500 if files are inaccessible 2021-09-23 13:02:17 +01:00
Tim W fdea8bb805 add module to access a sessions filesystem in a browser 2021-09-23 13:02:17 +01:00
Tim W f540c2ad8f move get_drives to file mixin 2021-09-23 13:02:17 +01:00
adfoster-r7 39ca4660a9 Add meterpreter compatibility metadata to screenshare module 2021-09-15 17:34:57 +01:00
Grant Willcox cec3a4bc46 Land #15601, Add Geutebruck Post Exploitation Module 2021-09-14 10:03:21 -05:00
adfoster-r7 1499b1988e Land #15609, Add Meterpreter compatibility commands 2021-09-13 15:21:03 +01:00