2021-12-28 02:28:43 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2021-12-29 17:08:30 +00:00
|
|
|
"flag"
|
|
|
|
"os"
|
2021-12-28 06:10:06 +00:00
|
|
|
|
2022-01-03 15:13:42 +00:00
|
|
|
"github.com/pterm/pterm"
|
2022-01-03 07:24:39 +00:00
|
|
|
"github.com/xvzc/SpoofDPI/config"
|
2022-01-03 15:13:42 +00:00
|
|
|
"github.com/xvzc/SpoofDPI/proxy"
|
2021-12-28 02:28:43 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2022-01-03 15:13:42 +00:00
|
|
|
src := flag.String("src", "127.0.0.1:8080", "source-ip:source-port")
|
2021-12-29 17:08:30 +00:00
|
|
|
dns := flag.String("dns", "8.8.8.8", "DNS server")
|
|
|
|
debug := flag.Bool("debug", false, "true | false")
|
2022-01-03 15:13:42 +00:00
|
|
|
flag.Parse()
|
2021-12-29 17:08:30 +00:00
|
|
|
|
2022-01-03 15:13:42 +00:00
|
|
|
err := config.InitConfig(*src, *dns, *debug)
|
2021-12-29 17:08:30 +00:00
|
|
|
if err != nil {
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
|
2022-01-03 15:13:42 +00:00
|
|
|
cyan := pterm.NewLettersFromStringWithStyle("Spoof", pterm.NewStyle(pterm.FgCyan))
|
|
|
|
purple := pterm.NewLettersFromStringWithStyle("DPI", pterm.NewStyle(pterm.FgLightMagenta))
|
|
|
|
pterm.DefaultBigText.WithLetters(cyan, purple).Render()
|
|
|
|
|
|
|
|
pterm.DefaultBulletList.WithItems([]pterm.BulletListItem{
|
|
|
|
{Level: 0, Text: "SRC : " + *src},
|
|
|
|
{Level: 0, Text: "DNS : " + *dns},
|
|
|
|
}).Render()
|
|
|
|
|
2021-12-29 17:08:30 +00:00
|
|
|
proxy.Start()
|
2021-12-28 02:28:43 +00:00
|
|
|
}
|