Wget ile bir dosyanın rename edilerek indirilmesi

wget http://ugurengin.com/wordpress-firewall.tar.gz –output-document=wpfw.tar.gz
–2011-12-06 00:26:30–  http://ugurengin.com/wordpress-firewall.tar.gz
Resolving ugurengin.com… 46.20.150.57
Connecting to ugurengin.com|46.20.150.57|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 6983 (6.8K) [application/x-gzip]
Saving to: `wpfw.tar.gz’

100%[======================================>] 6,983       –.-K/s   in 0.02s

2011-12-06 00:26:30 (413 KB/s) – `wpfw.tar.gz‘ saved [6983/6983]

Share on Facebook

BIND üzerinde ACL Kuralları Oluşturmak

named.conf isimli dosya açılarak options içerisine aşağıdaki şekilde bir acl tanımı yapılır.

blackhole { blacklist; };

Örnek:

options {
           blackhole { blacklist; };

                      };

Sonrasında, named.conf içerisinde boş olan herhangi bir alana dns sunucu’nun cevap vermesini istemediğiniz network adresleri girilir.

acl blacklist
{
#black networks
81.8.*.*/24;

};

Test etmek için Bind servisini reload edip, kısıtlama yapılan network üzerinden ilgili dns sunucuya bir A kaydı requesti yapalım.
service named reload

81.8.*.*/24 nolu network üzerinden yapılan dns kontrolü.

[root@base04 ~]# dig A sitename.com.tr @ns1.dnsserver.com

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5 <<>> A sitename.com.tr @ns1.dnsserver.com
;; global options:  printcmd
;; connection timed out; no servers could be reached

Hedef network’un paket gönderdiği esnada dns sunucu üzerinde tcpdump ile yakalanan paket aşağıda incelenebilir.Bu kısımda sadece bir A kaydı isteğinin  dns sunucuya geldiği, erişimin ise  dns sunucu üzerinde kısıtlandığı için ilgili network’e doğru herhangi bir paket dönmediği gözlemlenmiştir.

[root@ns1 etc]# tcpdump -ttnnn -i eth0 port 53
1322493943.363610 IP 81.8.*.*.46779 > 46.20.*.*.53:  5199+ A? sitename.com.tr. (32)
Share on Facebook

Dig ile TTL Süresini Tespit Etmek

dig +noquestion +nostats +noadditional +answer ugurengin.com @ns25.domaincontrol.com | awk '{print $2} '

<<>>
global
Got
->>HEADER<<-
flags:

ANSWER
3600

AUTHORITY
3600
3600

Share on Facebook

Shell Debugging Özelliği ile Error Tracking

bash -n logsign2.sh
logsign2.sh: line 68: unexpected EOF while looking for matching ``'
logsign2.sh: line 105: syntax error: unexpected end of file
Share on Facebook

Heap Address Space Protection

Unutma.
Kaynak: SANS

it is created one of the earlier security patches for the Linux kernel
that addressed the problems created by an executable user stack area. This feature
prevents attacks where a buffer overflow overwrites return pointers allowing an attacker
to execute arbitrary code inserted into the stack. “This patch also changes the default
address that shared libraries are mmap()’ed at to make it always contain a zero byte.
This makes it impossible to specify any more data (parameters to the function, or more
copies of the return address when filling with a pattern), — in many exploits that have to
do with ASCIIZ strings.”(7) While an excellent strategy in buffer overflow prevention,
this system only provides protection against these specific types of buffer overflows.
These features are also only available for Linux kernels running on i386 architectures.
Other (architecture independent) security enhancements provided by the x.

 

Share on Facebook

Corrupted MySQL MyISAM Tables

“Table ‘table_name’ is marked as crashed and should be repaired ….” şeklinde bir uyarı mesajı alıyor ve veritabanı engine olarak myisam kullanıyorsanız corrupt olmuş tablo/tabloları düzeltmek için myisamchk kullanabilirsiniz.Problemli tablo veya mevcut veritabanı içerisindeki diğer tabloların boyutu büyükse, checking ve reparing işlemi biraz uzayabilir.Bu durumda, eğer operating sistem üzerinde yeterli memory varsa mysql’in buffer parametlerini kullanarak komutun daha hızlı çalışmasını sağlayabilirsiniz.

532MB genişliğinde olan hedef  bir tablo’nun check ve repair edilmesi:

myisamchk -c -i -v -s -f -U oz_stats_counter.MYI  --key_buffer_size=512M --sort_buffer_size=512M \
 --read_buffer_size=8M --write_buffer_size=6M \ oz_stats_counter.MYI

Checking MyISAM file: oz_stats_counter.MYI
myisamchk: MyISAM file oz_stats_counter.MYI
myisamchk: warning: Table is marked as crashed
No recordlinks
block_size 1024:
myisamchk: error: Key in wrong position at page 539734016
  - Searching for keys, allocating buffer for 16576362 keys
  - Dumping 16576360 key
Komut seçenekleri hakkında detaylı bilgi:
myisamchk --help
Share on Facebook

MySQL MyISAM Engine Table Check

MyISAM engine yapısına sahip tablolar hakkında “myisamchk” ile detaylı bilgi almak mümkün.

myisamchk -dv oz_users.MYI

MyISAM file:         oz_users.MYI
Record format:       Packed
Character set:       latin1_swedish_ci (8)
File-version:        1
Creation time:       2011-04-16 11:52:43
Status:              open,changed
Auto increment key:              1  Last value:                102307
Data records:                98296  Deleted blocks:                 0
Datafile parts:              98524  Deleted data:                   0
Datafile pointer (bytes):        6  Keyfile pointer (bytes):        6
Datafile length:          22651516  Keyfile length:           7384064
Max datafile length: 281474976710654  Max keyfile length: 288230376151710719
Recordlength:                  948

table description:
Key Start Len Index   Type                     Rec/key         Root  Blocksize
1   1     4   unique  unsigned long                  1       300032       1024
2   1     4   unique  unsigned long prefix           0      7077888       1024
    843   100         varchar                        1

Share on Facebook