diff --git a/doc/2011-01-CMU/email1.txt b/doc/2011-01-CMU/email1.txt new file mode 100644 index 0000000..dee8079 --- /dev/null +++ b/doc/2011-01-CMU/email1.txt @@ -0,0 +1,71 @@ +From: The Dirtbags +To: RECIP +Subject: WIN BIG AT CAPTURE THE FLAG!!! +Message-ID: +MIME-Version: 1.0 +Content-type: multipart/alternative; boundary=eJwryC8uSS0qtqpIzc1P1i3OT86vAABObgfA +X-Face: '8$#2%$m/.;29z5"5"/ + +There are 5 tokens hidden in this message. Can you find them all? + +--eJwryC8uSS0qtqpIzc1P1i3OT86vAABObgfA +Content-type: text/plain; charset=UTF-8 + +CTF starts TOMORROW! Do you have sufficient stores of Mountain Dew? + +This is CMU's first ever CTF, so please be ready for a couple of +hiccups. Likewise, we expect you to be totally lost for a while, as you +get your bearings. While we tried to cover everything in the +registration web page, here are some points worth repeating: + +Your machine really ought to have netcat and nmap, and whatever +programming language(s) you prefer. An Ubuntu live CD has, at past +contests, not been sufficient. It's also a good idea to make sure your +computer works before you show up. Time is precious, don't spend yours +installing an operating system. + +We will have a switch at each table with gobs of ports, but you should +bring your own network cable. We will *not* provide an Internet +connection, so figure out now how you're going to get onto the Internet +(you will need it). + +If you have any questions, or would just like to hang out and shoot the +breeze, feel free to hop on IRC (server woozle.org, channel #ctf). + +We hope you have as much fun playing this as we're going to have +watching you work! + +The Dirtbags + +PS: are you aware of how much data can be hidden in a single email? +--eJwryC8uSS0qtqpIzc1P1i3OT86vAABObgfA +Content-type: text/html; charset=UTF-8 + +

CTF starts TOMORROW! Do you have sufficient stores of Mountain Dew?

+ +

This is CMU's first ever CTF, so please be ready for a couple of +hiccups. Likewise, we expect you to be totally lost for a while, as you +get your bearings. While we tried to cover everything in the +registration web page, here are some points worth repeating:

+ +

Your machine really ought to have netcat and nmap, and whatever +programming language(s) you prefer. An Ubuntu live CD has, at past +contests, not been sufficient. It's also a good idea to make sure your +computer works before you show up. Time is precious, don't spend yours +installing an operating system.

+ +

We will have a switch at each table with gobs of ports, but you should +bring your own network cable. We will *not* provide an Internet +connection, so figure out now how you're going to get onto the Internet +(you will need it).

+ +

If you have any questions, or would just like to hang out and shoot the +breeze, feel free to hop on IRC (server woozle.org, channel #ctf).

+ +

We hope you have as much fun playing this as we're going to have +watching you work!

+ +

The Dirtbags

+--eJwryC8uSS0qtqpIzc1P1i3OT86vAABObgfA-- + +cbfgref:krzbp-fbpbk diff --git a/doc/2011-01-CMU/thanks.png b/doc/2011-01-CMU/thanks.png new file mode 100644 index 0000000..55e8427 Binary files /dev/null and b/doc/2011-01-CMU/thanks.png differ diff --git a/doc/2011-01-CMU/thanks/blob b/doc/2011-01-CMU/thanks/blob new file mode 100644 index 0000000..61d84fd Binary files /dev/null and b/doc/2011-01-CMU/thanks/blob differ diff --git a/doc/2011-01-CMU/thanks/t.png b/doc/2011-01-CMU/thanks/t.png new file mode 100644 index 0000000..55e8427 Binary files /dev/null and b/doc/2011-01-CMU/thanks/t.png differ diff --git a/doc/2011-01-CMU/thanks/thanks b/doc/2011-01-CMU/thanks/thanks new file mode 100755 index 0000000..0becabf Binary files /dev/null and b/doc/2011-01-CMU/thanks/thanks differ diff --git a/doc/2011-01-CMU/thanks/thanks.c b/doc/2011-01-CMU/thanks/thanks.c new file mode 100644 index 0000000..fb1ee64 --- /dev/null +++ b/doc/2011-01-CMU/thanks/thanks.c @@ -0,0 +1,19 @@ +char *t = ( +"Thank you for helping make Capture The Flag a success! We couldn't" +"have done it without you." + +"As our way of saying thank you, we humbly offer this image" +"proclaiming you to be a cool person. Please feel free to print" +"off a copy of this image and post it in your window, over your" +"pannier, on your forehead, or wherever else you feel is appropriate." + +"Sincerely," + +" The Dirtbags" +); + +#include +int main(){char*p=t;while(1){int +c=getchar();if(EOF==c)break; +putchar(c^*p);if(!*++p)p=t;}return +0;} diff --git a/doc/2011-01-CMU/thanks/thanks.png b/doc/2011-01-CMU/thanks/thanks.png new file mode 100644 index 0000000..55e8427 Binary files /dev/null and b/doc/2011-01-CMU/thanks/thanks.png differ diff --git a/doc/2011-01-CMU/thanks/thanks.svg b/doc/2011-01-CMU/thanks/thanks.svg new file mode 100644 index 0000000..0fd412c --- /dev/null +++ b/doc/2011-01-CMU/thanks/thanks.svg @@ -0,0 +1,371 @@ + + + + + + + + + + + image/svg+xml + + + + + + + Capture the Flag 2011 + + at + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Central Michigan University + happened with my helpbecause I am a cool person! + + + + + right on! + + + diff --git a/doc/interest.txt b/doc/interest.txt new file mode 100644 index 0000000..f06479b --- /dev/null +++ b/doc/interest.txt @@ -0,0 +1 @@ +andrew.hay@afit.edu diff --git a/doc/writing-puzzles.txt b/doc/writing-puzzles.txt new file mode 100644 index 0000000..77b2975 --- /dev/null +++ b/doc/writing-puzzles.txt @@ -0,0 +1,163 @@ +How to create puzzle categories +=============================== + +The contest has multiple "puzzle" categories. Each category contains a +collection of thematically-related puzzles with increasing point +values. This document will guide you through the process of creating a +new category. It's up to you to make challenging puzzles, though :) + +Since Unix commands are plain text, I'll be using the Unix commands to +illustrate steps. These are simple commands that should be easy to +translate to a GUI. + + +Step 1: Establish a progression +------------------------------- + +Before you do anything else, you should sit down with a pen and paper, +and plan out how you'd like contestants to progress through your +category. This contest framework is set up to encourage a linear +progression through puzzles, while still allowing contestants to skip +over things they get stuck on. + +The net-re category, for instance, features full tutorial pages with +simple "end of chapter" type questions for point values 1-8. Point +values 10-99 apply the skills learned in the tutorial against +increasingly challenging problems, point values 100-999 increasingly +approach real-world challenges which use the skills, and point values +1000+ are either culled or inspired by actual net-re tasks performed by +experts in the field. + +The crypto category uses the previous answers key as part of the +solution process for each point value. + +Ideally, your category will work standalone for novices, while allowing +experts to quickly answer the training questions and progress to real +challenges. Remember that some events don't have a class portion, and +even the ones that do have students who prefer to spend the contest time +reviewing the exact same problems they did in the class. + +Remember, it's easy to make incredibly challenging puzzles, and you will +probably have a lot of ideas about how to do this. What's harder is to +make simple puzzles that teach. It can be helpful to imagine a student +with a basic skill set. Write your first puzzle for this student to +introduce them to the topic and get them thinking about things you +believe are important. Guide that student through your tutorial +puzzles, until they emerge ready to tackle some non-tutorial problems. +As they gain confidence, keep them on their toes with new challenges. +Remember to only introduce one new concept for each puzzle! + +Past a certain point, feel free to throw in the killer tricky puzzles +you're just dying to create! + + + +Step 2: Establish point values +------------------------------ + +Each of your steps needs a point value. Each point value must be +unique: you may not have two 5-point puzzles. + +Point values should roughly reflect how difficult a problem is to solve. +It's not terribly important that a 200-point puzzle be ten times harder +than a 20-point puzzle, but it is crucial that a 25-point puzzle be +roughly as difficult as a 20-point puzzle. Poorly-weighted puzzles has +been the main reason students lose interest. + + + +Step 3: Set up your puzzle structure +------------------------------------ + +The best way to get puzzles to me is in a zip file of an entire +directory. Let's say you are going to create a "sandwich" category. +Your first step will be to make a "sandwich" directory somewhere. + + $ mkdir sandwich + $ cd sandwich + $ + +Within your category directory, create subdirectories for each point +value puzzle. In the "sandwich" category we have only 5, 10, and +100-point puzzles. + + $ mkdir 5 10 100 + $ + + +Step 4: Write puzzles +--------------------- + +Now that your skeleton is set up, you can begin to fill it in. In each +point-value subdirectory, there can be three special files, and as many +downloadable files as you like, in addition to CGI and any downloadable +but non-listed files you would like. + +Special files are: + +* index.mdwn: a plain text file formatted with + [markdown](http://daringfireball.net/projects/markdown/), displayed + before the list of normal files in the puzzle directory. +* key: a plain text file with acceptable answers, one per line. Answers + are matched exactly (ie. they are case-sensitive). +* summary: a single line explaining to contest organizers what's going + on in this puzzle. + +All remaining files, except those with filenames beginning with a comma +(","), are listed on the puzzle page for download. + +Any file ending with ".cgi" will be run as CGI. You can search the web +for how to write a CGI. Available languages are Python, Lua, and Bourne +Shell. + +Let's make our 5-point sandwich question! + + $ cd 5 + $ cat <index.mdwn + > Welcome to the Sandwich category! + > In this category you will learn how to make a tasty sandwich. + > The key ingredients in a sandwich are: bread, spread, and filling. + > When making a sandwich, you need to first put down one slice of bread, + > then apply any spreads, and finally add filling. Popular fillings + > include cheese, sprouts, and cold cuts. When you are done, apply + > another slice of bread on top, and optionally tie it together with + > a fancy toothpick. + > + > Now that you know the basics of sandwich-making, it's time for a + > question! How many slices of bread are in a sandwich? + > EOD + $ cat <key + > 2 + > TWO + > two + > EOD + $ echo "How many slices of bread in a sandwich" > summary + $ + +If you wanted to provide a PDF of various sandwiches, this would be the +time to add that too: + + $ cp /tmp/sandwich-types.pdf . + $ + +In a real category, you might provide an executable, hard drive image, +or some other kind of blob. + +No additional work is needed to have `sandwich-types.pdf` show up as a +download on the puzzle page. + + + +Step 5: Package it up +--------------------- + +After you've flushed out all your point-value directories, it's time to +wrap it up and send it in. Clean out any backup or temporary files you +or your editor might have written in the directories, and zip the sucker +up. + + $ cd ../.. + $ zip -r sandwich.zip sandwich/ + $ + +Now mail the zip file in, and you're all done! diff --git a/include/arc4.c b/include/arc4.c index 8e3d562..e96525e 100644 --- a/include/arc4.c +++ b/include/arc4.c @@ -61,6 +61,67 @@ arc4_hash(uint8_t const *buf, size_t buflen, arc4_init(&ctx, buf, buflen); for (i = 0; i < ARC4_HASHLEN; i += 1) { - hash[i] = arc4_pad(&ctx); + hash[i] = arc4_out(&ctx); } } + + +#ifdef ARC4_MAIN + +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + struct arc4_ctx ctx; + + /* Read key and initialize context */ + { + uint8_t key[256]; + size_t keylen = 0; + char *ekey = getenv("KEY"); + FILE *f; + + if (argc == 2) { + if (! (f = fopen(argv[1], "r"))) { + perror(argv[0]); + } + } else { + f = fdopen(3, "r"); + } + + if (f) { + keylen = fread(key, 1, sizeof(key), f); + fclose(f); + } else if (ekey) { + keylen = strlen(ekey); + if (keylen > sizeof(key)) { + keylen = sizeof(key); + } + memcpy(key, ekey, keylen); + } + + if (0 == keylen) { + fprintf(stderr, "Usage: %s [KEYFILE] &1 + +# Set up networking for all CTF packages +ip link set eth0 up +if ! ip route | grep -q default; then + ip route add default via 10.0.0.1 || exit 1 +fi + +install -o root -m 0755 -d /var/lib/ctf/tokens +exec ./update-tokens diff --git a/packages/tokens/service/tokens/tokens b/packages/ctfbase/service/ctf/update-tokens similarity index 100% rename from packages/tokens/service/tokens/tokens rename to packages/ctfbase/service/ctf/update-tokens diff --git a/packages/tokens/src/Makefile b/packages/ctfbase/src/Makefile similarity index 57% rename from packages/tokens/src/Makefile rename to packages/ctfbase/src/Makefile index 1bd9d34..5b21ecc 100644 --- a/packages/tokens/src/Makefile +++ b/packages/ctfbase/src/Makefile @@ -1,6 +1,7 @@ build: tokencli arc4 -arc4: arc4.o arc4-main.o +arc4: arc4.c + $(CC) $(CFLAGS) $(LDFLAGS) -DARC4_MAIN -o $@ $< tokencli: tokencli.o arc4.o diff --git a/packages/tokens/src/arc4.c b/packages/ctfbase/src/arc4.c similarity index 100% rename from packages/tokens/src/arc4.c rename to packages/ctfbase/src/arc4.c diff --git a/packages/tokens/src/arc4.h b/packages/ctfbase/src/arc4.h similarity index 100% rename from packages/tokens/src/arc4.h rename to packages/ctfbase/src/arc4.h diff --git a/packages/tokens/src/tokencli.c b/packages/ctfbase/src/tokencli.c similarity index 100% rename from packages/tokens/src/tokencli.c rename to packages/ctfbase/src/tokencli.c diff --git a/packages/logger/service/logger/run b/packages/logger/service/logger/run index aa0462d..040e9bc 100755 --- a/packages/logger/service/logger/run +++ b/packages/logger/service/logger/run @@ -1,4 +1,6 @@ -#! /bin/sh +#! /bin/sh -e exec 2>&1 -exec tcpsvd 0 4104 /opt/logger/bin/logger +IP=$(cat ip.txt) +ip addr add $IP dev eth0 +exec tcpsvd ${IP#/*} 1958 /opt/logger/bin/logger diff --git a/packages/logger/src/logger.c b/packages/logger/src/logger.c index 11ae1bb..b51b6ed 100644 --- a/packages/logger/src/logger.c +++ b/packages/logger/src/logger.c @@ -1,10 +1,35 @@ -#include +/** logger.c - generate fake log messages (part of dirtbags CTF) + * + * Author: Neale Pickett + * + * This software has been authored by an employee or employees of Los + * Alamos National Security, LLC, operator of the Los Alamos National + * Laboratory (LANL) under Contract No. DE-AC52-06NA25396 with the + * U.S. Department of Energy. The U.S. Government has rights to use, + * reproduce, and distribute this software. The public may copy, + * distribute, prepare derivative works and publicly display this + * software without charge, provided that this Notice and any statement + * of authorship are reproduced on all copies. Neither the Government + * nor LANS makes any warranty, express or implied, or assumes any + * liability or responsibility for the use of this software. If + * software is modified to produce derivative works, such modified + * software should be clearly marked, so as not to confuse it with the + * version available from LANL. + */ + + #include #include #include #include #include -#include "token.h" + +#ifdef STANDALONE +# define TOKEN_MAX 50 +#else +# include "token.h" +# include "arc4.h" +#endif #define PID_MAX 32768 #define QSIZE 200 @@ -27,12 +52,16 @@ read_tokens() char name[40]; for (i = 0; i < sizeof(token)/sizeof(*token); i += 1) { +#ifdef STANDALONE + strcpy(token[i], "logger:xylep-donut-nanox"); +#else /* This can't grow beyond 40. Think about it. */ sprintf(name, "logger%d", i); len = read_token(name, key, sizeof(key), token[i], sizeof(token[i])); if ((-1 == len) || (len >= sizeof(token[i]))) abort(); token[i][len] = '\0'; +#endif } } diff --git a/packages/mcp/service/eth0/run b/packages/mcp/service/eth0/run deleted file mode 100755 index 58a2f37..0000000 --- a/packages/mcp/service/eth0/run +++ /dev/null @@ -1,8 +0,0 @@ -#! /bin/sh -e - -hostname mcp - -ifconfig eth0 10.0.0.2 netmask 255.255.0.0 -route add default gw 10.0.0.1 - -exec inotifyd true $(pwd):x diff --git a/packages/mcp/service/httpd/mathopd.conf b/packages/mcp/service/httpd/mathopd.conf index a1e645e..00dcb97 100644 --- a/packages/mcp/service/httpd/mathopd.conf +++ b/packages/mcp/service/httpd/mathopd.conf @@ -41,6 +41,8 @@ Control { } Server { + Address 10.0.0.2 + Virtual { AnyHost Control { diff --git a/packages/mcp/service/tokend/run b/packages/mcp/service/tokend/run index 211a9b9..f373ff5 100755 --- a/packages/mcp/service/tokend/run +++ b/packages/mcp/service/tokend/run @@ -2,6 +2,8 @@ exec 2>&1 +ip addr add 10.0.0.2/24 dev eth0 + DB=/var/lib/ctf/tokens.db if [ ! -f $DB ]; then diff --git a/packages/mcp/src/Makefile b/packages/mcp/src/Makefile index 35fa5c5..02845a2 100644 --- a/packages/mcp/src/Makefile +++ b/packages/mcp/src/Makefile @@ -1,13 +1,13 @@ CFLAGS = -Wall -Werror -TARGETS = in.tokend tokencli claim.cgi +TARGETS = in.tokend claim.cgi TARGETS += puzzler.cgi puzzles.cgi -TARGETS += pointscli mktoken arc4 +TARGETS += pointscli mktoken all: build build: $(TARGETS) -in.tokend: in.tokend.o arc4.o common.o +in.tokend: in.tokend.o arc4.o md5.o common.o tokencli: tokencli.o arc4.o pointscli: pointscli.o common.o mktoken: mktoken.o common.o diff --git a/packages/mcp/src/arc4-main.c b/packages/mcp/src/arc4-main.c deleted file mode 120000 index d91405e..0000000 --- a/packages/mcp/src/arc4-main.c +++ /dev/null @@ -1 +0,0 @@ -../../tokens/src/arc4-main.c \ No newline at end of file diff --git a/packages/mcp/src/in.tokend.c b/packages/mcp/src/in.tokend.c index 7b1f044..e99276c 100644 --- a/packages/mcp/src/in.tokend.c +++ b/packages/mcp/src/in.tokend.c @@ -14,6 +14,7 @@ #include #include "common.h" #include "arc4.h" +#include "md5.h" void list_teams() @@ -28,14 +29,11 @@ list_teams() if ((0 == stat(state_path("teams/names/%s", ent->d_name), &buf)) && (S_ISREG(buf.st_mode))) { - uint8_t hash[ARC4_HASHLEN]; - int i; + char digest[MD5_HEXDIGEST_LEN + 1]; - arc4_hash((uint8_t *)ent->d_name, strlen(ent->d_name), hash); - for (i=0; i < ARC4_HASHLEN; i += 1) { - printf("%02x", hash[i]); - } - printf("\n"); + md5_hexdigest((uint8_t *)ent->d_name, strlen(ent->d_name), digest); + digest[MD5_HEXDIGEST_LEN] = '\n'; + write(1, digest, sizeof(digest)); } } closedir(dir); diff --git a/packages/mcp/src/tokencli.c b/packages/mcp/src/tokencli.c deleted file mode 120000 index 4ae82d2..0000000 --- a/packages/mcp/src/tokencli.c +++ /dev/null @@ -1 +0,0 @@ -../../tokens/src/tokencli.c \ No newline at end of file diff --git a/packages/octopus/service/octopus/run b/packages/octopus/service/octopus/run index 6bdd947..7655b30 100755 --- a/packages/octopus/service/octopus/run +++ b/packages/octopus/service/octopus/run @@ -1,4 +1,6 @@ -#! /bin/sh +#! /bin/sh -e exec 2>&1 -exec /opt/octopus/bin/octopus +IP=$(cat ip.txt) +ip addr add $IP dev eth0 +exec /opt/octopus/bin/octopus ${IP%/*} diff --git a/packages/octopus/src/octopus.c b/packages/octopus/src/octopus.c index 1b9dd25..f809a66 100644 --- a/packages/octopus/src/octopus.c +++ b/packages/octopus/src/octopus.c @@ -194,17 +194,17 @@ struct bound_port { } bound_ports[PORTS]; int -bind_port(int fd, uint16_t port) { +bind_port(struct in_addr *addr, int fd, uint16_t port) { struct sockaddr_in addr; addr.sin_family = AF_INET; addr.sin_port = htons(port); - addr.sin_addr.s_addr = INADDR_ANY; + addr.sin_addr.s_addr = *addr; return bind(fd, (struct sockaddr *)&addr, sizeof(addr)); } int -rebind() +rebind(struct in_addr *addr) { static int offset = 0; char token[200]; @@ -235,7 +235,7 @@ rebind() bound_ports[i + offset].fd = socket(PF_INET, SOCK_DGRAM, 0); do { port = (random() % 56635) + 10000; - ret = bind_port(bound_ports[i + offset].fd, port); + ret = bind_port(addr, bound_ports[i + offset].fd, port); } while (-1 == ret); /* Set the last guy's port number */ @@ -337,15 +337,25 @@ loop() int main(int argc, char *argv[]) { - int ret; - int i; - time_t last = time(NULL); + int ret; + int i; + time_t last = time(NULL); + struct in_addr addr; /* The random seed isn't super important here. */ - srand(8); + srand(last); + + if (argc > 1) { + if (-1 == inet_aton(argv[1], &addr)) { + fprintf(stderr, "invalid address: %s\n", argv[1]); + return EX_IOERR; + } + } else { + addr = INADDR_ANY; + } bound_ports[0].fd = socket(PF_INET, SOCK_DGRAM, 0); - ret = bind_port(bound_ports[0].fd, 8888); + ret = bind_port(&addr, bound_ports[0].fd, 8888); if (-1 == ret) { perror("bind port 8888"); return EX_IOERR; @@ -354,7 +364,7 @@ main(int argc, char *argv[]) for (i = 1; i < PORTS; i += 1) { bound_ports[i].fd = -1; } - if (-1 == rebind()) { + if (-1 == rebind(&addr)) { perror("initial binding"); return EX_IOERR; } @@ -364,7 +374,7 @@ main(int argc, char *argv[]) if (last + 4 < now) { last = now; - if (-1 == rebind()) break; + if (-1 == rebind(&addr)) break; } } diff --git a/packages/printf/service/printf/run b/packages/printf/service/printf/run index 512dcab..83dac55 100755 --- a/packages/printf/service/printf/run +++ b/packages/printf/service/printf/run @@ -1,11 +1,14 @@ -#! /bin/sh +#! /bin/sh -e exec 2>&1 +IP=$(cat ip.txt) +ip addr add $IP dev eth0 + # So I say to him, "Alex, what's a good high port number for a CTF category?" # And he says, "6" # And I say, "no, it has to be bigger than 1000" # And he says, "how about 9001, because that's bigger than 9000" -# So, okay. +# Okay. -exec tcpsvd 0 9001 ./run-printf +exec tcpsvd ${IP#/*} 9001 ./run-printf diff --git a/packages/pwnables/service/eth0.pwn/run b/packages/pwnables/service/eth0.pwn/run deleted file mode 100755 index 64d7d36..0000000 --- a/packages/pwnables/service/eth0.pwn/run +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/sh - -if [ -d /opt/mcp ]; then - sv d . - exit -fi - -hostname pwnables -ifconfig eth0 10.0.0.10 netmask 255.255.0.0 -route add default gw 10.0.0.1 -exec inotifyd true $(pwd):x diff --git a/packages/pwnables/service/pwnables/run b/packages/pwnables/service/pwnables/run index 4d8487b..86e16e9 100755 --- a/packages/pwnables/service/pwnables/run +++ b/packages/pwnables/service/pwnables/run @@ -1,5 +1,9 @@ #! /bin/sh -e +# Configure IP address +IP=$(cat ip.txt) +ip addr add $IP dev eth0 + # Set up chroot environment # We never umount any of this since it's all just in RAM mkdir -p /mnt/pwnables-root diff --git a/packages/pwnables/service/sshd.pwn/log/run b/packages/pwnables/service/sshd.pwn/log/run deleted file mode 100755 index 4794c8e..0000000 --- a/packages/pwnables/service/sshd.pwn/log/run +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh - -exec logger -t sshd diff --git a/packages/pwnables/service/sshd.pwn/rsa.key b/packages/pwnables/service/sshd.pwn/rsa.key deleted file mode 100644 index f530471..0000000 Binary files a/packages/pwnables/service/sshd.pwn/rsa.key and /dev/null differ diff --git a/packages/pwnables/service/sshd.pwn/run b/packages/pwnables/service/sshd.pwn/run deleted file mode 100755 index 1100af4..0000000 --- a/packages/pwnables/service/sshd.pwn/run +++ /dev/null @@ -1,10 +0,0 @@ -#! /bin/sh - -exec 2>&1 - -if [ -d /opt/mcp ]; then - sv d . - exit -fi - -exec dropbear -r ./rsa.key -E -F diff --git a/packages/mcp/service/sshd/finish b/packages/sshd/service/sshd/finish similarity index 100% rename from packages/mcp/service/sshd/finish rename to packages/sshd/service/sshd/finish diff --git a/packages/mcp/service/sshd/log/run b/packages/sshd/service/sshd/log/run similarity index 100% rename from packages/mcp/service/sshd/log/run rename to packages/sshd/service/sshd/log/run diff --git a/packages/mcp/service/sshd/rsa.key b/packages/sshd/service/sshd/rsa.key similarity index 100% rename from packages/mcp/service/sshd/rsa.key rename to packages/sshd/service/sshd/rsa.key diff --git a/packages/mcp/service/sshd/run b/packages/sshd/service/sshd/run similarity index 100% rename from packages/mcp/service/sshd/run rename to packages/sshd/service/sshd/run diff --git a/packages/tokens/service/tokens/run b/packages/tokens/service/tokens/run deleted file mode 100755 index 25df271..0000000 --- a/packages/tokens/service/tokens/run +++ /dev/null @@ -1,5 +0,0 @@ -#! /bin/sh - -exec 2>&1 -install -o root -m 0755 -d /var/lib/ctf/tokens -exec ./tokens diff --git a/packages/tokens/setup b/packages/tokens/setup deleted file mode 100755 index e864e0d..0000000 --- a/packages/tokens/setup +++ /dev/null @@ -1,4 +0,0 @@ -#! /bin/sh - -cp -r service/* /var/service -mkdir -p /var/lib/ctf/tokens diff --git a/packages/tokens/src/arc4-main.c b/packages/tokens/src/arc4-main.c deleted file mode 100644 index 9332685..0000000 --- a/packages/tokens/src/arc4-main.c +++ /dev/null @@ -1,58 +0,0 @@ -#include -#include -#include -#include -#include -#include "arc4.h" - -int -main(int argc, char *argv[]) -{ - struct arc4_ctx ctx; - - /* Read key and initialize context */ - { - uint8_t key[256]; - size_t keylen = 0; - char *ekey = getenv("KEY"); - FILE *f; - - if (argc == 2) { - if (! (f = fopen(argv[1], "r"))) { - perror(argv[0]); - } - } else { - f = fdopen(3, "r"); - } - - if (f) { - keylen = fread(key, 1, sizeof(key), f); - fclose(f); - } else if (ekey) { - keylen = strlen(ekey); - if (keylen > sizeof(key)) { - keylen = sizeof(key); - } - memcpy(key, ekey, keylen); - } - - if (0 == keylen) { - fprintf(stderr, "Usage: %s [KEYFILE]