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-06 16:01:39 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a9f50b3e9da654b9ca596ad2b9f6d0f8145b42f0
a9f50b3e
1 parent
7f9306c7
db 수정
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
Vulnerablity_DB/VulnCrawler/VulnRDS.cs
Vulnerablity_DB/VulnCrawler/VulnRDS.cs
View file @
a9f50b3
...
...
@@ -31,7 +31,6 @@ namespace VulnCrawler
public
string
RepositName
{
get
;
set
;
}
=
"NULL"
;
/* 유저 레파지토리 이름 */
public
int
VulnId
{
get
;
set
;
}
=
-
1
;
/* 취약점 vuln ID */
}
//
public
class
_Vuln
{
public
int
VulnId
{
get
;
set
;
}
=
-
1
;
/* 취약점 ID */
...
...
@@ -63,15 +62,14 @@ namespace VulnCrawler
public
static
void
InsertVulnData
(
Vuln
vuln
)
{
String
sql
=
string
.
Empty
;
// vulnId setting (마지막 vulnId +1)
MySqlCommand
cmd
=
null
;
// vulnId setting (마지막 vulnId +1)
int
last_vulnId
=
1
;
try
{
sql
=
"select max(vulnId) from vulnInfo"
;
cmd
=
new
MySqlCommand
(
sql
,
Conn
);
last_vulnId
=
(
Convert
.
ToInt32
(
cmd
.
ExecuteScalar
()))
+
1
;
}
catch
(
Exception
)
...
...
@@ -133,7 +131,7 @@ namespace VulnCrawler
cmd
.
Parameters
.
AddWithValue
(
"@vulnId"
,
last_vulnId
);
cmd
.
Parameters
.
AddWithValue
(
"@cve"
,
$
"'{vuln.Cve}'"
);
cmd
.
Parameters
.
AddWithValue
(
"@funcName"
,
$
"'{vuln.FuncName}'"
);
cmd
.
Parameters
.
AddWithValue
(
"@lenFunc"
,
$
"
'{vuln.LenFunc}'
"
);
cmd
.
Parameters
.
AddWithValue
(
"@lenFunc"
,
$
"
{vuln.LenFunc}
"
);
cmd
.
Parameters
.
AddWithValue
(
"@code"
,
$
"'{vuln.Code}'"
);
cmd
.
Parameters
.
AddWithValue
(
"@blockHash"
,
$
"'{vuln.BlockHash}'"
);
cmd
.
Parameters
.
AddWithValue
(
"@url"
,
$
"'{vuln.Url}'"
);
...
...
@@ -185,7 +183,7 @@ namespace VulnCrawler
cmd
.
CommandText
=
"INSERT INTO userInfo(userId, repositName, vulnId) VALUES(@userId, @repositName, @vulnId)"
;
cmd
.
Parameters
.
AddWithValue
(
"@userId"
,
last_userId
);
cmd
.
Parameters
.
AddWithValue
(
"@repositName"
,
$
"'{user.RepositName}'"
);
cmd
.
Parameters
.
AddWithValue
(
"@vulnInfo"
,
$
"
'{user.VulnId}'
"
);
cmd
.
Parameters
.
AddWithValue
(
"@vulnInfo"
,
$
"
{user.VulnId}
"
);
cmd
.
ExecuteNonQuery
();
//콘솔출력용
sql
=
"INSERT INTO userInfo(userId, repositName, vulnId) "
+
$
"VALUES({last_userId},'{user.RepositName}','{user.VulnId}')"
;
...
...
@@ -215,11 +213,11 @@ namespace VulnCrawler
cmd
=
new
MySqlCommand
();
cmd
.
Connection
=
Conn
;
//해당 vuln Update
cmd
.
CommandText
=
"UPDATE vuln_Info SET cve=@cve,fun
Name=@funName,lenFunc=@lenFunc,code=@code,blockHash=@blockHash,url=@url WHERE vulnId=@vu
nId"
;
cmd
.
CommandText
=
"UPDATE vuln_Info SET cve=@cve,fun
cName=@funcName,lenFunc=@lenFunc,code=@code,blockHash=@blockHash,url=@url WHERE vulnId=@vul
nId"
;
cmd
.
Parameters
.
AddWithValue
(
"@vulnId"
,
_vulnId
);
cmd
.
Parameters
.
AddWithValue
(
"@cve"
,
$
"'{vuln.Cve}'"
);
cmd
.
Parameters
.
AddWithValue
(
"@funcName"
,
$
"'{vuln.FuncName}'"
);
cmd
.
Parameters
.
AddWithValue
(
"@lenFunc"
,
$
"
'{vuln.LenFunc}'
"
);
cmd
.
Parameters
.
AddWithValue
(
"@lenFunc"
,
$
"
{vuln.LenFunc}
"
);
cmd
.
Parameters
.
AddWithValue
(
"@code"
,
$
"'{vuln.Code}'"
);
cmd
.
Parameters
.
AddWithValue
(
"@blockHash"
,
$
"'{vuln.BlockHash}'"
);
cmd
.
Parameters
.
AddWithValue
(
"@url"
,
$
"'{vuln.Url}'"
);
...
...
Please
register
or
login
to post a comment