Posts List

Automate Manual Static Code Analysis

Automate Manual Static Code Analysis

Antlr: Automate Manual SAST Activity I came across this wonderful which can understand any grammar and can be very helpful for people who do lot of manual source code analysis. This unlike the common grepping allows you to find specifics by programming it in many languages. Just to showcase the power of tool, I will be using antlr in python to find uninitialized varaibles in java code base. So before I get started you need to download the latest copy of antlr jar and install python library.

CTF: Cracking RSA Encryption

CTF: Cracking RSA Encryption

Crypt: Crack Poor RSA Challenge: N = 58900433780152059829684181006276669633073820320761216330291745734792546625247 C = 56191946659070299323432594589209132754159316947267240359739328886944131258862 e = 65537 Reverse encrypted text C to plain text Below is my code to crack RSA with given N, C & e. {works on py2+} from Crypto.PublicKey import RSA import gmpy2 def int2Text(number, size): text = "".join([chr((number >> j) & 0xff) for j in reversed(range(0, size << 3, 8))]) return text.lstrip("\x00") N = 58900433780152059829684181006276669633073820320761216330291745734792546625247 C = 56191946659070299323432594589209132754159316947267240359739328886944131258862 e = 65537L #http://factordb.

CTF: Back in Time

CTF: Back in Time

Crypt: Back in Time Challenge: I always hated history class. I thought history would never come in handy. With challenge there are two files: 1: encrypt.py 2: cipheretext.txt Below is the content of encrypt.py file import random alpha = "abcdefghijklmnopqrstuvwxyz" key = ''.join(random.sample(alpha,len(alpha))) print key assert(len(alpha) == 26) plaintext = open("plaintext.txt").read() ciphertext = "" sub_dict = {} for i in range(len(alpha)): sub_dict[alpha[i]] = key[i] for i in range(len(plaintext)): if plaintext[i] in alpha: ciphertext += sub_dict[plaintext[i]] else: ciphertext += plaintext[i] open("ciphertext.

CLI Security Testing: Stack Smashing

CLI Security Testing: Stack Smashing

Fuzzing Command Line Utilities Following up from one of my previous article, I will be fuzzing CLI params using JAFFY fuzzer and try to smash the stack on a vulnerable program. Jaffy can fuzz binaries that you run on the command line. It takes a simple XML as input to specify the arguments details and you are ready to go. In order to run jaffy you need to install this python3 module:

CLI Security Testing

CLI Security Testing

Command Line Interface Security Testing CLIs (Command Line Interface/Utility) offer a lot of commands to make system information easily available & manageable. Many of these commands offer various arguments (functionalities). These command line utilities and their arguments should be programmed in such a way that they should not be vulnerable or contain any logical flaw that can allow malicious user of CLI to escalate privilege, access unauthorized info, bypass ACL etc.

Nodejs Mutation Based Fuzzer

Nodejs Mutation Based Fuzzer

Mutation Fuzzers (AKA Dumb Fuzzers 😉) Mutation Fuzzers are all about mutating the existing input values (blindly). That’s why it is known as “dumb” fuzzers, as it lacks understanding of the complete format/structure of the data. One example of data mutation can be just replacing/appending a random section of data. Some methods used by mutation fuzzers to generate the data are: Bit flipping Random postfix Random prefix encoding disruption We will be looking at one of the mutation based fuzzer written in NodeJS today.

Mutation Testing to uncover Zero Days

Mutation Testing to uncover Zero Days

Mutation Test The Mutation Test is a technique that was proposed by De-Millo and it consists on creating a set of faulty versions of the test program called mutants. The goal for the tester is then to write a series of tests that can distinguish the original program from all its mutants. This technique not only help in generate very good data set for testing but also help in uncovering dark corners of software.