Exploit databaseDownload repository ZIP
GH-dd9a1a2c0ec11b47776e809b08323333
strainxx/react2shell-honeypot
Sources for CVE-2025-66478
18 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files6
strainxx/react2shell-honeypotRevision 8b41715d474d
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
main.go
Go · 2,109 bytespackage main
import (
"encoding/json"
"flag"
"fmt"
"net/http"
"os"
"path/filepath"
"strconv"
"strings"
"time"
"github.com/gin-gonic/gin"
)
func react2shell_like(form_value map[string][]string) bool {
if len(form_value) < 2 {
return false
}
for _, vals := range form_value {
for _, val := range vals {
var v any
err := json.Unmarshal([]byte(val), &v)
if err != nil {
continue
}
if !strings.Contains(val, "__proto__") && !strings.Contains(val, "$") {
continue
}
return true
}
}
return true
}
func log(form_value map[string][]string, ip string) {
new_path := filepath.Join(".", "logs", ip)
file_path := filepath.Join(new_path, strconv.FormatInt(time.Now().Unix(), 10))
err := os.MkdirAll(new_path, os.ModePerm)
if err != nil {
fmt.Printf("Failed to MkdirAll! %v", err.Error())
return
}
jsonstr, err := json.Marshal(form_value)
if err != nil {
fmt.Printf("Failed to Marshal! %v", err.Error())
return
}
err = os.WriteFile(file_path, jsonstr, os.ModePerm)
if err != nil {
fmt.Printf("Failed to WriteFile! %v", err.Error())
}
}
func main() {
fmt.Println("react2shell honeypot")
addrPtr := flag.String("addr", ":8080", "Address of server")
flag.Parse()
r := gin.Default()
r.GET("/", func(c *gin.Context) {
c.String(http.StatusOK, "Hello!")
})
r.POST("/", func(c *gin.Context) {
mp_form, err := c.MultipartForm()
if err != nil {
c.JSON(http.StatusNotFound, "Not found")
}
if react2shell_like(mp_form.Value) {
fmt.Printf("Someone exploiting (%v): %v\n", c.ClientIP(), mp_form.Value)
log(mp_form.Value, c.ClientIP())
}
c.Header("X-Action-Redirect", "/login?a=11111") // assetnote/react2shell-scanner detects react2shell using re.search(r'.*/login\?a=11111.*', redirect_header)
// Some stuff to mimic vulnerable host
// check: https://github.com/gensecaihq/react2shell-scanner
c.Header("x-action-revalidated", "aaaaaaaa")
c.String(500, "E{\"digest\": \"1\", \"aaa\":\"NEXT_REDIRECT ReactServerComponentsError|RSCError createActionProxy\"}") // Returning 500 for safe side channel
})
r.Run(*addrPtr)
}