Hacking 日記

我好像從來沒有分享過 hack 機器的經驗…
最近碰巧遇到一台機器, 有感而發來寫篇文章分享一些東西.
分享的東西不是說如何去 hack 一台機器, 而是要如何保護好自己…
喔喔 sorry, 這句話講的好像有點太偉大了,
這篇不是一個深入探討系統攻防的文章, 高手不用抱太大的期望 :)

我很少去玩 Windows 的機器, 因為我覺得 UNIX 的機器比較有挑戰性也比較有趣,
不過這次恰好遇到一台 Windows 的機器, 閒來無事看到有機可趁就把他幹掉了…

很多人都知道使用 Windows 系統要定期做 Windows Update,
要裝防毒軟體, 外加定期更新他的的病毒碼, 不要執行來路不明的程式,
要開防火牆, 要裝 SP2(?), 不要用 IE(?), 不要用 Outlook(?)…
這樣才你的系統不會沒事就被幹掉.

但是在 Internet 流行的現代, 要架設一台伺服器出來實在是太簡單了,
尤其是在 Windows 上, 就算對伺服器完全不懂的人也只要隨便抓個伺服器軟體,
一直按下一步下一步下一步, 馬上就可以建立一個對外的服務…
但是對於這種對伺服器一知半解的人, 胡亂設定一通所架設出來的東西,
往往也幫自己的系統開了一個很大的洞.
在做 network security 實務的人, 也對這樣的現象感到很頭痛.
尤其是這個現象現在在網路上真的越來越普遍.

這次舉的例子就是一個眾所皆知, 被廣泛使用的 FTP 伺服器軟體: Serv-U.
這個軟體可以讓你很容易的建立一個 FTP 伺服器, 分享軟體給其他人.

事情就發生在某天有個 FTP command packet 經過我家網路卡的洞口,
這時候我在洞口剛好看到這個 command packet 從我家門口經過,
也剛好上面寫了一組 username & password….

這邊先告訴我們一個教訓, 一般 FTP 預設所有的資訊都是不加密不編碼的.
所以重要資料要傳輸的時候請用 sftp 或用支援 SSL/TLS 的 FTP 伺服器,
所以想要架設 FTP 伺服器的人最好要考慮好自己的需求及開放的程度.

觀察也發現這個 FTP 連線的流量很大, 想說上面應該有好東西, 所以就上去看看…
GOOD! 超過 800G 的容量, 雖然說不是非常長更新, 但是東西還不少.
後來在目錄裡切來切去的時候發現居然切回 C:/ 的目錄 …

這邊又要告訴我們, 使用 FTP 伺服器的虛擬目錄功能時, 要仔細設好目錄的權限,
最好能把該 user 鎖定在 FTP 的根目錄中, 不要讓他能逛到系統的檔案區.

ok, 居然切到 C:/ 之後, 手指就不自覺得想建立一個目錄試看看,
目的在於試試看 C:/ 是不是 Read-Only…. “Premission denied.”
好險他的系統目錄是 Read-Only, 要不然這人就真的是大白痴了.
不過還是可以在系統目錄裡面逛逛看有沒有什麼好東西可以紀念一下..
就想說去看看他 FTP 伺服器的 user config file 好了,
當然就很順利的抓到 serv-u.ini , 裡面有所有的 ftp account 資訊.
好險 serv-u 裡面的 user password 是用 one-way encryption 編碼過的,
要不然他可慘了.

這邊有個例子, 在看解碼器的時候都是強調要先拿到 shadow password file.
有人就問過我, 讀不到 shadow password file 要怎麼拿去給解碼器解碼?
如果拿到 shadow password file 就代表拿到 root 權限了, 那幹麻還要解碼?
這也一個有 shadow passwd file 但是沒有完整權限的例子 (好像有點爛?)

不過對於跑解碼去解那些編碼過的 serv-u 的密碼我可一點興趣也沒有,
一來要花時間去解碼, 二來可能會解不出來, 三來解出這些密碼也沒啥用.
頂多是看看裡面有哪些 account, 大致上有什麼權限等等…
然後也注意到有些 user 是有完整的讀寫權限的, 不過我還是懶的去解那些人的密碼.
但是當我看到我正在用的這個 account 的資訊時, 發現了一個很好玩的事.
這個 account 除了 READ(讀取檔案), LIST(目錄列表) 權限之外,
居然還有 APPEND(檔案附加) 的權限 ??

APPEND 權限乍看之下並沒有太大的用途, 但是可以想想他的作用..
他可以在任何一個檔案後面附加資訊進去, 這跟 WRITE 權限已經沒有多大的分別了!
你有想到要如何利用這個權限來取得機器完整的控制權嗎?
我的作法是, 我可以新增一個 ftp account 在 serv-u.ini 裡面,
也就是新增一個 FTP 帳號, 並且給予這個 user 完整的存取權限!!
作法就是先把原本的 serv-u.ini 抓下來, 然後在後面加上一個新的 user account,
然後在利用 FTP續傳 的功能把改過的 serv-u.ini 傳上去 (使用到了 APPEND 權限),
這樣新增的 user account 就會進去了…

然後用新建的 ftp account 去登入 FTP 伺服器… Logged in !
這時候我們可以在利用 Serv-u 的特殊指令: site exec , 在 FTP 伺服器端執行任何指令.
而且執行的視窗也不會在 console 上跳出來, 這根本就是為 hacker 設計的嘛 XD
(這個 ftp account 必須具有 EXEC 權限)

不過這樣還不夠, 我們先建立一個批次檔, 傳到伺服器的硬碟上, 並且透過 serv-u 去執行他:
qprocess > process
net user > users
net config server > config.server
net config workstation > config.workstation
net statistics server > stat.server
net statistics workstation > stat.workstation
quser > quser
這些命令無聊的人可以在自己的 windows 上執行看看,
他只是列出一堆系統的資訊, 並不會造成任何損害…
好奇的人可以試試看, 執行完後會把資訊寫在一堆檔案裡面, 打開就可以看到了.

取得一些系統資訊後就要來想辦法真正控制整台電腦,
我們可以利用的是 WinXP, Win2003 之後提供的 遠端桌面 的功能,
遠端桌面對一般 user 來說是很棒的電腦遙控工具, 對 hacker 來說是一個很漂亮的大門…
想要用遠端桌面登入對方的電腦, 必須有 Windows 的 account & passwd (不是 serv-u 的),
並且該 user 要被設定成可以由遠端桌面登入 (或是該 user 屬於 Administrators 群組)

在這邊我們並不知道這台電腦的系統帳號跟密碼, 那要怎麼辦?
那還不簡單, 幫他建一個就好啦! 一樣透過 Serv-u 執行這些命令:
net user hihi 12344321 /add
net localgroup administators hihi /add
這樣我們就有一個 hihi 的 user, 密碼是 12344321
這時侯還要確認看看對方的 3389 port 有沒有打開, 現在很多人都會使用使用遠端桌面的功能,
所以大部分都是開的, 如果沒開的話就幫他把遠端桌面的服務啟動就好了…

這邊我們也學到一個東西, Windows 的 port 3389 就像 UNIX 的 port 22 一樣,
是個讓 Hacker 很方便進來的大門, 很容易讓人很方便的完全控制你的系統.
在 UNIX 底下比較嚴謹機器都會把 port 22 擋掉, 只開幾個信任的 IP 可以連接…
相同的在 Windows 底下也是一樣, 可以的話也盡量能限制能連接 port 3389 的 IP …

這時候我們使用 hihi 透過遠端桌面連接對方的電腦, 已經是能控制對方系統的極限了.
但是要注意的是, 要清除所遺留下來的 logs… 這邊就不多說了.
還有就是遠端桌面登入的時候會造成 console 的 user 被 logout (for WinXP),
所以不想被發現的話可以改用 VNC, UltraVNC, PCAnywhere 這類的東西…

時代在進步, 用來越多方便 user 使用的工具一直被發展出來, 架設伺服器的門檻也越來越低,
相對的, 讓 Hacker 能進入的縫也越來越多.
在這種網路的時代, Netowrk security 的概念是一個必學的課程…

