Trik ini berguna kalo Anda pengen download app/game yang ukurannya besar dari “unofficial market tool” seperti muzhiwan atau blackmart (yang udah saya test). Prinsipnya adalah dengan membelokkan request http dari device -Android- ke squid cache proxy, sehingga bisa dicek requestnya di access.log si squid.
Bahan-bahan:
- Android handset (saya pake NSFAT) yang udah terinstall aplikasi tersebut :D (muzhiwan/blackmart)
- Laptop yang udah terinstall squid (dan udah dikonfigurasi tentunya) yang akan dijadikan router/gateway
Cara memasak:
Konfigurasi laptop sebagai router dulu kemudian hubungkan NSFAT dengan laptop (melalui jaringan ad-hoc) langkah-langkahnya bisa dicek disini. Kemudian jalankan perintah tambahan untuk meredirect semua request http (port 80) yang berasal dari wifi ke local port squid (default 3128).
iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 80 -j REDIRECT --to-port 3128
jadi kalo discript sebelumnya adalah:
iptables -t nat --flush
iptables -t filter --flush
iptables --flush
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables --append FORWARD --in-interface wlan0 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
menjadi
iptables -t nat --flush
iptables -t filter --flush
iptables --flush
iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 80 -j REDIRECT --to-port 3128
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables --append FORWARD --in-interface wlan0 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
Uji coba:
1. monitor access.log dari squid; (default /var/log/squid/access.log
), dengan perintah tail -f
untuk realtime monitoring.
tail -f /var/log/squid/access.log
format output-nya kurang lebih begini:
1366616572.119 2318 192.168.10.4 TCP_MISS/200 1392 GET http://profile.ak.fbcdn.net/hprofile-ak-prn1/s32x32/624012_100000979046568_650384034_q.jpg - DIRECT/72.246.189.248 image/jpeg
1366616572.215 2283 192.168.10.4 TCP_MISS/200 1474 GET http://profile.ak.fbcdn.net/hprofile-ak-prn1/s32x32/174384_100001116881919_310459008_q.jpg - DIRECT/72.246.189.248 image/jpeg
1366616572.255 1495 192.168.10.4 TCP_MISS/200 394 GET http://www.facebook.com/ai.php? - DIRECT/69.171.229.25 text/html
1366616572.514 700 192.168.10.4 TCP_MISS/200 2537 GET http://profile.ak.fbcdn.net/hprofile-ak-ash4/274425_1234809719_1510989493_q.jpg - DIRECT/72.246.189.248 image/jpeg
1366616572.673 939 192.168.10.4 TCP_MISS/200 1371 GET http://profile.ak.fbcdn.net/hprofile-ak-ash4/s32x32/260878_100001343496028_1886186404_q.jpg - DIRECT/72.246.189.248 image/jpeg
1366616597.614 2265 192.168.10.4 TCP_MISS/200 565 POST http://www.facebook.com/ajax/bz - DIRECT/69.171.229.25 application/x-javascript
1366616601.910 41508 192.168.10.4 TCP_MISS/200 471 GET http://6-pct.channel.facebook.com/pull? - DIRECT/69.171.235.16 text/plain
1366616627.395 1968 192.168.10.4 TCP_MISS/200 565 POST http://www.facebook.com/ajax/bz - DIRECT/69.171.229.25 application/x-javascript
1366616643.129 41198 192.168.10.4 TCP_MISS/200 471 GET http://6-pct.channel.facebook.com/pull? - DIRECT/69.171.235.16 text/plain
1366617931.293 1607 10.194.73.176 TCP_MISS/200 5184 GET http://www.baidu.com/ - DIRECT/220.181.112.143 text/html
2. Sambil menjalankan perintah diatas (di laptop), kembali ke NSFAT buka muzhiwan/blackmart, kemudian pilih game yang kita ingin dapatkan link apk-nya, pilih download:
dan ketika downloadnya udah mulai jalan pilih pause/stop:
kemudian “kembali ke laptop” harusnya ada penampakan seperti ini di squid access.log :
1366618672.693 1623 10.227.11.197 TCP_MISS/200 5184 GET http://www.baidu.com/ - DIRECT/220.181.112.143 text/html
1366618673.214 1643 192.168.10.4 TCP_MISS/301 388 GET http://www.muzhiwan.com/bbs/uc_server/avatar.php? - DIRECT/114.113.149.105 text/html
1366618673.235 7 192.168.10.4 TCP_MEM_HIT/200 4353 GET http://www.muzhiwan.com/bbs/uc_server/images/noavatar_middle.gif - NONE/- image/gif
1366618674.251 3090 192.168.10.4 TCP_MISS/200 6395 GET http://pan.baidu.com/share/link? - DIRECT/202.108.23.29 text/html
1366618677.359 1511 192.168.10.4 TCP_MISS/301 388 GET http://www.muzhiwan.com/bbs/uc_server/avatar.php? - DIRECT/114.113.149.105 text/html
1366618677.382 7 192.168.10.4 TCP_MEM_HIT/200 4354 GET http://www.muzhiwan.com/bbs/uc_server/images/noavatar_middle.gif - NONE/- image/gif
1366618680.836 4138 192.168.10.4 TCP_MISS/200 270 POST http://alog.umeng.com/app_logs - DIRECT/211.151.139.211 application/json
1366618682.093 2046 192.168.10.4 TCP_MISS/301 406 GET http://www.muzhiwan.com/bbs/uc_server/avatar.php? - DIRECT/114.113.149.105 text/html
1366618692.478 18213 192.168.10.4 TCP_MISS/200 87284 GET http://down.muzhiwan.com/2011/11/28/4ed2efe930956.gpk - DIRECT/113.5.250.138 application/octet-stream
1366618692.938 10832 192.168.10.4 TCP_MISS/200 20439 GET http://www.muzhiwan.com/bbs/uc_server/data/avatar/000/19/42/01_avatar_middle.jpg - DIRECT/114.113.149.105 image/jpeg
1366618724.933 2655 192.168.10.4 TCP_MISS/200 6399 GET http://pan.baidu.com/share/link? - DIRECT/202.108.23.29 text/html
NB: kalo app yang g gede-gede amat ukurannya (tanpa data), file typenya apk, ini contoh pake blackmart: Buka blackmart, pilih app, kemudian pilih install/download:
kalo download udah jalan, pilih cancel.
Cek access.log squid di laptop, harusnya muncul penampakan seperti ini:
1366619299.501 6343 192.168.10.4 TCP_MISS/200 8198 GET http://market.b3er.org/blackmart/category/-2/0/downloads_desc/0 - DIRECT/5.9.111.111 application/json
1366619299.621 3716 192.168.10.4 TCP_MISS/200 1857 GET http://market.b3er.org/blackmart/info/com.outfit7.talkingtom - DIRECT/5.9.111.111 application/json
1366619309.423 8765 192.168.10.4 TCP_MISS/200 62983 GET http://market.b3er.org/blackmart/screenshot/com.outfit7.talkingtom.53.1.png - DIRECT/5.9.111.111 image/png
1366619310.506 9853 192.168.10.4 TCP_MISS/200 61264 GET http://market.b3er.org/blackmart/screenshot/com.outfit7.talkingtom.53.0.png - DIRECT/5.9.111.111 image/png
1366619311.026 19921 192.168.10.4 TCP_REFRESH_UNMODIFIED/200 6517 GET http://market.b3er.org/blackmart/icons/com.outfit7.talkingtom2free.21.png - DIRECT/5.9.111.111 image/png
1366619311.137 6 192.168.10.4 TCP_HIT/200 6517 GET http://market.b3er.org/blackmart/icons/com.outfit7.talkingtom2free.21.png - NONE/- image/png
1366619317.637 16519 192.168.10.4 TCP_REFRESH_UNMODIFIED/200 6517 GET http://market.b3er.org/blackmart/icons/com.outfit7.talkingtom2free.21.png - DIRECT/5.9.111.111 image/png
1366619344.545 61394 192.168.10.4 TCP_MISS/200 1435 GET http://market.b3er.org/blackmart/category/-2/0/downloads_desc/0 - DIRECT/5.9.111.111 application/json
1366619355.170 7332 192.168.10.4 TCP_MISS/206 76706 GET http://market.b3er.org/blackmart/downloads/com.outfit7.talkingtom.53.apk - DIRECT/5.9.111.111 text/plain
Tinggal copas aja link *.gpk/*.apk ke download manager kesukaan Anda, resume supported, multithread supported, dan yang paling penting NSFAT g kebakar :D
=-=-=-=-=
Powered by Blogilo