eric-conrad / digestive Goto Github PK
View Code? Open in Web Editor NEWDictionary cracking tool for HTTP Digest challenge/response hashes
License: GNU General Public License v3.0
Dictionary cracking tool for HTTP Digest challenge/response hashes
License: GNU General Public License v3.0
Hi
I've tried the tool as part of the SANS542 training, during an exercise I noticed that the expected results was failing.
Basically no password was identified. After several test I figure out that if I leave the "/" char at the end of the "--uri" parameter the pw is not found .
so this works (/digest)
digestive --wordlist /opt/john/run/password.lst --username trillian --realm Security542 --uri /digest --qop auth --nc 00000001 --method GET --nonce y55hehYCBgA=b5e1e35bb64d45ffb508c61209d7f4970a6457c1 --response 690cc7fc7db3634475efe8a4e12646cf --cnonce 5da2ec5e8eebb9b1
this does not work (/digest/)
digestive --wordlist /opt/john/run/password.lst --username trillian --realm Security542 --uri /digest/ --qop auth --nc 00000001 --method GET --nonce y55hehYCBgA=b5e1e35bb64d45ffb508c61209d7f4970a6457c1 --response 690cc7fc7db3634475efe8a4e12646cf --cnonce 5da2ec5e8eebb9b1
but using your example in github works fine with the "/" at the end of digest...
what am I doing wrong ?
Thanks for helping
I don't want to create a Fork, so here is the Code for Python3. Just create a file named "digestive", paste this code in the file and use the same syntax as described in the README.
#!/usr/bin/python
# Eric Conrad (@eric_conrad)
# Modifyed for Python3 by Inflac
#
# Code based on: https://gist.github.com/yesecurity/5fb47f44e289e8bc9c35
# Thank you, yessecurity!
# https://gist.github.com/yesecurity
#
# Launches dictionary attack vs captured HTTP Digest credentials (taken from
# a PCAP, Burp or ZAP proxy, etc.)
#
# Example credentials:
#
# Authorization: Digest username="conrad", realm="Security542", nonce="es3UMKyKBQA=14c0d9850599ab3d69ad238ae68e7ca167ced5a2", uri="/digest/", algorithm=MD5, response="f4be8f052a172cce14d8c4ab2340f25c", qop=auth, nc=00000001, cnonce="90755b083034b34a"
#
# Resulting commandline:
#
# ./digest.py --username conrad --wordlist /opt/john/run/password.lst --method GET --uri /digest/ --nc 00000001 --qop auth --realm Security542 --cnonce 90755b083034b34a --nonce es3UMKyKBQA=14c0d9850599ab3d69ad238ae68e7ca167ced5a2 --response f4be8f052a172cce14d8c4ab2340f25c
#
import sys,itertools,argparse
import hashlib
parser = argparse.ArgumentParser()
parser.add_argument("--username", help="Username",required=True)
parser.add_argument("--wordlist", help="Path to the wordlist",required=True)
parser.add_argument("--method", help="HTTP method,required=True")
parser.add_argument("--nonce", help="nonce",required=True)
parser.add_argument("--cnonce", help="cnonce",required=True)
parser.add_argument("--uri", help="uri",required=True)
parser.add_argument("--qop", help="qop",required=True)
parser.add_argument("--response", help="response",required=True)
parser.add_argument("--nc", help="nc",required=True)
parser.add_argument("--realm", help="realm",required=True)
args = parser.parse_args()
wordlist=args.wordlist
nonce = args.nonce
uri = args.uri
username = args.username
method = args.method
nc = args.nc
qop = args.qop
cnonce = args.cnonce
response = args.response
realm=args.realm
with open(args.wordlist,encoding="ISO-8859-1") as f:
dictionary = f.read().splitlines()
for password in dictionary:
h1 = (username+":"+realm+":"+password)
ha1 = (hashlib.md5(h1.encode('utf-8')).hexdigest())
h2 = (method+":"+uri)
ha2 = (hashlib.md5(h2.encode('utf-8')).hexdigest())
resp = (ha1+":"+nonce+":"+nc+":"+cnonce+":"+qop+":"+ha2)
response2 = (hashlib.md5(resp.encode('utf-8')).hexdigest())
if response2 == response:
print("Username = " + username)
print("Password = " + password)
break
print("no password found")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.