diff --git a/guild2.py b/guild2.py index 98874f7..431b963 100644 --- a/guild2.py +++ b/guild2.py @@ -190,23 +190,19 @@ async def on_message(message): if output.split("\n")[1][:6] == "Failed": mess = await message.reply(embed=guilded.Embed(title=":sweebot-fail: Command Failed!",description="Nmap failed to resolve the domain!")) else: - if len(output.split("\n")) < 8: - mess = await message.reply(embed=guilded.Embed(title=":sweebot-unknown:",description="Nmap ran successfully, but the output is smaller than usual.")) - else: - ending = False - for i, j in enumerate(output.split("\n")): - if not ending: - if j[:4] == "PORT": - ending = True - pass + ending = False + for i, j in enumerate(output.split("\n")): + if not ending: + if j[:4] == "PORT": + ending = True + pass + else: + temp = (re.sub(' +', ' ', j)).split(" ") + print(temp) + if j != "": + ports.append(("🟢 " if temp[1] == "open" else "🔴 ") + temp[0] + " (" + temp[2] + ")") else: - temp = (re.sub(' +', ' ', j)).split(" ") - print(temp) - if j != "": - ports.append(("🟢 " if temp[1] == "open" else "🔴 ") + temp[0] + " (" + temp[2] + ")") - else: - break - + break mess = await message.reply(embed=guilded.Embed(title=":sweebot-success: Found " + str(len(ports)) +" ports",description="\n".join(ports))) print("[" + GREEN + "OK" + RESET + "] '$nmap' executed successfully.") else: