netcat-openbsd에 '-e' 옵션이 누락된 이유는 무엇입니까?

netcat-openbsd에 '-e' 옵션이 누락된 이유는 무엇입니까?

-e패키지 에 옵션이 누락된 이유 는 무엇입니까 netcat-openbsd? 패키지 가 있지만 netcat-traditionalOpenBSD 패키지에는 없는 많은 기능이 있습니다. 저는 리눅스 민트 16을 실행하고 있습니다.

이것이 왜 누락되었는지 아는 사람이 있습니까? 이는 netcat의 상당히 큰 기능을 제거합니다.

답변1

프로그램의 버전이 다양하기 때문입니다.

netcatPOSIX에 지정된 다른 많은 표준 유틸리티와 달리 지원해야 하는 옵션을 설명하는 "표준"은 없습니다 . OpenBSD netcat, FreeBSD,GNU 넷캣, 등등.

OpenBSD 변종의 경우맨페이지에는 다음과 같은 내용이 나와 있습니다.:

There is no -c or -e option in this netcat, but you still can execute a
 command after connection being established by redirecting file descriptors.
 Be cautious here because opening a port and let anyone connected execute
 arbitrary command on your site is DANGEROUS. If you really need to do this,
 here is an example:

 On ‘server’ side:

       $ rm -f /tmp/f; mkfifo /tmp/f
       $ cat /tmp/f | /bin/sh -i 2>&1 | nc -l 127.0.0.1 1234 > /tmp/f

 On ‘client’ side:

       $ nc host.example.com 1234
       $ (shell prompt from host.example.com)

 By doing this, you create a fifo at /tmp/f and make nc listen at port 1234
 of address 127.0.0.1 on ‘server’ side, when a ‘client’ establishes a
 connection successfully to that port, /bin/sh gets executed on ‘server’
 side and the shell prompt is given to ‘client’ side.

 When connection is terminated, nc quits as well. Use -k if you want it keep
 listening, but if the command quits this option won't restart it or keep nc
 running. Also don't forget to remove the file descriptor once you don't
 need it anymore:

       $ rm -f /tmp/f

답변2

마지막 버전에서는 netcat에 대한 일부 소스에서 실행 명령을 활성화하는 정의도 발견했습니다. 일반적으로 보안상의 이유로 비활성화되어 있습니다.

하지만 난 다른 해결 방법을 찾았어

http://www.commandlinefu.com/commands/view/11061/emlating-netcat-e-netcat-traditional-or-netcat-openbsd-with-the-gnu-netcat

관련 정보