netcat으로 다양한 전송 (그림)
                                            
                                                
                                                
                                                
                                                
                                                
                                                 3458 단어  ShellScriptBashnetcat리눅스네트워크
                    
범례
nc는 i를 so에, si를 o에 연결합니다.
포트 포워딩
client:1111 과 server:2222 를 연결한다.
clientmkfifo fifo
<fifo nc -l 1111 | nc server 2222 >fifo
while ... done 을 붙이면(자), 1번의 커넥션으로 종료하지 않는다.
 실행 예
다음 순서대로 수행해야합니다.
serverpython3 -m http.server 2222
Serving HTTP on 0.0.0.0 port 2222 (http://0.0.0.0:2222/) ...
11.11.11.11 - - [23/Jun/2021 04:18:07] "GET / HTTP/1.1" 200 -
clientrm -f fifo && mkfifo fifo && while true; do <fifo nc -l 1111 | nc server 2222 >fifo; done
clientcurl localhost:1111
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Directory listing for /</title>
</head>
<body>
<h1>Directory listing for /</h1>
<hr>
<ul>
<li><a href="fifo">fifo</a></li>
</ul>
<hr>
</body>
</html>
 
 client끼리 연결
client1 과 client2 를 server 를 통해 접속.
servermkfifo fifo
<fifo nc -l 1111 | nc -l 2222 >fifo
 실행 예
server 를 최초로 실행할 필요가 있다. 그 이외는 순부동.
serverrm -f fifo && mkfifo fifo && while true; do <fifo nc -l 1111 | nc -l 2222 >fifo; done
client1nc server 1111
client2nc server 2222
  
                
                    
        
    
    
    
    
    
                
                
                
                
                    
                        
                            
                            
                            Reference
                            
                            이 문제에 관하여(netcat으로 다양한 전송 (그림)), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
                                
                                https://qiita.com/yabeenico/items/c1a1c7c20bdf6a63526d
                            
                            
                            
                                텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                            
                            
                                
                                
                                 우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                            
                            
                        
                    
                
                
                
            
mkfifo fifo
<fifo nc -l 1111 | nc server 2222 >fifo
python3 -m http.server 2222
Serving HTTP on 0.0.0.0 port 2222 (http://0.0.0.0:2222/) ...
11.11.11.11 - - [23/Jun/2021 04:18:07] "GET / HTTP/1.1" 200 -
rm -f fifo && mkfifo fifo && while true; do <fifo nc -l 1111 | nc server 2222 >fifo; done
curl localhost:1111
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Directory listing for /</title>
</head>
<body>
<h1>Directory listing for /</h1>
<hr>
<ul>
<li><a href="fifo">fifo</a></li>
</ul>
<hr>
</body>
</html>
client1 과 client2 를 server 를 통해 접속.
server
mkfifo fifo
<fifo nc -l 1111 | nc -l 2222 >fifo
실행 예
server 를 최초로 실행할 필요가 있다. 그 이외는 순부동.
server
rm -f fifo && mkfifo fifo && while true; do <fifo nc -l 1111 | nc -l 2222 >fifo; done
client1
nc server 1111
client2
nc server 2222
 
                Reference
이 문제에 관하여(netcat으로 다양한 전송 (그림)), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/yabeenico/items/c1a1c7c20bdf6a63526d텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)