package summer.serializable;

import java.io.IOException;
import java.util.Date;

/**
 * @ClassName: VulnerabilityClass
 * @Description: TODO
 * @Author: summer
 * @Date: 2020/4/22 17:29
 * @Version: v1.0.0
 * @Description: 漏洞代码demo
 **/
public class VulnerabilityClass implements summer.serializable.Serializable {
    private static final long serialVersionUID = 5550839108669505813L;
    private String username;
    private String password;
    private Date date;

    /**
     * @Author:         summer
     * @CreateDate:     2020/4/22 18:15
     * @UpdateUser:     summer
     * @UpdateDate:     2020/4/22 18:15
     * @UpdateRemark:   修改内容
     * @Version:        v1.0.0
     * @Description:    重写readObject()方法
     */
    private void readObject(java.io.ObjectInputStream ois) throws IOException, ClassNotFoundException {
        ois.defaultReadObject();
        // 加入执行命令代码
        Runtime.getRuntime().exec("calc");
    }

    public VulnerabilityClass() {
    }

    private Integer id;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public Integer getId() {
        return id;
    }

    @Override
    public String toString() {
        return "VulnerabilityClass{" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", date=" + date +
                ", id=" + id +
                '}';
    }

    public VulnerabilityClass(String username, String password, Date date, Integer id) {
        this.username = username;
        this.password = password;
        this.date = date;
        this.id = id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
}
