Toggle navigation
Toggle navigation
This project
Loading...
Sign in
노현종
/
2018-1-Capstone1-VulnNotti
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
노현종
2018-06-10 02:57:44 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
199a9cafd46a3dc1205bb23ac90bf3422a684368
199a9caf
1 parent
0e3e7355
just
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
17 deletions
Vulnerablity_DB/DownloaderGithubClone/Program.cs
Vulnerablity_DB/VulnCrawler/VulnRDS.cs
Vulnerablity_DB/VulnUserCodeAnalyzer/Program.cs
Vulnerablity_DB/VulnUserCodeAnalyzer/VulnUserCodeAnalyzer.csproj
Vulnerablity_DB/VulnUserCodeAnalyzer/packages.config
Vulnerablity_DB/DownloaderGithubClone/Program.cs
View file @
199a9ca
...
...
@@ -25,21 +25,14 @@ namespace DownloaderGithubClone
Console
.
Write
(
"Git Repository URL을 입력하세요 : "
);
string
url
=
Console
.
ReadLine
();
//https://github.com/django/django.git
string
pattern
=
@"https://github.com/.+/(?<ProjectName>.+)\.(.+)"
;
var
match
=
Regex
.
Match
(
url
,
pattern
);
if
(!
match
.
Success
)
{
Console
.
WriteLine
(
$
"패턴이 맞지 않습니다. Pattern : {pattern}"
);
return
;
}
string
prName
=
match
.
Groups
[
"ProjectName"
].
Value
;
Console
.
WriteLine
(
prName
);
int
idx
=
1
;
string
path
=
Path
.
Combine
(
dir
,
prName
);
if
(
Directory
.
Exists
(
path
))
{
...
...
Vulnerablity_DB/VulnCrawler/VulnRDS.cs
View file @
199a9ca
...
...
@@ -534,24 +534,23 @@ namespace VulnCrawler
yield
return
a
;
}
}
public
static
IEnumerable
<
string
>
SelectAllReposit
()
public
static
IEnumerable
<
(
string
userName
,
string
repository
)
>
SelectAllReposit
()
{
String
sql
=
string
.
Empty
;
MySqlCommand
cmd
=
new
MySqlCommand
();
cmd
.
Connection
=
Conn
;
cmd
.
CommandText
=
"SELECT repository FROM vuln.auth_user "
;
string
a
=
null
;
MySqlCommand
cmd
=
new
MySqlCommand
{
Connection
=
Conn
,
CommandText
=
"SELECT username, repository FROM vuln.auth_user "
};
System
.
Data
.
DataSet
ds
=
new
System
.
Data
.
DataSet
();
MySqlDataAdapter
da
=
new
MySqlDataAdapter
(
cmd
.
CommandText
,
Conn
);
da
.
Fill
(
ds
);
//vuln에 입력
foreach
(
System
.
Data
.
DataRow
row
in
ds
.
Tables
[
0
].
Rows
)
{
a
=
Convert
.
ToString
(
row
[
"repository"
]);
Console
.
WriteLine
(
a
);
yield
return
a
;
string
repo
=
Convert
.
ToString
(
row
[
"repository"
]);
string
user
=
Convert
.
ToString
(
row
[
"username"
]);
yield
return
(
user
,
repo
);
}
}
public
static
IEnumerable
<
string
>
SelectReposit_detail
()
...
...
Vulnerablity_DB/VulnUserCodeAnalyzer/Program.cs
View file @
199a9ca
...
...
@@ -111,6 +111,7 @@ namespace VulnUserCodeAnalyzer
{
static
void
Main
(
string
[]
args
)
{
/* 연도별 CVE JSON 파일 로드 */
CVE_JSON
.
AutoLoad
();
...
...
@@ -150,6 +151,15 @@ namespace VulnUserCodeAnalyzer
return
;
}
var
reposits
=
VulnRDS
.
SelectAllReposit
();
foreach
(
var
(
userName
,
repository
)
in
reposits
)
{
Console
.
WriteLine
(
$
"{userName}, {repository}"
);
}
Console
.
ReadLine
();
/* hashDict = 사용된 사용자 함수 정보 */
var
hashDict
=
new
Dictionary
<
int
,
HashSet
<
VulnAbstractCrawler
.
UserBlock
>>();
/* 경과 시간 체크 */
...
...
@@ -327,6 +337,7 @@ namespace VulnUserCodeAnalyzer
{
type
=
"EXCUTE"
;
}
var
urlBytes
=
Convert
.
FromBase64String
(
findCveDict
[
cve
].
FirstOrDefault
().
Url
);
string
url
=
Encoding
.
Unicode
.
GetString
(
urlBytes
);
...
...
Vulnerablity_DB/VulnUserCodeAnalyzer/VulnUserCodeAnalyzer.csproj
View file @
199a9ca
...
...
@@ -38,6 +38,9 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
...
...
Vulnerablity_DB/VulnUserCodeAnalyzer/packages.config
View file @
199a9ca
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
packages
>
<
package
id
=
"Newtonsoft.Json"
version
=
"11.0.2"
targetFramework
=
"net461"
/>
<
package
id
=
"System.ValueTuple"
version
=
"4.5.0"
targetFramework
=
"net461"
/>
</
packages
>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment