K
K
Kirill Zimin2019-12-10 17:15:55
linux
Kirill Zimin, 2019-12-10 17:15:55

How to proxy traffic without changes on the client?

Given:
There is Host A, for which the analogue of Roskomnadzor banned access to Host C.
There is Host B, to which Host A has access.
Host B has Host C not banned.
On Host A only user rights.
The software on Host A does not know how to use a proxy.
Host B is completely in control.
Host A really wants to communicate with host C using an unknown protocol.
On hosts A and B linux.
Question:
How can I make a sort of proxy on Host B that would redirect requests from Host A to Hot C and responses from Host C to Host A, while not manipulating Host A? Simply by changing the address of Host C to the address of Host B in the software on Host A.
UPD:
Maybe I put it wrong, don’t cling to the word “proxy”, in fact, it’s just about redirecting Host A traffic to Host C on Host
B. Something tells me that a few iptables rules on B will suffice
. set or change nothing, just change the connection address (from address C to address B)

Answer the question

In order to leave comments, you need to log in

4 answer(s)
W
WinPooh32, 2019-12-10
@astraleuro

$ man socat

Socat is a command line based utility that establishes two bidirectional byte streams and transfers data between them. Because the streams can be constructed from a large set of different types of data sinks and sources (see address types), and because lots of address options may be applied to the streams, socat can be used for many different purposes.
...
It is possible through iptables on host B

A
alex1478, 2019-12-10
@alex1478

If on A linux, and the software does not know how to use a proxy, then torsocks will help

P
pfg21, 2019-12-10
@pfg21

google soxifiers - programs wrapping packets into sox-proxy.
option 2: extend vpn from A to B

A
Artem @Jump, 2019-12-10
Tag

How to make a kind of proxy on Host B that would redirect requests from Host A to Hot C and responses from Host C to Host A, without manipulating Host A? Simply by changing the address of Host C to the address of Host B in the software on Host A.
Masquerading. iptables rule.
Something tells me that a few iptables rules on B will suffice.
Two or three rules depending on the situation. Normal NAT in fact.
Google - iptables port forwarding examples on the net a bunch.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question