• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python utils.Refactor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中Modules.utils.Refactor的典型用法代码示例。如果您正苦于以下问题:Python Refactor类的具体用法?Python Refactor怎么用?Python Refactor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Refactor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: Start_Attack

    def Start_Attack(self):
        if  (len(self.txt_target.text()) and len(self.txt_mac.text()) and len(self.txt_gateway.text())) == 0:
            QMessageBox.information(self, 'Error Arp Attacker', 'you need set the input correctly')
        else:
            chdir(self.owd)
            if (len(self.txt_target.text()) and len(self.txt_gateway.text())) and len(self.txt_mac.text()) != 0:
                if len(self.txt_redirect.text()) != 0:
                    self.StatusMonitor(True,'stas_arp')
                    Refactor.set_ip_forward(1)

                    arp_gateway = ThARP_posion(str(self.txt_gateway.text()),str(self.txt_target.text()),
                    get_if_hwaddr(str(self.ComboIface.currentText())))
                    arp_gateway.setObjectName('Arp Posion:: [gateway]')
                    self.ThreadDirc['Arp_posion'].append(arp_gateway)
                    arp_gateway.start()

                    arp_target = ThARP_posion(str(self.txt_target.text()),
                    str(self.txt_gateway.text()),
                    str(self.txt_mac.text()))
                    self.connect(arp_target,SIGNAL('Activated ( QString ) '), self.StopArpAttack)
                    arp_target.setObjectName('Arp::Posion => [target]')
                    self.ThreadDirc['Arp_posion'].append(arp_target)
                    arp_target.start()

                    self.conf_attack(True)
                    redirectPackets = ThSpoofAttack('',
                    str(self.ComboIface.currentText()),'udp port 53',True,str(self.txt_redirect.text()))
                    self.connect(redirectPackets,SIGNAL('Activated ( QString ) '), self.StopArpAttack)
                    redirectPackets.setObjectName('Packets Spoof')
                    self.ThreadDirc['Arp_posion'].append(redirectPackets)
                    redirectPackets.start()
开发者ID:az0ne,项目名称:3vilTwinAttacker,代码行数:31,代码来源:ModuleArpPosion.py


示例2: CoreSettings

 def CoreSettings(self):
     range_dhcp = self.FSettings.xmlSettings('Iprange', 'range',None,False)
     self.PortRedirect = self.FSettings.xmlSettings('redirect', 'port',None,False)
     self.SettingsAP = {
     'interface':
         [
             'ifconfig %s up'%(self.Ap_iface),
             'ifconfig %s 10.0.0.1 netmask 255.255.255.0'%(self.Ap_iface),
             'ifconfig %s mtu 1400'%(self.Ap_iface),
             'route add -net 10.0.0.0 netmask 255.255.255.0 gw 10.0.0.1'
         ],
     'kill':
         [
             'iptables --flush',
             'iptables --table nat --flush',
             'iptables --delete-chain',
             'iptables --table nat --delete-chain',
             'killall dhpcd',
             'killall dnsmasq'
         ],
     'dhcp-server':
         [
             'authoritative;\n',
             'default-lease-time 600;\n',
             'max-lease-time 7200;\n',
             'subnet 10.0.0.0 netmask 255.255.255.0 {\n',
             'option routers 10.0.0.1;\n',
             'option subnet-mask 255.255.255.0;\n',
             'option domain-name \"%s\";\n'%(str(self.EditApName.text())),
             'option domain-name-servers 10.0.0.1;\n',
             'range %s;\n'% range_dhcp,
             '}',
         ],
     'dnsmasq':
         [
             'interface=%s\n'%(self.Ap_iface),
             'dhcp-range=10.0.0.10,10.0.0.50,12h\n',
             'dhcp-option=3, 10.0.0.1\n',
             'dhcp-option=6, 10.0.0.1\n',
             'no-hosts\n'
             'addn-hosts='+ getcwd() + '/Settings/dnsmasq.hosts\n'
         ]
     }
     Refactor.set_ip_forward(1)
     for i in self.SettingsAP['interface']:popen(i)
     for i in self.SettingsAP['kill']:popen(i)
     dhcp_select = self.FSettings.xmlSettings('dhcp','dhcp_server',None,False)
     if dhcp_select != 'dnsmasq':
         with open('Settings/dhcpd.conf','w') as dhcp:
             for i in self.SettingsAP['dhcp-server']:dhcp.write(i)
             dhcp.close()
             if path.isfile('/etc/dhcp/dhcpd.conf'):
                 system('rm /etc/dhcp/dhcpd.conf')
             move('Settings/dhcpd.conf', '/etc/dhcp/')
     else:
         with open('Settings/dnsmasq.conf','w') as dhcp:
             for i in self.SettingsAP['dnsmasq']:
                 dhcp.write(i)
             dhcp.close()
