Tuesday, February 17, 2015

Are u Aware of Security?

Security Awareness for .Net Developers

I wanted to share with you what I have learn form MS Tech Ed 2015.

"No language can prevent insecure code, although there are language features which could aid or hinder a security-conscious developer." 

                                                                             -Chris Shiflett


This article give some tips and tricks of secure a applications, understand security threat, tools and others.


Vulnerabilities & Solution


What are Vulnerabilities?


A vulnerability in Microsoft could allow an unauthenticated, remote attacker to execute arbitrary code, RegEx & ect.


  • RegEx vulnerability

    • RegEx - Regular Expressions provide a concise and flexible means for identifying strings. Also widely used in Text validations, Search engines and especially in security related applications, tools and libraries.

    • ReDoS - Regular expression Denial of Service is a denial-of-service attack that exploits the fact that most regular expression implementations may reach extreme situations that cause them to work very slowly. An attacker can then cause a program using a regular expression to enter these extreme situations and then hang for a very long time

    • The art of attacking the Web by ReDoS is by finding inputs which cannot be matched by the above Regexes and on these Regexes a Regex-based Web systems will get stuck.

  • External Binaries vulnerability
    • Due to an improper restriction by the affected software on the path used for loading external binaries.
  • Web Server vulnerability
    • The attack on specific web server configuration files and it allows an attacker to run arbitrary, system level code on the vulnerable server and retrieve any desired information contained therein. Improper coding errors lead to this vulnerability.

How MS helps to solve?

  • BinScope 
    • is to help detect potential vulnerabilities that can be introduced into Binary files. The tests it implements examine application binary files to identify coding and build practices that can potentially render the application vulnerable to attack or to being used as an exploit attack vector.

  • Attack Surface Analyzer
    • The purpose of this tool is to help software developers, Independent Software Vendors (ISVs) and IT Professionals better understand changes in Windows systems’ attack surface resulting from the installation of new applications. It's for the analysis of changes made to the attack surface of the OS.



Unsecured transportation & Solutions



Why Secure transportation channel?
  • Packet across network readable and there a risk to getting hacked. For example using Wireshark can caputer the  packets. Most important of online business is creating a trusted, secured & confident purchases environment.

How MS helps to solve?
  • The Secure Sockets Layer (SSL) is a computer networking protocol that manages server authentication, client authentication and encrypted communication between servers and clients. SSL uses a combination of public-key and symmetric-key encryption to secure a connection between two machines, typically a Web or mail server and a client machine, communicating over the Internet or an internal network.


Obfuscation & Solutions

What is Obfuscation?
  • Obfuscation is to make code harder to understand or read. The code is often obfuscated to protect it from such an attack. Deobfuscation techniques, such as program slicing, are sometimes employed to reverse engineer obfuscation.

What is the use of Obfuscators?
  • Compresses managed resources to reduce the size of the assembly. Takes all the DLLs and merges dependencies into the main assembly, so you don't have to load lots of DLL files, and so that they can also be obfuscated. Compresses and embeds your dependencies into your main assembly, simplifying the deployment of your software and reducing the size of your program. Remove unused codes make .NET assembly smaller.

Finally, This may helps you to understand application vulnerabilities & practice SDL

Specially thanks to MVP Walter Wong

References:

MS Tech Ed 2015 - Dev325: Security Awareness for .Net Developers by MVP Walter Wong

B' happiiiiiii always..............!

Monday, February 16, 2015

Little about a Windows Mobile app

I wanted to share with you what I have learn form MS Tech Ed 2015.

Windows Phone platform commonly known as a mobile platform that provides personalized characteristic, unique experience and smooth performance. In 2014, a signature cinema chain launches a Windows Phone GCS application with Microsoft. 

I got an opportunity to listen to a speech of one of a big figure in IT about an architectural & development experience of the Golden Screen Cinema windows mobile app.



