Mayhem CLI ã³ãã³ã¶
以äžã¯ãã¹ãŠã® Mayhem CLI ã«é¢ããç·åã¬ãã¡ã¬ã³ã¹ ã¬ã€ãã§ãã
Info
Mayhem CLI ã䜿çšããã«ã¯ãmayhem ãã€ããªãã€ã³ã¹ããŒã«ãããŠããå¿
èŠããããŸããã»ãã ã¢ããã®è©³çްã«ã€ããŠã¯ããMayhem CLI ã®ã€ã³ã¹ããŒã«ããåç
§ããŠãã ããã
å©çšå¯èœãªãã¹ãŠã® Mayhem CLI ã³ãã³ãã«é¢ãã詳现ã衚瀺ããã«ã¯ãmayhem --help ã³ãã³ãã䜿çšããŸãã
(base) andrew@Andrews-MacBook-Pro mcode % mayhem --help
usage: mayhem [-h] [-y] [--verbosity {info,debug}] [--version] CMD ...
Command line client for interacting with Mayhem
*positional arguments*:
  CMD
    check               Check targets to see if they are Mayhem-eligible.
    docker-registry     Gets the URI for mayhem's docker registry.
    download            Download a target and its test cases.
    init                Generate a Mayhemfile.
    list                List projects and targets you have run.
    login               Login to a Mayhem server.
    logout              Logout from a Mayhem server.
    package             Package the given target and dependencies for Mayhem.
    run                 Run a target through Mayhem.
    show                Show Mayhem run(s).
    stop                Stop a Mayhem run.
    sync                Sync a package to its latest state.
    validate            Validate a Mayhemfile.
    wait                Wait for a run to finish.
*optional arguments*:
  -h, --help            Show this help message and exit.
  -y, --noninteractive  Accept the default options for all prompts. Equivalent 
                        to setting the environment variable `MAYHEM_NONINTERACTIVE=1`.
  --prompt              Force prompt text to display. Useful when no 
                        TTY/interactive shell is connected, such as in a CI/CD pipeline,
                        and a user wants to control prompt input. Equivalent 
                        to setting the environment variable `MAYHEM_PROMPT=1`.
  --verbosity {info,debug}
                        Set mayhem verbosity level.
  --version             Get the version of the Mayhem CLI.
additional information:
    By default, mayhem stores its configuration in the directory
    `~/.config/mayhem`.
    If the environment variable `XDG_CONFIG_HOME` is set, it will
    store configuration under `$XDG_CONFIG_HOME/mayhem`.
check¶
ã¿ãŒã²ããã Mayhem ã«é©åãããããã§ãã¯ããŸãã
- 
æ§æ:
mayhem check <file> - 
å¿ é åŒæ°:
file: ãã§ãã¯å¯Ÿè±¡ã®ããŒã«ã« ãã¡ã€ã«ãžã®ãã¹ã§ãã
 - 
ä»»æåŒæ°:
-h, --help: ãã®ãã«ã ã¡ãã»ãŒãžã衚瀺ããŠçµäºããŸãã--format {pretty,json}: è¿ãããçµæã®ãã©ãŒãããã§ãã
 - 
䜿çšäŸ:
file=./testmemayhem check ./testmeã³ãã³ãã¯ãtestmeãã€ããªã®ä»¥äžã®ãããªããŸããŸãªç¹æ§ãçŸåšã®ãã£ã¬ã¯ããªã«åºåããŸãã- ã¢ãŒããã¯ãã£ãã¯ãŒã ãµã€ãºããšã³ãã£ã¢ã³
 - åçã«ããŒããããã©ã€ãã©ãª
 - DEP ãã¹ã¿ã㯠ã«ããªã¢ãªã©ã®æªçšå¯èœæ§ãã¡ã¯ã¿ãŒ
 - ããŒãæã®ã¡ã¢ãª ããã
 - ãã¡ã¶ãŒ ã€ã³ã¹ãã¥ã«ã¡ã³ããŒã·ã§ã³ã®æç¡
 - ãã€ããªãè¡ãå¯èœæ§ãããã·ã¹ãã ã³ãŒã«
 
~/tutorial/testme/v1# mayhem check ./testme Key Value --------- ------------------------------- File /root/tutorial/testme/v1/testme Type ELF/x86_64 Version 8.3.0 PIE â DEP â Canary â Fortify â Static â Fuzz â LibFuzzer â HonggFuzz â SymbExec â AFL â ASAN â MSAN â UBSAN â LSAN â Rust â Golang â 
docker-registry¶
Mayhem ã® Docker ã¬ãžã¹ããªã® URI ãååŸããŸãã
- 
æ§æ:
mayhem docker-registry - 
ä»»æåŒæ°:
-h, --help: ãã®ãã«ã ã¡ãã»ãŒãžã衚瀺ããŠçµäºããŸãã
 - 
䜿çšäŸ:
mayhem docker-registryã³ãã³ãã¯ãæ¥ç¶ããã Mayhem Docker ã¬ãžã¹ããªã® URI ãåºåããŸãã~/tutorial/testme/v1# mayhem docker-registry tutorial.forallsecure.com:5000 
download¶
ã¿ãŒã²ãããšãã¹ã ã±ãŒã¹ãããŠã³ããŒãããŸãã
- 
æ§æ:
mayhem download <target> - 
å¿ é åŒæ°:
target:[<owner>/]<project>/<target>ãšããŠæå®ããŸãã
 - 
