문제

I'm not really sure where to start. I'm supposed to use netcat to allow anyone to access my shell remotely in C. I know I need to need to use sockets, but not sure what else. Can anyone point me in the right direction. Basically when I execute the program, I want it to open "nc -l 1234", take in commands from the client and respond. Thanks.

도움이 되었습니까?

해결책

Try something like

mkfifo temp
nc -l 1234 < temp 2>&1 | /bin/sh > temp 2>&1

다른 팁

you can try

$nc -l 1234 -e /bin/bash -i  (server)

$nc x.x.x.x 1234  (client)

We have created a netcat server and indicated it to run /bin/bash command when connection is successful.

This is a good reference for it . (using c)

http://www.cs.swarthmore.edu/~aviv/classes/f12/cs43/labs/lab4/lab4.pdf
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top