SlideShare a Scribd company logo
1 of 22
Download to read offline
JSON Fuzzing: New
           approach to old problems

- Tamaghna Basu            - K.V.Prashant
tamaghna.basu@gmail.com    good.best.guy@gmail.com



http://null.co.in/                      http://nullcon.net/
Who are we?
        We are still discovering ourselves
        • Kaun hu main…
        • kahan hu main….
        • Main yahan kaise aya…
        • Purpose of my life…

      Till then,
      K.V.Prashant :- CEH, CISSP Security
           consultant/researcher. An avid null
           community member.


    Tamaghna Basu :- GCIH, CEH, ECSA, RHCE,
       Diploma in Cyber Law. Once coder, now
       researcher. A net addict citizen of India.




http://null.co.in/                                  http://nullcon.net/
What are you going to
           tolerate in next 30 mins or so…
      • Lazy bums we are.
      • Wanted an easy tool to
        test apps with JSON
        support. Unable to find
        one.
      • Laziness inside us
        prompted us to use an
        existing to and add JSON
        functionality instead
        building it from scratch.



http://null.co.in/                      http://nullcon.net/
Disclaimer
      We are not responsible for any mental, financial and
       physical health issues arising after viewing this
       presentation.

      We are not responsible for any damage to conference
       venue arising due our conference speech


                             So be seated at your own risk 


http://null.co.in/                                     http://nullcon.net/
Why are we here?
                              Because of him…
                              • American computer
                                programmer and
                                entrepreneur

                              • More popular for his
                                involvement and creation of
                                JSON format

                                           (Ref: Wikipedia)
          Doglas Croockford


http://null.co.in/                                   http://nullcon.net/
JSON:- What is that ?
      JSON (an acronym for JavaScript Object Notation) is a
         lightweight text-based open standard designed for human-
         readable data interchange. It is derived from the JavaScript
         programming language for representing simple data
         structures and associative arrays, called objects. Despite its
         relationship to JavaScript, it is language-independent, with
         parsers available for most programming languages.
      The JSON format was originally specified by Douglas Crockford,
         and is described in RFC 4627. The official Internet media type
         for JSON is application/json. The JSON filename extension is
         .json
      Blah… Blah… Blah…
                            SEE Wikipedia…
http://null.co.in/                                              http://nullcon.net/
JSON:- What is that ?
      In simple language
       It's a method to exchange data in a simple structured
         format between web-client and server.
       Mostly used with AJAX request/response scenarios.
       Lightweight, lesser tags and easy to parse- less
         computational intensive than XML
       Extensively used in applications developed by
         companies like Google, Yahoo, Amazon etc.



http://null.co.in/                                     http://nullcon.net/
JSON: Client Side processing
             var abc ='{"loginId":"'+ document.test.name.value +'","pwd":"'+
                document.test.password.value +'"}';
             var req = null;
             if (window.XMLHttpRequest) {
               req = new XMLHttpRequest();
             } else if (window.ActiveXObject) {
             try {
                   req = new ActiveXObject("Msxml2.XMLHTTP");
                 } catch (e) {
                               try {
                                      req = new ActiveXObject("Microsoft.XMLHTTP");
                                    } catch (e) {}
                             }
                   }
                   req.onreadystatechange = function() {
                                if(req.readyState == 4) {
                            if(req.status == 200) {
                               var employee=eval(+req.responseText+);
                                   document.write(employee.name);
                                      document.write(employee.age);
                          }else {
                            document.getElementById("realtooltip2").innerHTML="Error: returned status code " + req.status + " " + req.statusText;
                          }
                    }
                 };
                 req.open("POST", "http://in-prashantkv.in.kworld.kpmg.com:8080/servlets/Search", true);
                 req.send(abc);




http://null.co.in/                                                                                                                        http://nullcon.net/
JSON: Message Format
      Request sent to server :
      {
        “LoginId”:”name”
        “pwd":"secret”
      }

      Response received from server after authentication and
          processing:
      {
        “name”:”Prashant”
        “age":"secret”
      }

