# Linux基礎指令(1) > **ls** - 命令列出目前目錄中的檔案和目錄 ![image](https://hackmd.io/_uploads/HyDFClMPT.png) > **uname** 和 **lsb_release** 命令來檢視系統資訊 * uname -a # 顯示核心和系統資訊 * lsb_release -a # 顯示發行版資訊 ![image](https://hackmd.io/_uploads/SkHAAgfDp.png) ![image](https://hackmd.io/_uploads/Bk9MyWfva.png) > **sudo** 提升權限,以執行需要超級使用者權限的指令 > ![image](https://hackmd.io/_uploads/BysBybfwp.png) > **sudo apt-get update** 更新套件資訊 ![image](https://hackmd.io/_uploads/H1eL5kWfw6.png) > **sudo apt-get upgrade** 升級已安裝的套件 ![image](https://hackmd.io/_uploads/Byop1ZzPa.png) > **ifconfig** 命令顯示和設定網路介面 ![image](https://hackmd.io/_uploads/BJH1ebfPT.png) > **route** 查看系統的路由表 > ![image](https://hackmd.io/_uploads/rywlebGP6.png) > **pwd** 顯示目前所在位置 > > ![image](https://hackmd.io/_uploads/rkDsgZzwp.png) > **ctrl+alt** 可切換至本機滑鼠 --- * **txt**文檔 > **sudo apt install vim** 安裝vim指令 > 可用 **vim** + 資料夾名稱來新增 **txt** 檔 > ![image](https://hackmd.io/_uploads/BJBRfWfPp.png) > 按**i**可健行編輯 >利用來**wq!**退出 ![image](https://hackmd.io/_uploads/ByB-XWMw6.png) # Linux基礎指令(2) > **uname** 可用來顯示作業系統的資訊 > **-a** 表all ![image](https://hackmd.io/_uploads/H1kcT5Ud6.png) ``` sudo apt install neofetch 監控系統情況 按q可跳出 ``` *打**neofetch**,下圖為安裝好的樣子 ![image](https://hackmd.io/_uploads/SJQCCqIO6.png) > **htop**可以安裝與顯示系統狀態即時監控指令工具 > **sudo apt install htop** ![image](https://hackmd.io/_uploads/HJjJEjL_6.png) 打**htop**可顯示系統狀態即時監控指令工具 ![image](https://hackmd.io/_uploads/B155NoLOp.png) **sudo apt-get update** 檢查有沒有可以更新的 **sudo apt upgrade** 如可會直接更新 **sudo apt autoremove** 刪除多餘檔案 **sudo ufw enable** 啟用防火牆 (ufw為防火牆縮寫) ![image](https://hackmd.io/_uploads/HyDoboLOp.png) **sudo ufw status** 防火牆狀態 ![image](https://hackmd.io/_uploads/BJ6Abs8uT.png) # nmap * **nmap** ![image](https://hackmd.io/_uploads/HkE8d0w_a.png) 可掃描對方主計是否開機 * 上網蒐**web check**(只要把網址貼上去就會幫忙掃了!) # 靶機安裝與基礎運用 **df -kh** 查看目前應用空間的使用情況 ![image](https://hackmd.io/_uploads/BJWASiL_6.png) **sudo su**為超級使用者的狀態 輸入 **gedit /etc/fstab**(記得空格) ![image](https://hackmd.io/_uploads/HybAUoUua.png) 文字文件的最後一行加上 **vmhgfs-fuse /mnt/hgfs fuse defaults,allow_other 0 0** ``` vmhgfs 虛擬機資料夾共用的指令 /mnt/hgfs 掛載的路徑 allow 允許使用者使用 0 0 系統值(順序) ``` ![image](https://hackmd.io/_uploads/ByGows8_T.png) 按右上角save 可照剛剛設的路徑查詢 ![image](https://hackmd.io/_uploads/S1auqjIda.png) # Metasploitable2靶機 > 靶機帳號密碼皆為 **msfadmin** ![image](https://hackmd.io/_uploads/S1W62iUO6.png) **ifconfig** 得知自己的ip ![image](https://hackmd.io/_uploads/rJifTiIdp.png) 打開kali的firefox,輸自己的ip位置 ![image](https://hackmd.io/_uploads/rJ1T6oU_p.png) 按**DVWA**(上傳或下載的地方) 帳號 : **admin** 密碼 : **password** ![image](https://hackmd.io/_uploads/SJYSAiUdp.png) high調成low ![image](https://hackmd.io/_uploads/HJ4jm38uT.png) # 滲透測試 kali上輸入**ifconfig** ![image](https://hackmd.io/_uploads/Sk565AvOT.png) 再powershell裡打自己的IP ![image](https://hackmd.io/_uploads/Sy_NoCvdT.png) 成功! ## nmap(GUI) 搜尋欄打上我自己kali的IP後按scan(自己主機連到虛擬機的電腦) ![image](https://hackmd.io/_uploads/B1_xBy_u6.png) # Wireshark 掃描抓封包 ## 抓封包 先搜尋**wireshark** ![image](https://hackmd.io/_uploads/rknaqp8ua.png) 點**eth0** ![image](https://hackmd.io/_uploads/SJl4o6LO6.png) 開完後再搜尋nmap(可以掃描有多少個破口是開的跟鎖住的) ![image](https://hackmd.io/_uploads/SkKtopIOT.png) **ifconfig** 得知自己的ip為192.168.200.130 ![image](https://hackmd.io/_uploads/rJifTiIdp.png) 回nmap的command line裡打**sudo nmap 192.168.200.130** nmap會開始掃描靶機 帶有[RST, ACK]皆為鎖住的 ![image](https://hackmd.io/_uploads/H15RhT8_T.png) 灰色[SYN]皆為好攻入的破口 ![image](https://hackmd.io/_uploads/rJf46TLua.png) --- ## **操作** 1. 按紅色暫停,關掉後再次搜尋**wireshark**進入 2. 一樣選擇**eth0** 3. 去firefox搜自己ip(**192.168.200.130**) 1. 進入到metasploitable2 2. ![image](https://hackmd.io/_uploads/H14oRaL_T.png) 1. 進DVWA 2. ![image](https://hackmd.io/_uploads/rkJyy0L_6.png) 1. 搜尋**Http**找**dvwa**有**login**的那一列 2. ![image](https://hackmd.io/_uploads/BJ7aJAU_T.png) 1. 找不到有關帳號密碼的資訊,因為DVWA的安全層級為HIGH 調成**Low**再重新登入,就可以找到了 1. 找**POST**開頭的封包 2. ![Screenshot 2024-01-06 210804](https://hackmd.io/_uploads/S1AV-A8dT.png) 3. 再找user name,按進去就會顯示在上面了! 5. ![image](https://hackmd.io/_uploads/BJwfb0UO6.png) --- 淡江網站拿來試試看 **ftp ftp.tku.edu.tw** ![image](https://hackmd.io/_uploads/rkTqGCUuT.png) 搜尋ftp ![image](https://hackmd.io/_uploads/HkvDXALua.png) --- ## Rockyou **cd /usr/share/wordlists** 進入這個位置 **ll** 看資料夾裡面有什麼檔案 **rockyou.txt** 收集了目前網路上被破解的密碼 ![image](https://hackmd.io/_uploads/ryFhLCUOa.png) **rockyou.txt.gz** 解壓縮檔案 **ls** 顯示內容 **more rockyou.txt** 顯示目前最常用或被破解過的密碼 ![image](https://hackmd.io/_uploads/Hk1vPCIdT.png) ![image](https://hackmd.io/_uploads/Hy0dvC8Op.png) # Ettercap找使用者名稱+密碼 搜**ettercap**(密碼為**kali**) ![image](https://hackmd.io/_uploads/S1L6O08_p.png) 不用動任何東東,直接右上角打勾 ![image](https://hackmd.io/_uploads/SkPuK0Ldp.png) 之後按進**hostlist** ![image](https://hackmd.io/_uploads/r1fTK0I_p.png) 可以看到電腦周邊的位置狀態 ![image](https://hackmd.io/_uploads/Sk8zc0Iua.png) 按**Scan for host** 可查看同一路由器下的設備 ![image](https://hackmd.io/_uploads/BkQt9RL_p.png) 在瀏覽器網址區打 **inurl:http login** 查某家公司的登入畫面 ![image](https://hackmd.io/_uploads/rysdj08Oa.png) **右上角三個點點 -> View -> Connections** **login test** 左邊帳號**admin** 密碼**password** ![image](https://hackmd.io/_uploads/HkGehRUO6.png) 找**80**端口的(找了第三個80才找到帳密) ![image](https://hackmd.io/_uploads/BJ5u6R8_p.png) 找到了液 ![image](https://hackmd.io/_uploads/rkj260Id6.png) --- **sudo apt install driftnet**(更高級的攻擊手法,同router可以看到別人畫面很恐怖) 更新Kali **sudo apt update** **sudo apt full-upgrade -y** # Setoolkit釣魚網站 * 輸入 **git clone https://github.com/trustedsec/social-engineer-toolkit/ setoolkit** * **cd setoolkit** * **pip3 install -r requirements.txt** (紅紅的error是對的) ![image](https://hackmd.io/_uploads/Sky9WJwdp.png) * **sudo apt-get update && sudo apt-get install python-pip** ![image](https://hackmd.io/_uploads/BkpEzJP_T.png) 重開terminal 打**sudo setoolkit**(setoolkit為社交工程軟體名稱) ![image](https://hackmd.io/_uploads/SkOTMyvuT.png) 1. 先選**1** ![image](https://hackmd.io/_uploads/HJeFTmJDup.png) 3. 再選**2** ![image](https://hackmd.io/_uploads/H1kkNJDup.png) 5. 再選**3** ![image](https://hackmd.io/_uploads/HJG37kPda.png) 1. 再選**2** ![image](https://hackmd.io/_uploads/S1_mVJvua.png) 1. 直接**按enter** ![image](https://hackmd.io/_uploads/H1QdVyPup.png) 1. 輸入你要違造假網站的網址,拿ICLASS當例子 ![image](https://hackmd.io/_uploads/HkHWH1PuT.png) 1. 複製完網址後貼上 ![image](https://hackmd.io/_uploads/BJWDHkv_T.png) 1. 再來輸入我自己的ip位置貼到firefox上面 ![image](https://hackmd.io/_uploads/Hybk8JD_a.png) ![image](https://hackmd.io/_uploads/rJmzU1P_T.png) 會在自己這裡顯示我剛在假的網站輸入的帳號跟密碼 ![image](https://hackmd.io/_uploads/r1fYIyvO6.png) # Zphisher釣魚網站 社交工程模擬 - 釣魚網站工具 ## Zphisher 1. 上firefox搜尋Zphisher 2. 複製左邊到terminal貼上,安裝完成會顯示done ![image](https://hackmd.io/_uploads/Sy6KwiVPp.png) 3. $ cd zphisher $ bash zphisher.sh 4. 按25![image](https://hackmd.io/_uploads/SJvUOsEvp.png) 5. 按2和N![image](https://hackmd.io/_uploads/SJ36ujVDT.png) 6. N ![image](https://hackmd.io/_uploads/H18XKjVDp.png) 7. 選url 1進去(按右鍵-copy selection)!![image](https://hackmd.io/_uploads/HJ1SssVDa.png) 8. 帳號密碼隨便打![image](https://hackmd.io/_uploads/H175so4wa.png) 9. 如何獲取使用者密碼呢? 11. 這樣就能獲取剛剛在yahoo書的帳密!! ![image](https://hackmd.io/_uploads/Sy-2XpPd6.png) --- ## Gophish 1. 上網搜尋Gophish 2. 選64位元的下載![image](https://hackmd.io/_uploads/HydiehNvT.png) 3. 對資料夾按右鍵選第一個再按Extract![image](https://hackmd.io/_uploads/HJIVb2NDp.png) 4. properties ![Screenshot 2023-12-24 031435](https://hackmd.io/_uploads/rklT-3Ewa.png) 6. ![image](https://hackmd.io/_uploads/H1lZXnEDT.png) 6. ![image](https://hackmd.io/_uploads/S160z2EPp.png) 7. ![image](https://hackmd.io/_uploads/SyxHQhNwa.png) 8. 帳admin 密msfadmin(已改)![Screenshot 2023-12-24 032434](https://hackmd.io/_uploads/BJ4MV3EwT.png) 9. ![image](https://hackmd.io/_uploads/B1jyHnEwp.png) --- ## Docker安裝 1. 官網下64位元 2. powershell打 wsl --install 3. ![image](https://hackmd.io/_uploads/HJBZUwHv6.png) 4. wsl --update 5. wsl --install -d Ubuntu-22.04 6. ![image](https://hackmd.io/_uploads/S1GHUvBDa.png) 7. 安裝完成!! --- ## 在Docker上用Zphisher 先在本機CMD輸入指令 **docker pull htrtech/zphisher** ![image](https://hackmd.io/_uploads/HJ8et1dup.png) ![image](https://hackmd.io/_uploads/SJI_Ky_ua.png) 會跑出跟Kali跑Zphisher一樣的畫面!! ![image](https://hackmd.io/_uploads/B1YsKyd_p.png) 也可以在CMD 輸 **docker run --rm -ti htrtech/zphisher**