From 28cc20d0b4da2cbe62589a7aa247095c7dab57bf Mon Sep 17 00:00:00 2001 From: juyeon0714 Date: Tue, 28 May 2019 21:19:50 +0900 Subject: [PATCH] all changed --- CyberInvasion/.classpath | 2 + CyberInvasion/.project | 14 + CyberInvasion/.settings/.jsdtscope | 12 + .../org.eclipse.wst.common.component | 8 + ....eclipse.wst.common.project.facet.core.xml | 6 + ...rg.eclipse.wst.jsdt.ui.superType.container | 1 + .../org.eclipse.wst.jsdt.ui.superType.name | 1 + CyberInvasion/WebContent/ScenarioAction.jsp | 168 ++++++++++ CyberInvasion/WebContent/asset_eva.jsp | 12 +- CyberInvasion/WebContent/asset_list.jsp | 14 +- CyberInvasion/WebContent/ex_scenario.jsp | 112 +++++++ CyberInvasion/WebContent/login.jsp | 2 +- CyberInvasion/WebContent/main.jsp | 5 + CyberInvasion/WebContent/scenario.jsp | 309 ++++++++++++++++++ CyberInvasion/WebContent/scenario_eva.jsp | 159 +++++++++ .../WebContent/scenario_eva_detail.jsp | 175 ++++++++++ CyberInvasion/WebContent/scenario_step1.jsp | 132 ++++++++ CyberInvasion/WebContent/sec_eva.jsp | 4 + .../InfringmentAction/InfringmentDAO.class | Bin 2017 -> 2020 bytes .../InfringmentDateDAO.class | Bin 2102 -> 2105 bytes CyberInvasion/bin/asset/AssetDAO.class | Bin 5429 -> 5432 bytes CyberInvasion/bin/eva/CalDAO.class | Bin 2708 -> 0 bytes CyberInvasion/bin/eva/EvaDAO.class | Bin 5382 -> 5385 bytes CyberInvasion/bin/eva/Security_EvaDAO.class | Bin 4143 -> 4146 bytes CyberInvasion/bin/result/ResultDAO.class | Bin 2651 -> 2654 bytes CyberInvasion/bin/scenario/ScenarioDAO.class | Bin 1888 -> 6888 bytes .../bin/scenario/ScenarioEvaDAO.class | Bin 1993 -> 1996 bytes CyberInvasion/bin/scenario/ScenarioItem.class | Bin 1397 -> 2125 bytes .../bin/scenario/ScenarioStageDAO.class | Bin 1963 -> 1966 bytes CyberInvasion/bin/user/UserDAO.class | Bin 2286 -> 2491 bytes CyberInvasion/bin/util/DatabaseUtil.class | Bin 928 -> 931 bytes .../src/InfringmentAction/InfringmentDAO.java | 6 +- .../InfringmentAction/InfringmentDateDAO.java | 6 +- CyberInvasion/src/asset/AssetDAO.java | 6 +- CyberInvasion/src/eva/CalDAO.java | 90 ----- CyberInvasion/src/eva/EvaDAO.java | 4 +- CyberInvasion/src/eva/Security_EvaDAO.java | 4 +- CyberInvasion/src/result/ResultDAO.java | 4 +- CyberInvasion/src/scenario/ScenarioDAO.java | 182 ++++++++++- .../src/scenario/ScenarioEvaDAO.java | 6 +- CyberInvasion/src/scenario/ScenarioItem.java | 46 ++- .../src/scenario/ScenarioStageDAO.java | 6 +- CyberInvasion/src/user/UserDAO.java | 10 +- CyberInvasion/src/util/DatabaseUtil.java | 6 +- 44 files changed, 1365 insertions(+), 147 deletions(-) create mode 100644 CyberInvasion/.settings/.jsdtscope create mode 100644 CyberInvasion/.settings/org.eclipse.wst.common.component create mode 100644 CyberInvasion/.settings/org.eclipse.wst.common.project.facet.core.xml create mode 100644 CyberInvasion/.settings/org.eclipse.wst.jsdt.ui.superType.container create mode 100644 CyberInvasion/.settings/org.eclipse.wst.jsdt.ui.superType.name create mode 100644 CyberInvasion/WebContent/ScenarioAction.jsp create mode 100644 CyberInvasion/WebContent/ex_scenario.jsp create mode 100644 CyberInvasion/WebContent/scenario.jsp create mode 100644 CyberInvasion/WebContent/scenario_eva.jsp create mode 100644 CyberInvasion/WebContent/scenario_eva_detail.jsp create mode 100644 CyberInvasion/WebContent/scenario_step1.jsp delete mode 100644 CyberInvasion/bin/eva/CalDAO.class diff --git a/CyberInvasion/.classpath b/CyberInvasion/.classpath index 51a8bba..8319776 100644 --- a/CyberInvasion/.classpath +++ b/CyberInvasion/.classpath @@ -2,5 +2,7 @@ + + diff --git a/CyberInvasion/.project b/CyberInvasion/.project index 47bf116..3919e43 100644 --- a/CyberInvasion/.project +++ b/CyberInvasion/.project @@ -5,13 +5,27 @@ + + org.eclipse.wst.common.project.facet.core.builder + + + org.eclipse.jdt.core.javabuilder + + org.eclipse.wst.validation.validationbuilder + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature org.eclipse.jdt.core.javanature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.wst.jsdt.core.jsNature diff --git a/CyberInvasion/.settings/.jsdtscope b/CyberInvasion/.settings/.jsdtscope new file mode 100644 index 0000000..92e666d --- /dev/null +++ b/CyberInvasion/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/CyberInvasion/.settings/org.eclipse.wst.common.component b/CyberInvasion/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..6e877d7 --- /dev/null +++ b/CyberInvasion/.settings/org.eclipse.wst.common.component @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/CyberInvasion/.settings/org.eclipse.wst.common.project.facet.core.xml b/CyberInvasion/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..bddaa00 --- /dev/null +++ b/CyberInvasion/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/CyberInvasion/.settings/org.eclipse.wst.jsdt.ui.superType.container b/CyberInvasion/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/CyberInvasion/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/CyberInvasion/.settings/org.eclipse.wst.jsdt.ui.superType.name b/CyberInvasion/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/CyberInvasion/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/CyberInvasion/WebContent/ScenarioAction.jsp b/CyberInvasion/WebContent/ScenarioAction.jsp new file mode 100644 index 0000000..f494283 --- /dev/null +++ b/CyberInvasion/WebContent/ScenarioAction.jsp @@ -0,0 +1,168 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="utf-8"%> +<%@ page import="user.UserDAO" %> +<%@ page import="asset.AssetDTO" %> +<%@ page import="asset.AssetDAO" %> +<%@ page import="scenario.ScenarioDAO" %> +<%@ page import="scenario.ScenarioItem" %> +<%@ page import="java.io.PrintWriter" %> +<%@ page import="java.sql.*,java.util.*" %> + + + +<% + request.setCharacterEncoding("UTF-8"); +%> + + + + + + +취약점 진단 프로그램 + + +<% + // 세션의 로그인여부 확인 + String userID=null; + if(session.getAttribute("userID")!=null){ + userID=(String)session.getAttribute("userID"); + } + if(userID==null){ //로그인 안 됐을 경우 + PrintWriter script=response.getWriter(); + script.println(""); + script.close(); + return; + } + + + + int id=0; + String scenario_name=null; + String scenario_condition=null; + String asset_name=null; + int infringement_level=0; + String scenario_sum=null; + String scenario_content=null; + + if(request.getParameter("id")!=null){ + // asset_name=request.getParameter("asset_name"); + try{ + id=Integer.parseInt(request.getParameter("id")); + }catch(Exception e){ + System.out.println("아이디 오류"); + } } + if(request.getParameter("scenario_name")!=null){ + try{ + scenario_name=request.getParameter("scenario_name"); + }catch(Exception e){ + System.out.println("scenario_name 오류"); + }} + if(request.getParameter("scenario_condition")!=null){ + try{ + scenario_condition=request.getParameter("scenario_condition"); + }catch(Exception e){ + System.out.println("scenario_condition 오류"); + }} + + if(request.getParameter("asset_name")!=null){ + try{ + asset_name=request.getParameter("asset_name"); + }catch(Exception e){ + System.out.println(" asset_name 오류"); + }} + if(request.getParameter("infringement_level")!=null){ + try{ + infringement_level=Integer.parseInt(request.getParameter("infringement_level")); + }catch(Exception e){ + System.out.println("아이디 오류"); +} } + if(request.getParameter("scenario_sum")!=null){ + try{ + scenario_sum=request.getParameter("scenario_sum"); + }catch(Exception e){ + System.out.println("scenario_sum 오류"); + }} + if(request.getParameter("scenario_content")!=null){ + try{ + scenario_content=request.getParameter("scenario_content"); + }catch(Exception e){ + System.out.println("scenario_content 오류"); + }} + + + if(id==0){ + PrintWriter script=response.getWriter(); + script.println(""); + script.close(); + return; + } + if(scenario_name==null){ + PrintWriter script=response.getWriter(); + script.println(""); + script.close(); + return; + } + + if(asset_name==null){ + PrintWriter script=response.getWriter(); + script.println(""); + script.close(); + return; + } + + if(infringement_level==0){ + PrintWriter script=response.getWriter(); + script.println(""); + script.close(); + return; + } + + if(id==0||scenario_name==null||scenario_condition==null||asset_name==null||infringement_level==0){ + PrintWriter script=response.getWriter(); + script.println(""); + script.close(); + return; + } + + //모든 입력사항을 다 입력한 경우 + ScenarioDAO scenarioDAO = new ScenarioDAO (); //assetDAO 객체에 AssetDAO 저장 + //result에 assetDAO에 있는 write함수 값을 저장 + int result = scenarioDAO.ScenarioWrite(new ScenarioItem(id, scenario_name, infringement_level, asset_name, scenario_condition, scenario_sum, scenario_content)); + + if(result==-1){ + PrintWriter script=response.getWriter(); + script.println(""); + + }else{ //자산 추가 성공적으로 이루어진 경우 + PrintWriter script=response.getWriter(); + script.println(""); + } + +%> + + + + \ No newline at end of file diff --git a/CyberInvasion/WebContent/asset_eva.jsp b/CyberInvasion/WebContent/asset_eva.jsp index c19248b..e4ef2a0 100644 --- a/CyberInvasion/WebContent/asset_eva.jsp +++ b/CyberInvasion/WebContent/asset_eva.jsp @@ -36,7 +36,11 @@
  • 메인
  • 자산 리스트
  • 자산 평가
  • -
  • 보안성 평가 결과
  • +
  • 보안성 평가 결과
  • +
  • 비상사건 관리
  • +
  • 시나리오 리스트
  • +
  • 시나리오 평가
  • +
  • 침해대응 훈련
  • <% //로그인 여부에 따라 달라지는 탭 구현 위한 코드 if(userID==null){ @@ -130,10 +134,10 @@ <% //DB연동을 위함 try { - String dbURL ="jdbc:mysql://127.0.0.1:3306/ics3?serverTimezone=UTC"; - String dbID = "root"; - String dbPassword = "0805"; - Class.forName("com.mysql.cj.jdbc.Driver"); + String dbURL ="jdbc:mysql://127.0.0.1:3306/sys?serverTimezone=UTC"; + String dbID = "root"; + String dbPassword = "password"; + Class.forName("com.mysql.cj.jdbc.Driver"); Conn= DriverManager.getConnection(dbURL, dbID, dbPassword); stmt=Conn.createStatement(); diff --git a/CyberInvasion/WebContent/ex_scenario.jsp b/CyberInvasion/WebContent/ex_scenario.jsp new file mode 100644 index 0000000..fcd3698 --- /dev/null +++ b/CyberInvasion/WebContent/ex_scenario.jsp @@ -0,0 +1,112 @@ +<%@ page language="java" contentType="text/html; charset=EUC-KR" + pageEncoding="EUC-KR"%> + + + + + + + α׷ + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ó ȣ7
    ó ڹ Ʈ 븰 Ǽڵ
    ش ڻ ͺƮ +
    ħػ 2
    ʱ: Java 6 Ʈ
    ó : ڴ ũ Ѵٴ ̿Ͽ ũ Ѵٴ ̸ ũ Ŭϵ Ͽ. Ǽڵ + Java Ʈ Ͽ Java ʴ , ڹ ڽ ø Ǿ.
    ó : ũ 忡 ̸ ȮϿ. ̸ ߿ ũ ģ ϰ ִٴ ϵ ־. ũ Ѵ. ״ ָ ϴµ, ش ũ Ʈ õ Ǹ ǰ ã . + ״ ̹ 8 ׷ ϱ Ƽ ϰ, Ʈ ̸ ѷ װ ʿ ϴ ǰ ٰ â ȣ ϰ ư ߴ. + , ģ ̸Ͽ Ե Ʈ ũ ¶ Ʈ ʾҴٴ , ̸ ģ ƴϾٴ ̴. + ũ ̸ ũ ּҸ Ŭ ڹ 븰 Ǽ ڵ尡 Բ ٿε尡 ƴ. Ǽڵ尡 Ǹ ǻͰ ͳݿ . ũ ǻͿ ڹ , + Ʈ ġϸ ġ ڵ ʴ´. ũ ġߴ Java 6 ǻͿ ־, ڰ Java Update 29 븰 + Ǽڵ带 ũ ǻͿ Ŵν ڹ ڽ ø Ǽڵ带 ״.
    + + + + +
    +
    + +
    +
    + + diff --git a/CyberInvasion/WebContent/login.jsp b/CyberInvasion/WebContent/login.jsp index b333335..278b488 100644 --- a/CyberInvasion/WebContent/login.jsp +++ b/CyberInvasion/WebContent/login.jsp @@ -47,7 +47,7 @@

    로그인 화면

    - +
    diff --git a/CyberInvasion/WebContent/main.jsp b/CyberInvasion/WebContent/main.jsp index 9f1d28d..5b969a8 100644 --- a/CyberInvasion/WebContent/main.jsp +++ b/CyberInvasion/WebContent/main.jsp @@ -48,6 +48,10 @@ function eva_button() { return confirm("평가할 자산을 선택해주세요.") }
  • 보안성 평가 결과
  • +
  • 비상사건 관리
  • +
  • 시나리오 리스트
  • +
  • 시나리오 평가
  • +
  • 침해대응 훈련
  • <% if(userID==null){ @@ -86,6 +90,7 @@
    +[${userID }]님 반갑습니다.

    Welcome! this is

    Industry Control System Vulnerability Assessment Program

    diff --git a/CyberInvasion/WebContent/scenario.jsp b/CyberInvasion/WebContent/scenario.jsp new file mode 100644 index 0000000..75e573e --- /dev/null +++ b/CyberInvasion/WebContent/scenario.jsp @@ -0,0 +1,309 @@ +<%@ page language="java" import="java.sql.*, java.lang.*, java.util.*" contentType="text/html; charset=UTF-8" + pageEncoding="utf-8" %> + <%@ page import="scenario.ScenarioItem" %> + +<%@ page import="java.io.PrintWriter" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + +<% + request.setCharacterEncoding("UTF-8"); +%> + + + +<% + //DB에 저장된 AssetTable의 속성들을 getParameter 함수를 통해 불러옴 + Connection Conn=null; + Statement stmt=null; + ResultSet rs=null; + + String id=request.getParameter("id"); + String scenario_name=request.getParameter("scenario_name"); + String scenario_condition=request.getParameter("scenario_condition"); + String asset_name=request.getParameter("asset_name"); + String infringement_level=request.getParameter("infringement_level"); + String scenario_sum=request.getParameter("scenario_sum"); + String scenario_content=request.getParameter("scenario_content"); +// String db_list="select * from scenarioitem"; + String keyField = request.getParameter("keyField"); + String keyWord = request.getParameter("keyWord"); + ArrayList list = dao.getScenariolist(keyField, keyWord); + int num=1; + %> + + + + + + +취약점 진단 프로그램 + + + + + + + + + + + + + + + + +<% // 로그인여부 확인 + String userID=null; + if(session.getAttribute("userID")!=null){ + userID=(String)session.getAttribute("userID"); + } +%> + + <% + try { + String dbURL ="jdbc:mysql://127.0.0.1:3306/sys?serverTimezone=UTC&useSSL=false"; + String dbID = "root"; + String dbPassword = "password"; + Class.forName("com.mysql.cj.jdbc.Driver"); + Conn= DriverManager.getConnection(dbURL, dbID, dbPassword); + stmt=Conn.createStatement(); + + %> + + + +
    +
    + + + + + + + + + + + <% + for(ScenarioItem scenarioItem : list){ + %> + + + + + + + <% + // System.out.println(rs.getBoolean("account_manage")); + + //num++; + } + + %> + <% + // System.out.println(rs.getBoolean("account_manage")); + + //num++; + + //rs.close(); + // stmt.close(); + // Conn.close(); + } + catch(SQLException e) + { + System.out.println(e); + } + catch(Exception e1) + { + System.out.println(e1); + } + + %> + + + +
    번호시나리오 명침해사고 수준
    <%=scenarioItem.getId() %><%=scenarioItem.getScenario_name() %><%=scenarioItem.getInfringement_level() %>
    +
    +
    + + + +
    + + <% + for(int i=1; i<= 1; i++){ + + +%>
    + 삭제 +
    +
    + 수정ㅤ +
    + +
    + 추가ㅤ +
    + + <% + } +%> +
    + +