[ Try Hack Me ] REmux The Tmux

Ghi
5 min readMar 17, 2022

Task 1: Tmux practice machine

Task 2: Starting tmux “Sessions” and default tmux “prefix”

  • Do the ctrl and b keys need to be held down the whole time with every commands to work? yea/nay

A: nay

  • How to start tmux with the session with the name “thm”?

A: tmux new -s thm

  • How to change the current tmux session name?

A: ctrl b shift $

  • How to quit a tmux session without closing the session? To attach back later.

A: ctrl b d

  • How to list all tmux sessions?

A: tmux ls

  • How to reattach to a detached tmux session with the session name of “thm”

A: tmux a -t thm

  • How to create a new tmux session from your current tmux session with the name kali?

A: tmux new -s kali -d

  • How to switch between two or more tmux sessions without detaching from the current tmux session?

A: ctrl b s

  • How do you force kill the tmux session named “thm” if it’s not responsive from a new terminal window or tmux session?

A: tmux kill-session -t thm

  • Within a nested tmux session. A second tmux session within the first one. How to change the session name of the second/internal tmux session?

A: ctrl b ctrl b shift $

  • How to get into a tmux prompt to run/type tmux commands?

A: ctrl b shift :

  • Are there more than one way to exit a tmux prompt? yea/nay

A: yea

  • Is tmux case sensitive. Will hitting the caps lock break tmux? yea/nay

A: yea

  • Within tmux prompt or command mode how would you change the tmux directory? Where a new window or pane will start from the changed directory of /opt.

A: a -c /opt

  • How to kill all tmux sessions accept the one currently in use? With the name “notes”.

A: tmux kill-session -t notes -a

Task 3: Manage tmux “Panes”

  • How to create a new pane split horizontally?

A: ctrl b shift “

  • How to close a tmux pane like closing a ssh session?

A: exit

  • How to create a new pane split vertically?

A: ctrl b shift %

  • How to cycle between tmux pre built layout options? Starting with the number 1.

A: ctrl b esc 1

  • How to cycle/toggle between tmux layouts, one at a time?

A: ctrl b spacebar

  • How to force quit a frozen, crashed or borked pane?

A: ctrl b x y

  • How to move between the two must used tmux panes for the current tmux window?

A: ctrl b o

  • Can you use the arrow to move to the desired pane? yea/nay

A: yea

  • How to move the currently selected pane clockwise?

A: ctrl b shift {

  • How to move the currently selected pane counter-clockwise

A: ctrl b shift }

  • Before using swap-pane. How to check for which pane has what number?

A: ctrl b q

  • How to swap two panes and move with the swapped pane? Within tmux prompt mode. 1 -> 3 location

A: :swap-pane -t 3 -s 1

  • How to swap two panes without changing the currently selected pane location? Within tmux prompt mode. 1 -> 4 pane number

A: :swap-pane -t 4 -s 1

Task 4 Manage tmux “Windows”

  • How to create a new empty tmux window?

A: ctrl b c

  • How to change the currently select window’s name?

A: ctrl b ,

  • How to move the currently selected pane to it’s own tmux window?

A: ctrl b shift !

  • How to fuse two panes together with the “source” window of “bash”? After entering a tmux prompt?

A: join-pane -s bash

  • How to fuse two panes together with the “destination” window of “sudo”? After entering a tmux prompt?

A: join-pane -t sudo

  • What option can added with question 4 and 5 to fuse together vertically?

A: -v

  • What option can added with question 4 and 5 to fuse together horizontally?

A: -h

  • With join-pane can you use the window number instead of the window’s name? yea/nay

A: yea

  • How to kill or completely close a window. Including all the panes open on that window. If it’s unresponsive?

A: ctrl b shift &

  • How to view and cycle between all the tmux windows for the current tmux session without detaching from the current session?

A: ctrl b o

  • How to move back to the previous tmux window?

A: ctrl b n

  • How to move up to the next tmux window?

A: ctrl b p

Task 5: Tmux “copy” mode

  • How to start copy mode?

A: ctrl b [

  • While in copy mode. How to search/grep up the wall of terminal text?

A: ctrl r

  • While in copy mode. How to search/grep down the wall of terminal text?

A: ctrl s

  • How to exit search up or search down within copy mode?

A: esc

  • What single key can also be used to to exit out of copy mode.

A: q

  • After starting copy mode. How do you enable text highlighting to select for text copying?

A: ctrl spacebar

  • After selecting the text you want to copy. How do copy it?

A: alt w

  • When in a terminal text editor. How to paste from the tmux clipboard?

A: ctrl b ]

  • How to double check what is currently copied to the tmux clipboard

A: ctrl b shift #

Task 6: Oh My Tmux and beyond

  • Does tmux have a default tmux.conf config file? yea/nay

A: nay

  • Where can you find examples for custom tmux.conf config files?

A: /usr/share/doc/tmux

  • Can you use Hex color codes in place of the color name? yea/nay

A: yea

  • What directory must the .tmux.conf be put in to work with the next tmux session

A: home

  • How would you update tmux changes without quitting the tmux session from a tmux prompt?

A: :source-file ~/.tmux.conf

  • How to completely reset tmux to its default and kill all sessions? If the .tmux.conf is borked.

A: tmux kill-server

  • How would you select addition hotkeys. Without overwriting the default hotkey?

A: bind

  • How would you change the prefix to Ctrl a?

A: set -g prefix C-a

  • Can you display shell command output. From a script or one line command? yea/nay

A: yea

  • How would you load a plugin into a tmux config file?

A: .set -g @plugin

  • How can you run the desired plugin after loading it?

A: run-shell

Task 7: Oreo’s open-source .tmux.conf file

--

--

Ghi

Passionate cybersecurity learner :3 Ya with me?