-
-
Save g4rcez/b92e6eb4c9eeb3df60750aa476050cd7 to your computer and use it in GitHub Desktop.
SiteWatcher for KurupiraOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# Agradecimentos a BiggsCoder | |
# Dev by: @vandalvnl | |
import sys, os, platform | |
class OS(): | |
sistema = platform.system() | |
hostname = platform.node() | |
def basename(stdin): | |
return Stdin.array2String(stdin).split('/')[-1] | |
class Stdin(): | |
def getOptAndValue(stdin, parametros): | |
try: | |
for flag in stdin: | |
if flag in parametros: | |
return stdin[stdin.index(flag) + 1] | |
except: | |
return None | |
def getOpt(stdin, parametros): | |
try: | |
for flag in stdin: | |
if flag in parametros: | |
return True | |
except: | |
return False | |
try: | |
import requests | |
except: | |
print ("Deseja instalar a biblioteca requests? [Y/n]") | |
vaiInstalar = input() | |
if vaiInstalar in ('Y', 'y', 's', 'S'): | |
os.system("sudo pip3 install requests") | |
else: | |
exit() | |
namescript = sys.argv[0] | |
stdin = sys.argv[1:] | |
try: | |
namescript = namescript.split('/')[1] | |
except: | |
pass | |
site = '' | |
if Stdin.getOpt(stdin, '-t'): | |
site = Stdin.getOptAndValue(stdin, '-t') | |
elif Stdin.getOpt(stdin, '--target'): | |
site = Stdin.getOptAndValue(stdin, '--target') | |
else: | |
site = input('Por favor, informe um site para a análise: ') | |
print("Scan no site: " + site) | |
try: | |
link = site | |
argumento = 'robots.txt' | |
requisicao = requests.get(link+argumento) | |
resposta = requisicao.status_code | |
if resposta == 200: | |
print("[Online] => " + link + argumento) | |
except: | |
print("O site está offline ou não foi encontrado") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment