'전체 글'에 해당되는 글 472건

https://xinet.kr/?p=3478

 

nginx version 숨기기 및 header 정보 숨기기 ( nginx remove the server header )

기본적으로 Nginx에서 nginx 버전 정보를 숨기는 것은 간단하게 해결 할수 있다기본값이 on 상태일때 값을 확인해 보면버전 정보를 숨기기 위해서는 nginx.conf 환경설정에서 server_tokens 값을 off 로 변

xinet.kr

 

기본적으로 Nginx에서 nginx 버전 정보를 숨기는 것은 간단하게 해결 할수 있다
기본값이 on 상태일때 값을 확인해 보면

 
 
 
 
 
Shell
 
1
2
3
4
5
[root@xinet nginx-1.21.6]# vi /usr/local/nginx/conf/nginx.conf
 
 
### version hide
    server_tokens on;

이렇게 구성할 경우 버전이 출력된다

 
 
 
 
 
Shell
 
1
2
3
4
5
6
7
8
9
10
11
[root@xinet ~]# curl -IsL https://xinet.kr --insecure
HTTP/1.1 200 OK
Server: nginx/1.21.7
Date: Fri, 29 Apr 2022 06:58:54 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Set-Cookie: PHPSESSID=nv5flpefh076b2a92taf95u093; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Link: <https://xinet.kr/index.php?rest_route=/>; rel="https://api.w.org/"


버전 정보를 숨기기 위해서는 nginx.conf 환경설정에서 server_tokens 값을 off 로 변경하면 된다

 
 
 
 
 
Shell
 
1
2
3
4
[root@xinet nginx-1.21.6]# vi /usr/local/nginx/conf/nginx.conf
 
### version hide
    server_tokens off;

nginx 재시작 후 확인

 
 
 
 
 
Shell
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
[root@xinet ~]# systemctl restart nginx
 
 
[root@xinet ~]# curl -IsL https://xinet.kr --insecure
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 29 Apr 2022 07:02:06 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Set-Cookie: PHPSESSID=1ljq6md9ngrd6q7pm3njstrlst; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Link: <https://xinet.kr/index.php?rest_route=/>; rel="https://api.w.org/"

이렇게 하면 버전의 정보를 숨길 수가 있다


웹페이지에서도 확인해보자

그러면 header 값에 server에 nginx 값이 표시가 되는데 이것도 숨길 수가 있다
모듈이 추가해서 이용하면 되는데 사용되믄 모듈은 ngx_security_headers 이용하면 된다

다운로드 후 모듈을 생성 후 추가해주면 된다

 
 
 
 
 
Shell
 
1
2
3
[root@xinet ~]# cd /usr/local/src/
 

기본 설치된 버전 없으면 다운로드 있으면 처음 설치 폴더로 가서 모듈 생성 및 복사

 
 
 
 
 
Shell
 
1
2
3
4
5
6
7
[root@xinet src]# cd nginx-1.21.6/
 
[root@xinet nginx-1.21.6]# ./configure --with-compat --add-dynamic-module=/usr/local/src/ngx_security_headers
 
[root@xinet nginx-1.21.6]# make modules
 
[root@xinet nginx-1.21.6]# cp -a objs/ngx_http_security_headers_module.so /usr/local/nginx/modules/

모듈이 복사가 되었으면 환경설정 값에  추가

 
 
 
 
 
Shell
 
1
2
3
4
5
6
7
8
9
[root@xinet nginx-1.21.6]# vi /usr/local/nginx/conf/nginx.conf
 
 
 
 
load_module modules/ngx_http_security_headers_module.so;
 
### header hide
    hide_server_tokens on;

nginx 재시작 및 curl 확인 server 정보가 표시되지 않는다

 
 
 
 
 
Shell
 
1
2
3
4
5
6
7
8
9
10
11
12
13
[root@xinet ~]# systemctl restart nginx
 
 
[root@xinet ~]# curl -IsL https://xinet.kr --insecure
HTTP/1.1 200 OK
Date: Fri, 29 Apr 2022 06:52:39 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Set-Cookie: PHPSESSID=ukiujk8i29fo97enqlr4fops2i; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Link: <https://xinet.kr/index.php?rest_route=/>; rel="https://api.w.org/"


크롬 웹페이지에서 확인

만약 yum 으로 설치된 환경이라면  해당 설치 후 모듈 추가된거 확인 후 이용하면 된다

 
 
 
 
 
Shell
 
