owasp zap
openvas
測試結果後埔
helloworld
目前分類:系統管理 (418)
- Feb 25 Wed 2015 16:59
弱掃工具測試
- Feb 25 Wed 2015 11:42
slave dns zone file 亂碼??
在bind 9.9以後,slave的zone file格式預設為raw, 不再是text格式
所以無法直接檢視
如果要檢視的話,可以透過bind工具來轉換格式
example
named-compilezone -f raw -F text -o mybox.tw.zone.txt mybox.tw mybox.tw.zone
usage: named-compilezone [-djqvD] [-c class] [-f inputformat] [-F outputformat] [-t directory] [-w directory] [-k (ignore|warn|fail)] [-n (ignore|warn|fail)] [-m (ignore|warn|fail)] [-r (ignore|warn|fail)] [-i (full|full-sibling|local|local-sibling|none)] [-M (ignore|warn|fail)] [-S (ignore|warn|fail)] [-W (ignore|warn)] -o filename zonename filename
- Feb 25 Wed 2015 10:39
ntpdate error: no server suitable for synchronization found
ntp server 重開機後,會需要一段時間跟internet同步時間
這段期間如果client跟ntp server校時時會出現以下的錯誤
[root@zap ~]# ntpdate ntp.mybox.tw
25 Feb 10:27:23 ntpdate[26362]: no server suitable for synchronization found
加上 -d 參數可以看到詳細的debug內容
ntp.mybox.tw: Server dropped: strata too high
[root@zap ~]# ntpdate -d ntp.mybox.tw
25 Feb 10:30:49 ntpdate[26443]: ntpdate 4.2.2p1@1.1570-o Sat Dec 20 02:52:11 UTC 2014 (1)
Looking for host ntp.mybox.tw and service ntp
host found : ntp.mybox.tw
transmit(ntp.mybox.tw)
receive(ntp.mybox.tw)
transmit(ntp.mybox.tw)
receive(ntp.mybox.tw)
transmit(ntp.mybox.tw)
receive(ntp.mybox.tw)
transmit(ntp.mybox.tw)
receive(ntp.mybox.tw)
transmit(ntp.mybox.tw)
ntp.mybox.tw: Server dropped: strata too high
server ntp.mybox.tw, port 123
stratum 16, precision -19, leap 11, trust 000
refid [ntp.mybox.tw], delay 0.02626, dispersion 0.00002
transmitted 4, in filter 4
reference time: 00000000.00000000 Thu, Feb 7 2036 14:28:16.000
originate timestamp: d897b259.6921672c Wed, Feb 25 2015 10:30:49.410
transmit timestamp: d897b259.66759ab6 Wed, Feb 25 2015 10:30:49.400
filter delay: 0.02725 0.02666 0.02646 0.02626
0.00000 0.00000 0.00000 0.00000
filter offset: 0.010067 0.009981 0.010047 0.010051
0.000000 0.000000 0.000000 0.000000
delay 0.02626, dispersion 0.00002
offset 0.010051
25 Feb 10:30:49 ntpdate[26443]: no server suitable for synchronization found
過幾分鐘後,等ntp server同步完時間後即可正常運作
[root@zap ~]# ntpdate -d ntp.mybox.tw
25 Feb 10:33:04 ntpdate[26472]: ntpdate 4.2.2p1@1.1570-o Sat Dec 20 02:52:11 UTC 2014 (1)
Looking for host ntp.mybox.tw and service ntp
host found : ntp.mybox.tw
transmit(ntp.mybox.tw)
receive(ntp.mybox.tw)
transmit(ntp.mybox.tw)
receive(ntp.mybox.tw)
transmit(ntp.mybox.tw)
receive(ntp.mybox.tw)
transmit(ntp.mybox.tw)
receive(ntp.mybox.tw)
transmit(ntp.mybox.tw)
server ntp.mybox.tw, port 123
stratum 2, precision -19, leap 00, trust 000
refid [ntp.mybox.tw], delay 0.02618, dispersion 0.00000
transmitted 4, in filter 4
reference time: d897b2df.147be8ab Wed, Feb 25 2015 10:33:03.080
originate timestamp: d897b2e0.56b48642 Wed, Feb 25 2015 10:33:04.338
transmit timestamp: d897b2e0.537d0f1f Wed, Feb 25 2015 10:33:04.326
filter delay: 0.02733 0.02660 0.02625 0.02618
0.00000 0.00000 0.00000 0.00000
filter offset: 0.012223 0.012172 0.012194 0.012217
0.000000 0.000000 0.000000 0.000000
delay 0.02618, dispersion 0.00000
offset 0.012217
25 Feb 10:33:04 ntpdate[26472]: adjust time server ntp.mybox.tw offset 0.012217 sec
- Feb 06 Fri 2015 17:53
Linux調整時區/校時
#調整成台北時間 +0800
vi /etc/sysconfig/clock
ZONE="Asia/Taipei"
cp /usr/share/zoneinfo/Asia/Taipei /etc/localtime
#手動校時
ntpdate time.stdtime.gov.tw
#寫入bios
hwclock -w
- Jan 29 Thu 2015 17:20
Must issue a STARTTLS command first.
如果mail server是postfix,mua寄信時出現這個警告訊息
Must issue a STARTTLS command first.
Solution:
modify etc/postfix/master.cf
#smtpd_tls_security_level=encrypt
smtpd_tls_security_level=may
- Jan 15 Thu 2015 10:22
pop3如何判斷已經收到哪一封信
現在的MUA一般都會預設pop3收信時可以在server中保留幾天的信件
但,MUA又是怎麼判斷上一次已經收到哪一封,下次要從哪一封開始收咧?
pop3收信時,每一封信都會有一封單一的ID,來區別每一封信件
這個ID就叫做UIDL
以下是dovecot 2.x 的預設值
設定檔為 dovecot/conf.d/20-pop3.conf
# POP3 UIDL (unique mail identifier) format to use. You can use following
# variables, along with the variable modifiers described in
# doc/wiki/Variables.txt (e.g. %Uf for the filename in uppercase)
#
# %v - Mailbox's IMAP UIDVALIDITY
# %u - Mail's IMAP UID
# %m - MD5 sum of the mailbox headers in hex (mbox only)
# %f - filename (maildir only)
# %g - Mail's GUID
#
# If you want UIDL compatibility with other POP3 servers, use:
# UW's ipop3d : %08Xv%08Xu
# Courier : %f or %v-%u (both might be used simultaneosly)
# Cyrus (<= 2.1.3) : %u
# Cyrus (>= 2.1.4) : %v.%u
# Dovecot v0.99.x : %v.%u
# tpop3d : %Mf
#
# Note that Outlook 2003 seems to have problems with %v.%u format which was
# Dovecot's default, so if you're building a new server it would be a good
# idea to change this. %08Xu%08Xv should be pretty fail-safe.
#
#pop3_uidl_format = %08Xu%08Xv
server端可以用telnet mailserver 110 指令測試
登入後打uidl 就可以show出每一封信的uidl
驗證客戶端的收信log以thunderbird為例
可以在%appdata%\Roaming\Thunderbird\Profiles\ 下面搜尋popstate.dat 檔案
裡面就記載了,thunderbird上次的收信紀錄,下次才不會收到重複的信件
- Jan 14 Wed 2015 17:48
FreeBSD 9.x 安裝vmware-tools
1. 開啟vSphere Client
2. 選guestos , 點右鍵,Guest -> install/upgrade vmware tools
3. mkdir /mnt/cdrom ; mount_cd9660 /dev/cd0 /mnt/cdrom
4. mkdir /tmp/workdir ; cp /mnt/cdrom/vmware-freebsd-tools.tar.gz /tmp/workdir
5. cd /tmp/workdir ; tar -zxpBvf vmware-freebsd-tools.tar.gz
6. cd vmware-tools-distrib ; ./vmware-install.pl ; 如果出現對話視窗直接用預設值就好
7. 正常來說裝完會直接啟動/usr/local/lib/vmware-tools/sbin/vmtoolsd
如果沒有出現,檢查一下有沒有安裝/usr/ports/misc/compat6x/
- Jan 12 Mon 2015 15:37
apache allow/deny ip 參考 X-Forwarded-For
將原來的allow from ,修改成以下的格式
vi .htaccess
order deny,allow
deny from all
#allow from 10.1.1.100
SetEnvIF X-Forwarded-For "10.1.1.100" AllowIP
Allow from env=AllowIP
- Jan 12 Mon 2015 12:17
centos 6.x 安裝postfix + sasl + dovecot + openwebmail
postfix troubleshooting工具
postconf -n
postfix check
netstat -tap
/etc/sasl2/smtpd.conf
pwcheck_method: saslauthd
mech_list: plain login
dovecot troubleshooting
$ telnet mailserver 110
Trying mailserver...
Connected to mailserver (1.1.1.1).
Escape character is '^]'.
+OK Dovecot ready.
user ethanlee
-ERR Plaintext authentication disallowed on non-secure (SSL/TLS) connections.
-ERR Disconnected for inactivity.
Connection closed by foreign host.
solution:
vi /etc/dovecot/conf.d/10-auth.conf
#disable_plaintext_auth = yes
disable_plaintext_auth = no
/etc/init.d/dovecot restart
[安裝openwebmail]
cd /etc/yum.repos.d
wget http://repos.fedorapeople.org/repos/jkaluza/httpd24/epel-httpd24.repo
安裝套件
yum install openwebmail perl-CGI httpd
啟動httpd
/etc/init.d/httpd start
第一次執行以下指令,如果有錯誤會提醒你修改設定檔
/var/www/cgi-bin/openwebmail/openwebmail-tool.pl --init
預設登入網址為
http://ip/cgi-bin/openwebmail/openwebmail.pl
登入後,如果發現預設icon是英文的話,要改成正體中文修改以下設定檔
/var/www/cgi-bin/openwebmail/etc/openwebmail.conf
#default_iconset Cool3D.English
default_iconset Cool3D.Chinese.Traditional
- Jan 09 Fri 2015 18:35
notebook 接上hdmi螢幕後,喇叭沒聲音?
開始 -> 控制台 -> 硬體和音效 -> 聲音
把喇叭設定成預設即可
- Jan 07 Wed 2015 17:36
bash history to syslog
vi /etc/profile
PROMPT_COMMAND='history -a >(tee -a ~/.bash_history | logger -p local2.notice -t "$USER[$$]")'
vi /etc/syslog.conf
local2.notice /var/log/history.log
vi /etc/logrotate.conf
/var/log/history.log {
daily
rotate 100
}
重啟syslog
/etc/init.d/syslog restart
logrotate每天會排程執行,如果要手動執行的話
logrotate -d -f /etc/logrotate.conf
- Jan 06 Tue 2015 14:49
rsync 應用
rsync 是unix link系統間常用的檔案同步工具
用起來很方便,但相對的,資安的問題也要考量
最單純的作法當然是有防火牆的話,就讓防火牆開開心心做他想做的事
[查看server端有哪些module可供同步]
client 端
rsync -av server_ip::
可以列出遠端server提供那些module可供同步
如果server端不想讓別人知道有哪些mofule可供同步
可以在rsyncd.conf 設定
list = no
如此一來可以隱藏設定的模組
[略過不用同步的檔案]
rsync -av --exclude '特徵' server_ip::/module/ /dest/
[完整同步,如果server有把檔案移除的話,client端的檔案也一併移除]
rsync -av --delete server_ip::/module/ /dest/
- Dec 24 Wed 2014 15:08
lenovo x220i安裝msata ssd硬碟
lenovo x220i系列除了7mm的sata硬碟外,另外提供一個msata的介面可以使用,醬子就可以用msata開機,另外再裝一顆比較大容量的硬碟來放資料
可惜目前薄型硬碟最大似乎只到1TB
安裝步驟
1. 關閉notebook電源,翻到背面,移除電源線及電池
2. 卸下兩顆鍵盤螺絲
3. 翻到正面,先把鍵盤往前推,再把鍵盤拿起來,如果還是不好拿,可以找支一字起子輕輕撬起來,注意不要傷到排線
4. 翻到背面,移除五顆螺絲
5. 翻到正面,拿起觸碰版的上蓋,一樣注意不要傷到排線
6. 標註地方為msata的插槽,小心把上面的線移到旁邊並插入ssd硬碟,將剛剛撥開的線移回去
7. 最後基本上就是怎麼拆,就怎麼裝回去
PC DIY! 2月號/2017 第240期
雜誌名稱:PC DIY!
刊別:月刊
出版地區:台灣
語言:繁體中文
出版日期:2017/02/22
- Dec 24 Wed 2014 13:31
買錯apple app如何退款
- Nov 25 Tue 2014 18:46
安裝在vmware esx的win7 guest os會自動suspend
覺得很奇怪,為什麼放著就會自動suspend
原來是我自己豬頭,讓他睡著了
修改電源設定不要讓他自動睡眠即可
- Oct 30 Thu 2014 14:43
Promise SUPER TRAK raid rebuild
1. 開機時按ctrl+s進入raid bios
2. 點選disk array management
3 選擇進入有異常的raid
4. 點選physical drives in the disk array,記錄下正常的硬碟代號
如果線上是1,3,4 異常的id就是2
5 點選Start Manual Rebuild
Source Sequence Number 填入其中一個正常的硬碟id, 如1
Target Physical Drive ID 填入新裝上去的硬碟id, 這個例子應該要填2
6. Start Manual Rebuild 按enter, 開始rebuild
7. 回到主選單,點選background activity看目前rebuild的進度,建議重建完後再上線
- Oct 27 Mon 2014 13:32
在linux/unix下搜尋某些特定檔案是否包含關鍵字
- Oct 21 Tue 2014 17:50
exchange 2010 郵件自動轉寄功能
- Oct 14 Tue 2014 17:24
掛載nfs權限全部變成4294967294
拿centos 6.x來當nfs server
當nfs client 掛載起來的時候,檔案owner全部變成4294967294
網路上很多解法
/etc/default/nfs-common
NEED_IDMAPD=yes
及修改 /etc/idmapd.conf
但目前還沒試成功
偷雞解法就讓client強迫用nfsv3來掛載nfs了
mount -t nfs -o nfsvers=3 nfsserver:/export /mnt/remote
開機時自動掛載
vi /etc/fstab
nfsserver:/exports /mnt/remote nfs nfsvers=3
nfs4是個神奇的東西,有空再研究
- Sep 26 Fri 2014 18:04
讓guestos可以讀取usb儲存裝置
編輯guest 設定,點選add ...
依序新增 usb controller 及 usb device 即可