During the development life cycle they have highly focus on the following facts.


  • Identified the Platform uphill Challenges
    • iOS & Anroid already exists with high number of download
    • Customer does not understand Windows Phone from consumer
    • Windows phone platform market share is not convincing
  • Strategy
    • Differentiate itself from iOS & Anroid
    • Propose  new features & hopefully new business to generate more revenue
    • Using Hi-fidelity story-boarding to convince customers
  • Improvement Challengers
    • Better brand marketing
    • Increase application performance & reduce internet data usage
    • Support new method of payment via mobile app
    • Speed up application loading time & don't sacrifice user experience
    • Mobile application version checking
  • Increase application performance
    • Cache movie poster image offline
    • Download once & reuse
    • Reduce Flickr effect
  • Key Features
    • Voice Recognition
    • Movie poster stick to the wall paper
    • Advertising
    • Movies details & biography
    • Offline history records
    • Remainders for movie date time& snacks orders
    • Continuous client support
  • Conclusion
    • Understand platform capability during proposal stage and be innovative
    • Understand customer needs 
    • Stay connected with customers

Think different...

Specially thanks to MVP Walter Wong

References:

MS Tech Ed 2015 - Dev216 - Journey of Developing Windows Phone Application for Cinema by MVP Walter Wong

B' happiiiiiii always..............!

Wednesday, February 11, 2015

Waiting for VS 2015.....


I wanted to share with you what I have learn form MS Tech Ed 2015.

As all of you know VS 2015 CTP was released very recently. And they are waiting for the user feed backs for the final release.


New Features:


Create custom window layouts
enables to save up to 10 custom window layouts and quickly switch between them
Menu -> Window -> Save/Apply/ Mange or Reset Window layouts

Color management & Fade up unused component
fade up all the unused componanet & able to clean up at once with the help of lightbulb option

Colorized tool tips
when hover over collapsible outline editor display the hidden code in full color and even shows the full declaration to provide more context



Code fixes and Refactorings
When hover over an error or warning in the editor then it will often show a lightbulb with a tooltip explaining the problem. The lightbulb tells us there are possible fixes for the problem.
By right click on the code & select Quick Actions will helps to define a toll tip which contains the existing code in red & correction code in green




Debugging improved
Debugging has more extensive support for modern language features like LINQ queries, Lambda Expressions and Extension Methods, that can now be used in the Watch window, Immediate window, conditional breakpoints and other debugger contexts




Inline renaming
rename re factoring find all of the references to rename and do tons of work, taking minutes on a large solution. rename works as inline in the editor.




Diagnostic analyzer
new window appears while debugging that gives Debugger Events (with IntelliTrace), Memory Usage, and CPU Usage

Blend
with new look Start page links to recent projects, creating new projects and lots of related content and news.Solution Explorer contains lists projects, folders and files and Properties are switched to using Visual Studio-like layout. Code/XAML editor supports IntelliSense across both code window and XAML

View History
ability to monitor code change history inspecting the functions.

.Net natives
ability to configure
right click on project -> Properties -> Build -> enable Compile with ,net (not clear)

Specially thanks to MVP Walter Wong

References:

MS Tech Ed 2015 - Dev233 - New Improvements of Microsoft Visual Studio 2015 by MVP Walter Wong
http://www.c-sharpcorner.com/UploadFile/736ca4/new-improvement-of-C-Sharp-and-visual-basic-in-visual-studio-2015/
http://blogs.msdn.com/b/visualstudio/archive/2015/01/16/visual-studio-2015-cpt-5-now-available.aspx

B' happiiiiiii always..............!

Monday, January 26, 2015

What SSH is....


SSH ??



It’s a certain way for devices to communicate with each other over a network..FTP and SSH are both network protocols that run on top of the TCP/IP layer, just like HTTP. 


Just like a web browser uses the HTTP protocol to talk with websites, a shell account needs a certain protocol to enable data exchange between the two networked devices. 


SSH – Secure Shell Protocol.


