Skip to content

Instantly share code, notes, and snippets.

View golightlyb's full-sized avatar

Ben Sarah Golightly golightlyb

View GitHub Profile

Recon and Attack Vectors from My Logs

This document contains excerpts from my web server logs collected over a period of 7 years that shows various kinds of recon and attack vectors.

There were a total of 37.2 million lines of logs out of which 1.1 million unique HTTP requests (Method + URI) were found.

$ sed 's/^.* - - \[.*\] "\(.*\) HTTP\/.*" .*/\1/' access.log > requests.txt
# reuse freely
from datetime import datetime, timezone, timedelta
# usage: naturaltime.to_text(some_datetime)
def past(dt, dif):
if dif.days > 2:
@bruth
bruth / README.md
Last active April 12, 2024 05:02
SQLite update hook example in Go

SQLite Update Hook Example

This is an example usage of registering an update_hook to a SQLite connection. The motivation for exploring this feature is to test out various implementations of data monitoring interfaces.

A few notable properties of the implementation:

  • The hook must be registered on the connection being used which requires clients to manually integrate this code.
  • Each INSERT and UPDATE operation requires a subsequent SELECT to get the row data.
  • When registering the hook, increasing the bufsize under heavy workloads will improve throughput, but the SQLite library is single-threaded by design.
@nickcarenza
nickcarenza / lazy_evaluation.go
Created February 20, 2015 18:35
Golang Lazy Evaluation
package main
import (
"time"
)
type LazyInt chan func() int
// Can't use pointer receiver: invalid operation: l <- (func literal) (send to non-chan type *LazyInt)
func (l LazyInt) Future(i int) {
@golightlyb
golightlyb / DebugMessageCallbackARB.c
Created May 19, 2014 05:20
DebugMessageCallbackARB arguments are garbled by some drivers. This is a limited safer version that will try to safely print /something/ useful
// DebugMessageCallbackARB arguments are garbled by some drivers. This is a limited safer version that will try to safely print /something/ useful
void FormatDebugOutputARB
(
int d0, // accepts buggy parameters in any order
int d1,
int d2,
int d3
)
{
@martinsik
martinsik / index.html
Created September 6, 2012 10:03
Simple WebSocket server based on libwebsockets. For full description read http://martinsikora.com/libwebsockets-simple-websocket-server
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
window.WebSocket = window.WebSocket || window.MozWebSocket;
var websocket = new WebSocket('ws://127.0.0.1:9000',
@liovch
liovch / gist:3168961
Created July 24, 2012 09:01
GIMP color balance filter shader
NSString *const kColorShiftFragmentShaderString = SHADER_STRING
(
varying highp vec2 textureCoordinate;
uniform sampler2D inputImageTexture;
uniform lowp float redShift;
uniform lowp float greenShift;
uniform lowp float blueShift;
@ymotongpoo
ymotongpoo / requests-oauth2.py
Created February 25, 2012 07:53
Google API OAuth 2.0 Authorization Sample in Python
# -*- coding: utf-8 -*-
"""
This scripts reqire a third party module 'requests'.
You can get it from PyPI, i.e. you can install it using
easy_install or pip.
http://docs.python-requests.org/en/v0.10.4/
Original source code is written by shin1ogawa, which is in Java.
@ghedo
ghedo / sound_playback.c
Last active May 26, 2024 13:44
Simple sound playback using ALSA API and libasound
/*
* Simple sound playback using ALSA API and libasound.
*
* Compile:
* $ cc -o play sound_playback.c -lasound
*
* Usage:
* $ ./play <sample_rate> <channels> <seconds> < <file>
*
* Examples: