forked from Velocidex/velociraptor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a geoip() VQL function. (Velocidex#1178)
- Loading branch information
Showing
10 changed files
with
295 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Server.Enrichment.GeoIP | ||
description: | | ||
This artifact can use the MaxMind database to Geo resolve an IP | ||
address. You will need to provide a valid GeoIP database. | ||
You can obtain a free to use (gratis but not libre) database from | ||
https://www.maxmind.com/ or you can pay for a more accurate option. | ||
After storing the database somewhere on your server, you should the | ||
location in the server metadata screen to it under the key "GeoIPDB" | ||
(for example `/usr/shared/GeoLite2-City_20210803/GeoLite2-City.mmdb`) | ||
Alternatively you can import this artifact to gain access to the | ||
utility functions (or just copy them into your own artifact). | ||
export: | | ||
LET DB = server_metadata().GeoIPDB | ||
LET Country(IP) = geoip(db=DB, ip=IP).registered_country.names.en | ||
LET State(IP) = geoip(db=DB, ip=IP).subdivisions[0].names.en | ||
LET City(IP) = geoip(db=DB, ip=IP).city.names.en | ||
parameters: | ||
- name: IP | ||
description: An IP to lookup | ||
|
||
sources: | ||
- query: | | ||
SELECT Country(IP=_value) AS Country, | ||
State(IP=_value) AS State, | ||
City(IP=_value) AS City | ||
FROM foreach(row=IP) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.