Skip to content

Instantly share code, notes, and snippets.

@llagerlof
llagerlof / print_r_reverse.php
Last active July 4, 2022 05:18
Convert the output string of print_r to array again.
View print_r_reverse.php
<?php
// original author: https://www.php.net/manual/en/function.print-r.php#93529
// another dev said it was fixed for null values, but I don't encountered errors with null values for Matt's: https://www.php.net/manual/en/function.print-r.php#121259
// Matt
function print_r_reverse($in) {
$lines = explode("\n", trim($in));
if (trim($lines[0]) != 'Array') {
// bottomed out to something that isn't an array
return $in;
View gist:d74b607ca709f86e0870b8f95e3e1492
cd
mkdir work
cd work
git clone https://github.com/zmap/zmap.git
apt-get install build-essential cmake libgmp3-dev gengetopt libpcap-dev flex byacc libjson-c-dev pkg-config libunistring-dev
cd zmap
cmake .
make -j4
make install
cd
@tomykaira
tomykaira / java2smali.sh
Created September 9, 2017 17:52
Java to smali conversion, one liner.
View java2smali.sh
#!/bin/sh
set -e
JAVA_HOME='/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home'
cd /tmp
cat > input_tmp.java <<EOF
public class input_tmp {
public static void main(String[] args) {
View gist:2b1f031598ca2a067877f69bfcb55b1e
cd
mkdir work
cd work
git clone https://github.com/zmap/zmap.git
apt-get install build-essential cmake libgmp3-dev gengetopt libpcap-dev flex byacc libjson-c-dev pkg-config libunistring-dev
cd zmap
cmake .
make -j4
make install
cd
@PaulSec
PaulSec / cloudscan.py
Created January 4, 2017 14:06 — forked from jgamblin/cloudscan.py
A python script to run Nessus cloud scans by @jgamblin but mostly stolen from @averagesecguy.
View cloudscan.py
#!/usr/bin/env python
# Name: cloudscan.py
# Purpose: Run Nessus Cloud Scans Easily.
# By: Jerry Gamblin
# Date: 11.05.15
# Modified 11.05.15
# Rev Level 0.5
# -----------------------------------------------
import requests
@houtianze
houtianze / java2smali.bat
Last active September 7, 2022 22:13
Windows batch file to convert .java file to .smali
View java2smali.bat
:: http://stackoverflow.com/a/29052019/404271
echo JDK 7 is required
if not x%1==x goto doit
:usage
echo %~n0 ^<Java file without .java extension^>
goto end
:doit
@ffr4nz
ffr4nz / gtp.py
Last active November 28, 2017 07:09
Scapy GTP Layer
View gtp.py
#! /usr/bin/env python
## Copyright (C) 2014 Guillaume Valadon <guillaume.valadon@ssi.gouv.fr>
## 2014 Alexis Sultan <alexis.sultan@sfr.com>
## 2012 ffranz <ffranz@iniqua.com>
##
## This program is published under a GPLv2 license
# scapy.contrib.description = GTP
# scapy.contrib.status = loads
@tott
tott / ip_in_range.php
Created November 27, 2013 22:46
php check if IP is in given network range
View ip_in_range.php
/**
* Check if a given ip is in a network
* @param string $ip IP to check in IPV4 format eg. 127.0.0.1
* @param string $range IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed
* @return boolean true if the ip is in this range / false if not.
*/
function ip_in_range( $ip, $range ) {
if ( strpos( $range, '/' ) == false ) {
$range .= '/32';
}
@KenMacD
KenMacD / kali.sh
Last active December 15, 2020 15:23
Kali Sources
View kali.sh
cat >/etc/apt/sources.list.d/kali.list <<EOF
deb http://http.kali.org/kali kali main contrib non-free
deb-src http://http.kali.org/kali kali main contrib non-free
deb http://security.kali.org/kali-security kali/updates main contrib non-free
deb-src http://security.kali.org/kali-security kali/updates main contrib non-free
EOF
sudo apt-key adv --keyserver pgp.mit.edu --recv-keys ED444FF07D8D0BF6
sudo apt-get update
@geoffreyanderson
geoffreyanderson / syncFilesystemToImage.sh
Created June 2, 2011 18:19 — forked from fairchild/bundle-to-ebs.sh
A script to rsync a running Linux OS to an image file (specifically, a 10GB image file for deployment to AWS EC2).
View syncFilesystemToImage.sh
#!/bin/bash
# Run this script on a running Linux OS that you want to be put into an image file.
# Ensure that the system you run this on is less than 10GB in size if you wish to
# deploy the image file to AWS EC2.
# Note: This is based on Michael Fairchild's instance-to-ebs-ami.sh script.
# -https://gist.github.com/249915
imageFile=${1:-"awsImage-$(date +%m%d%y-%H%M).img"}
imageMountPoint=${2:-'/mnt/image'}
extraFilesArchive=${3:-'awsInstanceFiles.tar.gz'}