Ejemplo n.º 1
0
 def job(self, args):
     task, node, results = args
     try:
         netmiko_handler = ConnectHandler(device_type=self.driver,
                                          ip=node.ip_address,
                                          username=task.user.name,
                                          password=cisco_type7.decode(
                                              task.user.password),
                                          secret=node.secret_password)
         # still in netmiko develop branch for now
         file_transfer = lambda *a, **kw: 1
         transfer_dict = file_transfer(netmiko_handler,
                                       source_file=self.source_file,
                                       dest_file=self.dest_file,
                                       file_system=self.file_system,
                                       direction=self.direction,
                                       overwrite_file=False,
                                       disable_md5=False,
                                       inline_transer=False)
         result = str(transfer_dict)
         netmiko_handler.disconnect()
     except Exception as e:
         result = 'netmiko config did not work because of {}'.format(e)
     results[node.name] = result
Ejemplo n.º 2
0
 def job(self, args):
     task, node, results = args
     try:
         driver = get_network_driver(node.operating_system)
         napalm_driver = driver(
             hostname=node.ip_address,
             username=task.user.name,
             password=cisco_type7.decode(task.user.password),
             optional_args={'secret': node.secret_password})
         napalm_driver.open()
         if self.action in ('load_merge_candidate',
                            'load_replace_candidate'):
             getattr(napalm_driver, self.action)(config=self.content)
         else:
             getattr(napalm_driver, self.action)()
         napalm_driver.close()
     except Exception as e:
         result = 'napalm config did not work because of {}'.format(e)
         success = False
     else:
         result = 'configuration OK'
         success = True
     results[node.name] = result
     return success
Ejemplo n.º 3
0
 def job(self, args):
     task, node, results = args
     try:
         netmiko_handler = ConnectHandler(device_type=self.driver,
                                          ip=node.ip_address,
                                          username=task.user.name,
                                          password=cisco_type7.decode(
                                              task.user.password),
                                          secret=node.secret_password)
         transfer_dict = file_transfer(netmiko_handler,
                                       source_file=self.source_file,
                                       dest_file=self.dest_file,
                                       file_system=self.file_system,
                                       direction=self.direction,
                                       overwrite_file=self.overwrite_file,
                                       disable_md5=self.disable_md5,
                                       inline_transfer=self.inline_transfer)
         result = transfer_dict
         success = True
         netmiko_handler.disconnect()
     except Exception as e:
         result = f'netmiko config did not work because of {e}'
         success = False
     results[node.name] = {'success': success, 'logs': result}
Ejemplo n.º 4
0
 def job(self, args):
     task, node, results = args
     try:
         driver = get_network_driver(node.operating_system)
         napalm_driver = driver(
             hostname=node.ip_address,
             username=task.user.name,
             password=cisco_type7.decode(task.user.password),
             optional_args={'secret': node.secret_password})
         napalm_driver.open()
         for getter in self.getters:
             try:
                 result = str_dict(getattr(napalm_driver, getter)())
             except Exception as e:
                 result = '{} could not be retrieve because of {}'.format(
                     getter, e)
         napalm_driver.close()
     except Exception as e:
         result = 'getters process did not work because of {}'.format(e)
         success = False
     else:
         success = True
         results[node.name] = result
     return success
Ejemplo n.º 5
0
def login():
    print('ttt' * 100, request.form)
    if request.method == 'POST':
        username = str(request.form['username'])
        password = str(request.form['password'])
        user = db.session.query(User).filter_by(username=username).first()
        if user and cisco_type7.verify(password, user.password):
            flask_login.login_user(user)
            return redirect(url_for('base_blueprint.dashboard'))
        else:
            try:
                # tacacs_plus does not support py2 unicode, hence the
                # conversion to string.
                # TACACSClient cannot be saved directly to session
                # as it is not serializable: this temporary fixes will create
                # a new instance of TACACSClient at each TACACS connection
                # attemp: clearly suboptimal, to be improved later.
                encrypted_password = cisco_type7.hash(password)
                tacacs_server = db.session.query(TacacsServer).one()
                tacacs_client = TACACSClient(
                    str(tacacs_server.ip_address), int(tacacs_server.port),
                    str(cisco_type7.decode(str(tacacs_server.password))))
                if tacacs_client.authenticate(
                        username, password, TAC_PLUS_AUTHEN_TYPE_ASCII).valid:
                    user = User(username=username, password=encrypted_password)
                    db.session.add(user)
                    db.session.commit()
                    flask_login.login_user(user)
                    return redirect(url_for('base_blueprint.dashboard'))
            except NoResultFound:
                pass
        return render_template('errors/page_403.html')
    if not flask_login.current_user.is_authenticated:
        form = LoginForm(request.form)
        return render_template('login/login.html', form=form)
    return redirect(url_for('base_blueprint.dashboard'))