以前曾經有個 Hacker 說過:
“如果網路掌握未來人類的生活, 那我就是未來之神”
現在網路已經快要掌握未來人類的生活了, 未來之神不知道會有幾百萬個…….
(當然啦, 我還不在裡面)

15 則留言 »

  1. kenliao Said,

    六月 14, 2005 @ 5:33 pm

    好文章:P

  2. Li-Jie Cheng’s Blog… » Blog Archive » 邪惡的牛 … Said,

    六月 15, 2005 @ 1:12 am

    […] 記加密還改了密碼 XD 這大概是他怨念太深所幹的事情吧 !! 請看”這裡“ By: Li-Jie Cheng | 06/15/05 | 電腦相關 | Trackback | Comments [RSS 2.0] […]

  3. 連小峰 Said,

    六月 15, 2005 @ 8:32 am

    quser 是幹麻用的啊?
    我的電腦沒有這個指令~~

  4. kamaze Said,

    六月 15, 2005 @ 10:31 am

    quser 似乎是遠端桌面的附屬程式,
    使用過遠端桌面後在 system32/dllcache 裡面應該可以找的到,
    (這我不是很確定)
    他是可以列出現在系統裡有誰 login, 登入時間, 閒置的時間等等….

  5. SUPER-DVD Said,

    六月 29, 2005 @ 6:45 am

    請問一下 您是用什麼軟體錄下 你用AI在跑寶石方塊時候的畫面阿 !
    因為發問在寶石方塊那裡 我怕您不會看到 所以回在這裡 請見諒 !

  6. 什麼旭 Said,

    七月 7, 2005 @ 2:27 pm

    “分享的東西不是說如何去 hack 一台機器, 而是要如何保護好自己”
    我笑啦~ XDDDD
    這是每個駭客教學的經典開宗明義哪~
    有KUSO到!! 哈哈~~~

  7. Barry Said,

    八月 4, 2005 @ 12:07 am

    老大
    看到此篇感覺您好像hack到我的FTP= =”
    尤其我又跟你同個系館同一層樓
    你該不會開了什麼帳號在我電腦裡吧>”

  8. kamaze Said,

    八月 4, 2005 @ 12:10 am

    樓上的你多心了…
    但是話說回來… 你知道我是哪個系館哪層樓的也很厲害了 :P

  9. @@ Said,

    八月 4, 2005 @ 12:55 am

    複雜…serv-u又是啥勒?

  10. Barry Said,

    八月 4, 2005 @ 1:19 am

    呵呵…看到您的指導老師就了解囉
    前陣子系館全面換裝switch
    小弟家的封包應該不會再亂晃到您老大的網卡上了吧
    看來小弟得多加強網路安全….呼

  11. kamaze Said,

    八月 4, 2005 @ 1:38 am

    哈…sorry 我應該沒有提到我指導老師是誰
    您可能誤會了 :P

    我文章裡寫的應該是 “修那個老師的課\” 而已 :)
    另外系館通通換 switch, 並不代表網路就是安全的… :P

  12. azywu Said,

    八月 4, 2005 @ 12:26 pm

    想問問對於我來說還算是高高手的前輩們
    我對網路安全也算是有點興趣
    不過就是不知道怎麼樣起頭
    本身自己的科系就不是在搞資訊工程的
    但是環境不允許 還是想多學點
    不知道能不能得到各位前輩起頭的資訊
    看看能不能夠讓我也能學到一些東西

  13. ele Said,

    九月 18, 2005 @ 3:39 pm

    Administators
    用GOOGLE搜尋為什麼會出現你的BLOG
    還是第一項阿..

  14. Paul Said,

    十月 27, 2005 @ 4:03 pm

    哈哈~ Administators 拚錯了嘛…
    按GOOGLE大神排序計算~
    LCR’S BLOG可是繁體中文網頁、台灣的網頁裡
    Administators拚錯的網頁中
    看的人最多的喔 XD

  15. doit Said,

    十月 29, 2005 @ 12:21 am

    請問一下,那遠端桌面的log在那`?我怎麼都找不到?

  16. 過路人 Said,

    三月 24, 2007 @ 1:46 pm

    請問你是從那裡下載駭客工具的??
    網上的多是沒有了主程式

  17. Freeware and Shareware Software Downloads Said,

    十月 27, 2007 @ 10:22 am

    Freeware and Shareware Software Downloads…

    I couldn’t understand some parts of this article, but it sounds interesting…

  18. Cheap and Free Computer Software Said,

    十一月 25, 2007 @ 9:53 pm

    Cheap and Free Computer Software…

    Sorry, it just sounds like a crazy idea for me :)…

  19. Robyn25Schneider Said,

    七月 6, 2010 @ 2:41 pm

    The home loans suppose to be essential for people, which are willing to organize their own business. In fact, that’s not hard to get a secured loan.

  20. credit loans Said,

    七月 7, 2010 @ 11:28 pm

    I guess that to receive the credit loans from creditors you ought to have a firm motivation. But, once I have received a credit loan, because I was willing to buy a house.

  21. Cheyenne Said,

    九月 15, 2010 @ 9:53 pm

    Thanks for such wonderful post. Every time like to read you.

  22. Eye Beauty Comparisons Said,

    十月 21, 2012 @ 4:44 pm

    Thanks for the good writeup. It if truth be told used to be a entertainment account it. Glance complicated to far brought agreeable from you! By the way, how could we be in contact?

  23. Top Penis Enhancement Pills Said,

    十月 27, 2012 @ 1:24 pm

    When I originally commented I clicked the -Notify me when new comments are added- checkbox and now each time a comment is added I get four emails with the same comment. Is there any manner you can remove me from that service? Thanks!

  24. Top Penis Enhancement Pills Said,

    十月 27, 2012 @ 1:53 pm

    Really informative and wonderful bodily structure of content material material , now that’s user friendly (:. 205511

  25. Top Penis Enlargement Devices Said,

    十一月 1, 2012 @ 11:33 pm

    Very informative post. Thanks for taking the time to share your view with us.

  26. Top Penis Enlargement Devices Said,

    十一月 1, 2012 @ 11:41 pm

    Sorry for the huge review, but I’m really loving the new Zune, and hope this, as well as the excellent reviews some other people have written, will help you decide if it’s the right choice for you.

  27. Top Penis Enhancement / Enlargement Patches Said,

    十一月 10, 2012 @ 5:07 pm

    This layout is so stellar. How did you manage to make a blog thats as smart as it is sleek? I mean, its like an Aston Martin –smart and sexy at the same time. Ive got to say, the layout alone made me come back to this blog again. But now that Ive read what youve got to say, Ive got to share it with the world! Thanks

  28. Top Penis Enhancement / Enlargement Patches Said,

    十一月 10, 2012 @ 5:08 pm

    Good luck getting people behind this one. Though you make some VERY fascinating points, youre going to have to do more than bring up a few things that may be different than what weve already heard. What are trying to say here? What do you want us to think? It seems like you cant really get behind a unique thought. Anyway, thats just my opinion.

  29. Top Penis Enhancement / Enlargement Patches Said,

    十一月 10, 2012 @ 5:08 pm

    Good luck getting people behind this one. Though you make some VERY fascinating points, youre going to have to do more than bring up a few things that may be different than what weve already heard. What are trying to say here? What do you want us to think? It seems like you cant really get behind a unique thought. Anyway, thats just my opinion. Geat

  30. Top Penis Enhancement Exercises Said,

    十一月 10, 2012 @ 5:10 pm

    I was wondering if you ever considered changing the layout of your blog? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having one or two images. Maybe you could space it out better?

  31. Top Penis Enhancement Exercises Said,

    十一月 10, 2012 @ 5:11 pm

    Wow, what a blog! I mean, you just have so much guts to go ahead and tell it like it is. Youre what blogging needs, an open minded superhero who isnt afraid to tell it like it is. This is definitely something people need to be up on. Good luck in the future, man.

  32. Human Growth Hormones Resources Said,

    十一月 24, 2012 @ 11:39 pm

    I delight in, lead to I found just what I used to be having a look for. You have ended my four day lengthy hunt! God Bless you man. Have a nice day. Bye

  33. Anti-Aging Resources Said,

    十一月 24, 2012 @ 11:45 pm

    Hello. Very cool site!! Guy .. Beautiful .. Wonderful .. I’ll bookmark your site and take the feeds also…I am satisfied to locate numerous helpful information right here within the post. Thanks for sharing..

  34. AutoResponders Review Said,

    十一月 24, 2012 @ 11:50 pm

    Hi there! This is my 1st comment here so I just wanted to give a quick shout out and say I truly enjoy reading your blog posts.

  35. Semen Enhancers Reviews Said,

    十一月 24, 2012 @ 11:55 pm

    Currently it looks like Drupal is the top blogging platform available right now. (from what I’ve read) Is that what you’re using on your blog?

  36. Female Libido Said,

    十一月 25, 2012 @ 12:09 am

    This is really interesting, You are a very skilled blogger. I have joined your feed and look forward to seeking more of your wonderful post. Also, I have shared your website in my social networks!…

  37. Pheromones Resources Said,

    十一月 25, 2012 @ 12:13 am

    Hi there! I know this is somewhat off topic but I was wondering which blog platform are you using for this website? I’m getting sick and tired of WordPress because I’ve had issues with hackers and I’m looking at options for another platform. I would be great if you could point me in the direction of a good platform.

  38. Click Here For Male Enhancement Said,

    十二月 5, 2012 @ 10:34 pm

    It’s a pity you don’t have a donate button! I’d without a doubt donate to this superb blog! I suppose for now i’ll settle for bookmarking and adding your RSS feed to my Google account. I look forward to fresh updates and will share this site with my Facebook group. Talk soon!

  39. Click Here For Male Enhancement Said,

    十二月 5, 2012 @ 10:43 pm

    Hi my loved one! I wish to say that this post is awesome, nice written and come with approximately all vital infos. I’d like to look extra posts like this .

  40. Click Here For Male Enhancement Said,

    十二月 5, 2012 @ 11:09 pm

    Nice blog here! Also your web site lots up fast! What web host are you the usage of? Can I get your associate hyperlink on your host? I want my website loaded up as fast as yours lol

  41. Click Here For Male Enhancement Said,

    十二月 5, 2012 @ 11:20 pm

    It’s perfect time to make some plans for the future and it’s time to be happy. I’ve read this post and if I could I wish to suggest you some interesting things or suggestions. Perhaps you can write next articles referring to this article. I desire to read more things about it!

  42. View The Website Said,

    三月 2, 2013 @ 2:02 am

    interesting blog, i really learnt a lot from you… i got to know a lot ways of eating healthy from your blog..

  43. View The Website Said,

    三月 2, 2013 @ 2:10 am

    I couldn’t understand some parts of this article, but it sounds interesting…

  44. View The Website Said,

    三月 2, 2013 @ 2:17 am

    I must say, youve got one of the best blogs Ive seen in a long time. What I wouldnt give to be able to create a blog thats as interesting as this. I guess Ill just have to keep reading yours and hope that one day I can write on a subject with as much knowledge as youve got on this one!

  45. View The Website Said,

    三月 2, 2013 @ 2:25 am

    I’m still learning from you, as I’m improving myself. I certainly love reading all that is posted on your blog.Keep the tips coming. I loved it!

  46. View The Website Said,

    三月 2, 2013 @ 2:38 am

    I’m still learning from you, as I’m improving myself. I certainly love reading all that is posted on your blog.Keep the tips coming. I loved it! Great

  47. View The Website Said,

    三月 2, 2013 @ 2:38 am

    like it! I like it a lot. You know exactly what youre talking about, exactly where other people are coming from on this issue. Im glad that I had the fortune to stumble across your blog. Its definitely an important issue that not enough people are talking about and Im glad that I got the chance to see all the angles.

  48. http://www.bestpenisstretcher.info/ Said,

    九月 8, 2013 @ 10:43 pm

    Thank you so much for providing individuals with a very brilliant chance to check tips from this blog. It is often so cool and packed with a good time for me and my office peers to visit your web site at the very least thrice in one week to see the latest items you have. Of course, we are certainly impressed with all the stunning secrets served by you. Some 4 facts in this article are absolutely the finest we’ve had.

  49. http://www.penisenlargement-device.info/ Said,

    九月 8, 2013 @ 11:00 pm

    Congratulations for making to the summit. I bet this such a wonderful feeling to all the participants, specially to you guys. With all the effort and sweats you have shed…thanks for the share.

  50. http://www.toppenisenlargementmethods.com/ Said,

    九月 8, 2013 @ 11:16 pm

    Excellent blog here! Also your site loads up very fast! What web host are you using? Can I get your affiliate link to your host? I wish my website loaded up as quickly as yours lol

  51. http://www.bestpedevices.com/ Said,

    九月 8, 2013 @ 11:38 pm

    Thank you so much for providing individuals with a very brilliant chance to check tips from this blog. It is often so cool and packed with a good time for me and my office peers to visit your web site at the very least thrice in one week to see the latest items you have. Of course, we are certainly impressed with all the stunning secrets served by you. Some 4 facts in this article are absolutely the finest we’ve had. Great site!

  52. http://www.bestpedevices.com/ Said,

    九月 8, 2013 @ 11:59 pm

    Thank you so much for providing individuals with a very brilliant chance to check tips from this blog. It is often so cool and packed with a good time for me and my office peers to visit your web site at the very least thrice in one week to see the latest items you have. Of course, we are certainly impressed with all the stunning secrets served by you. Some 4 facts in this article are absolutely the finest we’ve had. Great site! Great

  53. Exercises Said,

    九月 26, 2013 @ 3:48 pm

    It’s a good quality summary that you have written. There are a number of points however which I believe would do better if you went into a little bit further detail than you have done. just my opinion, and I’m not trying to be critical at all. If you do follow this up then I would be interested. Thanks a lot!

  54. Exercises Said,

    九月 26, 2013 @ 4:01 pm

    This website has some very helpful info on it! Cheers for helping me. Great content!

  55. Exercises Said,

    九月 26, 2013 @ 4:19 pm

    I’m so glad I found this blog, I couldn’t discover any info on this subject before. No doubt that your blog gives valuable information for visitors. Definitely your ideas are helpful and inspiring for work.

  56. SizeGenetics Review Said,

    十月 3, 2013 @ 11:03 pm

    I simply want to mention I am just very new to blogging and site-building and seriously loved you’re web site. Probably I’m planning to bookmark your website . You surely come with beneficial well written articles. Thanks a bunch for sharing your web page. Well done!

  57. SizeGenetics Review Said,

    十月 3, 2013 @ 11:11 pm

    Thanks for another excellent post. Where else could anybody get that kind of info in such an ideal way of writing? I’ve a presentation next week, and I’m on the look for such info. Great content!

  58. SizeGenetics Review Said,

    十月 3, 2013 @ 11:24 pm

    Its like you read my mind! You seem to know so much about this, like you wrote the book in it or something. I think that you could do with a few pics to drive the message home a bit, but other than that, this is excellent blog. An excellent read. I’ll certainly be back. Thanks a lot for sharing with us!

  59. www Said,

    十月 11, 2013 @ 1:08 am

    This is the perfect blog for anyone who wants to know about this topic. You know so much its almost hard to argue with you (not that I really would want…HaHa). You definitely put a new spin on a subject thats been written about for years. Great stuff, just great!

  60. www Said,

    十月 11, 2013 @ 1:18 am

    I’m so glad I found this blog, I couldn’t discover any info on this subject before. No doubt that your blog gives valuable information for visitors. Definitely your ideas are helpful and inspiring for work. Thanks!

  61. www Said,

    十月 11, 2013 @ 2:43 am

    This is the perfect blog for anyone who wants to know about this topic. You know so much its almost hard to argue with you (not that I really would want…HaHa). You definitely put a new spin on a subject thats been written about for years. Great stuff, just great! Great

RSS feed for comments on this post · TrackBack 引用通告網址URI

Leave a Comment