Skip to content
This repository was archived by the owner on Apr 19, 2020. It is now read-only.

Commit 92f79d1

Browse files
committed
commit v6.4
1 parent 1e1abf1 commit 92f79d1

File tree

11 files changed

+151
-126
lines changed

11 files changed

+151
-126
lines changed

3vilTwin-Attacker.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,21 @@
2121
from Core.Privilege import frm_privelege
2222
from Core.Main import Initialize
2323
from Core.check import check_dependencies
24+
from Modules.utils import Refactor
25+
26+
def ExecRootApp():
27+
check_dependencies()
28+
root = QApplication(argv)
29+
app = Initialize()
30+
app.setWindowIcon(QIcon('rsc/icon.ico'))
31+
app.center(),app.show()
32+
exit(root.exec_())
33+
2434
if __name__ == '__main__':
2535
if not getuid() == 0:
2636
app2 = QApplication(argv)
2737
priv = frm_privelege()
2838
priv.setWindowIcon(QIcon('rsc/icon.ico'))
29-
priv.show()
30-
exit(app2.exec_())
31-
else:
32-
check_dependencies()
33-
root = QApplication(argv)
34-
app = Initialize(None)
35-
app.setWindowIcon(QIcon('rsc/icon.ico'))
36-
app.center()
37-
app.show()
38-
exit(root.exec_())
39-
40-
39+
priv.show(),app2.exec_()
40+
exit(Refactor.threadRoot(priv.Editpassword.text()))
41+
ExecRootApp()

CHANGELOG

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
Version 0.6.4
2+
-------------
3+
- added support kali 2.0
4+
- added iptables Settings
5+
- change design main
6+
- fixed some bug with AP internet share
7+
- fixed dhcp install
8+
19
Version 0.6.3
210
-----------
311
- Netcreds Plugin
@@ -7,12 +15,8 @@ Version 0.6.3
715
- export html report attack
816
- Advanced Settings
917
- sslstrip on default
10-
- Fixed xterm window
1118
- Credentials Monitor
1219
- Credentials Phising
13-
- added support kali 2.0
14-
- added iptables Settings
15-
- added function save all Logs
1620

1721
Version 0.5.9
1822
-----------

Core/Main.py

Lines changed: 54 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
from shutil import move
2020
from sys import argv
2121
import logging
22-
from re import search,compile,VERBOSE,IGNORECASE
22+
from re import search
2323
from multiprocessing import Process
2424
from time import asctime
25-
from subprocess import Popen,PIPE,STDOUT,call,check_output
25+
from subprocess import Popen,PIPE,STDOUT,call
2626
from Modules.ModuleStarvation import frm_dhcp_main
2727
from Modules.ModuleDeauth import frm_window,frm_deauth
2828
from Modules.ModuleMacchanger import frm_mac_generator
@@ -44,7 +44,7 @@
4444
author = ' @mh4x0f P0cl4bs Team'
4545
4646
license = 'MIT License (MIT)'
47-
version = '0.6.3'
47+
version = '0.6.4'
4848
date_create = '18/01/2015'
4949
update = '27/07/2015'
5050
desc = ['Framework for EvilTwin Attacks']
@@ -126,7 +126,9 @@ def run(self):
126126
reactor.run(installSignalHandlers=False)
127127
def stop(self):
128128
print 'Stop thread:' + self.objectName()
129-
reactor.stop()
129+
try:
130+
reactor.stop()
131+
except:pass
130132

131133

132134
class SubMain(QWidget):
@@ -263,7 +265,7 @@ def intGUI(self):
263265
self.EditChannel = QLineEdit(self)
264266
self.selectCard = QComboBox(self)
265267
self.ListLoggerDhcp = QListWidget(self)
266-
self.ListLoggerDhcp.setFixedHeight(170)
268+
self.ListLoggerDhcp.setFixedHeight(150)
267269
try:
268270
self.EditGateway.setText([Refactor.get_interfaces()[x] for x in Refactor.get_interfaces().keys() if x == 'gateway'][0])
269271
except:pass
@@ -287,11 +289,11 @@ def intGUI(self):
287289
dnsmasq = popen('which dnsmasq').read().split("\n")
288290
lista = [ '/usr/sbin/airbase-ng', ettercap[0],driftnet[0],dhcpd[0],dnsmasq[0]]
289291
self.m = []
290-
for i in lista:
291-
self.m.append(path.isfile(i))
292+
for i in lista:self.m.append(path.isfile(i))
292293

293-
self.form = QFormLayout()
294-
self.form2 = QFormLayout()
294+
self.FormGroup1 = QFormLayout()
295+
self.FormGroup2 = QFormLayout()
296+
self.FormGroup3 = QFormLayout()
295297
hLine = QFrame()
296298
hLine.setFrameStyle(QFrame.HLine)
297299
hLine.setSizePolicy(QSizePolicy.Minimum,QSizePolicy.Expanding)
@@ -301,40 +303,54 @@ def intGUI(self):
301303
vbox = QVBoxLayout()
302304
vbox.setMargin(5)
303305
vbox.addStretch(20)
304-
self.form.addRow(vbox)
306+
self.FormGroup1.addRow(vbox)
305307
self.logo = QPixmap(getcwd() + '/rsc/logo.png')
306-
self.imagem = QLabel(self)
308+
self.imagem = QLabel()
307309
self.imagem.setPixmap(self.logo)
308-
self.form.addRow(self.imagem)
310+
self.FormGroup1.addRow(self.imagem)
309311

310-
self.form.addRow('Gateway:', self.EditGateway)
311-
self.form.addRow('AP Name:', self.EditApName)
312-
self.form.addRow('Channel:', self.EditChannel)
312+
313+
self.GroupAP = QGroupBox()
314+
self.GroupAP.setTitle('Access Point::')
315+
self.FormGroup3.addRow('Gateway:', self.EditGateway)
316+
self.FormGroup3.addRow('AP Name:', self.EditApName)
317+
self.FormGroup3.addRow('Channel:', self.EditChannel)
318+
self.GroupAP.setLayout(self.FormGroup3)
313319

314320
# grid network adapter fix
315321
self.btrn_refresh = QPushButton('Refresh')
316322
self.btrn_refresh.setIcon(QIcon('rsc/refresh.png'))
317323
self.btrn_refresh.clicked.connect(self.refrash_interface)
318-
self.grid = QGridLayout()
319-
self.grid.addWidget(QLabel('Network Adapter:'),0,0)
320-
self.grid.addWidget(self.selectCard, 0,1)
321-
self.grid.addWidget(self.btrn_refresh,0,2)
324+
325+
self.layout = QFormLayout()
326+
self.GroupAdapter = QGroupBox()
327+
self.GroupAdapter.setTitle('Network Adapter::')
328+
self.layout.addRow(self.selectCard)
329+
self.layout.addRow(self.btrn_refresh)
330+
self.GroupAdapter.setLayout(self.layout)
331+
322332

323333
self.btn_start_attack = QPushButton('Start Attack', self)
324334
self.btn_start_attack.setIcon(QIcon('rsc/start.png'))
325-
self.btn_start_attack.setFixedWidth(160)
326335
self.btn_cancelar = QPushButton('Stop Attack', self)
327336
self.btn_cancelar.setIcon(QIcon('rsc/Stop.png'))
328-
self.btn_cancelar.setFixedWidth(165)
329337
self.btn_cancelar.clicked.connect(self.kill)
330338
self.btn_start_attack.clicked.connect(self.StartApFake)
331339

332-
self.form2.addRow(self.btn_start_attack, self.btn_cancelar)
333-
self.form2.addRow(self.ListLoggerDhcp)
334-
self.form2.addRow(self.StatusBar)
335-
self.Main.addLayout(self.form)
336-
self.Main.addLayout(self.grid)
337-
self.Main.addLayout(self.form2)
340+
hBox = QHBoxLayout()
341+
hBox.addWidget(self.btn_start_attack)
342+
hBox.addWidget(self.btn_cancelar)
343+
344+
self.slipt = QHBoxLayout()
345+
self.slipt.addWidget(self.GroupAP)
346+
self.slipt.addWidget(self.GroupAdapter)
347+
348+
self.FormGroup2.addRow(hBox)
349+
self.FormGroup2.addRow(self.ListLoggerDhcp)
350+
self.FormGroup2.addRow(self.StatusBar)
351+
self.Main.addLayout(self.FormGroup1)
352+
self.Main.addLayout(self.slipt)
353+
self.Main.addLayout(self.FormGroup2)
338354
self.setLayout(self.Main)
339355

340356
def show_arp_posion(self):
@@ -407,6 +423,7 @@ def refrash_interface(self):
407423
self.selectCard.addItem(n[i])
408424

409425
def kill(self):
426+
if self.Apthreads['RougeAP'] == []:return
410427
for i in self.Apthreads['RougeAP']:i.stop()
411428
terminate = [
412429
'killall dhcpd',
@@ -415,8 +432,7 @@ def kill(self):
415432
'iptables --flush',
416433
'iptables --table nat --flush',
417434
'iptables --delete-chain',
418-
'iptables --table nat --delete-chain',
419-
'ifconfig %s down'%(self.Ap_iface),]
435+
'iptables --table nat --delete-chain']
420436
for delete in terminate:popen(delete)
421437
set_monitor_mode(self.interface).setDisable()
422438
self.Started(False)
@@ -462,8 +478,12 @@ def CoreSettings(self):
462478
],
463479
'kill':
464480
[
481+
'iptables --flush',
482+
'iptables --table nat --flush',
483+
'iptables --delete-chain',
484+
'iptables --table nat --delete-chain',
465485
'killall dhpcd',
466-
'killall dnsmasq',
486+
'killall dnsmasq'
467487
],
468488
'dhcp-server':
469489
[
@@ -474,6 +494,7 @@ def CoreSettings(self):
474494
'option routers 10.0.0.1;\n',
475495
'option subnet-mask 255.255.255.0;\n',
476496
'option domain-name \"%s\";\n'%(str(self.EditApName.text())),
497+
'option domain-name-servers 10.0.0.1;\n',
477498
'range %s;\n'% range_dhcp,
478499
'}',
479500
],
@@ -509,7 +530,7 @@ def StartApFake(self):
509530
QMessageBox.warning(self,'Error permission','Run as root ')
510531
return
511532
if len(self.selectCard.currentText()) == 0:
512-
QMessageBox.warning(self,'Error','Network interface not supported :(')
533+
QMessageBox.warning(self,'Error interface','Network interface not supported :(')
513534
return
514535
dhcp_select = self.config.xmlSettings('dhcp','dhcp_server',None,False)
515536
if dhcp_select != 'dnsmasq':
@@ -595,5 +616,6 @@ def on_sys_tray_activated(self, reason):
595616
elif reason == 2:self.showMinimized()
596617

597618
def about(self):
598-
self.Fabout = frmAbout()
619+
self.Fabout = frmAbout(author,emails,
620+
version,date_create,update,license,desc)
599621
self.Fabout.show()

Core/Privilege.py

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
11
from PyQt4.QtGui import *
22
from subprocess import Popen, PIPE
33
from Core.Settings import frm_Settings
4-
from os import popen,getpid
4+
from os import popen
55
from re import search
6-
import threading
76
import getpass
8-
from time import sleep
9-
global sudo_prompt
10-
sudo_prompt = None
11-
12-
class waiter(threading.Thread):
13-
def run(self):
14-
for i in range(2):
15-
sleep(5)
16-
if sudo_prompt == None:
17-
#popen("kill -9 %i"%(getpid()))
18-
pass
197

208
class frm_privelege(QDialog):
219
def __init__(self, parent = None):
@@ -62,28 +50,19 @@ def Qui(self):
6250
self.setLayout(self.Main)
6351

6452
def function_ok(self):
65-
out = self.password_check(self.Editpassword.text())
53+
self.hide()
54+
out = self.thread(str(self.Editpassword.text()))
6655
if search("1 incorrect password attemp",out):
67-
QMessageBox.information(self, "Sudo Password check", "[sudo] password for %s: Sorry, try again."%(getpass.getuser()))
56+
QMessageBox.information(self, "Sudo Password check",
57+
"[sudo] password for %s: Sorry, try again."%(getpass.getuser()))
6858
self.show()
6959
self.Editpassword.clear()
70-
else:
71-
self.close()
72-
73-
def password_check(self,sudo_password):
74-
self.hide()
75-
self.th = threading.Thread(target=self.thread, args=(sudo_password,))
76-
self.th.daemon = True
77-
self.th.start()
78-
waiter().start()
79-
self.th.join()
80-
return sudo_prompt
60+
return
61+
self.close()
8162

8263
def thread(self,sudo_password):
8364
popen("sudo -k")
84-
sudo_password = self.Editpassword.text()
85-
command = 'python functions.py'.split()
86-
p = Popen(['sudo', '-S'] + command, stdin=PIPE, stderr=PIPE,
87-
universal_newlines=True)
88-
global sudo_prompt
89-
sudo_prompt = p.communicate(str(sudo_password) + '\n')[1]
65+
p = Popen(['sudo', '-S','|','ls'], stdin=PIPE, stderr=PIPE,
66+
universal_newlines=True)
67+
output = p.communicate(str(sudo_password) + '\n')[1]
68+
return output

Core/about.py

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
from PyQt4.QtGui import *
22
from Core.Settings import frm_Settings
3-
author = ' @mh4x0f P0cl4bs Team'
4-
5-
version = '0.6.3'
6-
date_create = '18/01/2015'
7-
update ='27/07/2015'
8-
license = 'MIT License (MIT)'
9-
desc = ['Framework for EvilTwin Attacks']
103
class frmAbout(QDialog):
11-
def __init__(self, parent = None):
4+
def __init__(self,author,emails,version,
5+
date_create,update,license,desc, parent = None):
126
super(frmAbout, self).__init__(parent)
7+
self.author = author
8+
self.emails = emails
9+
self.version = version
10+
self.date_create = date_create
11+
self.update = update
12+
self.license = license
13+
self.desc = desc
1314
self.setWindowTitle("About 3vilTwinAttacker")
1415
self.Main = QVBoxLayout()
1516
self.frm = QFormLayout()
@@ -33,8 +34,9 @@ def center(self):
3334
def Qui_update(self):
3435
self.form = QFormLayout(self)
3536
self.btn_exit = QPushButton("Close")
36-
self.license = QTextEdit(self)
37-
self.license.setText(
37+
self.licenseEdit = QTextEdit(self)
38+
self.licenseEdit.setFixedHeight(150)
39+
self.licenseEdit.setText(
3840
'''The MIT License (MIT)
3941
Copyright (c) 2015-2016 mh4x0f P0cL4bs Team
4042
Permission is hereby granted, free of charge, to any person obtaining a copy of
@@ -52,21 +54,21 @@ def Qui_update(self):
5254
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
5355
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.'''
5456
)
55-
ltool = QLabel('<center>3vilTwin-Attacker v%s</center>'%(version))
56-
ldesc = QLabel('<center>'+desc[0]+'</center>')
57-
lversion = QLabel('Version:'+version)
58-
lupdate = QLabel('Last Update:'+update)
59-
lautor = QLabel('author:'+author)
60-
lemail = QLabel('Emails:'+emails[0] +" | "+emails[1])
61-
licese = QLabel('License:'+license)
57+
ltool = QLabel('<center>3vilTwin-Attacker v%s</center>'%(self.version))
58+
ldesc = QLabel('<center>'+self.desc[0]+'</center>')
59+
lversion = QLabel('Version:'+self.version)
60+
lupdate = QLabel('Last Update:'+self.update)
61+
lautor = QLabel('author:'+self.author)
62+
lemail = QLabel('Emails:'+self.emails[0] +" | "+self.emails[1])
63+
licese = QLabel('License:'+self.license)
6264
self.form.addRow(ltool)
6365
self.form.addRow(ldesc)
6466
self.form.addRow(lversion)
6567
self.form.addRow(lupdate)
6668
self.form.addRow(lautor)
6769
self.form.addRow(lemail)
6870
self.form.addRow(licese)
69-
self.form.addRow(self.license)
71+
self.form.addRow(self.licenseEdit)
7072
self.btn_exit.clicked.connect(self.deleteLater)
7173
self.form.addRow(self.btn_exit)
7274
self.Main.addLayout(self.form)

Core/theme2.qss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ QGroupBox {
156156

157157
QGroupBox::title {
158158
subcontrol-origin: margin;
159-
subcontrol-position: top center;
160159
padding-left: 10px;
161160
padding-right: 10px;
162161
padding-top: 10px;

0 commit comments

Comments
 (0)