FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
APIKit/src/main/java/burp/ContextMenu.java at main · test502git/APIKit · GitHub
test502git
/
APIKit
Public
forked from
API-Security/APIKit
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
APIKit
/
src
/
main
/
java
/
burp
/
ContextMenu.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
58 lines (48 loc) · 2.11 KB
Breadcrumbs
APIKit
/
src
/
main
/
java
/
burp
/
ContextMenu.java
Copy path
File metadata and controls
58 lines (48 loc) · 2.11 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package
burp
;
import
burp
.
application
.
apitypes
.
ApiType
;
import
burp
.
utils
.
Executor
;
import
javax
.
swing
.*;
import
java
.
awt
.
event
.
ActionEvent
;
import
java
.
awt
.
event
.
ActionListener
;
import
java
.
util
.
ArrayList
;
import
java
.
util
.
HashSet
;
import
java
.
util
.
List
;
import
java
.
util
.
concurrent
.
CompletableFuture
;
public
class
ContextMenu
implements
IContextMenuFactory
{
private
static
final
HashSet
<
Byte
>
availableToolFlag
=
new
HashSet
<>();
static
{
availableToolFlag
.
add
(
IContextMenuInvocation
.
CONTEXT_PROXY_HISTORY
);
availableToolFlag
.
add
(
IContextMenuInvocation
.
CONTEXT_MESSAGE_EDITOR_REQUEST
);
availableToolFlag
.
add
(
IContextMenuInvocation
.
CONTEXT_MESSAGE_VIEWER_REQUEST
);
}
@
Override
public
List
<
JMenuItem
>
createMenuItems
(
IContextMenuInvocation
invocation
) {
if
(
availableToolFlag
.
contains
(
invocation
.
getInvocationContext
())) {
ArrayList
<
JMenuItem
>
menuItemList
=
new
ArrayList
<>();
JMenuItem
menuItem
=
new
JMenuItem
(
"Do API scan"
);
menuItem
.
addActionListener
(
new
ContextMenuActionListener
(
invocation
));
menuItemList
.
add
(
menuItem
);
return
menuItemList
;
}
else
{
return
null
;
}
}
static
class
ContextMenuActionListener
implements
ActionListener
{
IContextMenuInvocation
invocation
;
public
ContextMenuActionListener
(
IContextMenuInvocation
invocation
) {
this
.
invocation
=
invocation
;
}
@
Override
public
void
actionPerformed
(
ActionEvent
actionEvent
) {
CompletableFuture
.
supplyAsync
(() -> {
PassiveScanner
passiveScanner
=
BurpExtender
.
getPassiveScanner
();
IHttpRequestResponse
[]
httpRequestResponses
=
invocation
.
getSelectedMessages
();
for
(
IHttpRequestResponse
httpRequestResponse
:
httpRequestResponses
) {
ArrayList
<
ApiType
>
apiTypes
=
passiveScanner
.
getApiScanner
().
detect
(
httpRequestResponse
,
false
);
passiveScanner
.
parseApiDocument
(
apiTypes
);
}
return
null
;
},
Executor
.
getExecutor
());
}
}
}
Back
|
FazBrowse Home
|
New Git URL