Skip to content

Commit

Permalink
Version 3.7 - Add Raw TCP device
Browse files Browse the repository at this point in the history
  • Loading branch information
ufrisk committed Jan 3, 2019
1 parent 8f3f9ce commit 33e75fb
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pcileech/devicerawtcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ BOOL DeviceRawTCP_ReadDMA(_Inout_ PPCILEECH_CONTEXT ctxPcileech, _In_ QWORD qwAd

cbRead = 0;
while (cbRead < Rx.cb) {
len = recv(ctxrawtcp->Sock, (char *)pb + cbRead, Rx.cb - cbRead, 0);
len = recv(ctxrawtcp->Sock, (char *)pb + cbRead, (int)(Rx.cb - cbRead), 0);
if (len == SOCKET_ERROR || len == 0) {
fprintf(stderr, "ERROR: recv() fails\n");
return 0;
Expand Down Expand Up @@ -213,7 +213,7 @@ BOOL DeviceRawTCP_WriteDMA(_Inout_ PPCILEECH_CONTEXT ctxPcileech, _In_ QWORD qwA
}

if (Rx.cmd != MEM_WRITE) {
fprintf(stderr, "ERROR: Memory write fail\n", cbRead);
fprintf(stderr, "ERROR: Memory write fail\n");
}

return cbWritten >= cb;
Expand Down
11 changes: 6 additions & 5 deletions pcileech/help.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ VOID Help_ShowGeneral()
" Wait occurs after any other actions have been completed. \n" \
" -device: force the use of a specific hardware device instead of auto-detect.\n" \
" Affects all modes and commands. \n" \
" Valid options: USB3380, FPGA, SP605_TCP, <memory-dump-file-name> or \n" \
" TOTALMELTDOWN \n" \
" -device-addr: Remote address for -device SP605_TCP. \n" \
" -device-port: Remote TCP port for -device SP605_TCP. Default value: 28472. \n" \
" Valid options: USB3380, FPGA, SP605_TCP, RAWTCP, TOTALMELTDOWN or \n" \
" <memory-dump-file-name>. \n" \
" -device-addr: Remote address for -device RAWTCP and SP605_TCP. \n" \
" -device-port: Remote TCP port for -device RAWTCP and SP605_TCP. (optional). \n" \
" -device-opt[0-3]: Optional additional device configuration for some devices.\n" \
" FPGA device (NB! 0 = default!): -device-opt0 = delay read uS \n" \
" -device-opt1 = delay write uS, -device-opt2 = delay probe uS \n" \
Expand Down Expand Up @@ -142,7 +142,7 @@ VOID Help_ShowInfo()
{
printf(
" PCILEECH INFORMATION \n" \
" PCILeech (c) 2016-2018 Ulf Frisk \n" \
" PCILeech (c) 2016-2019 Ulf Frisk \n" \
" Version: " \
PCILEECH_VERSION_CURRENT \
" \n" \
Expand All @@ -155,6 +155,7 @@ VOID Help_ShowInfo()
" Google USB Driver - https://developer.android.com/sdk/win-usb.html \n" \
" FTDI FT601 Driver - http://www.ftdichip.com/Drivers/D3XX.htm \n" \
" PCIe Injector - https://github.com/enjoy-digital/pcie_injector \n" \
" iLO DMA firmware - https://www.synacktiv.com/posts/exploit/using-your-bmc-as-a-dma-device-plugging-pcileech-to-hpe-ilo-4.html \n" \
" Dokany - https://github.com/dokan-dev/dokany/releases/latest \n" \
" ---------------- \n" \
" Use with memory dump files in read-only mode. \n" \
Expand Down
2 changes: 1 addition & 1 deletion pcileech/pcileech.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define __PCILEECH_H__
#include "oscompatibility.h"

#define PCILEECH_VERSION_CURRENT "3.6.2"
#define PCILEECH_VERSION_CURRENT "3.7.0"

#define SIZE_PAGE_ALIGN_4K(x) ((x + 0xfff) & ~0xfff)
#define CONFIG_MAX_SIGNATURES 16
Expand Down
2 changes: 2 additions & 0 deletions pcileech/pcileech.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
<ClInclude Include="device605_tcp.h" />
<ClInclude Include="devicefile.h" />
<ClInclude Include="devicefpga.h" />
<ClInclude Include="devicerawtcp.h" />
<ClInclude Include="devicetmd.h" />
<ClInclude Include="dokan.h" />
<ClInclude Include="executor.h" />
Expand All @@ -219,6 +220,7 @@
<ClCompile Include="device605_tcp.c" />
<ClCompile Include="devicefile.c" />
<ClCompile Include="devicefpga.c" />
<ClCompile Include="devicerawtcp.c" />
<ClCompile Include="devicetmd.c" />
<ClCompile Include="executor.c" />
<ClCompile Include="extra.c" />
Expand Down
6 changes: 6 additions & 0 deletions pcileech/pcileech.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@
<ClInclude Include="pcileech_dll.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="devicerawtcp.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="device.c">
Expand Down Expand Up @@ -158,6 +161,9 @@
<ClCompile Include="pcileech_dll.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="devicerawtcp.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="Makefile">
Expand Down
Binary file modified pcileech_files/dll/pcileech.dll
Binary file not shown.
Binary file modified pcileech_files/dll/pcileech.lib
Binary file not shown.
Binary file modified pcileech_files/pcileech.exe
Binary file not shown.
9 changes: 8 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PCILeech Summary:
=================
PCILeech uses PCIe hardware devices to read and write from the target system memory. This is achieved by using DMA over PCIe. No drivers are needed on the target system.

<b>PCILeech works without hardware together with memory dump files and the Windows 7/2008R2 x64 [Total Meltdown / CVE-2018-1038](https://blog.frizk.net/2018/03/total-meltdown.html) vulnerability.</b>
PCILeech works without hardware together with memory dump files and the Windows 7/2008R2 x64 [Total Meltdown / CVE-2018-1038](https://blog.frizk.net/2018/03/total-meltdown.html) vulnerability. In addition to locally connected devices PCILeech also support DMA patched iLO interfaces.

PCILeech supports multiple memory acquisition devices. Primarily hardware based, but also dump files and software based techniques based on select security issues are supported. USB3380 based hardware is only able to read 4GB of memory natively, but is able to read all memory if a kernel module (KMD) is first inserted into the target system kernel. FPGA based hardware is able to read all memory.

Expand Down Expand Up @@ -52,6 +52,7 @@ Please find a device comparision table below.
| [SP605/TCP](https://github.com/ufrisk/pcileech-fpga/) | FPGA | TCP/IP | 100kB/s | Yes | Yes |
| [USB3380-EVB](usb3380.md) | USB3380 | USB3 | 150MB/s | No (via KMD only) | No |
| [PP3380](usb3380.md) | USB3380 | USB3 | 150MB/s | No (via KMD only) | No |
| [DMA patched HP iLO](https://www.synacktiv.com/posts/exploit/using-your-bmc-as-a-dma-device-plugging-pcileech-to-hpe-ilo-4.html) | TCP | TCP | 1MB/s | Yes | No |

Recommended adapters:
* PE3B - ExpressCard to mini-PCIe.
Expand Down Expand Up @@ -122,6 +123,9 @@ Mount the PCILeech Memory Process File System from a Windows 10 64-bit memory im
Dump memory using the the reported "TotalMeltdown" [Windows 7/2008R2 x64 PML4 page table permission vulnerability](https://blog.frizk.net/2018/03/total-meltdown.html).
* ` pcileech.exe dump -out memdump_win7.raw -device totalmeltdown -v -force `

Insert a kernel module into a running Linux system remotely via a [DMA patched HP iLO](https://www.synacktiv.com/posts/exploit/using-your-bmc-as-a-dma-device-plugging-pcileech-to-hpe-ilo-4.html).
* ` pcileech.exe kmdload -vvv -device rawtcp -device-addr 127.0.0.1 -device-port 8888 -kmd LINUX_X64_48 `

Generating Signatures:
======================
PCILeech comes with built in signatures for Windows, Linux, FreeBSD and macOS. For Windows 10 it is also possible to use the pcileech_gensig.exe program to generate alternative signatures.
Expand Down Expand Up @@ -187,3 +191,6 @@ v3.5
v3.6
* Various bug fixes (including 'missing dlls' issue).
* Additional functionality exported from DLL.

v3.7
* Support for RAWTCP device - used to communicate with [DMA patched HP iLO](https://www.synacktiv.com/posts/exploit/using-your-bmc-as-a-dma-device-plugging-pcileech-to-hpe-ilo-4.html). Thanks to [Synacktiv](https://www.synacktiv.com) for the contribution and the awesome research!

0 comments on commit 33e75fb

Please sign in to comment.