노현종
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>8b3ec7f4-6106-4f2f-9a57-d10e4bbd93e8</ProjectGuid>
<ProjectGuid>{8B3EC7F4-6106-4F2F-9A57-D10E4BBD93E8}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AWS_Center</RootNamespace>
......@@ -30,24 +30,19 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System"/>
<Reference Include="System.Core"/>
<Reference Include="System.Xml.Linq"/>
<Reference Include="System.Data.DataSetExtensions"/>
<Reference Include="Microsoft.CSharp"/>
<Reference Include="System.Data"/>
<Reference Include="System.Net.Http"/>
<Reference Include="System.Xml"/>
<Reference Include="MySql.Data, Version=8.0.11.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Class1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
</Project>
\ No newline at end of file
......

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27428.2037
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AWS_Center", "AWS_Center.csproj", "{8B3EC7F4-6106-4F2F-9A57-D10E4BBD93E8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8B3EC7F4-6106-4F2F-9A57-D10E4BBD93E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8B3EC7F4-6106-4F2F-9A57-D10E4BBD93E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8B3EC7F4-6106-4F2F-9A57-D10E4BBD93E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8B3EC7F4-6106-4F2F-9A57-D10E4BBD93E8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EEBEFAA7-7268-4494-ADAF-291BB2AF8588}
EndGlobalSection
EndGlobal
......@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MySql.Data.MySqlClient;
// 참고(C# mysql 연결)
#region MySql 연결
......@@ -40,6 +40,8 @@ namespace AWS_Center
{
public static class VulnRDS
{
public static MySqlConnection Conn { get; set; }
public class Vuln
{
public int Len { get; set; } /* 발견된 취약점 함수 PreFunc 부분의 코드 길이 */
......@@ -54,10 +56,30 @@ namespace AWS_Center
// 생성자
public Vuln()
{
}
}
//connect
public static void Connect()
{
MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder()
{
Server = "vulndb.cby38wfppa7l.us-east-2.rds.amazonaws.com",
UserID = "yhackerbv",
Password = "guswhd12",
Database = "vuln",
Port = 3306,
};
string strConn = builder.ToString();
builder = null;
Conn = new MySqlConnection(strConn);
}
public static void InsertVulnData(int _len, string _repoName, string _cve, string _funcName,
string _preFunc, string _afterFunc, string _hash)
......@@ -66,11 +88,16 @@ namespace AWS_Center
* DB에 취약점 데이터가 이미 있는지 검사해야함
*
*/
}
public static IEnumerable<string> SearchVulnData(int _len)
{
Conn.Open();
}
//public static IEnumerable<string> SearchVulnData(int _len)
//{
//
//}
}
}
......
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MySql.Data.MySqlClient;
namespace Tester
{
class Program
{
static void Main(string[] args)
{
}
}
}
namespace AWS_Center
{
public static class VulnRDS
{
public static MySqlConnection Conn { get; set; }
public class Vuln
{
public int VulnId { get; set; } /* 취약점 ID */
public int LenBlock { get; set; } /* 취약점 BLOCK 길이 */
public string RepositName { get; set; } /* 취약점 레파지토리 이름 */
public string Cve { get; set; } /* 취약점 CVE */
public string FuncName { get; set; } /* 취약점 함수 이름 */
public string Language { get; set; } /* 취약점 언어 종류 */
public string CodeOriBefore { get; set; } /* 취약점 패치 전 원본 코드 */
public string CodeOriAfter { get; set; } /* 취약점 패치 후 원본 코드 */
public string CodeAbsBefore { get; set; } /* 취약점 패치 전 추상화 코드 */
public string CodeAbsAfter { get; set; } /* 취약점 패치 후 추상화 코드 */
public string BlockHash { get; set; } /* 취약점 블록 해시 값 */
// 생성자
public Vuln()
{
}
}
public class User
{
public int UserId { get; set; } /* 유저 ID */
public string RepositName { get; set; } /* 유저 레파지토리 이름 */
public string Cve { get; set; } /* 취약점 CVE */
public string CodeOriBefore { get; set; } /* 취약점 패치 전 원본 코드 */
public string CodeOriAfter { get; set; } /* 취약점 패치 후 원본 코드 */
public string FuncName { get; set; } /* 취약점 함수 이름 */
public string DetectDate { get; set; } /* 검사 날짜 */
// 생성자
public User()
{
}
}
//connect
public static void Connect()
{
MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder()
{
Server = "vulndb.cby38wfppa7l.us-east-2.rds.amazonaws.com",
UserID = "yhackerbv",
Password = "guswhd12",
Database = "vuln",
Port = 3306,
};
string strConn = builder.ToString();
builder = null;
Conn = new MySqlConnection(strConn);
}
public static void InsertVulnData(Vuln vuln)
{
/*
* DB에 취약점 데이터가 이미 있는지 검사해야함
*
*/
Conn.Open();
}
//public static IEnumerable<string> SearchVulnData(int _len)
//{
//
//}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
// 이러한 특성 값을 변경하세요.
[assembly: AssemblyTitle("Tester")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Tester")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요.
[assembly: ComVisible(false)]
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
[assembly: Guid("ac204ded-c47f-46fe-b357-01c71849ea76")]
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
//
// 주 버전
// 부 버전
// 빌드 번호
// 수정 버전
//
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호가 자동으로
// 지정되도록 할 수 있습니다.
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{AC204DED-C47F-46FE-B357-01C71849EA76}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Tester</RootNamespace>
<AssemblyName>Tester</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="MySql.Data, Version=8.0.11.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
......@@ -11,6 +11,14 @@ class UserCreationForm(UserCreationForm):
help_text=("github 레포지토리를 등록하세요."))
class UserEditForm(forms.Form):
email = EmailField(label=("이메일"), required=True,
help_text=("이메일을 입력하세요."))
repository = URLField(label=("레포지토리"), required=True,
help_text=("github 레포지토리를 입력하세요."))
class Meta:
model = User
fields = ("username", "email", "repository", "password1", "password2")
......
......@@ -26,6 +26,8 @@ urlpatterns = [
url(r'^home/', HomeView.as_view(), name='home'),
url(r'^myapp/', include('myapp.urls', namespace='myapp')),
url(r'^edit/', EditView.as_view(), name='edit'),
url(r'^accounts/', include('django.contrib.auth.urls')),
url(r'^accounts/register/$', UserCreateView.as_view(), name='register'),
url(r'^accounts/register/done$', UserCreateDoneTV.as_view(), name='register_done'),
......
......@@ -59,6 +59,25 @@ class HomeView(View):
# with connection.cursor() as cursor:
# cursor.execute(query, param_list)
class EditView(TemplateView):
template_name = 'registration/edit.html'
success_url = reverse_lazy('register_done')
def get(self, request, *args, **kwargs):
context = {}
red = 10
context['red'] = red
context['form'] = UserEditForm
return render(self.request, self.template_name, context)
def post(self, request, *args, **kwargs):
email = self.request.POST['email']
repository = self.request.POST['repository']
print(email, repository)
return render(self.request, 'index.html')
class UserCreateView(CreateView):
......
......@@ -17,42 +17,13 @@
<link rel="stylesheet" href="{% static 'vendor/magnific-popup/magnific-popup.css' %}">
<!-- Custom styles for this template -->
<link rel="stylesheet" href="{% static 'css/freelancer.min.css' %}">
<script src="//cdnjs.cloudflare.com/ajax/libs/Chart.js/0.2.0/Chart.min.js" type="text/javascript"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$( document ).ready(function() {
var ctx = document.getElementById("myChart");
var data = {
labels: [
"Red",
"Blue",
"Yellow"
],
datasets: [
{
data: [300, 50, 100],
backgroundColor: [
"#FF6384",
"#36A2EB",
"#FFCE56"
],
hoverBackgroundColor: [
"#FF6384",
"#36A2EB",
"#FFCE56"
]
}
]
};
var myChart = new Chart(ctx, {
type: 'pie',
data: data,
options: options
});
});
</script>
<!-- highlight.js -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<link rel="stylesheet" href="//cdn.jsdelivr.net/highlight.js/9.5.0/styles/vs2015.min.css">
<script src="//cdn.jsdelivr.net/highlight.js/9.5.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
......@@ -80,24 +51,35 @@
</nav>
<!-- Header -->
<header class="masthead bg-primary text-white text-center">
<header class="bg-primary text-white text-center">
<div class="container">
<h3 class="text-uppercase mb-0">정적 분석 페이지 입니다.</h3>
<hr class="star-light">
<h2 class="font-weight-light mb-0"></h2>
</div>
</header>
<!-- Portfolio Grid Section -->
<canvas id="myChart" width="400" height="400"></canvas>
<!-- <section class="portfolio" id="portfolio"> -->
<div class="col-md-6 col-lg-6" style="float:left;">
<div class="col-md-6 col-lg-6" style="float: left;">
<div class="container">
<canvas id="barChart" width="700" height="200"></canvas>
</div>
</div>
<div class="col-md-6 col-lg-6" style="float: right;">
<div class="container">
<canvas id="pieChart" width="700" height="200"></canvas>
</div>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div class="col-md-12 col-lg-12">
<div style="width: 100%; margin-left: 0px; margin-right: 0px;">
<!-- <form method="post" action=".">
<fieldset>{% csrf_token %}
<div>
......@@ -116,226 +98,233 @@
<th>CVE</th>
<th>내용</th>
<th>이름</th>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary">자세히보기</button></td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
</tr><tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary">자세히보기</button></td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
</tr><tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary">자세히보기</button></td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
</tr><tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary">자세히보기</button></td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
</tr><tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary">자세히보기</button></td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
</tr><tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary">자세히보기</button></td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
</tr>
</table>
</div>
</div>
<div class="col-md-6 col-lg-6" style="float:left;">
<div class="container">
<table class="table table-hover">
<thead>
<tr>
<th>번호</th>
<th>제목</th>
<th>이름</th>
<th>CVE</th>
<th>내용</th>
<th>이름</th>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary">자세히보기</button></td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
</tr><tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary">자세히보기</button></td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
</tr><tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary">자세히보기</button></td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
</tr><tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary">자세히보기</button></td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
</tr><tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary">자세히보기</button></td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
</tr><tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary">자세히보기</button></td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
</tr><tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary">자세히보기</button></td>
</tr>
{% for object in object_list %}
<tr>
<td>1</td>
<td>2</td>
<td>경수</td>
<td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">자세히보기</button></td>
<td>{{ forloop.counter }}</td>
<td>{{ object.Language }}</td>
<td>{{ object.Length }}</td>
<td>{{ object.PreviousFunc }}</td>
<td>{{ object.InputDate }}</td>
<td>{{ object.Hash }}</td>
<td>{{ forloop.counter }}</td>
<td>{{ object.Language }}</td>
<td>{{ object.Length }}</td>
<td>{{ object.PreviousFunc }}</td>
<td id="modal_{{ forloop.counter }}">
<a class="portfolio-item d-block mx-auto" href="#portfolio-modal-{{ forloop.counter }}">
<button class="btn btn-primary">자세히보기</button></td>
</a>
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
<h4 class="modal-title">모달제목</h4>
</div>
<div class="modal-body">
<p>content</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">닫기
</button>
</div>
{% for object in object_list %}
<div class="portfolio-modal mfp-hide" id="portfolio-modal-{{ forloop.counter }}">
<div class="portfolio-modal-dialog bg-white">
<!-- header -->
<div class="modal-header">
<h2 class="text-secondary text-uppercase mb-0" style="text-align: center;">cve function name</h2>
</div>
<!-- left side -->
<div class="col-lg-6" style="float: left; border: 1px solid red; height: 1000px;">
<h2 class="text-secondary text-uppercase mb-0" style="text-align: center;">previous sourcecode</h2>
<hr class="star-dark mb-5">
<pre><code>
using namespace std;
int main()
{
int rows;
cout << "Enter number of rows: ";
cin >> rows;
for(int i = 1; i <= rows; ++i)
{
for(int j = 1; j <= i; ++j)
{
cout << j << " ";
}
cout << "\n";
}
char input, alphabet = 'A';
cout << "Enter the uppercase character you want to print in the last row: ";
cin >> input;
for(int i = 1; i <= (input-'A'+1); ++i)
{
for(int j = 1; j <= i; ++j)
{
cout << alphabet << " ";
}
++alphabet;
cout << endl;
}
return 0;
}
</code></pre>
</div>
<!-- right side -->
<div class="col-lg-6" style="float: left; border: 1px solid red; height: 1000px;">
<h2 class="text-secondary text-uppercase mb-0" style="text-align: center;">modified sourcecode</h2>
<hr class="star-dark mb-5">
<pre><code>
using namespace std;
int main()
{
int rows;
cout << "Enter number of rows: ";
cin >> rows;
for(int i = 1; i <= rows; ++i)
{
for(int j = 1; j <= i; ++j)
{
cout << j << " ";
}
cout << "\n";
}
char input, alphabet = 'A';
cout << "Enter the uppercase character you want to print in the last row: ";
cin >> input;
for(int i = 1; i <= (input-'A'+1); ++i)
{
for(int j = 1; j <= i; ++j)
{
cout << alphabet << " ";
}
++alphabet;
cout << endl;
}
return 0;
}
</code></pre>
</div>
<!-- footer -->
<div class="modal-footer" style="float: clear;">
<a class="btn btn-primary btn-lg rounded-pill portfolio-modal-dismiss" href="#">
<i class="fa fa-close"></i>
Close
</a>
</div>
</div>
</div>
<!-- Scroll to Top Button (Only visible on small and extra-small screen sizes) -->
<div class="scroll-to-top d-lg-none position-fixed ">
<a class="js-scroll-trigger d-block text-center text-white rounded" href="#page-top">
<i class="fa fa-chevron-up"></i>
</a>
</div>
</div>
<script src="{% static 'js/Chart.min.js' %}"></script>
<script src="{% static 'vendor/freelancer_jquery/jquery.min.js' %}"></script>
<script src="{% static 'vendor/freelancer_bootstrap/js/bootstrap.bundle.min.js' %}"></script>
<script src="{% static 'vendor/jquery-easing/jquery.easing.min.js' %}"></script>
<script src="{% static 'vendor/magnific-popup/jquery.magnific-popup.min.js' %}"></script>
<script src="{% static 'js/jqBootstrapValidation.js' %}"></script>
<script src="{% static 'js/contact_me.js' %}"></script>
<script src="{% static 'js/freelancer.min.js' %}"></script>
<script>
</script>
{% endfor %}
</body>
<script src="{% static 'js/Chart.min.js' %}"></script>
<script src="{% static 'vendor/freelancer_jquery/jquery.min.js' %}"></script>
<script src="{% static 'vendor/freelancer_bootstrap/js/bootstrap.bundle.min.js' %}"></script>
<script src="{% static 'vendor/jquery-easing/jquery.easing.min.js' %}"></script>
<script src="{% static 'vendor/magnific-popup/jquery.magnific-popup.min.js' %}"></script>
<script src="{% static 'js/jqBootstrapValidation.js' %}"></script>
<script src="{% static 'js/contact_me.js' %}"></script>
<script src="{% static 'js/freelancer.min.js' %}"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
<script type="text/javascript" src="{% static 'js/Chart.min.js' %}"></script>
<script type="text/javascript">
// barChart
var ctx = document.getElementById("barChart").getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
datasets: [{
label: '# of Votes',
data: [12, 19, 3, 5, 2, 3],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)'
],
borderColor: [
'rgba(255,99,132,1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
],
borderWidth: 1
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero:true
}
}]
}
}
});
// pieChart
var red = {{ red }}
var green = {{ green }}
var blue = {{ blue }}
var ctx = document.getElementById("pieChart").getContext('2d');
var data = {
datasets: [{
data: [red, green, blue],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
],
borderColor: [
'rgba(255,99,132,1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
],
borderWidth: 1
}],
// These labels appear in the legend and in the tooltips when hovering different arcs
labels: [
'Red',
'Yellow',
'Blue'
]
};
var options = {
title: {
display: true,
text: 'CVE',
position: 'top'
},
rotation: -0.7 * Math.PI
};
var myChart = new Chart(ctx, {
type: 'pie',
data: data,
options: options
});
</script>
</html>
......
......@@ -14,6 +14,31 @@ class MypageView(TemplateView):
context = {}
context['form'] = testform
query = 'SELECT * FROM vuln.vulnInfo'
param_list = []
with connection.cursor() as cursor:
cursor.execute(query, param_list)
columns = [column[0] for column in cursor.description]
object_list = []
for row in cursor.fetchall():
object_list.append(dict(zip(columns, row)))
context = {}
red = 3
blue = 4
green = 5
context['red'] = red
context['blue'] = blue
context['green'] = green
context['object_list'] = object_list
return render(self.request, self.template_name, context)
......
......@@ -37,10 +37,6 @@
<li class="nav-item mx-0 mx-lg-1">
<a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="#about">Dynamic</a>
</li>
<li class="nav-item mx-0 mx-lg-1">
<a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="#contact">Contact</a>
</li>
{% if user.is_active %}
<!-- <li class="nav-item mx-0 mx-lg-1">
<a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="/myapp/mypage">myPage</a>
......@@ -49,7 +45,7 @@
<a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="{% url 'logout' %}?next=/home">Logout</a>
</li>
<li class="nav-item mx-0 mx-lg-1">
<a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="{% url 'logout' %}?next=/home">Edit Info</a>
<a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="{% url 'edit' %}">Edit Info</a>
</li>
{% else %}
<li class="nav-item mx-0 mx-lg-1">
......@@ -214,34 +210,7 @@
<br></p>
</div>
<div class="col-md-4 mb-5 mb-lg-0">
<h4 class="text-uppercase mb-4">Around the Web</h4>
<ul class="list-inline mb-0">
<li class="list-inline-item">
<a class="btn btn-outline-light btn-social text-center rounded-circle" href="#">
<i class="fa fa-fw fa-facebook"></i>
</a>
</li>
<li class="list-inline-item">
<a class="btn btn-outline-light btn-social text-center rounded-circle" href="#">
<i class="fa fa-fw fa-google-plus"></i>
</a>
</li>
<li class="list-inline-item">
<a class="btn btn-outline-light btn-social text-center rounded-circle" href="#">
<i class="fa fa-fw fa-twitter"></i>
</a>
</li>
<li class="list-inline-item">
<a class="btn btn-outline-light btn-social text-center rounded-circle" href="#">
<i class="fa fa-fw fa-linkedin"></i>
</a>
</li>
<li class="list-inline-item">
<a class="btn btn-outline-light btn-social text-center rounded-circle" href="#">
<i class="fa fa-fw fa-dribbble"></i>
</a>
</li>
</ul>
</div>
<div class="col-md-4">
<h4 class="text-uppercase mb-4">About Us</h4>
......
{% load staticfiles %}
{% load crispy_forms_tags %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>VulnNotti</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="{% static 'vendor/freelancer_bootstrap/css/bootstrap.min.css' %}">
<!-- Custom fonts for this template -->
<link rel="stylesheet" href="{% static 'vendor/freelancer_font-awesome/css/font-awesome.min.css' %}">
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css">
<!-- Plugin CSS -->
<link rel="stylesheet" href="{% static 'vendor/magnific-popup/magnific-popup.css' %}">
<!-- Custom styles for this template -->
<link rel="stylesheet" href="{% static 'css/freelancer.min.css' %}">
<style>
.errornote{
display: block;
margin: 5px 0;
border: 1px solid #c30;
background: #fcf;
padding: 5px 25px;
color: #c30;
font-size: 12px;
font-weight: bold;
}
fieldset{
border: 1px solid #ccc;
}
.aligned label{
width: 170px;
display: block;
padding: 3px 10px 0 0;
float: left;
}
.form-row{
padding: 10px;
font-size: 11px;
border-bottom: 1px solid #eee;
}
.submit-row{
margin: 5px 0;
border: 1px solid #ccc;
text-align: right;
}
.submit-row input{
margin: 10px;
background: #ffc;
}
</style>
</head>
<body id="page-top">
<!-- Header -->
<header class="masthead bg-primary text-white text-center">
<div class="container">
<h1>Edit User Repository</h1>
</div>
</header>
<section>
<form method="post" action="."> {% csrf_token %}
{% if form.errors %}
<p class="errornote">Wrong! Please correct the error(s) below.</p>
{% endif %}
<fieldset class="aligned">
<div>
{{ form|crispy }}
</div>
<input class="btn btn-success" style="background-color:#FF0066; border:#FF0066;"type="submit" value="Edit"/>
</fieldset>
</section>
<div class="copyright py-4 text-center text-white">
<div class="container">
<small>Copyright &copy;www.VulnNotti.com</small>
</div>
</div>
<!-- Scroll to Top Button (Only visible on small and extra-small screen sizes) -->
<div class="scroll-to-top d-lg-none position-fixed ">
<a class="js-scroll-trigger d-block text-center text-white rounded" href="#page-top">
<i class="fa fa-chevron-up"></i>
</a>
</div>
<!-- Portfolio Modals -->
<script src="{% static 'vendor/freelancer_jquery/jquery.min.js' %}"></script>
<script src="{% static 'vendor/freelancer_bootstrap/js/bootstrap.bundle.min.js' %}"></script>
<script src="{% static 'vendor/jquery-easing/jquery.easing.min.js' %}"></script>
<script src="{% static 'vendor/magnific-popup/jquery.magnific-popup.min.js' %}"></script>
<script src="{% static 'js/jqBootstrapValidation.js' %}"></script>
<script src="{% static 'js/contact_me.js' %}"></script>
<script src="{% static 'js/freelancer.min.js' %}"></script>
</body>
</html>