Skip to content

Instantly share code, notes, and snippets.

View rdapaz's full-sized avatar

ricdeez rdapaz

View GitHub Profile
@rdapaz
rdapaz / Hashmania.py
Created February 11, 2021 00:30
Clever data munging with hashes
abbrevs = [
'STP',
'TCP',
'TI',
'USB',
'UTP',
'VLAN',
'VLANs',
'VM',
'VMs',
@rdapaz
rdapaz / visioUpdater.py
Created January 14, 2021 23:53
Visio Updater
import os
import win32com.client
import re
import pprint
def pretty_print(o):
pp = pprint.PrettyPrinter(indent=4)
pp.pprint(o)
@rdapaz
rdapaz / ASA_tunnel.md
Created December 18, 2020 06:21
Configure Tunnel on ASA Firewall

Configure Tunnel on ASA

Phase 1 Configuration

Configure IKE V1

ASA1(config)# crypto ikev1 policy 10 
ASA1(config-ikev1-policy)# authentication pre-share 
@rdapaz
rdapaz / portscanner.ps1
Created December 17, 2020 07:12
Use Powershell as a port scanner
$range_of_ports = 1500 .. 1505
$ip = "10.230.149.232"
$range_of_ports | % { echo ((new-object Net.sockets.TCPClient).Connect($ip,$_)) (" Port $_ is open!") } 2>$null
https://www.sans.org/blog/pen-test-poster-white-board-powershell-built-in-port-scanner/
@rdapaz
rdapaz / hypriot.md
Last active December 14, 2020 23:34
Change Hostname and IP Address on Hypriot

Change hostname on hypriot

Option 1: Do it after the SD card has been imaged and loaded on first boot

Change hostname by editing each of these files:

/etc/hosts
/etc/hostname
/etc/cloud/cloud.cfg 
@rdapaz
rdapaz / getObjectsFromSecurityRules.py
Created November 18, 2020 09:07
Get Object Names from set commands in Palo Alto Firewall
import os
import re
import sqlite3
from pathlib import Path
def process(ary):
conn = sqlite3.connect(db_path)
cur = conn.cursor()
sql = """CREATE TABLE IF NOT EXISTS objects_in_rules (
id integer primary key,
@rdapaz
rdapaz / IguessIhavetoNameThis.sh
Created October 21, 2020 12:17
Download youtube video as mp3
# Note to future self...
# Preparatory Steps
# -----------------
# pip3 install youtube-dl
# sudo apt-get install ffmpeg
url=https://www.youtube.com/watch?v=b9fUdJdlExU
youtube-dl -F $url
# This gives list of available formats
youtube-dl -f 140 $url
# Say if file was downloaded as input.m4a
@rdapaz
rdapaz / til.md
Last active October 7, 2020 13:34
TIL

Using Hashcat

echo -n "Password" | md5sum | tr -d " -" >> target_hashes.txt

echo -n "HELLO" | md5sum | tr -d " -" >> target_hashes.txt

echo -n "MYSECRET" | md5sum | tr -d " -" >> target_hashes.txt

echo -n "Test1234"| md5sum | tr -d " -" >> target_hashes.txt

@rdapaz
rdapaz / SubnetIPLister.py
Created October 7, 2020 04:14
List All IPs on a Subnet
import ipaddress
nw = ipaddress.IPv4Network('192.168.10.0/28')
for ip in nw:
print(ip)
@rdapaz
rdapaz / VsdTools.py
Created September 24, 2020 06:46
Rename Visio Objects
import win32com.client as c
vsApp = c.gencache.EnsureDispatch('Visio.Application')
vsApp.Visible = True
path = r'https://woodsideenergy-my.sharepoint.com/personal/ricardo_dapaz_woodside_com_au/Documents/Desktop/Compass Documents/XA0000DJ0020.0009 (RDP).vsd'
dwg = vsApp.Documents.Open(path)
pge = dwg.Pages('CPMS CER, FAR 1&2')
nodes = {
'DESC.1': 'CERDAS1',
'DESC.2': 'CEREWS1',