Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not prompted for Access key for geo lookup on first run #75

Open
Absoblogginlutely opened this issue Jul 14, 2021 · 1 comment
Open
Labels
Bug Something isn't working

Comments

@Absoblogginlutely
Copy link
Contributor

I recently got a new computer, ran Hawk for the first time for a long time and was not prompted to enter the geoip access key. As a result, all the geoip lookups were empty and the converted_authentication_logs had blank values in the CountryName and City columns.
Verbose mode shows that the access key was never used in the querystring.
output below
[7/14/2021 8:51:22 AM] - Failed to retreive location for IP 136.53.77.94
VERBOSE: GET http://api.ipstack.com/136.53.77.94?access_key= with 0-byte payload
VERBOSE: received -1-byte response of content type application/json; Charset=UTF-8

Found the source code and ran the line manually and verified that the ip lookup still works.
`$accesskey="80b6f3"
$ipaddress="128.146.161.32"
$resource = "http://api.ipstack.com/" + $ipaddress + "?access_key=" + $Accesskey
$geoip = Invoke-RestMethod -Method Get -URI $resource
$geoip

ip : 128.146.161.32
type : ipv4
continent_code : NA
continent_name : North America
country_code : US
country_name : United States
region_code : OH
region_name : Ohio
city : Dublin
zip : 43065
latitude : 40.15196990966797
longitude : -83.09722900390625
location : @{geoname_id=5152333; capital=Washington D.C.; languages=System.Object[];
country_flag=http://assets.ipstack.com/flags/us.svg; country_flag_emoji=🇺🇸;
country_flag_emoji_unicode=U+1F1FA U+1F1F8; calling_code=1; is_eu=False}`

Attempting to read or add the access_key with read-hawkappdata or add-hawkappdata returns the name not found

read-hawkappdata
read-hawkappdata : The term 'read-hawkappdata' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.

Add-HawkAppData -name access_key -value "80f3"
Add-HawkAppData : The term 'Add-HawkAppData' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.

How do we add the access key back into the system again?

@Absoblogginlutely Absoblogginlutely added the Bug Something isn't working label Jul 14, 2021
@blade3
Copy link

blade3 commented Oct 6, 2023

In version 3.1.0 (I don't remember before this version), there's a .json file in the user directory with apistack's APIKEY:
Location:

C:\Users\[User]\AppData\Local\Hawk\Hawk.json

content:

{
    "access_key": "APIKEY_IPSTACK"
}

is it what you are looking for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants