Mayhemfile ã®æ§æ¶
Mayhem ã©ã³ãå®è¡ããŠã¿ãŒã²ãã ã¢ããªã±ãŒã·ã§ã³ã解æããéãMayhem 㯠Mayhemfile
ãšããæ§æãã¡ã€ã«ã䜿çšããŸãããŠãŒã¶ãŒã¯ããã®èšå®ãã¡ã€ã«ã«å¿
é ããã³ä»»æãã©ã¡ãŒã¿ãŒãæå®ããã«ã¹ã¿ã ã¿ãŒã²ããããã¹ãã§ããŸãã
ã·ã³ãã«ãªã¢ããªã±ãŒã·ã§ã³ã§ã¯ãmayhem package ã³ãã³ãã䜿çšããŠãã¿ãŒã²ãã ã¢ããªã±ãŒã·ã§ã³ã® Mayhemfile
ãèªåçã«çæããããšãã§ããŸããããããããè€éãªãœãããŠã§ã¢ã§ã¯ãå€ãã®å Žåãã¿ãŒã²ãããæ£ãããã¡ãžã³ã°ããã«ã¯ããŠãŒã¶ãŒã Mayhemfile
ã§è¿œå ã®èšå®ãæå®ããå¿
èŠããããŸãããã®ããããŠãŒã¶ãŒãããããã® Mayhem ã©ã³ã«åãã㊠Mayhemfile
ãæ§æããã®ã«åœ¹ç«ã€æ
å ±ã以äžã«èšèŒããŠããŸãã
Mayhemfile ãœãŒã¹ãšã©ã³ã®éã¶
ãããã°ããéããŠãŒã¶ãŒãäœæã㊠Mayhem ã«ã¢ããããŒããã Mayhemfile
ãšãMayhem ãå®éã« Mayhem ã©ã³ã§äœ¿çšããå®å
šä¿®é£Ÿããã Mayhemfile
ã®éããæèããå¿
èŠããããŸãã
å
·äœçã«ã¯ãMayhem ã¯ãŠãŒã¶ãŒãã¢ããããŒããã Mayhemfile
ã«ç¹å®ã®ãã£ãŒã«ããè¿œå ãå€æŽãåé€ããŠæçµçãªå€æŽãå ããMayhem ã©ã³ã®å®è¡ã«äœ¿çšããå®å
šãªæ§æãäœæããŸããMayhem ã¯ã以äžãèæ
®ããŠãŠãŒã¶ãŒãã¢ããããŒãããããœãŒã¹ãMayhemfile
ã調æŽããŸãã
- ç°å¢å€æ°:
${MAYHEM_PROJECT}
ãªã©ã®Mayhemfile
å ã®å€æ°ã¯ããŠãŒã¶ãŒã®å¯Ÿå¿ããç°å¢å€æ° (ååšããå Žå) ã®å€ã«çœ®ãæããããŸãã - CLI ã®ãªãŒããŒã©ã€ã: Mayhem CLI ã§ç¹å®ã®ãã©ã¡ãŒã¿ãŒ/ãã©ã°ãæå®ã㊠Mayhem ã©ã³ãå®è¡ããçµæãšããŠã
Mayhemfile
å ã®å€ãäžæžããããŸãã - ããã©ã«ãå€: ã«ã¹ã¿ã å€ãæå®ãããŠããªãå Žåãèªåçã«ããã©ã«ãã®ãã©ã¡ãŒã¿ãŒããã³å€ã
Mayhemfile
ã«è¿œå ãããŸãã
ç°å¢å€æ°¶
次ã®ãœãŒã¹ Mayhemfile
ãèŠãŠã¿ãŸãããã
1 2 3 4 |
|
${FOO}
ããã³ ${BAR}
ç°å¢å€æ°ãèšå®ãããŠããŸãã
Note
Mayhemfile ã§ç°å¢å€æ°ãæå®ããéã${FOO}
ãŸã㯠$FOO
ã®ã©ã¡ãã®æ§æã䜿çšããŠãããŸããŸããããã® 2 ã€ã¯åçã§ãã
ãŠãŒã¶ãŒã®ç°å¢ã§ ${FOO}
ã« foo
ãèšå®ããã${BAR}
ã« bar
ãèšå®ãããŠããå Žåãmayhem run
ã³ãã³ããå®è¡ãããšã次ã®ããã«ç°å¢å€æ°ã®å±éã確èªããããã³ããã衚瀺ãããŸããâY" ãå
¥åããŠç¶è¡ããŸãã
$ export FOO=foo
$ export BAR=bar
$ mayhem run .
Performing environment variable interpolation based on the following values from the local environment:
FOO
BAR
Proceed? [Y/n]? Y
Run started: foo/bar/1
Run URL: https://tutorial.forallsecure.com:443/mayhemuser/foo/bar/1
Tip
ããã³ãããã¹ããããããå Žåãmayhem run
ãªã©ã® Mayhem CLI ã³ãã³ãã«ä»»æãªãã·ã§ã³ -y
ãŸã㯠--noninteractive
ã䜿çšã§ããŸããããšãã°ãmayhem -y run .
ã¯çŸåšã®ãã£ã¬ã¯ããªå
ã® Mayhemfile ã䜿çšããŠéã€ã³ã¿ã©ã¯ãã£ã ã¢ãŒã㧠Mayhem ã©ã³ãå®è¡ããŸãã
ã©ã³ãå®è¡ããããã®ã©ã³ã® Mayhemfile
ã確èªãããšã${FOO}
ããã³ ${BAR}
ç°å¢å€æ°ãé©åãªå€ã«çœ®æãããŠããããšãããããŸãã
1 2 3 4 |
|
Info
Mayhemfile
ã§æåããšã¹ã±ãŒãããã«ã¯ãããã¯ã¹ã©ãã·ã¥ \
ã䜿çšããŸããããšãã°ã$TARGET
ãšããã¿ãŒã²ãããããå Žåã次ã®ããã«ããã¯ã¹ã©ãã·ã¥ã䜿çšã㊠$
ããšã¹ã±ãŒãããŸã:
# Source Mayhemfile
project: foo
target: bar
cmds:
- cmd: \$TARGET @@
ããã¯æ¬¡ã®ããã«ãªããŸã:
# Run Mayhemfile
project: foo
target: bar
cmds:
- cmd: $TARGET @@
CLI ã®ãªãŒããŒã©ã€ã¶
Mayhem CLI ã§æ¬¡ã®ãªãŒããŒã©ã€ã ãã©ã¡ãŒã¿ãŒãæå®ã㊠mayhem run
ãå®è¡ã§ããŸãã
-h, --help Show this help message and exit.
--regression Run regression tests on available test cases.
--static Run static checks on the entrypoint of the target.
--dynamic Run dynamic analysis on the target.
--coverage Perform coverage analysis on the target.
--all Enable all supported analyses.
-f FILE, --file FILE Path to the Mayhemfile used (default:
<package>/Mayhemfile).
-b BUILD_ID, --build-id BUILD_ID
Build id to associate with this specific run.
--docker Indicates whether the package is a docker image tag or
hash.
--warning-as-error Have the warnings be treated as errors.
--testsuite TESTSUITE Specify a testsuite directory.
--project PROJECT Name of the project.
--owner OWNER The owner for this project.
--target TARGET Name of the target.
--image IMAGE Docker image you want to analyze.
--duration DURATION How long to run for in seconds (wall clock time).
--uid UID User id for running the target.
--gid GID Group id for running the target.
--advanced-triage ADVANCED_TRIAGE
Set extra advanced triage analysis. Increases the
number of CWEs Mayhem finds but also increases test
case processing time.
--cmd CMD Command to invoke the target.
--cwd CWD Current working directory for running the target.
--env KEY=VALUE Environment variable to include while running.
--filepath FILEPATH Input file path where the target reads from.
--network-url NETWORK_URL
Network URI where the target reads from.
--network-timeout NETWORK_TIMEOUT
The time (in seconds) for Mayhem to wait for the
target to accept network input.
--network-client NETWORK_CLIENT
Specify whether this network target is a client or
server.
--libfuzzer LIBFUZZER
Specify whether this is a libfuzzer target or not.
--honggfuzz HONGGFUZZ
Specify whether this is a honggfuzz target or not.
--sanitizer SANITIZER
Specify whether sanitization is compiled in or not.
--max-length MAX_LENGTH
Maximum length for test cases.
--memory-limit MEMORY_LIMIT
How much memory to allow the target in megabytes (MB).
--url URL URL to running Mayhem API.
--token TOKEN Authentication token for accessing Mayhem API.
-k, --insecure Disable SSL verification.
--cacert CACERT Path to the mayhem server's certificate.
--timeout TIMEOUT Seconds to wait for API responses (useful for slow
connections).
ããšãã°ã次ã®ãœãŒã¹ Mayhemfile ããããšããŸãã
1 2 3 4 5 |
|
ãã®åŸãMayhem CLI ã³ãã³ã mayhem run . --image forallsecure/tutorial
ãäžèšã® Mayhemfile
ãšåãçŸè¡ãã£ã¬ã¯ããªå
ããå®è¡ãããšãimage
ãã©ã¡ãŒã¿ãŒã Docker Hub ã®ã€ã¡ãŒãž forallsecure/tutorial
ã§äžæžããããã©ã³ã«å¯ŸããŠæ¬¡ã® Mayhemfile
ãçæãããŸãã
1 2 3 4 5 |
|
Info
ãã©ã¡ãŒã¿ãŒã®ãªãŒããŒã©ã€ãã¯ããªãŒããŒã©ã€ãããããŒããã§ã«ãœãŒã¹ Mayhemfile ã«ååšãããã©ããã«å¿ããŠãã©ã¡ãŒã¿ãŒãå€æŽãŸãã¯è¿œå ããŸãã
ããã©ã«ã倶
次ã®ããããã®ãã©ã¡ãŒã¿ãŒã«å¯ŸããŠã«ã¹ã¿ã å€ãæå®ãããŠããªãå ŽåãMayhem 㯠Mayhem ã©ã³ã® Mayhemfile
ã«æ¬¡ã®ããã©ã«ãå€ãè¿œå ããŸãã
1 2 3 4 5 6 7 8 9 |
|
äžèšã®ããã©ã«ãå€ãæ§ç¯ãããããMayhem ã¯æ¬¡ã®ã€ã³ãã«ãå€ã®å€ã眮æããŸãããããã®å€ã¯ãã«ã¹ã¿ã ç°å¢å€æ°ã§æå®ãããªãããããèªåçã«èšå®ãããŸããããã㯠testsuite
ã image
ã®å€ãªã©ã®ããŸããŸãªç®æã§çœ®æãããŸãã
- ${MAYHEM_DOCKER_REGISTRY}: ã©ã³ãå®è¡ãã Mayhem ã€ã³ã¹ã¿ã³ã¹ã® Mayhem Docker ã¬ãžã¹ã㪠URL ãèšå®ãããŸã (äŸ:
tutorial.forallsecure.com:5000
)ã - ${MAYHEM_DOMAIN}: ã©ã³ãå®è¡ãã Mayhem ã€ã³ã¹ã¿ã³ã¹ã® URL ãèšå®ãããŸã (äŸ:
tutorial.forallsecure.com
)ã - ${MAYHEM_PROJECT}: Mayhemfile ã®å¿
é ãã£ãŒã«ã
project
ã®åã«ãŠãŒã¶ãŒãŸãã¯çµç¹ã®ååãä»å ããå€ãèšå®ãããŸã (äŸ:forallsecure/project1
)ã - ${MAYHEM_TARGET}: Mayhemfile ã®å¿
é ãã£ãŒã«ã
target
ããå°ãããå€ãèšå®ãããŸãã - ${MAYHEM_URL}: 次ã®æ§æã«åŸã£ãŠå€ãèšå®ãããŸãã
https://${MAYHEM_DOMAIN}
(äŸ:https://tutorial.forallsecure.com
) - ${MAYHEM_OWNER}: Mayhemfile ã§
project
ãã£ãŒã«ãã®äžéšãšããŠæå®ããããªãŒã㌠(äŸ:project: forallsecure/project1
)ããŸãã¯ãã°ã€ã³ãã Mayhem ãŠãŒã¶ãŒã®ãŠãŒã¶ãŒåãèšå®ãããŸãã ãã®ã±ãŒã¹ã§ã¯ããªãŒããŒã«ã¯forallsecure
ãèšå®ãããŸãã
ããšãã°ããŠãŒã¶ãŒ mayhemuser
ã Mayhem ã©ã³ã®å®è¡æã«æ¬¡ã® Mayhemfile
ãã¢ããããŒããããšããŸãã
1 2 3 4 |
|
Mayhem ã¯çµæã®ã©ã³ã® Mayhemfile
ã«æ¬¡ã®ããã©ã«ãå€ãèªåçã«è¿œå ããŸã (ãŸãã€ã³ãã«ãå€æ°ãé©å®çœ®æããŸã)ã
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Mayhemfile ã®ãµã³ã㫶
Mayhem ã¯ãã¡ã€ã«å
¥åãæšæºå
¥åãTCP/UDP å
¥åã䜿çšããŠã¿ãŒã²ãã ã¢ããªã±ãŒã·ã§ã³ããã¡ãžã³ã°ã§ããŸãããã®ã»ã¯ã·ã§ã³ã«ã¯ãã¿ã€ããç°ãªã Mayhemfile
æ§æã®ãµã³ãã«ããããŸãã
ãã¡ã€ã«å ¥å¶
ã³ãã³ãã©ã€ã³äžã§åäžã®å
¥åãåãåããŸã (objdump
ãã)ã
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
æšæºå ¥å (stdin)¶
/dev/stdin
ããå
¥åãåãåãããã ããã£ãš djpeg ã«å¯ŸããŠãã¹ããå®è¡ããŸãã
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
TCP/UDP å ¥å¶
ãããªãã¯ãª Docker Hub ã€ã¡ãŒãžã䜿çšããTCP ããŒãã® 80 ã§ãããã¯ãŒã¯ããåäžã®å
¥åãåãåããŸã (sebp/lighttpd
ãã)ã
1 2 3 4 5 6 7 8 9 10 |
|
Mayhemfile ã®ãã©ã¡ãŒã¿ãŒ¶
以äžã« Mayhemfile
ã§å©çšå¯èœãªãã¹ãŠã®ãã©ã¡ãŒã¿ãŒã瀺ããŸãã
Important
è€æ°ã¬ãã«ã® Mayhemfile
ãããããããã©ã¡ãŒã¿ãŒã®éå±€ãæèããŠãã ããã
version
¶
Mayhem ã®ããŒãžã§ã³ãæå®ããŸãã
- ä»»æ
- ããŒã¿ã¿ã€ã: string
- ãµã³ãã«:
version: '2.10'
Info
Mayhemfile ã®ããŒãžã§ã³ã«ã¯ 0.4 以äžãæå®ã§ããŸãã泚æ: ãã ããå€ãããŒãžã§ã³ã® Mayhem ãæå®ãã Mayhemfile ã«ã¯ãããæ°ããããŒãžã§ã³ã®æ©èœãå«ãŸããŠããªãå ŽåããããŸãã
project
¶
ã¿ãŒã²ãããæå±ãããããžã§ã¯ãçµç¹ããã³ãããžã§ã¯ãã®åºæåã§ãã
- Owner (ä»»æ), Projectname (ä»»æ)
- ããŒã¿ã¿ã€ã: string
- ãµã³ãã«:
project: owner/projectname
target
¶
ãã¹ã察象ã®ã¿ãŒã²ããã®ååã§ãã1 ã€ã® target ã«è€æ°ã®ã¿ãŒã²ãããèšå®ã§ããŸãã
- ä»»æ
- ããŒã¿ã¿ã€ã: string
- ãµã³ãã«:
target: targetname
image
¶
Warning
ãã®ãã£ãŒã«ãã¯ã以å㯠baseimage
ã§ããããçŸåš mCode version 2.X ã§ã¯ image
ã§ãã
image
ã¯ã䜿çšããã Docker ã€ã¡ãŒãžã®ååã§ããã€ã¡ãŒãžã«ã¯ã¿ãŒã²ãã (Docker ããã±ãŒãžã䜿çšããŠããå Žå) ãå«ãŸããå ŽåããããŸãããŸãã¯ãroot/ ãã©ã«ããŒã«ã¿ãŒã²ãããå«ãŸããå ŽåããããŸãããã®å Žåãã¿ãŒã²ãããã€ã¡ãŒãžã«éããããŸã (mayhem package ã³ãã³ããåç
§)ãã€ã¡ãŒãžãæå®ãããŠããªãå ŽåãDebian buster ãåºã«ãã ForAllSecure ã®ããã©ã«ãã® Docker ã€ã¡ãŒãžã䜿çšãããŸã: $MAYHEM_DOCKER_REGISTRY/forallsecure/debian-buster
å
éšç㪠Docker ã¬ãžã¹ããªãŸãã¯ãããªãã¯ãª Docker Hub ã¬ãžã¹ããªã䜿çšã㊠Mayhem ã« Docker ã€ã¡ãŒãžãã¢ããããŒãã§ããŸãã
Info
Mayhem ã«ã¢ããããŒãããã Docker ã€ã¡ãŒãžããã£ãšç°¡åã«åç
§ããã«ã¯ã$MAYHEM_DOCKER_REGISTRY
å€æ°ã䜿çšããŠãµãŒããŒã®å
éšç㪠Docker ã¬ãžã¹ããªã®å Žæãåç
§ããŸããMayhem ã«ã¯ ForAllSecure ã®ããã©ã«ãã®ã€ã¡ãŒãžãäºåã€ã³ã¹ããŒã«ãããŠããŸãã
- ä»»æ
- ããŒã¿ã¿ã€ã: string
- ããã©ã«ãå€:
$MAYHEM_DOCKER_REGISTRY/forallsecure/debian-buster
- ãµã³ãã«:
image: $MAYHEM_DOCKER_REGISTRY/forallsecure/debian-buster
duration
¶
ã¢ããªã±ãŒã·ã§ã³ãå®è¡ããç§æ°ã
Info
duration
ãã©ã¡ãŒã¿ãŒã« null
ãèšå®ããå Žå (ã€ãŸãããã©ã«ãã®æéãæå®ãããªãã£ãå Žå)ãæéã¯ç¡æéã«ãªããŸãã
- ä»»æ
- ããŒã¿ã¿ã€ã integer
- ããã©ã«ãå€:
null
- ãµã³ãã«:
duration: 90
advanced_triage
¶
è¿œå ã®ãã¹ã ã±ãŒã¹åŠçã«ãã£ãŠè¿œå ã®è§£æãè¡ãããã¡ã¢ãª ãªãŒã¯ãæªåæåå€æ°ã®äœ¿çšãªã©ã® UNIX ã·ã°ãã«ãéä¿¡ãããªãæ¬ é¥ãæ€åºãããŸãã
Info
ç¹å¥ãªãã¹ã ã±ãŒã¹åŠçãè¿œå ããããããadvanced_triage
ãæå¹ã«ãããš Mayhem ã©ã³ã®å
šäœçãªããã©ãŒãã³ã¹ãäœäžããå¯èœæ§ããããŸãã察ç
§çã«ãéåžžã®éžå¥ã䌎ãã©ã³ã¯ãadvanced_triage
ãæå¹åãããã©ã³ãããæ倧㧠10 åãé«éãªå¯èœæ§ããããŸãã
- ä»»æ
- ããŒã¿ã¿ã€ã: boolean
- ããã©ã«ãå€:
false
- ãµã³ãã«:
advanced_triage: false
tasks
¶
Mayhem ã©ã³ã§å®è¡ãããã¿ã¹ã¯ãèšå®ããŸããtasks
ãã©ã¡ãŒã¿ãŒã«èšå®ã§ããã¿ã¹ã¯ã«ã¯ä»¥äžã®ãããªãã®ããããŸãã
- æªçšå¯èœæ§ãã¡ã¯ã¿ãŒ
- ãªã°ã¬ãã·ã§ã³ ãã¹ã
- ããã€ã㢠ãã¹ã
- ã«ãã¬ããžè§£æ
- ä»»æ
- ããŒã¿ã¿ã€ã: object
- ããã©ã«ãå€:
tasks: - name: exploitability_factors - name: regression_testing - name: behavior_testing
- ãµã³ãã«:
tasks: - name: exploitability_factors - name: regression_testing - name: behavior_testing - name: coverage_analysis
Note
task ãã©ã¡ãŒã¿ãŒãæå®ã㊠mayhem run
ã³ãã³ããå®è¡ãããšãMayhemfile
ã® tasks
ããŒããªãŒããŒã©ã€ããããŸããããšãã°ãMayhemfile 㧠tasks
ããŒã« behavior_testing
ã ããèšå®ãããŠããŠããmayhem run --all .
㯠Mayhem ã©ã³ã§ãã¹ãŠã®ã¿ã¹ã¯ãå®è¡ããŸãã
testsuite
¶
Note
ãã®ãã£ãŒã«ãã¯ã以å㯠corpus
ã§ããããçŸåš mCode version 2.X ã§ã¯ testsuite
ã§ãã
Mayhem ã©ã³ã®åæãã¹ã ã¹ã€ãŒãã®å Žæãå®çŸ©ããŸãã次ã®ããã«åŠçãããŸãã
- èŠçŽ ã
file://
ã§å§ãŸãå ŽåãããŒã«ã« ãã¡ã€ã« ãœãŒã¹ã§ãããCLI ãå®è¡ãéå§ããã®ãšåãã·ã¹ãã äžã®ãã¡ã€ã«ãŸãã¯ãã£ã¬ã¯ããªãè¡šããŸãã - ãã¹ã¯çžå¯Ÿãã¹ã䜿çšããããšãã§ããŸã (äŸãã°
file://foo
)ããã®å Žåããã¡ã€ã«ã¯ Mayhemfile ãå«ããã£ã¬ã¯ããªãžã®çžå¯Ÿãã¹ãšããŠè§£æ±ºãããŸãã -
ãã¹ã¯çµ¶å¯Ÿãã¹ã䜿çšããããšãã§ããŸã (
file:///
ã3 ã€ã®ã¹ã©ãã·ã¥ã¯å é ã®ã¹ã©ãã·ã¥ã§å§ãŸããã¹ã瀺ããŸã)ã -
Mayhemfile ã§ã€ã¡ãŒãž ãã¡ã€ã«ã·ã¹ãã ã®ã«ãŒãã«
/corpus
ãŸãã¯/testsuite
ãã©ã«ããŒãå«ã Docker ã€ã¡ãŒãžãæå®ãããå Žåããããã®ãã©ã«ããŒã®å 容ãåæãã¹ã ã¹ã€ãŒãã«è¿œå ãããŸãã -
ä»»æ
- ããŒã¿ã¿ã€ã: string ã®ãªã¹ã
-
ããã©ã«ãå€:
-
https://$MAYHEM_DOMAIN/$MAYHEM_PROJECT/$MAYHEM_TARGET/testsuite.tar
file://testsuite
Info
https://$MAYHEM_DOMAIN/$MAYHEM_PROJECT/$MAYHEM_TARGET/testsuite.tar
ã¯ãæå®ããããããžã§ã¯ãããã³ã¿ãŒã²ããã® Mayhem ã€ã³ã¹ã¿ã³ã¹ã«ä¿åããã testsuite.tar
ãã¡ã€ã«ãæã URL ãæå®ããŸã (å©çšå¯èœãªå Žå)ãããã«ãããç¹å®ã®ãããžã§ã¯ãããã³ã¿ãŒã²ããã®ä»¥åã® Mayhem ã©ã³ã®ãã¹ã ã±ãŒã¹ã次㮠Mayhem ã©ã³ã«åŒãç¶ãããŸãã
- ãµã³ãã«:
testsuite:
- file://testsuite
uid
¶
ã¿ãŒã²ãã uid ãšããŠäœ¿çšãããªãã·ã§ã³ã®æ°å€ UNIX ãŠãŒã¶ãŒ ID ã§ããæªèšå®ã®å Žåãç¹æš©ãªãã® UNIX ãŠãŒã¶ãŒ ID ã䜿çšããããã¡ã€ã«ãžã®ã¢ã¯ã»ã¹ã®åé¡ã®åå ã«ãªãå¯èœæ§ããããŸãã0 以å€ã® uid ã䜿çšãããå Žåãäžè¬çã«ã¿ãŒã²ãã㯠1024 æªæºã®ããŒããžã®ãã€ã³ããªã©ã®ç¹æš©çæäœãå®è¡ã§ããŸãããDocker ã¯ãã®ãªãã·ã§ã³ã®ããã©ã«ãã 0 ã«ããŸãããUSER ã³ãã³ãã§ãªãŒããŒã©ã€ãã§ããŸããããã©ã«ãã® ããŒã¹ ã€ã¡ãŒãžã䜿çšããå Žåããã®å€ã¯ 1000 ã§ãã
- ä»»æ
- ããŒã¿ã¿ã€ã: integer
- ããã©ã«ãå€:
image
ããååŸ - ãµã³ãã«:
uid: 0
gid
¶
ã¿ãŒã²ãã uid ãšããŠäœ¿çšãããªãã·ã§ã³ã®æ°å€ UNIX ã°ã«ãŒã ID ã§ããæªèšå®ã®å Žåãç¹æš©ãªãã® UNIX ã°ã«ãŒã ID ã䜿çšããããã¡ã€ã«ãžã®ã¢ã¯ã»ã¹ã®åé¡ã®åå ã«ãªãå¯èœæ§ããããŸããæªæå®ã®å Žåãgid ã¯ããŒã¹ ã€ã¡ãŒãžããç¶æ¿ãããŸããDocker ã¯ãã®ãªãã·ã§ã³ã®ããã©ã«ãã 0 ã«ããŸãããUSER ã³ãã³ãã§ãªãŒããŒã©ã€ãã§ããŸããããã©ã«ãã® ããŒã¹ ã€ã¡ãŒãžã䜿çšããå Žåããã®å€ã¯ 1000 ã§ãã
- ä»»æ
- ããŒã¿ã¿ã€ã: integer
- ããã©ã«ãå€:
image
ããååŸ - ãµã³ãã«:
gid: 0
cmds
¶
ããã±ãŒãžåãããã¢ããªã±ãŒã·ã§ã³ããã¹ãããããŸããŸãªæ¹æ³ãæå®ãã cmd ãªããžã§ã¯ãã®ãªã¹ãã§ããå cmd ãªããžã§ã¯ãã¯ãMayhem ã«ã¿ãŒã²ããå®è¡ãã¡ã€ã«ã解æããæ¹æ³ãéç¥ããŸããå cmd ãªããžã§ã¯ãã«ã¯ã以äžã®ä»»æãã£ãŒã«ããå«ãŸããŠããŸãããããã®ãã£ãŒã«ãã¯ãã¿ãŒã²ãããè¿œå ã®æ å ±ãå¿ èŠãšããå ŽåããŸãã¯å®è¡ã®åã«ç°å¢ã«å€æŽãå ããå¿ èŠãããå Žåã«ã ã䜿çšããã¹ãã§ãã
- å¿ é
- ããŒã¿ã¿ã€ã: dictionary
cmd
¶
ã¿ãŒã²ããå®è¡ãã¡ã€ã«ã®åŒã³åºãã§ãã
ã³ãã³ã ã©ã€ã³ã§ @@
èå¥åãçç¥ããã¿ãŒã²ããããããã¯ãŒã¯ã䜿çšããããæå®ããªãã£ãå ŽåãMayhem ã¯æšæºå
¥å (/dev/stdin
) ãäž»èŠãªå
¥åãœãŒã¹ã§ãããšä»®å®ããŸãã
Note
@@
ã®ãã¡ãžã³ã° ããŒã¿ããã¡ã€ã«ã·ã¹ãã ãã¡ã€ã«ãšããŠæäœãããå Žåããã®ãŠãŒã¹ ã±ãŒã¹ãå®çŸããã«ã¯ filepath
ãã©ã¡ãŒã¿ãŒã®é
ãåç
§ããŠãã ãããcmd
ã®å
容ã¯ãbash ã€ã³ã¿ãŒããªã¿ãŒãçµç±ããã«çŽæ¥å®è¡ãããŸãã
- å¿ é
- ããŒã¿ã¿ã€ã: string
- ãµã³ãã« 1:
cmd: /usr/bin/objdump -x @@
- ãµã³ãã« 2:
- cmd: /host/tinyxml2-2.0.1/parse-fuzzer
libfuzzer: true
- cmd: /host/tinyxml2-2.0.1/orig-collapse @@
Info
ç°ãªãã€ã³ã¹ãã¥ã«ã¡ã³ããŒã·ã§ã³ã®ã€ã³ã¹ã¿ã³ã¹ã䜿çšããŠã¿ãŒã²ãããè€æ°åå®è¡ãããå Žåã1 ã€ã® Mayhemfile ã§è€æ°ã® cmd
ãã©ã¡ãŒã¿ãŒãå®è¡ããããšãã§ããŸããããšãã°ãã¿ãŒã²ãã㯠libFuzzer ããŒãã¹ãå®è¡ãã cmd
ãšãã¡ã€ã«ãèªã¿èŸŒã¿åãã³ãŒããåŒã³åºãã€ã³ã¹ãã¥ã«ã¡ã³ããªã/ããŒã¹å®è¡ãã¡ã€ã«ã® cmd
ã®äž¡æ¹ãå®è¡ããå ŽåããããŸããã·ã³ããªãã¯å®è¡ã¯ libFuzzer ããµããŒãããŸããããã€ã³ã¹ãã¥ã«ã¡ã³ããããŠããªã/ããŒã¹å®è¡ãã¡ã€ã« ãã€ããªã§ã·ã³ããªã㯠å®è¡ãèŠã€ãããã¹ã ã±ãŒã¹ã¯ãlibFuzzer ã®å®è¡ã§ãå
±æã§ããæ°ããã³ãŒããã«ããŒããã®ã«åœ¹ç«ã€ãããè€æ°ã® cmd ãã©ã¡ãŒã¿ãŒãæå®ããããšã«ã¯å©ç¹ããããŸãã
max_length
¶
ãã¡ãžã³ã° ã¿ãŒã²ãããžã®å ¥åãšããŠäžããããæ倧ã®é·ã (åäœ: ãã€ã) ã§ãã100 MB ãè¶ ããŠã¯ãããŸããã100 MB ãè¶ ããå Žåãæ€èšŒã倱æããŸããéå§ãã¹ãã®æå®ãããæ倧ã®é·ãããã倧ãããã¹ã ã±ãŒã¹ã¯ãæå®ãããå€ã«åãæšãŠãããŸãã
Info
ãŠãŒã¶ãŒã Mayhemfile V1.10 ã䜿çšããMayhemfile ã§æ瀺çã« max_length ãæå®ããªãã£ãå Žåãããã©ã«ãå€ã¯ 8192 ãã€ãã«ãªããŸããMayhemfile V1.9 以äžã®å ŽåãlibFuzzer ã¿ãŒã²ããã®ããã©ã«ãå€ã¯ 8192 ãã€ãã«ãªããã€ã³ã¹ãã¥ã«ã¡ã³ããŒã·ã§ã³ãªãã®ã¿ãŒã²ããã«å¯ŸããŠã¯ããã©ã«ãå€ã¯ãããŸããã
- ä»»æ
- ããŒã¿ã¿ã€ã: integer
- ããã©ã«ãå€:
8192
- ãµã³ãã«:
max_length: 8192
cwd
¶
Warning
ãã®ãã£ãŒã«ãã¯ã以å㯠chdir
ã§ããããçŸåš mCode version 2.X ã§ã¯ cwd
ã§ãã
ã¿ãŒã²ãããå®è¡ããåã« Mayhem ãã¹ã€ãããããã¹ã§ãã(çŸåšã®ã¯ãŒãã³ã° ãã£ã¬ã¯ã㪠- CWD ãšãåŒã°ããŸã)
- ä»»æ
- ããŒã¿ã¿ã€ã: string
- ããã©ã«ãå€:
image
ããååŸ - ãµã³ãã«:
cwd: /usr/bin
filepath
¶
Warning
ãã®ãã£ãŒã«ãã¯ã以å㯠target_path
ã§ããããçŸåš mCode version 2.X ã§ã¯ filepath
ã§ãã
@@
å€æ°ã®ãã¡ãº ããŒã¿ããã¡ã€ã«ã·ã¹ãã ãã¡ã€ã«ãšããŠæäœããå¿
èŠãããå ŽåãMayhem ãå
¥åãã¡ã€ã«ã«äžããååã§ãã
- ä»»æ
- ããŒã¿ã¿ã€ã: string
- ããã©ã«ãå€: null
- ãµã³ãã«:
filepath: /tmp/my_custom_file
env
¶
ããã°ã©ã å®è¡æã«èšå®ãããç°å¢å€æ°ãæå®ããŸããããã«ãMayhem ã«ãã£ãŠäœ¿çšãããããã©ãŒãã³ã¹æ¡åŒµã®äžéšãšããã°ã©ã ã®äºææ§ããªãå Žåãç¹å¥ãªç°å¢å€æ°ãæå®ã§ããŸããéåžžã¯å¿ èŠãããŸããããäžéšã®ãã«ãã¹ã¬ãã ããã°ã©ã ã§ã¯è§£æãå°é£ã«ãªãå¯èœæ§ããããŸãã
Mayhem å®è¡æã«äœ¿çšããç¹å¥ãªç°å¢å€æ°ã¯æ¬¡ã®ãšããã§ãã
ç°å¢å€æ° | å€ | 説æ |
---|---|---|
DISABLE_SMOKETEST |
1 |
1 ãèšå®ãããšãã¹ã¢ãŒã¯ ãã¹ããç¡å¹åãããŸããã¹ã¢ãŒã¯ ãã¹ãã¯ãç°¡æçãªãµãã㣠ãã§ãã¯ãå®è¡ããã¿ãŒã²ãããåäœããŠãããã確èªããŸããã¿ãŒã²ãããåäœããŠããªãå Žåãããã±ãŒãž/Mayhemfile ã§ãŠãŒã¶ãŒã®ä»å
¥ãå¿
èŠãšããäžè¬çãªæ§æã®èª€ããæ€åºããã¬ããŒãããŸãã |
MAYHEM_AUTORESOLUTION |
true ãŸã㯠false |
true ãèšå®ãããšãMayhem ã®èªå解決ãæå¹åãããŸããMayhem ã¯ãMayhem ã©ã³ã®å®è¡æã«çºçããå¯èœæ§ããã Mayhemfile æ§æã®åé¡ã®èªå解決ãè©Šã¿ãŸããfalse ãèšå®ãããšãMayhem ã®èªå解決ãç¡å¹ãããŸãã |
MFUZZ_COMPAT_LEVEL |
1 ãŸã㯠2 |
1 ãèšå®ãããšãMayhem ã®ããã©ãŒãã³ã¹æé©åã®äžéšãç¡å¹åãããŸã (ãšãã«ãã©ãŒã¯ ãµãŒããŒã®å®è¡å»¶æ)ã2 ãèšå®ãããšããã«ãã¹ã¬ãã ããã°ã©ã ãšå¹²æžããå¯èœæ§ãããæé©åãå®å
šã«ç¡å¹åãããŸãã |
MFUZZ_JAVA_MAIN_CLASS |
äŸ: com.forallsecure.FuzzMe |
æå®ããã JAR ãã¡ã€ã«ã®ã¡ã€ã³ ã¯ã©ã¹ãèšå®ããŸãã |
MFUZZ_JAVA |
1 |
1 㯠Java ã¿ãŒã²ããã®ãã¡ãžã³ã°ã Mayhem ã«æ瀺ããŸãã |
MFUZZ_CUSTOM_MUTATOR |
äŸ: /libmutator.so |
ã«ã¹ã¿ã ãã¥ãŒããŒã¿ãŒã®ãµããŒãçšã®å ±æãªããžã§ã¯ããèšå®ããŸãã |
MFUZZ_DOCKER_ENTRYPOINT |
1 |
1 㯠Docker ã€ã¡ãŒãž ã¿ãŒã²ããã§å©çšå¯èœãª docker-entrypoint.sh ã¹ã¯ãªãããå®è¡ãããã Mayhem ã«æ瀺ããŸãã |
MAYHEM_TIMEOUTS_AS_DEFECTS |
1 |
1 ã¯ãã¹ã ã±ãŒã¹ã®ã¿ã€ã ã¢ãŠããæ¬ é¥ãšããŠæ±ããMayhem UI ã®ã©ã³ ããŒãžã§ Defects/Test Case ãã€ã³ã«ã¬ããŒããããã Mayhem ã«æ瀺ããŸãããããã®æ¬ é¥ã® CWE 㯠407 Inefficient Algorithmic Complexity ã«ãªããŸãã |
Info
env
ãã©ã¡ãŒã¿ãŒã®å€ã®ãã©ãŒãããã¯ãYAML ã® flow ãŸã㯠block ã¹ã¿ã€ã«ã®ã©ã¡ãã§ãããŸããŸãããè€æ°ã®ç°å¢å€æ°ããµããŒããããŠããŸãã
- ä»»æ
- ããŒã¿ã¿ã€ã: object
- ãµã³ãã« 1:
env: { "ENV_VAR1": "value1", "ENV_VAR2": "value2", "ENV_VAR3": "value3" }
- ãµã³ãã« 2:
env:
ENV_VAR1: value1
ENV_VAR2: value2
ENV_VAR3: value3
- ããã©ã«ãå€:
image
ãã©ã¡ãŒã¿ãŒã§æå®ããã Docker ã€ã¡ãŒãžã«ãã§ã«ååšããç°å¢å€æ°ããååŸããŸãã
network
¶
ã¿ãŒã²ããããããã¯ãŒã¯ ã¿ãŒã²ããã§ããããšãæå®ããŸãã
- ã¿ãŒã²ããããããã¯ãŒã¯çµç±ã§å ¥åãåãåãå Žåã¯å¿ é ã§ãã
- ããŒã¿ã¿ã€ã: string
- ããã©ã«ãå€:
{}
url
¶
解æ察象ã®ãããã³ã«ããã¹ããããŒããæå®ããŸãããµããŒã察象ã®ãããã³ã«ã¯æ¬¡ã®ãšããã§ã: "tcp"ã"udp"ã"unix+stream"ã"unix+dgram" ããã³ "unix+seqpacket"
Mayhem ã§ã¯ãlocalhost
ã¯ä»»æã®ããŒã«ã« ã€ã³ã¿ãŒãã§ã€ã¹ãIPv4 ãŸã㯠IPv6 ãæå³ãããã¹ããããããã³ã«ã®èªåæ€åºãè©Šã¿ãããŸãããããããæå®ããå¿
èŠãããå ŽåãIPv4 ã®å Žå㯠127.0.0.1
ãIPv6 ã®å Žå㯠[::1]
ãšèšè¿°ããŸããããšãã°ãtcp://127.0.0.1:80
㯠IPv4 æ¥ç¶ã®ããŒã 80 ã«å
¥åããã£ãŒãããŸãã
ã¿ãŒã²ããã®éä¿¡æ¹æ³ãåžžã«æèããããã«ããŸããç¹ã«ãã³ã³ãããŒå
㧠localhost
ã䜿çšããã«ã¯ãlocalhost
ãã¹ãåã®ã«ãã¯ã¢ãããå¿
èŠãªå ŽåããããæåŸ
ã©ãã解決ãããªãå¯èœæ§ããããŸãããããŸãããé¿ããããã«ãå¯èœã§ããã°ãå
éšã¿ãŒã²ããæ§æã§ã¯ãã€ã³ãã£ã³ã°ãšæ¥ç¶ã«äžè²«ã㊠IP ã¢ãã¬ã¹ã䜿çšããŸãã
- ã¿ãŒã²ããããããã¯ãŒã¯çµç±ã§å ¥åãåãåãå Žåã¯å¿ é ã§ãã
- ããŒã¿ã¿ã€ã: string
- ããã©ã«ãå€: empty
- ãµã³ãã«:
url: tcp://localhost:8080
timeout
¶
éžå¥æã«ã¿ãŒã²ããããããã¯ãŒã¯å ¥åãåä¿¡ããã®ã Mayhem ãåŸ æ©ããæé (åäœ: ç§) ã§ãããã®å¶éæéå ã«ã¿ãŒã²ããããããã¯ãŒã¯å ¥åãåä¿¡ããªãã£ãå Žåããã¹ãã±ãŒã¹ã¯ç Žæ£ãããŸããå¶éæéãçããããšããã¹ãã±ãŒã¹ã¯éåžžã©ããã¬ããŒããè¿ãå ŽåããããŸããã¿ãŒã²ããã®éå§ã«æéããããå Žåãã¿ã€ã ã¢ãŠããé·ãããå¿ èŠãããå ŽåããããŸãã
Note
ãã®ãã£ãŒã«ãã¯ãããã¯ãŒã¯ ã¿ãŒã²ããã® timeout
ãæå³ããéãããã¯ãŒã¯ ã¿ãŒã²ããã® timeout
ãã©ã¡ãŒã¿ãŒãšã¯ç°ãªããŸãã
- ä»»æ
- ããŒã¿ã¿ã€ã: number
- ããã©ã«ãå€:
2
- ãµã³ãã«:
timeout: 10
client
¶
Warning
ãã®ãã£ãŒã«ãã¯ã以å㯠is_client
ã§ããããçŸåš mCode version 2.X ã§ã¯ client
ã§ãã
ãã¹ã察象ã®å®è¡ãã¡ã€ã«ãã¯ã©ã€ã¢ã³ãã®å Žåã'true' ãèšå®ããŸããã¯ã©ã€ã¢ã³ãã¯ãããã¯ãŒã¯æ¥ç¶ãéå§ããããšãæåŸ ããããã£ãœãããµãŒããŒã¯ Mayhem ãåŸ æ©ããããšãæåŸ ãããŸãã
- ä»»æ
- ããŒã¿ã¿ã€ã: boolean
- ããã©ã«ãå€:
false
- ãµã³ãã«:
client: true
timeout
¶
åå¥ã®ãã¹ããå®äºããã®ã Mayhem ãåŸ æ©ããæé (åäœ: ç§) ã§ãã
Info
ãããã€ã¡ã³ã/ã€ã³ã¹ããŒã«æã®ç°å¢å€æ° MAX_CMD_TIMEOUT_SECONDS
ã§ãªãŒããŒã©ã€ãã㊠timeout
å¶éãå¢ãããªãããããèš±å¯ããã timeout
ã®æ倧å€ã¯ 60 ç§ã§ããèšå®æå€§å€ (ããã©ã«ãã® 60 ç§ãŸã㯠MAX_CMD_TIMEOUT_SECONDS
ã«ãã£ãŠæå®ãããå€) ãè¶
ããå€ã¯ãèªåçã« timeout
å¶éã®æ倧å€ã«ããŠã³ãµã€ãºãããŸããå¿
èŠã«å¿ããŠçµç¹ã®ç®¡çè
ã«é£çµ¡ããMAX_CMD_TIMEOUT_SECONDS
ç°å¢å€æ°ãèšå®ããŠãã ããã
- ä»»æ:
- ããŒã¿ã¿ã€ã: number
- ããã©ã«ãå€: automatic
- ãµã³ãã«:
timeout: 1.5
memory_limit
¶
Warning
ãã®ãã£ãŒã«ãã¯ã以å㯠memory_limit_in_mb
ã§ããããçŸåš mCode version 2.X ã§ã¯ memory_limit
ã§ãã
ã¿ãŒã²ãããå²ãåœãŠãããšãã§ããã¡ã¢ãªéã®æ倧å€ã§ã (åäœ: MB)ãMayhem ã¯ãã®å¶éå€ãè¶ ãããã¹ãããã«ããã¯ã©ãã·ã¥ãšããŠå ±åããŸãã
- ä»»æ
- ããŒã¿ã¿ã€ã: integer
- ããã©ã«ãå€: automatic
- ãµã³ãã«:
memory_limit: 8192
sanitizer
¶
ã¿ãŒã²ããå®è¡ãã¡ã€ã«ããµãã¿ã€ã¶ãŒä»ãã§ã³ã³ãã€ã«ãããŠããå Žåã«ã ã true ãèšå®ããŸãã
- ä»»æ
- ããŒã¿ã¿ã€ã: boolean
- ããã©ã«ãå€: automatic
- ãµã³ãã«:
sanitizer: false
libfuzzer
¶
ã¿ãŒã²ããå®è¡ãã¡ã€ã«ã libFuzzer ä»ãã§ã³ã³ãã€ã«ãããŠããå Žåã«ã ã true ãèšå®ããŸãã
- ä»»æ
- ããŒã¿ã¿ã€ã: boolean
- ããã©ã«ãå€: automatic
- ãµã³ãã«:
libfuzzer: false
afl
¶
ã¿ãŒã²ããå®è¡ãã¡ã€ã«ã AFL/AFL++ ã€ã³ã¹ãã¥ã«ã¡ã³ããŒã·ã§ã³ä»ãã§ã³ã³ãã€ã«ãããŠããå Žåã«ã ã true ãèšå®ããŸãã
- ä»»æ
- ããŒã¿ã¿ã€ã: boolean
- ããã©ã«ãå€: automatic
- ãµã³ãã«:
afl: false
honggfuzz
¶
ã¿ãŒã²ããå®è¡ãã¡ã€ã«ã Honggfuzz ä»ãã§ã³ã³ãã€ã«ãããŠããå Žåã«ã ã true ãèšå®ããŸãã
- ä»»æ
- ããŒã¿ã¿ã€ã: boolean
- ããã©ã«ãå€: automatic
- ãµã³ãã«:
honggfuzz: false
gcov
¶
ã¿ãŒã²ããå®è¡ãã¡ã€ã«ã gcov
ãµããŒãä»ãã§ã³ã³ãã€ã«ãããŠããå Žåã«ã ã true ãèšå®ããŸãããŸããã¿ãŒã²ããå®è¡ãã¡ã€ã«ãšåããã¹ã« gcno
ããªããã°ãªããŸããã
- ä»»æ
- ããŒã¿ã¿ã€ã: boolean
- ããã©ã«ãå€: false
- ãµã³ãã«:
gcov: true
sancov
¶
ã¿ãŒã²ããå®è¡ãã¡ã€ã«ã sancov
ãµããŒãä»ãã§ã³ã³ãã€ã«ãããŠããå Žåã«ã ã true ãèšå®ããŸãã
- ä»»æ
- ããŒã¿ã¿ã€ã: boolean
- ããã©ã«ãå€: false
- ãµã³ãã«:
sancov: true
dictionary
¶
AFL/AFL++ äºæãã£ã¯ã·ã§ã㪠ãã¡ã€ã«ãžã®ãã¹ã§ãããã¹ã¯ã³ã³ãããŒã®ã«ãŒããžã®çžå¯Ÿãã¹ã§ããå¿
èŠããããŸããããšãã°ããã£ã¯ã·ã§ããªãã€ã¡ãŒãžå
ã® /etc/foo/bar/http.dict
ã®äžã«ããå ŽåãMayhemfile ã®ãã£ã¯ã·ã§ã㪠ãã¹ã¯ /etc/foo/bar/http.dict
ã§ããå¿
èŠããããŸãã
Tip
ãã¡ã¶ãŒå ¥åãšããŠãã£ã¯ã·ã§ããªã䜿çšããå Žåã®çŸå®çãªãµã³ãã«ã«ã€ããŠã¯ãAFL-compatibile dictionariesããåç §ããŠãã ããã
- ä»»æ
- ããŒã¿ã¿ã€ã: string
- ããã©ã«ãå€: empty
- ãµã³ãã«:
dictionary: /tmp/my-dictionary