rowty.net code snippets Public source code sharing repository https://rowty.net fix permissions for suphp - rowty.net code snippets find . -type d -exec chmod 755 {} \; find . -type f -name '*.php' -exec chmod 644 {} \; https://rowty.net/view/76/1/fix-permissions-for-suphp https://rowty.net/view/76/1/fix-permissions-for-suphp Thu, 23 Feb 2017 12:02:55 GMT Clean up old kernels - rowty.net code snippets package-cleanup --oldkernels --count=2 https://rowty.net/view/73/1/Clean-up-old-kernels https://rowty.net/view/73/1/Clean-up-old-kernels Thu, 23 Feb 2017 12:00:14 GMT Create cxs quarantine directory - rowty.net code snippets cxs --qcreate --quarantine /home/quarantine https://rowty.net/view/72/1/Create-cxs-quarantine-directory https://rowty.net/view/72/1/Create-cxs-quarantine-directory Thu, 23 Feb 2017 11:59:05 GMT Check certain ports on a list of servers - rowty.net code snippets nmap -p 22,80,443 -iL ./check-ports.txt https://rowty.net/view/55/1/Check-certain-ports-on-a-list-of-servers- https://rowty.net/view/55/1/Check-certain-ports-on-a-list-of-servers- Thu, 23 Feb 2017 11:36:39 GMT Find top 10 IPs with bad logins to your server - rowty.net code snippets lastb|awk '{print $3}'|sort|uniq -c|sort -n|tail -n 10|awk '{print $2}' https://rowty.net/view/54/1/Find-top-10-IPs-with-bad-logins-to-your-server https://rowty.net/view/54/1/Find-top-10-IPs-with-bad-logins-to-your-server Thu, 23 Feb 2017 11:30:07 GMT Generate a 10 digit password - rowty.net code snippets date | md5sum | cut -c1-10 https://rowty.net/view/45/1/Generate-a-10-digit-password https://rowty.net/view/45/1/Generate-a-10-digit-password Thu, 23 Feb 2017 10:23:46 GMT Check which http methods are available - rowty.net code snippets nmap -p 80 --script http-methods http://rowty.net https://rowty.net/view/44/1/Check-which-http-methods-are-available https://rowty.net/view/44/1/Check-which-http-methods-are-available Thu, 23 Feb 2017 10:22:19 GMT Check for traceenable - rowty.net code snippets curl -v -X TRACE http://rowty.net https://rowty.net/view/43/1/Check-for-traceenable https://rowty.net/view/43/1/Check-for-traceenable Thu, 23 Feb 2017 10:20:08 GMT Check ssl for weak ciphers - rowty.net code snippets nmap --script ssl-enum-ciphers -p 443 HOST | grep -i weak # Example: nmap --script ssl-enum-ciphers -p 443 www.linuxos.pro | grep -i weak https://rowty.net/view/34/1/Check-ssl-for-weak-ciphers https://rowty.net/view/34/1/Check-ssl-for-weak-ciphers Thu, 23 Feb 2017 09:21:34 GMT Check ssl certificate for start and expire dates - rowty.net code snippets echo | openssl s_client -connect host:port 2>/dev/null | openssl x509 -noout -startdate -enddate # Example: echo | openssl s_client -connect www.linuxos.pro:443 2>/dev/null | openssl x509 -noout -startdate -enddate notBefore=Feb 13 18:15:00 2017 GMT notAfter=May 14 18:15:00 2017 GMT https://rowty.net/view/33/1/Check-ssl-certificate-for-start-and-expire-dates https://rowty.net/view/33/1/Check-ssl-certificate-for-start-and-expire-dates Thu, 23 Feb 2017 09:20:07 GMT Check if vulnerability is patched in your version - rowty.net code snippets rpm -qa --changelog glibc | grep CVE-2015-7547 https://rowty.net/view/30/1/Check-if-vulnerability-is-patched-in-your-version https://rowty.net/view/30/1/Check-if-vulnerability-is-patched-in-your-version Thu, 23 Feb 2017 09:13:12 GMT netstat - which ips are hitting currently - rowty.net code snippets netstat -tanp|grep EST|grep :80|awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -n https://rowty.net/view/21/1/netstat---which-ips-are-hitting-currently https://rowty.net/view/21/1/netstat---which-ips-are-hitting-currently Wed, 22 Feb 2017 15:41:34 GMT tcpdump monitor mysql at port 3306 - rowty.net code snippets tcpdump -i eth0 -nN -vvv -xX -s 1500 port 3306 https://rowty.net/view/3/1/tcpdump-monitor-mysql-at-port-3306 https://rowty.net/view/3/1/tcpdump-monitor-mysql-at-port-3306 Wed, 22 Feb 2017 14:37:53 GMT