It looks like you're new here. If you want to get involved, click one of these buttons!
import socket
import struct
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host = \"vortex.labs.overthewire.org\"
port = 5842
s.connect((host, port))
int = 0
for n in range(4):
data = s.recv(4)
int += struct.unpack(\"<I\", data)[0]
s.send(struct.pack(\"<I\",(int & 0xFFFFFFFF)))
print s.recv(1000)
s.close()
Nice what sources/reading did you do to find out this, not walkthroughs but things that explain insigned integers and reading them in hostbyte order
#! /usr/bin/dmd -run
/* * * * * * * * * * * * * * * * * * * * * * *
 * *
 * OverTheWire.org : Semtex level 0 solution *
 * File : otw_semtex0.d *
 * *
 * * * * * * * * * * * * * * * * * * * * * * */
 import std.socket;
 import std.stdio;
 int main(string args[])
 {
 // Note: port 24000:x86/elf, 24001:amd64/elf, 24002:ppc/mach-O
 auto sock = new TcpSocket(new InternetAddress(\"semtex.labs.overthewire.org\", 24001));
 //sock.connect();
 char[] file;
 char[1024] buf;
 int sock_result;
 while (true)
 {
 sock_result = sock.receive(buf);
 if ((sock_result == sock.ERROR) || (!sock_result)) break;
 file ~= buf[0 .. sock_result];
 }
 sock.shutdown(SocketShutdown.BOTH);
 sock.close();
Â
 if (file.length < 2) return 0;
 auto out_file = File(\"lev0.elf64\", \"wb\");
 for (uint i = 0; i < file.length; i += 2)
 out_file.write(file[i]);
 out_file.close();
Â
 return 0;
 }
haha, these are pretty good. i've been trying a few of the other level 0s~ completed semtex just now~ woot.
[spoiler]
#! /usr/bin/dmd -run
/* * * * * * * * * * * * * * * * * * * * * * *
 * *
 * OverTheWire.org : Semtex level 0 solution *
 * File : otw_semtex0.d *
 * *
 * * * * * * * * * * * * * * * * * * * * * * */
 import std.socket;
 import std.stdio;
 int main(string args[])
 {
 // Note: port 24000:x86/elf, 24001:amd64/elf, 24002:ppc/mach-O
 auto sock = new TcpSocket(new InternetAddress(\"semtex.labs.overthewire.org\", 24001));
 //sock.connect();
 char[] file;
 char[1024] buf;
 int sock_result;
 while (true)
 {
 sock_result = sock.receive(buf);
 if ((sock_result == sock.ERROR) || (!sock_result)) break;
 file ~= buf[0 .. sock_result];
 }
 sock.shutdown(SocketShutdown.BOTH);
 sock.close();
Â
 if (file.length < 2) return 0;
 auto out_file = File(\"lev0.elf64\", \"wb\");
 for (uint i = 0; i < file.length; i += 2)
 out_file.write(file[i]);
 out_file.close();
Â
 return 0;
 }
output:
http://i.imgur.com/MdUE5.jpg
[/spoiler]