인증서 생성 시도(실패)
certbot 으로 뚝딱 만들어질 줄 알았는데 안된다!
└─$ sudo certbot certonly --webroot -w ./public -d www.nicebunker.com
[sudo] password for kali:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Enter email address (used for urgent renewal and security notices)
(Enter 'c' to cancel): nicebunker@gmail.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.3-September-21-2022.pdf. You must
agree in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let's Encrypt project and the non-profit organization that
develops Certbot? We'd like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Account registered.
Requesting a certificate for www.nicebunker.com
Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
Domain: www.nicebunker.com
Type: dns
Detail: DNS problem: NXDOMAIN looking up A for www.nicebunker.com - check that a DNS record exists for this domain; DNS problem: NXDOMAIN looking up AAAA for http://www.nicebunker.com - check that a DNS record exists for this domain
Hint: The Certificate Authority failed to download the temporary challenge files created by Certbot. Ensure that the listed domains serve their content from the provided --webroot-path/-w and that files created there can be downloaded from the internet.
Some challenges have failed.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
/etc/hosts 에 추가를 해도 ping 은 되는데 nslookup 은 안된다
https://hellominchan.tistory.com/5\
칼리리눅스(kali linux) - static 네트워크 설정
디폴트로 구성된 kali 는 자동으로 설정되어있다. host 와 guest 를 동등한 수준으로 통신하게 하기 위해 OVM 에서 브리지 방식으로 설정하고 kali 내부에서는 자동설정된 구성으로 수동으로 설정한다.
https://lopicit.tistory.com/267
SSL 인증서 생성 시도
DNS 에 대한 nslookup 이 안된다고 실패함
mkdir certbot-test
certbot-test
mkdir public
certbot certonly --webroot -w ./public -d kys.nicebunker.com
SSL 인증서 생성 시도
블로그 참고하여 interfaces 수정 시도. 그러나 실패
https://whitewing4139.tistory.com/95
vi /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.219.111
gateway 192.168.219.1
netmask 255.255.255.0
boradcast 192.168.219.255
dns-nameservers 164.124.107.9
service networking restart
auto eth0
iface eth0 inet static
address 192.168.0.196
gateway 192.168.0.1
netmask 255.255.255.0
boradcast 192.168.0.255
dns-nameservers 164.168.0.196 164.124.101.2
service networking restart
nslookup yskim.nicebunker.com (성공인가 실패인가)
DNS 설정이 필요하고 DNS 설정이 정상적으로 되어야 ssl 인증서 생성 작업 도중 문제가 해소될 것이다.
└─# more /etc/hosts
127.0.0.1 localhost
127.0.1.1 kali
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.0.1 www.nicebunker.com
192.168.0.196 kali.nicebunker.com
192.168.0.189 yskim.nicebunker.com
┌──(root㉿kali)-[~]
└─# nslookup yskim.nicebunker.com
Server: 164.124.101.2
Address: 164.124.101.2#53
** server can't find yskim.nicebunker.com: NXDOMAIN
┌──(root㉿kali)-[~]
└─# netstat -na | grep 53
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN
tcp6 0 0 :::53 :::* LISTEN
udp 0 0 0.0.0.0:53 0.0.0.0:*
udp6 0 0 :::53 :::*
unix 3 [ ] STREAM CONNECTED 17532 /run/systemd/journal/stdout
┌──(root㉿kali)-[/etc/network]
└─# systemctl restart networking
Job for networking.service failed because the control process exited with error code.
See "systemctl status networking.service" and "journalctl -xeu networking.service" for details.
/etc/hosts 파일에 yskim.nicebunker.com 을 을 강제로 등록하고 netstat -na | grep 53 명령을 통해 dnsmasq 를 통해 dns 서버가 구동중임도 확인함. 그러나 kali 의 IP 설정에 primary secondary DNS 서버가 auto로 되어 있어서 로칼에 설치된 dnsmasq 를 바라보지 않아서 lookup 이 실패하는 것임.
/etc/resolv.conf /etc/network/interfaces 를 이것저것 만지다가 boradcast 192.168.0.255 이 부분에 오타가 있다는 것을 발견하고 해결함.
┌──(root㉿kali)-[/etc/network]
└─# vi interfaces
┌──(root㉿kali)-[/etc/network]
└─# systemctl restart networking
┌──(root㉿kali)-[/etc/network]
└─# nslookup kys.nicebunker.com
Server: 164.124.101.2
Address: 164.124.101.2#53
** server can't find kys.nicebunker.com: NXDOMAIN
┌──(root㉿kali)-[/etc/network]
└─# nslookup kys.nicebunker.com
Server: 192.168.0.196
Address: 192.168.0.196#53
Name: kys.nicebunker.com
Address: 192.168.0.189
** server can't find kys.nicebunker.com : REFUSED
kys.nicebunker.com 은 실제로는 yskim.nicebunker.com 으로 테스트한 것이다. 그런데 tistory 편집모드에서 yskim. 으로 시작하는 것을 붙여넣기하면 앞에 http 가 붙으면서 이상하게 깨진다.
server can't find ... 를 보고 실패했나 싶었다. 그런데 192.168.0.196 이란 IP 는 정확히 찾은 정보다.
설정을 잘 한 것인가 문제가 있는 것인가?
kali 한글 설정하기
브라우저 열어서 www.naver.com 열어보니 한글이 깨져서 불편하다.
https://blog.naver.com/sisayseki/223026697437
sudo apt install fonts-nanum*
apt install fcitx-hangul*
apt install fcitx-lib*
im-config
im-config 를 마무리해야 한글입력이 될것 같은데 하다가 포기하고 넘어감.
그래도 인증서 생성은 실패
nslookup 이 정상 동작하는 것 같은데도 인승서 생성은 오류메시지를 토해낸다.
┌──(root㉿kali)-[~/certbot-test]
└─# nslookup kys.nicebunker.com
Server: 192.168.0.196
Address: 192.168.0.196#53
Name: kys.nicebunker.com
Address: 192.168.0.189
┌──(root㉿kali)-[~/certbot-test]
└─# certbot certonly --webroot -w ./public -d kys.nicebunker.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Requesting a certificate for kys.nicebunker.com
Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
Domain: kys.nicebunker.com
Type: dns
Detail: DNS problem: NXDOMAIN looking up A for kys.nicebunker.com - check that a DNS record exists for this domain; DNS problem: NXDOMAIN looking up AAAA for kys.nicebunker.com - check that a DNS record exists for this domain
Hint: The Certificate Authority failed to download the temporary challenge files created by Certbot. Ensure that the listed domains serve their content from the provided --webroot-path/-w and that files created there can be downloaded from the internet.
Some challenges have failed.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
┌──(root㉿kali)-[~/certbot-test]
└─# certbot certonly --webroot -w ./public -d www.naver.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Requesting a certificate for www.naver.com
Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
Domain: www.naver.com
Type: unauthorized
Detail: 104.71.220.240: Invalid response from https://www.naver.com/.well-known/acme-challenge/AAUZdA25pVRjoliVYbzQg78p2Eb2ItQKAQGU5vdOraA: 404
Hint: The Certificate Authority failed to download the temporary challenge files created by Certbot. Ensure that the listed domains serve their content from the provided --webroot-path/-w and that files created there can be downloaded from the internet.
Some challenges have failed.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
www.naver.com 은 유효한 도메인이다. 속성으로 설정한 kys.nicebunker.com 은 DNS record 체크에서 막힌다. www.naver.com 은 DNS record 체크는 통과하고 그 다음 단계에서 오류가 발생한다.
dnsmasq 를 통해 간편하게 구성된 DNS 서버를 통해서는 certbot ( 또는 letsencrypt ) 에 의한 인증서 생성이 되지 않는다.
BIND 등을 위해 정식으로 구성된 경우라도 성공한다는 보장은 없을 것 같지만 시도를 해볼까 말까?