Skip to content

Commit

Permalink
fix: 提取数据前跟新token
Browse files Browse the repository at this point in the history
  • Loading branch information
song-xiao-lin committed Dec 18, 2024
1 parent 63bce7a commit 43e39e7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions app/renderer/src/main/src/utils/extractor.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, {useEffect, useState} from "react"
import {FuzzerResponse} from "@/pages/fuzzer/HTTPFuzzerPage"
import {YakEditor} from "@/utils/editors"
import {StringToUint8Array, Uint8ArrayToString} from "@/utils/str"
import {useDebounceEffect, useGetState, useMap} from "ahooks"
import {editor} from "monaco-editor"
Expand All @@ -17,6 +16,7 @@ import {RegexpInput} from "@/pages/mitm/MITMRule/MITMRuleFromModal"
import styles from "./extractor.module.scss"
import {YakitPopconfirm} from "@/components/yakitUI/YakitPopconfirm/YakitPopconfirm"
import {YakitSpin} from "@/components/yakitUI/YakitSpin/YakitSpin"
import {YakitEditor} from "@/components/yakitUI/YakitEditor/YakitEditor"

export interface WebFuzzerResponseExtractorProp {
responses: FuzzerResponse[]
Expand Down Expand Up @@ -190,6 +190,9 @@ export const WebFuzzerResponseExtractor: React.FC<WebFuzzerResponseExtractorProp
type={"primary"}
size={"small"}
onClick={() => {
const t = randomString(46)
setToken(t)
setExtracted([])
setLoading(true)
responses.forEach((i, number) => {
ipcRenderer
Expand All @@ -203,11 +206,11 @@ export const WebFuzzerResponseExtractor: React.FC<WebFuzzerResponseExtractorProp
Data: i.ResponseRaw,
Token: i.UUID
},
getToken()
t
)
.finally(() => {
if (number === responses.length - 1) {
ipcRenderer.invoke("ExtractData", {End: true}, getToken())
ipcRenderer.invoke("ExtractData", {End: true}, t)
}
})
})
Expand Down Expand Up @@ -274,7 +277,7 @@ export const WebFuzzerResponseExtractor: React.FC<WebFuzzerResponseExtractorProp
<div style={{height: 400}}>
<ResizeBox
firstNode={
<YakEditor
<YakitEditor
editorDidMount={(e) => {
setEditor(e)
}}
Expand Down Expand Up @@ -346,11 +349,10 @@ export const WebFuzzerResponseExtractor: React.FC<WebFuzzerResponseExtractorProp
}
bodyStyle={{margin: 0, padding: 0}}
>
<YakEditor
<YakitEditor
readOnly={true}
noMiniMap={true}
noLineNumber={true}
triggerId={extracted}
type={"html"}
value={extracted.join("\n")}
/>
Expand Down

0 comments on commit 43e39e7

Please sign in to comment.