Exemple #1
0
def sprayLove(user, target, local_ip, remove):
    try:
        smbConnection = Connection(user.username, user.password, user.domain,
                                   user.lmhash + ':' + user.nthash, None, 'C$',
                                   False, False, None).run(target)
        if remove:
            exec_method = wmiexec_delete.WMIEXEC_DELETE(
                smbConnection, user.username, user.password, user.domain,
                user.lmhash, user.nthash)
            logging.warning("%sDeleting ProcDump and Dumps on %s%s%s..." %
                            (infoYellow, green, target, white))
        else:
            exec_method = wmiexec.WMIEXEC(smbConnection, user.username,
                                          user.password, user.domain,
                                          user.lmhash, user.nthash)
            logging.warning("%sProcDumping %s%s%s. Be patient..." %
                            (infoYellow, green, target, white))
        exec_method.run(target, get_os_arch(target))
    except UnboundLocalError:
        logging.info(
            "%s%s: The dump cannot be opened. Check if ProcDump worked with -v debug."
            % (warningRed, target))
    except Exception as e:
        logging.info("%sA problem occurs with %s%s%s. Err: %s" %
                     (warningRed, red, target, white, e))
        logging.debug("%s==== STACKTRACE ====" % (blue))
        if logging.getLogger().getEffectiveLevel() <= 10:
            traceback.print_exc(file=sys.stdout)
        logging.debug("%s==== STACKTRACE ====%s" % (blue, white))
Exemple #2
0
def sprayLove(user, target, local_ip):
    try:
        smbConnection = Connection(user.username, user.password, user.domain, user.lmhash + ':' + user.nthash, None, 'C$', False, False, None).run(target)
        exec_method = wmiexec.WMIEXEC(smbConnection, user.username, user.password, user.domain, user.lmhash, user.nthash)
        logging.warning("%sProcDumping %s%s%s. Be patient..." % (infoYellow, green, target, white))
        exec_method.run(target, get_os_arch(target))
    except Exception as e:
        logging.info("%s%s: %s" % (infoYellow, target, e))
Exemple #3
0
    async def _connect(self, source: discord.TextChannel,
                       dest: discord.TextChannel):
        # if one point does not exist nor will the other
        if self.bot._connections.get(dest.id, None) is None:
            webhooks = await self.get_webhooks_for(dest, source)
            source_connection = Connection(source, dest)
            dest_connection = Connection(dest, source)

            for i, c in enumerate((source_connection, dest_connection)):
                try:
                    webhook = webhooks[i]
                except IndexError:
                    webhook = None
                finally:
                    c.webhook = webhook

            self.bot._connections[source.id] = source_connection
            self.bot._connections[dest.id] = dest_connection
Exemple #4
0
def sprayLove(user, target, local_ip):
    try:
        smbConnection = Connection(user.username, user.password, user.domain, user.lmhash + ':' + user.nthash, None, 'C$', False, False, None).run(target)
        exec_method = wmiexec.WMIEXEC(smbConnection, user.username, user.password, user.domain, user.lmhash, user.nthash)
        logging.warning("%sProcDumping %s%s%s. Be patient..." % (infoYellow, green, target, white))
        exec_method.run(target, get_os_arch(target))
    except UnboundLocalError:
        logging.info("%s%s: The dump cannot be opened. Check if ProcDump worked with -v debug." % (warningRed, target))
    except Exception as e:
        logging.info("%s%s: %s" % (infoYellow, target, e))
def connect(user='******',
            host="localhost",
            port=5432,
            database=None,
            password=None,
            ssl=False,
            timeout=None,
            application_name=None):
    return Connection(user, host, port, database, password, ssl, timeout,
                      application_name)
Exemple #6
0
    def mouseReleaseEvent(self, mouseEvent):
        """
            Alter release mouse, we want:
                show parameters of Module
                show parameters of Port
                finish connection
        """
        QGraphicsScene.mouseReleaseEvent(self, mouseEvent)
        if mouseEvent.button() == Qt.LeftButton:

            if not self.justClick:
                '''
                    Some line is prepare, so try to make connection.
                '''
                items = self.items(mouseEvent.scenePos())
                # preparing variable for making connection
                startPort = None
                endPort = None
                startModule = None
                endModule = None

                for item in items:
                    '''
                        Looking for source port - QGraphicsPortItem.
                    '''
                    if self.line and (type(item) == QGraphicsPortItem):
                        items2 = self.items(self.line.line().p1())
                        endModule = item.findModuleUnder(item.scenePos()).module
                        endPort = item.port
                        for item2 in items2:
                            '''
                                Looking for destination port - QGraphicsPortItem.
                            '''
                            if type(item2) == QGraphicsPortItem:

                                startPort = item2.port
                                startModule = item2.findModuleUnder(item2.scenePos()).module
                        # one port shloud be Source, the other one Destination and both should be of same type (like Numeric, Raster, ...)
                        if startPort.type == endPort.type and startPort.portType != endPort.portType and startModule.id != endModule.id and startPort.isEmpty():# and endPort.isEmpty():
                            # test if startPoint is really source point of connection, otherwise switch them
                            if startPort.portType != PortType.Source:
                                tmp = endPort
                                endPort = startPort
                                startPort = tmp
                                tmp = endModule
                                endModule = startModule
                                startModule = tmp
                            # connect ports/modules by Connection
                            con = Connection(startPort, endPort, startModule,  endModule)
                            self.parent().graph.addConnection(con)
                            self.addConnection(con)

                            # start port could be source for more then one destination/end port, but destination have to have just one input
                            #startPort.setEmpty(False)
                            endPort.setEmpty(False)

                if self.line:
                    try:
                        self.removeItem(self.line)
                    except:
                        pass
                    self.line = 0
            else:
                '''
                    There is no line. User probably want to see/set informations/parameters of Module/Port.
                '''
                items = self.items(mouseEvent.scenePos())
                if len(items):
                    '''
                        User really wants to do smth.
                    '''
                    tmpPort = None
                    tmpModule = None
                    for i in items:
                        if (type(i) == QGraphicsPortItem):
                            tmpPort = i
                            break
                        elif (type(i) == QGraphicsModuleItem):
                            tmpModule = i

                    if (tmpPort):
                        '''
                            Give information about port.
                        '''
                        port = tmpPort.port
                        self.parent().item.setText(QString("Port - %s" % (port.name) ))
                        self.parent().textEditDesc.setText(QString("{1} --> {0}, {2}".format(port.description, port.type, port.getValue())))
                        self.parent().toolBox.setCurrentIndex(1)
                        self.parent().toolBox.setCurrentIndex(1)
                        self.parent().toolBox.setItemEnabled(0, False)

                    elif (tmpModule):
                        """
                            Give information about module.
                        """
                        module = tmpModule.module
                        self.parent().item.setText(QString("Module - %s" % (module.label)))
                        self.parent().textEditDesc.setText(module.description)
                        self.parent().toolBox.setCurrentIndex(0)
                        self.parent().toolBox.setItemEnabled(0, True)
                        # devide mandatory and optional ports/parameters
                        for port in module._ports.values():
                            widget = widgetByPort(port)
                            if port.optional:
                                self.parent().optionalForm.addRow(widget)
                            else:
                                self.parent().mandatoryForm.addRow(widget)

            self.justClick = False