Archive for October 3rd, 2008

3
Oct

thttpd

   Posted by: admin    in Mẹo vặt của hiếu râu

Down source PHP + http://www.acme.com/software/thttpd/thttpd-2.21b.tar.gz

phpinfo() –> + –with-thttpd=../thttpd-2.21b  ( /sapi/thttpd/README )

‘./configure’ ‘–prefix=/usr’ ‘–with-apxs2=/usr/sbin/apxs’ ‘–prefix=/usr’ ‘–sysconfdir=/etc’ ‘–disable-safe-mode’ ‘–enable-apc’ ‘–enable-apc-mmap’ ‘–enable-memory-limit’ ‘–enable-suhosin’ ‘–disable-magic-quotes’ ‘–enable-zend-multibyte’ ‘–enable-mbregex’ ‘–enable-tokenizer=shared’ ‘–with-config-file-scan-dir=/etc/php’ ‘–with-config-file-path=/etc/httpd’ ‘–with-mod_charset’ ‘–with-layout=PHP’ ‘–enable-sigchild’ ‘–enable-xml’ ‘–with-libxml-dir=/usr’ ‘–enable-simplexml’ ‘–enable-spl’ ‘–enable-filter’ ‘–disable-debug’ ‘–with-openssl=shared’ ‘–with-pcre-regex=/usr’ ‘–with-zlib=shared,/usr’ ‘–enable-bcmath=shared’ ‘–with-bz2=shared,/usr’ ‘–enable-calendar=shared’ ‘–enable-ctype=shared’ ‘–with-curl=shared’ ‘–with-curlwrappers’ ‘–enable-dba=shared’ ‘–with-gdbm=/usr’ ‘–with-db4=/usr’ ‘–enable-dbase=shared’ ‘–enable-exif=shared’ ‘–enable-ftp=shared’ ‘–with-gd=shared’ ‘–with-jpeg-dir=/usr’ ‘–with-png-dir=/usr’ ‘–with-zlib-dir=/usr’ ‘–with-xpm-dir=/usr’ ‘–with-freetype-dir=/usr’ ‘–with-t1lib=/usr’ ‘–enable-gd-native-ttf’ ‘–enable-gd-jis-conv’ ‘–with-gettext=shared,/usr’ ‘–with-gmp=shared,/usr’ ‘–with-iconv=shared’  ‘–with-ldap=shared’ ‘–enable-mbstring=shared’ ‘–with-hash’ ‘–with-mhash=shared,/usr’ ‘–with-mysql=shared,/usr’ ‘–with-mysqli=shared,/usr/bin/mysql_config’ ‘–enable-pdo=shared’ ‘–with-pdo-mysql=shared,/usr’ ‘–with-pdo-sqlite=shared’ ‘–with-pspell=shared,/usr’ ‘–with-mm=/usr’ ‘–enable-shmop=shared’ ‘–with-snmp=shared,/usr’ ‘–enable-soap=shared’ ‘–enable-sockets’ ‘–with-sqlite=shared’ ‘–with-regex=php’ ‘–enable-sysvmsg’ ‘–enable-sysvsem’ ‘–enable-sysvshm’ ‘–enable-wddx=shared’ ‘–with-xsl=shared,/usr’ ‘–enable-zip=shared’ ‘–with-tsrm-pthreads’ ‘–enable-shared=yes’ ‘–enable-static=no’ ‘–with-gnu-ld’ ‘–with-pic’ ‘–build=i486-slackware-linux’ –with-thttpd=../thttpd-2.21b ;make ;make install

Remove world-readable in libthttpd.c

cd ../thttpd-2.21b; ./configure ; make ; make install
thttpd -C /etc/thttpd.conf
# This section overrides defaults
dir=/home/thttpd
#chroot
user=thttpd# default = nobody
logfile=/var/log/thttpd.log
pidfile=/var/run/thttpd.pid
# This section _documents_ defaults in effect
port=809
# nosymlink# default = !chroot
vhost
# nocgipat
# nothrottles
# host=202.157.154.140
# charset=iso-8859-1

—– centos ——

http://vault.centos.org/5.10/updates/SRPMS/ download srpms

rpmbuild --rebuild [the downloaded file]
Ctrl-C :D 
cd /usr/src/redhat/BUILD/php-5.3.3

											
3
Oct

openwebmail

   Posted by: admin    in Mẹo vặt của hiếu râu

perl suid

perl -MCPAN -e shell

>install MIME::Base64

openwebmail-tool.pl –init

openwebmail.conf

domainnames             auto
auth_module             auth_unix.pl
mailspooldir            /var/mail
ow_cgidir               /home/www/…/cgi-bin/openwebmail
ow_cgiurl               /cgi-bin/openwebmail
ow_htmldir              /home/www/…/openwebmail
ow_htmlurl              /openwebmail
logfile                 /var/log/openwebmail.log
virtusertable           /etc/mail/virtusertable
use_syshomedir          no
ow_usersdir             /home/opwm
login_fieldwidth        25
enable_changepwd        yes
default_timeoffset              +0700
default_style                   BoringGray
default_iconset                 Adjunct.Silver
dbm.conf
dbm_ext                 .db
dbmopen_ext             .db
dbmopen_haslock         yes
auth_unix.conf
passwdfile_plaintext    /etc/passwd
passwdfile_encrypted    /etc/shadow
passwdmkdb              none
check_expire            no
check_nologin           no
check_shell             no
check_cobaltuser        no
change_smbpasswd        no

chmod 755 /home/opwm

vipw

abc:x:1000:100::/home/opwm/abc:/bin/bash

3
Oct

sendmail AUTH LOGIN

   Posted by: admin    in Mẹo vặt của hiếu râu

~/sendmail-8.14.3/devtools/Site/site.config.m4

APPENDDEF(`confMAPDEF', `-DNEWDB -DSTARTTLS -DSASL=2  -DTCPWRAPPERS -DNIS -DMAP_REGEX')
APPENDDEF(`confLIBS', `-lnsl -lssl -lcrypto -lsasl2 -lwrap -lm -ldb -lresolv')
APPENDDEF(`conf_libmilter_ENVDEF', `-DMILTER')
APPENDDEF(`conf_sendmail_ENVDEF', `-DMILTER')
APPENDDEF(`conf_libmilter_ENVDEF', `-D_FFR_MILTER_ROOT_UNSAFE ')
/usr/share/sendmail/cf/cf/sendmail-slackware-tls-sasl.mc
/usr/share/sendmail/cf/cf# ./Build sendmail.mc
FEATURE(`blacklist_recipients’)dnl
FEATURE(`dnsbl’,`dnsbl.sorbs.net’,`Rejected - see http://www.au.sorbs.net/lookup’)
FEATURE(`dnsbl’,`whois.rfc-ignorant.org’,`Rejected - see http://www.rfc-ignorant.org’)
FEATURE(`dnsbl’,`dnsbl.njabl.org’,`Rejected - see http://njabl.org/lookup.html’)
FEATURE(`dnsbl’,`dnsbl.ahbl.org’,`Rejected - see http://ahbl.org/tools/lookup’)
FEATURE(`dnsbl’,`list.dsbl.org’,`Rejected - see http://dsbl.org/listing’)
FEATURE(`dnsbl’,`sbl.spamhaus.org’,`Rejected - see http://www.spamhaus.org/lookup.lasso’)
FEATURE(`dnsbl’,`sbl-xbl.spamhaus.org’,`Rejected - see http://www.spamhaus.org/lookup.lasso’)
dnl# define(`confAUTH_OPTIONS’, `A y’)dnl
define(`confAUTH_MECHANISMS’, `LOGIN PLAIN DIGEST-MD5 CRAM-MD5′)dnl
TRUST_AUTH_MECH(`LOGIN PLAIN DIGEST-MD5 CRAM-MD5′)dnl
~/cyrus-sasl-2.1.23# ./configure –prefix=/usr –disable-anon –enable-plain –enable-login –disable-krb4 –with-saslauthd=/var/state/saslauthd –with-openssl –with-plugindir=/usr/lib/sasl2 –disable-cram –disable-digest –disable-otp
/usr/lib/sasl2/Sendmail.conf
pwcheck_method: saslauthd
mech_list: LOGIN PLAIN

--------------- Centos ------------
yum install cyrus-sasl-plan
define(`confAUTH_OPTIONS', `A')dnl
define(`confAUTH_MECHANISMS', `LOGIN PLAIN')dnl
TRUST_AUTH_MECH(`LOGIN PLAIN')dnl
3
Oct

apache - httpd.conf

   Posted by: admin    in Mẹo vặt của hiếu râu

VirtualDocumentRoot /home/www/%-2%-1/%1%2
VirtualScriptAlias /home/www/%-2%-1/%1%2/cgi-bin
<VirtualHost 203.113.172.97:80>
php_admin_flag register_globals On
php_admin_value file_upload 1
php_admin_value upload_tmp_dir /tmp
php_admin_value session.save_path /tmp
</VirtualHost>
Include /etc/httpd/basepaths/*
basepaths/daigiaphat.com
<VirtualHost 203.113.172.97:80>
ServerName
www.daigiaphat.com
ServerAlias daigiaphat.com
php_admin_flag safe_mode On
php_admin_value open_basedir /home/www/daigiaphatcom/wwwdaigiaphat/
php_admin_flag register_globals Off
php_admin_value file_upload 1
php_admin_value upload_tmp_dir /home/www/daigiaphatcom/wwwdaigiaphat/tmp/
php_admin_value session.save_path /tmp
</VirtualHost>

phpinfo();

‘./configure’ ‘–prefix=/usr’ ‘–with-apxs2=/usr/sbin/apxs’ ‘–prefix=/usr’ ‘–sysconfdir=/etc’ ‘–disable-safe-mode’ ‘–enable-apc’ ‘–enable-apc-mmap’ ‘–enable-memory-limit’ ‘–enable-suhosin’ ‘–disable-magic-quotes’ ‘–enable-zend-multibyte’ ‘–enable-mbregex’ ‘–enable-tokenizer=shared’ ‘–with-config-file-scan-dir=/etc/php’ ‘–with-config-file-path=/etc/httpd’ ‘–with-mod_charset’ ‘–with-layout=PHP’ ‘–enable-sigchild’ ‘–enable-xml’ ‘–with-libxml-dir=/usr’ ‘–enable-simplexml’ ‘–enable-spl’ ‘–enable-filter’ ‘–disable-debug’ ‘–with-openssl=shared’ ‘–with-pcre-regex=/usr’ ‘–with-zlib=shared,/usr’ ‘–enable-bcmath=shared’ ‘–with-bz2=shared,/usr’ ‘–enable-calendar=shared’ ‘–enable-ctype=shared’ ‘–with-curl=shared’ ‘–with-curlwrappers’ ‘–enable-dba=shared’ ‘–with-gdbm=/usr’ ‘–with-db4=/usr’ ‘–enable-dbase=shared’ ‘–enable-exif=shared’ ‘–enable-ftp=shared’ ‘–with-gd=shared’ ‘–with-jpeg-dir=/usr’ ‘–with-png-dir=/usr’ ‘–with-zlib-dir=/usr’ ‘–with-xpm-dir=/usr’ ‘–with-freetype-dir=/usr’ ‘–with-t1lib=/usr’ ‘–enable-gd-native-ttf’ ‘–enable-gd-jis-conv’ ‘–with-gettext=shared,/usr’ ‘–with-gmp=shared,/usr’ ‘–with-iconv=shared’ ‘–with-ldap=shared’ ‘–enable-mbstring=shared’ ‘–with-hash’ ‘–with-mhash=shared,/usr’ ‘–with-mysql=shared,/usr’ ‘–with-mysqli=shared,/usr/bin/mysql_config’ ‘–enable-pdo=shared’ ‘–with-pdo-mysql=shared,/usr’ ‘–with-pdo-sqlite=shared’ ‘–with-pspell=shared,/usr’ ‘–with-mm=/usr’ ‘–enable-shmop=shared’ ‘–with-snmp=shared,/usr’ ‘–enable-soap=shared’ ‘–enable-sockets’ ‘–with-sqlite=shared’ ‘–enable-sqlite-utf8′ ‘–with-regex=php’ ‘–enable-sysvmsg’ ‘–enable-sysvsem’ ‘–enable-sysvshm’ ‘–enable-wddx=shared’ ‘–with-xsl=shared,/usr’ ‘–enable-zip=shared’ ‘–with-tsrm-pthreads’ ‘–enable-shared=yes’ ‘–enable-static=no’ ‘–with-gnu-ld’ ‘–with-pic’ ‘–build=i486-slackware-linux’

remove ‘

remove imap

./configure –prefix=/usr –with-apxs2=/usr/sbin/apxs –prefix=/usr –sysconfdir=/etc –disable-safe-mode –enable-apc –enable-apc-mmap –enable-memory-limit –enable-suhosin –disable-magic-quotes –enable-zend-multibyte –enable-mbregex –enable-tokenizer=shared –with-config-file-scan-dir=/etc/php –with-config-file-path=/etc/httpd –with-mod_charset –with-layout=PHP –enable-sigchild –enable-xml –with-libxml-dir=/usr –enable-simplexml –enable-spl –enable-filter –disable-debug –with-openssl=shared –with-pcre-regex=/usr –with-zlib=shared,/usr –enable-bcmath=shared –with-bz2=shared,/usr –enable-calendar=shared –enable-ctype=shared –with-curl=shared –with-curlwrappers –enable-dba=shared –with-gdbm=/usr –with-db4=/usr –enable-dbase=shared –enable-exif=shared –enable-ftp=shared –with-gd=shared –with-jpeg-dir=/usr –with-png-dir=/usr –with-zlib-dir=/usr –with-xpm-dir=/usr –with-freetype-dir=/usr –with-t1lib=/usr –enable-gd-native-ttf –enable-gd-jis-conv –with-gettext=shared,/usr –with-gmp=shared,/usr –with-iconv=shared –with-ldap=shared –enable-mbstring=shared –with-hash –with-mhash=shared,/usr –with-mysql=shared,/usr –with-mysqli=shared,/usr/bin/mysql_config –enable-pdo=shared –with-pdo-mysql=shared,/usr –with-pdo-sqlite=shared –with-pspell=shared,/usr –with-mm=/usr –enable-shmop=shared –with-snmp=shared,/usr –enable-soap=shared –enable-sockets –with-sqlite=shared –enable-sqlite-utf8 –with-regex=php –enable-sysvmsg –enable-sysvsem –enable-sysvshm –enable-wddx=shared –with-xsl=shared,/usr –enable-zip=shared –with-tsrm-pthreads –enable-shared=yes –enable-static=no –with-gnu-ld –with-pic –build=i486-slackware-linux

make , make install

cp ./modules/* /usr/lib/php/extensions

httpd

./configure –enable-so –enable-modules=all

Include /usr/local/apache2/conf/mod_php.conf

Include /etc/httpd/basepaths/*

—————

# Load the PHP module:

LoadModule php5_module /usr/lib/httpd/modules/libphp5.so

AddType application/x-httpd-php .php

———-

3
Oct

Rửa máy mới

   Posted by: admin    in Lăng nhăng lít nhít

Hi all,

Chiều nay Dũng mời toàn team route tại quán 63 để rửa máy mới nhé. Nếu mà không rửa thì sẽ bị đất nhậu luôn cái máy thì căng lém. hehehhe