
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.
tea.melonie54.xyz/snow/snowball
Small communication protocol for TCP connections
Example client:
wg := &sync.WaitGroup{}
// Resolve TCP address
tcpAddr, err := net.ResolveTCPAddr("tcp", "127.0.0.1:12345")
if err != nil {
t.Fatal(err)
}
// Create snowball client
var snow *SnowballClient
snow = NewSnowballClient(wg, 3, tcpAddr, func(packet *packet.SnowballPacket) {
// Packet receiving logic only packets with `toAddr = 3` will be handled here
// Packets with `toAddr = 2` are forwarded to all clients from the server but
// the `toAddr` is changed to match to receiving client ID
switch packet.Id {
case 2:
// `MakeReply` can be used to create a packet to send back to the return address
snow.Send(packet.MakeReply(3, packet.Data))
}
})
// A WaitGroup can be used to prevent the program from closing
wg.Wait()
// Create and send a packet (with ID: 2) to client (with ID: 4)
// The from address is set to the current client
// A binary packet can be generated using a byte buffer and the functions in `net-byte-utils.go`
buf := new(bytes.Buffer)
utils.WriteString(buf, "hello")
snow.Send(NewSnowballPacketFromBytes(2, 0, 4, buf.Bytes()))
Example server:
wg := &sync.WaitGroup{}
tcpAddr, err := net.ResolveTCPAddr("tcp", "127.0.0.1:12346")
if err != nil {
t.Fatal(err)
}
var snow *SnowballServer
snow = NewSnowballServer(wg, tcpAddr, func(packet *packet.SnowballPacket) {
// Packet receiving logic only packets with `toAddr = 1` will be handled here
// Packets with other addresses are automatically routed to the client
// Packets with `toAddr = 2` are forwarded to all clients automatically
switch packet.Id {
case 2:
// `MakeReply` can be used to create a packet to send back to the return address
snow.Send(packet.MakeReply(3, packet.Data))
}
})
if err != nil {
t.Fatal(err)
}
// `Serve` is non-blocking
snow.Serve()
// A WaitGroup can be used to prevent the program from closing
wg.Wait()
Packet IDs:
0x00
- Reserved for the unknown packet0x01
- Reserved for the Hello packetClient IDs:
0x00
- Reserved for the unknown client (if used as fromAddr
it is changed to the current client ID before sending)0x01
- Reserved for the server0x02
- Reserved for sending packets to all clients (can be used from the client or server Send
methods)FAQs
Unknown package
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.