forked from rapid7/metasploit-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support to test custom payload branches
- Loading branch information
1 parent
8fa437e
commit 90ac288
Showing
9 changed files
with
231 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
## Setup | ||
|
||
This contains setup steps used for acceptance testing of the `cmd_exec` API. We will make use of the gcc docker image to | ||
build out the C binaries to then be uploaded to the host machine, so they can be used as part of the `cmd_exec` | ||
create process API. | ||
|
||
This directory contains: | ||
- C executable `show_args.c` | ||
This file is used as part of the `cmd_exec` testing as it requires a file to take args, then loop over them and output | ||
those args back to the user. | ||
|
||
- Makefile to build the binaries `makefile.mk` | ||
This file is used to create the binaries for both Windows and Linux that the docker command below will make use of. | ||
|
||
- Precompiled binaries for Windows | ||
- `show_args.exe` | ||
|
||
- Precompiled binaries for Linux and Mettle | ||
- `show_args` | ||
|
||
- Precompiled binaries for macOS | ||
- `show_args_macos` | ||
|
||
## Compile binaries locally | ||
|
||
We make use of gcc for this: https://hub.docker.com/_/gcc | ||
|
||
- Run: | ||
```shell | ||
docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp gcc:11.4.0 /bin/bash -c "apt update && apt install -y gcc-mingw-w64 && make all -f makefile.mk" | ||
``` | ||
|
||
You will need to compile the OSX payload separately on an OSX machine, Docker is not supported. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
all: show_args_linux show_args_windows | ||
show_args_linux: show_args.c | ||
cc show_args.c -o show_args_linux | ||
show_args_windows: show_args.c | ||
x86_64-w64-mingw32-gcc show_args.c -o show_args.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
int printf(const char *format, ...); | ||
|
||
int main(int argc, char *argv[]) { | ||
for (int i = 0; i < argc; i++) { | ||
printf("%s\n", argv[i]); | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters