Sunday, March 4, 2018

Wifi passive site survey using Ekahau



This video describes the process of mapping wifi coverage of an exisiting wifi deployment. Wifi data is collected by listening to beacons, since the software only passively listen to wifi transmissions this is called a passive survey. Ekahau software is the tool that was used for this video, there are other product which has a similar functionality.





Tuesday, February 27, 2018

[WinError 10054] An existing connection was forcibly closed by the remote host

I got this error when I was working on a Python script which use telnet to execute some show commands in Cisco 3650 and Cisco 2960 switches. Strangely I only got this error with Cisco 3650 (16.3.5b) switches.

[WinError 10054] An existing connection was forcibly closed by the remote host 


I was in a rush to get the script working and the work around below fixed the issue. 


1) The most useful method troubleshoot this was enabling debug in telnetlib

telnet = telnetlib.Telnet(ipOfRouterf)
telnet.set_debuglevel(1000)


2) Looking at the output with debugging on, it looked like that this issues is caused by the "exit" command in Cisco CLI.

cmd1 = 'show snmp location'

telnet = telnetlib.Telnet(ipOfRouterf)

telnet.set_debuglevel(1000)

telnet.read_until(b"Username: ",3)

telnet.write(user.encode('ascii') + b"\r\n")

telnet.read_until(b"Password: ",3)

telnet.write(password.encode('ascii') + b"\r\n")

telnet.write(cmd1.encode('ascii')+b"\r\n")

telnet.write(b"exit\r\n")

cmdOUT1 = telnet.read_all().decode('ascii')

print(cmdOUT1)


3) The work around I applied was to remove "exit" ,  enter a command that is invalid but unique so that telnet.read_until('testtest1234') can find it and then use telnet.close() instead of "exit"


cmd1 = 'show cdp neighbor'
cmd2 = 'show snmp location'

telnet = telnetlib.Telnet(ipOfRouterf,timeout = 3)
telnet.set_debuglevel(1000)
  
telnet.read_until(b"Username: ",3)

telnet.write(user.encode('ascii') + b"\r\n")
  
telnet.read_until(b"Password: ",3)
 
telnet.write(password.encode('ascii') + b"\r\n")
  
telnet.write(b"\r\n")
telnet.write(b"\r\n")
telnet.write(cmd1.encode('ascii')+b"\r\n")
telnet.write(b"\r\n")
telnet.write(cmd2.encode('ascii')+b"\r\n")
telnet.write(b"\r\n")
  
telnet.write(b"testtest1234\r\n")
  
cmdOUT1 = telnet.read_until(b"testtest1234").decode('ascii')

telnet.close()

print(cmdOUT1)





Sunday, February 11, 2018

Screen record in Windows using PowerPoint

In Mac OS you can screen record easily using quick time, but in Windows I have been struggling to find a way to do the same. Then I came across this function in PowerPoint. You can use this to screen record and voice over. check the screenshots below.

Windows 10 64bit
MS office professional plus 2016

1) Go to Insert --> Screen Record 


2. Click record . And Windows key + shift  + Q to stop recording




3) Once you stop recording the recorded video will appear as an embedded video in the ppt slide. Right click on the video and save it on to your desktop as a mp4 file.




Thursday, December 14, 2017

Show cisco 2950 switch info from rommon mode

This is how to show the MAC and serial number while you are in rommon mode of Cisco 2950 switch:


switch: flash_init


switch: more flash:env_vars

BOOT=flash:c2950-i6k2l2q4-mz.121-22.EA13.bin
MAC_ADDR=00:0B:FD:60:C0:40
MODEL_NUM=WS-C2950C-24
MODEL_REVISION_NUM=G0
MOTHERBOARD_ASSEMBLY_NUM=73-5710-11
MOTHERBOARD_REVISION_NUM=A0
MOTHERBOARD_SERIAL_NUM=FO1170307Z7
POWER_SUPPLY_PART_NUM=34-091165-01
POWER_SUPPLY_SERIAL_NUM=PHI0648051JE
SYSTEM_SERIAL_NUM=FOC07013AZ0N1

switch:

Thursday, November 30, 2017

SSH to Cisco WLC using Python (3.6) - simple example

import paramiko
import netmiko
from netmiko import ConnectHandler

host = "IP address"
user = "admin"
pw = "xxxxxxx"
platform = "cisco_wlc"


device = ConnectHandler(device_type=platform, ip=host, username=user, password=pw)


output = device.send_command('show wlan 1')

print(output)


device.disconnect()

Tuesday, October 31, 2017

Cisco AP power level 1 in UNII-1 and Level 4 in UNII-3

I was testing two Cisco 3602e access points. In The RF profile I had set min and max power to be 14dBm. Therefore I would expect the RRM will set the same power level in both APs



But when I checked the two APs one has power level 4 and the other has power level 1



Then I checked the output of command "show advanced 802.11a txpower". The output below explains why the two APs show two different power level. Because one is using an UNII-1 channel and the other is using a UNI-3 channel.





Tuesday, October 24, 2017

Set time zone in Cisco ISE 2.3

Cisco ISE has a CLI interface very similar to Cisco IOS.

1) SSH in to ISE 

2) show time zones 


ise-1/admin# show timezones

Australia/NSW
Australia/North
Australia/Perth
Australia/Queensland
Australia/South
Australia/Sydney



3) Set the time zone

ise-1/admin(config)# clock timezone Australia/Sydney

% On ise distributed deployments, it is recommended all nodes be
% configured with the same time zone.
Continue with time zone change?  Y/N [N]: y
System timezone was modified. You must restart ISE for change to take effect.
Do you want to restart ISE now? (yes/no) no

ise-1/admin(config)#
ise-1/admin(config)# end
ise-1/admin#
ise-1/admin# show clock
Tue Oct 24 20:47:09 AEDT 2017