Jump to content

Executar Script Ssh


Recommended Posts

Encontrei um script aqui no fórum para fazer uma varredura por arquivo shell no servidor, segue abaixo o código:

#!/bin/bash
#Scanning all users directory for various php shell
# Below command is one line so see that its one line in your script or else it will generate error

echo "No PHP Shell was Found" > /root/scan.txt
/bin/egrep "cgitelnet|webadmin|PHPShell|tryag|r57shell|c99shell|noexecshell|/etc/passwd|revengans|myshellexec" /home/*/public_html -R | cut -d: -f1 | uniq > /root/scan.txt

/bin/cat /root/scan.txt | mail -s "PHP Shell Scan" [email="[email protected]"][email protected][/email]

#Replace your email address above

#Cron Settings
# 0 6 * * * PATH TO SCRIPT

Gostaria de saber como faço pra executar ele via ssh.

Link to comment
Share on other sites

Primeiro, ele deve estar com permissões de executável:

 

chmod a+x script.sh

 

Para rodar, basta fazer:

 

sh script.sh

 

ou

 

./script.sh

 

Obs.: Como é um script para controle de segurança do servidor, você pode ativar uma tarefa Cron para ele...

 

Abraços! :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...

Important Information

Do you agree with our terms?