I’m using Curl 7.5.x, but somehow when i use the –ntlm option, the server seems not accepted. After many tries, i finally make it worked by install the curl 7.46 cd ~ sudo apt-get build-dep curl wget http://curl.haxx.se/download/curl-7.46.0.tar.bz2 tar -xvjf curl-7.46.0.tar.bz2 cd curl-7.46.0 ./configure –with-nghttp2 –with-ssl –with-libssl-prefix=/usr/local/ssl # This is the line I had the most trouble with, especially figure out –with-libssl-prefix make sudo make installRead More →

yum install gcc python3-devel yum install python3 pip3 install psutil Command: watch -n 2 python3 cpu.py def tell_systemstatus(): import psutil import platform import datetime os, name, version, , , = platform.uname() version = version.split(‘-‘)[0] cores = psutil.cpu_count() cpu_percent = psutil.cpu_percent() memory_percent = psutil.virtual_memory()[2] disk_percent = psutil.disk_usage(‘/’)[3] boot_time = datetime.datetime.fromtimestamp(psutil.boot_time()) running_since = boot_time.strftime(“%A %d. %B %Y”) response = “I am currently running on %s version %s. ” % (os, version) response += “\nThis system is named %s and has %s CPU cores. ” % (name, cores) response += “\nCurrent disk_percent is %s percent. ” % disk_percent response += “\nCurrent CPU utilization is %s percent. ”Read More →

Buying an old gadget is not always the best choice, but if you have to there is almost something that you need to do to make it better. I got an old Apple Wired USB mouse, it works perfectly except it’s hard to scroll up or down. It’s a little bit annoyance. I tried to see what’s inside, but it looks very difficult to open, there is no screw. I think they use glue to stick the parts. Google a little bit, so i see some tricks to make it work. Most of them suggest to use a paper towel, turn the mouse upside downRead More →

I was trying to install Adobe CS5 in my Imac 2011 – running High Sierra. When i clicked on the installation icon, i always got “install” can’t be opened. you should eject the disk image.” , i verified my security setting, there is nothing blocked there. This is the error i got:   Root cause: it’s something with Apple certificate expiration. It revokes Adobe from installing correctly. This is how i fixed Open “Terminal” app  and run 2 commands below: cd /Volumes/Adobe\ Photoshop\ CS5/Adobe\ Photoshop\ CS5/Install.app/Contents/MacOS/ install      Read More →

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 to update  –Read 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 and send it theRead 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 →