MarginResearch / mikrotik_authentication

Proofs of concept which successfully authenticate with MikroTik Winbox and MAC Telnet servers running on RouterOS version 6.45.1+
Apache License 2.0
76 stars 14 forks source link

Running within bash script #2

Open darshankowlaser opened 2 years ago

darshankowlaser commented 2 years ago

Hi,

First off I would like to thank you for making this tool. I would like to incorporate the tool into a BASH script but I am having issues. The MAC-TELNET session to the MikroTik works but Im not able to send commands from the rest of the bash script into the MAC-TELNET session.

Any advice, here is my bash script :

#!/bin/bash

# MikroTik variables
ros_username="admin"
ros_password=""
ros_export="/export"

# Information gathering
router_mac="$(arp -a |awk '{ print $4 }')"

# Start MAC telnet login
python3 /root/mikrotik_authentication/src/mactelnet.py ${router_mac} -u ${ros_username} -p ${ros_password}

# Execute ROS command
exc_export_config="$(${ros_export})"

# Export Results
echo -e "$exc_export_config"

Thanks, DK

thisisnotcamilo commented 2 years ago

hi @dkay-zaxxx, mactelnet.py probably doesn't have piping capabilities just yet, it will be awesome to see it implemented