Giter Site home page Giter Site logo

Comments (6)

shanjunmei avatar shanjunmei commented on June 9, 2024 2

The code you've highlighted does not cause the connect back address to always be set to listenAddress.

The if statement checks for an error, that error indicates if the argument --external_address was specified. If it was, then it omits that whole block.

Have you tried using --external_address or are you purely reading the code?

Sorry, my bad, just read the code, didn't actually test it

from reverse_ssh.

NHAS avatar NHAS commented on June 9, 2024 1

The code you've highlighted does not cause the connect back address to always be set to listenAddress.

The if statement checks for an error, that error indicates if the argument --external_address was specified. If it was, then it omits that whole block.

Have you tried using --external_address or are you purely reading the code?

from reverse_ssh.

NHAS avatar NHAS commented on June 9, 2024

What? I need more information on this.

If you're referring to the server main, connectBackAddress will be overwritten by listenAddress when --external_address is not specified?

Which is how it's suppose to be

from reverse_ssh.

shanjunmei avatar shanjunmei commented on June 9, 2024

` webserver := options.IsSet("webserver")
connectBackAddress, err := options.GetArgString("external_address")

if err != nil && webserver {

	connectBackAddress = listenAddress

	//Special case where we're using :3232 as an example, which listens on all interfaces
	//However we need to have a valid address for the link command, so we get the first interface
	addressParts := strings.Split(listenAddress, ":")
	if len(addressParts) > 0 && len(addressParts[0]) == 0 {

		port := addressParts[1]

		ifaces, err := net.Interfaces()
		if err == nil {
			for _, i := range ifaces {

				addrs, err := i.Addrs()
				if err != nil {
					continue
				}

				if len(addrs) == 0 {
					continue
				}

				if i.Flags&net.FlagLoopback == 0 {
					connectBackAddress = strings.Split(addrs[0].String(), "/")[0] + ":" + port
					break
				}
			}
		}
	}

}

`

from reverse_ssh.

shanjunmei avatar shanjunmei commented on June 9, 2024

` webserver := options.IsSet("webserver") connectBackAddress, err := options.GetArgString("external_address")

if err != nil && webserver {

	connectBackAddress = listenAddress

	//Special case where we're using :3232 as an example, which listens on all interfaces
	//However we need to have a valid address for the link command, so we get the first interface
	addressParts := strings.Split(listenAddress, ":")
	if len(addressParts) > 0 && len(addressParts[0]) == 0 {

		port := addressParts[1]

		ifaces, err := net.Interfaces()
		if err == nil {
			for _, i := range ifaces {

				addrs, err := i.Addrs()
				if err != nil {
					continue
				}

				if len(addrs) == 0 {
					continue
				}

				if i.Flags&net.FlagLoopback == 0 {
					connectBackAddress = strings.Split(addrs[0].String(), "/")[0] + ":" + port
					break
				}
			}
		}
	}

}

`

we try search by connectBackAddress = can found there are two rewriting connectBackAddress in this code

from reverse_ssh.

NHAS avatar NHAS commented on June 9, 2024

Please don't open issues without verifying that what you're talking about is an actual issue.

It wastes my time and makes me less open to seriously considering your issues in the future.

from reverse_ssh.

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.