Skip to content

Instantly share code, notes, and snippets.

View kost's full-sized avatar
💭
I'm upto something

kost kost

💭
I'm upto something
  • Diverto
  • Zagreb, Croatia
  • X @k0st
View GitHub Profile
@gfoss
gfoss / command injector
Created September 10, 2014 07:01
script to assist in exploiting command injection vulns / interacting with simple webshells
#!/bin/bash
#
# Command Injector v0.1
# greg.foss[at]owasp.org
# modified version of dirtshell by 'superkojiman' to exploit command injection vulnerabilities / access web shells via cli
# dirtshell.sh => http://blog.techorganic.com/2012/06/lets-kick-shell-ish-part-1-directory.html
function usage {
echo "usage: -u URL"
echo "eg : -u \"http://site.com/index.php?cmd=\""
@morhekil
morhekil / nginx.conf
Created August 14, 2014 12:18
Full request/response body logging in nginx
http {
log_format bodylog '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" $request_time '
'<"$request_body" >"$resp_body"';
lua_need_request_body on;
set $resp_body "";
body_filter_by_lua '
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@kwk
kwk / Makefile
Last active March 14, 2025 08:43
Compiling with Address Sanitizer (ASAN) with CLANG and with GCC-4.8
.PHONY: using-gcc using-gcc-static using-clang
using-gcc:
g++-4.8 -o main-gcc -lasan -O -g -fsanitize=address -fno-omit-frame-pointer main.cpp && \
ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer) ./main-gcc
using-gcc-static:
g++-4.8 -o main-gcc-static -static-libstdc++ -static-libasan -O -g -fsanitize=address -fno-omit-frame-pointer main.cpp && \
ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer) ./main-gcc-static
@michaljemala
michaljemala / tls-client.go
Last active May 23, 2025 01:11
SSL Client Authentication Golang sample
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)
@richo
richo / hopper.zsh
Created May 18, 2014 21:01
Open files in hopper from a shell
function ,hopper() {
local path
case "$1" in
/*)
path="$1" ;;
*)
path="$(pwd)/$1" ;;
esac
/usr/bin/osascript <<EOM
tell application "Hopper Disassembler v3"
@maus-
maus- / gist:10010791
Created April 6, 2014 19:58
auditd template
## Remove any existing rules
-D
## Buffer Size
## Feel free to increase this if the machine panic's
-b 8192
## Failure Mode
## Possible values are 0 (silent), 1 (printk, print a failure message),
## and 2 (panic, halt the system).
@richardjortega
richardjortega / psysh.md
Created March 18, 2014 16:33
PsySH Install

Install:

$ brew update && brew install composer
$ composer global require psy/psysh
# If asked what version constraint to use just type `*`

Update Your PATH for global CLI use:

@todc
todc / mac-setup.md
Last active May 15, 2025 08:52
Fresh Mac OS Setup

1. Run Software Update

Make sure everything is up to date.

Software Update

2. Install Xcode and its "Command Line Tools"

  1. Go to App Store and install Xcode.
  2. Open and accept the terms
@ajithbh
ajithbh / log_redirect.cpp
Last active July 2, 2018 03:45
Qt - Redirect qDebug output to file
#include <fstream>
using namespace std;
ofstream logfile;
void LogToFile(QtMsgType type, const char *msg) {
QString datetime = QDateTime::currentDateTime().toString("yyyy.MM.dd hh:mm:ss");
switch (type) {
case QtDebugMsg:
logfile << datetime.toString().toAscii().data() << " [Debug] " << msg << "\n";