Exemple #1
0
 def run(self):
     self.httpd = None
     self.httpd = MyHTTPServer((self.Address, self.PORT), self.Handler,on_before_serve = self.httpd)
     self.Handler.log_message = self.Method_GET_LOG
     setup_logger('phishing', LOG_PHISHING, key=self.session)
     self.log_phishing = logging.getLogger('phishing')
     self.httpd.serve_forever()
Exemple #2
0
 def run(self):
     self.httpd = None
     self.httpd = MyHTTPServer((self.Address, self.PORT), self.Handler,on_before_serve = self.httpd)
     self.Handler.log_message = self.Method_GET_LOG
     setup_logger('phishing', './logs/Phishing/requests.log',key=self.session)
     self.log_phishing = logging.getLogger('phishing')
     self.httpd.serve_forever()
Exemple #3
0
 def run(self):
     self.httpd = None
     #self.httpd = MyHTTPServer((self.Address, self.PORT), self.Handler,on_before_serve = self.httpd)
     self.Handler.log_message_creds = self.Method_POST_DATA
     self.Handler.log_message_post = self.Mehtod_POST_LOG
     setup_logger('captivePortal', LOG_CAPTIVEPORTALPROXY, key=self.session)
     self.log_captiveportal = logging.getLogger('captivePortal')
 def run(self):
     self.httpd = None
     self.httpd = MyHTTPServer((self.Address, self.PORT), self.Handler,on_before_serve = self.httpd)
     self.Handler.log_message = self.Method_GET_LOG
     setup_logger('phishing', LOG_PHISHING, key=self.session)
     self.log_phishing = logging.getLogger('phishing')
     try:
         self.httpd.serve_forever()
     except Exception as e:
         print e
Exemple #5
0
 def startup(self):
     self.process = Popen(self.cmd,
     stdout=PIPE,stderr=STDOUT,preexec_fn=setsid)
     setup_logger('dhcp', C.LOG_DHCP,self.session)
     loggerDhcp = logging.getLogger('dhcp')
     loggerDhcp.info('---[ Start DHCP '+asctime()+']---')
     for line,data in enumerate(iter(self.process.stdout.readline, b'')):
         if 'DHCPREQUEST for' in data.rstrip():
             self.sendRequest.emit(data.split())
         elif 'DHCPACK on' in data.rstrip():
             self.sendRequest.emit(data.split())
         loggerDhcp.info(data.rstrip())
Exemple #6
0
 def run(self):
     self.process = Popen(self.args,
     stdout=PIPE,stderr=STDOUT,preexec_fn=setsid)
     print '[New Thread {} ({})]'.format(self.process.pid,self.objectName())
     setup_logger('dhcp', './logs/AccessPoint/dhcp.log',self.session)
     loggerDhcp = logging.getLogger('dhcp')
     loggerDhcp.info('---[ Start DHCP '+asctime()+']---')
     for line,data in enumerate(iter(self.process.stdout.readline, b'')):
         if 'DHCPREQUEST for' in data.rstrip():
             self.sendRequest.emit(data.split())
         elif 'DHCPACK on' in data.rstrip():
             self.sendRequest.emit(data.split())
         loggerDhcp.info(data.rstrip())
Exemple #7
0
 def run(self):
     self.process = Popen(self.args, stdout=PIPE, stderr=STDOUT, preexec_fn=setsid)
     print('[New Thread {} ({})]'.format(self.process.pid,self.objectName()))
     setup_logger('dhcp', C.LOG_DHCP,self.session)
     loggerDhcp = logging.getLogger('dhcp')
     loggerDhcp.info('---[ Start DHCP '+asctime()+']---')
     for line,data in enumerate(iter(self.process.stdout.readline, b'')):
         data = data.decode()
         if 'DHCPREQUEST for' in data.rstrip():
             self.sendRequest.emit(data.split())
         elif 'DHCPACK on' in data.rstrip():
             self.sendRequest.emit(data.split())
         elif 'reuse_lease' in data.rstrip():
             self.sendRequest.emit(data.split())
         loggerDhcp.info(data.rstrip())
Exemple #8
0
 def LoggerInjector(self, session):
     setup_logger('injectionPage', './logs/AccessPoint/injectionPage.log',
                  session)
     self.logging = logging.getLogger('injectionPage')
Exemple #9
0
 def LoggerInjector(self,session):
     setup_logger('injectionPage', './logs/AccessPoint/injectionPage.log',session)
     self.logging = logging.getLogger('injectionPage')
