netstat를 이용하여 사용중인 포트, 연결된 주소, 연결 상태등을 알수 있다.
netstat /na
특정 포트가 사용중인지 확인도 가능하다
netstat /na | find "443"
관리자 권한이 있을 시 관련 프로세스 정보도 알수 있다
netstat /nab
내용이 많아 보기 힘들때는 파일로 만들어서 확인할 수 있다.
netstat /nab > portinfo.txt
netstat를 이용하여 사용중인 포트, 연결된 주소, 연결 상태등을 알수 있다.
netstat /na
특정 포트가 사용중인지 확인도 가능하다
netstat /na | find "443"
관리자 권한이 있을 시 관련 프로세스 정보도 알수 있다
netstat /nab
내용이 많아 보기 힘들때는 파일로 만들어서 확인할 수 있다.
netstat /nab > portinfo.txt
UUID(Universally Unique IDentifier)는 네트워크상에서 각 개체들을 식별하고 구별하기 위한 범용적 식별자이다. 고유성을 완벽하게 보장할수는 없지만 중복될 가능성이 거의 없다고 인정하여 많이 사용하고 있다.
WMIC (Windows Management Instrumentation Command-line)을 이용하여
윈도우 시스템 UUID를 확인할 수 있다.
Win + R > cmd
wmic csproduct get uuid
이외에도 wmic를 이용하여 다음과 같은 정보를 얻을 수 있다.
wmic bios get biosversion // bios 버전
wmic bios get serialnumber // bios 시리얼 넘버
wmic diskdrive get index,serialnumber // 디스크 시리얼 넘버
public static byte[] hexStringToByte(String hex){ if (hex == null || hex.length() == 0) return null; if( hex.length() % 2 != 0 ) hex = "0" + hex; byte[] ba = new byte[hex.length() / 2]; for (int i = 0; i < ba.length; i++) ba[i] = (byte) Integer.parseInt(hex.substring(2 * i, 2 * i + 2), 16); return ba; } public static String byteToHexString(byte[] bytes) { char[] container = new char[bytes.length * 2]; for (int i = 0; i < bytes.length; i++) { int b = bytes[i] & 0xFF; container[i * 2] = Character.forDigit(b >>> 4, 0x10); container[i * 2 + 1] = Character.forDigit(b & 0xF, 0x10); } return new String(container); }
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.KOREA); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.KOREA); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH", Locale.KOREA); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd", Locale.KOREA); // if need UTC format.setTimeZone(TimeZone.getTimeZone("UTC")); String time = format.format( new Date() );
// String to byte String string = "abcd"; byte[] byteArray; byteArray = string.getBytes(); byteArray = string.getBytes("UTF-8"); byteArray = string.getBytes(StandardCharsets.UTF_8);
// byte to String byte[] byteArray = { 'a', 'b', 'c', 'd' }; String string; string = new String( byteArray ); string = new String( byteArray, "UTF-8" ); string = new String( byteArray, 0, byteArray.length, "UTF-8" ); string = new String( byteArray, StandardCharsets.UTF_8 ); string = new String( byteArray, 0, byteArray.length, StandardCharsets.UTF_8 );