노현종

AWS_Center 모듈 추가(DB 관리)

1 +<?xml version="1.0" encoding="utf-8"?>
2 +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4 + <PropertyGroup>
5 + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6 + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7 + <ProjectGuid>8b3ec7f4-6106-4f2f-9a57-d10e4bbd93e8</ProjectGuid>
8 + <OutputType>Library</OutputType>
9 + <AppDesignerFolder>Properties</AppDesignerFolder>
10 + <RootNamespace>AWS_Center</RootNamespace>
11 + <AssemblyName>AWS_Center</AssemblyName>
12 + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
13 + <FileAlignment>512</FileAlignment>
14 + </PropertyGroup>
15 + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16 + <DebugSymbols>true</DebugSymbols>
17 + <DebugType>full</DebugType>
18 + <Optimize>false</Optimize>
19 + <OutputPath>bin\Debug\</OutputPath>
20 + <DefineConstants>DEBUG;TRACE</DefineConstants>
21 + <ErrorReport>prompt</ErrorReport>
22 + <WarningLevel>4</WarningLevel>
23 + </PropertyGroup>
24 + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25 + <DebugType>pdbonly</DebugType>
26 + <Optimize>true</Optimize>
27 + <OutputPath>bin\Release\</OutputPath>
28 + <DefineConstants>TRACE</DefineConstants>
29 + <ErrorReport>prompt</ErrorReport>
30 + <WarningLevel>4</WarningLevel>
31 + </PropertyGroup>
32 + <ItemGroup>
33 + <Reference Include="System"/>
34 +
35 + <Reference Include="System.Core"/>
36 + <Reference Include="System.Xml.Linq"/>
37 + <Reference Include="System.Data.DataSetExtensions"/>
38 +
39 +
40 + <Reference Include="Microsoft.CSharp"/>
41 +
42 + <Reference Include="System.Data"/>
43 +
44 + <Reference Include="System.Net.Http"/>
45 +
46 + <Reference Include="System.Xml"/>
47 + </ItemGroup>
48 + <ItemGroup>
49 + <Compile Include="Class1.cs" />
50 + <Compile Include="Properties\AssemblyInfo.cs" />
51 + </ItemGroup>
52 + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
53 + </Project>
1 +using System;
2 +using System.Collections.Generic;
3 +using System.Linq;
4 +using System.Text;
5 +using System.Threading.Tasks;
6 +
7 +
8 +// 참고(C# mysql 연결)
9 +#region MySql 연결
10 +
11 +//MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder {
12 +// Server = "",
13 +// UserID = id,
14 +// Password = pw,
15 +// Database = "vuln",
16 +// Port = 3306
17 +//};
18 +
19 +//string strConn = builder.ToString();
20 +//builder = null;
21 +//MySqlConnection conn = new MySqlConnection(strConn);
22 +
23 +//try {
24 +
25 +// String sql = "INSERT INTO members (id, pwd, name) " +
26 +// "VALUES ('gon', '111', '김삿갓')";
27 +
28 +// MySqlCommand cmd = new MySqlCommand(sql, conn);
29 +
30 +// conn.Open();
31 +
32 +// cmd.ExecuteNonQuery();
33 +// conn.Close();
34 +//} catch (Exception e) {
35 +// Console.WriteLine(e.ToString());
36 +//}
37 +#endregion
38 +
39 +namespace AWS_Center
40 +{
41 + public static class VulnRDS
42 + {
43 + public class Vuln
44 + {
45 + public int Len { get; set; } /* 발견된 취약점 함수 PreFunc 부분의 코드 길이 */
46 + public string RepoName { get; set; } /* 발견된 레파지토리 이름 */
47 + public string CveName { get; set; } /* 발견된 CVE 이름 */
48 + public string FuncName { get; set; } /* 발견된 함수 이름 */
49 + public string PreFunc { get; set; } /* 발견된 패치 전 원본 코드 */
50 + public string AfterFunc { get; set; } /* 발견된 패치 후 코드 */
51 + public int SequenceNumber { get; set; } /* 발견된 같은 취약 함수 내에서 블록 순서 번호 */
52 + public string Hash { get; set; } /* 발견된 크리티칼 블록 해쉬값 */
53 +
54 + // 생성자
55 + public Vuln()
56 + {
57 +
58 + }
59 +
60 +
61 + }
62 + public static void InsertVulnData(int _len, string _repoName, string _cve, string _funcName,
63 + string _preFunc, string _afterFunc, string _hash)
64 + {
65 + /*
66 + * DB에 취약점 데이터가 이미 있는지 검사해야함
67 + *
68 + */
69 + }
70 +
71 + public static IEnumerable<string> SearchVulnData(int _len)
72 + {
73 +
74 + }
75 + }
76 +}
1 +using System.Reflection;
2 +using System.Runtime.CompilerServices;
3 +using System.Runtime.InteropServices;
4 +
5 +// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해
6 +// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
7 +// 이러한 특성 값을 변경하세요.
8 +[assembly: AssemblyTitle("AWS_Center")]
9 +[assembly: AssemblyDescription("")]
10 +[assembly: AssemblyConfiguration("")]
11 +[assembly: AssemblyCompany("")]
12 +[assembly: AssemblyProduct("AWS_Center")]
13 +[assembly: AssemblyCopyright("Copyright © 2018")]
14 +[assembly: AssemblyTrademark("")]
15 +[assembly: AssemblyCulture("")]
16 +
17 +// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
18 +// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
19 +// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요.
20 +[assembly: ComVisible(false)]
21 +
22 +// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
23 +[assembly: Guid("8b3ec7f4-6106-4f2f-9a57-d10e4bbd93e8")]
24 +
25 +// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
26 +//
27 +// 주 버전
28 +// 부 버전
29 +// 빌드 번호
30 +// 수정 버전
31 +//
32 +// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
33 +// 기본값으로 할 수 있습니다.
34 +// [assembly: AssemblyVersion("1.0.*")]
35 +[assembly: AssemblyVersion("1.0.0.0")]
36 +[assembly: AssemblyFileVersion("1.0.0.0")]