Beispiel #1
0
def main():
    ip = 'localhost'
    port = 9090
    print "Inicio del proxy"
    server = Proxy.Proxy(ip, port)
    print "Servidor proxy iniciado en la IP", ip, "y puerto", port
    server.start()
Beispiel #2
0
def login(account):
    # Read user info
    try:
        arr = account.split('|')
        if len(arr) >= 2:
            username = arr[0]
            password = arr[1]
    except Exception as error:
        write_to_log("Failed to read " + account, error, sys.exc_info())

    # Login
    proxy = Proxy.Proxy()
    proxy = proxy.get_proxy()

    url = 'https://de.lovoo.com/login_check'
    session = requests.Session()

    try:
        payload = {'_username': username,
                   '_password': password,
                   '_remember_me': 'false'
                   }
        # header = {'user-agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) '
        #                        'Chrome/71.0.3578.98 Safari/537.36'}
        # response = sess.get(url, data=data, headers=header, proxies=proxy)
        response = session.post(url, data=payload, proxies={'http': proxy})
        json = response.json()
        if json['success']:
            print('Successfully logged in')
            return session
        else:
            print(json['message'])
    except Exception as error:
        print(error)
Beispiel #3
0
 def __init__(self):
     print('Сбор доступных прокси')
     proxy = Proxy.Proxy()
     self.proxy_list = proxy.get_proxy()
     self.PROXY_LEN = len(self.proxy_list)
     self.user_agents = open('user-agent-list.txt').read().split('\n')
     d = date.today()
     date_file_name = str(d.year) + '-' + str(d.month) + '-' + str(d.day)
     os.chdir(os.path.dirname(__file__))
     self.proxy_f_name = os.getcwd() + 'proxies_' + date_file_name + '.txt'
Beispiel #4
0
def main():
    Proxy().run()
Beispiel #5
0
def Client():

    while 1:
        fileName = raw_input("Enter the name of the file you want access to: ")
        Proxy.Proxy(fileName)