ä»»æåŒæ°:
-h, --help: ãã®ãã«ã ã¡ãã»ãŒãžã衚瀺ããŠçµäºããŸãã-o OUTPUT, --output OUTPUT: ã¿ãŒã²ããã®åºåãã£ã¬ã¯ããªãæå®ããŸãã-n NAMESPACE, --owner NAMESPACE: API ã€ã³ã¿ã©ã¯ã·ã§ã³ã§äœ¿çšãããªãŒããŒã§ãã--url URL: å®è¡äžã® Mayhem API ãžã® URL ã§ãã--token TOKEN: Mayhem API ã«ã¢ã¯ã»ã¹ããããã®èªèšŒããŒã¯ã³ã§ãã-k, --insecure: SSL æ€èšŒãç¡å¹åããŸãã--cacert CACERT: Mayhem ãµãŒããŒã®èšŒææžãžã®ãã¹ã§ãã--timeout TIMEOUT: API ã¬ã¹ãã³ã¹ãåŸ æ©ããç§æ°ã§ã (æ¥ç¶ãäœéãªå Žåã«äŸ¿å©ã§ã)ã
 - 
䜿çšäŸ:
<target>=testme/testmemayhem download testme/testmeã³ãã³ãã¯ãæ¥ç¶ããã Mayhem ãŠãŒã¶ãŒã®testmeãããžã§ã¯ãå ã«ååšããtestmeã¿ãŒã²ããã®ææ°ã® Mayhemfileãtestsuite.tarãroot.tgz (é Docker ã¿ãŒã²ããã®å Žå) ãããŠã³ããŒãããŸãã~/tutorial/testme/v1# mayhem download testme/testme Downloaded: Mayhemfile. Downloaded: root.tgz. Downloading testsuite.tar: 1.3 MiB | #| Elapsed Time: 0:00:02 466.7 KiB/s Extracting test 1281 of 1281 |#############| Time: 0:00:00 Target downloaded at: '/tmp/testmetestme-uk3lt2ql'. 
init¶
Mayhemfile ãçæããŸãã
- 
æ§æ:
mayhem init <image> - 
å¿ é åŒæ°:
image: Docker ã€ã¡ãŒãž ã¿ã°ãŸãã¯ããã·ã¥ã§ãã
 - 
ä»»æåŒæ°:
-h: ãã®ãã«ã ã¡ãã»ãŒãžã衚瀺ããŠçµäºããŸãã-o OUTPUT: Mayhemfile ã®ãã¡ã€ã« ãã¹ãæå®ããŸãã--project PROJECT: ãããžã§ã¯ãåã§ãã--owner OWNER: ãã®ãããžã§ã¯ãã®ãªãŒããŒã§ãã--target TARGET: ã¿ãŒã²ããåã§ãã--image IMAGE: è§£æãã Docker ã€ã¡ãŒãžã§ãã--duration DURATION: å®è¡ããç§æ° (å®éã®çµéæé) ãæå®ããŸãã--uid UID: ã¿ãŒã²ããã®å®è¡ã«äœ¿çšãããŠãŒã¶ãŒ ID ã§ãã--gid GID: ã¿ãŒã²ããã®å®è¡ã«äœ¿çšããã°ã«ãŒã ID ã§ãã--advanced-triage ADVANCED_TRIAGE: 远å ã®é«åºŠãªåªå é äœä»ãè§£æãèšå®ããŸããMayhem ãçºèŠãã CWE ã®æ°ãå¢å ããŸããããã¹ã ã±ãŒã¹åŠçæéãå¢å ããŸãã--cmd CMD: ã¿ãŒã²ãããåŒã³åºãããã®ã³ãã³ãã§ãã--cwd CWD: ã¿ãŒã²ããã®å®è¡ã«äœ¿çšããçŸåšã®äœæ¥ãã£ã¬ã¯ããªã§ãã--env KEY=VALUE: å®è¡æã«ã€ã³ã¯ã«ãŒãããç°å¢å€æ°ã§ãã--filepath FILEPATH: ã¿ãŒã²ãããèªã¿åããè¡ãå ¥åãã¡ã€ã«ã®ãã¹ã§ãã--network-url NETWORK_URL: ã¿ãŒã²ãããèªã¿åããè¡ããããã¯ãŒã¯ URI ã§ãã--network-timeout NETWORK_TIMEOUT: ã¿ãŒã²ããããããã¯ãŒã¯å ¥åãåä¿¡ããã®ã Mayhem ãåŸ æ©ããæé (åäœ: ç§) ã§ãã--network-client NETWORK_CLIENT: ãããã¯ãŒã¯ ã¿ãŒã²ãããã¯ã©ã€ã¢ã³ãã§ããããµãŒããŒã§ããããæå®ããŸãã--libfuzzer LIBFUZZER: ã¿ãŒã²ããã libfuzzer ã¿ãŒã²ãããã©ãããæå®ããŸãã--honggfuzz HONGGFUZZ: ã¿ãŒã²ããã honggfuzz ã¿ãŒã²ãããã©ãããæå®ããŸãã--sanitizer SANITIZER: ãµãã¿ã€ãºä»ãã§ã³ã³ãã€ã«ãããŠãããã©ãããæå®ããŸãã--max-length MAX_LENGTH: ãã¹ã ã±ãŒã¹ã®æå€§ã®é·ãã§ãã--memory-limit MEMORY_LIMIT: ã¿ãŒã²ããã«èš±å¯ããã¡ã¢ãªã®éãã¡ã¬ãã€ã (MB) åäœã§æå®ããŸãã--template TEMPLATE: ããŒãã¹ ãã³ãã¬ãŒããŸãã¯ã©ãããŒãçæããŸããçŸæç¹ã§ã¯ãC++ ããã³ AutoSAR ããµããŒããããŠããŸãã
 - 