SSH uses a public key encryption and was developed to replace Telnet and other insecure shell protocols. The two major versions, SSH-1 and SSH-2, are now the dominating protocols to access shell accounts.


These days, SSH is used to log into and execute code on remote hosts, browse the web using encrypted proxy clients, and transfer files – even setting up a Virtual Private Network.


SSH clients are available for all major operating systems. Unix-based systems, including Linux and Mac OS X, can use OpenSSH.


FTPS


pros:



  • Widely known and used
  • The communication can be read and understood by the human
  • Provides services for server-to-server file transfer
  • SSL/TLS has good authentication mechanisms (X.509 certificate features)
  • FTP and SSL/TLS support is built into many internet communication frameworks.

cons:


  • Doesn’t have a uniform directory listing format
  • Requires a secondary DATA channel, which makes it hard to use behind the firewalls
  • Doesn’t define a standard for file name character sets (encodings)
  • Not all FTP servers support SSL/TLS
  • Doesn’t have a standard way to get and change file and directory attributes

SFTP

pros:



  • Has good standards background which strictly defines most (if not all) aspects of operations
  • Has only one connection (no need for DATA connection)
  • The connection is always secured
  • The directory listing is uniform and machine-readable
  • The protocol includes operations for permission and attribute manipulation, file locking and more functionality

cons:


  • The communication is binary and can’t be logged “as is” for human reading
  • SSH keys are harder to manage and validate
  • The standards define certain things as optional or recommended, which leads to certain compatibility problems between different software titles from different vendors.
  • No server-to-server copy and recursive directory removal operations
  • No built-in SSH/SFTP support in VCL and .NET frameworks

References:

Wednesday, June 18, 2014

Little about MVC versions...


MVC is a new Framework to develop web application. It helps to implements the MVC pattern which helps to provides separation of code and also provide better support for test-driven development (TDD).

Asp.Net MVC is a lightweight and highly testable open source framework for building highly scalable and well designed web applications.

Here is the little about version history of ASP.NET MVC Framework.

MVC1 :

Released on Mar 13, 2009
Runs on .Net 3.5 and with Visual Studio 2008 & Visual Studio 2008 SP1
MVC Pattern architecture with WebForm Engine
Html Helpers
Ajax helpers
Routing
Unit Testing

MVC2 :

Released on Mar 10, 2010
Runs on .Net 3.5, 4.0 and with Visual Studio 2008 & 2010
Strongly typed HTML helpers means lambda expression based Html Helpers
Templated Helpers
Support for Data Annotations Attribute
Client-side validation
UI helpers with automatic scaffolding & customizable templates
Attribute-based model validation on both client and server
Overriding the HTTP Method Verb including GET, PUT, POST, and DELETE
Areas for partitioning a large applications into modules
Asynchronous controllers

MVC3 :

Released on Jan 13, 2011
Runs on .Net 4.0 and with Visual Studio 2010
The Razor view engine
Improved Support for Data Annotations
Remote Validation
Compare Attribute
Sessionless Controller
Child Action Output Caching
Dependency Resolver
Entity Framework Code First support
Partial-page output caching
ViewBag dynamic property for passing data from controller to view
Global Action Filters
Better JavaScript support with unobtrusive JavaScript, jQuery Validation, and JSON binding
Use of NuGet to deliver software and manage dependencies throughout the platform
Good Intellisense support for Razor into Visual Studio

MVC4 :

Released on Aug 15, 2012
Runs on .Net 4.0, 4.5 and with Visual Studio 2010SP1 & Visual Studio 2012
ASP.NET Web API
Enhancements to default project templates
Mobile project template using jQuery Mobile
Display Modes
Task support for Asynchronous Controllers
Bundling and minification
Support for the Windows Azure SDK

MVC5 :

Released on 17 October 2013
Runs on .Net 4.5, 4.5.1 and with Visual Studio 2013
One Asp.Net
Asp.Net Identity
ASP.NET Scaffolding
Authentication filters - run prior to authorization filters in 

