This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def gcd(a, b): | |
while a != b: | |
if a > b: | |
a = a - b | |
else: | |
b = b - a | |
return a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function f() { | |
sleep "$1" | |
echo "$1" | |
} | |
while [ -n "$1" ] | |
do | |
f "$1" & shift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) |