Kali Linux は Bash コマンド "set" を使用して奇妙なコード行を表示します。

Kali Linux は Bash コマンド

Debian/GNU Linux("wheezy")ベースのディストリビューションであるKali8をインストールしました。 LXterminalと同様に、Bashの組み込みコマンド「set」を使用してXで変数をチェックすると、すべてがうまくいきます。これを行うには、コンソールVTまたはSSH / Puttyを介してログインすると、いくつかの変数と複数行のコードが表示されます。

もう一つのことは、数週間前にシステムを最初にインストールしたときにリストが短くなり、行数が徐々に増え、時間の経過とともにリストが長くなるということです。リストには常に先頭になければならない実際の変数があり、最後に同じコード行があるため、追加された行が途中にあるとします。最後の項目を確認するためにリストをファイルにパイプし、数日後にやり直して、サイズが大きくなることを確認します。

とにかく、何千行もの未知のスクリプトコードが印刷されているという事実を解決する理由と方法を知っている人はいますか?

例は次のとおりです。


root@kali:~# set
BASH=/bin/bash
BASHOPTS=checkwinsize:cmdhist:expand_aliases:extglob:extquote:force_fignore:interactive_comments:$
BASH_ALIASES=()
BASH_ARGC=()
BASH_ARGV=()
BASH_CMDS=()
BASH_COMPLETION_COMPAT_DIR=/etc/bash_completion.d
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="4" [1]="2" [2]="37" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu")
BASH_VERSION='4.2.37(1)-release'
COLUMNS=80
COMP_WORDBREAKS=$' \t\n"\'>=;|&(:'
DIRSTACK=()
EUID=0
GROUPS=()
HISTFILE=/root/.bash_history
HISTFILESIZE=500
HISTSIZE=500
HOSTNAME=kali
HOSTTYPE=x86_64
IFS=$' \t\n'
LANG=en_US.UTF-8
LIBGL_DRIVERS_PATH=/usr/lib32/dri:/usr/lib64/dri
LINES=24
LOGNAME=root
LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;$
LS_OPTIONS='--color=auto -F'
MACHTYPE=x86_64-pc-linux-gnu
MAIL=/var/mail/root
MAILCHECK=60
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PIPESTATUS=([0]="1" [1]="0")
PPID=10987
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
PS4='+ '
PWD=/root
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
SHLVL=1
SSH_CLIENT='192.168.10.143 10827 22'
SSH_CONNECTION='192.168.10.143 10827 192.168.10.104 22'
SSH_TTY=/dev/pts/1
TERM=xterm
UID=0
USER=root
XDG_SESSION_COOKIE=fb89d5d02d263ebdcf49f3a551dccb8b-1374307938.708154-385548377
_=
__colormgr_commandlist=$'\n    create-device\n    create-profile\n    delete-device\n    delete-p$
__git_all_commands=
__git_diff_common_options=$'--stat --numstat --shortstat --summary\n\t\t\t--patch-with-stat --nam$
__git_fetch_options=$'\n\t--quiet --verbose --append --upload-pack --force --keep --depth=\n\t--t$
__git_log_common_options=$'\n\t--not --all\n\t--branches --tags --remotes\n\t--first-parent --mer$
__git_log_date_formats='relative iso8601 rfc2822 short local default raw'
__git_log_pretty_formats='oneline short medium full fuller email raw format:'
__git_log_shortlog_options=$'\n\t--author= --committer= --grep=\n\t--all-match\n'
__git_merge_options=$'\n\t--no-commit --no-stat --log --no-log --squash --strategy\n\t--commit --$
__git_merge_strategies=
__git_mergetools_common=$'diffuse ecmerge emerge kdiff3 meld opendiff\n\t\t\ttkdiff vimdiff gvimd$
__git_porcelain_commands=
__git_send_email_confirm_options='always never auto cc compose'
__git_send_email_suppresscc_options='author self cc bodycc sob cccmd body all'
__git_whitespacelist='nowarn warn error error-all fix'
__grub_script_check_program=grub-script-check
_backup_glob='@(#*#|*@(~|.@(bak|orig|rej|swp|dpkg*|rpm@(orig|new|save))))'
_xspecs=([freeamp]="!*.@(mp3|ogg|pls|m3u)" [cdiff]="!*.@(dif?(f)|?(d)patch)?(.@([gx]z|bz2|lzma))"$
__colormgrcomp ()
{
    local all c s='
' IFS=' ''      ''
';
    local cur="${COMP_WORDS[COMP_CWORD]}";
    if [ $# -gt 2 ]; then
    fi;
    for c in $1;
    do
        case "$c$4" in
            *.)
                all="$all$c$4$s"
            ;;
            *)
                all="$all$c$4 $s"
            ;;
        esac;
    done;
    IFS=$s;
    COMPREPLY=($(compgen -P "$2" -W "$all" -- "$cur"));
    return
}
__dconf ()
{
    local choices;
...

********... thousands of lins after... **********
...
{
    local userland=$( uname -s );
    [[ $userland == @(Linux|GNU/*) ]] && userland=GNU;
    [[ $userland == $1 ]]
}
_variables ()
{
    if [[ $cur =~ ^(\$\{?)([A-Za-z0-9_]*)$ ]]; then
        [[ $cur == *{* ]] && local suffix=} || local suffix=;
        COMPREPLY+=($( compgen -P ${BASH_REMATCH[1]} -S "$suffix" -v --             "${BASH_REMAT$
        return 0;
    fi;
    return 1
}
_xfunc ()
{
    set -- "$@";
    local srcfile=$1;
    shift;
    declare -F $1 &>/dev/null || {
        local compdir=./completions;
        [[ $BASH_SOURCE == */* ]] && compdir="${BASH_SOURCE%/*}/completions";
        . "$compdir/$srcfile"
    };
    "$@"
}
_xinetd_services ()
{
    local xinetddir=/etc/xinetd.d;
    if [[ -d $xinetddir ]]; then
        local restore_nullglob=$(shopt -p nullglob);
        shopt -s nullglob;
        local -a svcs=($( printf '%s\n' $xinetddir/!($_backup_glob) ));
        $restore_nullglob;
        COMPREPLY+=($( compgen -W '${svcs[@]#$xinetddir/}' -- "$cur" ));
    fi
}
quote ()
{
    local quoted=${1//\'/\'\\\'\'};
    printf "'%s'" "$quoted"
}
quote_readline ()
{
    local quoted;
    _quote_readline_by_ref "$1" ret;
    printf %s "$ret"
}


root@kali:~#

PS:しかし、おそらく主題から逸脱したものでしょう。上記の行はでなければなりませんが、StackExchange MarkDownやHTMLと混同されているのでCOMP_WORDBREAKS=$' \t\n"\'><=;|&(:'削除する必要がありました…私の投稿には表示されません...うーん...奇妙です。<>

ベストアンサー1

Bash Completeは定義された関数を使用します。 Debianはファイルを/etc/bash_completionインポートし、ソースファイル内のすべてのファイルをインポートします/etc/bash_completion.d。一部のコマンドラインアプリケーションは新しい完成ファイルをインストールします。gitあなたの出力は良い例です。git che[TAB]fetchなどのタスクをタブに移動できますgit checkout。高度な補完機能が必要ない場合は、. /etc/bash_completionシェル初期化ファイルから削除してください。

おすすめ記事