This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def port_ping(host, port): | |
| ret = False | |
| sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
| try: | |
| sock.connect((socket.gethostbyname(host), int(port))) | |
| sock.close() | |
| ret = True | |
| except socket.error: | |
| ret = False | |
| return ret |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def disable_ssl_cert_validation(func): | |
| def inner(*args, **kwargs): | |
| default_context = None | |
| ret = None | |
| try: | |
| default_context = ssl._create_default_https_context | |
| ssl._create_default_https_context = ssl._create_unverified_context | |
| ret = func(*args, **kwargs) | |
| finally: | |
| ssl._create_default_https_context = default_context |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export { | |
| redef Log::default_writer = Log::WRITER_TCPLOG; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <string> | |
| #include <sstream> | |
| #include <vector> | |
| std::vector<std::string> split_tokens(const std::string &s, char delim) { | |
| std::stringstream ss(s); | |
| std::string item; | |
| std::vector<std::string> tokens; | |
| while (getline(ss, item, delim)) { | |
| if(item.length() > 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Header: | |
| // template <class T> std::string to_hex(T t, std::string prefix = "", bool pad = true, int8 custom_len = -1); | |
| #include <sstream> | |
| #include <string> | |
| #include <limits> | |
| template <class T> std::string to_hex(T t, std::string prefix, bool pad, int8 custom_len) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export { | |
| global g_rolling_conn_counter: int = 0; | |
| global probeid: int = 12345; | |
| } | |
| event new_connection(c: connection) &priority=20 | |
| { | |
| local uid_1 = fmt("%08x", to_int(strftime("%s", c$start_time))); | |
| local uid_2 = fmt("%08x", g_rolling_conn_counter); | |
| local uid_3 = fmt("%08x", probeid); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import sys | |
| import os | |
| from optparse import OptionParser | |
| class cli_handlers(object): | |
| def __init__(self, argv): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80 default_server; | |
| listen 443 ssl; | |
| server_name 127.0.0.1; #_; | |
| gzip on; | |
| gzip_comp_level 2; | |
| gzip_http_version 1.0; | |
| gzip_proxied any; | |
| gzip_min_length 1100; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| calc(){ awk "BEGIN{ print $* }" ;} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # | |
| # Aaron Eppert (aeppert@gamil.com) | |
| # | |
| # Wrapper script for starting the cifv2 Docker image via boot2docker | |
| # | |
| # NOTE: This assumes "boot2docker start" was run previously. | |
| # | |
| VBoxManage controlvm "boot2docker-vm" natpf1 "cifv2_forward_5000,tcp,,5000,,5000" | |
| VBoxManage controlvm "boot2docker-vm" natpf1 "cifv2_forward_443,tcp,,8443,,443" |