if __name__ == '__main__':
    # Parser for command inputs
    parser = argparse.ArgumentParser('Course Scraping Runner')
    # General PenjiDev Args
    parser.add_argument('-user', help='Enter user from config', default='PAIK')
    parser.add_argument('-school', help='Enter a school name', required=True)
    parser.add_argument('-term', help='Enter a term', default='fall19')
    parser.add_argument('-test', action='store_true', help='Test Runs')
    parser.add_argument('-ns', action='store_true', help='No Saving')
    parser.add_argument(
        '-log',
        help='Enter logger level: debug, info, warn, error, none',
        default='info',
        type=str)
    # General Variable Help messages
    parser.add_argument('-reset', action='store_true', help='Reset Files')
    # Special Args
    parser.add_argument('-width', help='Width Ratio', default=1, type=float)
    parser.add_argument('-height',
                        help='Height Ratio',
                        default=0.75,
                        type=float)
    parser.add_argument('-headless', action='store_true', help='Headless')

    parser_args = parser.parse_args()
    parser_args.save = not parser_args.ns
    parser_args = load_user_profile(parser_args)
    setup_logger(parser_args, 'course')
    setup_data_dir(args=parser_args)
    run(args=parser_args)
Exemple #11
0
    if os.path.exists(f'data/{args.school}/status.p'):
        os.remove(f'data/{args.school}/status.p')

def reset_logs(args):
    if os.path.exists(f'data/{args.school}/logs'):
        shutil.rmtree(f'data/{args.school}/logs')

if __name__ == '__main__':
    # Parser for command input
    parser = argparse.ArgumentParser('Check or Update Status of School ')
    # General PenjiDev Args
    parser.add_argument('-school', help='Enter a school name', required=True)
    parser.add_argument('-term', help='Enter a term', default='fall19')
    parser.add_argument('-test', action='store_true', help='Test Runs')
    parser.add_argument('-log', help='Enter logger level: debug, info, warn, error, none', default='info', type=str)
    # Special Args
    parser.add_argument('-update', action='store_true', help='Update Status')
    parser.add_argument('-reset_status', action='store_true', help='Reset Status')
    parser.add_argument('-reset_logs', action='store_true', help='Reset Log Files')
    parser_args = parser.parse_args()
    setup_logger(parser_args, 'status')
    # Always Check Status First
    if parser_args.reset_status:
        reset_status(parser_args)
    status_dict = check_status(parser_args)
    if parser_args.update:
        update_status(parser_args, status_dict)
    if parser_args.reset_logs:
        reset_logs(parser_args)

Exemple #12
0
 def makeLogger(self):
     setup_logger('hostapd', './logs/AccessPoint/hostapd.log',self.session)
     self.log_hostapd = logging.getLogger('hostapd')
Exemple #13
0
 def makeLogger(self):
     setup_logger('hostapd', C.LOG_HOSTAPD, self.session)
     self.log_hostapd = logging.getLogger('hostapd')
if __name__ == '__main__':
    # Parser for command inputs
    parser = argparse.ArgumentParser('Course Scraping Runner')
    # General PenjiDev Args
    parser.add_argument('-user', help='Enter user from config', default='PAIK')
    parser.add_argument('-school', help='Enter a school name', required=True)
    parser.add_argument('-term', help='Enter a term', default='fall19')
    parser.add_argument('-test', action='store_true', help='Test Runs')
    parser.add_argument('-ns', action='store_true', help='No Saving')
    parser.add_argument(
        '-log',
        help='Enter logger level: debug, info, warn, error, none',
        default='info',
        type=str)
    # General Variable Help messages
    parser.add_argument('-reset', action='store_true', help='Reset Files')
    # Special Args
    parser.add_argument('-width', help='Width Ratio', default=1, type=float)
    parser.add_argument('-height',
                        help='Height Ratio',
                        default=0.75,
                        type=float)
    parser.add_argument('-headless', action='store_true', help='Headless')

    parser_args = parser.parse_args()
    parser_args.save = not parser_args.ns
    parser_args = load_user_profile(parser_args)
    setup_logger(parser_args, 'student_org')
    setup_data_dir(args=parser_args)
    run(args=parser_args)
    spec.loader.exec_module(email_scraper)
    explored_professors = email_scraper.Scraper(args).run()
    logger.info(f'Explored Professors: \n{explored_professors}\n----------')


if __name__ == '__main__':
    # Parser for command input
    parser = argparse.ArgumentParser('Main Automation Runner')
    # General PenjiDev Args
    parser.add_argument('-user', help='Enter user from config', default='PAIK')
    parser.add_argument('-school', help='Enter a school name', required=True)
    parser.add_argument('-term', help='Enter a term', default='fall19')
    parser.add_argument('-test', action='store_true', help='Test Runs')
    parser.add_argument('-ns', action='store_true', help='No Saving')
    parser.add_argument('-log', help='Enter logger level: debug, info, warn, error, none', default='info', type=str)
    # General Variable Help messages
    parser.add_argument('-reset', action='store_true', help='Reset Files')
    # Special Args
    parser.add_argument('-width', help='Width Ratio', default=1, type=float)
    parser.add_argument('-height', help='Height Ratio', default=0.75, type=float)
    parser.add_argument('-headless', action='store_true', help='Headless')

    parser_args = parser.parse_args()
    parser_args.save = not parser_args.ns
    parser_args = load_user_profile(parser_args)


    setup_logger(parser_args, 'email')

    run(args=parser_args)
Exemple #16
0
 def makeLogger(self):
     setup_logger('hostapd', './logs/AccessPoint/hostapd.log', self.session)
     self.log_hostapd = logging.getLogger('hostapd')
Exemple #17
0
 def makeLogger(self):
     setup_logger('hostapd', C.LOG_HOSTAPD, self.session)
     self.log_hostapd = logging.getLogger('hostapd')
Exemple #18
0
    def __init__(self, parent=None, **kwargs):
        super(TCPProxy, self).__init__(parent)
        self.mainLayout = QtGui.QVBoxLayout()
        self.config = SettingsINI(C.TCPPROXY_INI)
        self.plugins = []
        self.parent = parent
        self.bt_SettingsDict = {}
        self.check_PluginDict = {}
        self.search_all_ProxyPlugins()
        # scroll area
        self.scrollwidget = QtGui.QWidget()
        self.scrollwidget.setLayout(self.mainLayout)
        self.scroll = QtGui.QScrollArea()
        self.scroll.setWidgetResizable(True)
        self.scroll.setWidget(self.scrollwidget)

        setup_logger("NetCreds", C.LOG_CREDSCAPTURE, "CapturedCreds")
        self.LogCredsMonitor = logging.getLogger("NetCreds")

        self.tabcontrol = QtGui.QTabWidget()
        self.tab1 = QtGui.QWidget()
        self.tab2 = QtGui.QWidget()
        self.page_1 = QtGui.QVBoxLayout(self.tab1)
        self.page_2 = QtGui.QVBoxLayout(self.tab2)
        self.tableLogging = dockTCPproxy()

        self.tabcontrol.addTab(self.tab1, 'Plugins')
        self.tabcontrol.addTab(self.tab2, 'Logging')

        self.TabPlugins = QtGui.QTableWidget()
        self.TabPlugins.setColumnCount(3)
        self.TabPlugins.setRowCount(len(self.plugins))
        self.TabPlugins.resizeRowsToContents()
        self.TabPlugins.setSizePolicy(QtGui.QSizePolicy.Preferred,
                                      QtGui.QSizePolicy.Preferred)
        self.TabPlugins.horizontalHeader().setStretchLastSection(True)
        self.TabPlugins.setSelectionBehavior(
            QtGui.QAbstractItemView.SelectRows)
        self.TabPlugins.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
        self.TabPlugins.verticalHeader().setVisible(False)
        self.TabPlugins.verticalHeader().setDefaultSectionSize(27)
        self.TabPlugins.setSortingEnabled(True)
        self.THeaders = OrderedDict([('Plugins', []), ('Author', []),
                                     ('Description', [])])
        self.TabPlugins.setHorizontalHeaderLabels(self.THeaders.keys())
        self.TabPlugins.horizontalHeader().resizeSection(0, 158)
        self.TabPlugins.horizontalHeader().resizeSection(1, 120)

        self.dockwidget = TCPProxyDock(None, title=self.Name)

        self.page_1.addWidget(self.TabPlugins)
        self.page_2.addWidget(self.tableLogging)
        # get all plugins and add into TabWidget
        Headers = []
        for plugin in self.plugins:
            self.bt_SettingsDict[plugin.Name] = QtGui.QPushButton(
                plugin.Author)
            self.check_PluginDict[plugin.Name] = QtGui.QCheckBox(plugin.Name)
            self.check_PluginDict[plugin.Name].setObjectName(plugin.Name)
            self.check_PluginDict[plugin.Name].clicked.connect(
                partial(self.setPluginOption, plugin.Name))
            self.THeaders['Plugins'].append(self.check_PluginDict[plugin.Name])
            self.THeaders['Author'].append({'name': plugin.Name})
            self.THeaders['Description'].append(plugin.Description)
        for n, key in enumerate(self.THeaders.keys()):
            Headers.append(key)
            for m, item in enumerate(self.THeaders[key]):
                if type(item) == type(QtGui.QCheckBox()):
                    self.TabPlugins.setCellWidget(m, n, item)
                elif type(item) == type(dict()):
                    self.TabPlugins.setCellWidget(
                        m, n, self.bt_SettingsDict[item['name']])
                else:
                    item = QtGui.QTableWidgetItem(item)
                    self.TabPlugins.setItem(m, n, item)
        self.TabPlugins.setHorizontalHeaderLabels(self.THeaders.keys())

        # check status all checkbox plugins
        for box in self.check_PluginDict.keys():
            self.check_PluginDict[box].setChecked(
                self.config.get_setting('plugins', box, format=bool))

        self.mainLayout.addWidget(self.tabcontrol)
        self.layout = QtGui.QHBoxLayout()
        self.layout.addWidget(self.scroll)
        self.setLayout(self.layout)