Comments (11)
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.
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.
Hi, does ghidra_bridge use a default port number? This would help narrow down where the expected communication should happen.
from ghidra_bridge.
Should be 4768 as seen here https://github.com/justfoxing/ghidra_bridge/blob/master/ghidra_bridge/bridge.py#L43
from ghidra_bridge.
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.
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.
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.
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.
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.
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.
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)
- Memory.getBytes returns empty array HOT 3
- AttributeError: 'instancemethod' object has no attribute '__len__' (bridge.py", line 974) HOT 5
- PyPI description has three sequential steps all numbered "1" HOT 2
- Timeout value is not configurable in `ghidra_bridge_server.py` HOT 1
- Are you able to write to a ghidra project? HOT 1
- findBytes return an empty Array HOT 1
- Unable to stop auto-analysis for script connected via ghidra_bridge HOT 1
- Expose other IPC channels HOT 1
- How to put arguments in remote_eval?
- setComment causes BridgeException HOT 2
- Cannot inherit bridged classes HOT 1
- Unhashable type _bridged_ghidra.program.database.function.FunctionDB HOT 2
- Bad file descriptor HOT 1
- Socket not closed, when GhidraBridge Object gets out of scope HOT 5
- Timeout Condition HOT 6
- How to remote debug with VSCode? HOT 4
- Windows: Binding on low port blocked by firewall HOT 3
- How to pass arguments to the post script HOT 1
- Question: how does the RPC bridge handle class callbacks? HOT 3
- using in IDE with proper auto completion
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ghidra_bridge.