forked from g3tsyst3m/BriarIDS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloadBriarMenu.py
executable file
·176 lines (170 loc) · 8.69 KB
/
loadBriarMenu.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# -*- coding: utf-8 -*-
from PyQt4 import QtCore, QtGui
import os
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName(_fromUtf8("Form"))
Form.resize(436, 517)
Form.setMinimumSize(QtCore.QSize(436, 400))
Form.setMaximumSize(QtCore.QSize(454, 503))
self.gridLayout = QtGui.QGridLayout(Form)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.line_2 = QtGui.QFrame(Form)
self.line_2.setFrameShape(QtGui.QFrame.HLine)
self.line_2.setFrameShadow(QtGui.QFrame.Sunken)
self.line_2.setObjectName(_fromUtf8("line_2"))
self.gridLayout.addWidget(self.line_2, 0, 0, 1, 2)
self.label_2 = QtGui.QLabel(Form)
font = QtGui.QFont()
font.setFamily(_fromUtf8("Tempus Sans ITC"))
font.setPointSize(16)
font.setBold(True)
font.setWeight(75)
self.label_2.setFont(font)
self.label_2.setAutoFillBackground(False)
self.label_2.setStyleSheet(_fromUtf8(""))
self.label_2.setObjectName(_fromUtf8("label_2"))
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 2)
self.line = QtGui.QFrame(Form)
self.line.setFrameShape(QtGui.QFrame.HLine)
self.line.setFrameShadow(QtGui.QFrame.Sunken)
self.line.setObjectName(_fromUtf8("line"))
self.gridLayout.addWidget(self.line, 2, 0, 1, 2)
self.label = QtGui.QLabel(Form)
self.label.setText(_fromUtf8(""))
self.label.setPixmap(QtGui.QPixmap(_fromUtf8(":/newPrefix/bateman-in-the-brier-patch-crop.jpg")))
self.label.setObjectName(_fromUtf8("label"))
self.gridLayout.addWidget(self.label, 3, 0, 1, 2)
self.label_3 = QtGui.QLabel(Form)
self.label_3.setObjectName(_fromUtf8("label_3"))
self.gridLayout.addWidget(self.label_3, 4, 0, 1, 1)
self.pushButton_4 = QtGui.QPushButton(Form)
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.pushButton_4.setFont(font)
self.pushButton_4.setAutoFillBackground(True)
self.pushButton_4.setAutoDefault(False)
self.pushButton_4.setDefault(False)
self.pushButton_4.setFlat(False)
self.pushButton_4.setObjectName(_fromUtf8("pushButton_4"))
self.gridLayout.addWidget(self.pushButton_4, 8, 0, 1, 2)
self.pushButton = QtGui.QPushButton(Form)
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.pushButton.setFont(font)
self.pushButton.setAutoFillBackground(True)
self.pushButton.setAutoDefault(False)
self.pushButton.setDefault(False)
self.pushButton.setFlat(False)
self.pushButton.setObjectName(_fromUtf8("pushButton"))
self.gridLayout.addWidget(self.pushButton, 5, 0, 1, 2)
self.comboBox = QtGui.QComboBox(Form)
self.comboBox.setObjectName(_fromUtf8("comboBox"))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.comboBox.addItem(_fromUtf8(""))
self.gridLayout.addWidget(self.comboBox, 4, 1, 1, 1)
self.pushButton_2 = QtGui.QPushButton(Form)
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.pushButton_2.setFont(font)
self.pushButton_2.setAutoFillBackground(True)
self.pushButton_2.setAutoDefault(False)
self.pushButton_2.setDefault(False)
self.pushButton_2.setFlat(False)
self.pushButton_2.setObjectName(_fromUtf8("pushButton_2"))
self.gridLayout.addWidget(self.pushButton_2, 7, 0, 1, 2)
self.pushButton_5 = QtGui.QPushButton(Form)
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.pushButton_5.setFont(font)
self.pushButton_5.setAutoFillBackground(True)
self.pushButton_5.setAutoDefault(False)
self.pushButton_5.setDefault(False)
self.pushButton_5.setFlat(False)
self.pushButton_5.setObjectName(_fromUtf8("pushButton_5"))
self.gridLayout.addWidget(self.pushButton_5, 6, 0, 1, 2)
self.pushButton_3 = QtGui.QPushButton(Form)
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.pushButton_3.setFont(font)
self.pushButton_3.setAutoFillBackground(True)
self.pushButton_3.setAutoDefault(False)
self.pushButton_3.setDefault(False)
self.pushButton_3.setFlat(False)
self.pushButton_3.setObjectName(_fromUtf8("pushButton_3"))
self.gridLayout.addWidget(self.pushButton_3, 9, 0, 1, 2)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
Form.setWindowTitle(_translate("Form", "BriarIDS", None))
self.pushButton.setToolTip(_translate("Form", "This installs Suricata and also checks if Suricata is already installed", None))
self.pushButton.setText(_translate("Form", "Install Suricata", None))
self.pushButton.clicked.connect(self.install)
self.label_2.setText(_translate("Form", "<html><head/><body><p><span style=\" font-size:10pt; color:#0055ff;\">Welcome to BriarIDS - designed for the Raspberry Pi</span></p></body></html>", None))
self.pushButton_2.setToolTip(_translate("Form", "This starts the Suricata IDS engine and displays log alerts in the terminal", None))
self.pushButton_2.setText(_translate("Form", "Run Suricata", None))
self.pushButton_2.clicked.connect(self.runtheprog)
self.pushButton_3.setToolTip(_translate("Form", "This checks for most recent updates...", None))
self.pushButton_3.setText(_translate("Form", "Check for Updates from GitHub", None))
self.pushButton_3.clicked.connect(self.updatecheck)
self.pushButton_4.setToolTip(_translate("Form", "Add in your public/WAN IP", None))
self.pushButton_4.setText(_translate("Form", "Add WAN IP to config for monitoring", None))
self.pushButton_5.setToolTip(_translate("Form", "This installs Bro and the Critical Stack Intel Feed client", None))
self.pushButton_5.setText(_translate("Form", "Install Bro-2.5 and Intel Feed Agent", None))
self.pushButton_5.clicked.connect(self.brointelinstall)
self.pushButton_4.clicked.connect(self.configcheck)
self.comboBox.setItemText(0, _translate("Form", "eth0", None))
self.comboBox.setItemText(1, _translate("Form", "eth1", None))
self.comboBox.setItemText(2, _translate("Form", "eth2", None))
self.comboBox.setItemText(3, _translate("Form", "eth3", None))
self.comboBox.setItemText(4, _translate("Form", "eth4", None))
self.comboBox.setItemText(5, _translate("Form", "wlan0", None))
self.comboBox.setItemText(6, _translate("Form", "wlan1", None))
self.label_3.setText(_translate("Form", "<span style='font-size:8pt'>SELECT YOUR MONITOR INTERFACE:</span>", None))
def install(self):
print ("Installation routine initializing...")
os.system("x-terminal-emulator -e './briarids-install-script.sh'")
def runtheprog(self):
monint=str(self.comboBox.currentText())
print ("Configuring interface using Ethtool...")
os.system("ethtool -K "+monint+" tx off rx off sg off gso off gro off")
print ("Note: You can view your alert logs by issuing the following command: tail -f /var/log/suricata/http.log /var/log/suricata/fast.log")
os.system("sleep 5")
print "Starting Suricata!!!"
os.system("./rulecleanup.sh")
mycommand='/opt/suricata/bin/suricata -c /opt/suricata/etc/suricata/suricata.yaml --af-packet='+monint
os.system("x-terminal-emulator -e "+mycommand)
def configcheck(self):
os.system("./configcheck.sh")
def brointelinstall(self):
os.system("./bro-installer.sh")
def updatecheck(self):
os.system("./updatecheck.sh")
import main_rc