Only the educated are free...
Blacklabs Security Tutorials
  • About Me...
  • Site Disclaimer

Minicom Demonstration

Link to Homepage

HARDWARE
Switch OR Router (Password Protected)
Rollover Cable
Laptop w/ Serial Port OR USB to Serial Adapter
​
SOFTWARE

Linux OS
Minicom
minicom topology
Requires a connection to devices Console Port

Minicom Program...
Minicom is a text-based serial port communications program. It is used to talk to external RS-232 devices such as mobile phones, routers, and serial console ports.


Purpose of Demo...
​
To walk you through how to establish a serial connection to Cisco equipment using Linux. There are numerous applications to accomplish this but we will leverage Minicom in this tutorial.

Demonstration in a nutshell:
  1. Install Minicom on the Linux OS (Kali Linux)
  2. Set Cisco Console Parameters
  3. Connect Network Topology
  4. Test Connection!

1. Install Minicom on the Linux OS (Kali Linux)

We will first need to obtain the Minicom application. In this demonstration, I will be using Kali Linux as this lab is intended to support an Ethical Hacking series.


Verify Internet Connectivity

​Ensure your OS has an Internet connection. To test, you can open a terminal prompt and ping Google’s DNS Server (8.8.8.8)

Linux Commands
​root@kali:~#
ping 8.8.8.8
pinging googles dns server
A reply from the 8.8.8.8 device indicates we are connected to the Internet. To stop the ping, use [crtl] + [c].

After confirming our Internet connection, let's install the minicom application. 
We will use the Advanced Packaging Tool (apt-get) to locate, download and install the Minicom application.
​
Linux Commands
root@kali:~# apt-get install minicom
apt-get install
NOTE: To install the application, you will need root access which in this example, I already have. If you are using a de-privileged account, you will need to “sudo” the command (below).
​
root@kali:~# sudo apt-get install minicom

sudo will allow you to execute the apt-get command with the privileges of root and may require the root password.

Determine the Serial Port mapping in Linux
Within the Linux OS, the serial port name will be needed to configure Minicom to use it for our connection. Serial ports are designated as “/dev/ttys#” where the # will be replaced with a port assignment number. In the above, /dev is the directory where device files are stored/listed, /tty represents TeleTypewriter devices and s# is the actual serial port.

Linux Commands
root@kali:~# dmesg | grep tty
displaying serial ports in Linux
USB to Serial ConverterClick to Product Page

​NOTE: If you are using a serial to USB adapter, you will follow this same process. The output will appear as “/dev/ttyUSB#” (as shown below)

output with a usb to serial adapter

2. Set the Cisco Serial Parameters

Now that we know the serial port identification in the Linux OS, let’s launch and configure Minicom.

Linux Commnads

root@kali:~# minicom –s 
minicom -s launch
NOTE: Keep in mind the command required if you are requiring Root access!

root@kali:~# sudo minicom –s

With Minicom installed, let's configure our serial connection parameters. From the resulting menu, we are interested in serial based connections. Select “serial port setup” from the menu (Up/Down arrows) and hit [Enter]
.
minicom configuration menu

​Press “A” to select the serial device parameters. 

Serial Device Parameters

Once your cursor is in the correct setting, enter the port ID we discovered with the dmesg command and hit [Enter]. Correct setting in my case would be as follows:

serial interface to configure

​Next, we’ll adjust the speed, parity and data/stop bits to meet Cisco requirements. Press “E” to select the correct parameters settings. 
Comm Paramenters
9600, 8-N-1-None – Cisco will require a certain speed, parity and data/stop parameters set in order to communicate with its Console port. The 9600, 8-N-1-None is a quick way to remember these settings:
  • 9600 = Bits per Second (Bps)
  • 8 = 8 Data Bits
  • N = No Parity
  • 1 = 1 Stop Bit
  • None = No Flow Control (This references the Software Flow Control Setting!)
 
We will use the following keyboard keys to set this appropriately: [c] key, [q] key, [Enter]. 
9600 8 n 1 none settings

Results will be as follows:
minicom cisco parameters

Lastly, hit [Enter] to return to the main menu of Minicom. Let’s save the connection so configuration to re-use in the future. You can save it as the default connection settings if you prefer by selecting ”Save setup as dfl”.

I’ll create this as a custom configuration by choosing “Save setup as…” and pressing [Enter].
custom name to settings

​Next, I’ll type in the configuration name of CiscoDevices and hit [Enter].  Keep in mind, the profile name you assign IS case sensitive!
saved name

​Select ”Exit from Minicom” and hit [Enter].


3. Connect the Topology

Using a Console Cable (Rollover), connect the serial connector to the laptops serial port and the RJ45 connector to the Console port of the Cisco device.
Console Cable
Console Connection to Router

​NOTE: If the PC does not have a serial port, you can leverage a USB to Serial Adapter and Console connection. Cabling would be setup as follows:
USB to Serial Adapter Connection

4. Test Connection

At this time, we should be ready to connect to our Cisco device! Power on the switch / router and launch Minicom.
 
root@kali:~# minicom CiscoDevices

NOTE: The profile entry, CiscoDevices IS CASE SENSITIVE! Once the session starts, hit [Enter] to begin interaction with the device.
minicon access to device

​Once connected, you can use [crtl] + [a] to access the connection status. From there, [z] gains you access to the Help menu. 
accessing the minicom help menu
minicom help menu
minicom Help Menu

To exit, use [crtl] + [c] to access the connection status. From there, [x] will leave session. 

exiting the minicom program
Proudly powered by Weebly