Skip to content

Instantly share code, notes, and snippets.

View joshrendek's full-sized avatar

Josh Rendek joshrendek

View GitHub Profile
#!/bin/bash
# This block defines the variables the user of the script needs to input
# when deploying using this script.
#
#
#<UDF name="hostname" label="The hostname for the new Linode.">
# HOSTNAME=
#
#<UDF name="fqdn" label="The new Linode's Fully Qualified Domain Name">
# FQDN=
println "hello world"
INFO: 2014/07/07 23:15:18 sshd.go:157: [0 0 0 5 117 110 97 109 101]
INFO: 2014/07/07 23:15:18 sshd.go:158: [117 110 97 109 101]
func HandleShellRequest(channel ssh.Channel, in <-chan *ssh.Request) {
for req := range in {
ok := true
logfile.Println("[request " + req.Type + "]: " + string(req.Payload))
switch req.Type {
case "shell":
logfile.Println("[shell]")
case "exec":
if string(req.Payload) == "uname" {
logfile.Println("[[[" + string(req.Payload) + "]]]")
start on runlevel [2345]
stop on runlevel [!2345]
console log
respawn
chdir /home/YOUR_USER
script
exec ./sshd_honeypot
func sshLoginList(res http.ResponseWriter, req *http.Request) {
var logins []SshLogin
var resp []byte
var per_page int64 = 50
page, err := strconv.ParseInt(req.URL.Query()["page"][0], 10, 64)
if err != nil {
resp, _ = json.Marshal(struct{ Message string }{"Invalid page parameter"})
}
fmt.Println(page)
DB.Debug().Model(SshLogin{}).Order("id desc").Limit(per_page).Offset(((page * per_page) - per_page)).Find(&logins)
pm := new(MockPackageManager)
a := new(MockSyswardApi)
pm.On("UpdatePackage", "apt").Return(nil)
job := Job{
JobId: 1,
JobType: "upgrade-package",
PackageName: "apt",
}
a.On("JobPostBack", job).Return()
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
;;; from purcell/emacs.d
(defun require-package (package &optional min-version no-refresh)
"Install given PACKAGE, optionally requiring MIN-VERSION.
If NO-REFRESH is non-nil, the available package lists will not be
re-downloaded in order to locate PACKAGE."
(if (package-installed-p package min-version)
package main
import (
"fmt"
"net"
"code.google.com/p/go.crypto/ssh"
"code.google.com/p/go.crypto/ssh/terminal"
)
package main
import "code.google.com/p/go.crypto/ssh"
func main() {
ExampleListen()
}
func ExampleListen() {
// An SSH server is represented by a ServerConfig, which holds