Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
gopkg.in/ns3777k/go-shodan.v2
To start working with Shodan you have to get your token first. You can do this at https://www.shodan.io.
Download the package:
go get "gopkg.in/ns3777k/go-shodan.v2"
2nd version has some breaking changes:
1.1
- 1.5
)GetHttpHeaders
is renamed to GetHTTPHeaders
panic
Streaming API methods will be totally reworked at version 3.
To use the old version:
go get "gopkg.in/ns3777k/go-shodan.v1"
That's it. You're ready to roll :-)
Simple example of resolving hostnames:
package main
import (
"log"
"gopkg.in/ns3777k/go-shodan.v2/shodan"
)
func main() {
client := shodan.NewEnvClient(nil)
dns, err := client.GetDNSResolve([]string{"google.com", "ya.ru"})
if err != nil {
log.Panic(err)
} else {
log.Println(*dns["google.com"])
}
}
Output for above:
2015/09/05 18:50:52 173.194.115.35
Streaming example:
package main
import (
"log"
"gopkg.in/ns3777k/go-shodan.v2/shodan"
)
func main() {
client := shodan.NewEnvClient(nil)
go func() {
for {
banner, ok := <- client.StreamChan
if !ok {
log.Fatalln("channel got closed")
}
// Do something here with banner
}
}()
go client.GetBanners()
for {
time.Sleep(time.Second * 10)
}
}
If a method is absent or something doesn't work properly don't hesitate to create an issue.
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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.