Results 1 to 10 of 10

Thread: Problems upgrading a Python tty shell in Kali 2022.2

  1. #1
    Join Date
    2022-May
    Posts
    2

    Question Problems upgrading a Python tty shell in Kali 2022.2

    Hi,

    I got my base Kali Linux VMWare image from (https://help.offensive-security.com/...irtual-Machine) which is 2021.3 and I performed apt update and apt upgrade to install the latest packages.

    I encountered this problem while interacting with reverse shells using Kali Linux. I think this is a usage problem, probably more related to bash or the terminal I am using.

    My Kali Linux VM information is as follows:
    Code:
    No LSB modules are available.
    Distributor ID: Kali
    Description:    Kali GNU/Linux Rolling
    Release:        2022.2
    Codename:       kali-rolling
    The typical way to upgrade a Python tty shell usually includes the following steps:
    • python -c "import pty;pty.spawn('/bin/bash');"
    • Ctrl + Z
    • stty raw -echo; fg (my Kali Linux image is using zsh, so I read that I had to put "fg" on the same line)
    • Enter
    • Enter
    • export TERM=xterm
    • export SHELL=bash
    • stty rows 32 cols 128


    However, even with the steps, tab auto-complete and arrow keys still do not work. Pressing the arrow keys will display the escape characters (^[[A, etc). When I revert the Kali VMWare image to 2021.3, the steps work and I can use tab auto-complete and the arrow keys.

    What has changed in Kali 2022.2 that now causes this change? How can I resolve this?

  2. #2
    Join Date
    2022-May
    Posts
    2
    Hi,

    I was wondering if any of the folks who maintain Kali Linux will be able to chime in on this? Which packages should I revert in order to solve this problem?

  3. #3
    Join Date
    2018-Jun
    Posts
    31
    This would do better as a bugs.kali.org report. Will look into this and see, and will report it if I can replicate the issue.

  4. #4
    Join Date
    2022-Aug
    Posts
    4
    Quote Originally Posted by MalGeek View Post
    Hi,

    I got my base Kali Linux VMWare image from (https://help.offensive-security.com/...irtual-Machine) which is 2021.3 and I performed apt update and apt upgrade to install the latest packages.

    I encountered this problem while interacting with reverse shells using Kali Linux. I think this is a usage problem, probably more related to bash or the terminal I am using.

    My Kali Linux VM information is as follows:
    Code:
    No LSB modules are available.
    Distributor ID: Kali
    Description:    Kali GNU/Linux Rolling
    Release:        2022.2
    Codename:       kali-rolling
    The typical way to upgrade a Python tty shell usually includes the following steps:
    • python -c "import pty;pty.spawn('/bin/bash');"
    • Ctrl + Z
    • stty raw -echo; fg (my Kali Linux image is using zsh, so I read that I had to put "fg" on the same line)
    • Enter
    • Enter
    • export TERM=xterm
    • export SHELL=bash
    • stty rows 32 cols 128


    However, even with the steps, tab auto-complete and arrow keys still do not work. Pressing the arrow keys will display the escape characters (^[[A, etc). When I revert the Kali VMWare image to 2021.3, the steps work and I can use tab auto-complete and the arrow keys.

    What has changed in Kali 2022.2 that now causes this change? How can I resolve this?
    I'm having the same issue.
    Am unable to fully upgrade a shell using bash or zsh.

  5. #5
    Join Date
    2022-Aug
    Posts
    4
    I'm having the same issue.
    Am not able to upgrade my shell using bash or zsh.
    Am using powerlevel10k for zsh theme and TMUX with XFCE-Terminal.

    Seems to be related to 2022.2 as this did not occur for me on the previous Kali 2021.3 using the same shell configuration and terminal.

  6. #6
    Join Date
    2021-May
    Location
    UK
    Posts
    507
    If you have updated from 2021.3 to 2022.2 then your bash and zsh profiles need to be rebuild, including powerlevel prompt, run the config again.

  7. #7
    Join Date
    2022-Aug
    Posts
    4
    This is on a fresh 2022.2 install. To clarify, on a separate 2021.3 install it worked properly.

    I'll make a snapshot and see if a update / full-upgrade will resolve the issue.

  8. #8
    Join Date
    2022-Aug
    Posts
    4
    Am not sure if this is due to some custom shell configurations or terminal issue.
    using oh-my-zsh , oh-my-tmux, powerlevel10k and XFCE-Terminal
    Not 100% sure this is what's causing the issue. Have tried using bash also but CTRL+C still terminates my nc shell after the usual upgrade tty steps in zsh and bash.

    .zshrc settings,
    Code:
    export ZSH="$HOME/.oh-my-zsh"
    ZSH_THEME="powerlevel10k/powerlevel10k"
    
    plugins=(docker docker-compose fd fzf git golang tmux virtualenv zsh-autosuggestions zsh-syntax-highlighting)
    source $ZSH/oh-my-zsh.sh
    
    ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
    ZSH_HIGHLIGHT_STYLES[single-hyphen-option]=fg=magenta
    ZSH_HIGHLIGHT_STYLES[double-hyphen-option]=fg=magenta
    export TERMINAL="xterm-256color"
    
    bindkey \^U backward-kill-line
    
    [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
    POWERLEVEL9K_INSTANT_PROMPT=quiet
    
    [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
    Kali Version
    Code:
    NAME="Kali GNU/Linux"
    ID=kali
    VERSION="2022.3"
    VERSION_CODENAME="kali-rolling"
    architecture
    Code:
    Linux 5.18.0-kali5-amd64 #1 SMP PREEMPT_DYNAMIC Debian 5.18.5-1kali6 (2022-07-07) x86_64 GNU/Linux

  9. #9
    I also have the same problem, is there a definite solution for this?

    My Kali version : 2022.3 5.19.11-1kali2 (2022-10-10) aarch64 GNU/Linux

  10. #10
    I am having the exactly the same issue, gone through all the step mentioned in https://blog.ropnop.com/upgrading-si...eractive-ttys/, still not working. even tried drop to the bash, same thing.

    ```
    ctrl + z
    stty raw -echo ; fg
    reset
    stty rows # columns #
    export TERM=xterm-256color
    export SHELL=/bin/bash
    exec /bin/bash
    ```
    my os is Kali 2022.3

    really hope can have a solution.

Similar Threads

  1. Does anyone have problems with Terminal on Nethunter 2022.1?
    By Mike9876 in forum NetHunter General Questions
    Replies: 2
    Last Post: 2022-06-09, 00:15
  2. Python giving me problems in kali linux
    By Musa_Faila in forum General Archive
    Replies: 0
    Last Post: 2020-10-06, 23:08
  3. problems while upgrading kali
    By baudouin in forum Installing Archive
    Replies: 2
    Last Post: 2020-02-24, 09:41
  4. Replies: 1
    Last Post: 2016-02-26, 05:43
  5. Replies: 5
    Last Post: 2014-11-09, 19:22

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •