Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

wargames

Name: Anonymous 2012-03-24 14:13

ugh, /g/ has proven to be too incompetent and full of dilettantes to crack a crackme together, so I'm hoping /prog/ won't disappoint.

Here's a wargame, a hacking puzzle where you get from level to level using knowledge of programming and computers.

http://www.overthewire.org/wargames/vortex/vortex0.shtml

This is a collaborative effort so share what you have. and don't cheat by looking up solutions online. happy hacking

Name: Anonymous 2012-03-24 15:31

#include <stdio.h>
#include <winsock2.h>

/* only runs on Windows, u mad bro?
 * gcc vortex0.c -ovortex0.exe -lWS2_32
 */

int main(void) {
    WSAStartup(MAKEWORD(2,2), &(WSADATA){});
    SOCKET s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
    struct hostent *h = gethostbyname("vortex.labs.overthewire.org");
    connect(s, (struct sockaddr *)&(struct sockaddr_in) {
        .sin_family = AF_INET,
        .sin_port = htons(5842),
        .sin_addr = *(struct in_addr *)h->h_addr
    }, sizeof(struct sockaddr_in));
    unsigned ints[4];
    int n = 0;
    while (n < sizeof(ints))
        n += recv(s, &((char *)ints)[n], sizeof(ints)-n, 0);
    printf("Received %d %d %d %d\n", ints[0], ints[1], ints[2], ints[3]);
    ints[0] += ints[1] + ints[2] + ints[3];
    send(s, (char *)&ints[0], sizeof(ints[0]), 0);
    char buffer[65536];
    recv(s, buffer, sizeof(buffer), 0);
    printf("%s\n", buffer);
    closesocket(s);
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List