Exploit database

GH-44d3c067f41a902d7e7d341755d2cc59

jpiechowka/at-doom-fortigate

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2018-13379

20 sources

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

Repository files3
jpiechowka/at-doom-fortigateRevision c8feee86b9a1

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

doom/cleaner.go

Go · 965 bytes
package doom

import (
	"at-doom-fortigate/config"
	"at-doom-fortigate/networking"
	"encoding/json"
	"github.com/rs/zerolog/log"
	"sync"
)

func CleanAndParseResponses(responsesChan <-chan *networking.MiniResponseObject) <-chan []byte {
	cleanAndParsedResponsesChan := make(chan []byte, config.CleanAndParsedResponsesChanBufferSize)

	go func() {
		defer close(cleanAndParsedResponsesChan)
		wg := sync.WaitGroup{}

		for response := range responsesChan {
			wg.Add(1)

			go func(r *networking.MiniResponseObject) {
				defer wg.Done()

				if r.RequestError == nil && r.ResponseBody != nil {
					outputJson, jsonMarshalError := json.Marshal(r)

					if jsonMarshalError != nil {
						log.Error().Err(jsonMarshalError).Msg("Error encoding struct to JSON")
						return
					}

					responseToWrite := append(outputJson, "\n"...)
					cleanAndParsedResponsesChan <- responseToWrite
				}
			}(response)
		}
		wg.Wait()
	}()

	return cleanAndParsedResponsesChan
}