Exemple #1
0
	def valide(self, evenement):

		if self.combo.GetValue() == "TCP":
				nbr = int(self.sld.GetValue())
				port = int(self.spinctrl.GetValue())
				target = self.text.GetValue()
				if functions.tcp_attack(target, port, nbr) == 0:
					self.label.SetLabel("Done, %i packets sent" % nbr)
				else:
					self.label.SetLabel("Error running the script.\nDid you run the script as root ?")

		if self.combo.GetValue() == "My ip":
			ip = functions.get_ip()
			self.label.SetLabel("External IP: %s" % (ip))
			
		if self.combo.GetValue() == "whoami":
			user = functions.get_username()
			self.label.SetLabel(user)

		if self.combo.GetValue() == "ping":
			if current_os in os1:
				arg="-c"
			if current_os in os3:
				arg="-n"
			nbr = self.sld.GetValue()
			host = self.text.GetValue()
			out = functions.ping(host, arg, nbr)
			history_write("ping %s " % host)
			self.label.SetLabel(out)

		if self.combo.GetValue() == "history":
				self.label.SetLabel(functions.history_read)
		if self.combo.GetValue() == "del history":
			history = open('history.log', 'w')
			history.write("")
			history.close()
			self.label.SetLabel("History deleted")
		if self.combo.GetValue() == "42":
			self.label.SetLabel("The answer to life the universe and everything")
Exemple #2
0
import functions

while True:
    option = int(
        input(
            "Digite '1' para ver seu IP externo e interno, digite '2' para testar seu ping e '3' para sair.\n opção:"
        ))
    if option == 1:
        functions.ips()
    elif option == 2:
        target = input("Digite o ip ou endereço da pagina(www....)\n host:")
        times = (int(input("Digite a quantidade de pings: ")))
        functions.ping(target, times)
    else:
        break
Exemple #3
0
def ping():
    print('[{0}: PING]'.format(datetime.datetime.now(pytz.utc).isoformat()))
    functions.ping()
Exemple #4
0
def login():
    website = 'https://passport.zhihuishu.com/login?service=http://online.zhihuishu.com/onlineSchool/'
    functions.ping("online.zhihuishu.com")
    driver_actions(website)
import functions

functions.ping("8.8.8.8")