Skip to content

Commit

Permalink
URL-encode usernames
Browse files Browse the repository at this point in the history
Fixes false "found!" from bad post requests when usernames with spaces are used by URL-encoding usernames too.
  • Loading branch information
the-emmon authored May 11, 2021
1 parent bed7dfc commit aa7439d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ettubrute.nim
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ proc main(loginURL:string,tokenName:string,postData:string,uname:string,pword:st
page2 = split($fetch.headers, "\"set-cookie\": @[\"")[1]
cookie = split(page2, "; ")[0]
var
inputData = postData.replace("^USER^", uname).replace("^PASS^", encodeUrl(pword)) & "&" & tokenName & "=" & token
inputData = postData.replace("^USER^", encodeUrl(uname)).replace("^PASS^", encodeUrl(pword)) & "&" & tokenName & "=" & token
cookieHeader = newHttpHeaders({"Cookie": cookie})
response = http.request(loginURL & "?" & inputData, httpMethod = HttpPost, headers = cookieHeader) # Try password
echo(" --> " & pword)
Expand Down

0 comments on commit aa7439d

Please sign in to comment.