Skip to content

Commit 5d4a4d3

Browse files
committed
add filtersResultWithStringOnBodyResponse.py
Signed-off-by: Timothée Ruffenach <timruff@gmx.com>
1 parent 13e3e33 commit 5d4a4d3

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# @author Timothée Ruffenach
2+
# Version 1.0
3+
# filters the fuzzing result with a string.
4+
5+
from javax.swing import JOptionPane
6+
7+
8+
# global variable
9+
init = False
10+
entry = ""
11+
isCheck = False
12+
13+
# Called after injecting the payloads and before forward the message to the server.
14+
def processMessage(utils, message) :
15+
global number,payloads
16+
if not init:
17+
initialise()
18+
19+
20+
def initialise():
21+
global init,entry,isCheck
22+
23+
entry = ""
24+
25+
# ask stings to find
26+
while entry == "":
27+
entry = getString("what character string do you want to find ?")
28+
if entry == "":
29+
JOptionPane.showMessageDialog(None, "Empty string","Waring", JOptionPane.WARNING_MESSAGE)
30+
# ask reverse message
31+
isCheck = JOptionPane.showConfirmDialog(None, "Reverse", "Confim", JOptionPane.YES_NO_OPTION)
32+
33+
34+
init = True
35+
36+
# Called after receiving the fuzzed message from the server
37+
def processResult(utils, fuzzResult) :
38+
global entry,isCheck
39+
body = fuzzResult.getHttpMessage().getResponseBody().toString()
40+
41+
# test all posibility
42+
if isCheck == JOptionPane.NO_OPTION and entry in body:
43+
return bool(1);
44+
elif isCheck == JOptionPane.YES_OPTION and entry in body:
45+
return bool(1);
46+
else:
47+
return bool(0);
48+
49+
# Question
50+
def getString(question):
51+
stringInput = JOptionPane.showInputDialog(None, question, "Input", JOptionPane.QUESTION_MESSAGE)
52+
return stringInput

0 commit comments

Comments
 (0)