Skip to content

Instantly share code, notes, and snippets.

View vijayanandrp's full-sized avatar
👑

Vijay Anand Pandian vijayanandrp

👑
View GitHub Profile
@vijayanandrp
vijayanandrp / Metasploit Framework.sh
Created June 14, 2017 21:13
Learn the basics of Metasploit Framework in 5 minutes !!
#before opening - update the framework
msfupdate
[*]
[*] Attempting to update the Metasploit Framework...
[*]
[*] Checking for updates via the APT repository
[*] Note: expect weekly(ish) updates using this method
@vijayanandrp
vijayanandrp / daimond.py
Created June 14, 2017 21:23
diamond format '*' program in python
print(" Diamond Format \n")
val = eval(input('Enter the value '))
k=val//2
j=0
for i in range(1,val,2):
print(' '*k,end='')
print('*'*i)print(" Diamond Format \n")
val = eval(input('Enter the value '))
k=val//2
j=0
@vijayanandrp
vijayanandrp / Baby Step Giant Step DLP problem .py
Created June 14, 2017 21:28
10 line python code to solve DLP (Discrete Logarithmic Problem) using Baby Step Giant Step Algorithm
# Baby Step Giant Step DLP problem y = a**x mod n
# Example 70 = 2**x mod 131
# Use SAGE for complex operations
y = 70
a = 2
n = 131
@vijayanandrp
vijayanandrp / TRAIL and DIVISION METHOD with PRIME SIEVE .py
Created June 14, 2017 21:33
Simple python code to solve Factorization Problems -TRAIL and DIVISION METHOD with PRIME SIEVE
""" TRAIL and DIVISION METHOD with PRIME_SIEVE """
def primes_sieve(limit):
a = [True] * limit # Initialize the primality list
a[0] = a[1] = False
for (i, isprime) in enumerate(a):
if isprime:
yield i
for n in xrange(i*i, limit, i): # Mark factors non-prime
a[n] = False
@vijayanandrp
vijayanandrp / Fermat Theorem .py
Created June 14, 2017 21:34
Simple python code to solve Factorization Problems - Fermat Theorem
import math
def gcd(a, b):
while a != b:
if a > b:
a = a - b
else:
b = b - a
return a
@vijayanandrp
vijayanandrp / Berlekamp-Massey Algorithm.py
Created June 14, 2017 21:41
Berlekamp–Massey algorithm implemented in Python. (Easy)
# Berlekamp-Massey Algorithm
#from __future__ import print_function
s = [GF(2)(0), 0, 1, 0, 0, 0, 0, 0, 1, 1, 0] #input sequence
n = len(s)
C = [GF(2)(1)]
B = [GF(2)(1)]
@vijayanandrp
vijayanandrp / Nullcon HackIM 2014 - Programming 100 Writeup.py
Created June 14, 2017 21:45
Nullcon HackIM 2014 - Programming 100 Writeup
'''
Well I am a beginner.
netcat 23.23.190.204 2002
Welcome
Enter 20 spam words to authenticate yourself.
01/20: spam
02/20: maps
03/20: hot
@vijayanandrp
vijayanandrp / Sleep Sorting Algorithm using Bash.sh
Created June 14, 2017 21:55
Easy way to implement interesting Sleep Sorting Algorithm using Bash
#!/bin/bash
function f() {
sleep "$1"
echo "$1"
}
while [ -n "$1" ]
do
f "$1" & shift
@vijayanandrp
vijayanandrp / Sleep Sorting Algorithm using Python.py
Created June 14, 2017 21:57
Just 10 lines of code to implement interesting Sleep Sorting Algorithm using Python
#!/usr/bin/env python
from time import sleep
from threading import Timer
def sleep_sort(values):
sleep_sort.result = []
def add1(x):
print 'Appending value in list -> %d' % x
sleep_sort.result.append(x)
@vijayanandrp
vijayanandrp / Passing messages between "iframe" to Parent frame in JavaScript.js
Created June 14, 2017 22:04
Passing messages between "iframe" to Parent frame in JavaScript
// PARENT - JavaScript (Parent.html)
window.addEventListener('message', function (event) {
console.log("Hello from -> " + event.data);
// Ignores messages from untrusted domains.
//if (event.origin != 'URL of Iframe') return;
});
// IFRAME - JavaScript (child.html)