> ## Documentation Index
> Fetch the complete documentation index at: https://docs.specterops.io/llms.txt
> Use this file to discover all available pages before exploring further.

# iTerm

> Read the contents of all open iTerm tabs if iTerms is open, otherwise just inform the operator that it's not currently running

## Summary

Read the contents of all open iTerm tabs if iTerms is open, otherwise just inform the operator that it's not currently running

* Needs Admin: False
* Version: 1
* Author: @its\_a\_feature\_

<Warning> In Mojave+ (10.14+) this will cause a popup the first time asking for permission for your process to access iTerm. </Warning>

### Arguments

## Usage

```
iTerm
```

## MITRE ATT\&CK Mapping

* T1139
* T1056

## Detailed Summary

This uses AppleEvents to read the contents of iTerm tabs:

```javascript theme={null}
if(term.running()){
    for(let i = 0; i < term.windows.length; i++){
        let window = {};
        for(let j = 0; j < term.windows[i].tabs.length; j++){
            let tab_info = {};
            tab_info['tty'] = term.windows[i].tabs[j].currentSession.tty();
            tab_info['name'] = term.windows[i].tabs[j].currentSession.name();
            tab_info['contents'] = term.windows[i].tabs[j].currentSession.contents();
            tab_info['profileName'] = term.windows[i].tabs[j].currentSession.profileName();
            window["Tab: " + j] = tab_info;
        }
        output["Window: " + i] = window;
    }
}
```
