Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add status success #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def parse_args(self):
help='String indicates fail in response text, \ne.g. -err "user not exist" "password wrong"')
detect.add_argument('-suc', metavar='SUC', default='', type=str, nargs='+',
help='String indicates success in response text, \ne.g. -suc "welcome," "admin"')
detect.add_argument('-ssuc', metavar='SSUC', default='', type=str, nargs='+',
help='String indicates success in status code, \ne.g. -ssuc "303" "404"')
detect.add_argument('-herr', metavar='HERR', default='', type=str,
help='String indicates fail in response headers')
detect.add_argument('-hsuc', metavar='HSUC', default='', type=str,
Expand Down
6 changes: 5 additions & 1 deletion lib/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def do_request(self):
conn.request(method='POST', url=self.args.path, body=data, headers=local_headers)

response = conn.getresponse(); res_headers = str(response.getheaders())
res_status = str(response.status)
_ = re.search('charset=([^"^>^\']*)', res_headers); charset = _.group(1).strip() if _ else None

html_doc = decode_response_text(response.read(), charset)
Expand Down Expand Up @@ -190,6 +191,9 @@ def do_request(self):
if (not self.args.no302 and response.status == 302):
cracked_msg = '[+]%s \t\t{302 redirect}' % data

if self.args.ssuc and res_status in self.args.ssuc:
cracked_msg = '[+]%s \t\t[Found %s in status]' % (data, self.args.ssuc)

if response.status == 200 and self.args.err and not found_err_tag:
cracked_msg = '[+]%s \t\t{%s not found}' % (data, self.args.err)

Expand Down Expand Up @@ -232,4 +236,4 @@ def do_request(self):
pass
time.sleep(3.0)

self.queue.task_done()
self.queue.task_done()