Skip to content

Instantly share code, notes, and snippets.

View nsuan's full-sized avatar

Nick Suan nsuan

  • Sourcefire
  • Maryland
View GitHub Profile
# coding=utf-8
import datetime
import sys
import time
import threading
import traceback
import SocketServer
from dnslib import *
@nsuan
nsuan / auth-passwd.c.diff
Created January 26, 2012 13:33 — forked from sjmurdoch/gist:1572229
Patch to FreeBSD OpenSSH to log username and password on log-in attempt to invalid user
--- openssh-5.9p1/auth-passwd.c 2009-03-07 19:40:28.000000000 -0500
+++ ../openssh-5.9p1/auth-passwd.c 2012-01-26 03:31:31.837922466 -0500
@@ -201,6 +201,7 @@
if (strcmp(pw_password, "") == 0 && strcmp(password, "") == 0)
return (1);
+
/* Encrypt the candidate password using the proper salt. */
encrypted_password = xcrypt(password,
(pw_password[0] && pw_password[1]) ? pw_password : "xx");
@nsuan
nsuan / async_resolver.rb
Created October 18, 2011 15:00 — forked from iragsdale/async_resolver.rb
Asynchronous DNS resolver based on EventMachine and net-dns
require 'eventmachine'
require 'net/dns'
require 'net/dns/resolver'
module EM # :nodoc:
module Protocols
include Logger::Severity
class AsyncResolver < Net::DNS::Resolver