䜿çšäŸ 1:
<image>=nginxmayhem init nginxã³ãã³ãã¯ãDocker Hub ãŸãã¯ãã©ã€ããŒã㪠Mayhem Docker ã¬ãžã¹ããªã®æå®ããã Docker ã€ã¡ãŒãžã«å¯Ÿã㊠Mayhemfile ãçæããMayhemfile ã®å¿ é ãã£ãŒã«ã (versionãprojectãtargetãcmds ããã³ cmd) ã«èªåçã«å€ãèšå®ããããšããŸãã(base) andrew@Andrews-MacBook-Pro mcode % mayhem init nginx View/edit generated Mayhemfile at: /Users/andrew/Desktop/mcode/Mayhemfile To start a run with this configuration, run mayhem run .1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
# Mayhem by https://forallsecure.com # Mayhemfile: configuration file for testing your target with Mayhem # Format: YAML 1.1 # Owned project name that the target belongs to project: nginx # Target name (should be unique within the project) target: nginx-latest # Base image to run the binary in. image: nginx:latest # List of commands used to test the target cmds: # Command used to start the target, "@@" is the input file # (when "@@" is omitted Mayhem defaults to stdin inputs) - cmd: nginx -g 'daemon off;' network: client: false timeout: 2.0 url: tcp://localhost:80 env: {} ## Uncomment to change default dir (/) from which the target is invoked #cwd: / ## Max test case length (in bytes) to be taken into account. Test cases over ## that length will be truncated. Be very careful about increasing this ## limit as it can severely affect your fuzzer performance. # max_length: 8192 - 
䜿çšäŸ 2:
<image>= nullmayhem initã³ãã³ãã¯ãããã©ã«ãã® Mayhemfile ãã³ãã¬ãŒããçæããŸãã(base) andrew@Andrews-MacBook-Pro mcode % mayhem init View/edit generated Mayhemfile at: /Users/andrew/Desktop/mcode/Mayhemfile To start a run with this configuration, run mayhem run .1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
# Mayhem by https://forallsecure.com # Mayhemfile: configuration file for testing your target with Mayhem # Format: YAML 1.1 # Owned project name that the target belongs to project: MYPROJECT # Target name (should be unique within the project) target: MYTARGET # Base image to run the binary in. image: MYIMAGE # List of commands used to test the target cmds: # Command used to start the target, "@@" is the input file # (when "@@" is omitted Mayhem defaults to stdin inputs) - cmd: MYBINARY env: {} ## Uncomment to change default dir (/) from which the target is invoked #cwd: / ## If this is a network target, uncomment the block below and remove ## the @@ input file reference in the cmd (you can either test network or ## file inputs, not both). #network: ## Use "127.0.0.1" instead of "localhost" below if you want to test only ## for IPv4. For IPv6, use "[::1]". By leaving as "localhost", Mayhem will ## attempt to autodetect the one used by the target. # url: tcp://localhost:8080 # protocol, host and port to analyze # client: false # target is a client-side program # timeout: 2.0 # max seconds for sending data ## Max test case length (in bytes) to be taken into account. Test cases over ## that length will be truncated. Be very careful about increasing this ## limit as it can severely affect your fuzzer performance. # max_length: 8192 
list¶
å®è¡æžã¿ã®ãããžã§ã¯ãããã³ã¿ãŒã²ããã®ãªã¹ãã衚瀺ããŸãã
- 
æ§æ:
mayhem list - 
ä»»æåŒæ°:
-h, --help: ãã®ãã«ã ã¡ãã»ãŒãžã衚瀺ããŠçµäºããŸãã-n NAMESPACE, --owner NAMESPACE: API ã€ã³ã¿ã©ã¯ã·ã§ã³ã§äœ¿çšãããªãŒããŒã§ãã--url URL: å®è¡äžã® Mayhem API ãžã® URL ã§ãã--token TOKEN: Mayhem API ã«ã¢ã¯ã»ã¹ããããã®èªèšŒããŒã¯ã³ã§ãã-k, --insecure: SSL æ€èšŒãç¡å¹åããŸãã--cacert CACERT: Mayhem ãµãŒããŒã®èšŒææžãžã®ãã¹ã§ãã--timeout TIMEOUT: API ã¬ã¹ãã³ã¹ãåŸ æ©ããç§æ°ã§ã (æ¥ç¶ãäœéãªå Žåã«äŸ¿å©ã§ã)ã
 - 
䜿çšäŸ:
mayhem listã³ãã³ãã¯ãæ¥ç¶æžã¿ã® Mayhem ãŠãŒã¶ãŒã«å¯Ÿå¿ãããããžã§ã¯ãããã³ã¿ãŒã²ããã<project>/<target>ãšãã圢åŒã§è¿ããŸãã~/tutorial/testme/v1# mayhem list afl/testme atheris/fuzzme-out-of-bounds atheris/testme auto-resolution/buf auto-resolution/testme-timeout bacsrv/bacsrv c/powerpc-c-uninstrumented cpp/cpp-afl-gcc dialserver/dialserver dnsmasq/dnsmasq docker/lighttpd-1-4 docker/testme foo/bar forallsecure-testme-docker/latest forallsecure-tutorial/latest ... 
login¶
Mayhem ãµãŒããŒã«ãã°ã€ã³ããŸãã
- 
æ§æ:
mayhem login <MAYHEM_URL> <MAYHEM_TOKEN> - 
å¿ é åŒæ°:
MAYHEM_URL: å®è¡äžã® Mayhem API ãžã® URL ã§ããMAYHEM_TOKEN: Mayhem API ã«ã¢ã¯ã»ã¹ããããã®èªèšŒããŒã¯ã³ã§ãã
 - 
ä»»æåŒæ°:
-h, --help: ãã®ãã«ã ã¡ãã»ãŒãžã衚瀺ããŠçµäºããŸãã--url URL: å®è¡äžã® Mayhem API ãžã® URL ã§ãã--token TOKEN: Mayhem API ã«ã¢ã¯ã»ã¹ããããã®èªèšŒããŒã¯ã³ã§ãã-k, --insecure: SSL æ€èšŒãç¡å¹åããŸãã--cacert CACERT: Mayhem ãµãŒããŒã®èšŒææžãžã®ãã¹ã§ãã--timeout TIMEOUT: API ã¬ã¹ãã³ã¹ãåŸ æ©ããç§æ°ã§ã (æ¥ç¶ãäœéãªå Žåã«äŸ¿å©ã§ã)ã
 - 
䜿çšäŸ:
MAYHEM_URL=tutorial.forallsecure.comMAYHEM_TOKEN=AT1.XAqBdE9bdo9YlMwDFdp-1Ku7wq8Cmek1mayhem login tutorial.forallsecure.com AT1.XAqBdE9bdo9YlMwDFdp-1Ku7wq8Cmek1ã³ãã³ãã¯ãAPI ããŒã¯ã³ã«ãã£ãŠæå®ããããŠãŒã¶ãŒã§ Mayhem ãµãŒããŒã«ãã°ã€ã³ããŸããMayhem CLI ã¯ã察å¿ãã Mayhem Docker ã¬ãžã¹ããªãå©çšå¯èœãªå Žåãã¬ãžã¹ããªã«ããã°ã€ã³ã詊ã¿ãŸããLogged in successfully at 'https://tutorial.forallsecure.com:443' as 'mayhemuser'. Syncing default settings: /root/.config/mayhem/mayhem. Docker is not installed, skipping docker login 
logout¶
Mayhem ãµãŒããŒãããã°ã¢ãŠãããŸãã
- 
æ§æ:
mayhem logout - 
ä»»æåŒæ°:
-h, --help: ãã®ãã«ã ã¡ãã»ãŒãžã衚瀺ããŠçµäºããŸãã
 - 
䜿çšäŸ:
mayhem logoutã³ãã³ãã¯ãMayhem ãµãŒããŒããã³ Mayhem Docker ã¬ãžã¹ã㪠(å©çšå¯èœãªå Žå) ãããŠãŒã¶ãŒããã°ã¢ãŠãããŸããDocker CLI not found, skipping logout from Docker registry. Logged out. 
package¶
æå®ãããã¿ãŒã²ããããã³äŸåé¢ä¿ã Mayhem çšã«ããã±ãŒãžåããŸãã
- 
æ§æ:
mayhem package <binary> - 
å¿ é åŒæ°:
binary: ããã±ãŒãžåããããŒã«ã« ã¿ãŒã²ãããžã®ãã¹ã§ãã
 - 
ä»»æåŒæ°:
-h, --help: ãã®ãã«ã ã¡ãã»ãŒãžã衚瀺ããŠçµäºããŸãã-o OUTPUT, --output OUTPUT: ããã±ãŒãžã®åºåãã£ã¬ã¯ããªãæå®ããŸãã-d DEPDIRS, --depdirs DEPDIRS: äŸåé¢ä¿ãæ€çŽ¢ãããã£ã¬ã¯ããªã®ã«ã³ãåºåããªã¹ãã§ãã
 - 
