This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| println "hello world" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) + "]]]") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| start on runlevel [2345] | |
| stop on runlevel [!2345] | |
| console log | |
| respawn | |
| chdir /home/YOUR_USER | |
| script | |
| exec ./sshd_honeypot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "net" | |
| "code.google.com/p/go.crypto/ssh" | |
| "code.google.com/p/go.crypto/ssh/terminal" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |