Всем привет. Есть некий сервер на ubuntu 16.04. Проблема в том, что какое-то ПО пишет странные команды в файл .bash_history:
echo $?
find / -xdev -type d 2>/dev/null | grep -P "^/opt/ibm/.*?/jre/lib$" | while read path; do if test -r "$path" && test -x "$path"; then filenames=`ls -1A "$path" 2>/dev/null | grep -x $'version.properties'; exit ${PIPESTATUS[0]};`; if [ "$?" != 0 ]; then exit 1; fi; IFS=$'\n'; for filename in $filenames; do filepath="$path"/"$filename"; if [ "$path" == "/" ]; then filepath="/$filename"; fi; if test -e "$filepath" && test ! -d "$filepath"; then perms=$(ls -ldL "$filepath" | cut -d \ -f 2 | tr -d '\n'; exit ${PIPESTATUS[0]};); if [ "$?" != 0 ]; then exit 1; fi; stats=$(stat -L --format="%A:%g:%u:%X:%Y:%Z:%s:%a" "$filepath" | tr -d '\n'; exit ${PIPESTATUS[0]};); if [ "$?" != 0 ]; then exit 1; fi; printf "%s:%s:%s\n" "$filepath" "$stats" "$perms"; ((i++)); if [ $i -ge 1024 ]; then break 2; fi; fi; done; fi; done;
echo $?
err=`( failover info ) 2>&1 >/dev/tty`; code=$?; printf "\n[[[d]]]\n%s\n[[[d]]]\n%s\n" "$code" "$err";
test -f $'/etc/SuSE-brand' && test -r $'/etc/SuSE-brand'; echo $?;
err=`( /usr/local/nagios/bin/nagios ) 2>&1 >/dev/tty`; code=$?; printf "\n[[[d]]]\n%s\n[[[d]]]\n%s\n" "$code" "$err";
err=`( find "/opt" "/usr/lib" "/usr/lib64" -path "*/bin/*" -type f -name "qmake" -exec {} --version \; 2>/dev/null | grep "Qt version" ) 2>&1 >/dev/tty`; code=$?; printf "\n[[[d]]]\n%s\n[[[d]]]\n%s\n" "$code" "$err";
sudo su -
command -v bind
echo $?
bind -v
echo $?
command -v bind
echo $?
bind -v
echo $?
command -v hostname
echo $?
hostname
echo $?
hostname --fqdn
echo $?
command -v ip
echo $?
ip -o link
echo $?
ip addr show lo
echo $?
ip route show dev lo
echo $?
command -v ethtool
echo $?
ip addr show ens32
echo $?
ip route show dev ens32
echo $?
command -v bind
echo $?
bind -v
echo $?
command -v rpm
echo $?
test -f $'/etc/lsb-release' && test -r $'/etc/lsb-release'; echo $?;
printf "%s\n" "test" | base64
echo $?
cat $'/etc/lsb-release' | base64
echo $?
test -f $'/etc/os-release' && test -r $'/etc/os-release'; echo $?;
cat $'/etc/os-release' | base64
echo $?
test -f $'/etc/SuSE-release' && test -r $'/etc/SuSE-release'; echo $?;
test -f $'/etc/debian_version' && test -r $'/etc/debian_version'; echo $?;
cat $'/etc/debian_version' | base64
echo $?
uname -a
echo $?
command -v grep
echo $?
grep -P "^a$" <<< "a" > /dev/null
echo $?
( path=$'/etc'; depth=0; rc_list_files() { local path="$1"; local depth="$2"; local filenames=`ls -1A "$path"`; if [ "$?" != 0 ]; then exit 1; fi; IFS=$'\n'; for filename in $filenames; do local filepath="$path"/"$filename"; if [ "$path" == "/" ]; then filepath=/"$filename"; fi; if test -f "$filepath" && test -r "$filepath"; then if ( grep -P "^(rosa-)?release$" <<< "$filename" > /dev/null ); then printf "%s\n" "$filepath"; ((fc++)); if [ $fc -ge 1024 ]; then exit 0; fi; fi; fi; if [ -d "$filepath" ] && [ -r "$filepath" ] && [ -x "$filepath" ]; then if [ "$depth" -ge 0 ]; then depth=$(( depth - 1 )); fi; if [ "$depth" -eq -1024 ] || [ "$depth" -ge 0 ]; then rc_list_files "$filepath" "$depth"; fi; fi; done; }; if [ "$depth" -le -1 ]; then depth=-1024; fi; if test -d "$path" && test -r "$path"; then rc_list_files "$path" "$depth"; fi; );
echo $?
test -f $'/opt/RedDatabase/bin/fb_config' && test -r $'/opt/RedDatabase/bin/fb_config'; echo $?;
test -f $'/etc/rosa-release' && test -r $'/etc/rosa-release'; echo $?;
test -e $'/etc/astra_version'; echo $?;
test -f $'/etc/system-release' && test -r $'/etc/system-release'; echo $?;
test -f $'/etc/astra_version' && test -r $'/etc/astra_version'; echo $?;
test -f $'/usr/local/nagiosxi/var/xiversion' && test -r $'/usr/local/nagiosxi/var/xiversion'; echo $?;
test -e $'/usr/local/nagios/bin/nagios' && test ! -d $'/usr/local/nagios/bin/nagios'; echo $?;
command -v dpkg-query
echo $?
dpkg-query -W -f='${Package}\t${Version}\t${Architecture}\t${Status}\t${Homepage}\t${Installed-Size}\t${Maintainer}\t${Section}\t${Source}\n'
echo $?
test -f $'/opt/skyboxview/utility/bin/version.txt' && test -r $'/opt/skyboxview/utility/bin/version.txt'; echo $?;
err=`( HDB version ) 2>&1 >/dev/tty`; code=$?; printf "\n[[[d]]]\n%s\n[[[d]]]\n%s\n" "$code" "$err";
test -f $'/etc/redhat-release' && test -r $'/etc/redhat-release'; echo $?;
grep -x "a" <<< "a" > /dev/null
echo $?
( path=$'/usr/java'; depth=5; rc_list_files() { local path="$1"; local depth="$2"; local filenames=`ls -1A "$path"`; if [ "$?" != 0 ]; then exit 1; fi; IFS=$'\n'; for filename in $filenames; do local filepath="$path"/"$filename"; if [ "$path" == "/" ]; then filepath=/"$filename"; fi; if test -e "$filepath" && test ! -d "$filepath"; then if [ "$filename" == $'java' ]; then perms=$(ls -ldL "$filepath" | cut -d \ -f 2 | tr -d '\n'; exit ${PIPESTATUS[0]};); if [ "$?" != 0 ]; then exit 1; fi; stats=$(stat -L --format="%A:%g:%u:%X:%Y:%Z:%s:%a" "$filepath" | tr -d '\n'; exit ${PIPESTATUS[0]};); if [ "$?" != 0 ]; then exit 1; fi; printf "%s:%s:%s\n" "$filepath" "$stats" "$perms"; ((fc++)); if [ $fc -ge 1024 ]; then exit 0; fi; fi; fi; if [ -d "$filepath" ] && [ -r "$filepath" ] && [ -x "$filepath" ]; then if [ "$depth" -ge 0 ]; then depth=$(( depth - 1 )); fi; if [ "$depth" -eq -1024 ] || [ "$depth" -ge 0 ]; then rc_list_files "$filepath" "$depth"; fi; fi; done; }; if [ "$depth" -le -1 ]; then depth=-1024; fi; if test -d "$path" && test -r "$path"; then rc_list_files "$path" "$depth"; fi; );
echo $?
( path=$'/home'; depth=5; rc_list_files() { local path="$1"; local depth="$2"; local filenames=`ls -1A "$path"`; if [ "$?" != 0 ]; then exit 1; fi; IFS=$'\n'; for filename in $filenames; do local filepath="$path"/"$filename"; if [ "$path" == "/" ]; then filepath=/"$filename"; fi; if test -e "$filepath" && test ! -d "$filepath"; then if [ "$filename" == $'java' ]; then perms=$(ls -ldL "$filepath" | cut -d \ -f 2 | tr -d '\n'; exit ${PIPESTATUS[0]};); if [ "$?" != 0 ]; then exit 1; fi; stats=$(stat -L --format="%A:%g:%u:%X:%Y:%Z:%s:%a" "$filepath" | tr -d '\n'; exit ${PIPESTATUS[0]};); if [ "$?" != 0 ]; then exit 1; fi; printf "%s:%s:%s\n" "$filepath" "$stats" "$perms"; ((fc++)); if [ $fc -ge 1024 ]; then exit 0; fi; fi; fi; if [ -d "$filepath" ] && [ -r "$filepath" ] && [ -x "$filepath" ]; then if [ "$depth" -ge 0 ]; then depth=$(( depth - 1 )); fi; if [ "$depth" -eq -1024 ] || [ "$depth" -ge 0 ]; then rc_list_files "$filepath" "$depth"; fi; fi; done; }; if [ "$depth" -le -1 ]; then depth=-1024; fi; if test -d "$path" && test -r "$path"; then rc_list_files "$path" "$depth"; fi; );
echo $?
( path=$'/usr/opt'; depth=5; rc_list_files() { local path="$1"; local depth="$2"; local filenames=`ls -1A "$path"`; if [ "$?" != 0 ]; then exit 1; fi; IFS=$'\n'; for filename in $filenames; do local filepath="$path"/"$filename"; if [ "$path" == "/" ]; then filepath=/"$filename"; fi; if test -e "$filepath" && test ! -d "$filepath"; then if [ "$filename" == $'java' ]; then perms=$(ls -ldL "$filepath" | cut -d \ -f 2 | tr -d '\n'; exit ${PIPESTATUS[0]};); if [ "$?" != 0 ]; then exit 1; fi; stats=$(stat -L --format="%A:%g:%u:%X:%Y:%Z:%s:%a" "$filepath" | tr -d '\n'; exit ${PIPESTATUS[0]};); if [ "$?" != 0 ]; then exit 1; fi; printf "%s:%s:%s\n" "$filepath" "$stats" "$perms"; ((fc++)); if [ $fc -ge 1024 ]; then exit 0; fi; fi; fi; if [ -d "$filepath" ] && [ -r "$filepath" ] && [ -x "$filepath" ]; then if [ "$depth" -ge 0 ]; then depth=$(( depth - 1 )); fi; if [ "$depth" -eq -1024 ] || [ "$depth" -ge 0 ]; then rc_list_files "$filepath" "$depth"; fi; fi; done; }; if [ "$depth" -le -1 ]; then depth=-1024; fi; if test -d "$path" && test -r "$path"; then rc_list_files "$path" "$depth"; fi; );
echo $?
test -f $'/usr/local/nagiosfusion/var/fusionversion' && test -r $'/usr/local/nagiosfusion/var/fusionversion'; echo $?;
test -f $'/etc/github/enterprise-release' && test -r $'/etc/github/enterprise-release'; echo $?;
( path=$'/opt'; depth=1; rc_list_files() { local path="$1"; local depth="$2"; local filenames=`ls -1A "$path"`; if [ "$?" != 0 ]; then exit 1; fi; IFS=$'\n'; for filename in $filenames; do local filepath="$path"/"$filename"; if [ "$path" == "/" ]; then filepath=/"$filename"; fi; if test -e "$filepath" && test ! -d "$filepath"; then if [ "$filename" == $'components.xml' ]; then perms=$(ls -ldL "$filepath" | cut -d \ -f 2 | tr -d '\n'; exit ${PIPESTATUS[0]};); if [ "$?" != 0 ]; then exit 1; fi; stats=$(stat -L --format="%A:%g:%u:%X:%Y:%Z:%s:%a" "$filepath" | tr -d '\n'; exit ${PIPESTATUS[0]};); if [ "$?" != 0 ]; then exit 1; fi; printf "%s:%s:%s\n" "$filepath" "$stats" "$perms"; ((fc++)); if [ $fc -ge 1024 ]; then exit 0; fi; fi; fi; if [ -d "$filepath" ] && [ -r "$filepath" ] && [ -x "$filepath" ]; then if [ "$depth" -ge 0 ]; then depth=$(( depth - 1 )); fi; if [ "$depth" -eq -1024 ] || [ "$depth" -ge 0 ]; then rc_list_files "$filepath" "$depth"; fi; fi; done; }; if [ "$depth" -le -1 ]; then depth=-1024; fi; if test -d "$path" && test -r "$path"; then rc_list_files "$path" "$depth"; fi; );
echo $?
err=`( grep -n -e "DocumentRoot" /etc/apache2/sites-available/default-ssl.conf ) 2>&1 >/dev/tty`; code=$?; printf "\n[[[d]]]\n%s\n[[[d]]]\n%s\n" "$code" "$err";
err=`( grep -n -e "DocumentRoot" /etc/httpd/conf/httpd.conf ) 2>&1 >/dev/tty`; code=$?; printf "\n[[[d]]]\n%s\n[[[d]]]\n%s\n" "$code" "$err";
test -f $'/opt/mssql/bin/sqlservr' && test -r $'/opt/mssql/bin/sqlservr'; echo $?;
test -f $'/etc/altlinux-release' && test -r $'/etc/altlinux-release'; echo $?;
test -f $'/opt/sysinfo/config/mcsysinfo.cfg' && test -r $'/opt/sysinfo/config/mcsysinfo.cfg'; echo $?;
command -v stat
echo $?
command -v find
echo $?
find / -xdev -type d 2>/dev/null | grep -P "^/opt/ibm/.*?/jre/lib$" | while read path; do if test -r "$path" && test -x "$path"; then filenames=`ls -1A "$path" 2>/dev/null | grep -x $'version.properties'; exit ${PIPESTATUS[0]};`; if [ "$?" != 0 ]; then exit 1; fi; IFS=$'\n'; for filename in $filenames; do filepath="$path"/"$filename"; if [ "$path" == "/" ]; then filepath="/$filename"; fi; if test -e "$filepath" && test ! -d "$filepath"; then perms=$(ls -ldL "$filepath" | cut -d \ -f 2 | tr -d '\n'; exit ${PIPESTATUS[0]};); if [ "$?" != 0 ]; then exit 1; fi; stats=$(stat -L --format="%A:%g:%u:%X:%Y:%Z:%s:%a" "$filepath" | tr -d '\n'; exit ${PIPESTATUS[0]};); if [ "$?" != 0 ]; then exit 1; fi; printf "%s:%s:%s\n" "$filepath" "$stats" "$perms"; ((i++)); if [ $i -ge 1024 ]; then break 2; fi; fi; done; fi; done;
echo $?
err=`( failover info ) 2>&1 >/dev/tty`; code=$?; printf "\n[[[d]]]\n%s\n[[[d]]]\n%s\n" "$code" "$err";
test -f $'/etc/SuSE-brand' && test -r $'/etc/SuSE-brand'; echo $?;
err=`( /usr/local/nagios/bin/nagios ) 2>&1 >/dev/tty`; code=$?; printf "\n[[[d]]]\n%s\n[[[d]]]\n%s\n" "$code" "$err";
err=`( find "/opt" "/usr/lib" "/usr/lib64" -path "*/bin/*" -type f -name "qmake" -exec {} --version \; 2>/dev/null | grep "Qt version" ) 2>&1 >/dev/tty`; code=$?; printf "\n[[[d]]]\n%s\n[[[d]]]\n%s\n" "$code" "$err";
Человек точно не будет такое писать)
Сервер не я настраивал.
[i]Перемещено hobbit из general[/i]