MITRE ATT&CK Technique
Description
The <code>HISTCONTROL</code> environment variable keeps track of what should be saved by the <code>history</code> command and eventually into the <code>~/.bash_history</code> file when a user logs out. This setting can be configured to ignore commands that start with a space by simply setting it to "ignorespace". <code>HISTCONTROL</code> can also be set to ignore duplicate commands by setting it to "ignoredups". In some Linux systems, this is set by default to "ignoreboth" which covers both of the previous examples. This means that “ ls” will not be saved, but “ls” would be saved by history. <code>HISTCONTROL</code> does not exist by default on macOS, but can be set by the user and will be respected. Adversaries can use this to operate without leaving traces by simply prepending a space to all of their terminal commands.
Supported Platforms
Created
April 29, 2026
Last Updated
April 29, 2026
STIX Data
{'created': '2017-12-14T16:46:06.044Z',
'created_by_ref': 'identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5',
'description': 'The <code>HISTCONTROL</code> environment variable keeps track '
'of what should be saved by the <code>history</code> command '
'and eventually into the <code>~/.bash_history</code> file '
'when a user logs out. This setting can be configured to '
'ignore commands that start with a space by simply setting it '
'to "ignorespace". <code>HISTCONTROL</code> can also be set to '
'ignore duplicate commands by setting it to "ignoredups". In '
'some Linux systems, this is set by default to "ignoreboth" '
'which covers both of the previous examples. This means that “ '
'ls” will not be saved, but “ls” would be saved by history. '
'<code>HISTCONTROL</code> does not exist by default on macOS, '
'but can be set by the user and will be respected. Adversaries '
'can use this to operate without leaving traces by simply '
'prepending a space to all of their terminal commands.',
'external_references': [{'external_id': 'T1148',
'source_name': 'mitre-attack',
'url': 'https://attack.mitre.org/techniques/T1148'},
{'external_id': 'CAPEC-13',
'source_name': 'capec',
'url': 'https://capec.mitre.org/data/definitions/13.html'}],
'id': 'attack-pattern--086952c4-5b90-4185-b573-02bad8e11953',
'kill_chain_phases': [{'kill_chain_name': 'mitre-attack',
'phase_name': 'defense-evasion'}],
'modified': '2025-10-24T17:48:21.311Z',
'name': 'HISTCONTROL',
'object_marking_refs': ['marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168'],
'revoked': True,
'spec_version': '2.1',
'type': 'attack-pattern',
'x_mitre_attack_spec_version': '3.2.0',
'x_mitre_deprecated': False,
'x_mitre_detection': '',
'x_mitre_domains': ['enterprise-attack'],
'x_mitre_is_subtechnique': False,
'x_mitre_modified_by_ref': 'identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5',
'x_mitre_platforms': ['Linux', 'macOS'],
'x_mitre_version': '1.2'}