Hack Forums
Reverse Shell Help:: /bin/sh: (BASH), Linux, Netcat -lvp, PATH[] questions. - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45)
+--- Forum: Grayhat • Purple Team • Hybrid Security (https://hackforums.net/forumdisplay.php?fid=449)
+---- Forum: Website Hacking (https://hackforums.net/forumdisplay.php?fid=43)
+---- Thread: Reverse Shell Help:: /bin/sh: (BASH), Linux, Netcat -lvp, PATH[] questions. (/showthread.php?tid=5405561)



Reverse Shell Help:: /bin/sh: (BASH), Linux, Netcat -lvp, PATH[] questions. - Skidy - Sep 14, 2016

I have a few questions I was hoping someone on here could answer. I am starting to learn about using reverse shells and wanted to know what does: /bin/sh: 0: can't access tty; job control turned off mean? What does BASH mean within Linux? What does the -lvp mean in Netcat when listening to a port?

And finally,

There was a Virtual Machine where in which you gain access to the server using a reverse shell and have to access a file. When you run the file it does 'cat: home/mike/msg.txt'. Then apparently you need to run the bin/bash command (whatever that means) and change the PATH variable to get the file to execute?

If that last point doesn't make sense:
Spoiler (Click to View)

Are there any good tutorials explaining all of the terminal stuff? I thought it was just connecting to the other machines linux terminal?


* - Gee4rce - Sep 15, 2016

I am at work so my respond is limited:

Skidy Wrote:"/bin/sh: 0: can't access tty; job control turned off"
Never faced this message, so i must pass on this. Google results may help though: click here

Skidy Wrote:"What does BASH mean within Linux?"
Bash stands for: Bourne again shell) and basically describes the systems command processor.
You can think of like a systems internal scripting language.

Skidy Wrote:"What does the -lvp mean in Netcat when listening to a port?"
l = listen (this will open a socket on the machine for listening, meaning if you send a command to the server to this port, it gets processed as the server is listening on that port for commands)
v = verbose (a more advanced output that gives you like debugging details)
p = port

Skidy Wrote:"When you run the file it does 'cat: home/mike/msg.txt' "
cat = outputting file content... run it like this:
Code
cat /home/mike/msg.txt

[quote='Skidy']
"Are there any good tutorials explaining all of the terminal stuff?"
In general when working with linux, you can always use "man netcat" (or "man <toolsname>") for the full documentation of a tool.
With -h you can get an overview of the most used args (args = -h or -lvp like mentioned above). Try this with netcat, i am sure you will atleast find -p and -v explained,
and if you use "man netcat" you will for sure will find also the -l parameter explained.

Besides the inbuilt help, you will always find good help at stackoverflow.com or stackexchange.com
(no need to vist these pages, just google your question and these pages mostly contain results to it in the first google page).

Feel free to get back if you have more Linux (or other) questions.

EDIT: As linux flavour i can recommend you Debian as it is more easy for beginners as a suse or redhat. Ubuntu i am no fan of, its a nice and comfortable flavour just like Debian,
but i had too much random problems with it and therefore can't really recommend it.

Hope this helped,
cheers, Gee.