开发者ID:az0ne,项目名称:3vilTwinAttacker,代码行数:59,代码来源:Main.py


示例3: kill

 def kill(self):
     if self.Apthreads['RougeAP'] == []:return
     for i in self.Apthreads['RougeAP']:i.stop()
     for kill in self.SettingsAP['kill']:popen(kill)
     set_monitor_mode(self.interface).setDisable()
     self.Started(False)
     Refactor.set_ip_forward(0)
     self.ListLoggerDhcp.clear()
开发者ID:az0ne,项目名称:3vilTwinAttacker,代码行数:8,代码来源:Main.py


示例4: kill_attack

 def kill_attack(self):
     try:
         for i in self.ThreadDirc['Arp_posion']:i.stop()
         self.Ftemplates.killThread()
     except:pass
     chdir(self.owd)
     self.StatusMonitor(False,'stas_arp')
     self.StatusMonitor(False,'stas_phishing')
     self.conf_attack(False)
     Refactor.set_ip_forward(0)
开发者ID:az0ne,项目名称:3vilTwinAttacker,代码行数:10,代码来源:ModuleArpPosion.py


示例5: kill

 def kill(self):
     if self.Apthreads['RougeAP'] == []:return
     for i in self.Apthreads['RougeAP']:i.stop()
     terminate = [
     'killall dhcpd',
     'killall dnsmasq'
     'killall xterm',
     'iptables --flush',
     'iptables --table nat --flush',
     'iptables --delete-chain',
     'iptables --table nat --delete-chain']
     for delete in terminate:popen(delete)
     set_monitor_mode(self.interface).setDisable()
     self.Started(False)
     Refactor.set_ip_forward(0)
     self.ListLoggerDhcp.clear()
开发者ID:uippet,项目名称:wifi-arsenal,代码行数:16,代码来源:Main.py


示例6: exportHTML

 def exportHTML(self):
     contents = Refactor.exportHtml()
     filename = QFileDialog.getSaveFileNameAndFilter(self, "Save File Logger HTML", "report.html", "HTML (*.html)")
     if len(filename) != 0:
         with open(str(filename[0]), "w") as filehtml:
             filehtml.write(contents), filehtml.close()
         QMessageBox.information(self, "3vilTwinAttacker", "file has been saved with success.")
开发者ID:jboy1009,项目名称:3vilTwinAttacker,代码行数:7,代码来源:Main.py


示例7: refrash_interface

 def refrash_interface(self):
     self.ComboIface.clear()
     n = Refactor.get_interfaces()["all"]
     for i, j in enumerate(n):
         if search("at", j) or search("wlan", j):
             self.ComboIface.addItem(n[i])
             self.discoveryIface()
开发者ID:jboy1009,项目名称:3vilTwinAttacker,代码行数:7,代码来源:Main.py


