-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSSTI_Menu.java
72 lines (60 loc) · 2.15 KB
/
SSTI_Menu.java
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package burp;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenu;
/**
*
* @author errorfiathck
*/
public class SSTI_Menu extends JMenu {
public BurpExtender myburp;
public String[] SSTI_MenuItems = {"{{7*7}}", "${7*7}", "<%= 7*7 %>","${{7*7}}", "#{7*7}", "*{7*7}"};
SSTI_Menu(BurpExtender burp){
this.setText("SSTI");
this.myburp = burp;
Methods.add_MenuItem_and_listener(this, SSTI_MenuItems, new WebShellItemListener(myburp));
}
}
class WebShellItemListener implements ActionListener {
BurpExtender myburp;
WebShellItemListener(BurpExtender burp) {
myburp = burp;
}
@Override
public void actionPerformed(ActionEvent e) {
int[] selectedIndex = myburp.context.getSelectionBounds();
IHttpRequestResponse req = myburp.context.getSelectedMessages()[0];
byte[] request = req.getRequest();
byte[] param = new byte[selectedIndex[1]-selectedIndex[0]];
System.arraycopy(request, selectedIndex[0], param, 0, selectedIndex[1]-selectedIndex[0]);
String selectString = new String(param);
String action = e.getActionCommand();
byte[] newRequest = do_SSTI(request, selectString, action, selectedIndex);
req.setRequest(newRequest);
}
public byte[] do_SSTI(byte[] request, String selectedString, String action, int[] selectedIndex){
switch(action){
case "SSTI 1":
selectedString = "{{7*7}}";
break;
case "SSTI 2":
selectedString = "${7*7}";
break;
case "SSTI 3":
selectedString = "<%= 7*7 %>";
break;
case "SSTI 4":
selectedString = "${{7*7}}";
break;
case "SSTI 5":
selectedString = "#{7*7}";
break;
case "SSTI 6":
selectedString = "*{7*7}";
break;
default:
break;
}
return Methods.do_modify_request(request, selectedIndex, selectedString);
}
}