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.
You can get pycof from PyPI with:
pip install pycof
The library is supported on Windows, Linux and MacOs.
You can find the full documentation at https://www.florianfelice.com/pycof or by clicking on the name of each function in the next section. It will redirect you the the function's specific documentation.
The current version of the library provides:
remote_execute_sql
: aggragated function for SQL queries to SELECT
, INSERT
, DELETE
or COPY
.read
: Load any data file, regarless of the format.send_email
: simple function to send email to contacts in a concise way.verbose_display
: extended function to print strings, lists, data frames and progression bar if used as a wrapper in for
loops.add_zero
: simple function to convert int
to str
by adding a 0 is less than 10.group
: will convert an int
to a str
with thousand seperator.replace_zero
: will transform 0 values to -
for display purposes.week_sunday
: will return week number of last sunday date of a given date.display_name
: displays the current user name. Will display either first
, last
or full
name.write
: writes a str
to a specific file (usually .txt) in one line of code.file_age
: computes the age (in days, hours, ...) of a given local file.str2bool
: converts string to boolean.many others
!The function remote_execute_sql
and send_email
will by default look for the credentials located at /etc/.pycof/config.json
.
On Windows, save the config file as C:/Windows/.pycof/config.json
.
The file follows the below structure:
{
"DB_USER": "",
"DB_PASSWORD": "",
"DB_HOST": "",
"DB_PORT": "3306",
"DB_DATABASE": "",
"__COMMENT_1__": "Email specific, send_email"
"EMAIL_USER": "",
"EMAIL_PASSWORD": "",
"EMAIL_SMTP": "smtp.gmail.com",
"EMAIL_PORT": "587"
"__COMMENT_2__": "IAM specific, if useIAM=True in remote_execute_sql",
"CLUSTER_NAME": "",
"AWS_ACCESS_KEY_ID": "",
"AWS_SECRET_ACCESS_KEY": "",
"REGION": "eu-west-1"
}
On Unix based system, run:
sudo nano /etc/.pycof/config.json
and paste the above json after filling the empty strings (pre-filled values are standard default values).
Reminder: To save the file, with nano press CTRL + O
, confirm with y
then CTRL + X
to exit.
On Windows, use the path C:/Windows/.pycof/config.json
.
FAQs
A package for commonly used functions
We found that pycof 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.