Skip to main content

Posts

Showing posts with the label Cisco Journey

PowerShell Port Scanning one liner - check range of port

Netcat is one of the best tools to check if port is open or not, and Netcat does offer also a lot of features other than port scanning. However, if netcat is not available on the system or it's not allowed to be installed. In Windows environment PowerShell will come in handy. Example one-liner code below uses PowerShell to scan a specified Target IP and also a range of ports to be scanned. To test the code, change the target IP as desired and also the range of port to be tested.  1..65535 | % {Test-NetConnection  127.0.0.1-Port $_ } 442..443 | % {Test-NetConnection  8.8.8.8 -Port $_ } Sample Output of the above commands:  1..10 | % {Test-NetConnection  127.0.0.1-Port $_ } 442..443 | % {Test-NetConnection  8.8.8.8 -Port $_ } Cheers! Take care. Till next Time. Enjoy exploring the world of PowerShell and enjoy the journey of learning.. Stay safe! and Keep things up!  Do ASAP,  A lways  S ay  A   P rayer ... Practice O.T.G. =  O be...

Cisco block telnet and SSH access

Block telnet and SSH access to the Cisco router. The user must have the privilege to change the settings or basically the admin user account. Block all (telnet and ssh):   line vty 0 4   transport input none sh startup-config (save config and will persist after reboot or shutdown) sh running-config (config is save but will not persist after reboot or shutdown) To enable or unblock: line vty 0 4  privilege level 15  login local  line vty 0 4 transport input telnet ssh Before rolling out to production be sure to test it out or else you will leave a vulnerability in your network. Cheers..till next time! ================================ Free Android Apps: Click on  links  below to find out more: Multiplication Table for early learners https://play.google.com/store/apps/details?id=com.TableMultiplication Catholic Rosary Guide  for Android: Pray the Rosary ...

PowerShell Get IP Address and Subnet mask

 Get IP Address, MAC Address and Subnet mask. It also displays the CIDR (Classless InterDomain Routing) notation. Here's the script:  ====================================== $nic_configuration = gwmi -computer .  -class "win32_networkadapterconfiguration" | Where-Object {$_.defaultIPGateway -ne $null} $IP = $nic_configuration.ipaddress write-output " IP Address : $IP" $MAC_Address = $nic_configuration.MACAddress write-output " MAC Address :  $MAC_Address" $SubnetMask = $nic_configuration.ipsubnet switch ($SubnetMask) { 255.255.255.255   {" Subnet mask is: 255.255.255.255 or /32 "} 255.255.255.254   {" Subnet mask is: 255.255.255.254  or   /31 "} 255.255.255.252   {" Subnet mask is:  255.255.255.252 or   /30 "} 255.255.255.248   {" Subnet mask is: 255.255.255.248 or  /29 "} 255.255.255.240   {" Subnet mask is:   255.255.255.240   or   /28"} ...

Wireless or Wi-Fi not working

Wireless connection or Wi-Fi connection gives easy convenience for moving Laptop computers inside the house or even in the office without losing internet connection. If there are two or more Laptop computers and one of them is not able to connect to the internet or wireless connection, then for this kind of scenario the wireless router is working properly. Since other Laptop computers is able to connect to the Internet or Wi-Fi connection. But if all of the wireless devices or laptop computers are not able to connect to the internet then it can be roll out that the router itself is having issues. Troubleshooting wireless router is beyond the scope of this topic. How to check or troubleshoot wireless connection issues? Windows has a built-in wizard that will help to troubleshoot or check wireless issues. A basic step to troubleshoot Wi-Fi or wireless connection if not working is to check: - check if the wireless driver is installed properly or check whether the wireless ...

Check for open ports in Windows

How to check which ports are open? How to check the ports that a particular application is using? Questions that will pop up when things go wrong, when an application does not work as expected. When replication does not work, or access denied error occurs. Or when an error occurs that states, a particular port is in use. Like, Port 80 is in use. Of course the error, just gives an idea that a port is in use by another application or program but does not explicitly tells that which specific application or program is using the port. This is where troubleshooting is necessary. An example below is given. One scenario that I can think of is when setting up Active Directory replication; whether in the real world, or in a test lab environment. Or even simply a port forwarding scenario on web hosting, CCTV installation or other setup,  if it doesn’t work would require troubleshooting or to check whether ports are open, ports are listening or not. Netstat com...

IPV4 Address - Subnetting Tutorial

IPV4 Address IPV4 Address is 32bit. IPV4 has public and private IP Address. Public IP Addresses is routable over the internet. Private IP Addresses as it names implies is private,  which is basically for private use and is not routable over the internet. Use by private companies or private individuals. Logically, private IP just goes with the saying. What happens in LA stays in LA. Likewise a private IP Address if it use at home then that IP Address stays at home. It won’t even go out to the neighbor, unless you have a Wifi and the neighbor crack your Wifi or wireless password, then that’s an exemption. Private IP Address Classes and Range Class A 10.0.0.0 – 10.255.255.255 Class B 172.16.0.0 – 172.31.255.255 Class C 192.168.0.0 – 192.168.255.255 IPV4 is 32 bit or four octets, each octet  is separated by dot or period. Example of an IPV4 Address, if you count the number of x it’s  32 x’es. ...