#!/bin/bash export TEXTDOMAINDIR="/usr/share/locale" export TEXTDOMAIN=sambasearch # Import BigControlCenter base modules / Importa os módulos básicos do BigControlCenter # That's include jquery and materialize / Isso inclui o jquery e o materialize # http://materializecss.com/ . /usr/share/bigbashview/bcc/shell/base.sh #Title/Description variables bcc_title=$"Procurar compartilhamentos" bcc_description=$"Localiza compartilhamentos na rede (Windows ou Samba)." # To disable logo use: bcc_logo="no" bcc_logo="logo.png" # About variables # To disable about use: bcc_about="no" bcc_about="yes" bcc_about_license=$"GPL v2 or greater" bcc_about_by=$"Bruno Gonçalves" bcc_about_release_date=$"01/08/2019" bcc_about_url_code=$"https://github.com/biglinux/sambasearch" bcc_about_url_project=$"https://www.biglinux.com.br" # Print header in screen bcc_header ############### # Start Content # Search last version and link OIFS=$IFS IFS=$'\n' echo '
' echo '
' if [ "$user" = "" ]; then username=$"Anônimo" else username="$user" fi echo $"Procura efetuada com o usuário:" " $username" $"na rede:" "$(ip -4 address | grep inet | grep -m1 -v 127.0.0.1 | awk '{ print $2 }')" '
' echo '

' for i in $(nmap -open -Pn -p 445,139 $(ip -4 address | grep inet | grep -m1 -v 127.0.0.1 | awk '{ print $2 }') | grep "Nmap scan report" | sed 's|.* ||g;s|(||g;s|)||g'); do if [ "$i" != "$(ip -4 address | grep inet | grep -m1 -v 127.0.0.1 | awk '{ print $2 }' | cut -f1 -d/)" ]; then echo '
- ' echo "$(nmblookup -A "$i" | sed -n -e 2p | awk '{print $1}')" '' "$i" '' echo '

  ' for x in $(smbclient -L $i -U"$user%$pass" -g 2> /dev/null | grep "|" | grep -v '\$|'); do echo "
  " "$(echo "$x" | cut -f2 -d"|")" '' done echo '

' fi #Utiliza o smbclient para identificar as pastas compartilhadas #smbclient -L $i -U"user%pass" done echo '

' IFS=$OIFS ################### # Close content div echo '' ############## # Start footer echo '
' echo ' ' ######### # The end echo '
'