λ³Έλ¬Έ λ°”λ‘œκ°€κΈ°
πŸ§…λ‹€ν¬λ„·, 닀크웹/ν”„λΌμ΄λ²„μ‹œ

ν”„λΌμ΄λ²„μ‹œ - Ncat νŠΉμ • 포트 터널링 with i2p 접속

by Janger 2023. 2. 11.
728x90
λ°˜μ‘ν˜•

Ncat에도 νŠΉμ •ν•œ 포트λ₯Ό ν¬μ›Œλ”©ν•˜λŠ” 것이 κ°€λŠ₯ν•˜λ‹€. 

 

https://janger.tistory.com/161

 

λ¦¬λˆ…μŠ€ - SSH 터널링을 μ΄μš©ν•˜μ—¬ νŠΉμ • 포트λ₯Ό 포트 ν¬μ›Œλ”©

둜컬(Local)μ—μ„œ 원격 μ„œλ²„(Remote) 접속, 원격 μ„œλ²„μ˜ 포트λ₯Ό ν¬μ›Œλ”© ssh -L 8080:127.0.0.1:80 server_username@server_ip - ν΄λΌμ΄μ–ΈνŠΈκ°€ localhost:8080으둜 μ ‘μ†ν•˜λ©΄ μ„œλ²„μ˜ 80번 포트(μ›Ή μ„œλ²„)둜 접속이 λ˜κ²Œλ” 원

janger.tistory.com

 

 

예λ₯Ό λ“€μ–΄ μ„œλ²„λ§Œ 접속할 수 μžˆλŠ” localhost:4444(i2p router)λ₯Ό μ™ΈλΆ€μ—μ„œ μ ‘μ†ν•˜κ³  싢을 경우

 

μ „μ œ 쑰건으둜 μ„œλ²„μ— μ™ΈλΆ€μ—μ„œ 접속할 수 μžˆλŠ” ν¬νŠΈκ°€ 미리 ν¬μ›Œλ”©μ΄ λ˜μ–΄ μžˆμ–΄μ•Ό 함(λ‚˜λŠ” 4545둜 μ„€μ •)

 

터널링 λͺ…λ Ήμ–΄

 

ncat -k -l -p 4545 -e "ncat 127.0.0.1 4444"

μ„œλ²„ μͺ½μ—μ„œ μœ„ λͺ…λ Ήμ–΄λ₯Ό μž…λ ₯ν•œλ‹€. μ‹€ν–‰μ‹œν‚€λ©΄ μ•„λ¬΄λŸ° 좜λ ₯이 μ•ˆ 뜨고 λŒ€κΈ° μƒνƒœκ°€ λœλ‹€. 

 

 

ν”„λ‘μ‹œ μ„€μ •

 

ν”„λ‘μ‹œμ— μ ‘μ†ν•˜λŠ” μ‚¬λžŒμ€ μ„œλ²„μ˜ 아이피 μ£Όμ†Œ, 포트 번호둜 ν”„λ‘μ‹œλ₯Ό μ„€μ •ν•΄ μ€€λ‹€. 

 

 

접속 ν™•μΈν•˜κΈ°

 

확인을 μœ„ν•΄ i2p μ‚¬μ΄νŠΈλ‘œ 접속을 ν•˜λ©΄ 잘 μ ‘μ†λ˜λŠ”κ±Έ 확인할 수 μžˆμ—ˆλ‹€. 

 

λ§ˆμ°¬κ°€μ§€λ‘œ 9050 포트(Tor Proxy)둜 λ°”κΏ”λ§Œ μ£Όλ©΄ .onion μ£Όμ†Œλ‘œ 접속이 λœλ‹€. 

 

 

 

 

 

μ ‘μ†μžκ°€ Ncat으둜 λ‘œμ»¬μ—μ„œ μžμ‹ μ˜ 포트둜 ν„°λ„λ§ν•΄μ„œ μ ‘μ†ν•˜κ²Œ ν•˜λŠ” 방법

 

μ΄λ²ˆμ—” λΈŒλΌμš°μ € ν”„λ‘μ‹œ μ„€μ •μ—μ„œ μ„œλ²„μ£Όμ†Œλ‘œ 접속을 ν•΄μ„œ ν”„λ‘μ‹œμ— μ ‘μ†ν•˜λŠ” 게 μ•„λ‹ˆλΌ

μ ‘μ†μžκ°€ localhostλ₯Ό ν†΅ν•΄μ„œ ν”„λ‘μ‹œμ— μ ‘μ†ν•˜κ²Œ ν•˜κΈ°

 

 

ncat -l -k  127.0.0.1 8081 --sh-exec "ncat ν”„λ‘μ‹œμ„œλ²„μ£Όμ†Œ 4545"

 

ν”„λ‘μ‹œ μ•„μ΄ν”Όμ—λŠ” 127.0.0.1와 포트 번호λ₯Ό λ„£μ–΄μ£Όλ©΄ 끝이닀. 

 

 

 

 

μ°Έκ³ : 

https://unix.stackexchange.com/questions/10428/simple-way-to-create-a-tunnel-from-one-local-port-to-another

 

Simple way to create a tunnel from one local port to another?

I have a development server, which is only accessible from 127.0.0.1:8000, not 192.168.1.x:8000. As a quick hack, is there a way to set up something to listen on another port (say, 8001) so that fr...

unix.stackexchange.com

 

https://unix.stackexchange.com/questions/293304/using-netcat-for-port-forwarding

 

Using netcat for port forwarding

I have a process that listens on an IP:port - in fact it is spark streaming which connects to a socket. The issue is that I wish to somehow create a server that connects to spark on one port and da...

unix.stackexchange.com

 

https://man7.org/linux/man-pages/man1/ncat.1.html

 

ncat(1) - Linux manual page

 

man7.org

 

728x90
λ°˜μ‘ν˜•