노현종

just

......@@ -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)) {
......
......@@ -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()
......
......@@ -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);
......
......@@ -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" />
......
<?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
......