Skip to content

Commit

Permalink
Created client headers to emulate Chrome and added server headers to …
Browse files Browse the repository at this point in the history
…emulate Apache.

Also put in cache control so we don't fuck the CDN with a bunch of random junk.
  • Loading branch information
doxx authored and doxx committed Nov 20, 2024
1 parent 73d347f commit 1d36be7
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 1 deletion.
Binary file modified bin/Apple-ARM64/darkflare-client
Binary file not shown.
Binary file modified bin/Apple-ARM64/darkflare-server
Binary file not shown.
Binary file modified bin/Debian-5.10-x86_64/darkflare-client
Binary file not shown.
Binary file modified bin/Debian-5.10-x86_64/darkflare-server
Binary file not shown.
21 changes: 21 additions & 0 deletions client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,27 @@ func (c *Client) createDebugRequest(method, baseURL string, body io.Reader) (*ht
host = strings.TrimPrefix(host, "http://")
req.Host = host

// Cache control
req.Header.Set("Cache-Control", "no-cache, no-store, must-revalidate")
req.Header.Set("Pragma", "no-cache")
req.Header.Set("Expires", "0")

// Modern Chrome headers
req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36")
req.Header.Set("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7")
req.Header.Set("Accept-Language", "en-US,en;q=0.9")
req.Header.Set("Accept-Encoding", "gzip, deflate, br")
req.Header.Set("Sec-Ch-Ua", "\"Google Chrome\";v=\"119\", \"Chromium\";v=\"119\", \"Not?A_Brand\";v=\"24\"")
req.Header.Set("Sec-Ch-Ua-Mobile", "?0")
req.Header.Set("Sec-Ch-Ua-Platform", "\"Windows\"")
req.Header.Set("Sec-Fetch-Dest", "document")
req.Header.Set("Sec-Fetch-Mode", "navigate")
req.Header.Set("Sec-Fetch-Site", "none")
req.Header.Set("Sec-Fetch-User", "?1")
req.Header.Set("Upgrade-Insecure-Requests", "1")
req.Header.Set("Connection", "keep-alive")
req.Header.Set("DNT", "1")

c.debugLog("Making %s request to: %s (Host: %s)", method, fullURL, host)

if c.debug {
Expand Down
9 changes: 8 additions & 1 deletion server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,14 @@ func (s *Server) handleRequest(w http.ResponseWriter, r *http.Request) {
return
}

// Set headers
// Set Apache-like headers
w.Header().Set("Server", "Apache/2.4.41 (Ubuntu)")
w.Header().Set("X-Powered-By", "PHP/7.4.33")
w.Header().Set("X-Content-Type-Options", "nosniff")
w.Header().Set("X-Frame-Options", "SAMEORIGIN")
w.Header().Set("X-XSS-Protection", "1; mode=block")

// Cache control headers
w.Header().Set("Cache-Control", "no-store, no-cache, must-revalidate")
w.Header().Set("Pragma", "no-cache")
w.Header().Set("Expires", "0")
Expand Down

0 comments on commit 1d36be7

Please sign in to comment.