Query: detect Detects suspicious shell commands or program code that may be executed or used in command line to establish a reverse sh in logs
Matching passage: Sigma rule: Detects suspicious shell commands or program code that may be executed or used in command line to establish a reverse sh. Logsource: linux. Rule: title: Suspicious Reverse Shell Command Line id: 738d9bcf-6999-4fdb-b4ac-3033037db8ab status: test description: Detects suspicious shell commands or program code that may be executed or used in command line to establish a reverse shell references: - https://alamot.github.io/reverse_shells/ author: Florian Roth (Nextron Systems) date: 2019-04-02 modified: 2021-11-27 tags: - attack.execution - attack.t1059.004 logsource: product: linux detection: keywords: - BEGIN {s = "/inet/tcp/0/ - bash -i >& /dev/tcp/ - bash -i >& /dev/udp/ - sh -i >$ /dev/udp/ - sh -i >$ /dev/tcp/ - '&& while read line 0<&5; do' - /bin/bash -c exec 5<>/dev/tcp/ - /bin/bash -c exec 5<>/dev/udp/ - '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 ' - xterm -display 1 condition: keywords falsepositives: - Unknown level: high
Near-miss passage: Sigma rule: Detects the registration of a new ODBC driver where the driver is located in a potentially suspicious location. Logsource: windows / registry_set. Rule: title: Potentially Suspicious ODBC Driver Registered id: e4d22291-f3d5-4b78-9a0c-a1fbaf32a6a4 status: test description: Detects the registration of a new ODBC driver where the driver is located in a potentially suspicious location references: - https://www.hexacorn.com/blog/2020/08/23/odbcconf-lolbin-trifecta/ author: Nasreddine Bencherchali (Nextron Systems) date: 2023-05-23 modified: 2023-08-17 tags: - attack.credential-access - attack.persistence - attack.t1003 logsource: category: registry_set product: windows detection: selection: TargetObject|contains: \SOFTWARE\ODBC\ODBCINST.INI\ TargetObject|endswith: - \Driver - \Setup Details|contains: - :\PerfLogs\ - :\ProgramData\ - :\Temp\ - :\Users\Public\ - :\Windows\Registration\CRMLog - :\Windows\System32\com\dmp\ - :\Windows\System32\FxsTmp\ - :\Windows\System32\Microsoft\Crypto\RSA\MachineKeys\ - :\Windows\System32\spool\drivers\color\ - :\Windows\System32\spool\PRINTERS\ - :\Windows\System32\spool\SERVERS\ - :\Windows\System32\Tasks_Migrated\ - :\Windows\System32\Tasks\Microsoft\Windows\SyncCenter\ - :\Windows\SysWOW64\com\dmp\ - :\Windows\SysWOW64\FxsTmp\ - :\Windows\SysWOW64\Tasks\Microsoft\Windows\PLA\System\ - :\Windows\SysWOW64\Tasks\Microsoft\Windows\SyncCenter\ - :\Windows\Tasks\ - :\Windows\Temp\ - :\Windows\Tracing\ - \AppData\Local\Temp\ - \AppData\Roaming\ condition: selection falsepositives: - Unlikely level: high