Sunday 30 August 2020

Learning Web Pentesting With DVWA Part 2: SQL Injection

In the last article Learning Web Pentesting With DVWA Part 1: Installation, you were given a glimpse of SQL injection when we installed the DVWA app. In this article we will explain what we did at the end of that article and much more.
Lets start by defining what SQL injection is, OWASP defines it as: "A SQL injection attack consists of insertion or "injection" of a SQL query via the input data from the client to the application. A successful SQL injection exploit can read sensitive data from the database, modify database data (Insert/Update/Delete), execute administration operations on the database (such as shutdown the DBMS), recover the content of a given file present on the DBMS file system and in some cases issue commands to the operating system. SQL injection attacks are a type of injection attack, in which SQL commands are injected into data-plane input in order to effect the execution of predefined SQL commands."
Which basically means that we can use a simple (vulnerable) input field in our web application to get information from the database of the server which hosts the web application. We can command and control (at certain times) the database of the web application or even the server.
In this article we are going to perform SQL injection attack on DVWA, so let's jump in. On the DVWA welcome page click on SQL Injection navigation link. We are presented with a page with an input field for User ID.
Now lets try to input a value like 1 in the input field. We can see a response from server telling us the firstname and surname of the user associated with User ID 1.
If we try to enter a user id which doesn't exist, we get no data back from the server. To determine whether an input field is vulnerable to SQL injection, we first start by sending a single quote (') as input. Which returns an SQL error.
We saw this in the previous article and we also talked about injection point in it. Before diving deeper into how this vulnerability can be exploited lets try to understand how this error might have occurred. Lets try to build the SQL query that the server might be trying to execute. Say the query looks something like this:
SELECT first_name, sur_name FROM users WHERE user_id = '1';
The 1 in this query is the value supplied by the user in the User ID input field. When we input a single quote in the User ID input field, the query looks like this:
SELECT first_name, sur_name FROM users WHERE user_id = ''';
The quotes around the input provided in the User ID input field are from the server side application code. The error is due to the extra single quote present in the query. Now if we specify a comment after the single quote like this:
'-- -
or
'#
we should get no error. Now our crafted query looks like this:
SELECT first_name, sur_name FROM users WHERE user_id = ''-- -';
or
SELECT first_name, sur_name FROM users WHERE user_id = ''#';
since everything after the # or -- - are commented out, the query will ignore the extra single quote added by the server side app and whatever comes after it and will not generate any error. However the query returns nothing because we specified nothing ('') as the user_id.
After knowing how things might be working on the server side, we will start to attack the application.
First of all we will try to determine the number of columns that the query outputs because if we try a query which will output the number of columns greater or smaller than what the original query outputs then our query is going to get an error. So we will first figure out the exact number of columns that the query outputs and we will do that with the help of order by sql statement like this:
' order by 1-- -
This MySQL server might execute the query as:
SELECT first_name, sur_name FROM users WHERE user_id = '' order by 1-- -';
you get the idea now.
if we don't get any error message, we will increase the number to 2 like this:
' order by 2-- -
still no error message, lets add another:
' order by 3-- -
and there we go we have an error message. Which tells us the number of columns that the server query selects is 2 because it erred out at 3.
Now lets use the union select SQL statement to get information about the database itself.
' union select null, version()-- -
You should first understand what a union select statement does and only then can you understand what we are doing here. You can read about it here.
We have used null as one column since we need to match the number of columns from the server query which is two. null will act as a dummy column here which will give no output and the second column which in our case here is the version() command will output the database version. Notice the output from the application, nothing is shown for First name since we specified null for it and the maria db version will be displayed in Surname.
Now lets check who the database user is using the user() function of mariadb:
' union select null, user()-- -
After clicking the submit button you should be able to see the user of the database in surname.

Now lets get some information about the databases in the database.
Lets determine the names of databases from INFORMATION_SCHEMA.SCHEMATA by entering following input in the User ID field:
' union select null, SCHEMA_NAME from INFORMATION_SCHEMA.SCHEMATA-- -
This lists two databases dvwa and information_schema. information_schema is the built in database. Lets look at the dvwa database.
Get table names for dvwa database from INFORMATION_SCHEMA.TABLES
' union select null, TABLE_NAME from INFORMATION_SCHEMA.TABLES-- -
It gives a huge number of tables that are present in dvwa database. But what we are really interested in is the users table as it is most likely to contain user passwords. But first we need to determine columns of that table and we will do that by querying INFORMATION_SCHEMA.COLUMNS like this:
' union select null, COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'users'-- -

We can see the password column in the output now lets get those passwords:
' union select user, password from users-- -
Of-course those are the hashes and not plain text passwords. You need to crack them.
Hope you learned something about SQL injection in this article. See you next time.

References:

1. SQL Injection: https://owasp.org/www-community/attacks/SQL_Injection
2. MySQL UNION: https://www.mysqltutorial.org/sql-union-mysql.aspx
3. Chapter 25 INFORMATION_SCHEMA Tables: https://dev.mysql.com/doc/refman/8.0/en/information-schema.html

More information


Parrot Security OS 4.7 Released With New Linux Kernel, Menu Structure, Tools Improvements And Many Changes


In Sep 18 2019, Parrot Security OS 4.7 has released, with many new following changes below.

Latest Linux 5.2.x series
   The new ISO files of Parrot 4.7 are being released only now, but we were the first Debian derivative distribution to introduce Linux 5.1 and 5.2 to all our users, and now ParrotSec team is ready to offer it also with our ISO files rebild cycle to support more devices and integrate all the latest linux features from the beginning.

New sandbox behavior (opt-in rather than opt-out)
   Sandboxing is a great thing, and ParrotSec team was in the first line when they introduced our custom Firejail and AppArmor solution for the first time many years ago. We still want to improve such feature and ParrotSec team has a whole team dedicated to improve sandboxing and hardening of the Parrot Security OS system, but ParrotSec team had to face the many users with issues caused by the restrictions of our sandbox.

   In Parrot Security OS 4.7 the sandbox is disabled by default, and users can decide wether to start an application sandboxed or not. You can easily start the sandboxed version of an installed program from the /sandbox/ folder or from a dedicated menu that ParrotSec team plans to improve in the future (meanwhile the search feature of the bottom menu will fit all your needs), or you can re-enable it by default by using the firecfg tool.

New menu structure and tools improvements
   The pentesting menu structure was refactored and re-designed to make tools easier to access in a more logical hierarchical structure. New tools were also added to the project, and ParrotSec team plans to add even more in the future. Not all of them are going to be pre-installed, but a good set of tools in our repository enables pentesters to build up the perfect pentest system for their specific needs, regardless the default package selection picked by ParrotSec team.

Domain changes
   To reflect the neutrality of a distro that started as a pentest-only system and became more general purpose later with Parro Home, the community voted through a democratic process to switch to parrotlinux.org as the new default domain of the project.

   ParrotSec team will still use ParrotSec.org for other things (included the old email addresses), and they introduced other project domains to handle specific parts of the infrastructure.

Repository changes
   ParrotSec team is preparing to integrate a future LTS branch, so they decided to rename the current repository from stable to rolling. Nothing changes for the end user, and the current Parrot Security OS branch will continue to behave the same as before, but now with a different name to better reflect the rolling release nature of the system, waiting for the LTS edition to join the Parrot Security OS family along side the rolling branch in a similar way OpenSUSE does.

New MATE 1.22 release: Parrot Security OS 4.7 ships with the latest MATE 1.22 desktop environment.

Miscellaneous: New Firefox Browser 69, the latest Radare2 and cutter versions and many other important upgrades are all aboard as expected in a properly developed rolling release distro.

How to upgrade to the lastest Parrot Security OS version
   You can update your existing Parrot Security OS system with this command:
sudo parrot-upgrade

   Or use the raw apt command
sudo apt update
sudo apt full-upgrade


   Don't forget to use this command regularly (at least once a week) to receive the latest security updates and bugfixes from the Parrot Security OS repository.

   Or you can download the latest release from official download page.

Continue reading


  1. Hack And Tools
  2. Easy Hack Tools
  3. Hacker Tools For Windows
  4. Hacker Tools Linux
  5. Pentest Tools Windows
  6. Pentest Tools Website
  7. Hacker Tools 2020
  8. Hacks And Tools
  9. Pentest Tools List
  10. Pentest Tools For Windows
  11. Pentest Tools Apk
  12. Pentest Tools Framework
  13. Hacking Tools And Software
  14. Ethical Hacker Tools
  15. Hack Tool Apk No Root
  16. Pentest Tools Download
  17. Usb Pentest Tools
  18. Pentest Tools Android
  19. Hacker Security Tools
  20. Black Hat Hacker Tools
  21. Pentest Tools Review
  22. Pentest Tools
  23. Hacker Tools
  24. Physical Pentest Tools
  25. Nsa Hack Tools Download
  26. Hacker Tools Free
  27. Hack Rom Tools
  28. Hacking Tools Download
  29. Hacking Tools For Kali Linux
  30. Hacking Apps
  31. Hacker Tools Free
  32. Blackhat Hacker Tools
  33. Hack Tools For Games
  34. Hacker Search Tools
  35. Pentest Recon Tools
  36. Hacker Tools Apk Download
  37. Hack Tools For Windows
  38. Pentest Tools Tcp Port Scanner
  39. Beginner Hacker Tools
  40. Hacker Tools Software
  41. Pentest Tools Nmap
  42. Hacking Tools Mac
  43. Pentest Tools Linux
  44. Pentest Tools Open Source
  45. Free Pentest Tools For Windows
  46. Pentest Tools Review
  47. Hacking Tools Online
  48. Pentest Tools Linux
  49. Hacker Tools
  50. Pentest Tools Linux
  51. Pentest Tools Bluekeep
  52. Hacking Tools For Games
  53. Nsa Hacker Tools
  54. Pentest Tools Framework
  55. Black Hat Hacker Tools
  56. Hacker Tools For Windows
  57. Hack Tools Download
  58. Pentest Tools Online
  59. Hacker Tools For Windows
  60. Free Pentest Tools For Windows
  61. Hack Tools
  62. Tools 4 Hack
  63. World No 1 Hacker Software
  64. Hack Tools For Pc
  65. Pentest Automation Tools
  66. Hacks And Tools

HOW TO BECOME A CERTIFIED ETHICAL HACKER

7 Tips to become a hacker?
It is very important for a hacker to learn different types of programming language such as C,C++,Python,Java,PHP etc and it is also necessary to learn hardware and networking for a good hacker because these skill are very useful to become a successful hacker.

1-Programming Language are essential to becoming a good hacker 

2-Networking skills is important to becoming an effective hacker.

3-SQL language are essential to becoming an effective hacker 

4-Internet surfing is also essential for becoming a hacker for gathering information.

5-Cryptography is essential to becoming a certified hacker from which a hacker can share his/her readable data to other person in a nonreadable form with the help of Cryptography.

6-Penetration testing  is also important for a hacker.

7-experiment a lot is also very useful to becoming a ethical hacker.

Follow me on insta_anoymous_adi

Related links


Saturday 29 August 2020

Memoryze


"MANDIANT Memoryze is free memory forensic software that helps incident responders find evil in live memory. Memoryze can acquire and/or analyze memory images, and on live systems can include the paging file in its analysis." read more...

Download: http://fred.mandiant.com/MemoryzeSetup.msi

Related articles
  1. Black Hat Hacker Tools
  2. Pentest Tools For Android
  3. How To Make Hacking Tools
  4. Hacking Tools For Kali Linux
  5. Hacker Tools List
  6. Pentest Tools For Ubuntu
  7. Hackrf Tools
  8. Blackhat Hacker Tools
  9. Hack Website Online Tool
  10. Hacking Tools For Windows 7
  11. Hack Tools For Mac
  12. Hacker Techniques Tools And Incident Handling
  13. Hacker Hardware Tools
  14. Hacking Tools Windows 10
  15. Nsa Hack Tools
  16. Pentest Tools For Android
  17. Hack And Tools
  18. Hacker Tools Mac
  19. Pentest Tools Linux
  20. Hacking Tools Windows 10
  21. Pentest Box Tools Download
  22. How To Make Hacking Tools
  23. Hacker Security Tools
  24. Hacker Tool Kit
  25. Hacking Tools 2019
  26. Hacking Tools Name
  27. Install Pentest Tools Ubuntu
  28. Hacker Security Tools
  29. Pentest Tools For Windows
  30. Hack Tools Online
  31. Pentest Tools Website Vulnerability
  32. Hack Tools
  33. Hack Tools Github
  34. Pentest Automation Tools
  35. Hacking Tools Kit
  36. Pentest Tools Find Subdomains
  37. How To Install Pentest Tools In Ubuntu
  38. Easy Hack Tools
  39. Hacking Tools Kit
  40. Hack App
  41. Tools Used For Hacking
  42. Hacker Security Tools
  43. Pentest Tools Android
  44. Hack Tools
  45. Hacker Security Tools
  46. Pentest Tools Apk
  47. Hacker Security Tools
  48. Hacker Tools Apk
  49. Hack Tools 2019
  50. Pentest Tools Framework
  51. Hacker Tools For Mac
  52. Hacker Tools Windows
  53. Blackhat Hacker Tools
  54. Pentest Tools Apk
  55. Hack Tools Mac
  56. Hack Tools 2019
  57. Tools For Hacker
  58. Ethical Hacker Tools
  59. Ethical Hacker Tools
  60. Hacker
  61. Hacking Tools Online
  62. Computer Hacker
  63. How To Install Pentest Tools In Ubuntu
  64. Pentest Tools Port Scanner
  65. Pentest Tools Linux
  66. Hack Website Online Tool
  67. Wifi Hacker Tools For Windows
  68. Hacks And Tools
  69. Physical Pentest Tools
  70. Pentest Tools Open Source
  71. Pentest Tools Website
  72. Hacking Apps
  73. Hacking Tools For Mac
  74. Pentest Tools Github
  75. Pentest Tools Windows
  76. Hacker Tools For Ios
  77. Hacking Tools For Windows 7
  78. Pentest Tools List
  79. Hacking Tools For Pc
  80. Pentest Tools Github
  81. Hacking Tools For Windows Free Download
  82. Hacker Tools For Pc
  83. Hacker Tools Apk
  84. Hacking Tools Software
  85. Free Pentest Tools For Windows
  86. Hack App
  87. Hacks And Tools
  88. Game Hacking
  89. Best Pentesting Tools 2018
  90. What Are Hacking Tools
  91. Pentest Tools Nmap
  92. Hacking Tools Download
  93. Hacker Tools For Windows
  94. Best Hacking Tools 2019
  95. Hacking Tools Software
  96. Nsa Hack Tools
  97. Hacking Tools Usb
  98. Pentest Tools For Windows
  99. Hack Tool Apk
  100. Tools 4 Hack
  101. Hack Tools For Ubuntu
  102. Hacker Tools List
  103. Hacker Tools Apk
  104. Hacking Tools Usb
  105. Hacker Tool Kit
  106. Hacker
  107. Pentest Tools Bluekeep
  108. How To Make Hacking Tools
  109. Hack Rom Tools
  110. Pentest Tools For Windows
  111. Pentest Tools Apk
  112. Hacker
  113. Tools 4 Hack
  114. Pentest Tools Find Subdomains
  115. Hack Website Online Tool
  116. How To Make Hacking Tools
  117. Hack Website Online Tool
  118. Hacker Tools 2020
  119. Pentest Tools
  120. Pentest Tools Url Fuzzer
  121. Pentest Tools For Ubuntu
  122. Hacking Tools 2019
  123. Hacker Tools 2019
  124. Hacking Tools Usb
  125. Pentest Tools For Mac
  126. Pentest Tools Website Vulnerability
  127. Hack Tools
  128. Hacking Tools For Windows 7
  129. Pentest Tools Subdomain
  130. Hack Tools
  131. Hacking Tools 2019
  132. Hacker Tools Linux