Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #program to search for content containing "hidden" or "password"
- # copy and past the urls for both isihack and dmva into \burplinks.txt
- import requests
- #open file for reading containing the url links from Burp spider
- myinputfile = open ("burplinks.txt","r")
- #open a file for writing information related to passwords found in the url links.
- mypasswordfile = open("passwordtext.txt","w")
- #to do
- # - Use a for loop and readlines to read each url link from burplinks.txt.
- # - Examine the string content returned by the url for the text "password". Your program must NOT be case sensitive when searching for "password" content.
- # - If the text "password" is found in the response text, write "password found" plus the url link and password text to passwordtext.txt
- # - Use new line "\n" in your passwordtext.txt file to write the url links and content to output separate lines.
- # - fyi - The answer key solution is five lines of code inlcuding the for loop. Your solution may vary.
- ####################
- # Loop through each URL in the file
- for line in myinputfile:
- # Download the contents of the URL
- res = requests.get(line)
- # Store text and search
- response = res.text
- # Search for lower 'password' in all lower case response
- lower = response.lower()
- if lower.find('password') != -1:
- mypasswordfile.write('password found: ' + line + ' ' + response + '\'')
- #close open files
- myinputfile.close()
- mypasswordfile.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement