Skip to content

Instantly share code, notes, and snippets.

@md-5
md-5 / FlagBot.rb
Created August 26, 2012 05:40 — forked from danopia/FlagBot.rb
IRC bot to run a Stripe CTF2 level8 cracking command automatically. Integrates with XChat.
#!/usr/bin/env ruby
$server = 'irc.stripe.com'
$channel = '#level8'
$nick = 'FlagBot'
$chanfile = '~/.xchat2/xchatlogs/NETWORK-\#level8.log'
$sshpath = 'user-hawkwarded@level02-4.stripe-ctf.com'
$command = 'ruby bot.rb'
$store = './flags.rb'
#include <stdio.h>
#include <jni.h>
JNIEnv* create_vm()
{
JavaVM* jvm;
JNIEnv* env;
JavaVMInitArgs args;
JavaVMOption options[1];
@md-5
md-5 / javaModule.java
Created August 26, 2012 06:57
ZNC Java
package in.znc.java;
import java.util.Collection;
public abstract class JavaModule {
private final String name;
public JavaModule(String name) {
this.name = name;
@md-5
md-5 / App.java
Created September 6, 2012 10:03
Why Netty is awesome.
package com.md_5.jcaptive;
import io.netty.bootstrap.Bootstrap;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundMessageHandlerAdapter;
import io.netty.channel.ChannelInitializer;
@md-5
md-5 / comments.txt
Created September 15, 2012 12:45
Sure you can add comments
<roxlu> hey guys, it looks like it's not possible to add comments to gists anymore?
<roxlu> It didn't work a couple of days before but I thought it was just me doing something wierd... but today I get the same thing
@md-5
md-5 / 1-0.java
Created September 16, 2012 08:39
Java NIO Webservers
package net.shadowraze.vote4diamondz;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
@md-5
md-5 / NBT.java
Created October 5, 2012 10:36
nbt lib
/**
* Copyright (c) 2012, md_5. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
@md-5
md-5 / BitPacking.java
Created October 14, 2012 05:57
BitPacking.java
public class App
{
public static void main(String[] args) throws Exception
{
for (byte art = 0; art < 24; art++)
{
for (byte data = 0; data < 4; data++)
{
byte packed = pack(art, data);
@md-5
md-5 / EncryptionUtil.java
Created November 16, 2012 23:21
MC Encryption
package net.md_5.bungee;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.net.URL;
import java.net.URLEncoder;
import java.security.InvalidKeyException;
import java.security.Key;
@md-5
md-5 / Nettyadaptor.java
Created November 19, 2012 05:22
Netty socket adaptor
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelOption;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.Socket;
import java.net.SocketAddress;