Beispiel #6
0
def cli(master_server, client_servers):
    while True:
        try:
            cmd = input("$ ").decode("utf-8")
            cmd = list(map(lambda s: s.replace("\n", ""), cmd.split(" ")))
            if (cmd[0] == "quit" or cmd[0] == "exit"):
                os._exit(0)
            elif (cmd[0] == "help"):
                print("--Commands--")
                for key, val in cmds.items():
                    log.info("{} :: {}".format(key, val))
                print("--Commands--")
            elif (cmd[0] == "setserver"):
                if (len(cmd) != 4):
                    log.warn(
                        "Error: Command format is \"setserver <interface> <ip> <port>\""
                    )
                else:
                    if (not master_server):
                        master_server = Proxy(cmd[1], cmd[2], int(cmd[3]))
                        master_server.start()
                        log.info(
                            "[> Started server connection: [ip {}] [port{}]".
                            format(cmd[2], cmd[3]))
                    else:
                        log.warn(
                            "Error: Server connection already established, close with \"server -c\""
                        )
            elif (cmd[0] == "setclient"):
                if (len(cmd) != 4):
                    print(
                        "Error: Command format is \"setclient <interface> <ip> <port>\""
                    )
                else:
                    client = Proxy(cmd[1], cmd[2], cmd[3])
                    client.start()
                    client_servers.append(client)
                    log.info("[> Started client connection: [ip {}] [port{}]".
                             format(cmd[2], cmd[3]))
            elif (cmd[0] == "client"):
                if (len(cmd) < 2):
                    log.warn("Error: Command format is \"client <flags>\"")
                else:
                    if ("-ca" in cmd):
                        for client in client_servers:
                            client.close()
                            client_servers.remove(clients)
                        log.info("[> Closed all open clients")
                    if ("-ci" in cmd):
                        index = cmd.index("-ci")
                        if (index >= len(cmd) - 1):
                            log.warn(
                                "Error: \"-ci\" flag must have an id specified"
                            )
                        else:
                            len_pre = len(client_servers)
                            for client in client_servers:
                                if (str(client.getClientUid()) == cmd[index +
                                                                      1]):
                                    client.close()
                                    client_servers.remove(client)
                                    break
                            if (len_pre == len(client_servers)):
                                log.warn(
                                    "Error: No open client with id: {}".format(
                                        cmd[index + 1]))
                            log.info("[> Closed client with id: {}".format(
                                cmd[index + 1]))
                    if ("-i" in cmd):
                        index = cmd.index("-i")
                        if (index >= len(cmd) - 1):
                            log.warn(
                                "Error: \"-i\" flag must have an id specified")
                        else:
                            for client in client_servers:
                                if (str(client.getClientUid()) == cmd[index +
                                                                      1]):
                                    log.info(
                                        "[> Client " + text.bold_yellow(
                                            str(client.getClientUid())) +
                                        "\nInterface: {}\nServer IP: {}\nPort: {}"
                                        .format(client.getInterface(),
                                                client.getServer(),
                                                client.getPort()))
                                    break
                    if ("-ids" in cmd):
                        if (len(client_servers) < 1):
                            log.warn("Error: No active clients")
                        else:
                            log.info("[> Active Clients")
                            for i in range(0, len(client_servers)):
                                logging.listelem(
                                    str(i), client_servers[i].getClientUid())
                    if ("-if" in cmd):
                        index = cmd.index("-if")
                        if (len(cmd) - 1 == index):
                            log.warn(
                                "Error: flag must have an interface specified")
                        else:
                            changed = False
                            for client in client_servers:
                                if (str(client.getClientUid()) == cmd[index +
                                                                      1]):
                                    client.from_host = cmd[index + 2]
                                    log.info(
                                        "[> Set client interface to: '{}'".
                                        format(cmd[index + 2]))
                                    changed = True
                                    break
                            if (not changed):
                                log.warn("Error: No client with id: " +
                                         cmd[index + 1])
            elif (cmd[0] == "server"):
                if (len(cmd) < 2):
                    log.warn("Error: Command format is \"server <flags>\"")
                else:
                    if ("-c" in cmd):
                        master_server.close()
                        log.info("[> Closed active server connection")
                    if ("-p" in cmd):
                        index = cmd.index("-p")
                        if (len(cmd) - 1 == index):
                            log.warn("Error: flag must have a port specified")
                        else:
                            master_server.port = int(cmd[index + 1])
                            log.info("[> Set server port to: '{}'".format(
                                cmd[index + 1]))
                    if ("-i" in cmd):
                        log.info("[> Server " + text.bold_yellow(
                            str(master_server.getServerUid())) +
                                 "\nInterface: {}\nIP: {}\nPort: {}".format(
                                     master_server.getInterface(),
                                     master_server.getServer(),
                                     master_server.getPort()))
                    if ("-if" in cmd):
                        index = cmd.index("-if")
                        if (len(cmd) - 1 == index):
                            log.warn(
                                "Error: flag must have an interface specified")
                        else:
                            master_server.from_host = cmd[index + 1]
                            log.info("[> Set server interface to: '{}'".format(
                                cmd[index + 1]))

            else:
                log.warn(
                    "Error: Invalid command, type \"help\" for a list of commands"
                )
        except Exception as e:
            print(e.message)
            logging.error(e)
Beispiel #7
0
import os, sys
import random
import numpy as np

from PySide2.QtCore import QUrl, Qt, QCoreApplication
from PySide2.QtWidgets import QApplication
from PySide2.QtQml import QQmlApplicationEngine

from PySide2.QtCore import QObject, Signal, Slot, Property
from PySide2.QtCore import QAbstractListModel, QAbstractTableModel, QModelIndex, QByteArray

from Proxy import *

if __name__ == '__main__':
    QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling)

    app = QApplication(sys.argv)

    proxy = Proxy()

    engine = QQmlApplicationEngine()
    engine.rootContext().setContextProperty("proxy", proxy)
    engine.load(
        QUrl.fromLocalFile(
            os.path.join(os.path.dirname(sys.argv[0]), "Gui.qml")))

    if not engine.rootObjects():
        sys.exit(-1)

    sys.exit(app.exec_())
Beispiel #8
0
import Auth, Proxy
import Container

id = Auth.Auth().get_user_id()
proxy = Proxy.Proxy(id)

proxy.create_group('Group1')

#permission = {}
#proxy.edit_group_stat(stat_name='permission', stat_value=permission, stat_opt='Dict')

print "Finally of create group we have GroupData with permission to invite new peuple for creator," \
      "We create ObjectData it's user who create a group"
print Container.GROUP_CONTAINER.container, Container.GROUP_CONTAINER.container[
    '123Group1'].permission
print Container.USER_CONTAINER.container, Container.USER_CONTAINER.container[
    '123Group1123']._roles
#proxy.edit_group_stat(permission, stat_opt, name)