HellPot/extra/banner.go

63 lines
2.1 KiB
Go
Raw Normal View History

2021-09-15 19:17:32 +00:00
package extra
import (
"bytes"
"compress/gzip"
crip "crypto/rand"
"encoding/base64"
"encoding/binary"
"fmt"
"io/ioutil"
"strings"
2021-09-16 07:51:16 +00:00
"github.com/yunginnanet/HellPot/config"
2021-09-15 19:17:32 +00:00
)
2021-09-22 06:47:32 +00:00
const hellpot = "H4sIAAAAAAACA8VXvW7bQAze9QpZOGQUbNXnJBDyAh27Gx1c10icRHLRKgUCdPDgQavOgB/QT1JZ9P3oRJ5OTowAjnE5feSR30fy5Ohqdj25nyYZ4EJkh/22Xn457h325WEvbYTZLq9m4u60nWTHP7AAO+UNaneuR8aUOqTxdAIDXAIv1cJE5TfbNVDNFZ8cScxWfUqOb52GMU6yiKAWfRjDisqRPEV6JautTN4WYONXXBPKCjAcGZ4qkMTRmpUtJrqJ+hy18GRskq4ZyQoqcdn1VH82uCf0YyHwcUVFJx0JTRFonvvMXJr9Ap1vyUtrlGQKVXJiVkHisFm0FRvSZdLRoyVvheUHKOMRhBpCR1q+uaRdws5A8RvSFTFI2DPttu2ph6N2R7HHiexmbEbuhue+WwykqO2ZS4VVkcSS0oLSEVAPoY8zhrpx7SunW5NWf/uuh5Kv5vMtpfWUoqNbfMHMWw1bj7SNMxpdR51z+iJjhSJqDbvQXByAAXBs+jqeCiWMDzxx9y5Oh/qQFtkfLK9UvXD69r3g9Qzeqj1lzpU0UB24BBsVE+WneezrG+ZVOTgAty884kPIbUILXWmhA+TrCM1kRb8YBeV/IWu6D7gLN7RaGAE9v3ioWBUMoRCqUn+lTjQTA1qQLqmLWInE0gEg3KGXxJNXhfmrrK6z+ZOicVQvpri5yk2DNKvmK4pgpl08rIpRsfg1+rn6vVwU4+f52/rP+Ovy5eXbumjg3xGMwdXox9cfo8U6G7+95g+rPJ/ny6KN/ycmsZjG4iYWt3Eq4nQSp9M4vYnT+t8k+g/TQ9elQBAAAA=="
2021-09-15 19:17:32 +00:00
func b64d(str string) []byte {
var data []byte
data, _ = base64.StdEncoding.DecodeString(str)
return data
}
func rc(s []string) string {
return strings.TrimSpace(s[ru()%uint32(len(s))])
}
func process(in string) (s string) {
2021-09-16 07:51:16 +00:00
var v = strings.Split(config.Version, "")
maj := v[0]
min := v[2]
2021-09-15 19:17:32 +00:00
sp := strings.Split(gz(b64d(in)), "|")
s = sp[0]
c := strings.Split(sp[1], ",")
cproc := func(in, num string) (inr string) {
inr = in
tor := fmt.Sprintf("$%s", num)
for n := strings.Count(inr, tor); n > 0; n-- {
inr = strings.Replace(inr, tor, rc(c), 1)
}
return
}
for n := 1; n < 5; n++ {
s = cproc(s, fmt.Sprintf("%d", n))
}
2021-09-16 07:51:16 +00:00
s = strings.Replace(s, "$maj", maj, -1)
s = strings.Replace(s, "$min", min, -1)
2021-09-15 19:17:32 +00:00
return
}
func gz(data []byte) string {
gz, _ := gzip.NewReader(bytes.NewReader(data))
out, _ := ioutil.ReadAll(gz)
return string(out)
}
func ru() uint32 {
b := make([]byte, 8192)
crip.Read(b)
return binary.LittleEndian.Uint32(b)
}
// PrintBanner prints our entropic banner
func PrintBanner() {
println("\n" + process(hellpot) + "\n\n")
}