Code Monkey home page Code Monkey logo

Comments (15)

evilsocket avatar evilsocket commented on May 8, 2024 1

Unfortunately it looks like port redirection with netsh is not possible, this doesn't work as expected as it just creates a local listener which redirects to 8080 but does not work on forwarded packets ... help ?

from bettercap.

evilsocket avatar evilsocket commented on May 8, 2024 1

mmm nope i did not, i will try to see if that changes anything, thanks

from bettercap.

evilsocket avatar evilsocket commented on May 8, 2024 1

From a conversation in our dev channel:

as u can see from the code i'm succesfully enabling incoming traffic on those ports
i also enabled routing with regedit
everything works, problem is:
that port redirection is fake
well, not fake fake, but it's basically a socks proxy tunnelling from ip A to ip B
so it does not forward connections at the packet level, like iptables does on linux
which is what we'd need in order for the proxy to work

from bettercap.

ohpe avatar ohpe commented on May 8, 2024 1

They are basically the same command, one set via netsh and one via the registry. REF.

from bettercap.

aflick2486 avatar aflick2486 commented on May 8, 2024

So this should work, you have to have ipv6 libraries installed with netsh int ipv6 install and then use netsh interface portproxy add v4tov4 listenport=<localport> listenaddress=<localaddress> connectport=<destport> connectaddress=<destaddress>. It does create a local listener on the local port and forwards it to the dest port. Would you be able to explain a little more on what you mean by it "does not work on forwarded packets"?

from bettercap.

evilsocket avatar evilsocket commented on May 8, 2024

because it just creates a listener at application layer

from bettercap.

NxxN39 avatar NxxN39 commented on May 8, 2024

Just in case, did you add the rule to allow the incoming port?

netsh advfirewall firewall add rule name=”BetterCap-Ng” protocol=TCP dir=in localip=x.x.x.x localport=xxxx action=allow

from bettercap.

NxxN39 avatar NxxN39 commented on May 8, 2024

Good write up from someone who apparently has been here already :) http://woshub.com/port-forwarding-in-windows/

from bettercap.

evilsocket avatar evilsocket commented on May 8, 2024

@NxxN39 added the firewall rule to enable the port, which is working ( I can connect to the box port 80 which is redirected to 8080 ), but it's not routing others' connections

from bettercap.

NxxN39 avatar NxxN39 commented on May 8, 2024

Is routing enabled on your machine? I remember a specific reg key has to be enabled to turn on routing on some versions of win. Which one are you using?

from bettercap.

evilsocket avatar evilsocket commented on May 8, 2024

Yes I enabled routing via regedit ( \HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters\IPEnableRouter -> 0x00000001 ).

from bettercap.

evilsocket avatar evilsocket commented on May 8, 2024

using windows 10

from bettercap.

evilsocket avatar evilsocket commented on May 8, 2024

Also this should enable forwarding too.

from bettercap.

evilsocket avatar evilsocket commented on May 8, 2024

Efforts are being made on this branch, removing from first milestone for now.

from bettercap.

evilsocket avatar evilsocket commented on May 8, 2024

Closing this issue as port forwarding is just not supported on Windows at the firewall level like it is on other OS, userland packet routing is needed which makes everything slow as hell.

from bettercap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.