Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
ip-details-fetcher
Advanced tools
Best NPM package to fetch IP details using the ipinfo.io API.
npm install ip-details-fetcher
import { getIPDetails } from 'ip-details-fetcher';
const token = 'YOUR_TOKEN_HERE'; // Replace with your actual token
getIPDetails(token).then(ipDetails => {
console.log('IP Details:', ipDetails);
}).catch(error => {
console.error('Error fetching IP details:', error);
});
To use this package, you need an API token from ipinfo.io. Follow these steps to get your token:
'YOUR_TOKEN_HERE'
in the usage example above with your actual token.import React, { useEffect, useState } from 'react';
import { getIPDetails, IPDetails } from 'ip-details-fetcher';
const App = () => {
const [ipDetails, setIpDetails] = useState<IPDetails | null>(null);
const token = 'YOUR_TOKEN_HERE'; // Replace with your actual token
useEffect(() => {
getIPDetails(token).then(setIpDetails).catch(error => console.error('Error fetching IP details:', error));
}, [token]);
if (!ipDetails) return <div>Loading...</div>;
return (
<div>
<h1>Your IP Details</h1>
<p><strong>IP:</strong> {ipDetails.ip}</p>
<p><strong>City:</strong> {ipDetails.city}</p>
<p><strong>Region:</strong> {ipDetails.region}</p>
<p><strong>Country:</strong> {ipDetails.country}</p>
<p><strong>Latitude and Longitude:</strong> {ipDetails.latitude}, {ipDetails.longitude}</p>
<p><strong>Timezone:</strong> {ipDetails.timezone}</p>
<p><strong>ISP:</strong> {ipDetails.org}</p>
</div>
);
};
export default App;
This package is licensed under the ISC License.
This README.md
provides clear instructions on how to install, use the package, and obtain the necessary API token from ipinfo.io.
FAQs
Best NPM package to fetch IP details
We found that ip-details-fetcher demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.