2019-04-02 15:03:51 +00:00
|
|
|
title: Suspicious Reverse Shell Command Line
|
2019-11-12 22:12:27 +00:00
|
|
|
id: 738d9bcf-6999-4fdb-b4ac-3033037db8ab
|
2019-04-02 15:03:51 +00:00
|
|
|
status: experimental
|
2021-02-24 14:43:13 +00:00
|
|
|
description: Detects suspicious shell commands or program code that may be executed or used in command line to establish a reverse shell
|
2019-04-02 15:03:51 +00:00
|
|
|
author: Florian Roth
|
|
|
|
date: 2019/04/02
|
2020-09-14 04:03:04 +00:00
|
|
|
references:
|
|
|
|
- https://alamot.github.io/reverse_shells/
|
2019-04-02 15:03:51 +00:00
|
|
|
logsource:
|
|
|
|
product: linux
|
|
|
|
detection:
|
|
|
|
keywords:
|
|
|
|
- 'BEGIN {s = "/inet/tcp/0/'
|
|
|
|
- 'bash -i >& /dev/tcp/'
|
2019-04-02 17:22:18 +00:00
|
|
|
- 'bash -i >& /dev/udp/'
|
|
|
|
- 'sh -i >$ /dev/udp/'
|
|
|
|
- 'sh -i >$ /dev/tcp/'
|
2019-04-02 15:03:51 +00:00
|
|
|
- '&& while read line 0<&5; do'
|
|
|
|
- '/bin/bash -c exec 5<>/dev/tcp/'
|
2019-04-02 18:09:13 +00:00
|
|
|
- '/bin/bash -c exec 5<>/dev/udp/'
|
2019-04-02 15:03:51 +00:00
|
|
|
- 'nc -e /bin/sh '
|
|
|
|
- '/bin/sh | nc'
|
|
|
|
- 'rm -f backpipe; mknod /tmp/backpipe p && nc '
|
|
|
|
- ';socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i))))'
|
|
|
|
- ';STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;'
|
|
|
|
- '/bin/sh -i <&3 >&3 2>&3'
|
|
|
|
- 'uname -a; w; id; /bin/bash -i'
|
|
|
|
- '$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2); $stream.Write($sendbyte,0,$sendbyte.Length); $stream.Flush()};'
|
|
|
|
- ";os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);os.putenv('HISTFILE','/dev/null');"
|
|
|
|
- '.to_i;exec sprintf("/bin/sh -i <&%d >&%d 2>&%d",f,f,f)'
|
|
|
|
- ';while(cmd=c.gets);IO.popen(cmd,"r"){|io|c.print'
|
|
|
|
- "socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:"
|
|
|
|
- 'rm -f /tmp/p; mknod /tmp/p p &&'
|
|
|
|
- ' | /bin/bash | telnet '
|
|
|
|
- ',echo=0,raw tcp-listen:'
|
|
|
|
- 'nc -lvvp '
|
2019-04-02 16:48:18 +00:00
|
|
|
- 'xterm -display 1'
|
2019-04-02 15:03:51 +00:00
|
|
|
condition: keywords
|
|
|
|
falsepositives:
|
|
|
|
- Unknown
|
|
|
|
level: high
|
2020-09-14 04:03:04 +00:00
|
|
|
tags:
|
|
|
|
- attack.execution
|
|
|
|
- attack.t1059.004
|