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.
pip install pushdit
from pushdit import pushd, popd, pushit
import os
>>> pushd
- C:\Users\Antsthebul\Desktop\pushit;
>>> pushd('tests')
>>> pushd
- C:\Users\Antsthebul\Desktop\pushit\tests;
0 tests
1 pushit
>>> os.getcwd()
'C:\\Users\\Antsthebul\\Desktop\\pushit\\tests'
Instead of having to use a seperate command to view CWD AND directory queue, pushd
will echo the CWD as well as the directories that have been added to the queue. This is similar operation to the pushd
and dirs
commands in Linux. The list of directories that pushd
echoes, will be displayed in the order they were inserted, 0 being most recent. This is the order they will be switched to on default operation when using pushit()
as a contenxtmanager, otherwise when calling popd()
, will remove dir from back of queue.
When pushd
recives a <..directory..>, unless specified pushd will move program to that directory. See examples below..
>>> pushd
- C:\Users\Antsthebul\Desktop\pushit;
>>> pushd('tests/pushtest1')
>>> pushd
- C:\Users\Antsthebul\Desktop\pushit\tests\pushtest1;
0 pushtest1
1 pushit
>>> pushd
- C:\Users\Antsthebul\Desktop\pushit;
>>> pushd('tests/pushtest1', right=True)
>>> pushd
- C:\Users\Antsthebul\Desktop\pushit\tests\pushtest1;
0 pushit
1 pushtest1
>>> os.getcwd()
'C:\\Users\\Antsthebul\\Desktop\\pushit\\tests\\pushtest1'
>>> pushd('pushtest2', chdir=False) # was in tests\pushtest1 when called
>>> pushd
- C:\Users\Antsthebul\Desktop\pushit\tests\pushtest1;
0 pushtest2
1 pushit
2 pushtest1
>>> pushd.clear()
>>> pushd
- C:\Users\Antsthebul\Desktop\pushit;
>>> pushd('tests/pushtest1/pushtest2')
>>> pushd
- C:\Users\Antsthebul\Desktop\pushit\tests\pushtest1\pushtest2;
0 pushtest2
1 pushit
>>> pushd('../..')
>>> pushd
- C:\Users\Antsthebul\Desktop\pushit\tests;
0 tests
1 pushtest2
2 pushit
>>> pushd
- C:\Users\Ansthebul\Desktop\pushit;
>>> pushd('~/documents')
>>> pushd
- C:\Users\Ansthebul\documents;
0 documents
1 pushit
>>> pushd('pushtest2', chdir=False)
>>> popd()
'C:\\Users\\Antsthbul\\pushit\\tests\\pushtest1'
>>> pushd
- C:\Users\Antsthebul\Desktop\pushit\tests\pushtest1;
0 pushtest2
1 pushit
Where it all comes together..
>>> pushd('tests', chdir=False)
>>> pushd('tests/pushtest1', chdir=False)
>>> pushd('tests/pushtest1/pushtest2', chdir=False)
>>> pushd()
>>> pushd
- C:\Users\Antsthebul\Desktop\\pushit;
0 pushtest2
1 pushtest1
2 tests
3 pushit
>>> with pushit() as lvl1:
... print('Do stuff here')
... print(os.getcwd())
... print()
... with pushit() as lvl2:
... print('Do more stuff here')
... print(os.getcwd())
... print()
... with pushit() as lvl3:
... print('OK i think you get the idea')
... print(os.getcwd())
... print()
... print('Back in lvl2')
... print(lvl2)
... print('inside lvl1')
... print(lvl1)
Do stuff here
C:\Users\Antsthebul\Desktop\pushit\tests\pushtest1\pushtest2
Do more stuff here
C:\Users\Ansthebul\Desktop\pushit\tests\pushtest1
OK i think you get the idea
C:\Users\Ansthebul\Desktop\pushit\tests
Back in lvl2
- C:\Users\Ansthebul\Desktop\pushit\tests\pushtest1;
inside lvl1
- C:\Users\Ansthebul\Desktop\pushit\tests\pushtest1\pushtest2;
0 pushit
>>> pushd
- C:\Users\Ansthebul\Desktop\pushit;
0 pushit
>>> os.getcwd()
C:\Users\Antsthebul\Desktop\pushit
>>> pushd
- C:\Users\Antsthebul\Desktop\\pushit;
>>> with pushit('tests/pushtest1/pushest2'):
... print(os.getcwd())
C:\Users\Antsthebul\Desktop\pushit\tests\pushtest1\pushtest2
>>> os.getcwd()
'C:\\Users\\Antsthebul\\Desktop\\pushit'
FAQs
pushd command like Linux
We found that pushdit 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.