hi i need a python script for this steps: 1. give a wordlist file path from user 2. send…
- User
hi i need a python script for this steps:
- give a wordlist file path from user
- send request to https://kent.com/domain/{{wordlist item's perline}}
- save output as txt with name's in wordlist file
- Assistant
Here's a Python script to perform the steps you mentioned:
pythonimport requests import os def main(): # Get the wordlist file path from the user wordlist_file = input("Enter the path to the wordlist file: ") # Ensure the file exists if not os.path.exists(wordlist_file): print("The specified file does not exist.") return # Read the wordlist contents with open(wordlist_file, 'r') as f: words = [word.strip() for word in f.readlines()] # Iterate through each word in the wordlist for word in words: # Send a request to the specified URL url = f"https://kent.com/domain/{word}" response = requests.get(url) # Save the output to a text file named after the word output_file = f"{word}.txt" with open(output_file, 'w') as f: f.write(response.text) print(f"Output for {word} saved as {output_file}") if __name__ == "__main__": main() - User
hi i need a script for run this idea: in result response of this target: "https://xxxx.net/search?scope=leak&q=%2Bevents.leak.severity%3A%22critical" , find Domain's and save line per Domain in one file with txt format
- Assistant
To achieve this, you can use the
requestslibrary to send the request and theBeautifulSouplibrary to parse the HTML response and extract the domain names. Here's the script:python
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.