Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
github.com/yijunjun/route-table
golang获取设置window路由表
package main
import (
"fmt"
. "github.com/yijunjun/route-table"
)
func main() {
table, err := NewRouteTable()
if err != nil {
panic(err.Error())
}
defer table.Close()
rows, err := table.Routes()
if err != nil {
panic(err.Error())
}
for _, row := range rows {
fmt.Sprintf(
"%v--->%v---->%v",
Inet_ntoa(row.ForwardDest, false),
Inet_ntoa(row.ForwardMask, false),
Inet_ntoa(row.ForwardNextHop, false),
)
}
local_ip, err := GetLocalIp()
if err != nil {
panic(err.Error())
}
local_ip_uint := Inet_aton(local_ip, false)
for _, row := range rows {
if row.ForwardNextHop == local_ip_uint {
// clone存在的路由,防止自定义出错
// route add 14.215.177.37 mask 255.255.255.255 本地ip
row.ForwardDest = Inet_aton("14.215.177.37", false)
row.ForwardMask = Inet_aton("255.255.255.255", false)
// 需要管理员权限,才能添加成功
if err := table.AddRoute(row); err != nil {
t.Error(err.Error())
}
break
}
}
}
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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.