Skip to content

Commit b42169e

Browse files
committed
initial source
Signed-off-by: hlts2 <[email protected]>
1 parent d320614 commit b42169e

File tree

4 files changed

+400
-0
lines changed

4 files changed

+400
-0
lines changed

cmd/root.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package cmd
2+
3+
import (
4+
"errors"
5+
"fmt"
6+
7+
"github.com/spf13/cobra"
8+
)
9+
10+
var (
11+
host string
12+
port uint
13+
)
14+
15+
var rootCmd = &cobra.Command{
16+
Use: "crssh",
17+
Short: "penetration testing tool for ssh",
18+
RunE: func(cmd *cobra.Command, args []string) error {
19+
if len(args) != 1 {
20+
return errors.New("argument not found")
21+
}
22+
fmt.Println(args)
23+
return nil
24+
},
25+
}
26+
27+
func init() {
28+
rootCmd.Flags().StringVarP(&host, "user", "u", "root", "set user name")
29+
rootCmd.Flags().UintVarP(&port, "port", "p", 22, "set port number")
30+
}
31+
32+
// Execute adds all child commands to the root command and sets flags appropriately.
33+
// This is called by main.main(). It only needs to happen once to the rootCmd.
34+
func Execute() {
35+
cobra.CheckErr(rootCmd.Execute())
36+
}

go.mod

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module github.com/hlts2/crssh
2+
3+
go 1.15
4+
5+
require (
6+
github.com/fsnotify/fsnotify v1.4.9 // indirect
7+
github.com/hlts2/gobf v0.0.0-20210217105025-8dc776744e94 // indirect
8+
github.com/hlts2/godict v0.0.0-20210217143636-bd825821640b // indirect
9+
github.com/magiconair/properties v1.8.4 // indirect
10+
github.com/mitchellh/go-homedir v1.1.0
11+
github.com/mitchellh/mapstructure v1.4.1 // indirect
12+
github.com/pelletier/go-toml v1.8.1 // indirect
13+
github.com/spf13/afero v1.5.1 // indirect
14+
github.com/spf13/cast v1.3.1 // indirect
15+
github.com/spf13/cobra v1.1.3
16+
github.com/spf13/jwalterweatherman v1.1.0 // indirect
17+
github.com/spf13/viper v1.7.1
18+
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43 // indirect
19+
golang.org/x/text v0.3.5 // indirect
20+
gopkg.in/ini.v1 v1.62.0 // indirect
21+
)

0 commit comments

Comments
 (0)