Arrow keys etc on target machine

Just started here and I would like to know:
Is it normal that some keys not working properly on target machine?
For example if I am in Lame machine and try to edit file with Vim, hjkl-keys don’t work so it is almost impossible to edit anything.
Also nano was behaving funnily (for example ctrl-x do not work)
If I am trying to cat a file, ctrl-d is not working so I can’t save and quit normally.
Also arrow keys are not working normally.
I have tried different terminals and different TERM settings.
I have tried 3 different linux machines: Kali on VM, normal Kali and Mint.

I am quite inexperienced with linux settings so before I start to reinstall and configure everything from beginning it would be helpful to know that there is way around this and people can use Vim normally in target machines?

No problems with keys normally, only when I am in exploited machine.

Thank you for your help in advance!

This is extremely normal, especially in reverse shells. (such as nc)
If you want a fully TTY and stable netcat shell, I would recommend checking this out, it’ll also make sure the arrow keys work.

And for the vim and nano issue… I haven’t really found a fix to that, if someone has; I’d love to know how! I mainly now just copy the contents of a file, and use vim on my machine and edit to my need, transfer the file back to the target machine into /tmp and overwrite where it’s needed.

Thank you so much!
You saved me lot of work and headache!

Type your comment> @gth276 said:

Thank you so much!
You saved me lot of work and headache!

You’re welcome, good luck with your hacking.

@PapyrusTheGuru With an interactive shell (SSH or NC xterm matched shells) you can easily use Nano without errors. I really don’t know about VIM in NC shells.

Type your comment> @gunroot said:

@PapyrusTheGuru With an interactive shell (SSH or NC xterm matched shells) you can easily use Nano without errors. I really don’t know about VIM in NC shells.

:open_mouth: I didn’t know about that. (NC xterm matched shells)
I’ll try it out in a bit, thank you so much!

https://codedblossom.com/blog/hackthebox/travel/#running-the-exploit

Just follow how she upgraded the NC reverse shell. :slight_smile:

I also would like to add that rlwrap is sometimes useful in these situations if you don’t want a fully interactive shell