the ASP.NET MVC pipeline
Bootstrap in the MVC template
ASP.NET Web API2

MVC 6 :

Coming Soon
Support Visual Studio 2014
Part of ASP.NET vNext
MVC, Web API, and Web Pages frameworks merged into one framework
Removes a lot of overlap between MVC, Web API, and Web Pages
Self-hosting just like Web API 2 and SignalR 2
Uses a common set of abstractions for routing, action selection, filters, model binding, and so on
Use the framework to create both UI (HTML) and web APIs
Eliminates the dependencies on the legacy System.Web infrastructure
Support side-by-side deployment 
(That means you can update your app without affecting other applications on the same server)
Pay as you go: turned on in the application startup routine
Azure and PowerShell Based Deployments
The Build Process Doesn’t Build
Full Framework vs Cloud Optimized Framework

References:
http://www.asp.net/mvc/tutorials/mvc-5/database-first-development/setting-up-database
http://www.dotnet-tricks.com/Tutorial/mvc/XWX7210713-A-brief-history-of-Asp.Net-MVC-framework.html
http://www.infoq.com/news/2014/05/ASP.NET-vNext

B' hapiiiiiii always....!

Friday, May 9, 2014

Embedded Yammer News Feed


As all of us know Yammer is a social network mostly used in professionalism aspects.

So it will be nicer if possible to plug the Yammer features in to a web applications, So it will be a value added service & good marketing point too.

Yammer API reference make it easier to plug with the web application.

As per the sample code in below,

1) Embedding the yammer embedded js file to the html page where the news feed should be appear.

2) By changing the attributes in js file can activate the Single Sign on.
 its is just a configuration. According to attributes appearance of the yammer new feed can be customized.

 

3) Finally in the web app you can see the Yammer API & once logging user able to see the news feed as follows inside the application.


Its quiet easy way for a plug able News feed in a web application.

References: 

B' hapiiiiiii always....!

Thursday, March 13, 2014

Import Excel to SQL DB quiet simple....

Hi,

As POC I have done a simple project to Import Excel data to SQL Table.

It 's quiet simple & easy. I have tried to Import Excel in 3 different ways to identify which one is most effective way.

I have came across these scenarios:
  • Using .Net OleDbCommand
  • Using SSIS
  • Using OpenXml
  • Using XmlTextWriter
Actually, effectiveness depends on the Data Load. For the Bulk & the complex data I am recommending you to go with SSIS.

Let's brief one by one.

Using .Net OleDbCommand



It's just save the uploaded file & read from the FTP, then map with the columns in both Excel & DB, finally copy data in to the database.

Using SSIS



For SSIS code end it looks easy, But we have to develop and SSIS package as the requirement. If we have the deployed SSIS package, we need to just trigger the function only. 

Developing SSIS is easy & fun, But somethings I am stuck with the configurations. Only the important figures I have attached.



By defining variable we can make the package, dynamic for Excel & database.

Using OpenXml



It is similar to OleDbCommand but OpenXML is better than COM Interop in .Net. Though you don't see any significant performance in OpenXML than COM, it is easy to code. Easier to maintain. Considering the large amounts of data you should read, take a look at below link for optimizing.

Using XmlTextWriter



Here data read from an XML file content and write the same content to an Excel file. Using an XmlReader for read the XML file to the Dataset . Loop through the Dataset and add the content to the Excel file, that become slower for the big amount of data.

Refer: 
https://www.youtube.com/watch?v=jhPp_Hz54BU
http://www.gemboxsoftware.com/support/articles/article-read-write-openxml-asp-net
http://blogs.msdn.com/b/brian_jones/archive/2010/05/27/parsing-and-reading-large-excel-files-with-the-open-xml-sdk.aspx
https://www.youtube.com/watch?v=79mi31caAag


I think this will be helpful for you..

B' happy always....... :)