http://null.co.in/                                             http://nullcon.net/
JSON: Server Side processing
      Using org.json libraries we can parse JSON object in below way:

      public class HelloWorld extends HttpServlet{
      public void doPost(HttpServletRequest request, HttpServletResponse response)
                          throws ServletException, IOException{
      {
      StringBuffer jb = new StringBuffer();
      String line = null;
      BufferedReader reader = request.getReader();

      while ((line = reader.readLine()) != null)
      jb.append(line);

      JSONObject jsonObject = new JSONObject(jb.toString());

      String pwd = jsonObject.getString("pwd");
      String uname = jsonObject.getString("loginId");
      …..



http://null.co.in/                                                                   http://nullcon.net/
JSON: Server Side processing
      Using org.json libraries we can create JSON object in below method:

      public class HelloJSON
      {
        public static void main(String args[]){
        JSONObject jobject=new JSONObject();

          jobject.put("name","prashant");
          jobject.put("Age",new Integer(25));

           .........
          }
      }




http://null.co.in/                                                          http://nullcon.net/
JSON Fuzzing: What's missing
       Almost everything 
       Current tools support only name/value pair
        format of data e.g.
        login=test&passwd=test123&seclogin=on
       But not JSON format like:
        {"loginId":"test@ttt.com","pwd":"12345"}
       Tiresome to edit each field each field in http
        proxies like paros


http://null.co.in/                                http://nullcon.net/
JSON Fuzzing: What's missing




    login=test&passwd=test
    123&seclogin=on&Form
    Name=existing



http://null.co.in/                         http://nullcon.net/
JSON Fuzzing: What's missing




http://null.co.in/                         http://nullcon.net/
JSON Fuzzing: What's missing




http://null.co.in/                         http://nullcon.net/
JSON Fuzzing: What's missing




http://null.co.in/                       http://nullcon.net/
JSON Fuzzing: What we did
       Took a popular Firefox addon
       Added conversion module to convert JSON to
        name/value pair
       Added fuzzing capabilities on converted name
        value/pair
       Convert back fuzzed values to JSON object and
        complete the request
        (current contribution still under review)

http://null.co.in/                               http://nullcon.net/
JSON Fuzzing: Demo



                            Demo




http://null.co.in/                        http://nullcon.net/
JSON Fuzzing: Road Ahead
      Support for various JSON format :
       Simple object - {"loginId":"test@ttt.com","pwd":"12345"}

       Nested object –
        { "name": "Jack ("Bee") Nimble",
          "format": { "type": "rect", "width": 1920}
        }

       Array –
        ["Sunday", "Monday", "Tuesday", "Wednesday",
        "Thursday", "Friday", "Saturday"]


http://null.co.in/                                                 http://nullcon.net/
JSON Fuzzing: Road Ahead
       Present code changes to Tamper data
        submitted to original writer
       Adding JSON fuzzing capabilities to other tools
        like Webscarab
       Release a JSON application with common
        vulnerabilities




http://null.co.in/                               http://nullcon.net/
JSON Fuzzing: References
       JSON reference site www.json.org
       JSON Ajax tutorials
        http://www.ibm.com/developerworks/web/li
        brary/wa-ajaxintro11.html
       Tamper data page
        https://addons.mozilla.org/en-
        us/firefox/addon/tamper-data/


http://null.co.in/                              http://nullcon.net/
JSON Fuzzing: Road Ahead
                      If you are still there/awake then

                                Dhanyawad

                     Special Thanks to null community
  Tamaghna Basu
  - tamaghna.basu@gmail.com                   K.V.Prashant
  - tamahawk-                                 -good.best.guy@gmail.com
  techguru.blogspot.com
  - twitter.comtitanlambda


http://null.co.in/                                           http://nullcon.net/

More Related Content

More from n|u - The Open Security Community

Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...n|u - The Open Security Community
 

More from n|u - The Open Security Community (20)

Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
 
Talking About SSRF,CRLF
Talking About SSRF,CRLFTalking About SSRF,CRLF
Talking About SSRF,CRLF
 
Building active directory lab for red teaming
Building active directory lab for red teamingBuilding active directory lab for red teaming
Building active directory lab for red teaming
 
Owning a company through their logs
Owning a company through their logsOwning a company through their logs
Owning a company through their logs
 
Introduction to shodan
Introduction to shodanIntroduction to shodan
Introduction to shodan
 
Cloud security
Cloud security Cloud security
Cloud security
 
Detecting persistence in windows
Detecting persistence in windowsDetecting persistence in windows
Detecting persistence in windows
 
Frida - Objection Tool Usage
Frida - Objection Tool UsageFrida - Objection Tool Usage
Frida - Objection Tool Usage
 
OSQuery - Monitoring System Process
OSQuery - Monitoring System ProcessOSQuery - Monitoring System Process
OSQuery - Monitoring System Process
 
DevSecOps Jenkins Pipeline -Security
DevSecOps Jenkins Pipeline -SecurityDevSecOps Jenkins Pipeline -Security
DevSecOps Jenkins Pipeline -Security
 
Extensible markup language attacks
Extensible markup language attacksExtensible markup language attacks
Extensible markup language attacks
 
Linux for hackers
Linux for hackersLinux for hackers
Linux for hackers
 
Android Pentesting
Android PentestingAndroid Pentesting
Android Pentesting
 
News bytes null 200314121904
News bytes null 200314121904News bytes null 200314121904
News bytes null 200314121904
 
XXE
XXEXXE
XXE
 
News Bytes
News BytesNews Bytes
News Bytes
 
Introduction to YARA rules
Introduction to YARA rulesIntroduction to YARA rules
Introduction to YARA rules
 
MITRE ATT&CK Framework
MITRE ATT&CK FrameworkMITRE ATT&CK Framework
MITRE ATT&CK Framework
 
Deep dive into ssrf
Deep dive into ssrfDeep dive into ssrf
Deep dive into ssrf
 
Social engineering
Social engineeringSocial engineering
Social engineering
 

Recently uploaded

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 

Recently uploaded (20)

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

nullcon 2011 - JSON Fuzzing: New approach to old problems

  • 1. JSON Fuzzing: New approach to old problems - Tamaghna Basu - K.V.Prashant tamaghna.basu@gmail.com good.best.guy@gmail.com http://null.co.in/ http://nullcon.net/
  • 2. Who are we? We are still discovering ourselves • Kaun hu main… • kahan hu main…. • Main yahan kaise aya… • Purpose of my life… Till then, K.V.Prashant :- CEH, CISSP Security consultant/researcher. An avid null community member. Tamaghna Basu :- GCIH, CEH, ECSA, RHCE, Diploma in Cyber Law. Once coder, now researcher. A net addict citizen of India. http://null.co.in/ http://nullcon.net/
  • 3. What are you going to tolerate in next 30 mins or so… • Lazy bums we are. • Wanted an easy tool to test apps with JSON support. Unable to find one. • Laziness inside us prompted us to use an existing to and add JSON functionality instead building it from scratch. http://null.co.in/ http://nullcon.net/
  • 4. Disclaimer We are not responsible for any mental, financial and physical health issues arising after viewing this presentation. We are not responsible for any damage to conference venue arising due our conference speech So be seated at your own risk  http://null.co.in/ http://nullcon.net/
  • 5. Why are we here? Because of him… • American computer programmer and entrepreneur • More popular for his involvement and creation of JSON format (Ref: Wikipedia) Doglas Croockford http://null.co.in/ http://nullcon.net/
  • 6. JSON:- What is that ? JSON (an acronym for JavaScript Object Notation) is a lightweight text-based open standard designed for human- readable data interchange. It is derived from the JavaScript programming language for representing simple data structures and associative arrays, called objects. Despite its relationship to JavaScript, it is language-independent, with parsers available for most programming languages. The JSON format was originally specified by Douglas Crockford, and is described in RFC 4627. The official Internet media type for JSON is application/json. The JSON filename extension is .json Blah… Blah… Blah… SEE Wikipedia… http://null.co.in/ http://nullcon.net/
  • 7. JSON:- What is that ? In simple language  It's a method to exchange data in a simple structured format between web-client and server.  Mostly used with AJAX request/response scenarios.  Lightweight, lesser tags and easy to parse- less computational intensive than XML  Extensively used in applications developed by companies like Google, Yahoo, Amazon etc. http://null.co.in/ http://nullcon.net/
  • 8. JSON: Client Side processing var abc ='{"loginId":"'+ document.test.name.value +'","pwd":"'+ document.test.password.value +'"}'; var req = null; if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } req.onreadystatechange = function() { if(req.readyState == 4) { if(req.status == 200) { var employee=eval(+req.responseText+); document.write(employee.name); document.write(employee.age); }else { document.getElementById("realtooltip2").innerHTML="Error: returned status code " + req.status + " " + req.statusText; } } }; req.open("POST", "http://in-prashantkv.in.kworld.kpmg.com:8080/servlets/Search", true); req.send(abc); http://null.co.in/ http://nullcon.net/
  • 9. JSON: Message Format Request sent to server : { “LoginId”:”name” “pwd":"secret” } Response received from server after authentication and processing: { “name”:”Prashant” “age":"secret” } http://null.co.in/ http://nullcon.net/
  • 10. JSON: Server Side processing Using org.json libraries we can parse JSON object in below way: public class HelloWorld extends HttpServlet{ public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{ { StringBuffer jb = new StringBuffer(); String line = null; BufferedReader reader = request.getReader(); while ((line = reader.readLine()) != null) jb.append(line); JSONObject jsonObject = new JSONObject(jb.toString()); String pwd = jsonObject.getString("pwd"); String uname = jsonObject.getString("loginId"); ….. http://null.co.in/ http://nullcon.net/
  • 11. JSON: Server Side processing Using org.json libraries we can create JSON object in below method: public class HelloJSON { public static void main(String args[]){ JSONObject jobject=new JSONObject(); jobject.put("name","prashant"); jobject.put("Age",new Integer(25)); ......... } } http://null.co.in/ http://nullcon.net/
  • 12. JSON Fuzzing: What's missing  Almost everything   Current tools support only name/value pair format of data e.g. login=test&passwd=test123&seclogin=on  But not JSON format like: {"loginId":"test@ttt.com","pwd":"12345"}  Tiresome to edit each field each field in http proxies like paros http://null.co.in/ http://nullcon.net/
  • 13. JSON Fuzzing: What's missing login=test&passwd=test 123&seclogin=on&Form Name=existing http://null.co.in/ http://nullcon.net/
  • 14. JSON Fuzzing: What's missing http://null.co.in/ http://nullcon.net/
  • 15. JSON Fuzzing: What's missing http://null.co.in/ http://nullcon.net/
  • 16. JSON Fuzzing: What's missing http://null.co.in/ http://nullcon.net/
  • 17. JSON Fuzzing: What we did  Took a popular Firefox addon  Added conversion module to convert JSON to name/value pair  Added fuzzing capabilities on converted name value/pair  Convert back fuzzed values to JSON object and complete the request (current contribution still under review) http://null.co.in/ http://nullcon.net/
  • 18. JSON Fuzzing: Demo Demo http://null.co.in/ http://nullcon.net/
  • 19. JSON Fuzzing: Road Ahead Support for various JSON format :  Simple object - {"loginId":"test@ttt.com","pwd":"12345"}  Nested object – { "name": "Jack ("Bee") Nimble", "format": { "type": "rect", "width": 1920} }  Array – ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] http://null.co.in/ http://nullcon.net/
  • 20. JSON Fuzzing: Road Ahead  Present code changes to Tamper data submitted to original writer  Adding JSON fuzzing capabilities to other tools like Webscarab  Release a JSON application with common vulnerabilities http://null.co.in/ http://nullcon.net/
  • 21. JSON Fuzzing: References  JSON reference site www.json.org  JSON Ajax tutorials http://www.ibm.com/developerworks/web/li brary/wa-ajaxintro11.html  Tamper data page https://addons.mozilla.org/en- us/firefox/addon/tamper-data/ http://null.co.in/ http://nullcon.net/
  • 22. JSON Fuzzing: Road Ahead If you are still there/awake then Dhanyawad Special Thanks to null community Tamaghna Basu - tamaghna.basu@gmail.com K.V.Prashant - tamahawk- -good.best.guy@gmail.com techguru.blogspot.com - twitter.comtitanlambda http://null.co.in/ http://nullcon.net/