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-08 15:59:38 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
83e7c2a0f87ad18effea77aa47f688504dec535f
83e7c2a0
1 parent
444af87c
selectbyCve 추가
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
5 deletions
Vulnerablity_DB/VulnCrawler/VulnRDS.cs
Vulnerablity_DB/VulnCrawler/VulnRDS.cs
View file @
83e7c2a
...
...
@@ -401,14 +401,13 @@ namespace VulnCrawler
}
public
static
IEnumerable
<
_Vuln
>
SelectVulnbyLen
(
int
_lenFunc
)
{
// var list = new List<_Vuln>();
String
sql
=
string
.
Empty
;
MySqlCommand
cmd
=
new
MySqlCommand
();
cmd
.
Connection
=
Conn
;
cmd
.
CommandText
=
"SELECT * FROM vuln_Info where lenFunc="
+
_lenFunc
;
System
.
Data
.
DataSet
ds
=
new
System
.
Data
.
DataSet
();
MySqlDataAdapter
da
=
new
MySqlDataAdapter
(
"SELECT * FROM vuln_Info where lenFunc="
+
_lenFunc
,
Conn
);
MySqlDataAdapter
da
=
new
MySqlDataAdapter
(
cmd
.
CommandText
,
Conn
);
da
.
Fill
(
ds
);
//vuln에 입력
...
...
@@ -425,11 +424,33 @@ namespace VulnCrawler
Url
=
Convert
.
ToString
(
row
[
"url"
])
};
yield
return
vuln
;
//list.Add(vuln);
}
//해당 list 반환
// return list;
}
public
static
IEnumerable
<
_Vuln
>
SelectVulnbyCve
(
string
_cve
)
{
String
sql
=
string
.
Empty
;
MySqlCommand
cmd
=
new
MySqlCommand
();
cmd
.
Connection
=
Conn
;
cmd
.
CommandText
=
$
"SELECT * FROM vuln_Info where cve='"
+
_cve
+
$
"'"
;
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
)
{
_Vuln
vuln
=
new
_Vuln
{
VulnId
=
Convert
.
ToInt32
(
row
[
"vulnId"
]),
Cve
=
Convert
.
ToString
(
row
[
"cve"
]),
FuncName
=
Convert
.
ToString
(
row
[
"funcName"
]),
LenFunc
=
Convert
.
ToInt32
(
row
[
"lenFunc"
]),
Code
=
Convert
.
ToString
(
row
[
"code"
]),
BlockHash
=
Convert
.
ToString
(
row
[
"blockHash"
]),
Url
=
Convert
.
ToString
(
row
[
"url"
])
};
yield
return
vuln
;
}
}
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment