Skip to content

Instantly share code, notes, and snippets.

@jamieparfet
jamieparfet / router.php
Created Jul 13, 2020
Simple PHP server to redirect to specified location based on requested extension
View router.php
<?php
// php -S 0.0.0.0:8000 router.php
// http://host/x.jsp?u=http://example.com
if (preg_match('/\.(?:jsp)/', $_SERVER["REQUEST_URI"])) {
$location = $_GET['u'];
Header("Location: ".$location);
} else {
echo "error";
}
View flash-analyzer.sh
#!/bin/bash
grep_list="clicktag|\
externalInterface\.addCallback|\
externalInterface\.call|\
flash\.external\.ExternalInterface\.call|\
flashvars|\
FScrollPane\.loadScrollContent|\
geturl\(_root|\
geturlBlankVar|\
View install-oracle-java8.sh
#!/bin/bash
dpkg-query -W -f='${binary:Package}\n' | grep -E -e '^(ia32-)?(sun|oracle)-java' -e '^openjdk-' -e '^icedtea' -e '^(default|gcj)-j(re|dk)' -e '^gcj-(.*)-j(re|dk)' -e '^java-common' | xargs sudo apt-get -y remove
sudo apt-get -y autoremove
# beware - this removes virtualbox config files
dpkg -l | grep ^rc | awk '{print($2)}' | xargs sudo apt-get -y purge
mkdir /opt/jdk
# download 'jdk-8u221-linux-x64.tar.gz'
tar -zxf jdk-8u221-linux-x64.tar.gz -C /opt/jdk
View install-flash-for-firefox.sh
#!/bin/bash
# Set Firefox's plugins dir
firefox_flash_install_dir="/usr/lib/mozilla/plugins"
# Setup Arch
case $(uname -m) in
x86_64) arch=x86_64 ;;
i?86) arch=i386 ;;
esac
View xss
alert(document.location)
View xss.as
package
{
import flash.display.Sprite;
import flash.text.TextField;
import flash.external.ExternalInterface;
public class xss extends Sprite
{
public function xss()
{
@jamieparfet
jamieparfet / macOS-mojave-iso.sh
Last active Nov 24, 2021
Create an ISO from the mojave installer app
View macOS-mojave-iso.sh
#!/bin/bash
# This assumes that the ~6GB mojave installer is in the /Applications folder.
# If it's not, just open the App Store, search Mojave, and you can download the installer file from there.
hdiutil create -o /tmp/mojave.cdr -size 6g -layout SPUD -fs HFS+J
hdiutil attach /tmp/mojave.cdr.dmg -noverify -mountpoint /Volumes/install_mojave
sudo /Applications/Install\ macOS\ mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/install_mojave
mv /tmp/mojave.cdr.dmg ~/Desktop/InstallSystem.dmg
hdiutil detach /Volumes/Install\ macOS\ mojave
View kali-setup.sh
#!/bin/bash
# Disable logging
service rsyslog stop
systemctl disable rsyslog
rm ~/.profile ~/.bashrc
wget -O ~/.profile https://raw.githubusercontent.com/jamieparfet/zone/master/dotfiles/.profile
wget -O ~/.bashrc https://raw.githubusercontent.com/jamieparfet/zone/master/dotfiles/.bashrc
wget -O ~/.tmux.conf https://raw.githubusercontent.com/jamieparfet/zone/master/dotfiles/.tmux.conf
View nessus-merger.py
import xml.etree.ElementTree as etree
import shutil
import os
first = 1
for fileName in os.listdir("."):
if ".nessus" in fileName:
print(":: Parsing", fileName)
if first:
mainTree = etree.parse(fileName)
@jamieparfet
jamieparfet / extract-jars.sh
Created Jun 18, 2018
Extract all jar files within subdirectories into respective folders
View extract-jars.sh
#!/bin/bash
BASE_PATH=/root/source-code/project/subdir
REMOVE_FROM_PATH=/root/source-code/project/
OUTPUT_DIR=/root/testing/temp
for JAR_FILE in $(find "$BASE_PATH" -name "*.jar" -type f); do
# Show found .jar file
echo "File: $JAR_FILE"
# Perform unzip operation