OWASP / SecurityShepherd

Web and mobile application security training platform
https://owasp.org/www-project-security-shepherd/
GNU General Public License v3.0
1.34k stars 452 forks source link

What address for server in 'untrusted input' and admin ? #459

Open Samuel-BF opened 5 years ago

Samuel-BF commented 5 years ago

Hello,

Now I'm on "Mobile Security Decisions via Untrusted Input" lesson. It was OK to launch the '****' activity, but it failed to fetch the result.

Of course, if this is part of the challenge, just tell me and close this report.

Note: digging into the code, the same API calls are made from "ShepherdLogin" app (MobileShepherd/ShepherdLogin/app/src/main/java/com/mobshep/shepherdlogin/LoggedIn.java)

Thanks!

SeanDuggan commented 5 years ago

Hi @Samuel-BF ,

Thanks for raising this. From your description I see two changes that need to be made here:

1) Prepending "https://" to the server URI as well as message showing the user how the address was saved. I am replacing this feature with a global server URI saved in a Android Preferences function on the next iteration of the Mobile App. (which will include all levels in one app)

2) The server should be the IP or URL of the shepherd instance you're running. So the goal in this challenge is to call up an exported activity using adb shell or a tool like drozer and then get the key. With the configured server URI the key is called from the shepherd web instance and the key is revealed. This should be made more clear to the user, but if a server uri is configured in the global setting which is planned, this should be a seamless process.

I will investigate this further and post an update.

Samuel-BF commented 5 years ago

2. The server should be the IP or URL of the shepherd instance you're running. So the goal in this challenge is to call up an exported activity using adb shell or a tool like drozer and then get the key. With the configured server URI the key is called from the shepherd web instance and the key is revealed. This should be made more clear to the user, but if a server uri is configured in the global setting which is planned, this should be a seamless process.

OK. It didn't worked for me for 3 reasons :

  1. My fault : i tried to fix #458 locally by simply re-importing jsp pages. I should also have imported back some other pieces of software. By the way, in current source tree, VulMobileAPI.java has totally disappeared.
  2. My configuration : initially, I set the MobileShepherd VM network connection to be host-only (or no connection). For this challenge, it is necessary to give it access to wider network (at least where the owaspShepherd instance is located). Maybe it would be useful to specify it on the lesson page ?
  3. Cert fail : the docker instance generates autosigned TLS certificates (which is expected), but MobileShepherd VM refuses to connect to the shepherd instance with this certificate. The global setting should also includes exceptions for this domain (case of single-user instance, don't care if the certificate is invalid) or a way to import the valid certificate (case of multi-user instance, where MitM attacks should be expected :-) ).