target = []: ^ IndentationError: expected an indented block after 'if' statement on line 156
Question:
Thats the code where the mistake is
if tool == ("11"):
target = []:
with open('freesec.txt','r') as f:
for line in f:
url = str(line.replace('n',''))
targets.append(url)
for url in targets:
if 'http://' in url:
url = url.replace('http://', '')
elif 'https://' in url:
url = url.replace('https://', '')
url = 'http://' + url
response = requests.get(url + "'").text
if 'error' in response and 'syntax' in response or 'MySQL' in response:
print 'Gotcha!!! ' + url
else:
print 'No luck here :( ' + url
Thats the image of my terminal when i was fixing the tool
Answers:
as per the error. You are missing the indentation.
# incorrect
if tool == ("11"):
target = []:
# correct
if tool == ("11"):
target = []:
Reason:
Python reqires indentation to recognise blocks of code.
Thats the code where the mistake is
if tool == ("11"):
target = []:
with open('freesec.txt','r') as f:
for line in f:
url = str(line.replace('n',''))
targets.append(url)
for url in targets:
if 'http://' in url:
url = url.replace('http://', '')
elif 'https://' in url:
url = url.replace('https://', '')
url = 'http://' + url
response = requests.get(url + "'").text
if 'error' in response and 'syntax' in response or 'MySQL' in response:
print 'Gotcha!!! ' + url
else:
print 'No luck here :( ' + url
Thats the image of my terminal when i was fixing the tool
as per the error. You are missing the indentation.
# incorrect
if tool == ("11"):
target = []:
# correct
if tool == ("11"):
target = []:
Reason:
Python reqires indentation to recognise blocks of code.