Skip to content

Instantly share code, notes, and snippets.

@jessfraz
jessfraz / boxstarter.ps1
Last active April 11, 2024 16:02
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@mattifestation
mattifestation / FileReadPrimitive.ps1
Last active June 12, 2023 16:33
A WMI file content read primitive - ROOT/Microsoft/Windows/Powershellv3/PS_ModuleFile
$CimSession = New-CimSession -ComputerName 10.0.0.2
$FilePath = 'C:\Windows\System32\notepad.exe'
# PS_ModuleFile only implements GetInstance (versus EnumerateInstance) so this trick below will force a "Get" operation versus the default "Enumerate" operation.
$PSModuleFileClass = Get-CimClass -Namespace ROOT/Microsoft/Windows/Powershellv3 -ClassName PS_ModuleFile -CimSession $CimSession
$InMemoryModuleFileInstance = New-CimInstance -CimClass $PSModuleFileClass -Property @{ InstanceID= $FilePath } -ClientOnly
$FileContents = Get-CimInstance -InputObject $InMemoryModuleFileInstance -CimSession $CimSession
$FileLengthBytes = $FileContents.FileData[0..3]
[Array]::Reverse($FileLengthBytes)
@Neo23x0
Neo23x0 / nmap-cmdline
Last active March 19, 2020 17:10
Nmap Scan Params for CVE-2017-0143 MS17-010 Scanning
# Scan for CVE-2017-0143 MS17-010
# The vulnerability used by WannaCry Ransomware
#
# 1. Use @calderpwn's script
# http://seclists.org/nmap-dev/2017/q2/79
#
# 2. Save it to Nmap NSE script directory
# Linux - /usr/share/nmap/scripts/ or /usr/local/share/nmap/scripts/
# OSX - /opt/local/share/nmap/scripts/
#
@rpothier
rpothier / Examples
Last active February 4, 2018 21:25
HOT templates to bring up the ASAv and CRS 1000v
glance image-create --name asav971 --disk-format qcow2 --container-format bare --file ./asav971.qcow2
glance image-create --name csr1000v --disk-format qcow2 --container-format bare --file ./csr1000v-universalk9.16.04.01.qcow2
glance image-update b1b57ece-9d08-4f7a-b78c-91f5aedfd6ef --property hw_disk_bus=ide
glance image-update b1b57ece-9d08-4f7a-b78c-91f5aedfd6ef --property hw_vif_model=e1000
To bring up the ASAv
heat stack-create -f asav.yaml -P private_net=af747d91-5a40-4e0f-8d13-e4ae720ead85 asav
localadmin@gg33-ds2:~$ ssh AdminUser@10.0.0.10
AdminUser@10.0.0.10's password:
@marcan
marcan / linux.sh
Last active December 1, 2023 15:18
Linux kernel initialization, translated to bash
#!/boot/bzImage
# Linux kernel userspace initialization code, translated to bash
# (Minus floppy disk handling, because seriously, it's 2017.)
# Not 100% accurate, but gives you a good idea of how kernel init works
# GPLv2, Copyright 2017 Hector Martin <marcan@marcan.st>
# Based on Linux 4.10-rc2.
# Note: pretend chroot is a builtin and affects the current process
# Note: kernel actually uses major/minor device numbers instead of device name
@mubix
mubix / infosec_newbie.md
Last active April 7, 2024 22:35
How to start in Infosec
@williballenthin
williballenthin / add_segment.py
Last active December 27, 2019 01:59
Add a segment to an IDA .idb from a file.
'''
IDAPython plugin that adds the contents of a file as a new segment in an existing idb.
Prompts the user for:
- file path
- segment name
- segment starting offset
Useful for reversing engineering packed software and shellcode.
Author: Willi Ballenthin <william.ballenthin@fireeye.com>
@alirobe
alirobe / reclaimWindows10.ps1
Last active April 26, 2024 17:59
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###

Share a ZFS file system over SMB/CIFS and advertise it via mDNS so that it shows up in the OS X Finder. Assumes SmartOS, but should work fine on any illumos distribution.

# Allow guest access to a trusted subnet
zfs set sharesmb=ro=192.168.1.0/25,guestok=true,name=store zones/store

# Advertise the SMB service, it will now show up in Finder
dns-sd -R "Loft Server" _smb._tcp local 445 &

# Give it a pretty icon. If you want something different, choose from the list in
@bishboria
bishboria / springer-free-maths-books.md
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links