|
3 months ago | |
---|---|---|
agent-deployment | 3 months ago | |
crossfire | 3 months ago | |
dist | 3 months ago | |
etc | 3 months ago | |
.envrc | 3 months ago | |
.gitignore | 5 months ago | |
COPYING | 5 months ago | |
LICENSE | 5 months ago | |
Makefile | 3 months ago | |
README.md | 3 months ago | |
license.template | 5 months ago |
distributed brute force infrastructure
takes the difficulty out of creating custom brute force jobs
cd
to the repo directory. hopefully you’re already here :P
add user-level racket dir to your PATH
export PATH=$HOME/.racket/$(racket -e "(displayln (version))")/bin:$PATH
export CROSSFIRE_DEVEL=1
install package from repo, and build the agent binary (and place it into the development state dir)
raco pkg install ./crossfire
mkdir -p lib/projects
make dev-make-agent
# this step could take a while, and needs an internet connection to download some additional sources
initialize server with some temporary dev commands
crossfire-server dev-export-client # exports lib/client0.rktd
start the server
crossfire-server
set up the client with access to the server using the previous client config
crossfire-client setup lib/client0.rktd
register and start up one or more agents (this assumes your arch is x86_64-pc-linux-gnu
, it’s
roughly the output of gcc -dumpmachine
-- the arch is used to select an agent binary that was
previously built)
crossfire-client agent -c -a x86_64-pc-linux-gnu -n myagent -r cpu
# this will output that it saved a binary to a certain file
# run the binary to start up the agent
check the status of agents
crossfire-client agent -l
create a new project
crossfire-client new meow2
cd meow2
edit config manifest.rktd
(mode stdio)
to (mode callback)
(command ...)
to (command "./meow")
generate files (Makefile, crossfire.c, crossfire.h -- these are support code for running your code on agents. in callback mode, your code registers a callback with crossfire that gets called for each possible input, and returns true or false)
crossfire-client generate
create a new source file meow.c
with the following
#include "crossfire.h"
bool my_callback( vartype a,vartype b,vartype c,vartype d,vartype e,vartype f) {
return e == '4' && f == '2';
}
int main(int argc, char* argv[]) {
return crossfire_main(argc, argv, my_callback);
}
update the makefile
.PHONY: all clean
CC=gcc
CFLAGS=-std=c11 -O3
LDFLAGS=-static
all: meow
meow: meow.o crossfire.o
clean:
$(RM) meow meow.o
# crossfire rules
### leave this section alone
build project
make
now we’re ready to submit
crossfire-client submit
check status of projects
crossfire-client status
this one completes pretty fast, so you should see 100% progress and one match
let’s show the match (assuming the project ID from the status command is 1
)
crossfire-client show 1
aaaaand yeah that’s all for now. lots of stuff still probably broken tbh
contributions welcome,,,,
crossfire_main
with callback function that returns true or falsecrossfire new
: create new crossfire projectcrossfire generate
: updates autogenerated files in a projectcrossfire check
: checks some common misconfiguration issuescrossfire test
: test project locally, replicates configuration of server with single local
agent to debug issuescrossfire node-test
: submit a mini-task to a node that has the necessary
resources to debug issuescrossfire submit
: submit task to servercrossfire delete
: cancels/deletes submitted taskcrossfire status
: check status of server / task summarycrossfire show
: shows task detailscrossfire setup
: sets up access to a servercrossfire agent
: manage agentscurrently only linux is supported for the server and agent. the server might run on macOS but it’s
not guaranteed. if you are interested in porting this to a new platform, take a look at
agent-deployment
for the embedded build of racket for the all-in-one agent binary, and perhaps
create additional makefiles for other platforms. additionally, platform-specific racket code is
marked with an XXX
comment