Skip to content

Commit

Permalink
Update regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaz492 committed Aug 6, 2024
1 parent ad487ce commit 9fa1ceb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ func uploadRequest(data []byte, lang string) (PsteMeResp, error) {

func sanitize(data []byte) []byte {
reToken := regexp.MustCompile(`(^|")(ey[a-zA-Z0-9._-]+|Ew[a-zA-Z0-9._+/-]+=|M\.R3[a-zA-Z0-9._+!\*\$/-]+)`)
reWindowsPath := regexp.MustCompile(`((?:[A-Za-z]:)\\Users\\)([^\\]+)(\\.+)`)
reMacPath := regexp.MustCompile(`(/Users/)([^/\\]+)(/.+)`)
reLinuxPath := regexp.MustCompile(`(/home/)([^/\\]+)(/.+)`)
reWindowsPath := regexp.MustCompile(`((?:[A-Za-z]:)\\Users\\)([^/\\\r\n\t\v]+)(\\.+)?`)
reMacPath := regexp.MustCompile(`(/Users/)([^/\\\r\n\t\v]+)(/.+)?`)
reLinuxPath := regexp.MustCompile(`(/home/)([^/\\\r\n\t\v]+)(/.+)?`)

clean := reToken.ReplaceAll(data, []byte("$1******AUTHTOKEN******$3"))
clean = reWindowsPath.ReplaceAll(clean, []byte("$1***$3"))
Expand Down

0 comments on commit 9fa1ceb

Please sign in to comment.