Archive for sec

Google Search Result Redirected to searchclick8.com

In my case this was caused by DNS redirection. Try this to solve the problem:

* Go to Network connections folder by following Start -> Connect to -> Show all connections.
* Right click "Local Area Connection" if you are connecting to the internet by a cable or "Wireless Network Connection" if wireless. Click "Properties" to bring up the "Connection Properties" panel.
* Highlight "Internet Protocol (TCP/IP)" and click the "Properties" button.
* In my case, I had "Use the following DNS server addresses:" highlighted and "77.74.48.113" as the Preferred DNS server. If this is your case as well, delete "77.74.48.113" and select the radio button next to the "Obtain DNS server address automatically"
* Click OK button.
* Try Google search and verify that searchclick8.com redirection is gone.

Apache 2 SSL Proxy

Configuration

Edit httpd.conf

 
LoadModule ssl_module modules/mod_ssl.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
 
Listen 443
NameVirtualHost *:443
<VirtualHost *:443>
  ServerName http://localhost
  # Serving https
  SSLEngine on
  SSLCertificateFile C:/certs/localhost.cer
  SSLCertificateKeyFile C:/localhost.key
 
  ProxyRequests Off
 
  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>
 
  SSLProxyEngine on
  SSLProxyCACertificateFile       "C:/certs/cacert.pem"
  # Need BOTH public key AND unencrypted private key:
  SSLProxyMachineCertificateFile  "C:/certs/localhost_privatekey_publickey.txt"
  SSLProxyVerifyDepth             10
  SSLProxyVerify                  none
 
  # Proxy to app1.my.com:8080
  ProxyPass /app1/ https://app1.my.com:8080/
  ProxyPassReverse /app1/ https://app1.my.com:8080/
</VirtualHost>
 

Troubleshooting

incomplete client cert configured for SSL proxy (missing or encrypted private key?)

* Need BOTH public key AND unencrypted private key pasted together

SSLProxyMachineCertificateFile  "C:/certs/localhost_privatekey_publickey.txt"

Java Key Store (jks)

Key Store

 
Generate private key
"%JAVA_HOME%\bin\keytool" -genkey -alias myhost -keyalg RSA -sigalg SHA1withRSA -keystore myhost.keystore -storepass secret -keypass secret -dname "CN=cName, OU=orgUnit, O=org, L=city, S=state, C=countryCode"
"%JAVA_HOME%\bin\keytool" -certreq -alias myhost -sigalg SHA1withRSA -file myhost.csr -keystore myhost.keystore
 
Inspect keys
"%JAVA_HOME%\bin\keytool" -list -v -alias myhost -keystore myhost.keystore
 
Import signed cert
Concatenate ca_root.cer to signed.cer
"%JAVA_HOME%\bin\keytool" -import -v -keystore myhost.keystore -alias myhost -storepass secret -file signed.cer
 
Delete a key
"%JAVA_HOME%\bin\keytool" -delete -alias myhost -keystore myhost.keystore -storepass secret
 

Apache 2 SSL

Setup Apache 2 SSL

httpd.conf

 
LoadModule ssl_module modules/mod_ssl.so
 
# Secure (SSL/TLS) connections
#Include conf/extra/httpd-ssl.conf
#
# Note: The following must must be present to support
#       starting without SSL on platforms with no /dev/random equivalent
#       but a statically compiled-in mod_ssl.
#
<IfModule ssl_module>
  SSLRandomSeed startup builtin
  SSLRandomSeed connect builtin
</IfModule>
 
Listen 443
<VirtualHost _default_:443>
  ServerName http://localhost
  SSLEngine on
  SSLCertificateFile \
  C:/OpenSSL/localhostca/certs/02.pem
  SSLCertificateKeyFile \
  C:/OpenSSL/localhostca/02/localhost.key
</VirtualHost>
 

[error] Init: SSLPassPhraseDialog builtin is not supported on Win32

Cause

* Server private key is protected by passphrase.

Resolution

* Remove passphrase from server private key.

openssl rsa -in server_key_with_passphrase.pem -out server_key_without_passphrase.pem

* Comments out SSLPassPhraseDialog directive if it is found in httpd.conf.