So here's what I got. ( It's terrible I know) It takes one argument, which is name of domain. Runs subfinder on that, then writes result's to results.
def getSubs(command):
result = subprocess.check_output(command, shell=True, universal_newlines=True)
with open('results', 'w') as file_contents:
for i in result:
file_contents.write(i)
http_check()
getSubs(['subfinder -d' 'sys.argv[1]'])
For now I just want to see If I can open up the file to pipe each line into a new command and worry about writing it to a another file later. I commented out everything except:
def httpCheck():
with open('results', 'r') as file_to_iterate:
for scan in file_to_iterate:
p1 = subprocess.Popen([f"echo", "{scan}"], stdout=subprocess.PIPE)
p2 = subprocess.Popen(['httprobe'], stdin=p1.stdout, shell=True, stdout=subprocess.PIPE)
p1.stdout.close()
output = p2.communicate()[0]
print(output)
Which returns:
b''
b''
b''
How can I get it to print out the results? Or a reference. Also the new_file just contains three lines for now:
domain.com
another_domain.com
non-existent.com