Raspberry Pi 設定 WireGuard VPN

之前都使用 Synology 內建的 OpenVPN Server,手邊有個空的 raspberry pi 想說多用一個 VPN Server 順便玩玩 WireGuard,試用了一下不管速度、設定、串內網 DNS Server 都沒問題,應該之後會當作主要的連線方式 Raspberry Pi Setting 用官方的工具刷個 lite x64,加個 ssh 檔案方便直接啟動 SSH Server scoop install raspberry-pi-imager 一波更新 sudo apt-get update sudo apt-get dist-upgrade sudo apt-get autoremove sudo apt-get autoclean 用 raspi-config 更新一下 hostname, password + expand filesystem + time zone sudo raspi-config 更新 firmware sudo rpi-update Install PiVPN 安裝 pivpn,這邊選 WireGuard 當作 VPN Server,就填一填這邊 DNS 可以設定自訂的 IP,我有用 AdGuard Home 做內網服務的 DNS rewrites,所以就填 AdGuard 的 IP ...

April 3, 2022

Airpods Pro and WF-1000XM4

因為前陣子聖誕節抽到了 WF-1000XM4,所以分享一下跟 Airpods Pro 的比較 WF-1000XM4 因為耳塞的關係,所以在某些活動或發生降操瞬間消失的感覺 例如重訓跟打哈欠的時候,但是換個副廠的矽膠耳塞應該可以解決這問題 WF-1000XM4 帶起來滿吃耳朵輪廓的,就我而言 Airpods Pro 比較舒服 音質方面 WF-1000XM4 比較好 因為本身用 iphone 的關係系統整合程度還是 Airpods Pro 勝 有用 android 手機的,耳朵剛好帶起來也適合滿推 WF-1000XM4 的

January 14, 2022

Scoop install list

紀錄一下安裝清單,搭配 powershell 7+ scoop 是一套 windows 下的 installer,有點像是 MacOS 下的 brew 以 powershell 當做後端 也有許多 buckets 可以加入 scoop bucket add nerd-fonts scoop bucket add extras scoop bucket add sysinternals 也可以利用 線上搜尋 package 看看有沒有自己要用的 Productivity Tools firefox 95.0.2 draw.io - 畫圖好幫手 vlc 7zip anydesk teamviewer obs-studio keepassxc - 管理密碼 marktext - markdown 編輯器 snipaste - 截圖工具 megasync Command Tools sudo - 在 windows 下用管理員權限執行 curl netcat wget ag - 搜尋好工具 croc - 傳檔案好幫手 speedtest-cli - 無聊測測 file bat busybox - 多很多 linux command cloc - 計算檔案類型數量 grep less hexyl - 看看 hex upx ttyd strings neovim Security Tools gobuster yara x64dbg - debugger pe-bear sysinternals - 微軟工具包大集合 processhacker detect-it-easy process-explorer Font 字體魔人? ...

January 12, 2022

ASRock IPMI reset

因為在網路上買了一片 ASRock 的二手 server 主機板,想用 IPMI 的功能,不過密碼已經被改過了,所以上網找一下有沒有可以 reset 的方法 首先可以用個隨便 windows 開機,下載 supermicro 的工具 IPMICFG https://www.supermicro.com/SwDownload/SwSelect_Free.aspx?cat=IPMI ipmicfg -user list Maximum number of Users : 10 Count of currently enabled Users : 1 User ID | User Name | Privilege Level | Enable --------|-----------|-----------------|------- 2 | admin | Administrator | Yes ipmicfg -user setpwd 2 admin 或是回到原廠設定 ipmicfg -fd ref https://blog.kingj.net/2014/03/15/how-to/resetting-the-ipmi-password-on-the-e3c224d2i/ https://support.siliconmechanics.com/portal/en/kb/articles/resetting-the-bmc

September 5, 2020

Use TTL to unbrick router

之前刷 Router 的時候不小心把它刷爆了,變成磚,可以透過 FT232 工具把 Router 的殼拆掉,對接上面的 RS232,其中 GND, TX, RX 接到電腦可以直接下 command,也可以執行 system shell。 使用 Putty 連接 FT232 的 COM Port,至於Router板子上面的腳位可以透過 DD-WRT 或是 Open-WRT 中的 Wiki,幾乎很多路由器都有可以參考的資料。 例如:https://wiki.openwrt.org/toh/d-link/dir-300revb 接上以後會出現以下選單,手速要快一點,選擇 “2” 可以連接到電腦架設的 TFTP Server 抓取韌體並重刷。 Please choose the operation: 1: Load system code to SDRAM via TFTP. 2: Load system code then write to Flash via TFTP. 3: Boot system code via Flash (default). 4: Entr boot command line interface. 7: Load Boot Loader code then write to Flash via Serial. 9: Load Boot Loader code then write to Flash via TFTP. 電腦設定固定 ip,然後網路線連到 Router,輸入電腦 ip 與韌體的檔名就好了。 ...

August 17, 2018

How to pwnalbe

陸續更新~ website, doc and video https://ctf-wiki.github.io/ctf-wiki LiveOverflow youtube channel https://www.youtube.com/channel/UClcE-kVhqyiHCcjYwcpfj9w http://liveoverflow.com/binary_hacking/protostar/index.html Heap 手法整理 https://github.com/shellphish/how2heap 日本選手的一系列投影片 http://www.slideshare.net/bata_24/presentations 杨坤:掘金CTF ——CTF中的内存漏洞利用技巧 http://netsec.ccert.edu.cn/wp-content/uploads/2015/10/2015-1029-yangkun-Gold-Mining-CTF.pdf Modern Binary Exploitation by RPISEC http://security.cs.rpi.edu/courses/binexp-spring2015/ https://github.com/RPISEC/MBE https://raintrees.net/projects/a-painter-and-a-black-cat/wiki/CTF_Pwn inaz2 整理的 exploit 手法 http://inaz2.hatenablog.com/archive/category/Exploit?page=1 http://inaz2.hatenablog.com/archive/category/Exploit?page=2 http://j00ru.vexillium.org/blog/24_03_15/dragons_ctf.pdf https://github.com/str4tan/pwning Heap: https://github.com/cloudburst/libheap https://github.com/DhavalKapil/libdheap https://github.com/degrigis/Heapy https://github.com/shellphish/how2heap wargame and ctf https://pwnable.tw/ http://pwnable.kr/ https://bamboofox.cs.nctu.edu.tw/ http://overthewire.org/wargames/ https://w3challs.com/ https://exploit-exercises.com/nebula/ http://ctf.katsudon.org/ http://ctf.katsudon.org/ctf4u/ tools debug https://github.com/snare/voltron

January 9, 2018

一些環境

紀錄一下環境的東西,有什麼沒記錄到的之後再更新 字體 等寬字體 monaco sourcecode pro Bitstream Vera Sans Mono ubuntu mono 硬體 架了一台家裡的server,跑debian,總耗電瓦數不超過30瓦,非常省電CP值超高!!!,唯一覺得可惜的是,SATA接頭只有2個而且主機板沒有支援RAID的功能 mb:asus N3150M-E ram:8G storage:120G SSD + 1T 鍵盤 ducky one 80% 茶軸,自己換了PBT鍵帽,PBT摸起來感覺有種粉粉的感覺,也買好清理的,高度Cherry原廠鍵帽的高度,剛開始是OEM不過用個幾天就習慣了 軟體 f.lux - 飽護眼睛 飽護眼睛的,可以讓白色變得比較黃一點,看久了眼睛不會那麼吃力,字體當然是要調大一點更好 Karabiner - 鍵盤映射 <https://pqrs.org/osx/karabiner/> 可以調整osx 的映射鍵把F1-F12 換成,歌曲切換聲音調整之類的,另外我也用內建的工具把`Caps lock`換成 `ctrl`,這樣 tmux 比較好用 `Caps` + `a` 就行 parallels desktop - 虛擬機 融合模式超猛,偶爾開 IDA Pro 或是些win 的軟體 VANILLA <http://matthewpalmer.net/vanilla/> services docker - nginx - php - ubuntu for pwnable avahi-daemon (在區網中可以直接使用 hostname.local 登入) time-machine (硬碟格式需要注意一下,我是用ext4) samba 在iterm下新增多個profile,搭配command ssh [email protected] ,使用ssh-key cmd + o ,開啟視窗直接選擇要登入的主機爽度大增 ...

August 5, 2016

Return Oriented Programming

整理一下 找 getgads 工具 rp++ ROPgadget Ret2libc 當程式有打開NX的時候造成 stack 上的 shellcode 無法執行,可以利用ret2libc或是利用ROP做mprotect開一個rwx的段, 參數傳遞 x86 利用stack x86_64 利用reg Ret2libc 疊法 可以盡可能的把參數疊完整,比較不會發生一些鳥問題 一般x86的疊法是: padding + function + ret address + argv1 + argv2 + argv3 .... 一般 function 可以直接跳 .plt , ret address 是執行完以後我要去的地方,假如一般疊出 system("/bin/sh"),ret address 可以直接填空沒關係 例如 : 'A'*100 + p32(system_addr) + p32(0) + p32(binsh_addr) x64: 利用一些 pop reg 的getgads把reg設定好 x32 參數直接疊在stack上,用 pop_ret 清掉用過的參數 read @ plt pop_pop_pop_ret 0 addr length system @ plt x86_64 最大地址 0x00007fffffffffff DynELF 假如在不知道對方libc 的情況下可以使用pwntools中的一個工具DynELF,給他一個leak的點,可以幫你找出function的位置 ...

May 31, 2016

TU CTF - Where Heretics Suffer

拿到這題的時候已經是一隻binary了,這是用比較新的gcc編的,對於function call 有一些新的機制,如下: 80485cb: 8d 4c 24 04 lea ecx,[esp+0x4] 80485cf: 83 e4 f0 and esp,0xfffffff0 80485d2: ff 71 fc push DWORD PTR [ecx-0x4] 80485d5: 55 push ebp 80485d6: 89 e5 mov ebp,esp 80485d8: 51 push ecx 80485d9: 83 ec 34 sub esp,0x34 ...... 8048682: b8 00 00 00 00 mov eax,0x0 8048687: 8b 4d fc mov ecx,DWORD PTR [ebp-0x4] 804868a: c9 leave 804868b: 8d 61 fc lea esp,[ecx-0x4] 804868e: c3 ret 可以看到在初始化的時候lea ecx,[esp+0x4],會把esp得值放到ecx中 之後再把ecx放到stack上,當我們overflow以後會把原本得直也蓋掉 ...

May 21, 2016

Install qira on rpi

把install.sh裡面capstone的地方註解掉後執行 下載capstone git clone https://github.com/aquynh/capstone.git $ ./make.sh $ sudo ./make.sh install

March 16, 2016