星期六, 12月 27, 2008

利用chntpw重新設定Windows 密碼

明天有一場研討會
要講綠色軟體 or Wireshark

就把之前的4GB USB Flash disk又拿出來
想說要用隨身碟來簡報
就想說要有多一些功能

前陣子有注意到有個套件
是用offline的方式來變更Windows管理帳號的密碼
但是是使用 Live CD or floppy的方式
自己沒有很喜歡, 也沒有花時間
所以今天就花一下時間看看他
順便安裝到我的OpenSuSE Flash Disk上面

套件的官網
chntpw
http://home.eunet.no/pnordahl/ntpasswd/

本來上去rpmfind.net
但是上面都是Fedora的RPM
想說就自己下載source code來玩好了

下載source code (假設下載到/root/Desktop)
http://home.eunet.no/pnordahl/ntpasswd/chntpw-source-080526.zip

#cd /root/Desktop
#unzip chntpw-source-080526.zip
#cd /root/Desktop/chntpw-080526
編譯
#make

︿︿
簡單就搞定

開始作實驗
#suse-usb:~ # fdisk -l

Disk /dev/sda: 4108 MB, 4108320768 bytes
255 heads, 63 sectors/track, 499 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x04030201

Device Boot Start End Blocks Id System
/dev/sda1 1 53 425691 82 Linux swap / Solaris
/dev/sda2 * 54 499 3582495 83 Linux

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x1fb51fb4

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 9807 78774696 7 HPFS/NTFS
/dev/sdb2 9808 60801 409609305 7 HPFS/NTFS

看到我的Windows 磁碟機在 /dev/sdb1

建立掛載目錄
#mkdir /mnt/usb

掛載起來
#mount -t ntfs-3g /dev/sdb1 /mnt/usb/

使用 chntpw -l 列出系統內的帳號資料
一般來說 SAM資料庫會在 WINDOWS/system32/config 內

# /root/Desktop/chntpw-080526/chntpw -l /mnt/usb/WINDOWS/system32/config/SAM

chntpw version 0.99.6 080526 (sixtyfour), (c) Petter N Hagen

Hive name (from header): <\SystemRoot\System32\Config\SAM>
ROOT KEY at offset: 0x001020 * Subkey indexing type is: 666c
Page at 0x7000 is not 'hbin', assuming file contains garbage at end
File size 262144 [40000] bytes, containing 6 pages (+ 1 headerpage)
Used for data: 295/21536 blocks/bytes, unused: 10/2848 blocks/bytes.


* SAM policy limits:
Failed logins before lockout is: 0
Minimum password length : 0
Password history count : 0
| RID -|---------- Username ------------| Admin? |- Lock? --|
| 01f4 | Administrator | ADMIN | |
| 01f5 | Guest | | *BLANK* |
| 03e8 | HelpAssistant | | dis/lock |
| 03f2 | ines | ADMIN | *BLANK* |
| 03ec | Max | ADMIN | |
| 03f8 | root | | *BLANK* |
| 03ea | SUPPORT_388945a0 | | dis/lock |
| 03f6 | __vmware_user__ | | |

發現Max是ADMIN權限但是有密碼
root一般使用者 密碼為空白

移除Max的密碼

#/root/Desktop/chntpw-080526/chntpw -u Max /mnt/usb/WINDOWS/system32/config/SAM
chntpw version 0.99.6 080526 (sixtyfour), (c) Petter N Hagen
Hive name (from header): <\SystemRoot\System32\Config\SAM>
ROOT KEY at offset: 0x001020 * Subkey indexing type is: 666c
Page at 0x7000 is not 'hbin', assuming file contains garbage at end
File size 262144 [40000] bytes, containing 6 pages (+ 1 headerpage)
Used for data: 295/21536 blocks/bytes, unused: 10/2848 blocks/bytes.


* SAM policy limits:
Failed logins before lockout is: 0
Minimum password length : 0
Password history count : 0
| RID -|---------- Username ------------| Admin? |- Lock? --|
| 01f4 | Administrator | ADMIN | |
| 01f5 | Guest | | *BLANK* |
| 03e8 | HelpAssistant | | dis/lock |
| 03f2 | ines | ADMIN | *BLANK* |
| 03ec | Max | ADMIN | |
| 03f8 | root | | *BLANK* |
| 03ea | SUPPORT_388945a0 | | dis/lock |
| 03f6 | __vmware_user__ | | |

