Exemplo n.º 1
0
def main():
    choices = "pw (Uses a password to create a key) & no_pw"
    print("Choices " + choices)
    choose_cmd = input("Type in the command you want to use: ").lower()
    ce.__input__(choose_cmd)

    if choose_cmd == "pw":
        pw()
    elif choose_cmd == "no_pw":
        key = Fernet.generate_key()
        print(key)
        print('\nRemember to add .key to the end of the file.\nAlso, if you wish to add the file to a different directory\nadd /directory/ before key name.')
        file = input('What is the filename? ')
        ce.__input__(file)
        f = open(file, 'wb')
        f.write(key)
        f.close()
    else:
        print("\nNot a valid command!")
        print("Use " + choices)
Exemplo n.º 2
0
def pw():
    # Use a password to create a key
    p = input('What is the password you want to use? ')
    ce.__input__(p)
    password = p.encode()
    salt = os.urandom(16)
    kdf = PBKDF2HMAC(
        algorithm=hashes.SHA256(),
        length=32,
        salt=salt,
        iterations=100000,
        backend=default_backend()
    )
    key = base64.urlsafe_b64encode(kdf.derive(password))
    print(key)
    print('\nRemember to add .key to the end of the file.\nAlso, if you wish to add the file to a different directory\nadd /directory/ before key name.')
    file = input('What is the filename? ')
    ce.__input__(file)
    f = open(file, 'wb')
    f.write(key)
    f.close()
Exemplo n.º 3
0
file = open('/tmp/ip_ping_results.txt', 'w')

print("NOTE:")
print(
    "While this script is legal, this still can be used with malicious intent."
)
print("Don't use this code with malicious intent!")
print(
    "This is meant for good purposes, DO NOT use this with malicious intent. DO NOT be a criminal.\n"
)
print(
    "Only PING IPs that belong to you and the people you have gained permission from!\n"
)

net = input('Enter network e.g. [192.168.1.1]: ')[0:-1]
if len(sys.argv) == 2: ce.__input__(net)

start = input('Starting IP: ')
if len(sys.argv) == 2: ce.__input__(start)

end = input('Ending IP: ')
if len(sys.argv) == 2: ce.__input__(end)

print()

for i in range(int(start), int(end)):
    try:
        subprocess.check_call(['ping', '-c', '1', net + str(i)],
                              stdout=file,
                              stderr=file)
    except (subprocess.CalledProcessError, OSError):
Exemplo n.º 4
0
#!/usr/bin/env python3

import os
import time
import sys

if len(sys.argv) == 2:
    sys.path.append("./tools")
    from logos import Logo
    import catch_exception as ce

    Logo('Server Pinging')

time.sleep(1)

hostname = input("Domain: ")
if len(sys.argv) == 2: ce.__input__(hostname)

response = os.system("ping -c 1 " + hostname)

if response == 0:
    print(hostname + " is up!")
else:
    print(hostname + " is down!")
Exemplo n.º 5
0
from cryptography.fernet import Fernet
import time
import sys

if len(sys.argv) == 2:
    sys.path.append("./tools")
    from logos import Logo
    import catch_exception as ce

    Logo('Pyca encryption')

time.sleep(1)

file = input('What is the key? ')
if len(sys.argv) == 2: ce.__input__(file)

f = open(file, 'rb')
key = f.read()
f.close()

fl = input('What is the filename? ')
if len(sys.argv) == 2: ce.__input__(fl)

with open(fl, 'rb') as r:
    msg = r.read()

fernet = Fernet(key)
enc = fernet.encrypt(msg)

print('\nRemember to add the file extenson you want e.g. .dat.')