示例8: SettingsScan

 def SettingsScan(self):
     self.data = {'Bssid':[], 'Essid':[], 'Channel':[]}
     if self.get_placa.currentText() == "":
         QMessageBox.information(self, "Network Adapter", 'Network Adapter Not found try again.')
     else:
         self.interface = str(set_monitor_mode(self.get_placa.currentText()).setEnable())
         self.xmlcheck.xmlSettings("interface", "monitor_mode", self.interface, False)
         if self.time_scan.currentText() == "10s":count = 10
         elif self.time_scan.currentText() == "20s":count = 20
         elif self.time_scan.currentText() == "30s":count = 30
         if self.interface != None:
             if self.options_scan == "scan_scapy":
                 self.scapy_scan_AP(self.interface,count)
                 for i in self.ApsCaptured.keys():
                     if Refactor.check_is_mac(i):
                         self.data['Channel'].append(self.ApsCaptured[i][0])
                         self.data['Essid'].append(self.ApsCaptured[i][1])
                         self.data['Bssid'].append(i)
                         Headers = []
                         for n, key in enumerate(self.data.keys()):
                             Headers.append(key)
                             for m, item in enumerate(self.data[key]):
                                 item = QTableWidgetItem(item)
                                 item.setTextAlignment(Qt.AlignVCenter | Qt.AlignCenter)
                                 self.tables.setItem(m, n, item)
             else:
                 if path.isfile(popen('which airodump-ng').read().split("\n")[0]):
                     self.thread_airodump = threading.Thread(target=self.scan_diveces_airodump)
                     self.thread_airodump.daemon = True
                     self.thread_airodump.start()
                 else:
                     QMessageBox.information(self,'Error airodump','airodump-ng not installed')
                     set_monitor_mode(self.get_placa.currentText()).setDisable()
开发者ID:uippet,项目名称:wifi-arsenal,代码行数:33,代码来源:ModuleDeauth.py


示例9: refrash_interface

 def refrash_interface(self):
     self.ComboIface.clear()
     n = Refactor.get_interfaces()['all']
     for i,j in enumerate(n):
         if search('at',j) or search('wlan',j):
             self.ComboIface.addItem(n[i])
             self.discoveryIface()
开发者ID:KorayAgaya,项目名称:WiFi-Pumpkin,代码行数:7,代码来源:Main.py


示例10: exportHTML

 def exportHTML(self):
     contents = Refactor.exportHtml()
     filename = QFileDialog.getSaveFileNameAndFilter(self,
     "Save File Logger HTML","report.html","HTML (*.html)")
     if len(filename) != 0:
         with open(str(filename[0]),'w') as filehtml:
             filehtml.write(contents),filehtml.close()
开发者ID:zhangqianrong,项目名称:3vilTwinAttacker,代码行数:7,代码来源:Main.py


示例11: setupGUI

    def setupGUI(self):
        self.form0 = QFormLayout()
        self.list_probe = QListWidget()
        self.list_probe.setFixedHeight(300)
        self.btn_scan = QPushButton("Scan")
        self.btn_scan.clicked.connect(self.Pro_request)
        self.btn_scan.setIcon(QIcon("rsc/network.png"))
        self.get_placa = QComboBox(self)
        n = Refactor.get_interfaces()['all']
        for i,j in enumerate(n):
            if search("wlan", j):
                self.get_placa.addItem(n[i])

        self.time_scan = QComboBox(self)
        self.time_scan.addItems(["10s","20s","30s"])

        self.form0.addRow("Network Adapter: ", self.get_placa)
        self.form0.addRow(self.list_probe)
        self.form0.addRow("Time Scan: ", self.time_scan)
        self.form1 = QFormLayout()
        self.form1.addRow(self.btn_scan)
        self.Main.addLayout(self.form0)
        self.Main.addLayout(self.form1)

        self.setLayout(self.Main)
开发者ID:XCHADXFAQ77X,项目名称:3vilTwinAttacker,代码行数:25,代码来源:ModuleProbeRequest.py


示例12: exportHTML

 def exportHTML(self):
     contents = Refactor.exportHtml()
     filename = QFileDialog.getSaveFileNameAndFilter(self,
     'Save File Logger HTML','report.html','HTML (*.html)')
     if len(filename) != 0:
         with open(str(filename[0]),'w') as filehtml:
             filehtml.write(contents),filehtml.close()
         QMessageBox.information(self, 'WiFi Pumpkin', 'file has been saved with success.')
