Skip to content

Instantly share code, notes, and snippets.

View w0ltage's full-sized avatar
:shipit:
hacking myself

Artyom Bulgakov w0ltage

:shipit:
hacking myself
View GitHub Profile
@w0ltage
w0ltage / install-dotfiles.sh
Created August 18, 2023 07:47
Install dotfiles from git bare repository
#!/bin/bash
# inspired by https://www.atlassian.com/git/tutorials/dotfiles
[ $# -eq 0 ] && { echo "Usage: $0 <remote-repo-url>"; exit 1; }
REMOTE_REPO=$1
BARE_REPO_PATH=$HOME/.dotfiles
git clone --bare $REMOTE_REPO $BARE_REPO_PATH
@w0ltage
w0ltage / init-bare-git.sh
Last active August 18, 2023 07:33
Init git bare repository
#!/bin/bash
# Inspired by https://www.atlassian.com/git/tutorials/dotfiles
[ $# -eq 0 ] && { echo "Usage: $0 <shell-config-file>"; exit 1; }
SHELL_CONFIG=$1
BARE_REPO_PATH=$HOME/.dotfiles
git init --bare $BARE_REPO_PATH
echo "alias config='/usr/bin/git --git-dir=$BARE_REPO_PATH --work-tree=$HOME'" >> $HOME/$SHELL_CONFIG
@w0ltage
w0ltage / linkhandler.sh
Created July 13, 2023 19:53
linkhandler for RSS feed
#!/bin/sh
# Inspired by https://youtu.be/VfKpftzaSJ4
# required dependencies:
# yt-dlp - https://github.com/yt-dlp/yt-dlp
# qutebrowser - https://qutebrowser.org
# rdrview - https://github.com/eafer/rdrview
# zathura, mpv, xclip, sxiv
# Feed script a url or file location.
# If an image, it will view in sxiv,
@w0ltage
w0ltage / secplan.py
Created October 28, 2022 07:06
Create a security plan (threat model) in markdown format by answering a questions
import sys
questions = [
"What do I want to protect? (asset)",
"Who do I want to protect it from? (threat)",
"How likely is that I will need to protect it? (adversary)",
"How bad are the consequences if I fail? (impact)",
"How much trouble are I willing to go through to prevent these consequences? (patience)"
]
@w0ltage
w0ltage / checkWare.ps1
Created October 7, 2022 02:15
PowerShell - Check if the application is installed. If it is installed, write the name, vendor (publisher), version, and path to the file.
$software = Read-Host -Prompt 'Enter an application name: ';
$uninstallInfo = gp HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*
$applicationName = $uninstallInfo.DisplayName -Match $software
If ($applicationName) {
$anchor = [regex]::Match($uninstallInfo.PSPath -Match $software,'.*\\(.*)').captures.groups[1].value
$applicationInfo = gp HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$anchor
$vendor = $applicationInfo.Publisher
$version = $applicationInfo.DisplayVersion
@w0ltage
w0ltage / createRandomUsers.ps1
Created October 5, 2022 09:06
Powershell - Create N random users
# Creates 20 random users with password "username_first_letter-Ww12345"
# For user "G7sk9Ilo" password will be "G-Ww12345"
for ($user_num = 1; $user_num -le 20; $user_num++){
$ruser = -join ((48..57) +(65..90) + (97..122) | Get-Random -Count 8 | % {[char]$_})
$rpassword = ConvertTo-SecureString "$($ruser.Substring(0,1))-Ww12345" -AsPlainText -Force
$null = New-LocalUser $ruser -Password $rpassword -FullName $ruser -Description "password almost same as name"
Write-Host "`r`nUSERNAME: $($ruser) `r`nNUMBER: $($user_num)"
}
@w0ltage
w0ltage / dusph.sh
Last active October 7, 2022 02:15
Shell & Python - Dumping Domain Controller Usernames, SID and Password Hashes with Impacket
#!/bin/bash
IMPACKET_PATH=$HOME/Github/impacket
DOMAIN="domain.local"
USERNAME="Administrator"
PASSWORD="AwesomeAdmin16"
IP="10.0.3.100"
OUTPUT_FILENAME="creds"
# Change the hardcoded values in variables before using!