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/stevenxie/glip
A clipboard interface for Go, compatible with Windows, Mac OS X, and Linux.
Install glip
like you would any other Go package:
go get github.com/stevenxie/glip
Since a glip.Board
(a clipboard interface) includes io.Writer
, io.Reader
,
io.WriterTo
, and io.ReaderFrom
, it can be used just about anywhere:
import (
"fmt"
"github.com/stevenxie/glip"
)
func main() {
// Save "snip snip" into the system clipboard.
glip.WriteString("snip snip")
// And we're done!
// Read clipboard contents into a string (ignoring the error).
out, _ := glip.ReadString()
fmt.Println(out)
// Output: snip snip
}
glip
provides API-wrapping structs specific to each clipboard-accessing
program; each struct implements the Board
interface.
If you know which specific program you would like to use, you can create a new
instance of the associated wrapper struct (i.e. PShellBoard
, Clip
,
DarwinBoard
, Xclip
, or Xsel
), and set program-specific flags / options
using the wrapper struct.
glip
uses the the PowerShell Get-Clipboard
and Set-Clipboard
cmdlets to
read and write to the Windows clipboard.
If PowerShell is not available, the clip
command is used to write to the
Windows clipboard.
glip
uses pbcopy
and pbpaste
commands on macOS.
glip
requires the installation of either xclip
or xsel
to function on
Linux (since there's no built-in clipboard interface). glip
will choose
whichever program is available, with a preference for xsel
if both are
avaiklable.
glip
sometimes seems to fail arbitrarily on x86 Windows, and I'm not sure why.
It seems like the PowerShell clipboard modules are not very reliable?
If anybody can accurately diagnose the situation on a Windows machine, I'd be very grateful 🙂.
For an example of an application that uses glip
, check out glipboard
(located at /cmd/glipboard/
).
glipboard
was developed to both showcase how glip
can be used in a real
application, as well as to be a universal clipboard interface that external
programs can call in order to write to a system clipboard, if the underlying
commands are available.
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.