Skip to content

Commit

Permalink
crash message box
Browse files Browse the repository at this point in the history
  • Loading branch information
dnsdudrla97 committed Dec 6, 2020
1 parent 3ea18c5 commit 99b0d4f
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 49 deletions.
2 changes: 1 addition & 1 deletion src/.esp.log
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ESP: 0019ff28 ( 1703720) -> 2@@PP,@L@8@@tP,@Ll)CuP,CuuCwP,MP,@aDwquCwJsEw;Dw@P,Actx 2 (stack)
ESP: 0019ff28 ( 1703720) -> 2@@P ;@r7@8@@t ;@r7l)Cu ;CuuCw ;h` ;@aDwC<uCw0sEw;Dw@ ;Actx 2 (stack)

Empty file added src/_test_.txt
Empty file.
14 changes: 7 additions & 7 deletions src/crashAllInfo.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
0x00d832c5 xchg [eax],eax from thread 16800 caused access violation
0x00d832c5 xchg [eax],eax from thread 26552 caused access violation
when attempting to write to 0x00000000

CONTEXT DUMP
EIP: 00d832c5 xchg [eax],eax
EAX: 00000000 ( 0) -> N/A
EBX: 002c5000 ( 2904064) -> @]Owx(@[Owpv0]OwP(pm @HOw3OwaJ? (heap)
ECX: c44cb0bc (3293360316) -> N/A
EBX: 003b2000 ( 3874816) -> @]Owx(@[Owpv0]OwP(pm @HOw3OwaJ? (heap)
ECX: 3772be1e ( 930266654) -> N/A
EDX: 00401000 ( 4198400) -> N/A
EDI: 00401000 ( 4198400) -> N/A
ESI: 00401000 ( 4198400) -> N/A
EBP: 00d80ef4 ( 14159604) -> N/A
ESP: 0019ff28 ( 1703720) -> 2@@PP,@L@8@@tP,@Ll)CuP,CuuCwP,MP,@aDwquCwJsEw;Dw@P,Actx 2 (stack)
+00: 0019ffcc ( 1703884) -> DwquCwJsEw;Dw@P,Actx 2 4|N&DTq24J6[IY-22B,0_P8\^VD( (stack)
ESP: 0019ff28 ( 1703720) -> 2@@P ;@r7@8@@t ;@r7l)Cu ;CuuCw ;h` ;@aDwC<uCw0sEw;Dw@ ;Actx 2 (stack)
+00: 0019ffcc ( 1703884) -> DwC<uCw0sEw;Dw@ ;Actx 2 4|N&DTq24J6[IY-22B,0_P8\^VD( (stack)
+04: 00d832d3 ( 14168787) -> N/A
+08: 00401000 ( 4198400) -> N/A
+0c: 00401000 ( 4198400) -> N/A
+10: 00d80ef4 ( 14159604) -> N/A
+14: 0019ff50 ( 1703760) -> 8@@tP,@Ll)CuP,CuuCwP,MP,@aDwquCwJsEw;Dw@P,Actx 2 4| (stack)
+14: 0019ff50 ( 1703760) -> 8@@t ;@r7l)Cu ;CuuCw ;h` ;@aDwC<uCw0sEw;Dw@ ;Actx 2 4| (stack)

disasm around:
0x00d832ae push eax
Expand All @@ -34,5 +34,5 @@ disasm around:
SEH unwind:
0019ffcc -> 00d832d3: push ebp
0019ffe4 -> 77449990: mov edi,edi
ffffffff -> 7745734a: nop
ffffffff -> 77457330: nop

96 changes: 55 additions & 41 deletions src/fuzz_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ def __init__(self):
self.programPath = ''
self.samplePath = ''
self.step = 0
self.check = 0
# mainwindow btn slot
self.btn_main_1.clicked.connect(self.openProgramPath)
self.btn_main_2.clicked.connect(self.openSamplePath)
Expand All @@ -391,30 +392,23 @@ def openCrashFile(self):
try:
with open('crashAllInfo.txt', 'r') as f:
self.textBrowser_2.append(f.read())
self.crashMessageBox()
except:
self.textBrowser_2.append("not crash")
# continue

try:
with open('.esp.log', 'r') as f:
self.textBrowser.append(f.read())
except:
self.textBrowser.append("is input?")
# continue

time.sleep(3)

# add step is the vuln detected before 'crashAllInfo file into the emtpy comapre so alert!!""
# event
if self.step == 10:
self.showdialog()

if self.step >= 100:
print("FIN")
# message BOx GO?


self.step += 1
self.progressBar.setValue(self.step)
else:
self.step += 1
self.progressBar.setValue(self.step)

# next stacked -> stack thread (0)
def enterData(self):
Expand All @@ -423,47 +417,67 @@ def enterData(self):
1. file_fuzzer class instance
2. openCrashFile
'''
# You did not write down the file path. (break)
if 0 == len(self.programPath) & 0 == len(self.samplePath):
self.doPathMessageBox() #
return
else:
# print(self.programPath)
# print(self.samplePath)
fuzzer = file_fuzzer(str(self.programPath), str(self.samplePath))
self.stacked.setCurrentIndex(1)

nextStackThread = threading.Thread(target=fuzzer.fuzz)
nextStackThread.setDaemon(1) #True is Program exit together
nextStackThread.start()

# textBrowser_2 testing file save to load
openCrashFileThread = threading.Thread(target=self.openCrashFile)
openCrashFileThread.setDaemon(0)
openCrashFileThread.start()


# translation sub layout
print("Loading next Stacked")
# fuzzing class (file_fuzzer)

fuzzer = file_fuzzer(str(self.programPath), str(self.samplePath))
self.stacked.setCurrentIndex(1)

nextStackThread = threading.Thread(target=fuzzer.fuzz)
nextStackThread.setDaemon(1) #True is Program exit together
nextStackThread.start()

# textBrowser_2 testing file save to load
openCrashFileThread = threading.Thread(target=self.openCrashFile)
openCrashFileThread.setDaemon(0)
openCrashFileThread.start()

# message box ok
def msgbtn(self):
print "Button pressed is:"

# messagebox
def showdialog(self):
msg = QMessageBox()
msg.setIcon(QMessageBox.Information)
msg.setText("CRASH DETECTED")
msg.setInformativeText("")
msg.setWindowTitle("CRASH DETECTED")
# crash messagebox
def crashMessageBox(self):
crashMsg = QMessageBox()
crashMsg.setIcon(QMessageBox.Information)
crashMsg.setText("CRASH DETECTED")
crashMsg.setInformativeText("")
crashMsg.setWindowTitle("CRASH DETECTED")

try:
with open(".hash.log", 'r') as f:
msg.setDetailedText(f.read())
crashMsg.setDetailedText(f.read())
except:
msg.setDetailedText("NOT CRASH")
crashMsg.setDetailedText("NOT CRASH")

# msg.setDetailedText("MD5 %s" % CRASH_HASH)
msg.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel)
msg.buttonClicked.connect(self.msgbtn)
# crashMsg.setDetailedText("MD5 %s" % CRASH_HASH)
crashMsg.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel)
crashMsg.buttonClicked.connect(self.msgbtn)

retval = msg.exec_()
retval = crashMsg.exec_()
print "value of pressed message box button:", retval

def msgbtn(self):
print "Button pressed is:"


# not push file path messagebox
def doPathMessageBox(self):
msg = QMessageBox()
msg.setIcon(QMessageBox.Critical)
msg.setText("FILE PATH")
msg.setWindowTitle("INPUT FILE PATH")

# msg.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel)
msg.buttonClicked.connect(self.msgbtn)
retval = msg.exec_()
print "value of pressed message box button:", retval



def main():
Expand Down
Binary file added src/test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/test.txt
Binary file not shown.

0 comments on commit 99b0d4f

Please sign in to comment.