GNU/Linux >> Linux Esercitazione >  >> Linux

Cosa fa questo script sh se eseguito?

Ho scaricato il primo URL (http://qualcosa.esempio.com/xx) e l'ho eseguito

$ file xx
xx: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU/Linux 2.6.15, not stripped

Quindi, è un programma eseguibile pensato per essere eseguito su una macchina Linux. Presumo che tu stia eseguendo un server Linux. Successivamente, vogliamo vedere cosa fa il programma, ma ovviamente non vuoi eseguirlo. Un modo rapido è ignorare tutto il codice di istruzioni del computer incorporato nell'eseguibile e guardare solo quali stringhe leggibili dall'uomo potrebbe contenere. Quindi, sono scappato

$ strings xx | less

[... excerpt ...]
NOTICE %s :Receiving file.
NOTICE %s :Saved as %s
NOTICE %s :Spoofs: %d.%d.%d.%d
NOTICE %s :Spoofs: %d.%d.%d.%d - %d.%d.%d.%d
NOTICE %s :Kaiten wa goraku
NOTICE %s :NICK <nick>
NOTICE %s :Nick cannot be larger than 9 characters.
NICK %s
NOTICE %s :DISABLE <pass>
Disabled
Enabled and awaiting orders
NOTICE %s :Current status is: %s.
NOTICE %s :Already disabled.
NOTICE %s :Password too long! > 254
NOTICE %s :Disable sucessful.
NOTICE %s :ENABLE <pass>
NOTICE %s :Already enabled.
NOTICE %s :Wrong password
NOTICE %s :Password correct.
NOTICE %s :Removed all spoofs
NOTICE %s :What kind of subnet address is that? Do something like: 169.40
NOTICE %s :Unable to resolve %s
NOTICE %s :UDP <target> <port> <secs>
NOTICE %s :Packeting %s.
NOTICE %s :PAN <target> <port> <secs>
NOTICE %s :Panning %s.
NOTICE %s :TSUNAMI <target> <secs>
NOTICE %s :Tsunami heading for %s.
NOTICE %s :UNKNOWN <target> <secs>
NOTICE %s :Unknowning %s.
NOTICE %s :MOVE <server>
NOTICE %s :TSUNAMI <target> <secs>                          = Special packeter that wont be blocked by most firewalls
NOTICE %s :PAN <target> <port> <secs>                       = An advanced syn flooder that will kill most network drivers
NOTICE %s :UDP <target> <port> <secs>                       = A udp flooder
NOTICE %s :UNKNOWN <target> <secs>                          = Another non-spoof udp flooder
NOTICE %s :NICK <nick>                                      = Changes the nick of the client
NOTICE %s :SERVER <server>                                  = Changes servers
NOTICE %s :GETSPOOFS                                        = Gets the current spoofing
NOTICE %s :SPOOFS <subnet>                                  = Changes spoofing to a subnet
NOTICE %s :DISABLE                                          = Disables all packeting from this client
NOTICE %s :ENABLE                                           = Enables all packeting from this client
NOTICE %s :KILL                                             = Kills the client
NOTICE %s :GET <http address> <save as>                     = Downloads a file off the web and saves it onto the hd
NOTICE %s :VERSION                                          = Requests version of client
NOTICE %s :KILLALL                                          = Kills all current packeting
NOTICE %s :HELP                                             = Displays this
NOTICE %s :IRC <command>                                    = Sends this command to the server
NOTICE %s :SH <command>                                     = Executes a command
NOTICE %s :Killing pid %d.
TSUNAMI
UNKNOWN
NICK
SERVER
GETSPOOFS

"Abilitato e in attesa di ordini" suggerisce che si tratta di un programma che fa agire il tuo server come un nodo botnet.

Il file successivo che scarica, http://qualcosa.esempio.com/ru, è uno script di shell, che a sua volta scarica un .tar.gz file da http://example.hu/ar/64.tgz (o 32.tgz, a seconda dell'architettura della CPU), quindi installa ed esegue. Quell'archivio contiene tre file:

  • Un php interprete compilato per Linux
  • Un altro eseguibile Linux chiamato pnscan
  • Uno script di shell chiamato run che lancia pnscan

L'altra cosa che fa è creare un cron job settimanale che scarica ed esegue http://something.example.com/sh, che contiene esattamente lo script di shell che hai postato sopra. Fondamentalmente, reinfetterà automaticamente la tua macchina ogni settimana a meno che tu non disinstalli quel cron job.

Azione consigliata

Il codice sembra essere stato messo insieme da script kiddies. Utilizza strumenti esistenti come pnscan , legato insieme ad alcuni script di shell. Non è un codice di qualità Stuxnet.

Dalle informazioni che hai aggiunto in seguito (il tuo server Apache non ha il supporto PHP, il tuo server Apache è ancora in esecuzione normalmente e nessun lavoro cron è stato installato), sembra probabile che il codice non sia mai stato effettivamente eseguito sul tuo server. In tal caso, probabilmente stai bene! Esegui ps ax per verificare se è in esecuzione qualcosa di sospetto e dovresti essere a posto.


Vedi questo post sul blog per tutti i dettagli:

Da quando è stata scoperta la vulnerabilità in Apache/PHP che ha consentito l'esecuzione del codice PHP utilizzando una semplice richiesta POST HTTP, sono stati lanciati attacchi automatici su larga scala che hanno portato a un gran numero di host compromessi.

Tali attacchi sono diminuiti negli ultimi mesi, tuttavia, uno di questi attacchi automatizzati è stato particolarmente interessante in quanto l'approccio utilizzato può essere classificato come simile a un worm. Entriamo nell'intero attacco a un livello superiore prima di passare alla parte tecnica.

L'attore ha utilizzato l'exploit rilasciato da kingcope [exploit-db] con un payload modificato che ha scaricato alcuni script e binari che a loro volta hanno avviato la scansione di un blocco A casuale di indirizzi IPv4. Se si scopre che un host esegue Apache, vengono lanciati tentativi di sfruttamento e l'intero processo ricomincia. Questi attacchi sono stati individuati per la prima volta intorno a novembre 2013.

Sulla base delle informazioni delineate, sembra trattarsi di una sorta di botnet che sfrutta gli exploit sopra menzionati.


Linux
  1. Cosa fa "lc_all=c"?

  2. Cosa significa `:-` in uno script di shell?

  3. Cosa significa e commerciale alla fine di una riga di script di shell?

  4. Cosa significa questo output di Xev?

  5. Cosa fa Eco $? Fare??

Cosa indica questa statistica del processo?

Cosa restituisce malloc(0)?

Cosa significa questo avviso?

Cosa significa - in questo comando Linux?

Cosa significa set -e in uno script bash?

Cosa fa questo script bash? [Tentativo di hackeraggio]