Posts

Image
This Blog is Permanatly moved to : https://medium.com/@sachin.ramesh No more posts here ! 

Jaggery From WSO2

Image
Lets See what is jaggery .. Jaggery is a framework developed by WSO2, to write web apps and HTTP-focused web services for all aspects of the application: front-end, communication, Server-side logic and persistence in pure Javascript. One of the intents of this framework is to reduce the gap between writing web apps and web services. Importantly, Jaggery is open-source and released under Apache 2.0. As a pure Javascript server-side scripting engine, Jaggery combines all the strengths of Javascript with flexibility and freedom at both the development and deployment stages. Most JavaScript webapp development mechanisms restrict developers to a framework-specific structure or patterns, which demand an additional learning curve. By contrast, with Jaggery, any developers who are versed in Javascript have everything they need to get going.  you can download and try the language from the visiting Jaggery website. so lets download and try it... visit the jaggery we

Hack The Box - How to hack in to the game ;)

Image
Firs of all lets see what is the Hack The Box   ðŸ˜ŽðŸ˜ŽðŸ˜Ž "Hack The Box is an online platform allowing you to test your penetration testing skills and exchange ideas and methodologies with other members of similar interests. It contains several challenges that are constantly updated. Some of them simulating real world scenarios and some of them leaning more towards a CTF style of challenge. As an individual, you can complete a simple challenge to prove your skills and then create an account, allowing you to connect to Hack The Box's private network (HTB Labs) where several machines await for you to hack them. By hacking machines you get points that help you advance in the Hall of Fame." when you go down the page you will be ask to click a button to join the HTB, go ahead and click it this is the first step to get invite code after you click it you will be end up a page like this asking an invite code which you wont have. don't get confused , le

Oauth - Social Login implementation

Image
Social Login with Oauth 2.0 Oauth 2.0 framework enable to get data from web servers with limited access to the 3rd party websites behalf of the resource owners.  There are several grant types to get data from resource servers  Authorization code grant type - for web apps that have back end servers Implicit grant type -  for client side scripts in web apps Client credentials grant type - server to server communications Resource owner password credentials grant type - for official apps like facebook mobile app etc.... in this example we use authorization code grant type lets starts the coding now. Step 1 - create facebook app go to the https://developers.facebook.com/ and create and app as follow. fill the relevant information go through the security check go tot the settings -> basic and copy the appID and the App secrete now you need to define what is the app domain . we are not going to host this app any ware so our app d

Implement CSRF protection - Double submit token

Image
what is double submit token Cookies? as above figure when client login to the system server generates the CSRF token and store it in the client side (on cookie) when next reques goes to server, client embed the csrf token in to submit form and sends with CSRF token cookie. when server receive an request from client, it will validate user by comparering  both CSRF token field on the submit form and CSRF token cookie. How to implement ? In this web app there are 3 files  client side -> index.html  server side -> login.php                         sever.php step 1 -  login UI     you need to model simple its index.html this is the main page of the app. this is my index.html step 2 -  when user click log in data will send to server side (login.php) and authenticate user, start session  and set 2 cookies in client webbrowser 1 - Session cookie 2 - CSRF token cookie step 3 -  when client submitted the form it should have and hidden f

implement CSRF protection - Synchronizer token pattern

Image
what is synchronizer token pattern ?  as above figure, first client browser request login page and log in to the system. same time server generates CSRF token and store it on server side. next time user interact with the server, user ask server to send CSRF token with AJAX and user submit data along with CSRF token.  so server can verify this request came from legitimate user by comparing CSRF token received and own. How to implement ? In this web app there are 3 files  client side -> index.html  server side -> login.php                         sever.php step 1 - login UI     you need to model simple its index.html this is the main page of the app. this is my index.html step 2 -  when user click log in data will send to server side (login.php) and authenticate user.  then only if user authenticated client browser will create a new cookie with current session id and relevant information. step 3 -  same time sever will be genera