䜿çšäŸ:
<binary>=./testmemayhem package ./testmeã³ãã³ãã¯ãçŸåšã®ãã£ã¬ã¯ããªã«ããtestmeãã€ããªãããã±ãŒãžåããäŸåé¢ä¿ãéçã«æšæž¬ããçæããã Mayhemfile ããã³ãã¹ã ãã©ã«ããŒãšå ±ã«/tmp/testme-noleclq8ã«å«ããŸãã~/tutorial/testme/v1# mayhem package ./testme Packaging target: /root/tutorial/testme/v1/testme Packaging dependency: /root/tutorial/testme/v1/testme -> /tmp/testme-noleclq8/root/root/tutorial/testme/v1/testme Generating default configuration under: /tmp/testme-noleclq8/Mayhemfile Packaging complete. To upload the package do: `mayhem run /tmp/testme-noleclq8`. Before uploading, you may wish to edit the config file at '/tmp/testme-noleclq8/Mayhemfile'. /tmp/testme-noleclq8 ~/tutorial/testme/v1# ls -l /tmp/testme-noleclq8 -rw-r--r-- 1 root root 1918 Jan 5 18:08 Mayhemfile drwxr-xr-x 2 root root 4096 Jan 5 18:08 tests drwxr-xr-x 3 root root 4096 Jan 5 18:08 root 
run¶
Mayhem ã䜿çšããŠã¿ãŒã²ãããå®è¡ããŸãã
æ§æ: mayhem run <package>
- 
å¿ é åŒæ°:
package: ããã±ãŒãžåãããã¿ãŒã²ãããå«ããã£ã¬ã¯ããªãžã®ãã¹ã§ãã
 - 
ä»»æåŒæ°:
-h, --help: ãã®ãã«ã ã¡ãã»ãŒãžã衚瀺ããŠçµäºããŸãã--regression: å©çšå¯èœãªãã¹ã ã±ãŒã¹ã«å¯ŸããŠååž°ãã¹ããå®è¡ããŸãã--static: ã¿ãŒã²ããã®ãšã³ããªãã€ã³ãã«å¯ŸããŠéçãã§ãã¯ãå®è¡ããŸãã--dynamic: ã¿ãŒã²ããã«å¯ŸããŠåçãã¹ããå®è¡ããŸãã--coverage: ã¿ãŒã²ããã«å¯ŸããŠã«ãã¬ããžè§£æãå®è¡ããŸãã--all: ãµããŒãããããã¹ãŠã®è§£æãæå¹åããŸãã-f FILE, --file FILE: 䜿çšãã Mayhemfile ãžã®ãã¹ã§ã (ããã©ã«ãå€:<package>/Mayhemfile)ã-b BUILD_ID, --build-id BUILD_ID: ãã®ç¹å®ã®ã©ã³ã«é¢é£ä»ãããã«ã ID ã§ãã--docker: ããã±ãŒãžã Docker ã€ã¡ãŒãž ã¿ã°ãããã·ã¥ã§ããããæå®ããŸãã--warning-as-error: èŠåããšã©ãŒãšããŠæ±ããŸãã--testsuite TESTSUITE: ãã¹ã ã¹ã€ãŒãã®ãã£ã¬ã¯ããªãæå®ããŸãã--project PROJECT: ãããžã§ã¯ãåã§ãã--owner OWNER: ãã®ãããžã§ã¯ãã®ãªãŒããŒã§ãã--target TARGET: ã¿ãŒã²ããåã§ãã--duration DURATION: ããã€ã㢠ãã¹ãå®è¡æéãç§åäœãŸã㯠'XhYmZs' ãšãããã©ãŒãããã§æå®ããŸããX ã¯æéãY ã¯åãZ ã¯ç§ã§ãã (ããã©ã«ã: ãªã) / Mayhemfile ãäžæžãããŸãã--uid UID: ã¿ãŒã²ããã®å®è¡ã«äœ¿çšãããŠãŒã¶ãŒ ID ã§ãã--gid GID: ã¿ãŒã²ããã®å®è¡ã«äœ¿çšããã°ã«ãŒã ID ã§ãã--advanced-triage ADVANCED_TRIAGE: 远å ã®é«åºŠãªåªå é äœä»ãè§£æãèšå®ããŸããMayhem ãçºèŠãã CWE ã®æ°ãå¢å ããŸããããã¹ã ã±ãŒã¹åŠçæéãå¢å ããŸãã--image IMAGE: è§£æãã Docker ã€ã¡ãŒãžã§ãã--cmd CMD: ã¿ãŒã²ãããåŒã³åºãããã®ã³ãã³ãã§ãã--cwd CWD: ã¿ãŒã²ããã®å®è¡ã«äœ¿çšããçŸåšã®äœæ¥ãã£ã¬ã¯ããªã§ãã--env KEY=VALUE: å®è¡æã«ã€ã³ã¯ã«ãŒãããç°å¢å€æ°ã§ãã--filepath FILEPATH: ã¿ãŒã²ãããèªã¿åããè¡ãå ¥åãã¡ã€ã«ã®ãã¹ã§ãã--network-url NETWORK_URL: ã¿ãŒã²ãããèªã¿åããè¡ããããã¯ãŒã¯ URI ã§ãã--network-timeout NETWORK_TIMEOUT: ã¿ãŒã²ããããããã¯ãŒã¯å ¥åãåä¿¡ããã®ã Mayhem ãåŸ æ©ããæé (åäœ: ç§) ã§ãã--network-client NETWORK_CLIENT: ãããã¯ãŒã¯ ã¿ãŒã²ãããã¯ã©ã€ã¢ã³ãã§ããããµãŒããŒã§ããããæå®ããŸãã--libfuzzer LIBFUZZER: ã¿ãŒã²ããã libfuzzer ã¿ãŒã²ãããã©ãããæå®ããŸãã--honggfuzz HONGGFUZZ: ã¿ãŒã²ããã honggfuzz ã¿ãŒã²ãããã©ãããæå®ããŸãã--sanitizer SANITIZER: ãµãã¿ã€ãºä»ãã§ã³ã³ãã€ã«ãããŠãããã©ãããæå®ããŸãã--max-length MAX_LENGTH: ãã¹ã ã±ãŒã¹ã®æå€§ã®é·ãã§ãã--memory-limit MEMORY_LIMIT: ã¿ãŒã²ããã«èš±å¯ããã¡ã¢ãªã®éãã¡ã¬ãã€ã (MB) åäœã§æå®ããŸãã-n NAMESPACE, --namespace NAMESPACE: API ã€ã³ã¿ã©ã¯ã·ã§ã³ã§åå空éã§ãã--url URL: å®è¡äžã® Mayhem API ãžã® URL ã§ãã--token TOKEN: Mayhem API ã«ã¢ã¯ã»ã¹ããããã®èªèšŒããŒã¯ã³ã§ãã-k, --insecure: SSL æ€èšŒãç¡å¹åããŸãã--cacert CACERT: Mayhem ãµãŒããŒã®èšŒææžãžã®ãã¹ã§ãã--timeout TIMEOUT: API ã¬ã¹ãã³ã¹ãåŸ æ©ããç§æ°ã§ã (æ¥ç¶ãäœéãªå Žåã«äŸ¿å©ã§ã)ã
 - 
䜿çšäŸ
<package>=.mayhem run .ã³ãã³ãã¯ãçŸåšã®ãã£ã¬ã¯ããªã§ Mayhemfile ãæ€çŽ¢ããæå®ããã Mayhemfile èšå®ã䜿çšã㊠Mayhem ã©ã³ãå®è¡ããŸããé Docker ã¿ãŒã²ããã®å ŽåãMayhemfile ã®cmdãã£ãŒã«ãã«ã¿ãŒã²ãã ãã€ããªãžã®æå¹ãªãã¡ã€ã« ãã¹ãæå®ãããŠãããããã±ãŒãžåããããã€ããªãå¿ èŠã§ãã~/tutorial/testme/v1# mayhem run . /tmp/tmpgxuz_son/testsuite.tgz 100% |###########################| Time: 0:00:00 338.3 B/s Syncing /tmp/tmpukob8cbx 100% |##############################| Time: 0:00:00 /tmp/tmp73rvnn8l/Mayhemfile 100% |###########################| Time: 0:00:00 3.1 KiB/s Run started: testme/testme/66 Run URL: https://tutorial.forallsecure.com:443/mayhemuser/testme/testme/66 testme/testme/66 
show¶
Mayhem ã©ã³ã衚瀺ããŸãã
- 
æ§æ:
mayhem show <run> - 
å¿ é åŒæ°:
run:[<owner>/]<project>/<target>/<run>ãã©ãŒãããã®ã©ã³æå®åã§ãã
 - 
ä»»æåŒæ°:
-h, --help: ãã®ãã«ã ã¡ãã»ãŒãžã衚瀺ããŠçµäºããŸãã--status STATUS: æ£èŠè¡šçŸã§æå®ããã¹ããŒã¿ã¹ã«åºã¥ããŠã©ã³ããã£ã«ã¿ãŒããŸã (ããã©ã«ãå€: '.*')ã--format {pretty,json,csv}: è¿ãããçµæã®ãã©ãŒãããã§ãã-n NAMESPACE, --owner NAMESPACEAPI ã€ã³ã¿ã©ã¯ã·ã§ã³ã§äœ¿çšãããªãŒããŒã§ãã--url URL: å®è¡äžã® Mayhem API ãžã® URL ã§ãã--token TOKEN: Mayhem API ã«ã¢ã¯ã»ã¹ããããã®èªèšŒããŒã¯ã³ã§ãã-k, --insecure: SSL æ€èšŒãç¡å¹åããŸãã--cacert CACERT: Mayhem ãµãŒããŒã®èšŒææžãžã®ãã¹ã§ãã--timeout TIMEOUT: API ã¬ã¹ãã³ã¹ãåŸ æ©ããç§æ°ã§ã (æ¥ç¶ãäœéãªå Žåã«äŸ¿å©ã§ã)ã
 - 
