-
-
Save AlexDaniel/35252aa967456a31c28aafaf1c612320 to your computer and use it in GitHub Desktop.
perl6 segfault
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
#!/usr/bin/env perl6 | |
use JSON::Tiny; | |
# Some data to work with | |
mkdir ‘data-for-segfault’; | |
my $script = 「sleep 0.1s」; | |
spurt ‘data-for-segfault/a’, $script; | |
spurt ‘data-for-segfault/b’, $script; | |
chmod 0o755, "data-for-segfault/a", "exploitd/b"; | |
spurt ‘foo.json’, 「{"targets": ["a","b","c","d","e"]}」; | |
# Code | |
my $config = from-json slurp ‘foo.json’; | |
my $targets = $config<targets>; | |
my $exploits = ‘data-for-segfault’.IO.dir.map: {.path}; | |
say "targets are $targets[]"; | |
for $targets.race(batch => 2, degree => 2) -> $target { | |
for $exploits -> $exploit { | |
shell "$exploit $target"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment