DEV Community

JackedIN
JackedIN

Posted on

Scripting network console sessions with a local API

A lot of network work still happens on a console: a USB-serial cable for the first SSH key, a Telnet jump on a lab switch, then a normal SSH session once the box is up. The painful part is not the protocols. It is repeating the same login, pager, and show command in a window you cannot script.

This post is about driving those sessions from a command line and from a small local API, using JackedIN, a terminal we build for network gear. Built-in profiles for Junos, Cisco IOS/NX-OS, Arista, Nokia, MikroTik and more. Every download is a full 72-hour trial: the window, the CLI, and the API, with no card and no sign-up.

If you want short demos and explainers, subscribe to Been There, Built That on YouTube: https://www.youtube.com/@BeenThere.BuiltThat

One program, three ways in

Run jackedin with no arguments and you get the desktop window: tabs, saved sessions, serial, SSH, and Telnet. Run it with a command and it stays in the terminal, prints a result, and exits, which is what you want in a script:

jackedin ports
jackedin connect --serial /dev/ttyUSB0 --baud 9600
jackedin connect --host 192.0.2.10 --user netops
echo 'show version' | jackedin connect --protocol telnet --host 192.0.2.10
Enter fullscreen mode Exit fullscreen mode

On Windows the serial port looks like COM5. Use a device you own or are allowed to manage, and keep secrets out of the command line. JackedIN can take an enable secret from an environment variable instead of argv.

The same engine is also a local automation API. It is off by default, listens only on the local machine, and needs a token. You turn it on when you want scripts on that computer to open a session, send a command, wait for output, and close it, or to run ping, traceroute, and a port scan against gear you are allowed to test.

See the plan before you touch the device

Dry-run is the habit that keeps a typo from becoming a change window. Nothing connects and no password is sent:

jackedin exec --host 192.0.2.10 --dry-run --cmd 'show version'
Enter fullscreen mode Exit fullscreen mode

If the output looks right, drop --dry-run and run it for real. You can also pass expect rules so a run fails when the output is wrong, not only when the connection drops.

Python on the same computer

The Python client and the optional Nornir plugin are free on PyPI, but they drive the JackedIN app, so you still need the trial or a license on that machine:

pip install jackedin
# optional
pip install nornir-jackedin
Enter fullscreen mode Exit fullscreen mode
from jackedin import Jackedin

device = Jackedin("192.0.2.10", username="netops")  # password from JACKEDIN_PASSWORD
print(device.dry_run(["show version"]).text)
report = device.run(
    ["show version"],
    expect=[{"command": "show version", "expect_match": "Version"}],
)
print(report)
Enter fullscreen mode Exit fullscreen mode

That is enough to hang a lab check off a script: confirm a version string, grab a show command, or fail a job when the prompt is not what you expected. There is also a Nornir task if you already keep inventory that way, and an Ansible collection in the portable zip.

A few practical notes

  • JackedIN 1.2.1 runs on Windows 10/11, Debian/Ubuntu, and Raspberry Pi OS 64-bit. There is no macOS build yet.
  • Import works from PuTTY, SecureCRT, MobaXterm, and SSH config, which is useful when you are moving an existing session list rather than starting over.
  • SFTP file transfer is included.
  • The local API stays on the same machine. Do not treat it as a network service to open up.
  • 1.2.1 fixes serial consoles that only prompt Password: and the enable prompt on the console, which is the exact mess a first-boot script runs into.
  • The Windows installer is not code-signed yet, so SmartScreen may say "Windows protected your PC." The portable zip does not need admin rights.

The trial, the user's guide, and the current 1.2.1 downloads are at https://getjackedin.com. After the 72-hour trial, the launch price is $19 one-time (regular $29). There is also a Lab Bundle with PathProbe Pro for $24.99: https://getpathprobe.com/bundle/. Students, teachers, and CTF teams can email service@getpathprobe.com for a 40% off code. If you already live in a terminal, start with the CLI. If you already live in Python, start with pip install jackedin and a dry-run against a lab address.


Disclosure: we build JackedIN. This post describes the current 1.2.1 app and the 1.2.0 Python packages, which work together.

Top comments (0)