Git Product home page Git Product logo

Comments (11)

justfoxing avatar justfoxing commented on July 2, 2024 1

This issue has gone a bit stale, and I've released a few major updates since then. If you still experience problems with the latest version of ghidra_bridge (0.2.0), hit me up and we'll go from there

from ghidra_bridge.

fmagin avatar fmagin commented on July 2, 2024

Have you waited until the log message in Ghidra bridge says that it is up and running? The bridge takes a bit to setup and if you try connecting before the socket won't be open yet.
Is there any other log message in the Ghidra log?

Otherwise try standard network troubleshooting, i.e.:

  • is the port open? (check with ss -tlpn on Linux or the windows equivalent)
  • can you reach from localhost (check with nc or similiar tools)
  • do you have a firewall that might be blocking it (unlikely due to connection refused and not timeout)

from ghidra_bridge.

jpc0016 avatar jpc0016 commented on July 2, 2024

Hi, does ghidra_bridge use a default port number? This would help narrow down where the expected communication should happen.

from ghidra_bridge.

fmagin avatar fmagin commented on July 2, 2024

Should be 4768 as seen here https://github.com/justfoxing/ghidra_bridge/blob/master/ghidra_bridge/bridge.py#L43

from ghidra_bridge.

jpc0016 avatar jpc0016 commented on July 2, 2024

Ok I found something weird. Ghidra shows the below in the console. Is 54228 the port number?

ghidra_bridge_server.py> Running...
INFO:ghidra_bridge.bridge:serving!
WARNING:ghidra_bridge.bridge:Handling connection from ('127.0.0.1', **54228**)

And port 4768 appears to be working:

LISTEN                           0                                 5                                                             [::ffff:127.0.0.1]:4768                                                                    *:* 

from ghidra_bridge.

fmagin avatar fmagin commented on July 2, 2024

54228 is the source port number.
Is that the address that port is open on? [::ffff:127.0.0.1]:4768 seems a bit weird, half IPv6 half IPv4. Maybe that is the issue.

from ghidra_bridge.

jpc0016 avatar jpc0016 commented on July 2, 2024

I have no idea where 54228 is coming from. It's not listed in my ss command. The source code for bridge.py clearly states the default port is 4768.

from ghidra_bridge.

fmagin avatar fmagin commented on July 2, 2024

Yes, but TCP connections come from a host:port and connect to a host:port. In most cases the sourceport is irrelevant and just chosen randomly. If you run ss without the -l flag (for listening ports) it should appear. Did you manage to connect now, because something seems to be connecting to your bridge. If you don't know what is connecting you can check with ss -tnp which should show one established connection to the port 4768 and from whatever the host:port in the log is.

from ghidra_bridge.

jpc0016 avatar jpc0016 commented on July 2, 2024

Sorry for not posting earlier. Here's the exact error I received from running the client Python script:

Traceback (most recent call last):
  File "test_ghidra.py", line 10, in <module>
    with ghidra_bridge.GhidraBridge(namespace=globals()):
  File "/usr/local/lib/python2.7/dist-packages/ghidra_bridge/ghidra_bridge.py", line 32, in __init__
    self.get_flat_api(namespace=self.namespace)
  File "/usr/local/lib/python2.7/dist-packages/ghidra_bridge/ghidra_bridge.py", line 42, in get_flat_api
    remote_main = self.bridge.remote_import("__main__")
  File "/usr/local/lib/python2.7/dist-packages/ghidra_bridge/bridge.py", line 542, in remote_import
    return self.client.remote_import(module_name)
  File "/usr/local/lib/python2.7/dist-packages/ghidra_bridge/bridge.py", line 428, in remote_import
    return self.deserialize_from_dict(self.send_cmd(command_dict))
  File "/usr/local/lib/python2.7/dist-packages/ghidra_bridge/bridge.py", line 326, in send_cmd
    sock = self.get_socket()
  File "/usr/local/lib/python2.7/dist-packages/ghidra_bridge/bridge.py", line 312, in get_socket
    self.sock.connect((self.host, self.port))
  File "/usr/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 111] Connection refused

from ghidra_bridge.

fmagin avatar fmagin commented on July 2, 2024

That doesn't say more than the connection got refused.
You said you got the message:

ghidra_bridge_server.py> Running...
INFO:ghidra_bridge.bridge:serving!
WARNING:ghidra_bridge.bridge:Handling connection from ('127.0.0.1', **54228**)

Do you get that without initiating a connection from the ghidra_bridge client? Something seems to be connection, and it can't really be your client because that is getting a connection refused.

from ghidra_bridge.

jpc0016 avatar jpc0016 commented on July 2, 2024

Ok so my Ghidra installation was done as sudo so I reinstalled as user. The connection refused message goes away and the server begins running; however, I run into new Traceback errors. It appears no response was provided to one of the programs.

I recommend closing this issue and opening a new one with the new error.

4195764
Traceback (most recent call last):
  File "test.py", line 4, in <module>
    ghidra.program.model.data.DataUtilities.isUndefinedData(currentProgram, currentAddress)
  File "/home/jpc0016/.local/lib/python2.7/site-packages/ghidra_bridge/bridge.py", line 1177, in __call__
    return self._bridge_conn.remote_call(self._bridge_handle, *args, **kwargs)
  File "/home/jpc0016/.local/lib/python2.7/site-packages/ghidra_bridge/bridge.py", line 656, in remote_call
    return self.deserialize_from_dict(self.send_cmd(command_dict))
  File "/home/jpc0016/.local/lib/python2.7/site-packages/ghidra_bridge/bridge.py", line 595, in send_cmd
    cmd_id, timeout=timeout_override if timeout_override else self.response_timeout )
  File "/home/jpc0016/.local/lib/python2.7/site-packages/ghidra_bridge/bridge.py", line 408, in get_response
    "Didn't receive response {} before timeout".format(response_id))
Exception: Didn't receive response 59046521-4c68-4de1-b476-fe9c97b590d9 before timeout

Also after stopping ghidra_bridge_server.py, I received a socket error in the Ghidra console. It states "Address already in use"

from ghidra_bridge.

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.