mirror of
https://github.com/Li4n0/revsuit.git
synced 2026-09-21 22:30:46 +08:00
Support http,dns and mysql connection. Support custom http, dns response. Support dns rebinding. Support mysql load local files and jdbc deserialize exploit.
66 lines
1.4 KiB
Go
66 lines
1.4 KiB
Go
package cli
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"os"
|
|
"sort"
|
|
|
|
"github.com/li4n0/revsuit/pkg/server"
|
|
"github.com/urfave/cli/v2"
|
|
"gopkg.in/yaml.v2"
|
|
log "unknwon.dev/clog/v2"
|
|
)
|
|
|
|
func Start() {
|
|
app := &cli.App{
|
|
Name: "RevSuit",
|
|
Usage: "An Open-Sourced Reverse Platform Designed for Receive Various Kinds of Connection",
|
|
Flags: []cli.Flag{
|
|
&cli.StringFlag{
|
|
Name: "addr",
|
|
Usage: "platform listened address",
|
|
},
|
|
&cli.StringFlag{
|
|
Name: "token",
|
|
Usage: "token used to manage platform",
|
|
},
|
|
&cli.StringFlag{
|
|
Name: "flags",
|
|
Usage: "for http and dns connection, platform will only record the connection those match these regex flags. * meaning record all",
|
|
},
|
|
&cli.StringFlag{
|
|
Name: "db",
|
|
Usage: "database file path",
|
|
},
|
|
},
|
|
Action: func(c *cli.Context) error {
|
|
conf := &server.Config{}
|
|
if content, err := ioutil.ReadFile("config.yaml"); err == nil {
|
|
if err := yaml.Unmarshal(content, conf); err != nil {
|
|
log.Fatal(err.Error())
|
|
}
|
|
} else {
|
|
log.Fatal(err.Error())
|
|
}
|
|
if c.String("addr") != "" {
|
|
conf.Addr = c.String("addr")
|
|
}
|
|
if c.String("token") != "" {
|
|
conf.Addr = c.String("token")
|
|
}
|
|
if c.String("db") != "" {
|
|
conf.Database = c.String("db")
|
|
}
|
|
server.New(conf).Run()
|
|
return nil
|
|
},
|
|
}
|
|
sort.Sort(cli.FlagsByName(app.Flags))
|
|
sort.Sort(cli.CommandsByName(app.Commands))
|
|
|
|
err := app.Run(os.Args)
|
|
if err != nil {
|
|
log.Fatal(err.Error())
|
|
}
|
|
}
|