Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Get Context is a directory context generator designed to provide a structured overview of the contents of a directory and its subdirectories. It generates a single text file that lists the directory structure and the contents of text or program files, while excluding non-human-readable files such as binary or multimedia files. This tool is particularly useful for organizing and reviewing large codebases or data directories. It can also be used to easily pass the contents of a directory to a large language AI model for further analysis.
This program is available as the Python package "get_context". If Python is installed on your system, you should be able to run:
pip install get_context
After the package is installed, the program can be run on the command line by typing:
get_context <directory> [file_extensions...]
The program takes the directory as the first argument and can optionally filter files by specified extensions. For example:
get_context . .py .txt
This will generate a text file containing the directory structure and the contents of .py
and .txt
files within the specified directory.
This program is still in development and is currently buggy. Further testing and implementation is required before it can be used as a fully-fledged, reliable product.
This program uses both Python’s built-in libraries and external libraries for various functionalities:
os
and mimetypes
libraries for file and directory manipulation.codecs
and io
libraries to handle different text encodings.pathspec
library to handle file exclusion patterns, specifically for interpreting and applying .gitignore
-style patterns.This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Generates a single text document for a directory
We found that get-context 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.