Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # !/bin/bash
- Pasta()
- {
- # Montando Pasta
- mkdir LOGS
- if [ -e LOGS ]
- then
- echo "Diretorio criado"
- else
- echo ""
- fi
- }
- ####################
- ##### PROGRAMA #####
- ####################
- # Chamda de funcao
- Pasta
- # Variavel de controle
- i=1
- # Estrutura em loop
- while(( $i == 1 ))
- do
- clear
- echo ""
- echo -e "\033[01;31m ##### FORENSE ##### \033[01;37m"
- echo ""
- echo -e "\033[01;32m [1] Historico de comando \033[01;37m"
- echo -e "\033[01;32m [2] Encontrando arquivos \033[01;37m"
- echo -e "\033[01;32m [3] Lista de usuarios [sem comentarios] \033[01;37m"
- echo -e "\033[01;32m [4] Lista de senhas [criptografadas] \033[01;37m"
- echo -e "\033[01;32m [5] Lista de grupos \033[01;37m"
- echo ""
- echo -e "\033[01;34m [6] Usuarios [id] \033[01;37m"
- echo -e "\033[01;34m [7] Usuarios [logados] \033[01;37m"
- echo -e "\033[01;34m [8] Usuarios [atuais] \033[01;37m"
- echo -e "\033[01;34m [9] Usuarios [conectados simultaneamente] \033[01;37m"
- echo ""
- echo -e "\033[01;35m [10] Mostrar informacoes detalhadas \033[01;37m"
- echo -e "\033[01;35m [11] Mostrar os ultimos usuarios logados \033[01;37m"
- echo -e "\033[01;35m [12] Mostrar os dados de desligamento \033[01;37m"
- echo -e "\033[01;35m [13] Mostrar os ultimos logins \033[01;37m"
- echo ""
- echo -e -n "\033[01;35m * Resp: \033[01;37m"
- read opc
- clear
- # Estrutura em escolha
- case $opc in
- 1)
- history > LOGS/historico.txt
- cat LOGS/historico.txt | less;;
- 2)
- echo -e -n "\n- Digite o arquivo: "
- read arq
- find / -name $arq > LOGS/caminhos.txt
- cat LOGS/caminhos.txt | less;;
- 3)
- cat /etc/passwd | grep -v "[$,#]" > LOGS/usuarios.txt
- cat LOGS/usuarios.txt | less;;
- 4)
- cat /etc/shadow | grep -v "[$,#]" > LOGS/senhas.txt
- cat LOGS/senhas.txt | less;;
- 5)
- cat /etc/group | grep -v "[$,#]" > LOGS/grupo.txt
- cat LOGS/grupo.txt | less;;
- 6)
- echo -e -n "\n- Digite usuario: "
- read usuario
- id $usuario;;
- 7)
- w;;
- 8)
- who;;
- 9)
- users;;
- 10)
- # apt-get -f install finger
- echo -e -n "\n- Digite usuario: "
- read usuario
- finger $usuario > LOGS/finger.txt
- cat LOGS/finger.txt | less;;
- 11)
- last > LOGS/logins.txt
- cat LOGS/logins.txt | less;;
- 12)
- last -x > LOGS/dados.txt
- cat LOGS/dados.txt | less;;
- 13)
- lastlog > LOGS/ultimos_logins.txt
- cat LOGS/ultimos_logins.txt | less;;
- *)
- ;;
- esac
- echo ""
- echo " Pressione [Enter] quando terminar"
- echo ""
- read
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement