Skip to content

Instantly share code, notes, and snippets.

@M507
M507 / gist:5247f27556e80bb2cc5e5c181e44e6a9
Last active February 3, 2021 05:33
Install packer on Mac
# Install Homebrew on Mac
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install packer
brew install packer
# Set packer's env variables
echo "
export PACKER_PLUGIN_PATH="~/.packer.d/plugins"
export PACKER_CONFIG_DIR="~/.packer.d"
" >> ~/.zshrc
# /bin/bash
echo "deb http://httpredir.debian.org/debian stretch-backports main" | sudo tee -a /etc/apt/sources.list.d/stretch-backports.list
apt-get update
cd /tmp
wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add -
echo 'deb https://debian.neo4j.com stable 4.0' > /etc/apt/sources.list.d/neo4j.list
apt update -y
apt install apt-transport-https -y
apt install neo4j -y
cd /usr/bin
@M507
M507 / pfsense-slack-notifications.sh
Created November 4, 2020 19:43
pfsense service checker - Slack
#!/bin/sh
for value in arpwatch dhcpd dpinger ntpd openvpn syslogd unbound
do
pfSsh.php playback svc status $value | grep stopped
if [ $? -eq 0 ]
then
out="Important alert from "`hostname`": service $value is down!"
echo $out
curl -X POST -H 'Content-type: application/json' [Webhook URL] --data "{\"text\": \"${out}\"}"
fi
@M507
M507 / windows-slack-notifications.ps1
Created November 4, 2020 21:00
Windows auth notifier - Slack
$out = 'Info: '+ (whoami) + ' logged into ' + (hostname)
$body = @(
@{
text = $out
}
)
$JSON = $body | ConvertTo-Json
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-RestMethod -Uri "[Webhook URL]" -Method Post -Body $JSON -ContentType "application/json"
@ECHO OFF
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -nologo -noProfile -NonInteractive -ExecutionPolicy bypass -File \\domain.com\sysvol\domain.com\Policies\{000000000000000000}\USER\Scripts\Logon\slack-auth.ps1
@M507
M507 / Upgrade-wget-Centos-7.sh
Last active August 12, 2024 12:22
Upgrade wget to 1.20.3 on Centos
yum groupinstall "Development Tools" -y
yum install gcc glibc glibc-common gd gd-devel openssl -y
yum install glibc-devel glibc-headers kernel-headers kernel-devel gnutls-devel -y
cd /opt
wget https://ftp.gnu.org/gnu/wget/wget-1.20.3.tar.gz
./configure
make
cd src/
cp wget /usr/bin/wget
cd ~/
using BITS = BITSReference1_5;
namespace ConsoleApp2
{
class Program
{
class BISTJobObject
{
static BITS.BackgroundCopyManager1_5 BITSManager;
static BITS.GUID JobGUID;
@M507
M507 / BigBountyReconQueries.md
Created February 14, 2021 18:55
All BigBountyRecon repo queries without GUI

BigBountyReconQueries

All BigBountyRecon queries without GUI:

$ cat queries.txt
https://www.google.com/search?q=site:REPLACEME intitle:index.of
https://www.google.com/search?q=site:REPLACEME ext:xml | ext:conf | ext:cnf | ext:reg | ext:inf | ext:rdp | ext:cfg | ext:txt | ext:ora | ext:ini
https://www.google.com/search?q=site:REPLACEME ext:sql | ext:dbf | ext:mdb
https://www.google.com/search?q=site:REPLACEME inurl:wp- | inurl:wp-content | inurl:plugins | inurl:uploads | inurl:themes | inurl:download
@M507
M507 / gist:f2e125dcb812bb15f7dafb40d76ae1f3
Created March 18, 2021 16:02
clear all security onion logs
function cleansoslogs() {
ssh root@$1 -t "so-nsm-clear -y; sleep 1; so-elastic-clear -y; sleep 1; so-sensor-clean"
}
@M507
M507 / git_backup.sh
Last active March 19, 2021 16:34
Backup public repositories
#!/bin/bash
your_gitlab_profile=gitlab-example.com:username
github_link=$1
folder_name=$(echo $github_link | awk -F'/' '{print $NF}' | rev | cut -c5- | rev)
git clone $github_link $folder_name
cd $folder_name
rm -rf .git/
git init
git add *
git commit -m "Backup script"