Skip to content

Instantly share code, notes, and snippets.

@richzw
richzw / recv.cpp
Created April 20, 2015 11:02
http message parser
while ( gets( line, line_len, BODY_LEN/*sizeof(line)*/ ) != NULL )
{
if ( strncmp( line, "Host:", 5 ) == 0 )
{
strncpy_s(m_strHost, 100, line + 5, sizeof(m_strHost)-1);
}
else if ( strncmp( line, "Connection:", 11 ) == 0 )
{
if(strstr(line, "Keep-Alive"))
@richzw
richzw / amqpConsumer.cpp
Last active August 29, 2015 14:17
amqpConsumer.cpp
void ConsumerThread::Run()
{
enum
{
Term_Evt = 0,
MQTimer_Evt,
RpTimer_Evt,
Queue_Evt,
Evt_cnt,
'use strict';
/**
* dependencies
*/
var amqp = require('amqplib'),
when = require('when');
/**
* Receiver Class, initialized with amqp address
@richzw
richzw / Sender.js
Last active August 29, 2015 14:16
amqp sender
'use strict';
/**
* dependencies
*/
var amqp = require('amqplib'),
when = require('when');
/**
'use strict';
/**
* dependencies
*/
var amqp = require('amqplib'),
when = require('when');
/**
@richzw
richzw / failurerecover.js
Created February 11, 2015 06:23
amqphandlefailure
'use strict';
/**
* dependencies
*/
var amqp = require('amqplib'),
when = require('when');
/**
@richzw
richzw / gist:57177f3fecbeb921819c
Last active August 29, 2015 14:15
amqpreconnection.js
'use strict';
/**
* dependencies
*/
var amqp = require('amqplib'),
when = require('when');
/**
#!/usr/bin/env python2
"""
Author: takeshix <takeshix@adversec.com>
PoC code for CVE-2014-0160. Original PoC by Jared Stafford (jspenguin@jspenguin.org).
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP.
"""
import sys,struct,socket
from argparse import ArgumentParser
// EDIT: 2013/10/20
// google has updated its kwt UI, this script doesn't work any more!
// may be I will update this script when I have time to investigate their new Interface.
// requires
var utils = require('utils');
var casper = require('casper').create()
var casper = require('casper').create({
verbose: true,
# EDIT: 2013/10/20
# google has updated its kwt UI, this script doesn't work any more!
# may be I will update this script when I have time to investigate their new Interface.
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
import selenium.webdriver.support.wait
selenium.webdriver.support.wait.POLL_FREQUENCY = 0.05
import re