DEV Community

Phongphan Phienphanich
Phongphan Phienphanich

Posted on

1 1

[UPDATE] มุด Proxy ย้อนกลับ

จากการโพส https://dev.to/kapong/proxy-3pcm ลง Facebook แล้วได้คำแนะนำจาก @นเรศ เก็จรัมย์ พบว่ามีวิธีที่สั้นกว่ามาก โดย SSH Client สามารถทำ SOCKS Proxy ได้ในตัวอยู่แล้ว (จริงๆ เอาไว้เพื่อทำ Tunnel) เราก็สามารถใช้ SOCKS ตัวนั้นเป็น Proxy Server ย้อนกลับมาได้เลย

ด้วย

$ ssh -R <port> <user>@<host>
Enter fullscreen mode Exit fullscreen mode

หลังจากนั้น เมื่อเข้าไป Server แล้วก็กำหนด HTTP Proxy เพื่อใช้งานได้โดย

export {http,https,ftp,rsync,dns}_proxy=socks5h://127.0.0.1:<port>
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
Enter fullscreen mode Exit fullscreen mode

ก็เสร็จเลย ข้ามไปหลายขั้นตอนเลยทีเดียว

เพิ่มเติม 1

มี software ที่จะช่วยให้ใช้ proxy http เป็นบางคำสั่งได้ นั่นคือ proxychains ลองค้นๆต่อเอานะ ก็สะดวกไปอีกแบบ

เพิ่มเติม 2

เปลี่ยน -R เป็น -D คือกลับทิศกัน

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay