
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
didi-pc-sdk
Advanced tools
npm i didi-pc-sdk
or
yarn add didi-pc-sdk
vue.config.js
configureWebpack: {
devtool: "source-map",
externals: {
sequelize: "require('sequelize')",
sqlite3: "require('sqlite3')",
},
},
pluginOptions: {
electronBuilder: {
externals: ['sequelize'],
nodeIntegration : true
}
}
import MessageSDK from 'didi-pc-sdk'
const messageSDK = new MessageSDK({
host: 'wss://xxxx.com/api/chat-socket',
udid: 'didi.pc-8ad19023250c8ba17bba874de62255b01e3116f5bfe9fa3d040eaf5cd6cb3f3f',
token: 'eyJhbGciOiJIUzUxMiJ9.eyJhdWQiOiJudWxsIiwiaGVhZEltZyI6Imh0dHBzOi8vb3Nzc2l0LmRpZGltZXNzYWdlLmNvbS9oZWFkc2hvdC8yMDIxLzExLzIzLzE2MTIyYTcxLTE4YTQtNDlhMy04NjhmLTNmNWJmOWYxZTJhNV8xMDF4MTAxLnBuZyIsIm5pY2tOYW1lIjoicWkubCBpYW5nMeKdpO-4jyIsImNvdW50cnlDb2RlIjoiUEhMIiwiaW52aXRlQ29kZSI6IjQ0NDQiLCJzZXgiOjEsImlzcyI6IjEwODU2NDg2MDQyNDg0Njk1MDQiLCJ1c2VyVHlwZSI6MCwiZXhwIjoyNjQ2MDE0OTI5LCJpYXQiOjE2NDYwMTQ5MzAsImVtYWlsIjpudWxsLCJqdGkiOiI3ZWJlZmFlYi05MzZkLTRjYmQtYmUxNy1iOWYwN2NmMmQ4NjEifQ.7KbZWCaNL5otO-MTr9ORNHqJQmyg0B90vqH369ARErObqAQcqFxnJquSV9X-VNKTfRizeIet6L-6un-TGeHikw',
userId: '1085648604248469504',
language: 'zh-cn',
version: '196',
platformType: 'PC',
clientType: 'pc'
clientPlatform: 'nl'
PCPlatform: 'Mac.Windows',
});
then.
// 建立websocket连接
messageSDK.init()
this.ws.wsr.close(code, reason)
正常关闭示例
this.ws.wsr.close(1000, '')
// sdk-message => 接收来自 sdk 的消息
messageSDK.addEventListener('sdk-message', (event) => {
console.warn('vue sdk-message: => ',event)
messageSDK.toSDK({
reqId: event.data.reqId
})
})
// sdk-status => 接收 websocket 状态
messageSDK.addEventListener('sdk-status', (event) => {
console.warn('vue sdk-status: => ',event.code)
})
code
编码key | value | desc |
---|---|---|
-1 | DISCONNECT | 无连接 |
0 | CONNECTING | 连接中 |
1 | CONNECTED | 连接成功 |
变化: 新增加code字段,关于code字段的说明
普通消息和加密消息格式照旧
messageSDK.sendMessage({
message: ms,
})
// 示例
// - 普通消息:
{
"code":"02000013",
"reqId":"86374ea6-0bd2-4e28-958f-a8296d17bd97",
"targetType":2,
"targetId":"1283943746819764224",
"fromType":999,
"fromId":"1085648604248469504",
"uniqueCode":"GROUP@1283943746819764224",
"msgType":1,
"msgBody":{
"text":"json群聊"
},
"msgHeader":{
"pubKey":null,
"version":null,
"msgSeqNo":1,
"msgSeqTotal":1,
"effectiveTime":604800000,
"sourceSite":null,
"language":"zh-cn",
"sign":null,
"signType":null,
"effectiveTimeDate":1651044091791
},
"refMsgBody":{
"fromName":"qi.l iang1❤️",
"fromIcon":"https://osssit.didimessage.com/headshot/2021/11/23/16122a71-18a4-49a3-868f-3f5bf9f1e2a5_101x101.png",
"tUrl":"https://ididisit.oss-accelerate.aliyuncs.com/headshot/2022/04/20/11a40d1e-c001-413d-ba53-6ec446cc6a48_240x240.png",
"tName":"sdk测试群"
}
}
- 加密消息
{
"code":"02000022",
"sendTime":1650439419792,
"myMds":[
{
"ud":"1085648604248469504",
"et":"E068E966-B2DA-425F-AC31-A83D9A244612",
"deviceId":1,
"regId":16313,
"md":"加密单聊"
}
],
"mds":[
{
"ud":"1279608676230094848",
"et":"538E561B-1F18-4890-AB3E-911DBA665B12",
"deviceId":1,
"regId":7831,
"md":"加密单聊"
}
],
"reqId":"cc884668-eeea-41ca-a484-34b289895ff6"
}
messageSDK.toSDK({
reqId: event.data.reqId
})
// 示例
this.ws.toSDK({
reqId: event.data.reqId
})
node: 14+
electron: 11.4.6
FAQs
for didimessage pc sdk
The npm package didi-pc-sdk receives a total of 0 weekly downloads. As such, didi-pc-sdk popularity was classified as not popular.
We found that didi-pc-sdk demonstrated a not healthy version release cadence and project activity because the last version was released 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.