Skip to content

Run interact server behing nginx proxy, real remote IP#272

Merged
ehsandeep merged 7 commits intoprojectdiscovery:devfrom
derekkddj:main
Jun 17, 2022
Merged

Run interact server behing nginx proxy, real remote IP#272
ehsandeep merged 7 commits intoprojectdiscovery:devfrom
derekkddj:main

Conversation

@derekkddj
Copy link
Copy Markdown
Contributor

If the Revheader is present, and the reverse proxy adds a header with the original IP (like X-Forwarded-For) you cna tun interact-sh server behing a proxy and get the real IP in the logs/client.

@ehsandeep ehsandeep changed the base branch from main to dev April 29, 2022 05:25
@derekkddj
Copy link
Copy Markdown
Contributor Author

I dont know why it fails, because i have not touch the "interactsh-client" code, only in the server.

@ehsandeep ehsandeep requested a review from Mzack9999 May 5, 2022 17:30
@Mzack9999
Copy link
Copy Markdown
Member

@dhd0004 Thanks for opening this PR. This is for sure an interesting use-case scenario. If I'm not mistaken, the information related to the original IP would be contained within the dumped request as we capture the whole HTTP interaction. I guess the use case you are describing is to place a reverse proxy in front of an interactsh instance for internal testing?

@derekkddj
Copy link
Copy Markdown
Contributor Author

derekkddj commented May 6, 2022

@dhd0004 Thanks for opening this PR. This is for sure an interesting use-case scenario. If I'm not mistaken, the information related to the original IP would be contained within the dumped request as we capture the whole HTTP interaction. I guess the use case you are describing is to place a reverse proxy in front of an interactsh instance for internal testing?

Hi!

The scenario i am using is having only one server, with NGINX configured as Reverse Proxy. Behind the proxy i have the interactsh server, another apache web server, and one PHP application. If I acces for example web.mydomain.com, the nginx redirects the request to the internal web server. If i use interactsh.mydomain.com, the NGINX sends the request to the interactsh server.
The problem with this use case is that interactsh was showing always 127.0.0.1 as the remote address, because the nginx was between the real user and the interactsh server (is a rev proxy). So with this PR, my nginx sends the real remote IP addr to interactsh-server in an HTTP Header, and the interactsh server can show the real remote IP in the logs.

Regards

@Mzack9999 Mzack9999 requested a review from ehsandeep June 17, 2022 15:10
@ehsandeep ehsandeep merged commit c591208 into projectdiscovery:dev Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants