Skip to content

Commit 71749c9

Browse files
committed
Intruder 模块增加Action处理
1 parent ba720bb commit 71749c9

File tree

6 files changed

+58
-4
lines changed

6 files changed

+58
-4
lines changed

app.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ func NewApp() *App {
2929
return &App{}
3030
}
3131

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

217+
// InterceptSend 从 Intercept 发给 Repeater\Intruder 界面处理
218+
func (a *App) InterceptSend(name string) {
219+
runtime.EventsEmit(a.ctx, name, burpSuite.HttpBodyInter)
220+
return
221+
}
222+
218223
// SendToRepeater 发给 Repeater 界面处理
219224
func (a *App) SendToRepeater(id int) {
220225
runtime.EventsEmit(a.ctx, "RepeaterBody", burpSuite.HTTPBodyMap.ReadMap(id))

frontend/src/components/burpsuite/proxy/intercept/Intercept.vue

+37-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
<n-button :type="type" style="margin-right: 16px;" id="start" @click="changeButtonType()">
1111
{{value}}
1212
</n-button>
13+
14+
<n-dropdown trigger="hover" :show-arrow="true" :options="options" @select="handleSelect">
15+
<n-button>Action</n-button>
16+
</n-dropdown>
1317
</div>
1418

1519
<n-card>
@@ -20,10 +24,41 @@
2024
</template>
2125

2226
<script setup>
23-
import {ref} from "vue";
24-
import {Intercept} from "../../../../../wailsjs/go/main/App.js";
27+
import {ref, h} from "vue";
28+
import {NCard, useMessage} from "naive-ui";
29+
import {Intercept, InterceptSend} from "../../../../../wailsjs/go/main/App.js";
2530
import {EventsOn} from "../../../../../wailsjs/runtime/runtime.js";
2631
32+
const message = useMessage();
33+
34+
const options = [
35+
{
36+
label: () => h("span", { style: { color: "green" } }, "Repeater"),
37+
key: "repeater",
38+
},
39+
{
40+
label: () => h("span", { style: { color: "green" } }, "Intruder"),
41+
key: "intruder",
42+
},
43+
];
44+
const handleSelect = (option) => {
45+
if (option === "repeater") {
46+
47+
if(body.value !== "") {
48+
message.info("Send To Repeater Success");
49+
InterceptSend("RepeaterBody")
50+
}
51+
52+
} else if (option === "intruder") {
53+
if(body.value !== "") {
54+
message.info("Send To Intruder Success");
55+
InterceptSend("IntruderBody")
56+
}
57+
58+
}
59+
};
60+
61+
2762
const body = ref('')
2863
2964
EventsOn("InterceptBody", result => {

frontend/wailsjs/go/main/App.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export function GetProxyPort():Promise<number>;
1818

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

21+
export function InterceptSend(arg1:string):Promise<void>;
22+
2123
export function Intruder(arg1:string,arg2:string,arg3:Array<string>,arg4:Array<string>,arg5:string,arg6:string):Promise<void>;
2224

2325
export function Parser(arg1:string):Promise<any>;

frontend/wailsjs/go/main/App.js

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ export function Intercept(arg1, arg2, arg3) {
3434
return window['go']['main']['App']['Intercept'](arg1, arg2, arg3);
3535
}
3636

37+
export function InterceptSend(arg1) {
38+
return window['go']['main']['App']['InterceptSend'](arg1);
39+
}
40+
3741
export function Intruder(arg1, arg2, arg3, arg4, arg5, arg6) {
3842
return window['go']['main']['App']['Intruder'](arg1, arg2, arg3, arg4, arg5, arg6);
3943
}

tools/burpSuite/BurpSuite.go

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ var Proxy *proxy.Proxy
4747

4848
var Intercept bool
4949

50+
var HttpBodyInter *HTTPBody
51+
5052
func init() {
5153
HttpHistory = make(chan HTTPHistory, 1)
5254

tools/burpSuite/burpAddon.go

+6
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ func (b *Burp) Request(f *proxy.Flow) {
170170

171171
requestDump := buf.String()
172172

173+
HttpBodyInter = &HTTPBody{
174+
TargetUrl: f.Request.URL.String(),
175+
Request: requestDump,
176+
Response: "",
177+
}
178+
173179
runtime.EventsEmit(Ctx, "InterceptBody", requestDump)
174180
Sum += 1
175181
Done <- true

0 commit comments

Comments
 (0)