I frequently use the Intruder tab in Burp Suite Pro to password spray websites which use Active Directory authentication. One of the problems of using Burp Suite is that there doesn’t seem to be a way to avoid lockout when using a long password list. Frequently I don’t get a hit on valid password on the first try with Season/Year stuff like “Winter2018!” and need to run through a list of 51 common AD passwords that I have in a file. Sure, I can paste in a list of three or four passwords (depending on my client’s lockout policy), but then I have to wait X minutes and then replace those passwords with three of four more, track the time between password spray runs, etc. That’s a manual process, and I’d prefer something that I can setup and just let it run to completion.

This process is going to require the Pro version of Burp Suite because you’ll need to install an extension from the BApp store. In Burp Suite, install the “Copy As Python-Requests” extension. Next, proxy an authentication request to the website through Burp with Intercept on, and when it pauses on the request, right click and choose “Copy as requests”. If you paste the clipboard to your editor you’ll notice that each line starts with “burp0”.

In the following code, you’ll notice where I have placed those “burp0” lines. Paste them in to your code editor at the bottom, the cut/paste each line over the related line in this script. In the line that begins with “burp0_data”, you’ll need to replace the user name and password that you entered on the web page with “username” and “password” as shown below.

Once you’ve updated the script with your data copied using the “Copy As Python-Requests” extension, run it using the parameters shown in the usage variable. Although the script outputs to CSV which can be sorted based on content length (sort -k4 -n -t, output.csv) or opened and sorted with Gnumeric or Excel, an easier way to sort the response headers may be to proxy the requests through Burp Suite and sort them there. An easy way to proxy through Burp without having to modify the script is to set an environmental variable: export HTTPS_PROXY=“http://127.0.0.1:8080”

The script also prints timestamps to the screen which is useful for those times that you get blamed for locking out users. I believe in logging everything, and this has saved my reputation more than once when I was blamed for account lockouts which ended up being caused by something in the client’s environment.