2019/08/14

2019년 8월 MS 취약점 패치 주요 사항

배포된 여러 취약점중에, 서버를 운영하는 경우 아래와 같은 취약점은 패치 적용을 꼭 진행하는 것이 좋습니다.

CVE-2019-0714 | Windows Hyper-V 서비스 거부 취약성
https://portal.msrc.microsoft.com/ko-KR/security-guidance/advisory/CVE-2019-0714

CVE-2019-0720 | Hyper-V 원격 코드 실행 취약성
https://portal.msrc.microsoft.com/ko-KR/security-guidance/advisory/CVE-2019-0720

CVE-2019-1181 | 원격 데스크톱 서비스 원격 코드 실행 취약성
https://portal.msrc.microsoft.com/ko-KR/security-guidance/advisory/CVE-2019-1181

CVE-2019-1206 | Windows DHCP 서버 서비스 거부 취약성
https://portal.msrc.microsoft.com/ko-KR/security-guidance/advisory/CVE-2019-1206

CVE-2019-1224 | 원격 데스크톱 프로토콜 서버 정보 유출 취약성
https://portal.msrc.microsoft.com/ko-KR/security-guidance/advisory/CVE-2019-1224

CVE-2019-9511 | HTTP/2 Server 서비스 거부 취약성
https://portal.msrc.microsoft.com/ko-KR/security-guidance/advisory/CVE-2019-9511



2019/08/13

C# Google API Blogger 예제

주로 REST API 호출 예제가 많은데, 구글에서 제공되는 닷넷 API Lib 사용 예제. 인증 부분에서 한참을 헤메다가.. 그리고 API 통해서 포스트내 이미지 업로드 추가는 어떻게 하는건지 못찾음 (지원 안되는것 같음?)


using System.Net.Security;
using Google.Apis.Blogger.v3.Data;
using Google.Apis.Blogger.v3;
using Google.Apis.Auth.OAuth2;
using Google.Apis.Util.Store;
using Google.Apis.Services;


// 인증

UserCredential credential;

using (var stream = new FileStream("client_secret_oauth.json", FileMode.Open, FileAccess.Read))
{
    credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
        GoogleClientSecrets.Load(stream).Secrets,
        new[] { "https://www.googleapis.com/auth/blogger" },    // https://developers.google.com/apis-explorer/#p/blogger/v3/ 에서 허용 설정
        "abc", // 구분값
        CancellationToken.None,
        new FileDataStore("Auth.Blogger")).Result;
}

string blogUrl = "http://bitsyrup.blogspot.com";
BloggerService BloggerService = new BloggerService(new BaseClientService.Initializer()
{
    HttpClientInitializer = credential,
    ApplicationName = "My Project 20108",
});

// 블로그 정보

var BlogResource = BloggerService.Blogs.GetByUrl(blogUrl);
Blog blog = BlogResource.Execute();
Console.WriteLine("Blog ID: " + blog.Id);

// 포스트 데이터

Post PostData = new Post();
PostData.Title = DateTime.Now.ToString() + " " + " - test";
PostData.Content = "xxx23232  <br /><br /> ";
// PostData.Images.Add(xxx);  // 이건 어떻게 작동? 활용 하는건지 못찾음. 예제 없음

// 포스트 올리기

PostsResource PostsResource = new PostsResource(BloggerService);
var post = PostsResource.Insert(PostData, blog.Id).Execute();
Console.WriteLine(post.Id);

// 포스트 목록

PostsResource.ListRequest _request = new PostsResource.ListRequest(_bloggerService, blog.Id);
_request.MaxResults = 50;
_request.FetchBodies = false;
_request.FetchImages = false;

foreach (var _item in _request.Execute().Items)
{
}

C# Google API PhotosLibrary 예제

C# 예제가 거의 전무 하다 시피해서... 한참을  이것 저것 테스트 헤매다가 어케 어케....


using Google.Apis.Auth.OAuth2;
using Google.Apis.Util.Store;
using Google.Apis.Services;
using Google.Apis.PhotosLibrary.v1;
using Google.Apis.PhotosLibrary.v1.Data;


// 인증

UserCredential credential;

using (var stream = new FileStream("client_secret_oauth.json", FileMode.Open, FileAccess.Read))
{
    credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
        GoogleClientSecrets.Load(stream).Secrets,
        new[] { PhotosLibraryService.Scope.Photoslibrary, PhotosLibraryService.Scope.DrivePhotosReadonly },
        "abcApp",   // 구분값
        CancellationToken.None,
        null).Result;
}

// 앨범 목록

PhotosLibraryService PhotosService = new PhotosLibraryService(new BaseClientService.Initializer()
{
    HttpClientInitializer = credential,
});

var albumsList = PhotosService.Albums.List().Execute();
foreach (var item in albumsList.Albums)
{
    Console.WriteLine("Album title: " + item.Title);
    Console.WriteLine("Album ID: " + item.Id);
}

// 사진 목록

SearchMediaItemsRequest x = new SearchMediaItemsRequest();
x.AlbumId = "AMhW9mr-M9UF3Tpo2";

var mitems = PhotosService.MediaItems.Search(x).Execute();  // 특정 앨범
foreach(var i in mitems.MediaItems)
{
    Console.WriteLine("Id : " +i.Id);
    Console.WriteLine("Filename : " + i.Filename);
    Console.WriteLine("BaseUrl : " + i.BaseUrl);
    Console.WriteLine("ProductUrl : " + i.ProductUrl);
}


2019/08/12

구글 API 인증 At least one client secrets (Installed or Web) should be set 에러


C#, Google.Apis.Blogger.v3 Auth

처리되지 않은 예외: System.InvalidOperationException: At least one client secrets (Installed or Web)
 should be set
   위치: Google.Apis.Auth.OAuth2.GoogleClientSecrets.get_Secrets()


json 인증값이, 구글 API 서비스 인증이 아닌 사용자 oAuth 인증으로 변경 적용해 볼 필요가 있음. (구글 여러 API 중에, 서비스 인증을 지원 안하는 API 인것 때문으로 보임)


가장 많이 본 글