Skip to content

Instantly share code, notes, and snippets.

@ql-owo-lp
ql-owo-lp / BOOTP.java
Created March 3, 2015 00:05
OpenDaylight DHCP and DNS packet parser
package com.kevinxw.net.packet;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import org.opendaylight.controller.sal.packet.BitBufferHelper;
import org.opendaylight.controller.sal.packet.BufferException;
import org.opendaylight.controller.sal.packet.Packet;
import org.opendaylight.controller.sal.packet.PacketException;
import org.opendaylight.controller.sal.utils.HexEncode;
import org.opendaylight.controller.sal.utils.NetUtils;
@ql-owo-lp
ql-owo-lp / kern_clock.c
Created October 7, 2013 02:06
Recently Aged Ticks algorithm for CIS 657
/*-
* Copyright (c) 1982, 1986, 1991, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* Redistribution and use in source and binary forms, with or without
@ql-owo-lp
ql-owo-lp / Program_random_starter.bat
Last active December 16, 2015 12:08
Program random starter for WinXP SP3
@Echo Off
For /F "tokens=2 delims=:" %%j in ('Find /C /V "" random.txt') Do (
Set MOD=%%j
)
Set MOD=%MOD:~1%
echo Launched program list > launched_list.txt
:LOOP
#!/bin/bash
cp /usr/lib/ssl/openssl.cnf .
chmod 755 ./openssl.cnf
dir="./demoCA"
certs=$dir/certs # Where the issued certs are kept
crl_dir=$dir/crl # Where the issued crl are kept
new_certs_dir=$dir/newcerts # default place for new certs.
database=$dir/index.txt # database index file.
@ql-owo-lp
ql-owo-lp / CIS644-Lab8-MiniVPN.c
Last active October 31, 2017 23:07
for CIS 644 Lab 8 VPN
/*
* MiniVPN.c - a simple VPN implemention with PKI
*
* Copyright (C) 2013 Kevin Wang <kevixw@gmail.com>
*
* Based on codes created by:
* Copyright (C) 2003 Philippe Biondi <phil@secdev.org>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
@ql-owo-lp
ql-owo-lp / Crypto-lab6-digt.c
Last active October 12, 2018 12:17
CIS 644 Lab 6 Hash function crack
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/evp.h>
void getHash(char * hashname, char *msg, unsigned char *md_value) {
EVP_MD_CTX *mdctx;
const EVP_MD *md;
//unsigned char md_value[EVP_MAX_MD_SIZE];
int md_len, i;
@ql-owo-lp
ql-owo-lp / Crypto-lab5-cracker.c
Last active December 15, 2015 10:19
for CIS 644 Lab 5
/*
For AES encryption/decryption lab. -> CIS 644 / Sp13 -> Kevin Wang
*/
#include <string.h>
@ql-owo-lp
ql-owo-lp / XmlTranslator.h
Created March 20, 2013 00:48
CIS 687 XmlTranslator for Project 1 & 2
#ifndef XMLENCODER_H
#define XMLENCODER_H
#include <string>
// the translator class of XmlReader / XmlWriter
class XmlEncoder {
// escape markup
static std::string encodeAttr(std::string str) {
@ql-owo-lp
ql-owo-lp / dns_attack_advanced.sh
Last active December 15, 2015 02:39
CIS644 Lab 4 DNS Pharming
#!/bin/sh
# script created for CIS644 Lab 4, Kevin - Mar 18, 2013
# the payload_answer2 is a special raw data file that carefully constructured
# to use this file, you should insert two byte as Transaction ID at position 0 of the file
# then read 11 bytes, insert your random domain name at position 13(2+11)
# then append the fake DNS server IP address in the end of the file
./pacgen2
{- This is case study 1 for CIS 623, by Kevin Wang, Spring 2013 -}
{- here we define the well-formed formula -}
data WFF = VAR String
| NEG WFF
| AND WFF WFF
| OR WFF WFF
| IMPLY WFF WFF
{- here we define the WFF function, which is implemation free -}