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-04-12 00:31:24 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f0bd3a61b4b280bffbf50b8079bd45821ebc3cde
f0bd3a61
1 parent
7503c1d2
insert AWS, Account class
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
98 additions
and
25 deletions
Vulnerablity_DB/VulnCrawler/AWS.cs
Vulnerablity_DB/VulnCrawler/Program.cs
Vulnerablity_DB/VulnCrawler/VulnCrawler.csproj
Vulnerablity_DB/VulnCrawler/AWS.cs
0 → 100644
View file @
f0bd3a6
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Xml
;
using
System.Xml.Serialization
;
namespace
VulnCrawler
{
public
static
class
AWS
{
[
XmlRoot
(
"MySqlAccountInfo"
)]
public
class
Account
{
public
static
string
FilePath
=>
@"D:\Account.xml"
;
[
XmlAttribute
(
"EndPoint"
)]
public
string
Endpoint
{
get
;
set
;
}
[
XmlAttribute
(
"ID"
)]
public
string
Id
{
get
;
set
;
}
[
XmlAttribute
(
"PW"
)]
public
string
Pw
{
get
;
set
;
}
}
private
static
Account
account
;
static
AWS
()
{
// account = LoadAccount();
account
=
new
Account
()
{
Endpoint
=
"aaa"
,
Id
=
"bbb"
,
Pw
=
"1231"
,
};
Console
.
WriteLine
(
account
.
Endpoint
);
}
private
static
Account
LoadAccount
()
{
if
(!
File
.
Exists
(
Account
.
FilePath
))
{
return
null
;
}
Account
acc
=
null
;
// Deserialization
using
(
var
reader
=
new
StreamReader
(
Account
.
FilePath
))
{
XmlSerializer
xs
=
new
XmlSerializer
(
typeof
(
Account
));
acc
=
(
Account
)
xs
.
Deserialize
(
reader
);
}
return
acc
;
}
public
static
void
SaveAccount
()
{
//File.SetAttributes(Account.FilePath, FileAttributes.Normal);
// Serialization
using
(
StreamWriter
wr
=
new
StreamWriter
(
Account
.
FilePath
))
{
XmlSerializer
xs
=
new
XmlSerializer
(
typeof
(
Account
));
xs
.
Serialize
(
wr
,
account
);
}
}
}
}
Vulnerablity_DB/VulnCrawler/Program.cs
View file @
f0bd3a6
...
...
@@ -15,36 +15,35 @@ namespace VulnCrawler
{
static
void
Main
(
string
[]
args
)
{
string
accountInfo
=
File
.
ReadAllText
(
@"c:\account.txt"
);
string
id
=
accountInfo
.
Split
(
','
)[
0
];
string
pw
=
accountInfo
.
Split
(
','
)[
1
];
MySqlConnectionStringBuilder
builder
=
new
MySqlConnectionStringBuilder
{
Server
=
""
,
UserID
=
id
,
Password
=
pw
,
Database
=
"vuln"
,
Port
=
3306
};
string
strConn
=
builder
.
ToString
();
builder
=
null
;
MySqlConnection
conn
=
new
MySqlConnection
(
strConn
);
AWS
.
SaveAccount
();
//MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder {
// Server = "",
// UserID = id,
// Password = pw,
// Database = "vuln",
// Port = 3306
//};
//string strConn = builder.ToString();
//builder = null;
//MySqlConnection conn = new MySqlConnection(strConn);
try
{
//
try {
String
sql
=
"INSERT INTO members (id, pwd, name) "
+
"VALUES ('gon', '111', '김삿갓')"
;
//
String sql = "INSERT INTO members (id, pwd, name) " +
//
"VALUES ('gon', '111', '김삿갓')";
MySqlCommand
cmd
=
new
MySqlCommand
(
sql
,
conn
);
//
MySqlCommand cmd = new MySqlCommand(sql, conn);
conn
.
Open
();
//
conn.Open();
cmd
.
ExecuteNonQuery
();
conn
.
Close
();
}
catch
(
Exception
e
)
{
Console
.
WriteLine
(
e
.
ToString
());
}
//
cmd.ExecuteNonQuery();
//
conn.Close();
//
} catch (Exception e) {
//
Console.WriteLine(e.ToString());
//
}
// Run();
...
...
Vulnerablity_DB/VulnCrawler/VulnCrawler.csproj
View file @
f0bd3a6
...
...
@@ -53,6 +53,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AWS.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="VulnPython.cs" />
...
...
Please
register
or
login
to post a comment