---------------------> SYSKEY CHECK <-----------------------
SYSTEM SecureBoot : -1 -> Not Set (not installed, good!)
SAM Account\F : 1 -> key-in-registry
SECURITY PolSecretEncryptionKey: -1 -> Not Set (OK if this is NT4)

***************** SYSKEY IS ENABLED! **************
This installation very likely has the syskey passwordhash-obfuscator installed
It's currently in mode = -1, Unknown-mode

SYSTEM (and possibly SECURITY) hives not loaded, unable to disable syskey!
Please start the program with at least SAM & SYSTEM-hive filenames as arguments!


RID : 1004 [03ec]
Username: Max
fullname: Max
comment :
homedir :

User is member of 3 groups:
00000221 = Users (which has 5 members)
00000220 = Administrators (which has 3 members)
0000022b = Remote Desktop Users (which has 1 members)

Account bits: 0x0210 =
[ ] Disabled | [ ] Homedir req. | [ ] Passwd not req. |
[ ] Temp. duplicate | [X] Normal account | [ ] NMS account |
[ ] Domain trust ac | [ ] Wks trust act. | [ ] Srv trust act |
[X] Pwd don't expir | [ ] Auto lockout | [ ] (unknown 0x08) |
[ ] (unknown 0x10) | [ ] (unknown 0x20) | [ ] (unknown 0x40) |

Failed login count: 0, while max tries is: 0
Total login count: 48

- - - - User Edit Menu:
1 - Clear (blank) user password
2 - Edit (set new) user password (careful with this on XP or Vista)
3 - Promote user (make user an administrator)
(4 - Unlock and enable user account) [seems unlocked already]
q - Quit editing user, back to user select
Select: [q] > 1 詢問如何處理,輸入1清空密碼

接下來
Password cleared!

Hives that have changed:
# Name
0
Write hive files? (y/n) [n] : y 詢問如何處理,輸入y寫入

使用指令查詢Max的密碼是否有被清空 chntpw -l SAM
#/root/Desktop/chntpw-080526/chntpw -l /mnt/usb/WINDOWS/system32/config/SAM
chntpw version 0.99.6 080526 (sixtyfour), (c) Petter N Hagen
Hive name (from header): <\SystemRoot\System32\Config\SAM>
ROOT KEY at offset: 0x001020 * Subkey indexing type is: 666c
Page at 0x7000 is not 'hbin', assuming file contains garbage at end
File size 262144 [40000] bytes, containing 6 pages (+ 1 headerpage)
Used for data: 295/21536 blocks/bytes, unused: 10/2848 blocks/bytes.


* SAM policy limits:
Failed logins before lockout is: 0
Minimum password length : 0
Password history count : 0
| RID -|---------- Username ------------| Admin? |- Lock? --|
| 01f4 | Administrator | ADMIN | |
| 01f5 | Guest | | *BLANK* |
| 03e8 | HelpAssistant | | dis/lock |
| 03f2 | ines | ADMIN | *BLANK* |
| 03ec | Max | ADMIN | *BLANK* |
| 03f8 | root | | *BLANK* |
| 03ea | SUPPORT_388945a0 | | dis/lock |
| 03f6 | __vmware_user__ | | |


Okay~~
enjoy it

星期日, 12月 21, 2008

在Linux 下轉換 WAV格式 為 MP3

今天去購買 創見的MP3
型號 T.sonic 630

錄音效果很好
功能也很多 ^^ ~~ 覺得這個錢花的有價值

錄音出來的格式為 WAV

在Open SuSE 下預設的Banshee 似乎不能播放 WAV檔
再來是 WAV檔案的格式也比 MP3來的大
所以就想說找一下 在Linux 內轉換音樂格式的軟體

後來找到 lame這個套件

使用man文件找到的範例
linux-wg5u:/home/max/Desktop # lame -h 1221m001.wav 1221m003.mp3
LAME 3.98.2 32bits (http://www.mp3dev.org/)
CPU features: MMX (ASM used), SSE (ASM used), SSE2
Using polyphase lowpass filter, transition band: 16538 Hz - 17071 Hz
Encoding 1221m001.wav to 1221m003.mp3
Encoding as 44.1 kHz single-ch MPEG-1 Layer III (11x) 64 kbps qval=2
Frame | CPU time/estim | REAL time/estim | play/CPU | ETA
1344/1344 (100%)| 0:02/ 0:02| 0:02/ 0:02| 12.813x| 0:00
---------------------------------------------------------------------------------------------------
kbps mono % long switch short %
64.0 100.0 98.3 1.0 0.8
Writing LAME Tag...done
ReplayGain: +13.3dB

就順利的轉換為MP3 格式啦

^__^

man 內的範例如下
**************************************************************
EXAMPLES
Fixed bit rate jstereo 128kbs encoding:

lame sample.wav sample.mp3


Fixed bit rate jstereo 128 kbps encoding, highest quality (recom‐
mended):

lame -h sample.wav sample.mp3


Fixed bit rate jstereo 112 kbps encoding:

lame -b 112 sample.wav sample.mp3


To disable joint stereo encoding (slightly faster, but less quality at
bitrates <= 128 kbps):

lame -m s sample.wav sample.mp3

**************************************************************

星期四, 12月 18, 2008

Sendmail 的 dsn: host unknown 問題解決

之前sendmail 在寄信的時候出現這樣的錯誤訊息
dsn: host unknown

奇怪的是
#host -t mx 網域名稱
#host 郵件伺服器的FQDN
也都沒有問題

試了很久~~~我想也有可能是很久沒睡了
找到這篇
http://www.webmasterworld.com/forum40/767.htm

在/etc/hosts 下面把相關的 IP 及 FQDN寫進去
然後重新啟動 sendmail

就回復正常了

星期一, 12月 15, 2008

Wireshark 的 IO Graphs 功能

之前在使用Wireshark的時候, 大部分都是看封包的內容
比較少去對封包做一些分析的動作
最近在看一些Wireshark的一些影片, 所以就動手寫有關於 Wireshark的一些功能
讓自己記憶一下
以下是Wireshark 的 IO Graphs的圖片( 在statistcs --> IO Graphs) (就是把流量繪製成圖片)
使用這個功能的時候, 預設是針對所有的流量, 並繪製成黑色的線條
倘若我想比較同樣一個檔案, 但是針對兩台不同的Server 來觀察他們彼此的流量
那又該如何做呢?

在這邊我以下載 OpenSuSE 11.0 的DVD iso 來當例子
下載頁面
http://download.opensuse.org/distribution/11.0/iso/dvd/openSUSE-11.0-DVD-i386.iso?mirrorlist

在這個頁面, 我選取兩個不同的網站

一個在台灣, 一個在日本 來做測試
首先為了獲得相關資訊
我在Wireshark的 display filter 內使用 dns 的過濾條件, 來觀察台灣及日本的站台 IP位置

台灣的伺服器 IP 為 140.128.9.18
日本的伺服器 IP 為 134.160.38.1

接下來使用 IO Graphs 功能( 在statistcs --> IO Graphs)
點選 Graph 1 將所有封包所繪製而成的黑線條 "取消"
--> 接下來 在 Graph 2 的Filter 欄位條件上 輸入 ip.addr==140.128.9.18
--> 點選 Graph 2 使其出現紅色線條(顯示台灣站台的流量)
--> 接下來 在 Graph 3 的Filter 欄位條件上 輸入 ip.addr==134.160.38.1
--> 點選 Graph 3 使其出現綠色線條(顯示日本站台的流量)
結果如下圖

接下來要調整相關的資訊, 來讓這個分析更好閱讀
在左下角的 X Axis區域內(也就是X軸)
我調整了
  • Tick interval: 為 10 sec ( 就是間隔為 10秒)
  • Pixels per tick 10 (每個點要有10圖點pixel)
  • 勾選 View as time of the day ( 顯示時間)
結果如下圖

這樣以後就可以將不同的標的IP 來繪製不同的分析圖
另外可以藉由 儲存 功能, 將這個結果儲存成圖片格式
相當的方便

星期日, 12月 07, 2008

在Windows 背景顯示系統資訊

之前看Windows 上課的老師, 可以在桌面上直些顯示 系統的資訊
覺得很方便, 看到這各軟體, 就順手記一下

軟體名稱: BgInfo

功能:在Windows 背景顯示系統資訊


引用圖片 http://i.technet.microsoft.com/bb897557.BgInfo(en-us,MSDN.10).jpg



相關網頁
http://technet.microsoft.com/en-us/sysinternals/bb897557.aspx