Cyber Training Guide
CTF WriteupsOther NotesHow-To: Radare2How-To: GDB
  • Cyber Training Guide
  • 0x0: Introduction
    • git-good
    • root-1
    • root-2
    • intro
  • Binary Exploitation (pwn)
    • What is Binary Exploitation?
    • 0x1: ret2win
      • win32
      • win64
      • args
    • 0x2: shellcodes
      • location
      • shell
      • constrained
    • 0x3: format strings
      • format
      • chase
      • bbpwn
    • 0x4: stack canaries
      • canary
      • findme
    • 0x5: ROP
      • rop2win
      • split
      • callme
      • write4
      • badchars
    • 0x6: PIE
      • gimme
      • leak32
      • leak64
    • 0x7: ASLR
      • groundzero
      • stepup
      • ret2plt
    • 0x8: GOT overwrites
      • gotem
      • gotem64
  • Programming
    • What is the Programming Section?
    • 0x9: Data Serialization
      • LinkedOps
      • Tree
      • TeLeVision
    • 0xA: Programming
      • Calorie Counting
      • Hash
      • Rock Paper Scissors
      • Watch the Register
      • Supply Stacks
      • Rope Bridge
      • Mountain Climbers
  • Reverse Engineering (RE)
    • What is Reverse Engineering?
    • 0xB: Ghidra
      • hardcode
      • undo
      • snake
  • Toolkit
    • Using Pwntools
      • Establishing Connection
      • Context
      • Sending/Receiving Data
      • The ELF Class
    • My Workflow
      • Tmux
      • Vim
Powered by GitBook
On this page
  • Installation
  • Usage
  • Windows
  • Panes
  • Copy Mode
  • Downsides of Tmux

Was this helpful?

  1. Toolkit
  2. My Workflow

Tmux

Organizing multiple terminal windows in one tab.

Installation

Installing tmux is easy using apt:

sudo apt install tmux

The default configuration of tmux disables the mouse, which isn't ideal for me. This removes scrolling capability within the window, which is difficult for horizontal windows. To enable the mouse, create a file at ~/.tmux.conf with the following contents:

set -g mouse on

Then, reload the configuration:

$ tmux kill-server
$ tmux

Use tmux to start a new tmux session.

Usage

I split the usage section up into various sections based on the functionalities tmux provides.

By default, tmux uses a hotkey to activate its commands. This hotkey is Ctrl + b. The hotkey must precede all commands.

Windows

These commands are for making and removing windows.

  • c - Create a new window

  • & - Kill the current window

  • w - List all windows

These commands are for navigating between windows.

  • n - Go to the next window

  • p - Go to the previous window

  • f - Find a window by name

  • , - Rename the current window

Panes

These commands are for making and removing panes.

  • % - Split the current pane vertically

  • " - Split the current pane horizontally

Use the arrow keys to navigate between panes.

These commands are for handling panes.

  • x - Kill the current pane

  • o - Swap panes

  • q - Show pane numbers

These commands are for resizing panes.

  • Ctrl + <arrow key> - Resize the current pane in the direction of the arrow key

  • + - Break the current pane out of the window

  • - - Restore the current pane to the window

Copy Mode

Use Ctrl + b and then [ to enter copy mode. This allows you to use the cursor to navigate the pane. Use Esc to exit copy mode.

Copy mode supports the same navigation commands as Vim:

  • h|j|k|l - Navigate left/down/up/right

  • w|b - Navigate forward/backward by word

  • gg|G - Navigate to the top/bottom of the pane

  • 0|$ - Navigate to the beginning/end of the line

Downsides of Tmux

Arguably, the worst part of tmux is the inability to copy and paste properly. Copying is defaulted to go across the terminal; however, with horizontal terminals, this causes the copy to go across both terminals.

The only way around this is to use Copy Mode, which is hard to manage. It almost becomes easier to open a new tab and reproduce the command to copy.

PreviousMy WorkflowNextVim

Last updated 1 year ago

Was this helpful?