Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
github.com/redsift/ip2location-go
This Go package provides a fast lookup of country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection type, IDD code, area code, weather station code, station name, mcc, mnc, mobile brand, elevation, and usage type from IP address by using IP2Location database. This package uses a file based database available at IP2Location.com. This database simply contains IP blocks as keys, and other information such as country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection type, IDD code, area code, weather station code, station name, mcc, mnc, mobile brand, elevation, and usage type as values. It supports both IP address in IPv4 and IPv6.
This package can be used in many types of projects such as:
The database will be updated in monthly basis for the greater accuracy. Free LITE databases are available at https://lite.ip2location.com/ upon registration.
The paid databases are available at https://www.ip2location.com under Premium subscription package.
go get github.com/ip2location/ip2location-go
package main
import (
"fmt"
"github.com/ip2location/ip2location-go"
)
func main() {
ip2location.Open("./IPV6-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WEATHER-MOBILE-ELEVATION-USAGETYPE.BIN")
ip := "8.8.8.8"
results := ip2location.Get_all(ip)
fmt.Printf("country_short: %s\n", results.Country_short)
fmt.Printf("country_long: %s\n", results.Country_long)
fmt.Printf("region: %s\n", results.Region)
fmt.Printf("city: %s\n", results.City)
fmt.Printf("isp: %s\n", results.Isp)
fmt.Printf("latitude: %f\n", results.Latitude)
fmt.Printf("longitude: %f\n", results.Longitude)
fmt.Printf("domain: %s\n", results.Domain)
fmt.Printf("zipcode: %s\n", results.Zipcode)
fmt.Printf("timezone: %s\n", results.Timezone)
fmt.Printf("netspeed: %s\n", results.Netspeed)
fmt.Printf("iddcode: %s\n", results.Iddcode)
fmt.Printf("areacode: %s\n", results.Areacode)
fmt.Printf("weatherstationcode: %s\n", results.Weatherstationcode)
fmt.Printf("weatherstationname: %s\n", results.Weatherstationname)
fmt.Printf("mcc: %s\n", results.Mcc)
fmt.Printf("mnc: %s\n", results.Mnc)
fmt.Printf("mobilebrand: %s\n", results.Mobilebrand)
fmt.Printf("elevation: %f\n", results.Elevation)
fmt.Printf("usagetype: %s\n", results.Usagetype)
fmt.Printf("api version: %s\n", ip2location.Api_version())
ip2location.Close()
}
The complete database is available at https://www.ip2location.com under subscription package.
Use the IPv4 BIN file if you just need to query IPv4 addresses. Use the IPv6 BIN file if you need to query BOTH IPv4 and IPv6 addresses.
Copyright (C) 2019 by IP2Location.com, support@ip2location.com
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.