Saturday 14 April 2018

HTML: rel= noopener noreferrer meaning

rel="noopener noreferrer" should be added to links containing target="_blank" as a precaution against reverse tabnabbing

noopener
“Instructs the browser to open the link without granting the new browsing context access to the document that opened it — by not setting the Window.opener property on the opened window (it returns null).”

noreferrer
“Prevents the browser, when navigating to another page, to send this page address, or any other value, as referrer via the Referer: HTTP header.”

References:
1. Why am I seeing rel=”noopener noreferrer” in my WordPress links?
2. Add rel="noopener noreferrer" to target="_blank"

jQuery Versions Vulnerable

jQuery VersionIs it Vulnerable?
jQuery 2.0.3Safe
jQuery 2.0.2Safe
jQuery 2.0.1Safe
jQuery 2.0.0Safe
jQuery 1.10.2Safe
jQuery 1.10.1Safe
jQuery 1.9.1Safe
jQuery 1.10.0Safe
jQuery 1.9.0Safe
jQuery 1.5.1Safe
jQuery 1.4.2Vulnerable
jQuery 1.6.1Vulnerable
jQuery 1.8.3Vulnerable
jQuery 1.6.2Vulnerable
jQuery 1.6.3Vulnerable
jQuery 1.7.2Vulnerable
jQuery 1.7.1Vulnerable
jQuery 1.6.0Vulnerable
jQuery 1.8.0Vulnerable
jQuery 1.5.0Vulnerable
jQuery 1.4.4Vulnerable
jQuery 1.6.4Vulnerable
jQuery 1.4.0Vulnerable
jQuery 1.8.1Vulnerable
jQuery 1.8.2Vulnerable
jQuery 1.5.2Vulnerable
jQuery 1.4.1Vulnerable
jQuery 1.7.0Vulnerable
jQuery 1.3.2Vulnerable
jQuery 1.4.3Vulnerable
jQuery 1.3.1Vulnerable
jQuery 1.3.0Vulnerable
jQuery 1.2.3Vulnerable
jQuery 1.2.6Vulnerable


References: 

Friday 2 February 2018

How to monitor a windows service using vb script

1. The below-mentioned script is to monitor on a window service.

The service name is 'W3SVC' (World Wide Web Publishing Service), you can change the service name as per your requirement. If the script finds the service is stopped then it will start the stopped service.
The below code is a loop which runs the start service code every 15 seconds

**************************************************************************
do
   MyCode
   wscript.sleep 15000
loop

Sub MyCode
Set wmi = GetObject("winmgmts://./root/cimv2")
qry = "SELECT * FROM Win32_Service WHERE Name = 'W3SVC'"
For Each svc In wmi.ExecQuery(qry)
  If svc.State <> "Running" Then svc.StartService
Next
End Sub
****************************************************************************


2. The below-mentioned script is to kill all the vb scripts running in the background.
****************************************************************************
Option Explicit
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "taskkill /f /im Cscript.exe", , True
WshShell.Run "taskkill /f /im wscript.exe", , True
****************************************************************************

3. The below-mentioned script is to start multiple window services
****************************************************************************
do
   MyCode
   wscript.sleep 15000
loop

Sub MyCode
sComputer = "."
aTargetSvcs= Array ("W3SVC","aspnet_state","AdobeARMservice") 'array of window service
Set oWMIService =  GetObject("winmgmts://./root/cimv2")
Set cServices = oWMIService.ExecQuery("SELECT * FROM Win32_Service")
For Each oService In cServices
 For Each sTargetSvc In aTargetSvcs
  If LCase(oService.Name) = LCase(sTargetSvc) Then
  'MsgBox(oService.State) (commented code to check the status of the service in alert)
    If oService.State <>  "Running" Then 'check the status of the service
      oService.StartService() 
     End If
End if
Next
Next
End Sub
****************************************************************************

4.  vbscript terminate application / vbscript kill process
****************************************************************************



****************************************************************************

5. How to create a vb script
****************************************************************************
1. Open the notepad
2. Copy and paste the above script into the notepad
3. Save it as "test.vbs"
4. To test the same double-click on the "test.vbs"
****************************************************************************

References
1. How to stop a vb script running in windows
2. How do I stop / start service in VBScript?
3. re-run vbs script with time interval.
4. How to get a VBS script to start a service if it is stopped, with no window?
5. VBScript to start multiple services
6. VBA - Message Box

Friday 5 January 2018

IIS redirect from HTTP to https

We recently faced an issue relating to URL Rewriting on our IIS 8 SharePoint 2013 server.
Firstly I would like to let you know the website current situation in which it was working.
Web Application was hosted on port 80 but after some configuration, it was moved to port 443 and port 80 was discontinued.
In addition, under SSL settings  require SSL was checked so the website can be only browsable when user upfront tries to browse via https://www.xyz.com by typing in the URL bar

When the user was trying to access http://xyz.com or https://xyz.com or http://www.xyz.com, it wasn't accessible at all and it was hampering the current SEO operations of our SharePoint 2013 web application in google.
Furthermore, We attempted all the permutation combinations of redirection to get it worked from HTTP to https when the user tries to access the website.

So, mentioned below are the permutation combinations as follows:
1. Defining New rules for redirection in URL rewrite tag of web.config file of SharePoint 2013 web application.
2. We reconfigured alternate access mapping.
3. Under SSL settings, we un-check require SSL option.
4. Under Http redirect, we tried all the options of redirect all the request to https://www.xyz.com but no relief.
5. A very childish option of letting the user visit the URL http://www.xyz.com and redirecting again to https://www.xyz.com via jquery/javascript

After spending the whole day behind the issue. We were left with no option to go with "No 5" for redirection from HTTP to https.
As leaving things behind we thought to give a try of re-installation of the setup.
1. press (windows + r) key  and it will open run
2. type appwiz.cpl and it will open control panel
3. under Programs and features, we repaired the "IIS URL rewrite option"
4. After repairing the module the IIS gets reset
5. We tried to browse the website using http://www.xyz.com and it redirected to https://www.xyz.com

After all the tantrums, the issue was fixed by repairing the IIS rewrite under control panel.

References:
Download URL Rewrite
Redirect from HTTP to HTTPS using the IIS URL Rewrite module
Redirect a user from HTTP to HTTPS using JavaScript