开发者ID:KorayAgaya,项目名称:WiFi-Pumpkin,代码行数:8,代码来源:Main.py


示例13: Start_Attack

 def Start_Attack(self):
     if  (len(self.txt_target.text()) and len(self.txt_mac.text()) and len(self.txt_gateway.text())) == 0:
         QMessageBox.information(self, 'Error Arp Attacker', 'you need set the input correctly')
     else:
         chdir(self.owd)
         if (len(self.txt_target.text()) and len(self.txt_gateway.text())) and len(self.txt_mac.text()) != 0:
             if len(self.txt_redirect.text()) != 0:
                 self.StatusMonitor(True,'stas_arp')
                 Refactor.set_ip_forward(1)
                 self.conf_attack(True)
                 thr = ThreadAttackPosion(str(self.txt_target.text()),
                                          str(self.txt_gateway.text()),
                                          str(self.txt_mac.text()))
                 self.connect(thr,SIGNAL('Activated ( QString ) '), self.StopArpAttack)
                 thr.setObjectName('Arp Posion')
                 self.ThreadDirc['Arp_posion'].append(thr)
                 thr.start()
开发者ID:uippet,项目名称:wifi-arsenal,代码行数:17,代码来源:ModuleArpPosion.py


示例14: StartApFake

    def StartApFake(self):
        self.ListLoggerDhcp.clear()
        if geteuid() != 0:
            QMessageBox.information(self,'Error permission',
            'Run as root ')
            return
        if len(self.selectCard.currentText()) == 0:
            QMessageBox.information(self,'Error',
            'Network interface not supported :(')
            return

        self.interface = str(set_monitor_mode(self.selectCard.currentText()).setEnable())
        self.config.xmlSettings('interface', 'monitor_mode',self.interface,False)
        # airbase thread
        thr_airbase = ProcessThread(['airbase-ng',
        '-c', str(self.EditChannel.text()), '-e', self.EditApName.text(),
        '-F', 'Logs/'+asctime(),self.interface])
        thr_airbase.name = 'Airbase-ng'
        self.thread.append(thr_airbase)
        thr_airbase.start()

        # settings conf
        while True:
            if thr_airbase.iface != None:
                self.Ap_iface = [x for x in Refactor.get_interfaces()['all'] if search('at',x)][0]
                self.config.xmlSettings('netcreds', 'interface',self.Ap_iface,False)
                break
        # thread netcreds
        ThNetCreds = ProcessThread(['python','Plugins/NetCreds.py','-i',
        self.config.xmlSettings('netcreds', 'interface',None,False)])
        ThNetCreds.setName('Net-Creds')
        self.thread.append(ThNetCreds)
        ThNetCreds.start()
        p = Process(target=self.CoreSettings,args=())
        p.start(),p.join()

        # thread dhcp
        if self.config.xmlSettings('dhcp','dhcp_server',None,False) != 'dnsmasq':
            Thdhcp = ThRunDhcp(['sudo','dhcpd','-d','-f','-cf','/etc/dhcp/dhcpd.conf',self.Ap_iface])
            self.connect(Thdhcp,SIGNAL('Activated ( QString ) '), self.dhcpLog)
            Thdhcp.setObjectName('DHCP')
            self.thread.append(Thdhcp)
            Thdhcp.start()
            self.Started(True)
        else:
            Thdhcp = ThRunDhcp(['dnsmasq','-C','Settings/dnsmasq.conf','-d'])
            self.connect(Thdhcp,SIGNAL('Activated ( QString ) '), self.dhcpLog)
            Thdhcp.setObjectName('DHCP')
            self.thread.append(Thdhcp)
            Thdhcp.start()
            self.Started(True)


        # thread sslstrip
        Thsslstrip = Threadsslstrip(self.PortRedirect)
        Thsslstrip.setObjectName("Sslstrip")
        self.thread.append(Thsslstrip)
        Thsslstrip.start()
开发者ID:zhangqianrong,项目名称:3vilTwinAttacker,代码行数:58,代码来源:Main.py


