Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import subprocess
- import time
- import string
- import sys, paramiko
- import wifi
- from subprocess import check_output
- #time.sleep(10)
- network = ("ELUXNET")
- results = subprocess.check_output(["netsh", "wlan", "show", "network"])
- results = results.decode("ascii")
- results = results.replace("\r","")
- ls = results.split("\n")
- ls = ls[4:]
- ssids = []
- out = []
- x = 0
- while x < len(ls):
- if x % 5 == 0:
- ssids.append(ls[x])
- x += 1
- if network in ssids:
- out.append(time.asctime( time.localtime(time.time() )))
- out.append("Snoopy Access Point found")
- print(out)
- else:
- print(ssids)
- hostname = "192.168.4.1"
- password = "elux"
- command = "ls"
- username = "elux"
- port = 22
- #try:
- # client = paramiko.SSHClient()
- # client.load_system_host_keys()
- # client.set_missing_host_key_policy(paramiko.WarningPolicy)
- #
- # client.connect(hostname, port=port, username=username, password=password)
- #
- # stdin, stdout, stderr = client.exec_command(command)
- # print stdout.read(),
- #
- #finally:
- # client.close()
- def Search():
- wifilist = []
- cells = wifi.Cell.all('wlan1')
- for cell in cells:
- wifilist.append(cell)
- return wifilist
- print Search()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement