Skip to content

Commit d318847

Browse files
authored
Merge pull request #305 from Fudgedotdotdot/master
azrte-Fudgedotdotdot
2 parents b81257d + 7e4c12b commit d318847

1 file changed

Lines changed: 32 additions & 4 deletions

File tree

src/pentesting-cloud/azure-security/az-privilege-escalation/az-functions-app-privesc.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,12 +357,40 @@ Then, you can access with these **basic auth credentials to the SCM URL** of you
357357
curl -u '<username>:<password>' \
358358
https://<app-name>.scm.azurewebsites.net/api/settings -v
359359
360-
# Deploy code to the funciton
361-
zip function_app.zip function_app.py # Your code in function_app.py
362-
curl -u '<username>:<password>' -X POST --data-binary "@<zip_file_path>" \
363-
https://<app-name>.scm.azurewebsites.net/api/zipdeploy
364360
```
365361
362+
You can download, modify and upload new function code :
363+
364+
365+
```bash
366+
# download
367+
curl -u '<username>:<password>' -X GET \
368+
https://<app-name>.scm.azurewebsites.net/api/zip/site/wwwroot/ \
369+
-o current_function_code.zip
370+
371+
unzip current_function_code.zip -d updated_code/
372+
cd updated_code/
373+
#... modify the function code
374+
zip -r ../updated_function_app.zip .
375+
cd ../
376+
377+
# upload
378+
curl -u '<username>:<password>' https://<app-name>.scm.azurewebsites.net/api/zipdeploy -X POST --data-binary @updated_function_app.zip -v
379+
```
380+
381+
You can even upload a specific file :
382+
383+
```bash
384+
curl -u '<username>:<password>' \
385+
-X PUT \
386+
-H "Content-Type: application/javascript" \
387+
-H "If-Match: *" \
388+
--data-binary "@./my_local_payload.js" \
389+
"https://<app-name>.scm.azurewebsites.net/api/vfs/site/wwwroot/hello-world/index.js" # example NodeJS file
390+
```
391+
392+
393+
366394
_Note that the **SCM username** is usually the char "$" followed by the name of the app, so: `$<app-name>`._
367395
368396
You can also access the web page from `https://<app-name>.scm.azurewebsites.net/BasicAuth`

0 commit comments

Comments
 (0)