Skip to content

Instantly share code, notes, and snippets.

@llagerlof
llagerlof / print_r_reverse.php
Last active May 28, 2024 03:19
Convert the output string of print_r to array again.
<?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;
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.
#!/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) {
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.
#!/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 15, 2024 16:37
Windows batch file to convert .java file to .smali
:: 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
#! /usr/bin/env python
## Copyright (C) 2014 Guillaume Valadon <[email protected]>
## 2014 Alexis Sultan <[email protected]>
## 2012 ffranz <[email protected]>
##
## 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
/**
* 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
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).
#!/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'}