2013년 11월 26일 화요일

SimpleURLCheck

 import java.net.*;
    import java.io.*;

    public class SimpleURLCheck {

      public static void main(String args[]) {
        if (args.length == 0) {
          System.err.println(
              "Please provide a URL to check");
        } else {
          HttpURLConnection.setFollowRedirects(false);
          String urlString = args[0];
          try {
            URL url = new URL(urlString);
            URLConnection connection =
              url.openConnection();
            if (connection instanceof HttpURLConnection) {
              HttpURLConnection httpConnection =
               (HttpURLConnection)connection;
              httpConnection.connect();
              int response =
               httpConnection.getResponseCode();
              System.out.println("Response: " + response);
              String location =         
               httpConnection.getHeaderField("Location");
              if (location != null) {
                System.out.println(
                 "Location: " + location);
              }
              InputStream is =
                httpConnection.getInputStream();
              byte[] buffer = new byte [256];
              while (is.read (buffer) != -1) {}
              is.close();
            }
          } catch (IOException e) {
            e.printStackTrace();
          }
        }
      }
    }

홈페이지 jQuery 라이브러리에서 CVE-2019-11358 취약점 패치 여부 확인 방법

현재 홈페이지에서 사용 중인 jQuery 라이브러리가 CVE-2019-11358 취약점 패치를 적용했는지 확인하는 방법은 다음과 같습니다. 1. jQuery 버전 확인 홈페이지 소스 코드를 확인하여 jQuery 라이브러리 버전을 직접 확인합니다. 웹 ...