I get Conncetion refused when I try to get information from the API

485 views
Skip to first unread message

mariem gharbi

unread,
Sep 30, 2023, 7:25:16 AM9/30/23
to velociraptor-discuss
details = "failed to connect to all addresses; last error: UNKNOWN: ipv4:192.168.1.8:8001: Failed to connect to remote host: Connection refused"
debug_error_string = "UNKNOWN:failed to connect to all addresses; last error: UNKNOWN: ipv4:192.168.1.8:8001: Failed to connect to remote host: Connection refused {created_time:"2023-09-30T13:07:46.154701614+02:00", grpc_status:14}"
---------------------------------------------------------------------------------
I'm trying to get infromations fro the api.config.yaml to use it for shuffle 

Mike Cohen

unread,
Sep 30, 2023, 7:28:31 AM9/30/23
to mariem gharbi, velociraptor-discuss
Make sure you change the API service to be listening to all interfaces. By default it's only listening to localhost. If you want external connections you need to set it to 0.0.0.0


Thanks
Mike

--
You received this message because you are subscribed to the Google Groups "velociraptor-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to velociraptor-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/velociraptor-discuss/23762881-9636-4e30-972e-c0403a118d41n%40googlegroups.com.

mariem gharbi

unread,
Sep 30, 2023, 7:49:16 AM9/30/23
to velociraptor-discuss
Hello Mike, 
Yes I also did I got the same error (I changed the bind address to 0.0.0.0 and regenerate the API yaml file ) the version is 0.6.2 what to do please cause am working on my end of studies project and I got no time to change another version of velo

mariem gharbi

unread,
Sep 30, 2023, 7:49:22 AM9/30/23
to velociraptor-discuss
error.PNG

Le samedi 30 septembre 2023 à 12:28:31 UTC+1, Mike Cohen a écrit :

Mike Cohen

unread,
Sep 30, 2023, 7:52:11 AM9/30/23
to mariem gharbi, velociraptor-discuss
Make sure the api.config.yaml file points at the publicly accessible address of the API server - so there you should have something real like 1.2.3.4 and not 0.0.0.0. Whatever is initiating the connection looks like it is trying to connect to 0.0.0.0 in the error above.

The 0.0.0.0 is only in the server.config.yaml to make the API server listen on all interfaces.

Thanks
Mike

Mike Cohen 
Digital Paleontologist, 
Velocidex Enterprises
mi...@velocidex.com 


mariem gharbi

unread,
Sep 30, 2023, 8:10:18 AM9/30/23
to velociraptor-discuss
Sorry but the problem is the same even thought I wrote 0.0.0.0 in the server.yaml and the other IP in the api.yaml I got the same error do you think I should change the velociraptor version or what and sorry for the inconvenience

Mike Cohen

unread,
Sep 30, 2023, 8:18:47 AM9/30/23
to mariem gharbi, velociraptor-discuss
It is not clear to me what your screenshot shows and what is happening in the background but the way to verify this works is via the pyvelociraptor python binding or just the velociraptor binary itself:

on the remote machine just run 
velociraptor.exe --api_config api.config.yaml query -v "SELECT * FROM info()"

then watch the output and make sure the api connection is working correctly. Once you have that working you can worry about the other code your are trying to integrate with.

Although 0.6.2 is very old I dont think the API code has changed in ages and should work the same way. I think your issue is networking - the error definitely indicates that whatever the screenshot is from is trying to connect to 0.0.0.0

thanks
Mike



Mike Cohen 
Digital Paleontologist, 
Velocidex Enterprises
mi...@velocidex.com 

mariem gharbi

unread,
Sep 30, 2023, 8:28:54 AM9/30/23
to velociraptor-discuss
It was just a screenshot from shuffle but here is the command line execution and the config of the server.yaml and api.yaml 
api.PNG
server.PNG
err.PNG

mariem gharbi

unread,
Sep 30, 2023, 8:36:35 AM9/30/23
to velociraptor-discuss
here is the execution of your command line 
errrror.PNG

Mike Cohen

unread,
Sep 30, 2023, 9:17:39 AM9/30/23
to mariem gharbi, velociraptor-discuss
Next you should do the same thing on the server itself to verify it's listening on that interface.

Then check for iptable rules that might be blocking connections

Reply all
Reply to author
Forward
0 new messages