For educational reasons I've decided to create my own CA. Here is what I learned.
Lets get some context first.
<?php | |
// ip2asn.php?ip=IP_OR_HOSTNAME : Returns a comma-separated list of matching ASNs | |
// ip2asn.php?asn=AS_NUMBER : Returns the organization name | |
// ip2asn.php?update=1&token=SECRET_TOKEN : Updates the local database (setup cron to run once a day) | |
$SECRET_TOKEN = 'ChangeMe'; | |
$TMP_DIR = '/tmp/ip2asn'; | |
$DATA_DIR = '/var/lib/ip2asn'; |
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# "Whattomine GPU Hash time calculator" | |
# | |
# This is not for CPU or ASIC calculations. | |
# Author: Brady Shea | |
# Email: Use github user: bmatthewshea or gist comments | |
# Origin: https://gist.github.com/bmatthewshea/90b120722e0561dd235adcdc231b6765 | |
# |
#!/usr/bin/python2.7 | |
import sys | |
import socket | |
import threading | |
import json | |
from collections import OrderedDict | |
import binascii | |
import datetime | |
import time |
### KERNEL TUNING ### | |
# Increase size of file handles and inode cache | |
fs.file-max = 2097152 | |
# Do less swapping | |
vm.swappiness = 10 | |
vm.dirty_ratio = 60 | |
vm.dirty_background_ratio = 2 |
`pip install pycrypto` | |
from Crypto.Cipher import DES3 | |
from Crypto import Random | |
key = 'Sixteen byte key' | |
iv = Random.new().read(DES3.block_size) #DES3.block_size==8 | |
cipher_encrypt = DES3.new(key, DES3.MODE_OFB, iv) | |
plaintext = 'sona si latine loqueri ' #padded with spaces so than len(plaintext) is multiple of 8 | |
encrypted_text = cipher_encrypt.encrypt(plaintext) |
#!/usr/bin/python | |
# DNSpionage log parser | |
# This script displays the exfiltrated data in the log.txt file | |
# It only supports the DNS mode. The HTTP mode does not encode the exfiltrated data in the log file | |
# Can be easily adapted to parse passive DNS logs | |
# @r00tbsd | |
import sys | |
import base64 |
sysctl -w fs.file-max=12000500
sysctl -w fs.nr_open=20000500
# Set the maximum number of open file descriptors
ulimit -n 20000000
# Set the memory size for TCP with minimum, default and maximum thresholds
sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
# fizzbuzz.py | |
# Python implementation of FizzBuzz (http://imranontech.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/) | |
# | |
# Author: Amber Jain (http://amberj.devio.us/) | |
# Problem description: | |
# Write a program that prints the numbers from 1 to 100. | |
# But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". | |
# For numbers which are multiples of both three and five print "FizzBuzz". | |
# Problem source: http://imranontech.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/ |
#!/bin/bash | |
# ABOUT: | |
# | |
# Use this set of commands to: | |
# - Change password of root account | |
# - Create a new user account, set it's password and grant sudo privileges | |
# on Ubuntu Linux. | |
# Change password of currently logged in 'root' account: |