示例15: kill

 def kill(self):
     if self.Apthreads['RougeAP'] == []:return
     self.FSettings.xmlSettings('statusAP','value','False',False)
     for i in self.Apthreads['RougeAP']:i.stop()
     for kill in self.SettingsAP['kill']:popen(kill)
     set_monitor_mode(self.ConfigTwin['interface']).setDisable()
     self.Started(False)
     self.Apthreads['RougeAP'] = []
     self.APclients = {}
     with open('Settings/dhcp/dhcpd.leases','w') as dhcpLease:
         dhcpLease.write(''),dhcpLease.close()
     self.btn_start_attack.setDisabled(False)
     Refactor.set_ip_forward(0)
     self.TabInfoAP.clearContents()
     try:
         self.FormPopup.Ftemplates.killThread()
         self.FormPopup.StatusServer(False)
     except AttributeError as e:
         print e
开发者ID:KorayAgaya,项目名称:WiFi-Pumpkin,代码行数:19,代码来源:Main.py


示例16: GetDHCPRequests

 def GetDHCPRequests(self,data):
     if len(data) == 8:
         if Refactor.check_is_mac(data[4]):
             if data[4] not in self.APclients.keys():
                 self.APclients[data[4]] = {'IP': data[2],'device': data[5],'in_tables': False,}
             print self.APclients
     elif len(data) == 9:
         if Refactor.check_is_mac(data[5]):
             if data[5] not in self.APclients.keys():
                 self.APclients[data[5]] = {'IP': data[2],'device': data[6],'in_tables': False,}
             print self.APclients
     elif len(data) == 7:
         if Refactor.check_is_mac(data[4]):
             if data[4] not in self.APclients.keys():
                 leases = IscDhcpLeases('Settings/dhcp/dhcpd.leases')
                 hostname = None
                 try:
                     for item in leases.get():
                         if item.ethernet == data[4]:
                             hostname = item.hostname
                     if hostname == None:
                         item = leases.get_current()
                         hostname = item[data[4]]
                 except:
                     hostname = 'unknown'
                 if hotname == None:hostname = 'unknown'
                 self.APclients[data[4]] = {'IP': data[2],'device': hostname,'in_tables': False,}
                 print self.APclients
     Headers = []
     for mac in self.APclients.keys():
         if self.APclients[mac]['in_tables'] == False:
             self.APclients[mac]['in_tables'] = True
             self.THeaders['mac-address'].append(mac)
             self.THeaders['ip-address'].append(self.APclients[mac]['IP'])
             self.THeaders['device'].append(self.APclients[mac]['device'])
             for n, key in enumerate(self.THeaders.keys()):
                 Headers.append(key)
                 for m, item in enumerate(self.THeaders[key]):
                     item = QTableWidgetItem(item)
                     item.setTextAlignment(Qt.AlignVCenter | Qt.AlignCenter)
                     self.TabInfoAP.setItem(m, n, item)
             self.TabInfoAP.setHorizontalHeaderLabels(self.THeaders.keys())
     self.connectedCount.setText(str(len(self.APclients.keys())))
开发者ID:KorayAgaya,项目名称:WiFi-Pumpkin,代码行数:43,代码来源:Main.py


示例17: list_clicked

 def list_clicked(self, index):
     itms = self.list.selectedIndexes()
     for i in itms:
         attack = str(i.data().toString()).split()
         for i in attack:
             if Refactor.check_is_mac(i.replace(" ", "")):
                 self.linetarget.setText(str(i))
         if self.linetarget.text() == "":
             QMessageBox.information(self, "MacAddress",
                                     "Error check the Mac Target, please set the mac valid.")
开发者ID:uippet,项目名称:wifi-arsenal,代码行数:10,代码来源:ModuleDeauth.py


示例18: D_attack

 def D_attack(self):
     interface = Refactor.get_interfaces()['activated']
     if interface != None:
         self.check.setText("[ ON ]")
         self.check.setStyleSheet("QLabel {  color : green; }")
         self.threadstar = ThreadAttackStar(interface)
         self.connect(self.threadstar,SIGNAL("Activated ( QString )"),self.getloggerAttack)
         self.threadstar.setObjectName("DHCP Starvation")
         self.threadstar.start()
     else:
         QMessageBox.information(self, "Interface Not found", 'None detected network interface try again.')
