Skip to content

Instantly share code, notes, and snippets.

View maravedi's full-sized avatar
🏒
Slappin' shots

maravedi

🏒
Slappin' shots
View GitHub Profile
@gfoss
gfoss / PowerShell Command Line Logging
Last active January 10, 2025 19:49
Detect and alert on nefarious PowerShell command line activity
# PowerShell Audit Logging for LogRhythm SIEM - 2015
# For detecting dangerous PowerShell Commands/Functions
Log Source Type:
MS Event Log for Win7/Win8/2008/2012 - PowerShell
Add this file to your PowerShell directory to enable verbose command line audit logging
profile.ps1
$LogCommandHealthEvent = $true
$LogCommandLifeCycleEvent = $true
@maravedi
maravedi / homestead_32bit.md
Last active December 12, 2016 11:54
Setting up Homestead 2.0.7 on Windows 7 32-bit

#Introduction For the most part, you can follow the instructions given by Jeffrey Way at Laracasts - Say Hello to Laravel Homestead 2.

If you are like me and also have a 32-bit installation of Windows with low RAM, the there are a few exceptions.

#Setting up 32-bit Homestead Firstly, the default homestead VM is a 64-bit version of Ubuntu, so you'll need to change that. Thankfully, someone has created a 32-bit version of homestead already. To do this, you will need to go to C:\Users\myusername\AppData\Roaming\Composer\vendor\laravel\homestead\scripts\ and then edit the homestead.rb file.

Following the instructions from here, within the homestead.rb file you will need to change the line

@haukurk
haukurk / syslogger.py
Created December 11, 2014 17:04
Logger that sends to syslog servers.
#!/usr/bin/python
# -*- encoding: iso-8859-1 -*-
"""
Python syslog client.
This code is placed in the public domain by the author.
Written by Christian Stigen Larsen.
This is especially neat for Windows users, who (I think) don't
@ducas
ducas / Create-Administrator.ps1
Last active February 4, 2026 11:52
Create a local administrator account using PowerShell
$Username = "su"
$Password = "password"
$group = "Administrators"
$adsi = [ADSI]"WinNT://$env:COMPUTERNAME"
$existing = $adsi.Children | where {$_.SchemaClassName -eq 'user' -and $_.Name -eq $Username }
if ($existing -eq $null) {
@gosukiwi
gosukiwi / .vimrc
Last active December 4, 2025 22:27
.vimrc
" ---------------------- USABILITY CONFIGURATION ----------------------
" Basic and pretty much needed settings to provide a solid base for
" source code editting
" don't make vim compatible with vi
set nocompatible
" turn on syntax highlighting
syntax on
" and show line numbers
@zyzof
zyzof / UdpSpoofer.py
Created January 3, 2014 12:20
Sending spoofed raw packets with scapy
from scapy.all import *
import time
ip = IP(dst='192.168.1.1', src='192.168.1.1')
udp = UDP(sport=1234,dport=1234)
payload = '\x01\x0f'
packet = ip/udp/payload
while(True):
@kamermans
kamermans / fail2ban-allstatus.sh
Created July 11, 2011 17:06
Show status of all fail2ban jails at once
#!/bin/bash
JAILS=`fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'`
for JAIL in $JAILS
do
fail2ban-client status $JAIL
done