Skip to content

Commit

Permalink
Intruder 模块增加Action处理
Browse files Browse the repository at this point in the history
  • Loading branch information
yhy0 committed May 16, 2023
1 parent ba720bb commit 71749c9
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 4 deletions.
9 changes: 7 additions & 2 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ func NewApp() *App {
return &App{}
}

// startup is called when the app starts. The context is saved
// so we can call the runtime methods
// startup is called when the app starts. The context is saved ,so we can call the runtime methods
func (a *App) startup(ctx context.Context) {
a.ctx = ctx
burpSuite.Ctx = ctx
Expand Down Expand Up @@ -215,6 +214,12 @@ func (a *App) GetHistoryDump(id int) *burpSuite.HTTPBody {
return burpSuite.HTTPBodyMap.ReadMap(id)
}

// InterceptSend 从 Intercept 发给 Repeater\Intruder 界面处理
func (a *App) InterceptSend(name string) {
runtime.EventsEmit(a.ctx, name, burpSuite.HttpBodyInter)
return
}

// SendToRepeater 发给 Repeater 界面处理
func (a *App) SendToRepeater(id int) {
runtime.EventsEmit(a.ctx, "RepeaterBody", burpSuite.HTTPBodyMap.ReadMap(id))
Expand Down
39 changes: 37 additions & 2 deletions frontend/src/components/burpsuite/proxy/intercept/Intercept.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<n-button :type="type" style="margin-right: 16px;" id="start" @click="changeButtonType()">
{{value}}
</n-button>

<n-dropdown trigger="hover" :show-arrow="true" :options="options" @select="handleSelect">
<n-button>Action</n-button>
</n-dropdown>
</div>

<n-card>
Expand All @@ -20,10 +24,41 @@
</template>

<script setup>
import {ref} from "vue";
import {Intercept} from "../../../../../wailsjs/go/main/App.js";
import {ref, h} from "vue";
import {NCard, useMessage} from "naive-ui";
import {Intercept, InterceptSend} from "../../../../../wailsjs/go/main/App.js";
import {EventsOn} from "../../../../../wailsjs/runtime/runtime.js";
const message = useMessage();
const options = [
{
label: () => h("span", { style: { color: "green" } }, "Repeater"),
key: "repeater",
},
{
label: () => h("span", { style: { color: "green" } }, "Intruder"),
key: "intruder",
},
];
const handleSelect = (option) => {
if (option === "repeater") {
if(body.value !== "") {
message.info("Send To Repeater Success");
InterceptSend("RepeaterBody")
}
} else if (option === "intruder") {
if(body.value !== "") {
message.info("Send To Intruder Success");
InterceptSend("IntruderBody")
}
}
};
const body = ref('')
EventsOn("InterceptBody", result => {
Expand Down
2 changes: 2 additions & 0 deletions frontend/wailsjs/go/main/App.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export function GetProxyPort():Promise<number>;

export function Intercept(arg1:boolean,arg2:boolean,arg3:string):Promise<number>;

export function InterceptSend(arg1:string):Promise<void>;

export function Intruder(arg1:string,arg2:string,arg3:Array<string>,arg4:Array<string>,arg5:string,arg6:string):Promise<void>;

export function Parser(arg1:string):Promise<any>;
Expand Down
4 changes: 4 additions & 0 deletions frontend/wailsjs/go/main/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export function Intercept(arg1, arg2, arg3) {
return window['go']['main']['App']['Intercept'](arg1, arg2, arg3);
}

export function InterceptSend(arg1) {
return window['go']['main']['App']['InterceptSend'](arg1);
}

export function Intruder(arg1, arg2, arg3, arg4, arg5, arg6) {
return window['go']['main']['App']['Intruder'](arg1, arg2, arg3, arg4, arg5, arg6);
}
Expand Down
2 changes: 2 additions & 0 deletions tools/burpSuite/BurpSuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ var Proxy *proxy.Proxy

var Intercept bool

var HttpBodyInter *HTTPBody

func init() {
HttpHistory = make(chan HTTPHistory, 1)

Expand Down
6 changes: 6 additions & 0 deletions tools/burpSuite/burpAddon.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ func (b *Burp) Request(f *proxy.Flow) {

requestDump := buf.String()

HttpBodyInter = &HTTPBody{
TargetUrl: f.Request.URL.String(),
Request: requestDump,
Response: "",
}

runtime.EventsEmit(Ctx, "InterceptBody", requestDump)
Sum += 1
Done <- true
Expand Down

0 comments on commit 71749c9

Please sign in to comment.