real-time system analysis

 Daha gelişmiş sistem bilgilerini toplamak, özellikle dinamik öğeler olan çalışan işlemler, hizmetler ve aktif ağ bağlantıları hakkında bilgi edinmek için, statik makine bilgileri dışında cmdlet'ler kullanılabilir.

Get-Process, o anda çalışan tüm işlemleri detaylı bir şekilde gösterir, işlem başına CPU ve bellek kullanımı da dahil olmak üzere önemli bilgiler sunar. Bu, izleme ve hata ayıklama için güçlü bir araçtır.

Örneğin:

yaml
Terminal PS C:\Users\captain> Get-Process Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName ------- ------ ----- ----- ------ -- -- ----------- 67 5 872 500 0.06 2340 0 AggregatorHost 55 5 712 2672 0.02 3024 0 AM_Delta_Patch_1.417.483.0 309 13 18312 1256 0.52 1524 0 amazon-ssm-agent 78 6 4440 944 0.02 516 0 cmd 94 7 1224 1744 0.31 568 0 conhost [...]

Bu komut, her bir işlemin kullanımda olan bellek, CPU zamanı, işlem kimliği (PID) ve adını gösterir.

Benzer şekilde, Get-Service cmdleti, makinadaki hizmetlerin durumunu sorgular, hangi hizmetlerin çalıştığını, durduğunu veya askıya alındığını gösterir. Sistem yöneticileri ve dijital forensik analizinde görevli analistler, anormal hizmetlerin tespiti için sıklıkla bu komutu kullanır.

Örneğin:

sql
Terminal PS C:\Users\captain> Get-Service Status Name DisplayName ------ ---- ----------- Stopped Amazon EC2Launch Amazon EC2Launch Running AmazonSSMAgent Amazon SSM Agent Stopped AppIDSvc Application Identity Running BFE Base Filtering Engine Running CertPropSvc Certificate Propagation Stopped ClipSVC Client License Service (ClipSVC) [...]

Bu komut, sistemdeki her hizmetin durumunu ve adını listeler.

Aktif ağ bağlantılarını izlemek için Get-NetTCPConnection cmdleti, mevcut TCP bağlantılarını gösterir. Bu, hem yerel hem de uzak uç noktalar hakkında bilgi verir. Bu cmdlet, özellikle olay yanıtı ve zararlı yazılım analizlerinde faydalıdır, çünkü saldırgan kontrollü sunucularla kurulmuş gizli arka kapıları veya bağlantıları keşfetmeye yardımcı olabilir.

Örneğin:

nginx
Terminal PS C:\Users\captain> Get-NetTCPConnection LocalAddress LocalPort RemoteAddress RemotePort State AppliedSetting OwningProcess ------------ --------- ------------- ---------- ----- -------------- ------------- [...] :: 22 :: 0 Listen 1444 10.10.178.209 49695 199.232.26.172 80 TimeWait 0 0.0.0.0 49668 0.0.0.0 0 Listen 424 0.0.0.0 49667 0.0.0.0 0 Listen 652 0.0.0.0 49666 0.0.0.0 0 Listen 388 0.0.0.0 49665 0.0.0.0 0 Listen 560 0.0.0.0 49664 0.0.0.0 0 Listen 672 0.0.0.0 3389 0.0.0.0 0 Listen 980 10.10.178.209 139 0.0.0.0 0 Listen 4 0.0.0.0 135 0.0.0.0 0 Listen 908 10.10.178.209 22 10.14.87.60 53523 Established Internet 1444 0.0.0.0 22 0.0.0.0 0 Listen 1444

Bu komut, sistemdeki TCP bağlantılarının durumu, yerel adresler, uzak adresler ve bağlantı durumu hakkında detaylı bilgi verir.

Ayrıca, Get-FileHash cmdleti, dosya hash'lerini oluşturmak için kullanılır. Bu, olay yanıtı, tehdit avcılığı ve zararlı yazılım analizinde çok değerli bir araçtır, çünkü dosya bütünlüğünü doğrulamanıza ve potansiyel müdahaleleri tespit etmenize yardımcı olur.

Örneğin:

mathematica
Terminal PS C:\Users\captain\Documents\captain-cabin> Get-FileHash -Path .\ship-flag.txt Algorithm Hash Path --------- ---- ---- SHA256 54D2EC3C12BF3D[...] C:\Users\captain\Documents\captain-cabin\ship-flag.txt

Bu komut, belirli bir dosyanın hash değerini hesaplar, böylece dosyanın değiştirilip değiştirilmediğini kontrol edebilirsiniz.

Bu cmdlet'ler, olay yanıtı ve tehdit avcılığı için özellikle yararlı olan, sistem izleme ve analizine dair kapsamlı bir araç seti sunar.


English Translation:

To gather more advanced system information, especially concerning dynamic aspects like running processes, services, and active network connections, we can leverage a set of cmdlets that go beyond static machine details.

Get-Process provides a detailed view of all currently running processes, including CPU and memory usage, making it a powerful tool for monitoring and troubleshooting.

For example:

yaml
Terminal PS C:\Users\captain> Get-Process Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName ------- ------ ----- ----- ------ -- -- ----------- 67 5 872 500 0.06 2340 0 AggregatorHost 55 5 712 2672 0.02 3024 0 AM_Delta_Patch_1.417.483.0 309 13 18312 1256 0.52 1524 0 amazon-ssm-agent 78 6 4440 944 0.02 516 0 cmd 94 7 1224 1744 0.31 568 0 conhost [...]

This cmdlet provides detailed information about each process, including memory usage, CPU time, process ID (PID), and name.

Similarly, Get-Service allows the retrieval of information about the status of services on the machine, such as which services are running, stopped, or paused. It is extensively used in troubleshooting and forensic analysis to find anomalous services installed on the system.

For example:

sql
Terminal PS C:\Users\captain> Get-Service Status Name DisplayName ------ ---- ----------- Stopped Amazon EC2Launch Amazon EC2Launch Running AmazonSSMAgent Amazon SSM Agent Stopped AppIDSvc Application Identity Running BFE Base Filtering Engine Running CertPropSvc Certificate Propagation Stopped ClipSVC Client License Service (ClipSVC) [...]

This cmdlet lists the status and names of services running on the system.

To monitor active network connections, Get-NetTCPConnection displays current TCP connections. It provides insights into both local and remote endpoints, which can be particularly useful during incident response or malware analysis to uncover hidden backdoors or connections to attacker-controlled servers.

For example:

nginx
Terminal PS C:\Users\captain> Get-NetTCPConnection LocalAddress LocalPort RemoteAddress RemotePort State AppliedSetting OwningProcess ------------ --------- ------------- ---------- ----- -------------- ------------- [...] :: 22 :: 0 Listen 1444 10.10.178.209 49695 199.232.26.172 80 TimeWait 0 0.0.0.0 49668 0.0.0.0 0 Listen 424 0.0.0.0 49667 0.0.0.0 0 Listen 652 0.0.0.0 49666 0.0.0.0 0 Listen 388 0.0.0.0 49665 0.0.0.0 0 Listen 560 0.0.0.0 49664 0.0.0.0 0 Listen 672 0.0.0.0 3389 0.0.0.0 0 Listen 980 10.10.178.209 139 0.0.0.0 0 Listen 4 0.0.0.0 135 0.0.0.0 0 Listen 908 10.10.178.209 22 10.14.87.60 53523 Established Internet 1444 0.0.0.0 22 0.0.0.0 0 Listen 1444

This cmdlet shows the state of TCP connections, local and remote addresses, and connection status.

Additionally, Get-FileHash is useful for generating file hashes. This is especially valuable for incident response, threat hunting, and malware analysis, as it helps verify file integrity and detect potential tampering.

For example:

mathematica
Terminal PS C:\Users\captain\Documents\captain-cabin> Get-FileHash -Path .\ship-flag.txt Algorithm Hash Path --------- ---- ---- SHA256 54D2EC3C12BF3D[...] C:\Users\captain\Documents\captain-cabin\ship-flag.txt

This cmdlet computes the hash of a file, allowing you to check if the file has been altered.