Skip to content

Instantly share code, notes, and snippets.

@binarysta
Created January 2, 2021 23:49
Show Gist options
  • Select an option

  • Save binarysta/fc917bb05ccd0654277323f41f48a614 to your computer and use it in GitHub Desktop.

Select an option

Save binarysta/fc917bb05ccd0654277323f41f48a614 to your computer and use it in GitHub Desktop.
#!/bin/bash
URL=$1
params=($(echo "$URL" | awk -F'/|:|//' '{print $1,$3,$4}'))
if [ "${params[0]}" == "capture" ]; then
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -l root "${params[1]}" tcpdump -i "${params[2]}" -s 0 -U -w - | wireshark -k -i -
elif [ "${params[0]}" == "telnet" ]; then
gnome-terminal -- telnet "${params[1]}" "${params[2]}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment