Added default placeholder route
This commit is contained in:
@@ -17,7 +17,7 @@ type GlobalSettings struct {
|
||||
MaxRequestRetries int
|
||||
WaitBeforeRetry int
|
||||
WebTemplatePrefix string
|
||||
WebTemplateRoute string
|
||||
WebFrontPlaceholder string
|
||||
}
|
||||
|
||||
type GlobalSettingsJson struct {
|
||||
@@ -27,7 +27,7 @@ type GlobalSettingsJson struct {
|
||||
MaxRequestRetries int `json:"maxRequestRetries"`
|
||||
WaitBeforeRetry int `json:"waitBeforeRetry"`
|
||||
WebTemplatePrefix string `json:"webTemplatePrefix"`
|
||||
WebTemplateRoute string `json:"webTemplateRoute"`
|
||||
WebFrontPlaceholder string `json:"webFrontPlaceholder"`
|
||||
}
|
||||
|
||||
|
||||
@@ -60,14 +60,14 @@ func (tapit *Tapit) updateGlobalSettings(w http.ResponseWriter, r *http.Request)
|
||||
http.Error(w, "Bad request", 400)
|
||||
return
|
||||
}
|
||||
if globalSettingsJson.SecretRegistrationCode != "" && globalSettingsJson.ThreadsPerCampaign != 0 && globalSettingsJson.BcryptCost != 0 && globalSettingsJson.WebTemplatePrefix != "" && globalSettingsJson.WebTemplateRoute != "" {
|
||||
if globalSettingsJson.SecretRegistrationCode != "" && globalSettingsJson.ThreadsPerCampaign != 0 && globalSettingsJson.BcryptCost != 0 && globalSettingsJson.WebTemplatePrefix != "" {
|
||||
globalSettings.SecretRegistrationCode = globalSettingsJson.SecretRegistrationCode
|
||||
globalSettings.ThreadsPerCampaign = globalSettingsJson.ThreadsPerCampaign
|
||||
globalSettings.BcryptCost = globalSettingsJson.BcryptCost
|
||||
globalSettings.MaxRequestRetries = globalSettingsJson.MaxRequestRetries
|
||||
globalSettings.WaitBeforeRetry = globalSettingsJson.WaitBeforeRetry
|
||||
globalSettings.WebTemplatePrefix = globalSettingsJson.WebTemplatePrefix
|
||||
globalSettings.WebTemplateRoute = globalSettingsJson.WebTemplateRoute
|
||||
globalSettings.WebFrontPlaceholder = globalSettingsJson.WebFrontPlaceholder
|
||||
err = tapit.db.Save(&globalSettings).Error
|
||||
|
||||
if err != nil {
|
||||
@@ -96,7 +96,7 @@ func (tapit *Tapit) getGlobalSettings(w http.ResponseWriter, r *http.Request) {
|
||||
globalSettingsJson.MaxRequestRetries = globalSettings.MaxRequestRetries
|
||||
globalSettingsJson.WaitBeforeRetry = globalSettings.WaitBeforeRetry
|
||||
globalSettingsJson.WebTemplatePrefix = globalSettings.WebTemplatePrefix
|
||||
globalSettingsJson.WebTemplateRoute = globalSettings.WebTemplateRoute
|
||||
globalSettingsJson.WebFrontPlaceholder = globalSettings.WebFrontPlaceholder
|
||||
|
||||
jsonResults, err := json.Marshal(globalSettingsJson)
|
||||
if err != nil {
|
||||
|
||||
@@ -88,7 +88,7 @@ func main() {
|
||||
globalSettings.MaxRequestRetries = 5
|
||||
globalSettings.WaitBeforeRetry = 1000
|
||||
globalSettings.WebTemplatePrefix = "https://www.attacker.com/"
|
||||
globalSettings.WebTemplateRoute = "/"
|
||||
globalSettings.WebFrontPlaceholder = ""
|
||||
|
||||
tapit.db.NewRecord(&globalSettings)
|
||||
tapit.db.Create(&globalSettings)
|
||||
@@ -166,6 +166,7 @@ func main() {
|
||||
|
||||
// Handle WebTemplate Routes
|
||||
webTemplateRouter := mux.NewRouter()
|
||||
webTemplateRouter.HandleFunc("/", tapit.handleWebFront)
|
||||
webTemplateRouter.HandleFunc("/{route}", tapit.webTemplateRouteHandler)
|
||||
|
||||
// Starting victim route web server
|
||||
|
||||
Binary file not shown.
@@ -438,6 +438,18 @@ func (tapit *Tapit) webTemplateRouteHandler(w http.ResponseWriter, r *http.Reque
|
||||
return
|
||||
}
|
||||
|
||||
func (tapit *Tapit) handleWebFront(w http.ResponseWriter, r *http.Request) {
|
||||
var globalSettings GlobalSettings
|
||||
err := tapit.db.Last(&globalSettings).Error
|
||||
if err != nil {
|
||||
w.Write([]byte(""))
|
||||
return
|
||||
}
|
||||
|
||||
w.Write([]byte(globalSettings.WebFrontPlaceholder))
|
||||
return
|
||||
}
|
||||
|
||||
func (tapit *Tapit) handleDownloadView(w http.ResponseWriter, r *http.Request) {
|
||||
if strings.ToUpper(r.Method) == "GET" {
|
||||
var csvBuffer bytes.Buffer
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -11,7 +11,7 @@ export class GlobalSettings {
|
||||
maxRequestRetries: number;
|
||||
waitBeforeRetry: number;
|
||||
webTemplatePrefix: string;
|
||||
webTemplateRoute: string;
|
||||
webFrontPlaceholder: string;
|
||||
}
|
||||
|
||||
export class GlobalSettingsNotification {
|
||||
|
||||
@@ -43,8 +43,8 @@
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-12 d-flex">
|
||||
<label for="web-route" class="pr-2 mt-auto mb-auto">Web Route</label>
|
||||
<input type="text" class="flex-grow-1" id="web-route" [(ngModel)]="displaySettings.webTemplateRoute" >
|
||||
<label for="webfront-placeholder" class="pr-2 mt-auto mb-auto">Frontpage Placeholder</label>
|
||||
<textarea class="form-control flex" [(ngModel)]="displaySettings.webFrontPlaceholder" id="webfront-placeholder" rows="6"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
|
||||
@@ -14,7 +14,7 @@ export class GlobalSettingsComponent implements OnInit {
|
||||
updateGlobalSettings() {
|
||||
this.tempSettings.secretRegistrationCode = this.displaySettings.secretRegistrationCode;
|
||||
this.tempSettings.webTemplatePrefix = this.displaySettings.webTemplatePrefix;
|
||||
this.tempSettings.webTemplateRoute = this.displaySettings.webTemplateRoute;
|
||||
this.tempSettings.webFrontPlaceholder = this.displaySettings.webFrontPlaceholder;
|
||||
this.tempSettings.threadsPerCampaign = parseInt(this.displaySettings.threadsPerCampaign, 10) + 0;
|
||||
this.tempSettings.bcryptCost = parseInt(this.displaySettings.bcryptCost, 10);
|
||||
this.tempSettings.maxRequestRetries = parseInt(this.displaySettings.maxRequestRetries, 10);
|
||||
|
||||
Reference in New Issue
Block a user