Skip to content

Instantly share code, notes, and snippets.

@fuomag9
Created June 25, 2019 11:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fuomag9/2744008bf4bd8c6717e58b2a11118688 to your computer and use it in GitHub Desktop.
Save fuomag9/2744008bf4bd8c6717e58b2a11118688 to your computer and use it in GitHub Desktop.
powershell autosubdomain
$domain_path="D:\fuomag9\Documents\hacking\results\$domain\"
$domain_txt_1="$domain"+"_1.txt"
$domain_txt_2="$domain"+"_2.txt"
$domain_txt_3="$domain"+"_3.txt"
$domain_result="$domain"+"_result.txt"
$domain_result_temp="$domain"+"_result_temp.txt"
$domain_txt_1_path="$domain_path\$domain_txt_1"
$domain_txt_2_path="$domain_path\$domain_txt_2"
$domain_txt_3_path="$domain_path\$domain_txt_3"
$domain_result_temp_path="$domain_path\$domain_result_temp"
$domain_result_path="$domain_path\$domain_result"
New-Item -ItemType "directory" -Path "$domain_path" -ErrorAction SilentlyContinue
python "D:\fuomag9\Documents\hacking\Sublist3r\sublist3r.py" -d $domain -o "$domain_txt_1_path"
."D:\fuomag9\Documents\hacking\amass\amass.exe" enum -active -brute -o "$domain_txt_2_path" -d $domain
."D:\fuomag9\Documents\hacking\subfinder\subfinder.exe" -d $domain -o "$domain_txt_3_path"
Get-Content "$domain_txt_1_path" , "$domain_txt_2_path" | Sort-Object | Get-Unique > "$domain_result_temp_path"
Get-Content "$domain_result_temp_path" , "$domain_txt_3_path" | Sort-Object | Get-Unique > "$domain_result_path"
Remove-Item -Path "$domain_txt_1_path" -Force
Remove-Item -Path "$domain_txt_2_path" -Force
Remove-Item -Path "$domain_txt_3_path" -Force
Remove-Item -Path "$domain_result_temp_path" -Force
(Get-Content "$domain_result_path" | Select-Object -Skip 1) | Set-Content "$domain_result_path"
."D:\fuomag9\Documents\hacking\subjack\subjack.exe" -w "$domain_result_path" -t 20 -o "$domain_path\$($domain)_subdomain_takeover.txt" -a -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment