Skip to content

Instantly share code, notes, and snippets.

View valorcz's full-sized avatar
🕵️‍♂️
In God we trust, all others need to bring data.

Vašek Lorenc valorcz

🕵️‍♂️
In God we trust, all others need to bring data.
View GitHub Profile
@gasman
gasman / pnginator.rb
Created April 30, 2012 18:08
pnginator: pack Javascript into a self-extracting PNG
#!/usr/bin/env ruby -w
# pnginator.rb: pack a .js file into a PNG image with an HTML payload;
# when saved with an .html extension and opened in a browser, the HTML extracts and executes
# the javascript.
# Usage: ruby pnginator.rb input.js output.png.html
# By Gasman <http://matt.west.co.tt/>
# from an original idea by Daeken: http://daeken.com/superpacking-js-demos
@endeav0r
endeav0r / analyze.py
Created March 15, 2013 21:39
This is a quick, static taint-analysis script targetting PHP as seen on: http://rainbowsandpwnies.com/~endeavor/blog/finding-sqli-through-taint-analysis.html . It may be a bit hackish.
from phply.phpparse import parser
import phply.phplex as phplex
from phply.phpast import *
import sys
import copy
import os.path
import pickle
import subprocess
import traceback
@dav3860
dav3860 / gist:5345656
Last active April 27, 2020 11:38
Cisco ASA/PIX config for logstash.
/etc/logstash/logstash.conf :
# We handle the syslog part of the Cisco PIX/ASA messages
grok {
tags => "cisco-fw"
patterns_dir => "/etc/logstash/patterns"
pattern => "^<%{POSINT:syslog_pri}>(?:(%{TIMESTAMP_ISO8601:timestamp8601} |%{CISCOTIMESTAMP:timestamp} ))?%{SYSLOGHOST:logsource}?[ :]+%{GREEDYDATA:syslog_message}"
}
syslog_pri {
tags => "cisco-fw"
@NathanSweet
NathanSweet / svn-to-git
Last active June 6, 2018 10:38
Migrates multiple SVN repos to Git, without anything fancy (no Ruby, no dependencies, no issues with Cygwin paths). Works with GitHub or any Git repo.
Migrates multiple SVN repos to Git, without anything fancy (no Ruby, no dependencies, no issues
with Cygwin paths). SVN tags are created as Git tags and properly pushed to the Git repo. To run:
1) Edit run-authors.sh to have your SVN repos. Run it to get an authors.txt file.
2) Edit the authors.txt to have the names and emails if you like. You must use GitHub user email
addresses if you want contributions to be associated with GitHub accounts.
3) Edit run-convert.sh to have your SVN repos and project name (for local temp directories). Run it.
@dmglab
dmglab / git_bible.md
Last active March 9, 2024 02:59
how to git

Note: this is a summary of different git workflows putting together to a small git bible. references are in between the text


How to Branch

try to keep your hacking out of the master and create feature branches. the [feature-branch workflow][4] is a good median between noobs (i have no idea how to branch) and git veterans (let's do some rocket sience with git branches!). everybody get the idea!

Basic usage examples

import requests, json, logging, sys
class PassiveTotal:
def __init__(self, apikey):
self.__apikey = apikey
self.__classifications = [ 'targeted', 'crime', 'benign', 'multiple' ]
self.__actions = [ 'add', 'remove' ]
@crisroura
crisroura / splunk_xml_evtx
Created June 12, 2014 11:11
How to index Windows EventLogs with Splunk
1. Parse evtx logs with evtxdump.py (https://github.com/williballenthin/python-evtx)
2. Create custom Splunk sourcetype "winevtx":
Edit $SPLUNK_HOME/etc/system/local/props.conf
[winevtx]
NO_BINARY_CHECK = 1
SHOULD_LINEMERGE = true
BREAK_ONLY_BEFORE = ^\<Event xmlns=
input {
file {
path => "/var/log/nginx/access.log"
type => "nginx-access"
sincedb_path => "/var/log/.nginxaccesssincedb"
}
}
input {
file {
path => "/var/log/nginx/error.log"
@rjurney
rjurney / java_install.sh
Created July 15, 2014 23:54
How to automagically install Oracle JDK 1.8 on CentOS
# Install Java 1.8 in CentOS/RHEL 6.X
sudo yum remove -y java-1.6.0-openjdk
wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/8-b132/jdk-8-linux-x64.rpm" \
-O jdk-8-linux-x64.rpm
sudo rpm -Uvh jdk-8-linux-x64.rpm
sudo alternatives --install /usr/bin/java java /usr/java/jdk1.8.0/jre/bin/java 20000
sudo alternatives --install /usr/bin/jar jar /usr/java/jdk1.8.0/bin/jar 20000
@yusufhm
yusufhm / logstash-ossec-alerts.conf
Last active May 22, 2017 16:54
Logstash configuration for reading OSSEC alerts files and send to Elasticsearch (credits to https://mig5.net)
input {
file {
type => "ossec"
path => "/var/ossec/logs/alerts/alerts.log"
sincedb_path => "/opt/logstash/"
codec => multiline {
pattern => "^\*\*"
negate => true
what => "previous"
}