HTTPS thought shadowsocks --mptcp - https

I would like to ask if it is possible to forward HTTPS through the following diagram
A USER -> Wi-Fi -> SQUID -> SHADOWSOCKS_CLIENT -> MPTCP -> SHADOWSOCKS_SERVER -> INTERNET
HTTP is working.
We have already ask for here for advice how to use shadowsocks properly for https (https://github.com/shadowsocks/shadowsocks-libev/issues/926)
However there might be other solutions.
I would like to ask for an advice.
thank you

Related

golang get network port friendly description

I am building a port scanner to learn go, so please, don't be rude with me.
I want a way to get the description of a port programmatically in go
Example:
API.GetPortDescription(22) -> ssh
API.GetPortDescription(80) -> http
API.GetPortDescription(433) -> https
i tried parsing /etc/services file, but my poor knowledge of go didn't help
i did something similar in java

How to forward all requests on port X to localhost (Windows)

I need to forward all requests on port 200 to localhost:8080.
Here is what I tried, but I need more direction actually getting it to work. If there is a more obvious way (firewall?, browser's proxy settings?) please say.
netsh as admin
netsh interface portproxy add v4tov4 listenaddress=+ listenport=200 connectaddress=127.0.0.1 connectport=8080 protocol=tcp
This did not work for me (requests to :200 time out) whether I use * or + as listenaddress.
Local proxy.
Many options exist, but cannot find docs that deal with port forwarding for any of them. Spent lots of time with Acrylic but my experiments all failed. Pointers to docs or actual rules would help loads.
Acrylic
Privoxy (formerly JunkBusters)
Fiddler (referred to on S.O., but not current)
Ergo (or perhaps Ergo?)
Proximodo (formerly proxomitron. Abandoned?)
Karma (abandoned?)
Browser Plugins.
I am sure there are some, but cannot find any. Installed uMatrix and spent an hour understanding its rules before realizing that it cannot do this at all.
External Port Forwarding, with the router or Pi-Hole.
I don't have piHole, and am using a no-name router provided and locked by my local ISP. I could probably ask them to open it, but is that worth pursuing?
VPN software.
I would guess that there is VPN software that has routing options. Not sure, and wouldn't know where to start.
Please advise!

Sending HTTPS POST request with ABAP

I'm trying to send https post request using either FM HTTP_POST or class CL_HTTP_CLIENT but I wasn't successful yet.
To test my code I'm using https://ptsv2.com.
When posting to HTTP everything works fine but when I send a request to HTTPS I'm getting:
"OpenSSL not available" for rfc destination SAPHTTP.
"SapSSL error: SSSLERR_SSL_CONNECT" for default rfc destination -
SAPHTTPA
I think the problem might be from the BASIS site, I've already tried doing some magic with SM59/STRUST but those changed nothing so I was probably just messing around.
If anyone has any tips or sample codes(preferably with adresses to test) I'd be happy to try it out :)
You need to install the server SSL certificate root CA with t-code STRUST into the PSE SSL Client (Anonymous). Also you need to know the exact handshake configuration with your server. If your server only supports TLS 1.2, your SAP system must have commoncryptolib (sapcryptolib) at least 8.431 and the profile parameter ssl/client_ciphersuites must be configured. You can check the commoncryptolib version with the program SSF02.
If you need to investigate in details, you can go to t-code SMICM. Configure the trace level as 2 (Goto -> Trace Level -> Set). Reset trace file (Goto -> Trace File -> Reset) for removing old logs. Run your program again and check trace file (Goto -> Trace File -> Display All).
STRUST won't help, if you try to connect from the SAP GUI. This is where destination SAPHTTP goes to. In this case SAP note 2979489 might help.

How to get the original PID of a TCP connection in Windows using GetExtendedTcpTable?

I am trying to get the PID of the process making local connections to a local http server from inside the server. eg: Chrome-> HTTPREQ -> httpServer:8080. So from the httpServer I can know which process is making the connection, in this case Chrome.
I can query all the tcp connections using GetExtendedTcpTable with TCP_TABLE_OWNER_MODULE_ALL and then check each row and use row->dwOwningPid
8080 == ntohs(row->dwRemotePort) &&
row->dwLocalAddr == inet_addr("127.0.0.1") &&
row->dwRemoteAddr == inet_addr("127.0.0.1")
The problem seems to be that because I have an AV installed that is intercepting my traffic I am getting the PID of the AV not the original app that started the connection.
chrome -> av wfp -> httpserver
Without adding exclusions to the AV, is there a way I can retrieve the PID of the original process that started the request, not a forwarder like an AV network filter?
Thanks in advance.
Answering my own question:
Chrome -> AV -> WFP
If AV (Xport) -> (Yport)WFP
Usually:
Chrome (Xport -1) -> WFP.
That worked for me.

How to redirect user to another network if the first one is out of reach

I am running squid proxy server which is connected to a network(Lets say A). I have another server running same proxy server but is connected to a different network(Lets say B). my question is, is there any filter or check in squid proxy server which I can use in A to check if internet is down or not, and if it is down then instead of sending user unable to connect to internet message, send the traffic to server B?
You can try making browser to choose proxy using proxy.pac file, something like that:
function FindProxyForURL(url, host) {
return "PROXY proxy3.company.lan:8080; PROXY proxy4.company.lan:8080";
}
Or you can configure one proxy as a fall back parent for another one if network infrastructure allows you to do this. For example: if A can't access internet directly then it tries to access internet through B. So it would look like: client -> A -> B -> internet.

Resources