Skip to content

Instantly share code, notes, and snippets.

View ajinabraham's full-sized avatar

Ajin Abraham ajinabraham

View GitHub Profile
@ajinabraham
ajinabraham / digital_ocean_snaphot.py
Last active June 28, 2018 06:22
Periodic Digital Ocean Snapshot is cheaper than Backups
import time
import datetime
import digitalocean
TOKEN = "**"
SERVERS = {**: "**", **: "**"}
def snapshot_backup():
manager = digitalocean.Manager(token=TOKEN)
my_droplets = manager.get_all_droplets()
@ajinabraham
ajinabraham / sign.js
Last active January 11, 2023 15:44
Node.js Digital Signature - Sign
//Create Private Key with OpenSSL
//openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:4096 -pkeyopt rsa_keygen_pubexp:3 -out privateKey.pem
//Generate Public Key to be used at the client side (Mobile)
//openssl pkey -in privateKey.pem -out publicKey.pem -pubout
const crypto = require('crypto')
const fs = require('fs')
const private_key = fs.readFileSync('digital_sign/privateKey.pem', 'utf-8')
//File to be signed
const package = fs.readFileSync('webpackage.zip')
from psutil import process_iter, NoSuchProcess
from signal import SIGTERM, SIGKILL
def kill_proxy_process(port):
"""Kill 'em all"""
for proc in process_iter():
try:
pinfo = proc.as_dict()
except NoSuchProcess:
@ajinabraham
ajinabraham / trust-manager.js
Created September 30, 2017 13:15 — forked from oleavr/trust-manager.js
How to implement an X509TrustManager using Frida
'use strict';
var TrustManager;
var manager;
Java.perform(function () {
var X509TrustManager = Java.use('javax.net.ssl.X509TrustManager');
TrustManager = Java.registerClass({
name: 'com.example.TrustManager',
@ajinabraham
ajinabraham / infosec_newbie.md
Created August 10, 2017 10:37 — forked from mubix/infosec_newbie.md
How to start in Infosec
@ajinabraham
ajinabraham / SSL_or_TLS_Attacks.txt
Last active June 15, 2020 12:19
Various SSL/TLS Security Issues
BEAST - Browser Exploit Against SSL/TLS
(Sep 2011)
This vulnerability has the potential to decrypt the encrypted traffic by determining the IV of cipher block chaining (CBC)
CRIME - Compression Ratio Info-leak Made Easy
(Sep 2012)
A compression side-channel attack against HTTPS allows attacker to Inject partial chosen plaintext into a victim's request.
Lucky 13
(Feb 2013)
@ajinabraham
ajinabraham / Good CipherSuites Ordering.txt
Created July 24, 2015 12:38
Good CipherSuites Ordering
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
import SimpleHTTPServer
class CORSHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def send_head(self):
"""Common code for GET and HEAD commands.
This sends the response code and MIME headers.
Return value is either a file object (which has to be copied
to the outputfile by the caller unless the command was HEAD,
and must be closed by the caller under all circumstances), or
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.Signature;
public class TamperCheck {
//we store the hash of the signture for a little more protection
private static final String APP_SIGNATURE = "1038C0E34658923C4192E61B16846";
@ajinabraham
ajinabraham / Linux
Created April 19, 2015 15:20
Linux Tips
sudo apt-get install screen
Start a new session:
screen -S <screen_name>
Run your process as you run it in the screen session. If you want to back to your main terminal press key shortcut ctrl+a+d. And also view the screen by typing,
screen -r <screen_name>