노현종
1 -<?xml version="1.0" encoding="utf-8"?> 1 +<?xml version="1.0" encoding="utf-8"?>
2 <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 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')" /> 3 <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4 <PropertyGroup> 4 <PropertyGroup>
5 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 5 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 6 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7 - <ProjectGuid>8b3ec7f4-6106-4f2f-9a57-d10e4bbd93e8</ProjectGuid> 7 + <ProjectGuid>{8B3EC7F4-6106-4F2F-9A57-D10E4BBD93E8}</ProjectGuid>
8 <OutputType>Library</OutputType> 8 <OutputType>Library</OutputType>
9 <AppDesignerFolder>Properties</AppDesignerFolder> 9 <AppDesignerFolder>Properties</AppDesignerFolder>
10 <RootNamespace>AWS_Center</RootNamespace> 10 <RootNamespace>AWS_Center</RootNamespace>
...@@ -30,24 +30,19 @@ ...@@ -30,24 +30,19 @@
30 <WarningLevel>4</WarningLevel> 30 <WarningLevel>4</WarningLevel>
31 </PropertyGroup> 31 </PropertyGroup>
32 <ItemGroup> 32 <ItemGroup>
33 - <Reference Include="System"/> 33 + <Reference Include="MySql.Data, Version=8.0.11.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL" />
34 - 34 + <Reference Include="System" />
35 - <Reference Include="System.Core"/> 35 + <Reference Include="System.Core" />
36 - <Reference Include="System.Xml.Linq"/> 36 + <Reference Include="System.Xml.Linq" />
37 - <Reference Include="System.Data.DataSetExtensions"/> 37 + <Reference Include="System.Data.DataSetExtensions" />
38 - 38 + <Reference Include="Microsoft.CSharp" />
39 - 39 + <Reference Include="System.Data" />
40 - <Reference Include="Microsoft.CSharp"/> 40 + <Reference Include="System.Net.Http" />
41 - 41 + <Reference Include="System.Xml" />
42 - <Reference Include="System.Data"/>
43 -
44 - <Reference Include="System.Net.Http"/>
45 -
46 - <Reference Include="System.Xml"/>
47 </ItemGroup> 42 </ItemGroup>
48 <ItemGroup> 43 <ItemGroup>
49 <Compile Include="Class1.cs" /> 44 <Compile Include="Class1.cs" />
50 <Compile Include="Properties\AssemblyInfo.cs" /> 45 <Compile Include="Properties\AssemblyInfo.cs" />
51 </ItemGroup> 46 </ItemGroup>
52 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 47 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
53 - </Project> 48 +</Project>
...\ No newline at end of file ...\ No newline at end of file
......
1 +
2 +Microsoft Visual Studio Solution File, Format Version 12.00
3 +# Visual Studio 15
4 +VisualStudioVersion = 15.0.27428.2037
5 +MinimumVisualStudioVersion = 10.0.40219.1
6 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AWS_Center", "AWS_Center.csproj", "{8B3EC7F4-6106-4F2F-9A57-D10E4BBD93E8}"
7 +EndProject
8 +Global
9 + GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 + Debug|Any CPU = Debug|Any CPU
11 + Release|Any CPU = Release|Any CPU
12 + EndGlobalSection
13 + GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 + {8B3EC7F4-6106-4F2F-9A57-D10E4BBD93E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 + {8B3EC7F4-6106-4F2F-9A57-D10E4BBD93E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 + {8B3EC7F4-6106-4F2F-9A57-D10E4BBD93E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 + {8B3EC7F4-6106-4F2F-9A57-D10E4BBD93E8}.Release|Any CPU.Build.0 = Release|Any CPU
18 + EndGlobalSection
19 + GlobalSection(SolutionProperties) = preSolution
20 + HideSolutionNode = FALSE
21 + EndGlobalSection
22 + GlobalSection(ExtensibilityGlobals) = postSolution
23 + SolutionGuid = {EEBEFAA7-7268-4494-ADAF-291BB2AF8588}
24 + EndGlobalSection
25 +EndGlobal
...@@ -3,7 +3,7 @@ using System.Collections.Generic; ...@@ -3,7 +3,7 @@ using System.Collections.Generic;
3 using System.Linq; 3 using System.Linq;
4 using System.Text; 4 using System.Text;
5 using System.Threading.Tasks; 5 using System.Threading.Tasks;
6 - 6 +using MySql.Data.MySqlClient;
7 7
8 // 참고(C# mysql 연결) 8 // 참고(C# mysql 연결)
9 #region MySql 연결 9 #region MySql 연결
...@@ -40,6 +40,8 @@ namespace AWS_Center ...@@ -40,6 +40,8 @@ namespace AWS_Center
40 { 40 {
41 public static class VulnRDS 41 public static class VulnRDS
42 { 42 {
43 + public static MySqlConnection Conn { get; set; }
44 +
43 public class Vuln 45 public class Vuln
44 { 46 {
45 public int Len { get; set; } /* 발견된 취약점 함수 PreFunc 부분의 코드 길이 */ 47 public int Len { get; set; } /* 발견된 취약점 함수 PreFunc 부분의 코드 길이 */
...@@ -54,10 +56,30 @@ namespace AWS_Center ...@@ -54,10 +56,30 @@ namespace AWS_Center
54 // 생성자 56 // 생성자
55 public Vuln() 57 public Vuln()
56 { 58 {
57 - 59 +
60 +
58 } 61 }
59 62
60 - 63 +
64 + }
65 +
66 + //connect
67 + public static void Connect()
68 + {
69 + MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder()
70 + {
71 + Server = "vulndb.cby38wfppa7l.us-east-2.rds.amazonaws.com",
72 + UserID = "yhackerbv",
73 + Password = "guswhd12",
74 + Database = "vuln",
75 + Port = 3306,
76 + };
77 + string strConn = builder.ToString();
78 + builder = null;
79 + Conn = new MySqlConnection(strConn);
80 +
81 +
82 +
61 } 83 }
62 public static void InsertVulnData(int _len, string _repoName, string _cve, string _funcName, 84 public static void InsertVulnData(int _len, string _repoName, string _cve, string _funcName,
63 string _preFunc, string _afterFunc, string _hash) 85 string _preFunc, string _afterFunc, string _hash)
...@@ -66,11 +88,16 @@ namespace AWS_Center ...@@ -66,11 +88,16 @@ namespace AWS_Center
66 * DB에 취약점 데이터가 이미 있는지 검사해야함 88 * DB에 취약점 데이터가 이미 있는지 검사해야함
67 * 89 *
68 */ 90 */
69 - }
70 91
71 - public static IEnumerable<string> SearchVulnData(int _len) 92 + Conn.Open();
72 - { 93 +
94 +
73 95
74 } 96 }
97 +
98 + //public static IEnumerable<string> SearchVulnData(int _len)
99 + //{
100 + //
101 + //}
75 } 102 }
76 } 103 }
......
1 +<?xml version="1.0" encoding="utf-8" ?>
2 +<configuration>
3 + <startup>
4 + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
5 + </startup>
6 +</configuration>
...\ No newline at end of file ...\ No newline at end of file
1 +using System;
2 +using System.Collections.Generic;
3 +using System.Linq;
4 +using System.Text;
5 +using System.Threading.Tasks;
6 +using MySql.Data.MySqlClient;
7 +
8 +namespace Tester
9 +{
10 + class Program
11 + {
12 + static void Main(string[] args)
13 + {
14 +
15 +
16 + }
17 + }
18 +}
19 +
20 +
21 +namespace AWS_Center
22 +{
23 + public static class VulnRDS
24 + {
25 + public static MySqlConnection Conn { get; set; }
26 +
27 + public class Vuln
28 + {
29 + public int VulnId { get; set; } /* 취약점 ID */
30 + public int LenBlock { get; set; } /* 취약점 BLOCK 길이 */
31 + public string RepositName { get; set; } /* 취약점 레파지토리 이름 */
32 + public string Cve { get; set; } /* 취약점 CVE */
33 + public string FuncName { get; set; } /* 취약점 함수 이름 */
34 + public string Language { get; set; } /* 취약점 언어 종류 */
35 + public string CodeOriBefore { get; set; } /* 취약점 패치 전 원본 코드 */
36 + public string CodeOriAfter { get; set; } /* 취약점 패치 후 원본 코드 */
37 + public string CodeAbsBefore { get; set; } /* 취약점 패치 전 추상화 코드 */
38 + public string CodeAbsAfter { get; set; } /* 취약점 패치 후 추상화 코드 */
39 + public string BlockHash { get; set; } /* 취약점 블록 해시 값 */
40 + // 생성자
41 + public Vuln()
42 + {
43 +
44 +
45 + }
46 + }
47 +
48 + public class User
49 + {
50 + public int UserId { get; set; } /* 유저 ID */
51 + public string RepositName { get; set; } /* 유저 레파지토리 이름 */
52 + public string Cve { get; set; } /* 취약점 CVE */
53 + public string CodeOriBefore { get; set; } /* 취약점 패치 전 원본 코드 */
54 + public string CodeOriAfter { get; set; } /* 취약점 패치 후 원본 코드 */
55 + public string FuncName { get; set; } /* 취약점 함수 이름 */
56 + public string DetectDate { get; set; } /* 검사 날짜 */
57 + // 생성자
58 + public User()
59 + {
60 +
61 +
62 + }
63 +
64 + }
65 + //connect
66 + public static void Connect()
67 + {
68 + MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder()
69 + {
70 + Server = "vulndb.cby38wfppa7l.us-east-2.rds.amazonaws.com",
71 + UserID = "yhackerbv",
72 + Password = "guswhd12",
73 + Database = "vuln",
74 + Port = 3306,
75 + };
76 + string strConn = builder.ToString();
77 + builder = null;
78 + Conn = new MySqlConnection(strConn);
79 + }
80 + public static void InsertVulnData(Vuln vuln)
81 + {
82 + /*
83 + * DB에 취약점 데이터가 이미 있는지 검사해야함
84 + *
85 + */
86 +
87 + Conn.Open();
88 +
89 + }
90 +
91 + //public static IEnumerable<string> SearchVulnData(int _len)
92 + //{
93 + //
94 + //}
95 + }
96 +}
1 +using System.Reflection;
2 +using System.Runtime.CompilerServices;
3 +using System.Runtime.InteropServices;
4 +
5 +// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해
6 +// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
7 +// 이러한 특성 값을 변경하세요.
8 +[assembly: AssemblyTitle("Tester")]
9 +[assembly: AssemblyDescription("")]
10 +[assembly: AssemblyConfiguration("")]
11 +[assembly: AssemblyCompany("")]
12 +[assembly: AssemblyProduct("Tester")]
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("ac204ded-c47f-46fe-b357-01c71849ea76")]
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")]
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>{AC204DED-C47F-46FE-B357-01C71849EA76}</ProjectGuid>
8 + <OutputType>Exe</OutputType>
9 + <RootNamespace>Tester</RootNamespace>
10 + <AssemblyName>Tester</AssemblyName>
11 + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
12 + <FileAlignment>512</FileAlignment>
13 + <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14 + </PropertyGroup>
15 + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16 + <PlatformTarget>AnyCPU</PlatformTarget>
17 + <DebugSymbols>true</DebugSymbols>
18 + <DebugType>full</DebugType>
19 + <Optimize>false</Optimize>
20 + <OutputPath>bin\Debug\</OutputPath>
21 + <DefineConstants>DEBUG;TRACE</DefineConstants>
22 + <ErrorReport>prompt</ErrorReport>
23 + <WarningLevel>4</WarningLevel>
24 + </PropertyGroup>
25 + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26 + <PlatformTarget>AnyCPU</PlatformTarget>
27 + <DebugType>pdbonly</DebugType>
28 + <Optimize>true</Optimize>
29 + <OutputPath>bin\Release\</OutputPath>
30 + <DefineConstants>TRACE</DefineConstants>
31 + <ErrorReport>prompt</ErrorReport>
32 + <WarningLevel>4</WarningLevel>
33 + </PropertyGroup>
34 + <ItemGroup>
35 + <Reference Include="MySql.Data, Version=8.0.11.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL" />
36 + <Reference Include="System" />
37 + <Reference Include="System.Core" />
38 + <Reference Include="System.Xml.Linq" />
39 + <Reference Include="System.Data.DataSetExtensions" />
40 + <Reference Include="Microsoft.CSharp" />
41 + <Reference Include="System.Data" />
42 + <Reference Include="System.Net.Http" />
43 + <Reference Include="System.Xml" />
44 + </ItemGroup>
45 + <ItemGroup>
46 + <Compile Include="Program.cs" />
47 + <Compile Include="Properties\AssemblyInfo.cs" />
48 + </ItemGroup>
49 + <ItemGroup>
50 + <None Include="App.config" />
51 + </ItemGroup>
52 + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
53 +</Project>
...\ No newline at end of file ...\ No newline at end of file
...@@ -11,6 +11,14 @@ class UserCreationForm(UserCreationForm): ...@@ -11,6 +11,14 @@ class UserCreationForm(UserCreationForm):
11 help_text=("github 레포지토리를 등록하세요.")) 11 help_text=("github 레포지토리를 등록하세요."))
12 12
13 13
14 +class UserEditForm(forms.Form):
15 + email = EmailField(label=("이메일"), required=True,
16 + help_text=("이메일을 입력하세요."))
17 +
18 + repository = URLField(label=("레포지토리"), required=True,
19 + help_text=("github 레포지토리를 입력하세요."))
20 +
21 +
14 class Meta: 22 class Meta:
15 model = User 23 model = User
16 fields = ("username", "email", "repository", "password1", "password2") 24 fields = ("username", "email", "repository", "password1", "password2")
......
...@@ -26,6 +26,8 @@ urlpatterns = [ ...@@ -26,6 +26,8 @@ urlpatterns = [
26 url(r'^home/', HomeView.as_view(), name='home'), 26 url(r'^home/', HomeView.as_view(), name='home'),
27 url(r'^myapp/', include('myapp.urls', namespace='myapp')), 27 url(r'^myapp/', include('myapp.urls', namespace='myapp')),
28 28
29 + url(r'^edit/', EditView.as_view(), name='edit'),
30 +
29 url(r'^accounts/', include('django.contrib.auth.urls')), 31 url(r'^accounts/', include('django.contrib.auth.urls')),
30 url(r'^accounts/register/$', UserCreateView.as_view(), name='register'), 32 url(r'^accounts/register/$', UserCreateView.as_view(), name='register'),
31 url(r'^accounts/register/done$', UserCreateDoneTV.as_view(), name='register_done'), 33 url(r'^accounts/register/done$', UserCreateDoneTV.as_view(), name='register_done'),
......
...@@ -59,6 +59,25 @@ class HomeView(View): ...@@ -59,6 +59,25 @@ class HomeView(View):
59 # with connection.cursor() as cursor: 59 # with connection.cursor() as cursor:
60 # cursor.execute(query, param_list) 60 # cursor.execute(query, param_list)
61 61
62 +class EditView(TemplateView):
63 + template_name = 'registration/edit.html'
64 + success_url = reverse_lazy('register_done')
65 +
66 + def get(self, request, *args, **kwargs):
67 + context = {}
68 + red = 10
69 + context['red'] = red
70 + context['form'] = UserEditForm
71 + return render(self.request, self.template_name, context)
72 +
73 + def post(self, request, *args, **kwargs):
74 +
75 + email = self.request.POST['email']
76 + repository = self.request.POST['repository']
77 +
78 + print(email, repository)
79 + return render(self.request, 'index.html')
80 +
62 81
63 82
64 class UserCreateView(CreateView): 83 class UserCreateView(CreateView):
......
...@@ -17,42 +17,13 @@ ...@@ -17,42 +17,13 @@
17 <link rel="stylesheet" href="{% static 'vendor/magnific-popup/magnific-popup.css' %}"> 17 <link rel="stylesheet" href="{% static 'vendor/magnific-popup/magnific-popup.css' %}">
18 <!-- Custom styles for this template --> 18 <!-- Custom styles for this template -->
19 <link rel="stylesheet" href="{% static 'css/freelancer.min.css' %}"> 19 <link rel="stylesheet" href="{% static 'css/freelancer.min.css' %}">
20 - 20 + <!-- highlight.js -->
21 - <script src="//cdnjs.cloudflare.com/ajax/libs/Chart.js/0.2.0/Chart.min.js" type="text/javascript"></script> 21 + <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/styles/default.min.css">
22 - <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js" type="text/javascript"></script> 22 + <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/highlight.min.js"></script>
23 - <script type="text/javascript"> 23 + <script>hljs.initHighlightingOnLoad();</script>
24 - $( document ).ready(function() { 24 + <link rel="stylesheet" href="//cdn.jsdelivr.net/highlight.js/9.5.0/styles/vs2015.min.css">
25 - var ctx = document.getElementById("myChart"); 25 + <script src="//cdn.jsdelivr.net/highlight.js/9.5.0/highlight.min.js"></script>
26 - var data = { 26 + <script>hljs.initHighlightingOnLoad();</script>
27 - labels: [
28 - "Red",
29 - "Blue",
30 - "Yellow"
31 - ],
32 - datasets: [
33 - {
34 - data: [300, 50, 100],
35 - backgroundColor: [
36 - "#FF6384",
37 - "#36A2EB",
38 - "#FFCE56"
39 - ],
40 - hoverBackgroundColor: [
41 - "#FF6384",
42 - "#36A2EB",
43 - "#FFCE56"
44 - ]
45 - }
46 - ]
47 - };
48 -
49 - var myChart = new Chart(ctx, {
50 - type: 'pie',
51 - data: data,
52 - options: options
53 - });
54 - });
55 - </script>
56 </head> 27 </head>
57 28
58 29
...@@ -80,24 +51,35 @@ ...@@ -80,24 +51,35 @@
80 </nav> 51 </nav>
81 52
82 <!-- Header --> 53 <!-- Header -->
83 - <header class="masthead bg-primary text-white text-center"> 54 + <header class="bg-primary text-white text-center">
84 <div class="container"> 55 <div class="container">
85 -
86 <h3 class="text-uppercase mb-0">정적 분석 페이지 입니다.</h3> 56 <h3 class="text-uppercase mb-0">정적 분석 페이지 입니다.</h3>
87 <hr class="star-light"> 57 <hr class="star-light">
88 - <h2 class="font-weight-light mb-0"></h2>
89 </div> 58 </div>
90 59
91 </header> 60 </header>
92 61
93 <!-- Portfolio Grid Section --> 62 <!-- Portfolio Grid Section -->
94 63
95 -<canvas id="myChart" width="400" height="400"></canvas>
96 <!-- <section class="portfolio" id="portfolio"> --> 64 <!-- <section class="portfolio" id="portfolio"> -->
97 - <div class="col-md-6 col-lg-6" style="float:left;"> 65 + <div class="col-md-6 col-lg-6" style="float: left;">
66 + <div class="container">
67 + <canvas id="barChart" width="700" height="200"></canvas>
68 + </div>
69 + </div>
70 + <div class="col-md-6 col-lg-6" style="float: right;">
98 <div class="container"> 71 <div class="container">
72 + <canvas id="pieChart" width="700" height="200"></canvas>
73 + </div>
74 + </div>
75 +
76 +
77 + <p>&nbsp;</p>
78 + <p>&nbsp;</p>
99 79
100 80
81 + <div class="col-md-12 col-lg-12">
82 + <div style="width: 100%; margin-left: 0px; margin-right: 0px;">
101 <!-- <form method="post" action="."> 83 <!-- <form method="post" action=".">
102 <fieldset>{% csrf_token %} 84 <fieldset>{% csrf_token %}
103 <div> 85 <div>
...@@ -116,226 +98,233 @@ ...@@ -116,226 +98,233 @@
116 <th>CVE</th> 98 <th>CVE</th>
117 <th>내용</th> 99 <th>내용</th>
118 <th>이름</th> 100 <th>이름</th>
119 -
120 - </tr>
121 -
122 - <tr>
123 - <td>1</td>
124 - <td>2</td>
125 - <td>경수</td>
126 - <td><button class="btn btn-primary">자세히보기</button></td>
127 - </tr>
128 - <tr>
129 - <td>1</td>
130 - <td>2</td>
131 - <td>경수</td>
132 - <td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
133 - </tr><tr>
134 - <td>1</td>
135 - <td>2</td>
136 - <td>경수</td>
137 - <td><button class="btn btn-primary">자세히보기</button></td>
138 - </tr>
139 - <tr>
140 - <td>1</td>
141 - <td>2</td>
142 - <td>경수</td>
143 - <td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
144 - </tr><tr>
145 - <td>1</td>
146 - <td>2</td>
147 - <td>경수</td>
148 - <td><button class="btn btn-primary">자세히보기</button></td>
149 - </tr>
150 - <tr>
151 - <td>1</td>
152 - <td>2</td>
153 - <td>경수</td>
154 - <td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
155 - </tr><tr>
156 - <td>1</td>
157 - <td>2</td>
158 - <td>경수</td>
159 - <td><button class="btn btn-primary">자세히보기</button></td>
160 - </tr>
161 - <tr>
162 - <td>1</td>
163 - <td>2</td>
164 - <td>경수</td>
165 - <td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
166 - </tr><tr>
167 - <td>1</td>
168 - <td>2</td>
169 - <td>경수</td>
170 - <td><button class="btn btn-primary">자세히보기</button></td>
171 - </tr>
172 - <tr>
173 - <td>1</td>
174 - <td>2</td>
175 - <td>경수</td>
176 - <td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
177 - </tr><tr>
178 - <td>1</td>
179 - <td>2</td>
180 - <td>경수</td>
181 - <td><button class="btn btn-primary">자세히보기</button></td>
182 - </tr>
183 -
184 - <tr>
185 - <td>1</td>
186 - <td>2</td>
187 - <td>경수</td>
188 - <td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
189 - </tr>
190 -
191 - </table>
192 - </div>
193 - </div>
194 -
195 - <div class="col-md-6 col-lg-6" style="float:left;">
196 - <div class="container">
197 - <table class="table table-hover">
198 - <thead>
199 - <tr>
200 <th>번호</th> 101 <th>번호</th>
201 <th>제목</th> 102 <th>제목</th>
202 <th>이름</th> 103 <th>이름</th>
203 <th>CVE</th> 104 <th>CVE</th>
204 <th>내용</th> 105 <th>내용</th>
205 - <th>이름</th>
206 -
207 - </tr>
208 - <tr>
209 - <td>1</td>
210 - <td>2</td>
211 - <td>경수</td>
212 - <td><button class="btn btn-primary">자세히보기</button></td>
213 - </tr>
214 -
215 - <tr>
216 - <td>1</td>
217 - <td>2</td>
218 - <td>경수</td>
219 - <td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
220 - </tr><tr>
221 - <td>1</td>
222 - <td>2</td>
223 - <td>경수</td>
224 - <td><button class="btn btn-primary">자세히보기</button></td>
225 - </tr>
226 - <tr>
227 - <td>1</td>
228 - <td>2</td>
229 - <td>경수</td>
230 - <td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
231 - </tr><tr>
232 - <td>1</td>
233 - <td>2</td>
234 - <td>경수</td>
235 - <td><button class="btn btn-primary">자세히보기</button></td>
236 - </tr>
237 - <tr>
238 - <td>1</td>
239 - <td>2</td>
240 - <td>경수</td>
241 - <td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
242 - </tr><tr>
243 - <td>1</td>
244 - <td>2</td>
245 - <td>경수</td>
246 - <td><button class="btn btn-primary">자세히보기</button></td>
247 - </tr>
248 - <tr>
249 - <td>1</td>
250 - <td>2</td>
251 - <td>경수</td>
252 - <td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
253 - </tr><tr>
254 - <td>1</td>
255 - <td>2</td>
256 - <td>경수</td>
257 - <td><button class="btn btn-primary">자세히보기</button></td>
258 - </tr>
259 - <tr>
260 - <td>1</td>
261 - <td>2</td>
262 - <td>경수</td>
263 - <td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
264 - </tr><tr>
265 - <td>1</td>
266 - <td>2</td>
267 - <td>경수</td>
268 - <td><button class="btn btn-primary">자세히보기</button></td>
269 - </tr>
270 - <tr>
271 - <td>1</td>
272 - <td>2</td>
273 - <td>경수</td>
274 - <td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
275 - </tr><tr>
276 - <td>1</td>
277 - <td>2</td>
278 - <td>경수</td>
279 - <td><button class="btn btn-primary">자세히보기</button></td>
280 </tr> 106 </tr>
107 + {% for object in object_list %}
281 <tr> 108 <tr>
282 - <td>1</td> 109 + <td>{{ forloop.counter }}</td>
283 - <td>2</td> 110 + <td>{{ object.Language }}</td>
284 - <td>경수</td> 111 + <td>{{ object.Length }}</td>
285 - <td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td> 112 + <td>{{ object.PreviousFunc }}</td>
113 + <td>{{ object.InputDate }}</td>
114 + <td>{{ object.Hash }}</td>
115 + <td>{{ forloop.counter }}</td>
116 + <td>{{ object.Language }}</td>
117 + <td>{{ object.Length }}</td>
118 + <td>{{ object.PreviousFunc }}</td>
119 +
120 + <td id="modal_{{ forloop.counter }}">
121 + <a class="portfolio-item d-block mx-auto" href="#portfolio-modal-{{ forloop.counter }}">
122 + <button class="btn btn-primary">자세히보기</button></td>
123 + </a>
124 + </td>
286 </tr> 125 </tr>
287 - 126 + {% endfor %}
288 </table> 127 </table>
289 - </div>
290 </div> 128 </div>
291 129
292 - <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> 130 + {% for object in object_list %}
293 - <div class="modal-dialog"> 131 + <div class="portfolio-modal mfp-hide" id="portfolio-modal-{{ forloop.counter }}">
294 - <div class="modal-content"> 132 + <div class="portfolio-modal-dialog bg-white">
295 - <div class="modal-header"> 133 + <!-- header -->
296 - <button type="button" class="close" data-dismiss="modal"> 134 + <div class="modal-header">
297 - <span aria-hidden="true">&times;</span> 135 + <h2 class="text-secondary text-uppercase mb-0" style="text-align: center;">cve function name</h2>
298 - <span class="sr-only">Close</span> 136 + </div>
299 - </button> 137 + <!-- left side -->
300 - <h4 class="modal-title">모달제목</h4> 138 + <div class="col-lg-6" style="float: left; border: 1px solid red; height: 1000px;">
301 - </div> 139 + <h2 class="text-secondary text-uppercase mb-0" style="text-align: center;">previous sourcecode</h2>
302 - <div class="modal-body"> 140 + <hr class="star-dark mb-5">
303 - <p>content</p> 141 + <pre><code>
304 - </div> 142 + using namespace std;
305 - <div class="modal-footer"> 143 +
306 - <button type="button" class="btn btn-default" data-dismiss="modal">닫기 144 + int main()
307 - </button> 145 + {
308 - </div> 146 + int rows;
147 +
148 + cout << "Enter number of rows: ";
149 + cin >> rows;
150 +
151 + for(int i = 1; i <= rows; ++i)
152 + {
153 + for(int j = 1; j <= i; ++j)
154 + {
155 + cout << j << " ";
156 + }
157 + cout << "\n";
158 + }
159 +
160 + char input, alphabet = 'A';
161 +
162 + cout << "Enter the uppercase character you want to print in the last row: ";
163 + cin >> input;
164 +
165 + for(int i = 1; i <= (input-'A'+1); ++i)
166 + {
167 + for(int j = 1; j <= i; ++j)
168 + {
169 + cout << alphabet << " ";
170 + }
171 + ++alphabet;
172 +
173 + cout << endl;
174 + }
175 + return 0;
176 + }
177 + </code></pre>
178 + </div>
179 + <!-- right side -->
180 + <div class="col-lg-6" style="float: left; border: 1px solid red; height: 1000px;">
181 + <h2 class="text-secondary text-uppercase mb-0" style="text-align: center;">modified sourcecode</h2>
182 + <hr class="star-dark mb-5">
183 + <pre><code>
184 + using namespace std;
185 +
186 + int main()
187 + {
188 + int rows;
189 +
190 + cout << "Enter number of rows: ";
191 + cin >> rows;
192 +
193 + for(int i = 1; i <= rows; ++i)
194 + {
195 + for(int j = 1; j <= i; ++j)
196 + {
197 + cout << j << " ";
198 + }
199 + cout << "\n";
200 + }
201 +
202 + char input, alphabet = 'A';
203 +
204 + cout << "Enter the uppercase character you want to print in the last row: ";
205 + cin >> input;
206 +
207 + for(int i = 1; i <= (input-'A'+1); ++i)
208 + {
209 + for(int j = 1; j <= i; ++j)
210 + {
211 + cout << alphabet << " ";
212 + }
213 + ++alphabet;
214 +
215 + cout << endl;
216 + }
217 + return 0;
218 + }
219 + </code></pre>
220 + </div>
221 + <!-- footer -->
222 + <div class="modal-footer" style="float: clear;">
223 + <a class="btn btn-primary btn-lg rounded-pill portfolio-modal-dismiss" href="#">
224 + <i class="fa fa-close"></i>
225 + Close
226 + </a>
309 </div> 227 </div>
310 - </div>
311 - </div>
312 -
313 -
314 228
315 - <!-- Scroll to Top Button (Only visible on small and extra-small screen sizes) --> 229 + </div>
316 - <div class="scroll-to-top d-lg-none position-fixed ">
317 - <a class="js-scroll-trigger d-block text-center text-white rounded" href="#page-top">
318 - <i class="fa fa-chevron-up"></i>
319 - </a>
320 </div> 230 </div>
321 - 231 + {% endfor %}
322 -
323 -
324 - <script src="{% static 'js/Chart.min.js' %}"></script>
325 - <script src="{% static 'vendor/freelancer_jquery/jquery.min.js' %}"></script>
326 - <script src="{% static 'vendor/freelancer_bootstrap/js/bootstrap.bundle.min.js' %}"></script>
327 - <script src="{% static 'vendor/jquery-easing/jquery.easing.min.js' %}"></script>
328 - <script src="{% static 'vendor/magnific-popup/jquery.magnific-popup.min.js' %}"></script>
329 - <script src="{% static 'js/jqBootstrapValidation.js' %}"></script>
330 - <script src="{% static 'js/contact_me.js' %}"></script>
331 - <script src="{% static 'js/freelancer.min.js' %}"></script>
332 -
333 - <script>
334 -
335 -
336 - </script>
337 -
338 232
339 </body> 233 </body>
340 234
235 + <script src="{% static 'js/Chart.min.js' %}"></script>
236 + <script src="{% static 'vendor/freelancer_jquery/jquery.min.js' %}"></script>
237 + <script src="{% static 'vendor/freelancer_bootstrap/js/bootstrap.bundle.min.js' %}"></script>
238 + <script src="{% static 'vendor/jquery-easing/jquery.easing.min.js' %}"></script>
239 + <script src="{% static 'vendor/magnific-popup/jquery.magnific-popup.min.js' %}"></script>
240 + <script src="{% static 'js/jqBootstrapValidation.js' %}"></script>
241 + <script src="{% static 'js/contact_me.js' %}"></script>
242 + <script src="{% static 'js/freelancer.min.js' %}"></script>
243 +
244 + <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
245 + <script type="text/javascript" src="{% static 'js/Chart.min.js' %}"></script>
246 + <script type="text/javascript">
247 +
248 + // barChart
249 + var ctx = document.getElementById("barChart").getContext('2d');
250 + var myChart = new Chart(ctx, {
251 + type: 'bar',
252 + data: {
253 + labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
254 + datasets: [{
255 + label: '# of Votes',
256 + data: [12, 19, 3, 5, 2, 3],
257 + backgroundColor: [
258 + 'rgba(255, 99, 132, 0.2)',
259 + 'rgba(54, 162, 235, 0.2)',
260 + 'rgba(255, 206, 86, 0.2)',
261 + 'rgba(75, 192, 192, 0.2)',
262 + 'rgba(153, 102, 255, 0.2)',
263 + 'rgba(255, 159, 64, 0.2)'
264 + ],
265 + borderColor: [
266 + 'rgba(255,99,132,1)',
267 + 'rgba(54, 162, 235, 1)',
268 + 'rgba(255, 206, 86, 1)',
269 + 'rgba(75, 192, 192, 1)',
270 + 'rgba(153, 102, 255, 1)',
271 + 'rgba(255, 159, 64, 1)'
272 + ],
273 + borderWidth: 1
274 + }]
275 + },
276 + options: {
277 + scales: {
278 + yAxes: [{
279 + ticks: {
280 + beginAtZero:true
281 + }
282 + }]
283 + }
284 + }
285 + });
286 +
287 + // pieChart
288 + var red = {{ red }}
289 + var green = {{ green }}
290 + var blue = {{ blue }}
291 +
292 + var ctx = document.getElementById("pieChart").getContext('2d');
293 + var data = {
294 + datasets: [{
295 + data: [red, green, blue],
296 + backgroundColor: [
297 + 'rgba(255, 99, 132, 0.2)',
298 + 'rgba(54, 162, 235, 0.2)',
299 + 'rgba(255, 206, 86, 0.2)',
300 + ],
301 + borderColor: [
302 + 'rgba(255,99,132,1)',
303 + 'rgba(54, 162, 235, 1)',
304 + 'rgba(255, 206, 86, 1)',
305 + ],
306 + borderWidth: 1
307 + }],
308 + // These labels appear in the legend and in the tooltips when hovering different arcs
309 + labels: [
310 + 'Red',
311 + 'Yellow',
312 + 'Blue'
313 + ]
314 + };
315 + var options = {
316 + title: {
317 + display: true,
318 + text: 'CVE',
319 + position: 'top'
320 + },
321 + rotation: -0.7 * Math.PI
322 + };
323 +
324 + var myChart = new Chart(ctx, {
325 + type: 'pie',
326 + data: data,
327 + options: options
328 + });
329 + </script>
341 </html> 330 </html>
......
...@@ -14,6 +14,31 @@ class MypageView(TemplateView): ...@@ -14,6 +14,31 @@ class MypageView(TemplateView):
14 context = {} 14 context = {}
15 context['form'] = testform 15 context['form'] = testform
16 16
17 + query = 'SELECT * FROM vuln.vulnInfo'
18 +
19 + param_list = []
20 +
21 + with connection.cursor() as cursor:
22 + cursor.execute(query, param_list)
23 +
24 + columns = [column[0] for column in cursor.description]
25 +
26 + object_list = []
27 +
28 + for row in cursor.fetchall():
29 + object_list.append(dict(zip(columns, row)))
30 +
31 + context = {}
32 +
33 + red = 3
34 + blue = 4
35 + green = 5
36 +
37 + context['red'] = red
38 + context['blue'] = blue
39 + context['green'] = green
40 + context['object_list'] = object_list
41 +
17 return render(self.request, self.template_name, context) 42 return render(self.request, self.template_name, context)
18 43
19 44
......
...@@ -37,10 +37,6 @@ ...@@ -37,10 +37,6 @@
37 <li class="nav-item mx-0 mx-lg-1"> 37 <li class="nav-item mx-0 mx-lg-1">
38 <a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="#about">Dynamic</a> 38 <a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="#about">Dynamic</a>
39 </li> 39 </li>
40 - <li class="nav-item mx-0 mx-lg-1">
41 - <a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="#contact">Contact</a>
42 - </li>
43 -
44 {% if user.is_active %} 40 {% if user.is_active %}
45 <!-- <li class="nav-item mx-0 mx-lg-1"> 41 <!-- <li class="nav-item mx-0 mx-lg-1">
46 <a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="/myapp/mypage">myPage</a> 42 <a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="/myapp/mypage">myPage</a>
...@@ -49,7 +45,7 @@ ...@@ -49,7 +45,7 @@
49 <a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="{% url 'logout' %}?next=/home">Logout</a> 45 <a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="{% url 'logout' %}?next=/home">Logout</a>
50 </li> 46 </li>
51 <li class="nav-item mx-0 mx-lg-1"> 47 <li class="nav-item mx-0 mx-lg-1">
52 - <a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="{% url 'logout' %}?next=/home">Edit Info</a> 48 + <a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="{% url 'edit' %}">Edit Info</a>
53 </li> 49 </li>
54 {% else %} 50 {% else %}
55 <li class="nav-item mx-0 mx-lg-1"> 51 <li class="nav-item mx-0 mx-lg-1">
...@@ -214,34 +210,7 @@ ...@@ -214,34 +210,7 @@
214 <br></p> 210 <br></p>
215 </div> 211 </div>
216 <div class="col-md-4 mb-5 mb-lg-0"> 212 <div class="col-md-4 mb-5 mb-lg-0">
217 - <h4 class="text-uppercase mb-4">Around the Web</h4> 213 +
218 - <ul class="list-inline mb-0">
219 - <li class="list-inline-item">
220 - <a class="btn btn-outline-light btn-social text-center rounded-circle" href="#">
221 - <i class="fa fa-fw fa-facebook"></i>
222 - </a>
223 - </li>
224 - <li class="list-inline-item">
225 - <a class="btn btn-outline-light btn-social text-center rounded-circle" href="#">
226 - <i class="fa fa-fw fa-google-plus"></i>
227 - </a>
228 - </li>
229 - <li class="list-inline-item">
230 - <a class="btn btn-outline-light btn-social text-center rounded-circle" href="#">
231 - <i class="fa fa-fw fa-twitter"></i>
232 - </a>
233 - </li>
234 - <li class="list-inline-item">
235 - <a class="btn btn-outline-light btn-social text-center rounded-circle" href="#">
236 - <i class="fa fa-fw fa-linkedin"></i>
237 - </a>
238 - </li>
239 - <li class="list-inline-item">
240 - <a class="btn btn-outline-light btn-social text-center rounded-circle" href="#">
241 - <i class="fa fa-fw fa-dribbble"></i>
242 - </a>
243 - </li>
244 - </ul>
245 </div> 214 </div>
246 <div class="col-md-4"> 215 <div class="col-md-4">
247 <h4 class="text-uppercase mb-4">About Us</h4> 216 <h4 class="text-uppercase mb-4">About Us</h4>
......
1 +{% load staticfiles %}
2 +{% load crispy_forms_tags %}
3 +<!DOCTYPE html>
4 +<html lang="en">
5 + <head>
6 +
7 + <meta charset="utf-8">
8 + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
9 + <meta name="description" content="">
10 + <meta name="author" content="">
11 +
12 + <title>VulnNotti</title>
13 +
14 + <!-- Bootstrap core CSS -->
15 + <link rel="stylesheet" href="{% static 'vendor/freelancer_bootstrap/css/bootstrap.min.css' %}">
16 +
17 + <!-- Custom fonts for this template -->
18 + <link rel="stylesheet" href="{% static 'vendor/freelancer_font-awesome/css/font-awesome.min.css' %}">
19 +
20 + <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
21 + <link href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css">
22 +
23 + <!-- Plugin CSS -->
24 + <link rel="stylesheet" href="{% static 'vendor/magnific-popup/magnific-popup.css' %}">
25 + <!-- Custom styles for this template -->
26 + <link rel="stylesheet" href="{% static 'css/freelancer.min.css' %}">
27 +
28 + <style>
29 +
30 + .errornote{
31 + display: block;
32 + margin: 5px 0;
33 + border: 1px solid #c30;
34 + background: #fcf;
35 + padding: 5px 25px;
36 + color: #c30;
37 + font-size: 12px;
38 + font-weight: bold;
39 + }
40 +
41 + fieldset{
42 + border: 1px solid #ccc;
43 + }
44 +
45 + .aligned label{
46 + width: 170px;
47 + display: block;
48 + padding: 3px 10px 0 0;
49 + float: left;
50 + }
51 +
52 + .form-row{
53 + padding: 10px;
54 + font-size: 11px;
55 + border-bottom: 1px solid #eee;
56 + }
57 +
58 + .submit-row{
59 + margin: 5px 0;
60 + border: 1px solid #ccc;
61 + text-align: right;
62 + }
63 +
64 + .submit-row input{
65 + margin: 10px;
66 + background: #ffc;
67 + }
68 +
69 + </style>
70 + </head>
71 +
72 + <body id="page-top">
73 +
74 +
75 + <!-- Header -->
76 + <header class="masthead bg-primary text-white text-center">
77 + <div class="container">
78 + <h1>Edit User Repository</h1>
79 + </div>
80 + </header>
81 +
82 +
83 +
84 + <section>
85 +
86 + <form method="post" action="."> {% csrf_token %}
87 +
88 + {% if form.errors %}
89 + <p class="errornote">Wrong! Please correct the error(s) below.</p>
90 + {% endif %}
91 +
92 + <fieldset class="aligned">
93 +
94 + <div>
95 + {{ form|crispy }}
96 + </div>
97 + <input class="btn btn-success" style="background-color:#FF0066; border:#FF0066;"type="submit" value="Edit"/>
98 +
99 + </fieldset>
100 +
101 + </section>
102 +
103 +
104 +
105 + <div class="copyright py-4 text-center text-white">
106 + <div class="container">
107 + <small>Copyright &copy;www.VulnNotti.com</small>
108 + </div>
109 + </div>
110 +
111 + <!-- Scroll to Top Button (Only visible on small and extra-small screen sizes) -->
112 + <div class="scroll-to-top d-lg-none position-fixed ">
113 + <a class="js-scroll-trigger d-block text-center text-white rounded" href="#page-top">
114 + <i class="fa fa-chevron-up"></i>
115 + </a>
116 + </div>
117 +
118 + <!-- Portfolio Modals -->
119 +
120 + <script src="{% static 'vendor/freelancer_jquery/jquery.min.js' %}"></script>
121 + <script src="{% static 'vendor/freelancer_bootstrap/js/bootstrap.bundle.min.js' %}"></script>
122 + <script src="{% static 'vendor/jquery-easing/jquery.easing.min.js' %}"></script>
123 + <script src="{% static 'vendor/magnific-popup/jquery.magnific-popup.min.js' %}"></script>
124 + <script src="{% static 'js/jqBootstrapValidation.js' %}"></script>
125 + <script src="{% static 'js/contact_me.js' %}"></script>
126 + <script src="{% static 'js/freelancer.min.js' %}"></script>
127 +
128 + </body>
129 +
130 +</html>