Thursday, July 27, 2017

Big O notation



Big O specifically describes the worst-case scenario, and can be used to describe the execution time required or the space used (e.g. in memory or on disk) by an algorithm

The rate of growth of time with respect to input. 

https://www.quora.com/What-are-some-easy-ways-to-understand-and-calculate-the-time-complexity-of-algorithms




Sunday, July 23, 2017

SOLID Principles and Design Patterns



http://www.dotnetcurry.com/tutorials/software-gardening

S
O
L
I
D

BDD : Behavior Driven Development



http://specflow.org/getting-started/

http://www.dotnetcurry.com/patterns-practices/1375/behavior-driven-development-bdd

http://specflow.org/documentation/Unit-Test-Providers/


Steps:

1. Open Visual Studio --> Tools --> Extension and Update
    Specflow

2. Create a Unit test Project
    Select project --> Nuget Manager
     Specflow
     install Specflow and NUnit

3.  App.Config , Add following
<specFlow>  
  <unitTestProvider name="MSTest"></unitTestProvider>
</specFlow>

4. Create new Item,
  Specflow. feature file
  Right Click on Feature file in Test Editor  --> Generate Steps

5. Build , Open test explore and select the test case
     Execute


Wednesday, July 19, 2017

Test data generator tools


http://www.mockaroo.com/

http://www.generatedata.com/

http://www.datanamic.com/datagenerator/index.html

http://wiki.c2.com/?TestDataGenerator

https://webresourcesdepot.com/test-sample-data-generators/

http://www.softwaretestingmagazine.com/tools/open-source-test-data-generators/

http://toolsfordatabases.com/test-data-generation-tools.html

https://www.quora.com/What-are-the-tools-used-for-test-data-generation




Thursday, July 13, 2017

Command prompt cmd.exe c#


MSIEXEC


Microsoft Windows Installer (Windows 7/2008).

https://ss64.com/nt/msiexec.html

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

https://stackoverflow.com/questions/17613216/how-to-pause-cmd-before-it-close

https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx?mfr=true

Specify the K parameter instead of C
From Microsoft documentation:
/c : Carries out the command specified by string and then stops.
/k : Carries out the command specified by string and continues.


proc.Arguments = "/K ""ipconfig" 


Example:

using System.Diagnostics;
 
namespace ConsoleApplication7
{
    class Program
    {
        static void Main(string[] args)
        {
            string cmd = @"xcopy C:\abc\1\1.txt C:\abc\2\";
            ExecuteCommand(cmd);
        }
 
 
        public static string ExecuteCommand(string command)
        {
 
            ProcessStartInfo procStartInfo = new ProcessStartInfo("cmd""/k " + command)
            {
                UseShellExecute = false,
                CreateNoWindow = false,
                WindowStyle = ProcessWindowStyle.Maximized
            };
 
            using (Process proc = new Process())
            {
                proc.StartInfo = procStartInfo;
                proc.Start();
 
                string output = proc.StandardOutput.ReadToEnd();
 
                if (string.IsNullOrEmpty(output))
                    output = proc.StandardError.ReadToEnd();
 
                return output;
            }
 
        }
    }
 
}

Thursday, July 6, 2017

Python & Java


Tools to Code:

Python online interpreter

https://realpython.com/blog/python/setting-up-sublime-text-3-for-full-stack-python-development/

https://sourceforge.net/projects/pyscripter/


Java file executing and JVM

.java file (source code file) is compiled in to bytecode(.class file). Bytecode is platform independent, it can you distributed to any OS.   

JVM is platform dependent, its depends on Operating system, Processor. JVM comes with different version for different operating system.

The .Class file will be converted into Machine code by Windows JVM or Linux JVM depends on operating system.  The machine code will be used by processor and the program will execute. 

Monday, May 22, 2017

Web Security Testing

Security:  22May2017

Application security
End point security
Network security: Authentication
Content security

One factor authentication
Two factor authentication : Ex: ATM card & Pin

Content Security: 
Public data: Username
Private data: Password

Confidentiality: Encryption

Encryption + Decryption = Cryptography

Integrity: Hash code for checking the completeness of the data received from the sender

Security Trio:
All the below three cannot be obtained, if the application is more secure, ease of use will be difficult.

1 Security
2 Functionality
3 Ease of Use

Security Terminology:
1 Asset: 
 Tangible asset: Physical assets
 Intangible asset: Software and Licenses


2. Threat: Change to asset from intruder

3. Vulnerably: Weakness in the application

4 Attack: 

5. Exploit: Stealing the data and intruder benefit

6. Payload: Attacker write query and get data

7. Zero-Day: Attack with no solution 
                      Initially SQL injection had no solution

8. Risk


Security Control:
OWAS: Open Web App

Attack Surface:
Attack surface is the sum total of all the vulnerability’s in an application
E: User Input. Protocol, Interfaces

Elements of Security:
1. Confidentiality
2. Integrity
3. Availability:  Negative factor is Denial of Service

Authorization: Access Control
Authentication: Identification of valid user of not


Non-Repudiation:

Digital Certificate:

SHA: Secure has algorithm
MD5- Message Digest

RSA

Kinds of Attack:

Injection
  Command            Code     SQL injection

SQL injection: 
Numerical SQL Injection
String SQL Injection


Web scarab tool for editing the request and response

Blind SQL Injection

To know the database, tables and contents of the website, Kali 2016 OS with SQLMAP tool can be used.
There are several command where we can get all the details, whenever there is an error in the page.

ex: sqlmap - h     (for help)
sqlmap -u "websiteurl" -dbs      ( for getting database name)


Cross -Site Scripting:
1. Store / Persistence
2. Reflected / Temporary


Cross-Site Request Forgery: (in .Net its also called as view state one click attack)
(CSRF/XSRF)



JMeter Simple Controller

  Simple Controller is just a  container  for user request.