䜿çšäŸ 1:
<run>=testme/testme/66mayhem show testme/testme/66ã³ãã³ãã¯ãæ¥ç¶æžã¿ã® Mayhem ãŠãŒã¶ãŒã®testmeãããžã§ã¯ãå ã«ããtestmeã¿ãŒã²ããã® 66 çªç®ã®ã©ã³ã®è§£æçµæãè¿ããŸãã~/tutorial/testme/v1# mayhem show testme/testme/66 Statistics for testme/testme/66 Status: dynamic_analysis:failed, regression_testing:failed, static_analysis:completed Run started: Wed Jan 5 18:24:45 2022 +0000 Time elapsed: 0:00:04 Tests performed: 0 Test reports: 0 Crash reports: 0 Defects: 0 - 
䜿çšäŸ 2:
<run>= nullmayhem showã³ãã³ãã¯ãæ¥ç¶æžã¿ã® Mayhem ãŠãŒã¶ãŒã®ãã¹ãŠã®ãããžã§ã¯ãããã³ã¿ãŒã²ããã®ãã¹ãŠã®ã©ã³ã®è§£æçµæãè¿ããŸãã~/tutorial/testme/v1# mayhem show Reports Crashes Defects Date ---------------------------------------------------------------------------------------------------------------------------------------- testme/foo/1 dynamic_analysis:failed, static_analysis:completed, regression_testing:completed 82 59 1 Tue Oct 12 21:04:35 2021 +0000 testme/testme/68 dynamic_analysis:failed, regression_testing:failed, static_analysis:completed 0 0 0 Wed Jan 5 21:16:49 2022 +0000 testme/testme/67 static_analysis:stopped, regression_testing:stopped, dynamic_analysis:stopped 0 0 0 Wed Jan 5 20:06:20 2022 +0000 ... 
stop¶
Mayhem ã©ã³ãäžæ¢ããŸãã
- 
æ§æ:
mayhem stop <run_path> - 
å¿ é åŒæ°:
run_path:[<owner>/]<project>/<target>/<run_number>ãã©ãŒãããã®ã©ã³ã®ååã§ããã¿ãŒã²ããã®ãã¹ãŠã®ã©ã³ãäžæ¢ããã«ã¯ã<run_number>ãçç¥ããŸããäŸ "mayhem stop my-project/target"ãã¹ãŠã®ã¿ãŒã²ããã®ãã¹ãŠã®ã©ã³ãäžæ¢ããã«ã¯ã<run_number>ããã³<target>ã®äž¡æ¹ãçç¥ããŸããäŸ "mayhem stop my-project"
 - 
ä»»æåŒæ°:
-h, --help: ãã®ãã«ã ã¡ãã»ãŒãžã衚瀺ããŠçµäºããŸãã-n NAMESPACE, --owner NAMESPACE: API ã€ã³ã¿ã©ã¯ã·ã§ã³ã§äœ¿çšãããªãŒããŒã§ãã--url URL: å®è¡äžã® Mayhem API ãžã® URL ã§ãã--token TOKEN: Mayhem API ã«ã¢ã¯ã»ã¹ããããã®èªèšŒããŒã¯ã³ã§ãã-k, --insecure: SSL æ€èšŒãç¡å¹åããŸãã--cacert CACERT: Mayhem ãµãŒããŒã®èšŒææžãžã®ãã¹ã§ãã--timeout TIMEOUT: API ã¬ã¹ãã³ã¹ãåŸ æ©ããç§æ°ã§ã (æ¥ç¶ãäœéãªå Žåã«äŸ¿å©ã§ã)ã
 - 
䜿çšäŸ:
<run_path>:testme/testme/67mayhem stop testme/testme/67ã³ãã³ãã¯ãæ¥ç¶æžã¿ã® Mayhem ãŠãŒã¶ãŒã«é¢é£ä»ããããtestmeãããžã§ã¯ãã®testmeã¿ãŒã²ããã® 67 çªç®ã®å®è¡äžã©ã³ãäžæ¢ããŸãã~/tutorial/testme/v1# mayhem stop testme/testme/67 Stopping Run testme/testme/67... Stopping dynamic_analysis... Stopping regression_testing... Stopping static_analysis... 
sync¶
ããã±ãŒãžãææ°ã®ç¶æ
ã«åæããŸããmayhem sync path/to/target ãå®è¡ãããšã以åã«ããã±ãŒãžåãå®è¡ããã¿ãŒã²ããããææ°ã®ãã¹ã ã±ãŒã¹ãååŸããŸãã
- 
æ§æ:
mayhem sync <package> - 
å¿ é åŒæ°:
package: ããã±ãŒãž ãã£ã¬ã¯ããªãžã®ãã¹ã§ãã
 - 
ä»»æåŒæ°:
-h, --help: ãã®ãã«ã ã¡ãã»ãŒãžã衚瀺ããŠçµäºããŸãã-n NAMESPACE, --owner NAMESPACE: API ã€ã³ã¿ã©ã¯ã·ã§ã³ã§äœ¿çšãããªãŒããŒã§ãã--url URL: å®è¡äžã® Mayhem API ãžã® URL ã§ãã--token TOKEN: Mayhem API ã«ã¢ã¯ã»ã¹ããããã®èªèšŒããŒã¯ã³ã§ãã-k, --insecure: SSL æ€èšŒãç¡å¹åããŸãã--cacert CACERT: Mayhem ãµãŒããŒã®èšŒææžãžã®ãã¹ã§ãã--timeout TIMEOUT: API ã¬ã¹ãã³ã¹ãåŸ æ©ããç§æ°ã§ã (æ¥ç¶ãäœéãªå Žåã«äŸ¿å©ã§ã)ã
 - 
