Quick hack to get the external IP of an endpoint: ...
# general
w
Quick hack to get the external IP of an endpoint:
select result from curl where url = '<http://ipaddr.io>';
z
Nice! I took a similar concept with https://dactiv.llc/blog/locate-assets-with-osquery/.
w
Ah that's much better 🙂 Good to learn about JSON_EXTRACT too
z
Yeah json parsing in sqlite is very handy, though it can get quite verbose.
t
Just a heads up, if your employees run Little Snitch it will show osquery communicating with this domain
and might raise questions
😅 1
g
Longer term solution if you have a TLS server is to take it from the inbound connection.
a
I'd also think sending this across country boundaries for public services you don't own could get you into privacy issues
your Acceptable Use Policy may or may not cover you for that case, even as an employer
d
Also, your network security monitoring team will probably see alerts generated, as public IP checks are really common for malware (also get an alert for the
curl
user agent outbound etc)
w
Does osquery send a user agent for the curl table?
r
Hi everyone. how are you? Reviewing this documentation https://fleetdm.com/guides/locate-assets-with-osquery and playing around a bit I have not been able to get the results as shown in the post. The result of the query is that the json is badly formatted, but I have no way to format it, anyone who has tried this method or another and that returns the geolocation of a device?