Skip to content

Instantly share code, notes, and snippets.

View jstrosch's full-sized avatar

Josh Stroschein jstrosch

View GitHub Profile
@jstrosch
jstrosch / gist:3190568
Created July 27, 2012 21:31
iptables - delete all rules/chains
#view current chains
$ iptables -L
#remove/flush all rules & delete chains
$ iptables -F
$ iptables -X
$ iptables -t nat -F
$ iptables -t nat -X
$ iptables -t mangle -F
$ iptables -t mangle -X
@jstrosch
jstrosch / gist:3227681
Created August 1, 2012 15:13
check number of cores
cat /proc/cpuinfo |grep processor
@jstrosch
jstrosch / gist:3228947
Created August 1, 2012 17:19
setting up ssh in cygwin
Follow normal process for installing openSSH/openSSL, generating keys and adding to remote host. In cygwin, add the following to .bash_profile
### this is necessary to start ssh-agent and add keys
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
@jstrosch
jstrosch / KohanaFileMode
Last active January 1, 2016 09:59
Update file permissions on a Kohana website
#!/bin/bash
echo "Type the directory from /var/www, followed by [ENTER]:"
read dir
cd /var/www/$dir
echo "Updating owners..."
@jstrosch
jstrosch / DrupalFileMode.sh
Last active January 1, 2016 09:59
Script to set proper file permissions on a drupal installation.
#!/bin/bash
echo "Type the directory from /var/www, followed by [ENTER]:"
read dir
cd /var/www/$dir
echo "Updating owners..."
@jstrosch
jstrosch / phrack.sh
Created June 14, 2014 03:46
A [very] small script to download all issues of Phrack
#!/bin/bash
#Download all issues of phrack
for i in {1..68}
do
echo "Downloading... http://www.textfiles.com/magazines/PHRACK/PHRACK$i"
wget "http://www.textfiles.com/magazines/PHRACK/PHRACK$i"
#include <stdio.h>
int main(void) {
__asm
{
mov ebx, fs:[0x30]
mov ebx, [ebx + 0xc]
mov ebx, [ebx + 0x14]
mov esi, [ebx + 0x28]
}
@jstrosch
jstrosch / internetopen.c
Created March 13, 2018 15:50
Example using InternetOpen and InternetOpenUrl
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <winsock.h>
#include <wininet.h>
#pragma comment (lib, "wininet.lib")
HANDLE iH;
HANDLE iR;
#!/bin/bash
# For when you need to clear/delete a specific range of analysis
for i in {294..500}
do
curl "http://<YOUR_IP:8000/analysis/remove/$i/"
done
@jstrosch
jstrosch / cuckoo-setup-virtualenv.sh
Last active October 19, 2023 10:56
This script will setup Python virtualenv, I made it specifically for setting up Cuckoo. Please see the notes in the script before running.
#!/usr/bin/env bash
# Author: Josh Stroschein
# Source: https://askubuntu.com/questions/244641/how-to-set-up-and-use-a-virtual-python-environment-in-ubuntu
# NOTES: Run this script as: sudo -u <USERNAME> cuckoo-setup-virtualenv.sh
# Additionally, your environment may not allow the script to source bashrc and you may need to do this manually after the script completes
# install virtualenv
sudo apt-get update && sudo apt-get -y install virtualenv