Wednesday, May 31, 2023

Hackerhubb.blogspot.com

Hackerhubb.blogspot.comRead more

Learning Web Pentesting With DVWA Part 1: Installation



In this tutorial series I'm going to walk you through the damn vulnerable web application (DVWA) which is damn vulnerable. Its main goal according to the creators is "to aid security professionals to test thier skills and tools in a legal environment, help web developers better understand the process of securing web applications and to aid both students & teachers to learn about web application security in a controlled class room environment."

I am going to install DVWA in docker so the prerequisite for this tutorial will be an installation of docker (Docker is not the only way to install DVWA but if you have docker already installed then it may be the easiest way to install DVWA).

To install DVWA in docker run your docker deamon if it's not running already and open a terminal or powershell and type:

docker rum --rm -it -p 8080:80 vulnerables/web-dvwa




It will take some time to pull the image from docker hub depending on your internet speed and after it is complete it will start the dvwa application. In the command we have mapped the image instance's port 80 to our hosts port 8080 so we should be able to access the web application from our host at http://localhost:8080

Now open your favorite web browser and go to http://localhost:8080
You should be prompted with a login screen like this:



login with these creds:
username: admin
password: password

After login you'll see a database setup page since this is our first run. Click on Create / Reset Database button at the bottom. It will setup database and redirect you to login page. Now login again and you'll see a welcome page.



Now click on DVWA Security link at the bottom of the page navigation and make sure the security level is set to Low. If it is not click on the dropdown, select Low and then click submit.




Now our setup is complete, so lets try a simple SQL attack to get a taste of whats about to come.

Click on SQL Injection in navigation menu.
You'll be presented with a small form which accepts User ID.
Enter a single quote (') in the User ID input field and click Submit.
You'll see an SQL error like this:



From the error message we can determine that the server has a MariaDB database and we can see the point of injection.
Since there are many quotes we are not able to determine the exact location of our injection. Lets add some text after our single quote to see exactly where our injection point is.
Now I am going to enter 'khan in the User ID field and click Submit.



Now we can see exactly where the point of injection is. Determining the point of injection is very important for a successful SQL injection and is sometimes very hard too, though it might not be that much useful here in this exercise.

Now lets try the very basic SQL Injection attack.
In the User ID field enter ' or 1=1-- - and click Submit.



We will explain what is going on here in the next article.


References:-
1. DVWA Official Website: http://www.dvwa.co.uk/
Related news
  1. Hak5 Tools
  2. New Hacker Tools
  3. Hacking Tools For Pc
  4. Hack Tools For Windows
  5. Pentest Tools Url Fuzzer
  6. Usb Pentest Tools
  7. Hacking Tools For Kali Linux
  8. Tools For Hacker
  9. Top Pentest Tools
  10. Hacker Tools Github
  11. Pentest Tools
  12. How To Install Pentest Tools In Ubuntu
  13. Pentest Tools Nmap
  14. Github Hacking Tools
  15. Hack Tools Online
  16. Hacking Tools For Games
  17. Hacker Tools For Mac
  18. Hacking Tools Windows 10
  19. New Hack Tools
  20. Hack Tool Apk No Root
  21. Hackrf Tools
  22. Hacking Tools For Kali Linux
  23. Pentest Reporting Tools
  24. New Hack Tools
  25. Hack Tools 2019
  26. Hacking Tools For Mac
  27. Hacker Tools Linux
  28. Hacker Tools For Mac
  29. How To Install Pentest Tools In Ubuntu
  30. Beginner Hacker Tools
  31. Hacker Tools For Pc
  32. Hacking Tools For Beginners
  33. Usb Pentest Tools
  34. Hacking Tools Windows
  35. Hacking Tools Kit
  36. Hacks And Tools
  37. Nsa Hacker Tools
  38. How To Make Hacking Tools
  39. How To Install Pentest Tools In Ubuntu
  40. Pentest Tools Online
  41. Android Hack Tools Github
  42. Hackers Toolbox
  43. Black Hat Hacker Tools
  44. Pentest Tools Port Scanner
  45. Pentest Tools Download
  46. Beginner Hacker Tools
  47. Hacker Tools Mac
  48. New Hacker Tools
  49. Hackrf Tools
  50. Android Hack Tools Github
  51. Hacking Tools Free Download
  52. Hack Tools For Mac
  53. Hacking App
  54. Hack Tools For Pc
  55. Game Hacking
  56. Hack Apps
  57. Hacking Tools For Windows 7
  58. Hacking Tools And Software
  59. Hacker Techniques Tools And Incident Handling
  60. Pentest Tools Find Subdomains
  61. Hacking Tools For Windows
  62. Hacking Tools Software
  63. Best Hacking Tools 2019

Reversing Pascal String Object

There are many goodware and malware developed in pascal, and we will see that the binary generated by the pascal compilers is fascinating, not only because the small and clean generated binaries, or the  clarity of the pascal code, but also the good performance. In Linux we have Lazarus which is a good free IDE like Delphi and Kylix the free pascal IDE for windows.

The program:

program strtest;

var
  cstr:  array[0..10] of char;
  s, s2:  ShortString;

begin
  cstr := 'hello world';
  s  := cstr;
  s2 := 'test';
  
  WriteLn(cstr + ' ' + s + ' ' + s2);
end.


We are going to compile it with freepascal and lazarus, and just the binary size differs a lot:

lazarus          242,176 btytes  845 functions
freepascal       32,256 bytes   233 functions
turbopascal      2,928 bytes     80 functions  (wow)

And surprisingly turbopascal binaries are extremely light.
Lets start with lazarus:




Logically it imports from user32.dll some display functions, it also import the kernel32.dll functions and suspiciously the string operations of oleaut32.dll 


And our starting point is a function called entry that calls the console initialization and retrieve some console configurations, and then start a labyrinth of function calls.



On functions 10000e8e0 there is the function that calls the main function.

I named execute_param2 because the second param is a function pointer that is gonna be executed without parameters, it sounds like main calling typical strategy.
And here we are, it's clearly the user code pascal main function.


What it seems is that function 100001800 returns an string object, then is called its constructor to initialize the string, then the string is passed to other functions that prints it to the screen.

This function executes the method 0x1c0 of the object until the byte 0x89 is a null byte.
What the hell is doing here?
First of all let's create the function main:


Simply right button create function:

After a bit of work on Ghidra here we have the main:


Note that the struct member so high like 0x1b0 are not created by default, we should import a .h file with an struct or class definition, and locate the constructor just on that position.

The mysterious function was printing byte a byte until null byte, the algorithm the compiler implemented in asm is not as optimized as turbopascal's.

In Windbg we can see the string object in eax after being created but before being initialized:












Just before executing the print function, the RCX parameter is the string object and it still identical:


Let's see the constructor code.
The constructor address can be guessed on static walking the reverse-cross-references to main, but I located it in debugging it in dynamic analysis.


The constructor reads only a pointer stored on the string object on the position 0x98.

And we have that the pointer at 0x98 is compared with the address of the literal, so now we know that this pointer points to the string.
The sentence *string_x98 = literal confirms it, and there is not memory copy, it only points reusing the literal.



Freepascal

The starting labyrinth is bigger than Lazarus so I had to begin the maze from the end, searching the string "hello world" and then finding the string references:


There are two ways to follow the references in Ghidra, one is [ctrl] + [shift] + F  but there is other trick which is simply clicking the green references texts on the disassembly.

At the beginning I doubted and put the name possible_main, but it's clearly the pascal user code main function.




The char array initialization Is converted by freepascal compiler to an runtime initialization using mov instructions.

Reducing the coverage on dynamic we arrive to the writeln function:


EAX helds  a pointer to a struct, and the member 0x24 performs the printing. In this cases the function can be tracked easily in dynamic executing the sample.

And lands at 0x004059b0 where we see the WriteFile, the stdout descriptor, the text and the size supplied by parameter.


there is an interesting logic of what happens if WriteFile() couldn't write all the bytes, but this is other scope.
Lets see how this functions is called  and how text and size are supplied to figure out the string object.



EBX helds the string object and there are two pointers, a pointer to the string on 0x18 and the length in 0x18, lets verify it on windbg.


And here we have the string object, 0x0000001e is the length, and 0x001de8a68 is the pointer.


Thanks @capi_x for the pascal samples.

Continue reading

Tuesday, May 30, 2023

Hackerhubb.blogspot.com

Hackerhubb.blogspot.com

Related word


  1. Hack Tools Mac
  2. Hacks And Tools
  3. Hacker Tools For Pc
  4. Pentest Tools List
  5. Hacker Tools Free
  6. Free Pentest Tools For Windows
  7. Best Hacking Tools 2020
  8. Hacker Tools Online
  9. Hacking Tools Windows
  10. Hacker Hardware Tools
  11. Hacking Tools For Mac
  12. Hacker Tools Apk Download
  13. Black Hat Hacker Tools
  14. What Are Hacking Tools
  15. Hacker Tools For Mac
  16. Pentest Tools Android
  17. Hacker Tools Hardware
  18. Pentest Tools
  19. Hacker Tools For Pc
  20. Pentest Tools Windows
  21. Tools 4 Hack
  22. Hacker Tools For Windows
  23. Computer Hacker
  24. New Hack Tools
  25. Hacking Tools Name
  26. Hacking Tools Software
  27. Hacking Tools For Windows
  28. Pentest Tools Github
  29. Best Hacking Tools 2019
  30. Hacker Techniques Tools And Incident Handling
  31. Hacker Tools Linux
  32. Android Hack Tools Github
  33. Pentest Tools Find Subdomains
  34. Hacking Tools Windows
  35. Hack Tools Pc
  36. How To Install Pentest Tools In Ubuntu
  37. Hacking Tools For Games
  38. Hack Tools For Mac
  39. Hacking Tools 2020
  40. Easy Hack Tools
  41. Hack Tools For Pc
  42. Pentest Tools Download
  43. Easy Hack Tools
  44. Hacker Search Tools
  45. Hacker Tools Free Download
  46. Hacking Tools Windows
  47. Hacking Tools For Mac
  48. Ethical Hacker Tools
  49. Pentest Tools Website Vulnerability
  50. Hacking Tools Pc
  51. Best Pentesting Tools 2018
  52. Hack App
  53. Hack Tools
  54. Wifi Hacker Tools For Windows
  55. Blackhat Hacker Tools
  56. Blackhat Hacker Tools
  57. Tools For Hacker
  58. Usb Pentest Tools
  59. Pentest Tools Github
  60. Hacker Tools Mac
  61. Hack Tools Pc
  62. Hackrf Tools
  63. Pentest Tools Website
  64. Pentest Reporting Tools
  65. Pentest Tools Website
  66. Hacking Tools Name
  67. Hack Tools Download
  68. Hacking Tools Github
  69. Nsa Hacker Tools
  70. Usb Pentest Tools
  71. Hacker Tools For Pc
  72. Pentest Tools For Android
  73. Hak5 Tools
  74. Hack Tools For Mac
  75. Hack Tools For Games
  76. Hackrf Tools
  77. Pentest Tools Alternative
  78. Pentest Tools For Windows
  79. Nsa Hack Tools Download
  80. Pentest Tools Alternative
  81. What Is Hacking Tools
  82. Hacking Tools Windows 10
  83. Growth Hacker Tools
  84. Hacking App
  85. Pentest Tools List
  86. Hacking Tools 2020
  87. Termux Hacking Tools 2019
  88. Pentest Tools Alternative
  89. Pentest Tools For Windows
  90. Termux Hacking Tools 2019
  91. Hacker Tools List
  92. Hack Tools For Ubuntu
  93. Hacker Tools Hardware
  94. Hack Tools For Windows
  95. Pentest Tools Nmap
  96. Hack Tools For Ubuntu
  97. Hacking Tools
  98. Hacker
  99. Hacking App
  100. Ethical Hacker Tools
  101. Pentest Tools For Android
  102. Hacking Tools For Windows Free Download
  103. Hacker Tools Apk Download
  104. Pentest Tools Tcp Port Scanner
  105. Black Hat Hacker Tools
  106. Hacking Tools 2019
  107. What Are Hacking Tools
  108. Hack Tools Download
  109. Pentest Tools Url Fuzzer
  110. Pentest Tools Free
  111. Hacking Tools 2019
  112. Pentest Tools List
  113. Hacking Tools For Mac
  114. Hack Apps
  115. Hacker Tools Mac
  116. Hack Tools Download
  117. Nsa Hack Tools
  118. Pentest Tools Open Source
  119. Hack Tool Apk
  120. Hacking Tools Online
  121. Pentest Tools Github
  122. Hacking Tools Windows
  123. Tools For Hacker
  124. Hacking Tools Windows 10
  125. How To Install Pentest Tools In Ubuntu
  126. Install Pentest Tools Ubuntu
  127. Pentest Tools Android
  128. Hacking Tools
  129. Hacking Apps
  130. Beginner Hacker Tools
  131. Hacker Tools Mac
  132. Physical Pentest Tools
  133. Pentest Tools Windows
  134. Easy Hack Tools
  135. Hacking Tools Name
  136. Blackhat Hacker Tools
  137. Hacking Tools Kit
  138. Pentest Tools Github
  139. Hacking Tools Pc
  140. Hacker Techniques Tools And Incident Handling
  141. Pentest Tools Url Fuzzer
  142. Hacker Tools Free
  143. Tools For Hacker
  144. Pentest Tools Open Source
  145. Pentest Automation Tools
  146. Hacker Tools Github
  147. World No 1 Hacker Software
  148. Hacker Tools Free Download
  149. Beginner Hacker Tools
  150. Underground Hacker Sites
  151. Hacking Tools And Software
  152. Hacker Hardware Tools
  153. Hacking Tools Windows 10
  154. Nsa Hacker Tools
  155. Hacking Tools Online
  156. Hacker Tools For Pc
  157. Hacker Tools For Pc
  158. Hacker Tools For Mac
  159. Pentest Tools For Mac
  160. Underground Hacker Sites
  161. Usb Pentest Tools
  162. Blackhat Hacker Tools