Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
timjsmith24 committed Nov 9, 2021
1 parent 11f32ca commit 156c373
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions APs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
192.168.10.7
1 change: 1 addition & 0 deletions cmd.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
show capwap client
16 changes: 9 additions & 7 deletions wing5Blaster.py → hiveosBlaster.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

# Device Credentials
user = 'admin'
passwd = 'c0bra42b'
passwd = 'Extreme123!'

if not os.path.isdir(PATH+'/log'):
os.makedirs(PATH+'/log')
Expand Down Expand Up @@ -57,14 +57,11 @@ def ap_ssh(ip,cmds, device, mp_queue):
outputs = []
time.sleep(1)
resp = chan.recv(9999)
chan.send('enable\n')
chan.send('console page 0\n')
time.sleep(1)
resp = chan.recv(9999)
lines = resp.splitlines()
apname = lines[-1][:-1]
chan.send('no page\n')
time.sleep(1)
resp = chan.recv(9999)

for cmd in cmds:
sys.stdout.flush()
Expand Down Expand Up @@ -107,8 +104,13 @@ def main():
continue
else:
ip = device
dns = socket.gethostbyaddr(ip)
device = dns[0]
try:
dns = socket.gethostbyaddr(ip)
device = dns[0]
print("DNS for {} is {}".format(ip, device))
except:
print("The DNS for {} was not found".format(ip))

try:
print("connecting to", device)
socket.inet_aton(ip)
Expand Down
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Wing 5 Blaster
## wing5Blaster.py
# Hive OS Blaster
## hiveOSBlaster.py
### Purpose
This script with take a list of device IP Addresses or DNS names and a list of commands. An ssh session will be opened with each device and then run each of the commands in the command list. A log file will be created in a log directory for each device and the responses for each of the commands will be appended to the file.

Expand All @@ -25,7 +25,7 @@ ap-100.log
#### entering the device and cmd files
When running the script from terminal after entering the script name add the name of the device file and then the name of the command file
```
./wing5Blaster.py APs.txt cmd.txt
./hiveOSBlaster.py APs.txt cmd.txt
```

### Requirements
Expand Down

0 comments on commit 156c373

Please sign in to comment.