Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guest plugins #1241

Open
wants to merge 85 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
4010bdb
first real linjector commit
lacraig2 Sep 28, 2021
165f672
formatting changes
lacraig2 Sep 28, 2021
679d435
working fully now
lacraig2 Sep 29, 2021
fea1512
Fix linjector compilation issues
jamcleod Sep 29, 2021
86e8569
Cleanup linjector some
jamcleod Sep 29, 2021
7626b22
remove some prints
lacraig2 Sep 29, 2021
689ca74
initial gpm
lacraig2 Sep 29, 2021
07ada0a
early commits for guest_daemon
lacraig2 Sep 30, 2021
94c360f
fix publish message type
lacraig2 Sep 30, 2021
99838ba
add get_channel_from_nam to api
lacraig2 Sep 30, 2021
3cb13f5
added guest_plugin_manager initial implementation
lacraig2 Oct 1, 2021
061ef69
Add hyperfuse
jamcleod Oct 1, 2021
d4df893
Write length before payload in hyperfuse
jamcleod Oct 1, 2021
425da24
no. my hardcoded paths
lacraig2 Oct 1, 2021
dd14909
Merge branch 'linjector_stuff' of https://github.com/panda-re/panda i…
lacraig2 Oct 1, 2021
f483620
core changes
lacraig2 Oct 13, 2021
4fcd86e
Merge branch 'dev' into linjector_stuff
lacraig2 Oct 29, 2021
e17fa20
Merge branch 'dev' into linjector_base
lacraig2 Nov 17, 2021
f63c471
first attempt at pure syscall injection
lacraig2 Nov 17, 2021
3ab1e0a
some stuff
lacraig2 Nov 17, 2021
c7e1e6d
forward progress
lacraig2 Nov 18, 2021
7a17cfa
Linjector updates:
lacraig2 Dec 9, 2021
7939fd6
Hyperfuse updates:
jamcleod Nov 30, 2021
a2fdcd4
Begin porting linjector to arm/i386
jamcleod Dec 3, 2021
ae29be2
Fix hardcoded linjector dependency
jamcleod Dec 3, 2021
398d0e2
Guest shell updates:
jamcleod Dec 8, 2021
a1df2de
remove osi_linux removal
lacraig2 Dec 9, 2021
f40d99a
Add initial guest agent plugin build system
jamcleod Dec 9, 2021
d2217ed
Improve guest plugin build system
jamcleod Dec 10, 2021
e4efe26
Add guest plugin name-to-path lookup
jamcleod Dec 10, 2021
3a744c9
Remove debug prints from hyperfuse
jamcleod Dec 10, 2021
8e983e4
Add out-of-tree guest plugin building
jamcleod Dec 13, 2021
c778dfd
Remove hardcoded paths from guest_shell and hyperfuse
jamcleod Dec 13, 2021
321ad89
Have guest_plugin_manager load linjector; Guest plugin cleanup
jamcleod Dec 13, 2021
1ded2b1
Cleanup guest_shell PANDA plugin
jamcleod Dec 13, 2021
532d79d
Move guest_shell over to message_recv macro
jamcleod Dec 14, 2021
d6647ab
Another guest_shell cleanup pass
jamcleod Dec 14, 2021
de0089a
Move Rust example to crates.io panda-channels
jamcleod Dec 15, 2021
44fc6a2
Add guest_plugin_example to demonstrate host<->guest communication
jamcleod Dec 15, 2021
0121b7c
Add symlink support to hyperfuse
jamcleod Dec 17, 2021
4a8f980
Merge branch 'dev' into linjector_base4
jamcleod Dec 20, 2021
03223b9
Allow reading partial messages via hyperchannels
jamcleod Dec 21, 2021
c6b4224
Merge branch 'linjector_base4' of github.com/panda-re/panda into linj…
jamcleod Dec 21, 2021
c26bb60
Update hyperfuse TODO for clarity
jamcleod Jan 3, 2022
dbbf33b
Add guest plugin guide/docs
jamcleod Jan 11, 2022
847384c
Add API documentation to guest_plugin_manager
jamcleod Jan 12, 2022
a4a71b2
Add documentation to linjector
jamcleod Jan 12, 2022
6083a67
Add guest agent/linjector injection PPP callbacks
jamcleod Jan 13, 2022
59dbdc1
Get mmap working under linjector on i386
jamcleod Jan 19, 2022
8b15e28
Add guest agent frida support
jamcleod Feb 11, 2022
7616c10
Add ability to manually specify which process to inject the guest age…
jamcleod Feb 11, 2022
5d43ddd
Specify arm cross compiler linker
jamcleod Feb 25, 2022
e222e17
Add i386 support to linjector
jamcleod Mar 18, 2022
dde1bdc
Set arm guest plugins to build as armv5te
jamcleod Mar 21, 2022
ba520ad
Add anonymous guest agent channel API
jamcleod May 5, 2022
bead5f0
Add TCP passthrough plugin
jamcleod May 20, 2022
32f9fe3
Update TCP passthrough to use panda-rs 0.34
jamcleod May 20, 2022
f856c84
Rename print_tcp_servers to tcp_passthrough
jamcleod Jun 9, 2022
cbe4f31
Add TCP passthrough python API prototype
jamcleod Jun 10, 2022
ff534f8
Clean up TCP passthrough python API example
jamcleod Jun 10, 2022
585a2a8
Move tcp_servers to public PANDA repo
jamcleod Jun 17, 2022
80f1621
Add TCP passthrough API to pypanda
jamcleod Jun 17, 2022
d18e741
Add documentation to pypanda TCP passthrough API
jamcleod Jun 17, 2022
a6f9aac
Switch TCP passthrough default binding address
jamcleod Jul 13, 2022
3c8ca5d
Fix MIPS builds of linjector/guest_plugin_manager
jamcleod Jul 18, 2022
45df478
Fix build errors caused by unsupported guest agent architectures
jamcleod Jul 20, 2022
682c4c5
Add install script for musl toolchains
jamcleod Jul 28, 2022
548070f
Fix regression in linjector
jamcleod Aug 3, 2022
aa56b76
Fix panda-channels version for tcp guest plugin
jamcleod Aug 3, 2022
6fa6132
Add libfuse-dev to PANDA dependencies
jamcleod Aug 3, 2022
2455d05
Move guest_daemon in-tree
jamcleod Aug 3, 2022
edac98a
Remove unneeded nightly feature from guest_daemon
jamcleod Aug 3, 2022
b9326a3
Clean up guest_daemon warnings
jamcleod Aug 3, 2022
2eb59d1
Fix linjector arm support
jamcleod Aug 8, 2022
369459e
Merge branch 'dev' into linjector_base4
jamcleod Aug 15, 2022
af9c8d6
Fix libc version for mips64
jamcleod Aug 15, 2022
30e56c3
Disable guest plugin building if toolchains not installed
jamcleod Aug 15, 2022
0ac8097
Fix assumption that x86_64 musl Rust target is installed
jamcleod Aug 15, 2022
3e1fbca
Fix x86_64 musl Rust target typo
jamcleod Aug 16, 2022
81752af
Update linjector's panda-rs version
jamcleod Sep 7, 2022
10fbc7c
Separate linjector from guest plugin manager
jamcleod Sep 8, 2022
3840f1a
Fix guest_plugin docs link
jamcleod Oct 13, 2022
c29c59e
Add libfuse-dev to 22.04 build requirements
jamcleod Oct 13, 2022
df7b92a
Remove outdated commented code from guest_plugin_manager
jamcleod Oct 13, 2022
8bd67a2
Add check for guest plugins to setup.py
jamcleod Oct 17, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 90 additions & 1 deletion panda/Makefile.panda.target
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ extra-plugin-%: plog.pb-c.h plog.pb.h $(PANDA_API_EXT)
PLUGIN_SRC_ROOT="$(EXTRA_PLUGINS_PATH)/panda/plugins" \
V="$(V)" PLUGIN_NAME="$*" all,)

