
Research
Namastex.ai npm Packages Hit with TeamPCP-Style CanisterWorm Malware
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.
This is a simple webrtc library using mqtt as signaling server. to establish a peer-to-peer connection between two clients. The signaling server is used to exchange messages between the clients.
to use this library, you need to have a mqtt server running and the necessary credentials.
This library is compatible with all modern browsers and nodejs.
step1 : install the library using npm
npm install swrtc mqtt --save
step2 : import the library in your project
import callManager from 'swrtc';
const CallManager = require('swrtc');
<script src="https://cdn.jsdelivr.net/npm/swrtc/dist/CallManager.umd.js"></script>
step3 : create a new instance of MqttClient with the following parameters:
import mqtt from 'mqtt';
let mqttClient = mqtt.connect('mqtt://localhost:1883',{
clientId:'swrtc-client',
username:'swrtc',
password:'swrtc'
});
step4 : create a new instance of CallManager with the following parameters:
import callManager from 'swrtc';
let callManager = new CallManager(clientTopic,{
publish:(topic,messsage)=>{
//发布消息
mqttClient.publish(topic,messsage);
}
},{
video:true,
audio: {
noiseSuppression: true,
echoCancellation: true,
autoGainControl: true,
mozNoiseSuppression: true,
mozAutoGainControl: true,
mozEchoCancellation: true
}
},{
"offerIn":(data)=>{
//对方发过来的offer,展示接听界面
console.log("offerIn",data);
currentCall={
...data
}
$('.call-status').text('响铃...');
$('.call-buttons').show(); // 挂断后隐藏按钮
$('.answer-call').show();
$('.cuscontainer').css('display', 'flex');
},
"hangUp":(data)=>{
//对方拒绝或者挂断
console.log("hangUp",data);
$('.call-buttons').hide();
$('.call-status').text('已挂断...');
setTimeout(() => {
$('.cuscontainer').css('display', 'none');
}, 3000);
},
"localCallStream":(data)=>{
//本地流,设置播放流
document.getElementById("local").srcObject = data.stream;
console.log("打出时本地流",data);
},
"forwardCall":(data)=>{
//对方拒绝或者挂断
console.log("forward",data);
$('.call-status').text('已转接...');
},
"callStream":(data)=>{
//打电话的时候对方给的流,设置播放流
document.getElementById("remote").srcObject = data.stream;
console.log("打出时对方流",data);
},
"localAnswerStream":(data)=>{
//本地流,设置播放流
document.getElementById("local").srcObject = data.stream;
console.log("接听时本地流",data);
},
"answerStream":(data)=>{
//接听电话时对方给的流,设置播放流
document.getElementById("remote").srcObject = data.stream;
console.log("接听时对方流",data);
},
"reject":(data)=>{
//对方拒绝或者挂断
console.log("reject",data);
$('.call-status').text('已挂断...');
$('.call-buttons').hide();
setTimeout(() => {
$('.cuscontainer').css('display', 'none');
}, 3000);
},
"answered":(data)=>{
//相同主题的其他设备已接听
console.log("answered",data);
$('.call-status').text('其他设备已接听...');
$('.call-buttons').hide();
setTimeout(() => {
$('.cuscontainer').css('display', 'none');
}, 3000);
},
"connected":(data)=>{
//webrtc建立连接
console.log("connected",data);
$('.call-status').text('正在通话中...');
$('.call-buttons').show(); //
$('.answer-call').hide();
$('.decline-call').show();
},
"disconnected":(data)=>{
//webrtc断开连接
console.log("disconnected",data);
$('.call-status').text('对方信号不好...');
setTimeout(() => {
$('.cuscontainer').css('display', 'none');
$('.call-status').text('来电...');
$('.call-buttons').show(); // 挂断后隐藏按钮
}, 1000);
}
});
{
publish:(topic,messsage)=>{
//发布消息
mqttClient.publish(topic,messsage);
}
}
{
url: 'ws://{mqtthost}:8083/mqtt',
username: "test",
password: "test",
clientId: "test"+Math.random().toString(16).substr(2, 8)
}
calleeTopic:'/call/1',#
clientTopic:'/call/2',#
callerTopic:'/call/1'#
calleeTopic:'/call/1',#
clientTopic:'/call/2',#
callerTopic:'/call/1'#
npm install
npm run dev
FAQs
A WebRTC based communication library for web applications
We found that swrtc 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
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.