fgsect / FitM

FitM, the Fuzzer in the Middle, can fuzz client and server binaries at the same time using userspace snapshot-fuzzing and network emulation. It's fast and comparably easy to set up.
MIT License
279 stars 20 forks source link

Example run failed #7

Closed GoldBinocle closed 1 year ago

GoldBinocle commented 2 years ago

Hi, I built FitM with make, and run the example using FITM_ARGS=config/fitm-args.ftp.json make run but got the following failure:

FITM_ARGS=config/fitm-args.ftp.json make run
cargo build --release
   Compiling fitm v0.1.0 (/root/projects/fuzzer/FitM)
    Finished release [optimized + debuginfo] target(s) in 27.20s
sudo rm -rf ./active-state
sudo rm -rf ./cmin-tmp
sudo ./target/release/fitm config/fitm-args.ftp.json
cwd: "/root/projects/fuzzer/FitM"

    __________________  ___
   / ____/  _/_  __/  |/  /
  / /_   / /  / / / /|_/ / 
 / __/ _/ /  / / / /  / /  
/_/   /___/ /_/ /_/  /_/   

File fitm-state.json not found. Restarting from scratch.
No valid state to resume. Starting fresh :)
==== [*] Time start init_run: 2022-04-04 21:13:55 ====
[*] Init run finished with exit code None
[*] Target was killed by signal. Assuming dump success.
thread 'main' panicked at '[!] parse_pid failed to parse JSON in utils::parse_pid: UnexpectedEndOfJson', src/utils.rs:67:59
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
make: *** [Makefile:40:run] error 101

Could you please help me?

derpsteb commented 2 years ago

Hey :), could you print the unparsed json (pstree_string) by adding a print after this line? Maybe crit is producing some broken json. We had that problem before. How did you install criu? If you are not using the vagrantfile, what version do you use?

GoldBinocle commented 2 years ago

Hi :b, I added

println!("pstree_string: {}(end)", pstree_string);

after this line, and the output was:

pstree_string: (end)

The pstree_string was empty. I didn't install criu specially. I just installed the following apps as described in provision.sh

apt-get -y update && apt-get -y upgrade
apt-get -y install ntp # get rid of clock-skew in the vm
apt-get -y install build-essential binutils pkg-config python-ipaddress make protobuf-compiler protobuf-c-compiler libprotobuf-c-dev libprotobuf-dev libnet-dev python3-protobuf python3-yaml protobuf-c-compiler libbsd-dev libprotobuf-dev libprotobuf-c-dev protobuf-c-compiler protobuf-compiler python-protobuf libnl-3-dev libcap-dev ninja-build libglib2.0-dev cmake libcapstone-dev libaio-dev libnftables-dev iproute2
sudo -u vagrant -- sh -c "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y"

# target deps
apt-get -y install libgnutls28-dev bison flex libssl-dev autoconf libtool libsdl2-dev libopus-dev || true

and then make. Specifically, I didn't use the vagrantfile, and I'm working on Ubuntu 20.04 LTS.

derpsteb commented 2 years ago

Hm. Whats in the active state folder? Any failing syscalls/error msgs in stderr? What does criu.log report? Can you call crit (criu/crit/crit-python3) manually?

GoldBinocle commented 2 years ago

Hi, the active-state/stderr and active-state/snapshot/criu.log are attached (https://github.com/fgsect/FitM/files/8458437/active-state.zip),

and here is the output when calling crit (criu/crit/crit-python3) manually

$ ./criu/crit/crit-python3 
Traceback (most recent call last):
  File "/root/projects/fuzzer/FitM/./criu/crit/crit-python3", line 3, in <module>
    from pycriu import cli
  File "/root/projects/fuzzer/FitM/criu/crit/pycriu/__init__.py", line 1, in <module>
    from . import rpc_pb2 as rpc
  File "/root/projects/fuzzer/FitM/criu/crit/pycriu/rpc_pb2.py", line 6, in <module>
    from google.protobuf.internal import enum_type_wrapper
ModuleNotFoundError: No module named 'google'
derpsteb commented 2 years ago

Heyhey, so looking at the output from running crit-python3 to me it seems like the protobuf module for python has not been installed correctly. I would say that's python3-protobuf. See here. Installing with pip should also work.

domenukk commented 1 year ago

Closing this for lack of activity, reopen if the problem persists :)