all: $(PLUGIN_SUBDIR_RULES) $(EXTRA_PLUGIN_SUBDIR_RULES)
all: $(PLUGIN_SUBDIR_RULES) $(EXTRA_PLUGIN_SUBDIR_RULES) build_guest_plugins

PROTO_FILES=$(wildcard $(addsuffix /*.proto,$(ALL_PLUGIN_SUBDIRS)))

Expand Down Expand Up @@ -147,6 +147,95 @@ clean-panda:
rm -f panda/panda_*.so;\
fi

#########################################################
# Guest Plugins

# determine list of guest plugins
# remove spaces from lines. skip lines starting with a #. concatenate the rest into
# a space-delimited list
PANDA_GUEST_PLUGINS=$(shell tr -d "[:blank:]" < $(SRC_PATH)/panda/guest_plugins/config.panda | grep -v "^\#" | xargs)
GUEST_PLUGIN_SUBDIR_RULES=$(patsubst %,guest-plugin-%, $(PANDA_GUEST_PLUGINS))
GUEST_PLUGIN_SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR)

ALL_GUEST_PLUGIN_RULES=$(GUEST_PLUGIN_SUBDIR_RULES)

ifdef EXTRA_GUEST_PLUGINS_PATH
EXTRA_GUEST_PLUGINS=$(shell tr -d "[:blank:]" < $(EXTRA_GUEST_PLUGINS_PATH)/config.panda | grep -v "^\#" | xargs)
EXTRA_GUEST_PLUGIN_SUBDIR_RULES=$(patsubst %,extra-guest-plugin-%, $(EXTRA_GUEST_PLUGINS))
ALL_GUEST_PLUGIN_RULES+=$(EXTRA_GUEST_PLUGIN_SUBDIR_RULES)
endif

ifeq ($(TARGET_NAME),i386)
GUEST_CC=i486-linux-musl-gcc
GUEST_RUST_TARGET=i686-unknown-linux-musl
else ifeq ($(TARGET_NAME),x86_64)
GUEST_RUST_TARGET=x86_64-unknown-linux-musl
else ifeq ($(TARGET_NAME),mips)
GUEST_CC=mips-linux-musl-gcc
GUEST_RUST_TARGET=mips-unknown-linux-musl
else ifeq ($(TARGET_NAME),mipsel)
GUEST_CC=mipsel-linux-musl-gcc
GUEST_RUST_TARGET=mipsel-unknown-linux-musl
else ifeq ($(TARGET_NAME),mips64)
GUEST_CC=mips64-linux-musl-gcc
GUEST_RUST_TARGET=mips64-unknown-linux-muslabi64
else ifeq ($(TARGET_NAME),arm)
GUEST_CC=arm-linux-musleabi-gcc
GUEST_RUST_TARGET=armv5te-unknown-linux-musleabi
else ifeq ($(TARGET_NAME),aarch64)
GUEST_CC=aarch64-linux-musl-gcc
GUEST_RUST_TARGET=aarch64-unknown-linux-musl
endif

HAS_GUEST_TOOLCHAIN="no"
ifeq ($(TARGET_NAME),x86_64)
ifeq (, $(shell rustup target list --installed | grep $(GUEST_RUST_TARGET)))
GUEST_PLUGIN_DISABLE_REASON="rust target ${GUEST_RUST_TARGET} not installed"
HAS_GUEST_TOOLCHAIN="no"
else
HAS_GUEST_TOOLCHAIN="yes"
endif
else ifeq ($(TARGET_NAME),ppc)
HAS_GUEST_TOOLCHAIN="no"
GUEST_PLUGIN_DISABLE_REASON="unsupported on ppc"
else ifneq (, $(shell which $(GUEST_CC)))
ifeq (, $(shell rustup target list --installed | grep $(GUEST_RUST_TARGET)))
GUEST_PLUGIN_DISABLE_REASON="rust target ${GUEST_RUST_TARGET} not installed"
HAS_GUEST_TOOLCHAIN="no"
else
HAS_GUEST_TOOLCHAIN="yes"
endif
else
GUEST_PLUGIN_DISABLE_REASON="musl toolchain not in PATH"
endif

ifeq ($(HAS_GUEST_TOOLCHAIN),"yes")
build_guest_plugins: $(ALL_GUEST_PLUGIN_RULES)
@echo "GUEST_PLUGINS: ${PANDA_GUEST_PLUGINS} ${EXTRA_GUEST_PLUGINS}"
else
build_guest_plugins:
@echo "GUEST_PLUGINS: disabled on arch ${TARGET_NAME}, ${GUEST_PLUGIN_DISABLE_REASON}"
endif


guest-plugin-%:
$(call quiet-command,mkdir -p ../panda/guest_plugins/$*,)
$(call quiet-command,mkdir -p panda/guest_plugins/$*,)
$(call quiet-command,$(MAKE) $(GUEST_PLUGIN_SUBDIR_MAKEFLAGS) \
-f "$(SRC_PATH)/panda/guest_plugins/panda.mak" \
-f "$(SRC_PATH)/panda/guest_plugins/$*/Makefile" \
PLUGIN_SRC_ROOT="$(SRC_PATH)/panda/guest_plugins" \
V="$(V)" PLUGIN_NAME="$*" all,)

extra-guest-plugin-%:
$(call quiet-command,mkdir -p ../panda/guest_plugins/$*,)
$(call quiet-command,mkdir -p panda/guest_plugins/$*,)
$(call quiet-command,$(MAKE) $(GUEST_PLUGIN_SUBDIR_MAKEFLAGS) \
-f "$(SRC_PATH)/panda/guest_plugins/panda.mak" \
-f "$(EXTRA_GUEST_PLUGINS_PATH)/$*/Makefile" \
PLUGIN_SRC_ROOT="$(EXTRA_GUEST_PLUGINS_PATH)" \
V="$(V)" PLUGIN_NAME="$*" all,)

ifdef CONFIG_LLVM
#########################################################
# LLVM library
Expand Down
3 changes: 3 additions & 0 deletions panda/dependencies/ubuntu:18.04_build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ protobuf-compiler
python3-dev
zip

# hyperfuse build deps
libfuse-dev

# pypanda dependencies
python3-setuptools
python3-wheel
Expand Down
3 changes: 3 additions & 0 deletions panda/dependencies/ubuntu:20.04_build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ python3-dev
libpixman-1-dev
zip

# hyperfuse build deps
libfuse-dev

# pypanda dependencies
python3-setuptools
python3-wheel
Expand Down
3 changes: 3 additions & 0 deletions panda/dependencies/ubuntu:22.04_build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ python3-dev
libpixman-1-dev
zip

# hyperfuse build deps
libfuse-dev

# pypanda dependencies
python3-setuptools
python3-wheel
Expand Down
Loading