Skip to content

Instantly share code, notes, and snippets.

View ericbaranowski's full-sized avatar

Eric Baranowski ericbaranowski

View GitHub Profile
#!/bin/bash
set -e
set -u
set -x
if [[ -f $HOME/.zshrc ]]; then
mv $HOME/.zshrc $HOME/.zshrc.bak
fi
if [[ -f $HOME/.zhistory ]]; then
//Plots The Majority of Moving Averages
//Defaults to Current Chart Time Frame --- But Can Be Changed to Higher Or Lower Time Frames
//2nd MA Capability with Show Crosses Feature
study(title="CM_Ultimate_MA_MTF", shorttitle="CM_Ultimate_MA_MTF", overlay=true)
//inputs
src = close
useCurrentRes = input(true, title="Use Current Chart Resolution?")
resCustom = input(title="Use Different Timeframe? Uncheck Box Above", type=resolution, defval="D")
len = input(20, title="Moving Average Length - LookBack Period")
atype = input(1,minval=1,maxval=7,title="1=SMA, 2=EMA, 3=WMA, 4=HullMA, 5=VWMA, 6=RMA, 7=TEMA")
@ericbaranowski
ericbaranowski / config.ovpn
Created July 26, 2017 22:18
OpenVPN command line options nicely formatted for building your custom config file
OpenVPN 2.4.3 x86_64-apple-darwin16.6.0 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [MH/RECVDA] [AEAD] built on Jun 21 2017
# Local host name or ip address.
# Implies --bind.
local <hostname>
# Remote host name or ip address.
remote <hostname> [port]
# If multiple --remote options specified, choose one randomly.
@ericbaranowski
ericbaranowski / 00-New setup.md
Last active March 4, 2022 17:06 — forked from cderv/00-New setup.md
New computer setup
# installed by winget
winget install PowerShell-Preview
winget install git
git config --global user.name "Eric Baranowski"
git config --global user.email eric@kulado.com
winget install rstudio
winget install vscode
winget install -e R
winget install Github.GithubDesktop
#!/usr/bin/env python

Run Startup.ps1 as script in Azure

Then run ubuntu.sh on the WSL machine

Windows Terminal

Add Git Bash to Windows Terminal

Generate a new GUID in Powershell [guid]::NewGuid() the use it to add this to the settings, like

Reverse Shell Cheat Sheet

If you’re lucky enough to find a command execution vulnerability during a penetration test, pretty soon afterwards you’ll probably want an interactive shell.

If it’s not possible to add a new account / SSH key / .rhosts file and just log in, your next step is likely to be either trowing back a reverse shell or binding a shell to a TCP port. This page deals with the former.

Your options for creating a reverse shell are limited by the scripting languages installed on the target system – though you could probably upload a binary program too if you’re suitably well prepared.

The examples shown are tailored to Unix-like systems. Some of the examples below should also work on Windows if you use substitute “/bin/sh -i” with “cmd.exe”.

@ericbaranowski
ericbaranowski / restart_clearlinux_services.sh
Created October 1, 2019 15:51
restart_clearlinux_services.sh
#!/bin/sh
sudo systemctl --no-ask-password try-restart containerd.service
sudo systemctl --no-ask-password try-restart systemd-networkd.service
sudo systemctl --no-ask-password try-restart kvp.service
sudo systemctl --no-ask-password try-restart kubelet.service
sudo systemctl --no-ask-password try-restart libvirtd.service
sudo systemctl --no-ask-password try-restart vss.service
sudo systemctl --no-ask-password try-restart systemd-machined.service
sudo systemctl --no-ask-password try-restart waagent.service
@ericbaranowski
ericbaranowski / drop
Last active September 5, 2019 12:53
drop
1.10.16.0/20
1.32.128.0/18
5.8.37.0/24
5.34.242.0/23
5.101.218.0/24
5.101.221.0/24
5.134.128.0/19
5.157.0.0/18
14.4.0.0/14
23.226.48.0/20
@ericbaranowski
ericbaranowski / add_icp_docker_registry.sh
Created July 4, 2019 10:35
Add IBM Cloud Private Docker Registry to Docker-for-Mac or Ubuntu Docker VM
#!/bin/bash
echo "192.168.27.100 master.cfc mycluster.icp" | sudo tee /etc/hosts
if [[ $(uname -s) == 'Linux' ]]; then
# ubuntu
scp -r vagrant@mycluster.icp:/etc/docker/certs.d/mycluster.icp\:8500 /usr/local/share/ca-certificates
sudo cp -r /usr/local/share/ca-certificates/mycluster.icp\:8500 /etc/docker/certs.d
sudo update-ca-certificates
elif [[ $(uname -s) == 'Darwin' ]]; then