other ssl issue with my own ca
by Emre Tugriceri on Mar.18, 2009, under Security
/root/tugriceri.com_CA/ca/
cat ca.conf
[ ca ]
default_ca = ca_default
[ ca_default ]
dir = /root/tugriceri.com_CA/ca/
certs = /root/tugriceri.com_CA/ca/
new_certs_dir = /root/tugriceri.com_CA/ca/ca.db.certs
database = /root/tugriceri.com_CA/ca/ca.db.index
serial = /root/tugriceri.com_CA/ca/ca.db.serial
RANDFILE = /root/tugriceri.com_CA/ca/ca.db.rand
certificate = /root/tugriceri.com_CA/ca/ca.crt
private_key = /root/tugriceri.com_CA/ca/ca.key
default_days = 365
default_crl_days = 30
default_md = md5
preserve = no
policy = generic_policy
[ generic_policy ]
countryName = optional
stateOrProvinceName = optional
localityName = optional
organizationName = optional
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
openssl ca -config ca.conf -notext -out one.tugriceri.com/one.tugriceri.com.cer -infiles one.tugriceri.com/one.tugriceri.com.csr
openssl x509 -req -days 365 -in one.tugriceri.com/one.tugriceri.com.csr -CA ca/ca.crt -CAkey ca/ca.key -CAcreateserial -out one.tugriceri.com/one.tugriceri.com.cer
openssl verify -CAfile ../ca/ca.crt one.tugriceri.com.cer

Snoop with ssg
by Emre Tugriceri on Feb.11, 2009, under Firewalls
SSGW-> snoop filter ip src-ip 192.168.1.2 dst-ip 192.168.5.6
snoop filter added
SSGW-> snoop
Start Snoop, type ESC or ‘snoop off’ to stop, continue? [y]/n y
SSGW->
SSGW-> clear dbuf
SSGW-> get dbuf stream
…
SSGW-> snoop off
pfx to key
by Emre Tugriceri on Feb.03, 2009, under Security
openssl pkcs12 -export -in my.pem -nodes -out my.pfx
openssl pkcs12 -in my.pfx -out my-nodes.key -nodes -nocerts
fast “show run”
by cagri on Jan.13, 2009, under Cisco, Network
conf#parser config cache interface
#show run
in privelege mode, type “term len 0″
“show run” or “show start” will be faster
“show run brief“
Cisco SSH Configuration
by cagri on Jan.12, 2009, under Cisco, Network, Security
conf# username cagri privilege 15 secret cisco
“creates a user in local database with privelege level 15 and encrypted password cisco”
conf#ip domain-name tugriceri.com
“sets a domain name for the device”
conf#crypto key generate rsa
“creates a rsa key. in the next step encryption bits will be asked. default is 512. 1024 is better”
conf#ip ssh version 2
“change the version of ssh to 2”
conf#line vty 0 4
“go under the virtual teletype ports”
conf-line#transport input ssh
“and change the login type from telnet to ssh”
conf-line#login local
“device will look at the local user database to log in a user”
Rsync Backup (with daemon option)
by Emre Tugriceri on Dec.12, 2008, under Backup
[root@srv ~]#vi /etc/xinetd.d/rsync “and change disable = yes to disable = no”
[root@srv ~]#service xinetd restart
[root@srv ~]#cat /etc/rsyncd.conf
[GFS]
path = /wwwroot/
comment = Webroot
auth users = rsync
secrets file = /etc/rsync.secrets
read only = false
list = yes
write only = false
[root@srv ~]# cat /etc/rsync.secrets
rsync:deneme
[root@backupsrv ~]# rsync -av rsync@192.168.1.1::GFS /backup/
ssh Tunnel
by Emre Tugriceri on Dec.07, 2008, under Security
shell# ssh -f root@192.168.2.54 -L 7200:192.168.2.54:7200 -N
PRI Pinout
by Emre Tugriceri on Nov.21, 2008, under Uncategorized
MB-M-YB-T-TB-Y-KB-K
TB-T-YB-M-MB-Y-KB-K
check: no loaded plugin implements ‘check_main’:
by Emre Tugriceri on Oct.04, 2008, under Spam
<i>check: no loaded plugin implements 'check_main': cannot scan! at</i><i> /usr/lib/perl5/site_perl/5.8.8/Mail/SpamAssassin/PerMsgStatus.pm line</i><i> 164.<br /><br />vi init.pre<br /></i>loadplugin Mail::SpamAssassin::Plugin::Check<br />
Bir Asa log u
by Emre Tugriceri on Oct.04, 2008, under Firewalls, Security
Routing failed to locate next hop for icmp from outside…
Net1 de olması gereken bir host yada network net2 de tanımlanmış ise bu log ile karşılaşılır. Host u fln silip doğru yerde tanımlarını yapmak lazım.
Cisco Asa ssh enable
by Emre Tugriceri on Oct.03, 2008, under Firewalls, Security
username emre password pas priv 15
aaa authentication ssh console LOCAL
ssh x.x.x.x x.x.x.x external
frontend problemi skystar2 ve fedora
by Emre Tugriceri on Oct.03, 2008, under DVB
scanning Turksat-42E
using ‘/dev/dvb/adapter0/frontend0’ and ‘/dev/dvb/adapter0/demux0’
main:1882: FATAL: failed to open ‘/dev/dvb/adapter0/frontend0’: 6 No such device or address
Bu hata beni çıldırtmıştı. Çok uğraştırdı. Aslında sistemde linuxtv-dvb kurulu değil ve kaynaktan derliyorsanız
/usr/local/linuxtv-dvb-1.1.1/MAKEDEV-DVB.sh
bu script in çalıştıtılmaması buna neden olabilir.
Lakin benim sistemim şu anda FC9 ve bu hatayı aliyorum. (dvb-apps-1.1.1-11.fc9.i386 paketi kurulu)
FC9 ve 2.6.25.9-76.fc9.i686 ile skystar in driver lari gelmesine rağmen bu driver lar eski sürüm kartlar için. Uygun driver larin technisat tan çekilip mevcut kernel için derlenmesi lazım.
http://www.technisat.com/index3eee.html?nav=Software_Drivers,en,39&download=detail&produktID=1281
http://www.technisat.com/indexdb46.html?nav=Software_Drivers,en,39&download=download&produktID=1281&downloadID=1721
Driver in içinden çıkan README file driver in nasıl kurulacağını anlatiyor.
Bendeki sürümde v4l-dvb-0276304b76b9 in çekilip technisat tan alinan patch ile patch lendikten sonra derleme yapılması gerektiğinden bahsediyor.
Derleme işlemlerinden sonra alttaki komutlar kartın çalışması için yeterli.
shell# modprob frontend
shell# modprobe b2c2-flexcop-pci
kaffeine nin Turksat taki dogru kanallari bulmamasi
by Emre Tugriceri on Oct.03, 2008, under DVB
/home/emre/.kde/share/apps/kaffeine
altindaki
dvb-s/Turksat-42.0E dosyasinin düzenlenmesi gerekmektedir. Eğer kaffein ile dvb ayarlarini hiç yapmadıysanız
/home/emre/.kde/share/apps/kaffeine/dvbdata.tar.gz
ve
/usr/share/apps/kaffeine/dvbdata.tar.gz
dosyalarinin içinden değiştirmeniz gerekebilir.
vdr2kaffeine
by Emre Tugriceri on Oct.03, 2008, under DVB
http://free.pages.at/cleditor/vdr2kaffh.htm
Turksat-42.0E
by Emre Tugriceri on Oct.03, 2008, under DVB
/usr/share/dvb-apps/dvb-s/Turksat-42.0E
Bu dosya pek güncel değil. Bu dosyanın
S 11594000 H 4557000 5/6
S 10978000 V 2344000 3/4
S 11096000 V 27500000 3/4
S 11096000 V 27500000 5/6
S 12652000 H 22500000 5/6
S 12652000 H 22500000 3/4
şeklinde değiştirilmesi scandvb nin kanallari bulması için gerekli.
mysql deki snort loglarini temizlemek
by Emre Tugriceri on Sep.21, 2008, under Mysql, Security
reset master
purge master logs
delete from data
delete from event where timestamp<‘2008-8-01’
Citrix Netscaler backup script
by Emre Tugriceri on Apr.14, 2008, under Shell
Netscaler config lerini yedeklemek için yazdığım bir script belki birilerinin daha ihtiyacı vardır.
shell # ./ceknsconfig.ex `date +%y%m%d-%N`
şeklinde bir kullanımı var. Afiyet olsn.
Emre
Firefox ile java
by Emre Tugriceri on Feb.16, 2008, under Uncategorized
Java firefox u indirip kurduğunuzu farzediyorum.
ln -s /usr/java/latest/plugin/i386/ns7/libjavaplugin_oji.so .
ile firefox plugin klasoru içerisine link i oluşturuyoruz.
[root@etugriceri plugins]# firefox
VM did not start up properly
java_vm: xcb_xlib.c:50: xcb_xlib_unlock: Assertion `c->xlib.lock’ failed.
Could not read ack from child process
Plugin: Java VM process has died.
Could not start JavaVM!
Bu Javadaki bir bug dan kaynaklanıyormuş. Son java kurulduktan sonra;
Rpm den kurdum bende böyle;
total 4
lrwxrwxrwx 1 root root 16 2008-01-25 14:06 default -> /usr/java/latest
drwxr-xr-x 7 root root 4096 2008-02-16 18:57 jre1.6.0_03
lrwxrwxrwx 1 root root 21 2008-02-16 18:57 latest -> /usr/java/jre1.6.0_03
libmawt.so nin bulunduğu path kurulumumuza göre değiştirilebilir.
sed -i ‘s/XINERAMA/FAKEEXTN/g’ /usr/java/jre1.6.0_03/lib/i386/xawt/libmawt.so
komutu ile problem düzeliyor.
Sudo requiretty settings
by Emre Tugriceri on Jan.08, 2008, under Security
sudo: apache : sorry, you must have a tty to run sudo ; TTY=unknown ; …
/var/log/secure içerisinde gözlemlenen bu log apache ile çağırılan bir sistem komutunun çalışmayıp verdiği uyarı log u .
sudoers içerisinde
Defaults requiretty
ayarının # lenmesi gerekmektedir. Yukarıdaki log danda görüldüğü gibi apache user i herhangi bir tty ye sahip olmadığı için bu log düşmektedir. Normal şartlarda zaten “requiretty” nin kapatılmasına gerek yok fakat php kullanarak root yetkilerinde bir komut çalıştırma ihtiyacınız olursa bu ayarı kapatmanız gerekecektir.
Powered by ScribeFire.
SSL sertifikası yaratma
by Emre Tugriceri on Jan.04, 2008, under Security
Openssl ile sertifika yaratmak için yarattığınız anahtar dosya da güçlü şifreleme methodlarından birini seçerseniz sizden bir şifre girmenizi isteyecektir. Apache nin her başlamasında bu şifreyi yazmanız gerekmektedir.
Şifre sorulmadan bir sertifika yaratmak için ;
shell #> openssl dsaparam 1024 -out dsadosyasi
“dsaparam DSA Parameter Generation.”
shell #> openssl gendsa -out webserver.key dsadosyasi
Bu aşamada sizden şifre istenmeden bir key dosyasi yaratılacaktır. Bir şifre vermek isterseniz -des3 parametresi ekleyerek 3des algoritması ile şifrelenmiş bir anahtar dosya yaratabilirsiniz.
Sertifika talep dosyası yaratmak için ;
shell #> openssl req -new -key webserver.key -out webserver.csr
webserver.csr bizim sertifika talep dosyamız. Bu dosyayı kendi CA imizde yada Verisign gibi trusted CA lerde imzalatıp kullanabiliriz.
Kendi CA server imizda imzalamak için
shell #> openssl x509 -req -days 365 -in webserver.csr -signkey webserver.key -out webserver.crt
apache içerisinde ;
<VirtualHost _default_:443>
ServerAdmin root@tugriceri.com
DocumentRoot /var/www/html/
ServerName mail.tugriceri.com
SSLEngine on
SSLCertificateFile /webmail/webserver.crt
SSLCertificateKeyFile /webmail/webserver.key
#SSLCACertificateFile /webmail/cacertnew.pem
SetEnvIf User-Agent “.*MSIE.*” nokeepalive ssl-unclean-shutdown
</VirtualHost>
_default_ webserver inizin default ip adresidir. Her sertifika için başka ip ler vermeniz gerekmektedir. Bu sebepten diğer virtual host lar için _default_ yerine ip adresinizi yazabilirsiniz.
Eğer CA server başka bir sunucunuzun üzerinde ise SSLCACertificateFile ile CA sertifikanızı apache ye gösterebilir yada ;
shell #> keytool -import -file /webmail/cacertnew.pem
ile default key store içerisinde ekleyebilirsiniz.
Örnek;
openssl genrsa -des3 -rand file1:file2:file3:file4:file5 -out server.key 1024
openssl rsa -in server.key -out server.pem
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 60 -in server.csr -signkey server.key -out server.crt
Cer to Pem
by Emre Tugriceri on Jan.04, 2008, under Security
You can convert cer file to pem with this example command.
openssl x509 -in certnewb.cer -inform DER -out certnewb.pem -outform PEM
if you have a Microsoft CA server and if you signed your certification request with this CA server, this server will give to you der encoded certnew.cer file. you can convert this file to pem format for the any apache server.
Making patch file
by Emre Tugriceri on Dec.26, 2007, under Programming
Creating patch file with diff.
shell > diff -Naur old_file new_file > patch_file
shell > diff -Naur gazlo.pl gazlo_new.pl > gazlo.patch
shell > patch < gazlo.patch
Powered by ScribeFire.
Compiling perl code
by Emre Tugriceri on Dec.26, 2007, under Programming
You can compile your perl codes with using perlcc. For example;
shell > perlcc -B some.pl -o any.pl
Powered by ScribeFire.
Dovecot Error
by Emre Tugriceri on Dec.26, 2007, under Mail
imap-login: imap-login: error while loading shared libraries: libsepol.so.1: failed to map segment from shared object: Cannot allocate memory
64 bitlik bir sistem üzerinde dovecot ta imap ile ssl i aktif ettiğim zaman üstteki uyarıyı alıyordum. Problemin çözümü için /etc/dovecot.conf dosyası içerisinden;
“login_process_size = 32” olan değeri “login_process_size = 64” olarak değiştirmek yeterli.
Dovecot.conf içerisindeki açıklama ;
# Set max. process size in megabytes. If you don’t use
# login_process_per_connection you might need to grow this.
Powered by ScribeFire.
File Replace with sed
by Emre Tugriceri on Dec.24, 2007, under Shell
-i[SUFFIX], –in-place[=SUFFIX]
edit files in place (makes backup if extension supplied)
[root@etugriceri sil2]# sed -i ‘s/LAND/AIR/i’ *
Powered by ScribeFire.