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.
fancy-p
is a Ruby gem that extends the Kernel module to dynamically define
print methods with different characters. It allows you to create methods like
p!
, p1
, p2
, etc., which print a specified character 100 times before and after.
This exists simply because I found myself writing p '!' * 100
too often. I
followed a similar pattern for p 1 * 100
, p2 * 100
, etc.
For unpermitted characters, you can use the fp
method, which takes a string
of any length and prints it with a specified special character or str.
You can also create your own print methods pf_factory
method.
Add this line to your application's Gemfile:
gem 'fancy-p'
require 'fancy-p'
p! 'Hello, world!'
# => "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
# => "Hello, world!"
# => "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
p1 'Hello, world!'
# => "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
# => "Hello, world!"
# => "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
require 'fancy-p'
fp "@", "Hello, world!"
# => "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
# => "Hello, world!"
# => "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
fp "@", "Hello, world!", length: 14
# => "@@@@@@@@@@@@@@"
# => "Hello, world!"
# => "@@@@@@@@@@@@@@"
require 'fancy-p'
print_wat = fp_factory "WAT ", length: 10
print_wat['Hello, world!']
# => "WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT "
# => "Hello, world!"
# => "WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT "
print_wat['Some other string']
# => "WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT "
# => "Some other string"
# => "WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT "
FAQs
Unknown package
We found that fancy-p demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.