struts2利用工具-源码分享-女黑客 - Powered by Discuz! Archiver

nvhack 发表于 2017-9-23 00:38:26

struts2利用工具-源码分享

哈哈,我还没写完,现在只是个样子,不过我会一直更新的。
import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.CardLayout;
import javax.swing.JSplitPane;
import javax.swing.JComboBox;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JTabbedPane;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;

public class Strtus2 extends JFrame {

        private JPanel contentPane;
        private JTextField textField;
    private JLabel label1,label2,label3;
    private JPanel panel1,panel2,panel3;

        /**
       * Launch the application.
       */
        public static void main(String[] args) {
                EventQueue.invokeLater(new Runnable() {
                        public void run() {
                                try {
                                        Strtus2 frame = new Strtus2();
                                        frame.setVisible(true);
                                } catch (Exception e) {
                                        e.printStackTrace();
                                }
                        }
                });
        }

        /**
       * Create the frame.
       */
        public Strtus2() {
                setTitle("Struts测试工具 - By : www.xss.tv");
                setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                setBounds(100, 100, 530, 302);
                contentPane = new JPanel();
                contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
                setContentPane(contentPane);
                contentPane.setLayout(new CardLayout(0, 0));
               
                JSplitPane splitPane = new JSplitPane();
                splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
                contentPane.add(splitPane, "name_7412453971397");
               
                JPanel panel_one = new JPanel();
                splitPane.setLeftComponent(panel_one);
                panel_one.setLayout(new GridLayout(0, 2, -300, 0));
               
                JLabel lblNewLabel = new JLabel("目标网址:");
                panel_one.add(lblNewLabel);
               
                textField = new JTextField();
                textField.addKeyListener(new KeyAdapter() {
                        @Override
                        public void keyPressed(KeyEvent e) {
                                int k = e.getKeyCode();
                                if(k == e.VK_ENTER){
//                                        textField.setText("我是回车");
                                        new ReadByGet(textField.getText()).start();
                                }
                        }
                });
               
               
                textField.setText("http://xss.tv/1");
                panel_one.add(textField);
                textField.setColumns(10);
               
                JPanel panel_two = new JPanel();
                splitPane.setRightComponent(panel_two);
                panel_two.setLayout(new BorderLayout(0, 0));
               
                JSplitPane splitPane_1 = new JSplitPane();
                splitPane_1.setContinuousLayout(true);
                splitPane_1.setOrientation(JSplitPane.VERTICAL_SPLIT);
                panel_two.add(splitPane_1);
               
                JPanel panel_1 = new JPanel();
                splitPane_1.setLeftComponent(panel_1);
               
                JLabel lblNewLabel_1 = new JLabel("字符集");
                panel_1.add(lblNewLabel_1);
               
                JComboBox comboBox_2 = new JComboBox();
                panel_1.add(comboBox_2);
                comboBox_2.setModel(new DefaultComboBoxModel(new String[] {"GBK", "UTF-8", "GB2312"}));
               
                JLabel lblNewLabel_2 = new JLabel("提交方式");
                panel_1.add(lblNewLabel_2);
               
                JComboBox comboBox = new JComboBox();
                panel_1.add(comboBox);
                comboBox.setModel(new DefaultComboBoxModel(new String[] {"GET", "POST", "UPLOAD"}));
               
                JLabel lblNewLabel_3 = new JLabel("漏洞编号");
                panel_1.add(lblNewLabel_3);
               
                JComboBox comboBox_1 = new JComboBox();
                panel_1.add(comboBox_1);
                comboBox_1.setModel(new DefaultComboBoxModel(new String[] {"strtus-053"}));
               
               
      
      JPanel panel_2 = new JPanel();
      splitPane_1.setRightComponent(panel_2);
      panel_2.setLayout(new BorderLayout(0, 0));
      
      JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
      panel_2.add(tabbedPane);
      
               
                //创建标签
      label1=new JLabel("第一个标签的面板",SwingConstants.CENTER);
      label2=new JLabel("第二个标签的面板",SwingConstants.CENTER);
      label3=new JLabel("第三个标签的面板",SwingConstants.CENTER);
      //创建面板
      panel1=new JPanel();
      panel2=new JPanel();
      panel3=new JPanel();

      panel1.add(label1);
      panel2.add(label2);
      panel3.add(label3);
      
      //将标签面板加入到选项卡面板对象上
      tabbedPane.addTab("服务器信息",null,panel1,"First panel");
      tabbedPane.addTab("命令执行",null,panel2,"Second panel");
      tabbedPane.addTab("反弹shell",null,panel3,"Third panel");
               
        }

}
class ReadByGet extends Thread{
        String str;
        ReadByGet(String str){
                this.str = str;
        }
        public void run(){
                try {
                        URL url = new URL(str);
                        URLConnection connection = url.openConnection();
                        InputStream is = connection.getInputStream();
                        InputStreamReader isr = new InputStreamReader(is);
                        BufferedReader br = new BufferedReader(isr);
                       
                        String line;
                        StringBuilder builder = new StringBuilder();
                       
                        while((line = br.readLine()) != null){
                                builder.append(line);
                        }
                        br.close();
                        isr.close();
                        is.close();
                       
                        System.out.println(builder.toString());
                } catch (MalformedURLException e) {
                        e.printStackTrace();
                }catch (IOException e){
                        e.printStackTrace();
                }
               
               
        }
}


页: [1]
查看完整版本: struts2利用工具-源码分享