Smokeping is a great tool for network monitoring, we recently adopted smokeping to use it for URL monitoring. We use the Curl probe for this purpose. Everything seems working fine until the number of URL goes over a thousand, whenever we restart the service, we see a gap in the graph , this gap means Smokeping did nothing at that time. We did some analysis and make some change: – changing the forks parameter from 5 to 100 – changing the pings from 5 to 3 (if you do this you have to delete all your rrds first otherwise smokeping will not be able toRead More →

Mitmproxy is a python proxy, it’s very light. Basically it’s like a normal proxy but it offers some advanced features that most developer/ hacker like to have: – Watching your internet traffic – Decrypt https (SSL) traffic – It’s the middle man, it allows you to inject python code to change the request/response header between the client and the server. I have a use case to use it: I need to use Chrome in Linux and it must pass the NTLM authentication by windows server , Chrome can do it in Windows but In Linux , there is no way it can pickup credential andRead More →

nmap –script ssl-enum-ciphers -p 443 www.google.com you can test your script to see the difference. Here are some url that only support a specific tls version. This subdomain and port only supports TLSv1.2 https://tls-v1-2.badssl.com:1012/ This subdomain and port only supports TLSv1.1 https://tls-v1-1.badssl.com:1011/ This subdomain and port only supports TLSv1.0 https://tls-v1-0.badssl.com:1010/Read More →

$pfx_file=”mywindows_cert.pfx”; $password=”dailyithlep”; $pem_file=”mypem_cert.pem”; convert_pfx_file_to_pem($pfx_file,$password,$pem_file,true); function convert_pfx_file_to_pem($pfx_file,$password,$pem_file,$remove_password=true) { $CERT_FILE=”/tmp/certificate.crt”; $CA_CERT_FILE=”/tmp/ca-cert.crt”; $PRIVATE_KEY=”/tmp/private.key”; $PRIVATE_KEY_NOPASSWORD=”/tmp/private_nopassword.key”; //get the certificate file from pfx file $cmd=”openssl pkcs12 -clcerts -nokeys -in \”$pfx_file\” -out $CERT_FILE -passin pass:$password”; shell_exec($cmd); //get the ca-certificate file from pfx file $cmd=”openssl pkcs12 -cacerts -nokeys -in \”$pfx_file\” -out $CA_CERT_FILE -passin pass:$password”; shell_exec($cmd); ////get the private key from pfx file $cmd=”openssl pkcs12 -nocerts -in \”$pfx_file\” -out $PRIVATE_KEY -passin pass:$password -passout pass:$password”; shell_exec($cmd); if($remove_password) { //remove the password in private key $cmd=”openssl rsa -in $PRIVATE_KEY -out $PRIVATE_KEY_NOPASSWORD -passin pass:$password “; shell_exec($cmd); //put all 3 files into one file again $cmd=”cat $CERT_FILE $CA_CERT_FILE $PRIVATE_KEY_NOPASSWORD > $pem_file “; shell_exec($cmd); }else{ //put all 3 filesRead More →

Curl can provide us the following time report: time_namelookup time_redirect time_connect time_appconnect time_pretransfer time_starttransfer time_total To get these report time, you need to use the option -w , here is an example: curl -L –output /dev/null –silent –show-error –w ‘lookup: %{time_namelookup}\nconnect: %{time_connect}\nappconnect: %{time_appconnect}\npretransfer: %{time_pretransfer}\nredirect: %{time_redirect}\nstarttransfer: %{time_starttransfer}\ntotal: %{time_total}\n’ ‘google.com’ By default Smokeping Curl probe only fetch the load time – that is total_time – dns resolution. There are many occasions we have with DNS lookup, so we can’t find that issue. That’s why we have “AnotherCurl” probe , the big difference is the “write_out” option , AnotherCurl allows us to specify which the probe will report.Read More →

When you setup a cronjob file (/etc/cron.d/filename) , the file should include the path below: PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/root/bin this is because if you don’t set the path, some command might not run well such as: service ( because it can’t find service run file location)Read More →

A sample function to use curl post data. $data=array() $data=array(); $data[“field1″]=”hello world”; $data[“user”]=”hello user”; curl_post($url,$data) function curl_post($url,$fields) { //open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch,CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERAGENT, ‘Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)’); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1); curl_setopt($ch,CURLOPT_POST, count($fields)); curl_setopt($ch,CURLOPT_POSTFIELDS, $fields); //some other users translate this array to string, but it will require you to convert some special chars in url such as & //execute post $result = curl_exec($ch); //close connection curl_close($ch); return $result; }Read More →

The service record for ldap and kerberos are used to identify LDAP and Kerberos server for a domain in Active Directory. When you configure some authentication method, it might ask you to specify the LDAP or Kerberos Server.  The simplest way to achieve this is using nslookup command. nslookup -type=srv _ldap._tcp.dc._msdcs.<domain> <dns server ip> nslookup -type=srv _kerberos._tcp.dc._msdcs.<domain> <dns server ip>Read More →