mirror of
https://github.com/muraenateam/muraena.git
synced 2026-01-23 02:24:05 +00:00
Update transformer.go
This commit is contained in:
parent
7107021e68
commit
e97bc8fa61
1 changed files with 24 additions and 1 deletions
|
|
@ -544,7 +544,17 @@ func (r *Replacer) MakeReplacements() {
|
|||
// Responses
|
||||
//
|
||||
r.SetBackwardReplacements([]string{})
|
||||
r.SetBackwardReplacements(append(r.BackwardReplacements, []string{r.Target, r.Phishing}...))
|
||||
|
||||
//
|
||||
// Dirty fix for the case when the Victim domain is a subdomain of the Phishing domain:
|
||||
// e.g. phishing.com and no-phishing.com
|
||||
//
|
||||
// Define potential boundaries around the domain
|
||||
boundaries := []string{" ", ",", ".", ":", "/", "(", ")", "!", "'", "\"", ";", "<", ">", "\n", "\t"}
|
||||
targetVariations, phishingVariations := createVariations(r.Target, r.Phishing, boundaries)
|
||||
for i, variation := range targetVariations {
|
||||
r.SetBackwardReplacements(append(r.BackwardReplacements, []string{variation, phishingVariations[i]}...))
|
||||
}
|
||||
|
||||
// Add the SubdomainMap to the backward replacements
|
||||
for _, sub := range r.SubdomainMap {
|
||||
|
|
@ -596,6 +606,19 @@ func (r *Replacer) MakeReplacements() {
|
|||
|
||||
}
|
||||
|
||||
// createVariations generates all possible variations of the target and phishing strings with boundaries
|
||||
func createVariations(target, phishing string, boundaries []string) ([]string, []string) {
|
||||
var targetVariations, phishingVariations []string
|
||||
|
||||
// Generate variations with each boundary preceding and following the target
|
||||
for _, boundary := range boundaries {
|
||||
targetVariations = append(targetVariations, boundary+target)
|
||||
phishingVariations = append(phishingVariations, boundary+phishing)
|
||||
}
|
||||
|
||||
return targetVariations, phishingVariations
|
||||
}
|
||||
|
||||
func (r *Replacer) DomainMapping() (err error) {
|
||||
baseDom := r.Target
|
||||
// log.Debug("Proxy destination: %s", tui.Bold(tui.Green("*."+baseDom)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue