Edit Default Library Path on solaris 10 type “crle” for list Default Library Path crle Configuration file [version 4]: /var/ld/ld.config Default Library Path (ELF): /usr/local/lib:/lib:/usr/lib Trusted Directories (ELF): /lib/secure:/usr/lib/secure (system default) Command line: crle -c /var/ld/ld.config -l /usr/local/lib:/lib:/usr/lib type “crle -c /var/ld/ld.config -l /usr/local/lib:/lib:/usr/lib” to change Default Library Path crle -c /var/ld/ld.config -l /usr/local/lib:/lib:/usr/lib
Archive for the ‘linux security’ Category
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); curl_setopt($ch, CURLOPT_PROXY,”$host:$port”);
apt-get install build-essential
snmptranslate -IR tcpPassiveOpens.0 TCP-MIB::tcpPassiveOpens.0 snmptranslate -On TCP-MIB::tcpPassiveOpens.0 .1.3.6.1.2.1.6.6.0 snmptranslate .1.3.6.1.2.1.6.6.0 TCP-MIB::tcpPassiveOpens.0
netstat -tan | grep ‘:80 ‘ | awk ‘{print $6}’ | sort | uniq -c
คำสั่งดรอปการโจมตีจาก ip ด้วยคำสั่ง route บน linux route add xxx.xxx.xxx.xxx reject คำสั่งตรวจสอบว่าทำการปิดกันเรียบร้อยหรือยังถ้าแสดงข้อความแบบด้านล่างแสดงว่าได้ปิดกั้น ip นั้นเรียบร้อยแล้ว ip route get xxx.xxx.xxx.xxx RTNETLINK answers: Network is unreachable ใช้คำสั่งด้านล่างเพื่อดู ตารางการ route [[email protected] ~]#route -n ใช้คำสั่งด้านล่างเพื่อยกเลิกการปิดกัน ip ดังกล่าว [[email protected] ~]#route del -host xxx.xxx.xxx.xxx reject หมายเหตุ xxx.xxx.xxx.xxx คือ ip ที่ต้องการปิดกั้น
ป้องกันการโหลด files นามสกุล ที่ไม่อนุญาตใน apache
Posted: 25th May 2009 by admin in apacheTags: apache
บางครั้ง อัพโหลด files นามสกุล เหล่านี้ขึ้นไปโดยไม่ได้ตั้งใจ อาจทำให้ โดน hacker เข้ามาแอบอ่าน .bak ของ config สำคัญเราได้ เพื่อเป็นการป้องกันทำได้โดยการเพิ่มข้อความด้านล่างลงไปใน httpd.conf <FilesMatch “.(sql|bak|old|torrent)$”> Order allow,deny Deny from all </FilesMatch> แล้วสั่ง restart apache ใหม่เท่านี้ก็สามารถป้องกันไม่ให้ผู้ใช้ files นามสกุล ที่เราไม่อนุญาติได้แล้ว
การยกเลิกใช้งาน function อันตรายและไม่จำเป็นใน php
Posted: 25th May 2009 by admin in apache, phpTags: php function
แก้ไขที่ php.ini หาบรรทัดที่มีข้อความว่า disable_functions = โดย เพิ่มข้อความเหล่านี้ไปหลัง เครื่องหมาย = แล้วจัดการเซฟ escapeshellarg, escapeshellcmd, exec, passthru, proc_open,proc_close,proc_get_status, proc_nice, proc_terminate,shell_exec, system,apache_child_terminate, apache_get_modules,apache_get_version,apache_getenv, apache_lookup_uri, apache_note,apache_request_headers,apache_reset_timeout, apache_response_headers,apache_setenv, getallheaders, virtual, popen, pclose สั่ง restart apache
ตัวอย่างนี้เป้นการป้องกันไม่ให้ user apache ใช้งาน crontab [[email protected] ~]#echo “apache” >> /etc/cron.deny
การป้องกัน user แอบดึง file ข้อมูลในระบบโดยใช้ local infile ผ่าน mysql
Posted: 25th May 2009 by admin in mysqlTags: local infile
ให้ทำการเพิ่มข้อความด้านล่างลงไปใน my.cnf แล้วทำการ restart mysql local-infile=0