开发者ID:XCHADXFAQ77X,项目名称:3vilTwinAttacker,代码行数:11,代码来源:ModuleStarvation.py


示例19: SettingsScan

 def SettingsScan(self):
     self.data = {'Bssid':[], 'Essid':[], 'Channel':[]}
     if self.get_placa.currentText() == "":
         QMessageBox.information(self, "Network Adapter", 'Network Adapter Not found try again.')
     else:
         if not search(self.interface,check_output('ifconfig')):
             self.interface = self.set_monitor_mode(self.get_placa.currentText(),True)
             self.xmlcheck.xmlSettings("interface", "monitor_mode", self.interface, False)
         if self.time_scan.currentText() == "10s":count = 10
         elif self.time_scan.currentText() == "20s":count = 20
         elif self.time_scan.currentText() == "30s":count = 30
         if self.interface != None:
             if self.options_scan == "scan_scapy":
                 sniff(iface=self.interface, prn =self.Scanner_devices, timeout=count)
                 t = len(self.ap_list) -1
                 items,cap = [],[]
                 for i in range(t):
                     if len(self.ap_list[i]) < len(self.ap_list[i+1]):
                         if i != 0:
                             for index in xrange(self.list.count()):
                                 items.append(self.list.item(index))
                             if self.ap_list[i] or self.ap_list[i+1] in items:pass
                             else:
                                 if not (self.ap_list[i] + " " + self.ap_list[i+1]) in cap:
                                     cap.append(self.ap_list[i] + " " + self.ap_list[i+1])
                         else:
                             if not (self.ap_list[i] + " " + self.ap_list[i+1]) in cap:
                                 cap.append(self.ap_list[i] + " " + self.ap_list[i+1])
                     else:
                         if not (self.ap_list[i+1] + " " + self.ap_list[i]) in cap:
                             cap.append(self.ap_list[i+1] + " " + self.ap_list[i])
                     if self.ap_list[i] < i:
                         pass
                         break
                 for i in cap:
                     dat = i.split()
                     if Refactor.check_is_mac(dat[3]):
                         self.data['Channel'].append(dat[0])
                         self.data['Essid'].append(dat[2])
                         self.data['Bssid'].append(dat[3])
                         Headers = []
                         for n, key in enumerate(self.data.keys()):
                             Headers.append(key)
                             for m, item in enumerate(self.data[key]):
                                 item = QTableWidgetItem(item)
                                 item.setTextAlignment(Qt.AlignVCenter | Qt.AlignCenter)
                                 self.tables.setItem(m, n, item)
                 self.ap_list = []
             else:
                 self.thread_airodump = threading.Thread(target=self.scan_diveces_airodump)
                 self.thread_airodump.daemon = True
                 self.thread_airodump.start()
开发者ID:XCHADXFAQ77X,项目名称:3vilTwinAttacker,代码行数:52,代码来源:ModuleDeauth.py


示例20: threadServer

 def threadServer(self, directory):
     ip = Refactor.get_ip_local(self.cb_interface.currentText())
     try:
         chdir(directory)
     except OSError:
         pass
     global threadloading
     self.thphp = mThreadServer(("php -S %s:80" % (ip)).split())
     self.connect(self.thphp, SIGNAL("Activated ( QString ) "), self.logPhising)
     threadloading["server"].append(self.thphp)
     self.thphp.setObjectName("Server-PHP")
     self.thphp.start()
     self.status.showMessage("::Started >> [HTTP::" + ip + " ::Port 80]")
开发者ID:h4de5ing,项目名称:3vilTwinAttacker-1,代码行数:13,代码来源:ModuleUpdateFake.py



注:本文中的Modules.utils.Refactor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python Page.Page类代码示例发布时间:2022-05-24
下一篇:
Python commonBits.sampleDir函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap