사용한 적은 가끔??? 별로 없지만 그냥 종종 사용하게 듯
import sys import hashlib import qdarkstyle from PySide.QtGui import * from PySide.QtCore import * from itertools import product class MainForm(QWidget): def __init__(self): super(MainForm, self).__init__() self.layout = QGridLayout() self.label1 = QLabel("Hash: ") self.label2 = QLabel("Table: ") self.label3 = QLabel("Rule: ") self.edit1 = QLineEdit("033bd94b1168d7e4f0d644c3c95e35bf") self.edit2 = QLineEdit("!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~") self.edit3 = QLineEdit("T@@T") self.btn = QPushButton("Start") self.btn.clicked.connect(self.start) self.combo = QComboBox() self.combo.addItem("md5") self.combo.addItem("sha1") self.combo.addItem("sha224") self.combo.addItem("sha256") self.combo.addItem("sha384") self.combo.addItem("sha512") self.viewer = QTextEdit() self.layout.addWidget(self.combo, 1, 0, 1, 2) self.layout.addWidget(self.label1, 2, 0) self.layout.addWidget(self.label2, 3, 0) self.layout.addWidget(self.label3, 4, 0) self.layout.addWidget(self.edit1, 2, 1) self.layout.addWidget(self.edit2, 3, 1) self.layout.addWidget(self.edit3, 4, 1) self.layout.addWidget(self.btn, 5, 0, 1, 2) self.layout.addWidget(self.viewer, 6, 0, 1, 2) self.setWindowTitle("Hash Brute-Force") self.resize(850, 300) self.setLayout(self.layout) self.show() def start(self): self.viewer.clear() self.viewer.append("Start...") self.viewer.append(" ") ash = self.combo.currentText() result = self.edit1.text() table = self.edit2.text() rule = self.edit3.text() num = rule.count("@") for length in range(num, num+1): to_attempt = product(table, repeat=length) for attempt in to_attempt: temp = rule for word in attempt: temp = temp.replace("@", word, 1) m = hashlib.new(ash) m.update(temp) text = m.hexdigest() if text == result: self.viewer.append("===================Success!!!===================") self.viewer.append(temp) self.viewer.append("===============================================") break else: pass self.viewer.append("End...") if __name__ == '__main__': app = QApplication(sys.argv) app.setStyleSheet(qdarkstyle.load_stylesheet()) main = MainForm() sys.exit(app.exec_())
'HACK > Source' 카테고리의 다른 글
영어단어 암기 프로그램 (7) | 2020.03.11 |
---|