䜿çšäŸ:
<package>=.mayhem sync .ã³ãã³ãã¯ãçŸåšã®ãã£ã¬ã¯ããªã§ Mayhemfile ãæ€çŽ¢ããMayhemfile æ§æå ã®targetãšprojectãçµã¿åãããŠææ°ã®ãã¹ãã±ãŒã¹ãããŠã³ããŒãããŸãã~/tutorial/testme/v1# mayhem sync . Downloaded: Mayhemfile. Downloading testsuite.tar: 1.3 MiB | #| Elapsed Time: 0:00:02 456.2 KiB/s Extracting test 1281 of 1281 |################################| Time: 0:00:00 Target synced at: '.'. 
validate¶
Mayhemfile ãæ€èšŒããŸãã
- 
æ§æ:
mayhem validate <package> - 
å¿ é åŒæ°:
package: ããã±ãŒãžåãããã¿ãŒã²ãããå«ããã£ã¬ã¯ããªãžã®ãã¹ã§ãã
 - 
ä»»æåŒæ°:
-h, --help: ãã®ãã«ã ã¡ãã»ãŒãžã衚瀺ããŠçµäºããŸãã-f FILE, --file FILE: 䜿çšãã Mayhemfile ãžã®ãã¹ã§ã (ããã©ã«ãå€:<package>/Mayhemfile)ã--no-docker: Docker ãå¿ èŠãšããäŸµå ¥çæ€èšŒãã¹ãããããŸãã-n NAMESPACE, --owner NAMESPACE: API ã€ã³ã¿ã©ã¯ã·ã§ã³ã§äœ¿çšãããªãŒããŒã§ãã--url URL: å®è¡äžã® Mayhem API ãžã® URL ã§ãã--token TOKEN: Mayhem API ã«ã¢ã¯ã»ã¹ããããã®èªèšŒããŒã¯ã³ã§ãã-k, --insecure: SSL æ€èšŒãç¡å¹åããŸãã--cacert CACERT: Mayhem ãµãŒããŒã®èšŒææžãžã®ãã¹ã§ãã--timeout TIMEOUT: API ã¬ã¹ãã³ã¹ãåŸ æ©ããç§æ°ã§ã (æ¥ç¶ãäœéãªå Žåã«äŸ¿å©ã§ã)ã
 
wait¶
ã©ã³ãçµäºããã®ãåŸ æ©ããŸãã
- 
æ§æ:
mayhem wait <run> - 
å¿ é åŒæ°:
run: åŸ æ©ããã©ã³ã§ã ([<owner>/]<project/target/run_number>ãã©ãŒããã)ã
 - 
ä»»æåŒæ°:
-h, --help: ãã®ãã«ã ã¡ãã»ãŒãžã衚瀺ããŠçµäºããŸãã-v, --verbose: åŸ æ©äžã«ã¹ããŒã¿ã¹æ å ±ãåºåããŸãã--regression: ååž°ãã¹ããåŸ æ©ããŸãã--static: éçè§£æãåŸ æ©ããŸãã--dynamic: åçè§£æãåŸ æ©ããŸãã--coverage: ã¿ãŒã²ããã«å¯ŸããŠã«ãã¬ããžè§£æãå®è¡ããŸãã--all: ãã¹ãŠã®è§£æãåŸ æ©ããŸãã--junit JUNIT: JUnit XML ã¬ããŒããçæããæå®ããããã¡ã€ã«ã«æžã蟌ã¿ãŸãã--sarif SARIF: SARIF JSON ã¬ããŒããçæããæå®ããããã¡ã€ã«ã«æžã蟌ã¿ãŸãã-n NAMESPACE, --owner NAMESPACE: API ã€ã³ã¿ã©ã¯ã·ã§ã³ã§äœ¿çšãããªãŒããŒã§ãã--url URL: å®è¡äžã® Mayhem API ãžã® URL ã§ãã--token TOKEN: Mayhem API ã«ã¢ã¯ã»ã¹ããããã®èªèšŒããŒã¯ã³ã§ãã-k, --insecure: SSL æ€èšŒãç¡å¹åããŸãã--cacert CACERT: Mayhem ãµãŒããŒã®èšŒææžãžã®ãã¹ã§ãã--timeout TIMEOUT: API ã¬ã¹ãã³ã¹ãåŸ æ©ããç§æ°ã§ã (æ¥ç¶ãäœéãªå Žåã«äŸ¿å©ã§ã)ã
 - 
䜿çšäŸ
<run>=testme/testme/68mayhem wait testme/testme/68ã³ãã³ãã¯ãæ¥ç¶æžã¿ã® Mayhem ãŠãŒã¶ãŒã®testmeãããžã§ã¯ãã«ããtestmeã¿ãŒã²ããã® 68 çªç®ã®ã©ã³ãå®äºããã®ãåŸ æ©ããŸããmayhem waitã³ãã³ãã¯ãã¹ã¯ãªããå ã§ãåŠçãç¶è¡ããåã« Mayhem ã©ã³ã®å®äºãåŸ æ©ããå¿ èŠãããå Žåã«ç¹ã«äŸ¿å©ã§ãã~/tutorial/testme/v1# mayhem wait testme/testme/68 ~/tutorial/testme/v1#