Slide 51
Slide 51 text
private void addOsXMetadata()
{
buildScan.background {
def json = new JsonSlurper(
)
def ip = exec('curl', '-s', 'https://ipinfo.io/ip'
)
def ge
o
if (ip)
{
geo = json.parseText
(
exec('curl', '-s', “https://json.geoiplookup.io/$ip”
)
)
}
if (ip && geo)
{
value 'OS: Location', "${geo.city}, ${geo.region}, ${geo.country}
"
value 'OS: Coordinates', "${geo.latitude}, ${geo.longitude}
"
} else
{
value 'OS: Location', 'Unknown
'
}
}
}