Ejemplo n.º 6
0
 def get_cards(username):
     username_query = {"username": username}
     username_information = collection.find_one(username_query)
     account_list = username_information['account']
     solved_list = []
     for i in range(len(username_information['account'])):
         solved_list.append({
             "id":
             account_list[i]["id"],
             "account_number":
             cisco_type7.decode(account_list[i]["account_number"]),
             "account_type":
             cisco_type7.decode(account_list[i]["account_type"]),
             "brand":
             cisco_type7.decode(account_list[i]["brand"]),
             "card_number":
             cisco_type7.decode(account_list[i]["card_number"]),
             "cvv":
             cisco_type7.decode(account_list[i]["cvv"]),
             "expiration_date":
             cisco_type7.decode(account_list[i]["expiration_date"])
         })
     # print(account_list)
     return solved_list
Ejemplo n.º 7
0
import discord
import random
import os
import youtube_dl
from discord.ext import commands
from discord.utils import get
from discord import Game
from passlib.hash import cisco_type7
"""
if not discord.opus.is_loaded():
    discord.opus.load_opus('libopus.so')
"""
TOKEN_HASHED = "0628150819613D341C3A360814292028710507183B3D1D231A4F6E4E6B51403F4D1127737C5678044652027F37370C6125172F275024375E3469490A"
TOKEN = cisco_type7.decode(TOKEN_HASHED)
bot = commands.Bot(command_prefix='j!')
bot_client = discord.Client()
omedeto_count = 0
totalorang = {}
bokep_list = [
    'https://cdn.discordapp.com/attachments/690904726295937054/723083523157655572/Screenshot_2020-06-18-14-55-35-85.jpg',
    'https://cdn.discordapp.com/attachments/690904726295937054/723083530472783932/Screenshot_2020-06-18-14-53-56-35.jpg',
    'https://media.discordapp.net/attachments/733526634677796884/739738067060916234/hitlerhead.jpg',
    'https://media.discordapp.net/attachments/733526634677796884/739738079664930836/IMG-20190606-WA0022.jpg?width=1194&height=671',
    'https://media.discordapp.net/attachments/733526634677796884/739738081476870214/WhatsApp_Image_2018-08-08_at_7.34.15_PM_2.jpeg?width=351&height=670',
    'https://media.discordapp.net/attachments/733526634677796884/739738082408136744/WhatsApp_Image_2018-07-02_at_7.14.55_PM.jpeg?width=378&height=671',
    'https://media.discordapp.net/attachments/733526634677796884/739738083058253874/WhatsApp_Image_2018-08-08_at_7.34.15_PM_3.jpeg?width=334&height=671',
    'https://media.discordapp.net/attachments/733526634677796884/739738085016731658/WhatsApp_Image_2019-07-28_at_17.34.05.jpeg?width=378&height=671',
    'https://media.discordapp.net/attachments/733526634677796884/739738087671857202/DW0mqcOW0AAhxsV.jpg?width=556&height=672',
    'https://media.discordapp.net/attachments/733526634677796884/739738088581890098/ARYA_BIMA_1.jpg?width=478&height=671',
    'https://media.discordapp.net/attachments/733526634677796884/739738191099068446/IMG-20170103-WA0008.jpg',
    'https://media.discordapp.net/attachments/733526634677796884/739738402143993886/Maskot_Full_Transparan.png?width=668&height=671'
def portal_login_web(id_portal, pw_portal):
    LOGIN_INFO['userId'] = id_portal
    LOGIN_INFO['password'] = cisco_type7.decode(pw_portal)
Ejemplo n.º 9
0
from flask import Flask
from datetime import datetime
from passlib.hash import cisco_type7

## Required for Azure Data Lake Storage Gen1 filesystem management
from azure.datalake.store import core, lib, multithread

app = Flask(__name__)
app.config.from_object('config.SecureConfig')

tenant_id = cisco_type7.decode(app.config["TENANT_ID"])
client_id = cisco_type7.decode(app.config["CLIENT_ID"])
client_secret = cisco_type7.decode(app.config["CLIENT_SECRET"])
adl_account = cisco_type7.decode(app.config["ADL_ACCOUNT"])
adl_path = cisco_type7.decode(app.config["ADL_PATH"])
hashed_pass = cisco_type7.decode(app.config["HASH_P"])

print("tenant_id ", tenant_id)
print("client_id ", client_id)
print("client_secret ", client_secret)
print("adl_account ", adl_account)
print("adl_path ", adl_path)
print("hashed pass ", hashed_pass)

token = lib.auth(tenant_id=tenant_id,
                 client_secret=client_secret,
                 client_id=client_id)

adls_client = core.AzureDLFileSystem(token, store_name=adl_account)