Skip to content

Instantly share code, notes, and snippets.

View jstrosch's full-sized avatar

Josh Stroschein jstrosch

View GitHub Profile
#!/usr/bin/env bash
PCAPFILE=$1
LOG_LOCATION='/tmp/suricata/'
if [ -z $PCAPFILE ] || [ ! -f $PCAPFILE ]; then
echo "File ${PCAPFILE} doesnt seem to be there - please supply a pcap file."
exit 1;
fi
#!/usr/bin/env bash
# Author: Josh Stroschein
# Date: 22 Nov 2020
# Reference: https://suricata-update.readthedocs.io/en/latest/quickstart.html#directories-and-permissions
if (($EUID != 0)); then
echo -e "[!] Please run this script as root or with \"sudo\"\n"
exit 1
fi
@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
#!/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 / 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;
#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 / 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"
@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 / 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 / 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}"