scripting

 Scripting, bir dizi komutun yazılıp çalıştırılması işlemidir ve bu komutlar bir metin dosyasında (script) bulunur. Genellikle, komutlar bir kabuk (shell), örneğin PowerShell, içinde çalıştırılmak üzere yazılır. Scripting'in amacı, manuel olarak yapılacak görevlerin otomatikleştirilmesidir. Yani, bilgisayara bir "yapılacaklar listesi" vermek gibidir; her satır bir görevi temsil eder ve bilgisayar bu görevleri otomatik olarak yerine getirir.

Basitçe ifade etmek gerekirse, scripting, bilgisayara her biri belirli bir işi yapan komutlardan oluşan bir liste vermek gibidir. Bu, zaman kazandırır, hata yapma olasılığını azaltır ve manuel olarak yapılması çok karmaşık veya sıkıcı olan görevleri otomatik hale getirir. Shell'ler ve scripting hakkında daha fazla bilgi edinmeye başladıkça, scriptlerin sistem yönetimi, veri işleme ve daha birçok görev için güçlü araçlar olabileceğini keşfedeceksiniz.

PowerShell'de scripting öğrenmek, bu alanın kapsamını aşar. Ancak şunu anlamamız önemlidir ki, PowerShell'in gücü, siber güvenlik alanındaki her rol için kritik bir beceri olmasını sağlar.

  • Blue Team Profesyonelleri: Olay müdahale uzmanları, zararlı yazılım analizörleri ve tehdit avcıları, PowerShell scriptlerini, günlük (log) analizi, anomali tespiti ve zararlılık izleri (IOC'ler) çıkarma gibi birçok farklı görevi otomatikleştirmek için kullanabilirler. Bu scriptler, kötü amaçlı yazılımın tersine mühendisliğini yapmak veya sistemleri saldırı izleri için taramak gibi güvenlik görevlerini de otomatikleştirebilir.

  • Red Team Profesyonelleri: Penetrasyon test uzmanları ve etik hackerlar, PowerShell scriptlerini, sistem envanterleme, uzak komutlar çalıştırma ve savunmaların aşılması için obfuscation (karmaşıklaştırma) yapma gibi görevleri otomatikleştirmek için kullanabilirler. PowerShell'in her tür sistemle derin entegrasyonu, saldırı simülasyonları ve gerçek dünyadaki tehditlere karşı sistem dayanıklılığını test etmek için güçlü bir araç haline getirir.

  • Sistem Yöneticileri: PowerShell scripting, sistem bütünlüğü kontrolü yapma, sistem yapılandırmalarını yönetme ve ağları güvence altına alma gibi görevlerde faydalıdır, özellikle uzak veya büyük ölçekli ortamlar için. PowerShell scriptleri, güvenlik politikalarını uygulamak, sistem sağlığını izlemek ve güvenlik olaylarına otomatik olarak yanıt vermek için tasarlanabilir, böylece genel güvenlik duruşunu güçlendirir.

PowerShell scripting, savunma ya da saldırı amaçlı kullanılsa da, siber güvenlik araç setindeki temel bir beceridir.

Invoke-Command Cmdlet'i de bu bağlamda belirtmek önemlidir. Invoke-Command, uzak sistemlerde komut çalıştırmak için kullanılır ve bu, sistem yöneticileri, güvenlik mühendisleri ve penetrasyon test uzmanları için temel bir araçtır. Invoke-Command, uzak yönetimi verimli hale getirir ve scripting ile birleştirildiğinde birden fazla makine üzerinde görevleri otomatikleştirir. Penetrasyon testlerinde veya saldırganlar tarafından, hedef sistemler üzerinde yükler veya komutlar çalıştırmak için de kullanılabilir.

Invoke-Command'in kullanımı ile ilgili bazı örnekler:

Terminal:

pgsql
PS C:\Users\captain> Get-Help Invoke-Command -examples NAME Invoke-Command SYNOPSIS Runs commands on local and remote computers. ------------- Example 1: Run a script on a server ------------- Invoke-Command -FilePath c:\scripts\test.ps1 -ComputerName Server01 The FilePath parameter specifies a script that is located on the local computer. The script runs on the remote computer and the results are returned to the local computer. --------- Example 2: Run a command on a remote server --------- Invoke-Command -ComputerName Server01 -Credential Domain01\User01 -ScriptBlock { Get-Culture } The ComputerName parameter specifies the name of the remote computer. The Credential parameter is used to run the command in the security context of Domain01\User01, a user who has permission to run commands. The ScriptBlock parameter specifies the command to be run on the remote computer. In response, PowerShell requests the password and an authentication method for the User01 account. It then runs the command on the Server01 computer and returns the result.

Yukarıdaki örnekler, Invoke-Command cmdlet'inin gücünü ve basitliğini ortaya koymaktadır. Birincisi, cmdlet'in herhangi bir özel script ile nasıl kolayca birleştirilebileceğini gösterir. İkincisi ise, script yazmayı bilmesek bile Invoke-Command'in gücünden nasıl faydalanabileceğimizi gösterir; çünkü -ScriptBlock parametresini ekleyerek, uzaktaki bilgisayarda herhangi bir komutu çalıştırabiliriz.


English Translation:

Scripting is the process of writing and executing a series of commands contained in a text file, known as a script, to automate tasks that would typically be performed manually in a shell, like PowerShell.

Simply speaking, scripting is like giving a computer a to-do list, where each line in the script is a task the computer will carry out automatically. This saves time, reduces the chance of errors, and allows tasks that would be too complex or tedious to do manually to be automated. As you learn more about shells and scripting, you'll discover that scripts can be powerful tools for managing systems, processing data, and much more.

Learning scripting with PowerShell goes beyond the scope of this room. Nonetheless, it’s important to understand that its power makes it a crucial skill across all cybersecurity roles.

  • Blue Team Professionals: Incident responders, malware analysts, and threat hunters can use PowerShell scripts to automate many tasks, including log analysis, detecting anomalies, and extracting indicators of compromise (IOCs). These scripts can also be used to reverse-engineer malicious code (malware) or automate scanning of systems for signs of intrusion.

  • Red Team Professionals: Penetration testers and ethical hackers can use PowerShell scripts to automate tasks like system enumeration, executing remote commands, and crafting obfuscated scripts to bypass defenses. Its deep integration with all systems makes it a powerful tool for simulating attacks and testing systems' resilience against real-world threats.

  • System Administrators: PowerShell scripting is beneficial for automating integrity checks, managing system configurations, and securing networks, especially in remote or large-scale environments. PowerShell scripts can be designed to enforce security policies, monitor system health, and respond automatically to security incidents, thereby strengthening the overall security posture.

Whether used defensively or offensively, PowerShell scripting is an essential capability in the cybersecurity toolkit.

Invoke-Command Cmdlet is also worth mentioning in this context. Invoke-Command is essential for executing commands on remote systems, making it fundamental for system administrators, security engineers, and penetration testers. Invoke-Command enables efficient remote management and, when combined with scripting, automates tasks across multiple machines. It can also be used by penetration testers (or attackers) to execute payloads or commands on target systems during an engagement.

Here are some examples of using this powerful cmdlet:

Terminal:

pgsql
PS C:\Users\captain> Get-Help Invoke-Command -examples NAME Invoke-Command SYNOPSIS Runs commands on local and remote computers. ------------- Example 1: Run a script on a server ------------- Invoke-Command -FilePath c:\scripts\test.ps1 -ComputerName Server01 The FilePath parameter specifies a script located on the local computer. The script runs on the remote computer and the results are returned to the local computer. --------- Example 2: Run a command on a remote server --------- Invoke-Command -ComputerName Server01 -Credential Domain01\User01 -ScriptBlock { Get-Culture } The ComputerName parameter specifies the name of the remote computer. The Credential parameter runs the command in the security context of Domain01\User01, a user with permission to run commands. The ScriptBlock parameter specifies the command to be run on the remote computer. In response, PowerShell requests the password and authentication method for the User01 account. It then runs the command on the Server01 computer and returns the result.

The first two examples provided by the Get-Help "examples" page demonstrate the simplicity and power of the Invoke-Command cmdlet. The first shows how easily it can be combined with any custom script to automate tasks on remote computers. The second shows that you don’t need to know how to script to benefit from the power of Invoke-Command. By simply appending the -ScriptBlock parameter, you can execute any command or sequence of commands on a remote computer.

owning process

 Owning Process, bir işlemle ilişkili olan ve o işlemi yöneten veya başlatan ana süreç anlamına gelir. Windows işletim sistemi bağlamında, her işlem bir "sahip" işleme sahiptir. Bu, o işlemin diğer işlem veya hizmetler tarafından başlatıldığını ve yönetildiğini gösterir.

Owning Process, genellikle her bir TCP bağlantısının sahip olduğu işlemle ilişkilidir. Örneğin, bir ağ bağlantısı açıldığında, bu bağlantıyı hangi işlem açtığını ve bu bağlantıyı hangi işlem yönettiğini belirlemek için "Owning Process" kullanılır.

Owning Process'in Önemi:

  1. Tehdit Tespiti: Bir ağ bağlantısının belirli bir işlemle ilişkili olduğunu bilmek, kötü amaçlı yazılımlar, arka kapılar veya izinsiz bağlantılar gibi tehditleri tespit etmekte yardımcı olabilir. Özellikle zararlı yazılımlar, genellikle meşru bir süreç gibi görünmeye çalışarak ağ bağlantıları oluşturur.

  2. Sistem İzleme ve Yönetimi: "Owning Process", bir bağlantının sistemdeki hangi işlem tarafından kullanıldığını belirlemenizi sağlar. Bu bilgi, sistem yöneticilerinin hangi uygulamanın veya işlemin ağ kaynaklarını kullandığını izlemelerini sağlar.

  3. Olay Yanıtı: Ağ bağlantıları, bir saldırganın sistemle iletişim kurduğu kanallar olabilir. Bu tür bağlantıları izlemek, saldırganın hangi işlem veya hizmet üzerinden bağlantı kurduğunu tespit etmeye yardımcı olur.

Örneğin, Get-NetTCPConnection komutuyla bir bağlantıyı sorgularken, Owning Process şu şekilde gösterilebilir:

nginx
Terminal PS C:\Users\captain> Get-NetTCPConnection LocalAddress LocalPort RemoteAddress RemotePort State AppliedSetting OwningProcess ------------ --------- ------------- ---------- ----- -------------- ------------- 0.0.0.0 3389 0.0.0.0 0 Listen 980 10.10.178.209 22 10.14.87.60 53523 Established Internet 1444

Burada, OwningProcess alanı, bağlantıyı yöneten işlem ID'sini (PID) gösterir. Örneğin, OwningProcess 980 olan bağlantı, PID 980 tarafından yönetiliyor demektir.

Özetle:

  • Owning Process, bir ağ bağlantısını veya işlemi yöneten, başlatan işlemi belirtir.

  • Bu bilgi, sistem yöneticilerinin veya tehdit analistlerinin, hangi işlemlerin ağ kaynaklarını kullandığını ve potansiyel güvenlik tehditlerini izlemelerini sağlar.

  • Özellikle kötü amaçlı yazılım tespiti ve ağ analizi gibi güvenlik amaçlarıyla büyük öneme sahiptir.

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.

system and network info

 PowerShell, sistem yöneticileri ve IT profesyonellerinin ihtiyaç duyduğu güçlü bir otomasyon ve yönetim aracı olarak yaratılmıştır. Bu nedenle, sistem yapılandırması ve ağ ayarları hakkında detaylı bilgi edinmeyi sağlayan bir dizi cmdlet sunmaktadır.

Get-ComputerInfo cmdleti, işletim sistemi bilgisi, donanım özellikleri, BIOS detayları ve daha fazlası dahil olmak üzere kapsamlı sistem bilgilerini alır. Bu komut, tüm sistem yapılandırmasının anlık bir görüntüsünü tek bir komutla sağlar. Geleneksel karşılığı olan systeminfo komutu ise aynı bilgilerin yalnızca küçük bir kısmını sunar.

Örneğin:

yaml
Terminal PS C:\Users\captain> Get-ComputerInfo WindowsBuildLabEx : 20348.859.amd64fre.fe_release_svc_prod2.220707-1832 WindowsCurrentVersion : 6.3 WindowsEditionId : ServerDatacenter WindowsInstallationType : Server Core WindowsInstallDateFromRegistry : 4/23/2024 6:36:29 PM WindowsProductId : 00454-60000-00001-AA763 WindowsProductName : Windows Server 2022 Datacenter [...]

Bu komut, sistemin işletim sistemi sürümü, donanım bilgileri ve kurulum tarihini gibi çok sayıda detayı verir.

Get-LocalUser cmdleti ise sistemdeki tüm yerel kullanıcı hesaplarını listelemeye yarar. Çıktıda her kullanıcı için kullanıcı adı, hesap durumu ve açıklama yer alır. Bu bilgi, kullanıcı hesaplarını yönetmek ve makinenin güvenlik yapılandırmasını anlamak için gereklidir.

Örneğin:

pgsql
Terminal PS C:\Users\captain> Get-LocalUser Name Enabled Description ---- ------- ----------- Administrator True Built-in account for administering the computer/domain captain True The beloved captain of this pirate ship. DefaultAccount False A user account managed by the system. Guest False Built-in account for guest access to the computer/domain WDAGUtilityAccount False A user account managed and used by the system for Windows Defender Application Guard scenarios.

Bu komut, sistemdeki kullanıcı hesaplarını ve her birinin etkin olup olmadığını gösterir.

Geleneksel ipconfig komutuna benzer olarak, ağ yapılandırmasıyla ilgili detaylı bilgi almak için şu iki cmdlet kullanılabilir:

Get-NetIPConfiguration cmdleti, sistemdeki ağ arabirimleri hakkında detaylı bilgi sağlar, IP adresleri, DNS sunucuları ve ağ geçidi yapılandırmaları dahil.

Örneğin:

yaml
Terminal PS C:\Users\captain> Get-NetIPConfiguration InterfaceAlias : Ethernet InterfaceIndex : 5 InterfaceDescription : Amazon Elastic Network Adapter NetProfile.Name : Network 3 IPv4Address : 10.10.178.209 IPv6DefaultGateway : IPv4DefaultGateway : 10.10.0.1 DNSServer : 10.0.0.2

Bu komut, sistemdeki Ethernet bağlantısının IP adresini, ağ geçidi ve DNS sunucu adresini gösterir.

Eğer ağ arabirimlerine atanmış IP adresleri hakkında daha fazla bilgiye ihtiyaç varsa, Get-NetIPAddress cmdleti, sistemdeki tüm IP adreslerini ve bunların aktif olup olmadığını gösterir.

Örneğin:

yaml
Terminal PS C:\Users\captain> Get-NetIPAddress IPAddress : fe80::3fef:360c:304:64e%5 InterfaceIndex : 5 InterfaceAlias : Ethernet AddressFamily : IPv6 Type : Unicast PrefixLength : 64 PrefixOrigin : WellKnown SuffixOrigin : Link AddressState : Preferred ValidLifetime : Infinite ([TimeSpan]::MaxValue) PreferredLifetime : Infinite ([TimeSpan]::MaxValue) SkipAsSource : False PolicyStore : ActiveStore [...] IPAddress : 10.10.178.209 InterfaceIndex : 5 InterfaceAlias : Ethernet AddressFamily : IPv4 [...]

Bu komut, ağ arabirimlerine atanmış tüm IP adreslerini listeler.

Bu cmdlet'ler, IT profesyonellerine komut satırından sistem ve ağ bilgilerine hızlıca erişim sağlama yeteneği sunar, böylece yerel ve uzak makinelerin yönetimini kolaylaştırır.


English Translation:

PowerShell was created to address a growing need for a powerful automation and management tool to help system administrators and IT professionals. As such, it offers a range of cmdlets that allow the retrieval of detailed information about system configuration and network settings.

The Get-ComputerInfo cmdlet retrieves comprehensive system information, including operating system information, hardware specifications, BIOS details, and more. It provides a snapshot of the entire system configuration in a single command. Its traditional counterpart systeminfo retrieves only a small set of the same details.

For example:

yaml
Terminal PS C:\Users\captain> Get-ComputerInfo WindowsBuildLabEx : 20348.859.amd64fre.fe_release_svc_prod2.220707-1832 WindowsCurrentVersion : 6.3 WindowsEditionId : ServerDatacenter WindowsInstallationType : Server Core WindowsInstallDateFromRegistry : 4/23/2024 6:36:29 PM WindowsProductId : 00454-60000-00001-AA763 WindowsProductName : Windows Server 2022 Datacenter [...]

This command provides detailed information about the operating system version, hardware, and installation date of the system.

The Get-LocalUser cmdlet lists all local user accounts on the system. The default output shows the username, account status, and description for each user. This information is essential for managing user accounts and understanding the machine’s security configuration.

For example:

pgsql
Terminal PS C:\Users\captain> Get-LocalUser Name Enabled Description ---- ------- ----------- Administrator True Built-in account for administering the computer/domain captain True The beloved captain of this pirate ship. DefaultAccount False A user account managed by the system. Guest False Built-in account for guest access to the computer/domain WDAGUtilityAccount False A user account managed and used by the system for Windows Defender Application Guard scenarios.

This command lists the user accounts on the system and their statuses.

Similar to the traditional ipconfig command, the following two cmdlets can be used to retrieve detailed information about the system’s network configuration:

The Get-NetIPConfiguration cmdlet provides detailed information about network interfaces, including IP addresses, DNS servers, and gateway configurations.

For example:

yaml
Terminal PS C:\Users\captain> Get-NetIPConfiguration InterfaceAlias : Ethernet InterfaceIndex : 5 InterfaceDescription : Amazon Elastic Network Adapter NetProfile.Name : Network 3 IPv4Address : 10.10.178.209 IPv6DefaultGateway : IPv4DefaultGateway : 10.10.0.1 DNSServer : 10.0.0.2

This command shows the IP address, gateway, and DNS server for the Ethernet connection.

If more specific details about the IP addresses assigned to the network interfaces are needed, the Get-NetIPAddress cmdlet will show all IP addresses, including those that are not currently active.

For example:

yaml
Terminal PS C:\Users\captain> Get-NetIPAddress IPAddress : fe80::3fef:360c:304:64e%5 InterfaceIndex : 5 InterfaceAlias : Ethernet AddressFamily : IPv6 Type : Unicast PrefixLength : 64 PrefixOrigin : WellKnown SuffixOrigin : Link AddressState : Preferred ValidLifetime : Infinite ([TimeSpan]::MaxValue) PreferredLifetime : Infinite ([TimeSpan]::MaxValue) SkipAsSource : False PolicyStore : ActiveStore [...] IPAddress : 10.10.178.209 InterfaceIndex : 5 InterfaceAlias : Ethernet AddressFamily : IPv4 [...]

This cmdlet lists all IP addresses assigned to the network interfaces.