View Issue Details

IDProjectCategoryView StatusLast Update
0005827Kali LinuxFeature Requestspublic2019-12-05 14:12
Reporterthe6thv3n0m Assigned Todaniruiz  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionreopened 
Summary0005827: KALI-UNDERCOVER FEATURE
Description

Love the concept of this newly added feature. Tested it out with no issues. Just wanted to make a suggestion that perhaps it could be taken a step further and set the default prompt in the shell to resemble the Windows command prompt:

export PS1='C:${PWD//\//\}> '

Great job.

Attached Files
kali-undercover.png (370,553 bytes)

Activities

daniruiz

daniruiz

2019-12-01 18:37

manager   ~0011507

I'll add it for next update ;)
By the way, this change will only affect terminals opened after the switch to undercover mode, but still a nice detail

the6thv3n0m

the6thv3n0m

2019-12-03 01:35

reporter   ~0011555

Just some rough thoughts on dealing with terminals that are already open. Just requires that the xdotool be installed.

Using the xdotool, search for all of the open terminals and store in an array:
TERMS=( $(xdotool search --name "root@") )
echo ${TERMS[@]}
75497478 79691782 65011718 71303174

For the DOS terminal, set the following variable:
n=$(printf '%s\n' 'export PS1='"'"'C:${PWD//\//\}>'" '")

Use the xdotool to set the prompt in the open terminal. This is just using a single terminal window id as an example:
xdotool windowfocus 65011718 type "$n" && xdotool windowfocus 65011718 key Return && xdotool windowfocus 65011718 type clear && xdotool windowfocus 65011718 key Return

To restore the original prompt set the following variable:
o=$(printf '%s' 'export PS1='"'"'[\e]0;\u@\h: \w\a]${debian_chroot:+($debian_chroot)}[\033[01;31m]\u@\h[\033[00m]:[\033[01;34m]\w[\033[00m]\$ '"'")

Then repeat the previous xdotool command to set the prompt changing the variable:
xdotool windowfocus 65011718 type "$o" && xdotool windowfocus 65011718 key Return && xdotool windowfocus 65011718 type clear && xdotool windowfocus 65011718 key Return

daniruiz

daniruiz

2019-12-05 14:12

manager   ~0011582

While I like the idea and I also been trying some other methods to implement this, I think its a bit overcomplicated and may end being a failure point. Even more, I don't think overwriting your currently opened terminals is a good idea, imagine if another process is running on it...

Thank you anyway ;)

PD: A change that I am going to apply is exporting that prompt at the end of the script, so that if you call kali-undercover from the terminal at least that terminal changes the prompt immediately

Issue History

Date Modified Username Field Change
2019-11-27 17:39 the6thv3n0m New Issue
2019-11-27 17:39 the6thv3n0m File Added: kali-undercover.png
2019-12-01 18:13 daniruiz Assigned To => daniruiz
2019-12-01 18:13 daniruiz Status new => assigned
2019-12-01 18:37 daniruiz Note Added: 0011507
2019-12-02 11:09 daniruiz Status assigned => resolved
2019-12-02 11:09 daniruiz Resolution open => fixed
2019-12-03 01:35 the6thv3n0m Status resolved => feedback
2019-12-03 01:35 the6thv3n0m Resolution fixed => reopened
2019-12-03 01:35 the6thv3n0m Note Added: 0011555
2019-12-05 14:12 daniruiz Note Added: 0011582
2019-12-05 14:12 daniruiz Status feedback => closed