This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| param( [ScriptBlock] $scriptBlock ) | |
| <# | |
| .SYNOPSIS | |
| Impersonates a user and executes a script block as that user. This is an interactive script | |
| and a window will open in order to securely capture credentials. | |
| .EXAMPLE | |
| Use-Impersonation.ps1 {Get-ChildItem 'C:\' | Foreach { Write-Host $_.Name }} | |
| This writes the contents of 'C:\' impersonating the user that is entered. | |
| #> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /etc/profile.d/bash_history.sh | |
| # Save 5,000 lines of history in memory | |
| HISTSIZE=10000 | |
| # Save 2,000,000 lines of history to disk (will have to grep ~/.bash_history for full listing) | |
| HISTFILESIZE=2000000 | |
| # Append to history instead of overwrite | |
| shopt -s histappend | |
| # Ignore redundant or space commands | |
| HISTCONTROL=ignoreboth | |
| # Ignore more |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/bash | |
| which ansible >/dev/null 2>&1 | |
| if [ $? -ne 0 ]; | |
| then | |
| echo "Installing Ansible..." | |
| sleep 5 | |
| pushd . | |
| cd ~ | |
| pacman -S libyaml-devel python2 tar libffi libffi-devel gcc pkg-config make openssl-devel openssh libcrypt-devel --noconfirm --needed | |
| curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # THIS PROJECT IS AN EXAMPLE APP. SOME CODE MAY NOT BE ACTUALLY USEFUL | |
| # FOR DEMONSTRATION PURPOSES ONLY | |
| # YOUR MILEAGE MAY VARY | |
| # Requirements are Flask, Flask-WTF, Flask-SQLAlchemy | |
| import os | |
| from flask import (Flask, | |
| Blueprint, | |
| redirect, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Very simple HTTP server in python for logging requests | |
| Usage:: | |
| ./server.py [<port>] | |
| """ | |
| from http.server import BaseHTTPRequestHandler, HTTPServer | |
| import logging | |
| class S(BaseHTTPRequestHandler): |