1
2
3
yum -y install https://extras.getpagespeed.com/release-latest.rpm
 
yum -y install nginx-module-security-headers
 
 
 
 
 
Shell
 
1
2
3
4
5
6
7
load_module modules/ngx_http_headers_more_filter_module.so;
 
http {
    ...
    more_clear_headers Server;
    ...
}

 

'경로 및 정보' 카테고리의 다른 글

Teleport 관련 자료  (1) 2024.02.24
A deep dive into AWS S3 access controls – taking full control over your assets  (1) 2024.02.05
/.vscode/sftp.json  (0) 2023.11.19
Active Directory Basic 문제  (0) 2023.11.12
Fiddler 셋팅  (0) 2023.11.10
블로그 이미지

wtdsoul

,

https://dev-blackcat.tistory.com/1

 

[VSCODE] 비주얼스튜디오코드(Visual Studio Code) SFTP 연동하기

먼저, 확장 탭을 클릭 후 "SFTP" 검색한 후 아래의 이미지의 확장을 설치해 주세요. 새로운 폴더 혹은 기존 프로젝트 폴더를 열어주신 후 "F1"을 눌러 "sftp" 검색 후 "sftp:config"을 선택해 주세요. 아래

dev-blackcat.tistory.com

 

먼저, 확장 탭을 클릭 후 "SFTP" 검색한 후 아래의 이미지의 확장을 설치해 주세요.

VSCODE 확장프로그램

 

새로운 폴더 혹은 기존 프로젝트 폴더를 열어주신 후 "F1"을
눌러 "sftp" 검색 후 "sftp:config"을 선택해 주세요.

VSCODE 확장프로그램

 

아래와 같이 ".vscode" 폴더가 생성되며 "sftp.json" 파일이 생성됩니다.

VSCODE 확장프로그램

 

초기 생성 시 없는 속성이 있습니다. 아래와 비교하여 추가해 주세요.

옵션 설명
uploadOnSave 저장시에 자동으로 업로드 (true/false)
igonre 업/다운로드를 제외할 파일 및 폴더 보안상 ".vscode" 폴더 안의 파일 내용에는 서버 계정의 비밀번호까지 있기 때문에 대부분 설정합니다.
{
    "name": "프로젝트 이름",
    "host": "서버 IP 주소",
    "protocol": "sftp",
    "port": 22,
    "username": "서버 계정",
    "password": "서버 비밀번호",
    "remotePath": "서버 디렉토리 루트",
    "uploadOnSave": true,
    "watcher": {
        "files": "**/*",
        "autoUpload": true,
        "autoDelete": true
    },
    "ignore": [
        "**/.vscode",
        "**/.git",
        "**/.DS_Store",
        "**/.sftp.json",
        "**/node_modules"
    ]
}

 

예제

다시 "F1"을 눌러 "sftp:Download Project"을 선택하여 프로젝트 다운로드하기

{
    "name": "TEST Project",
    "host": "01.234.567.890",
    "protocol": "sftp",
    "port": 22,
    "username": "root",
    "password": "123456",
    "remotePath": "/root/test",
    "uploadOnSave": true,
    "watcher": {
        "files": "**/*",
        "autoUpload": true,
        "autoDelete": true
    },
    "ignore": [
        "**/.vscode",
        "**/.git",
        "**/.DS_Store",
        "**/.sftp.json",
        "**/node_modules"
    ]
}
 
 
 
블로그 이미지

wtdsoul

,

https://tryhackme.com/room/winadbasics

 

TryHackMe | Active Directory Basics

This room will introduce the basic concepts and functionality provided by Active Directory.

tryhackme.com

 

슬슬 시작할때가 왔구만... 

 

Several groups are created by default in a domain that can be used to grant specific privileges to users. As an example, here are some of the most important groups in a domain:

Security Group Description
Domain Admins Users of this group have administrative privileges over the entire domain. By default, they can administer any computer on the domain, including the DCs.
Server Operators Users in this group can administer Domain Controllers. They cannot change any administrative group memberships.
Backup Operators Users in this group are allowed to access any file, ignoring their permissions. They are used to perform backups of data on computers.
Account Operators Users in this group can create or modify other accounts in the domain.
Domain Users Includes all existing user accounts in the domain.
Domain Computers Includes all existing computers in the domain.
Domain Controllers Includes all existing DCs on the domain.

You can obtain the complete list of default security groups from the Microsoft documentation.

 

블로그 이미지

wtdsoul

,