Questions tagged [powershell]

task automation and configuration management CLI for Windows, the first release was in Windows XP SP2 in 2006

Filter by
Sorted by
Tagged with
-1 votes
0 answers
10 views

How delete windows logs with powershell & cmd command in period of time [closed]

I am curious that how can can i delete windows logs with PowerShell & cmd command in period of time? Period of time mean only delete specific logs related to last two month. Please show all ...
user avatar
0 votes
0 answers
26 views

Intercept API calls of powershell module

I am looking at a way to intercept the API call made by the AzureAD powershell module. Wireshark is not able to decrypt the TLS packets sent and I'd also like to work with the HTTP requests rather ...
user avatar
0 votes
0 answers
120 views

Invoke GetProcAddress returns nothing

I try to execute a meterpreter shellcode to a windows machine. In order to bypass the AV, I try to load the shellcode in the memory thanks to the DelegateType Reflection technique. Below, the first ...
user avatar
  • 259
-1 votes
1 answer
162 views

PowerShell - privilege escalation [closed]

In the past, I have used the Sherlock PowerShell script to quickly find missing software patches for local privilege escalation vulnerabilities. However, I am looking for a similar script, but I ...
user avatar
3 votes
1 answer
194 views

Is there a way to run a downloaded powershell script as admin without setting a global ExecutionPolicy bypass?

Since the 20H2 build of Windows 10 came out, if I want to run a script without copying and pasting it into a PowerShell window, I have to write the following command: Set-ExecutionPolicy -...
user avatar
  • 1,237
1 vote
1 answer
476 views

How to run PrintSpoofer in memory from powershell?

PrintSpoofer uses named pipe impersonation to elevate on Windows 10 to SYSTEM from a user with SeImpersonatePrivilege (Local Service, Network Service, Administrator etc.). The compiled version is ...
user avatar
  • 123
0 votes
1 answer
106 views

How can I modify Windows registry programmatically? [closed]

Which programming language I can use to modify Windows registry? Can I use js or powershell?
user avatar
1 vote
1 answer
326 views

Possible to create a self-signed certificate with AIA extension using PowerShell or openssl?

I am able to use the PowerShell New-SelfSignedCertificate cmdlet to create a self-signed cert just fine, but I'd like to create one with an AIA extension and give it an OCSP responder URL. There is a ...
user avatar
8 votes
1 answer
287 views

Is this Windows local code execution bug also a security vulnerability?

I stumbled on a Windows bug leading to code execution. I believe it should be categorized as a vulnerability but Microsoft does not recognize it as such. I would like to read other opinions. ...
user avatar
1 vote
1 answer
120 views

Learn Bash or Powershell for Security Work? [closed]

Is Bash more commonly used in security work than PowerShell? If so, why? (Now that Powershell can be used on Linux) I tried to Google around for an answer on this, and the only questions we seem to ...
user avatar
  • 523
0 votes
1 answer
270 views

How can I execute a base64 encoded exe stored as a variable, inside a powershell script without writing any files?

Basically if I have exe1 encoded with base64 and I copy that encoded source into a powershell script as a variable. I want to be able to decode it and execute the source exe without writing the exe to ...
user avatar
  • 3
-1 votes
1 answer
110 views

Metasploit shell non-responsive

Metasploit successfully executes the exploit, but after that, I get a non-responsive shell: Do you know what could be the problem here?
user avatar
1 vote
1 answer
122 views

How does one tighten up their git repo security for Powershell?

Back when I was a Java developer, we used to use build.properties or build.xml to store sensitive information outside of the VCS and just add the file with whatever passwords would go in it after ...
user avatar
  • 1,237
3 votes
1 answer
4k views

How do I stabilize a reverse shell in when the attack box is using powershell?

So I've managed to get a version of netcat onto my windows machine and I can run the standard: nc -lvnp 1234 and this properly connects to the victim's machine, but it's a very fragile connection. ...
user avatar
0 votes
0 answers
316 views

autorunscript metasploit

I'm trying to run the following autoscript use exploit/multi/handler set payload … set lhost set lport set AutoRunScript multi_console_command -r /root/script.rc set ...
user avatar
1 vote
1 answer
2k views

Getting an Interactive Powershell Reverse Shell Using socat

I've read that socat is capable of creating interactive shells. I'd like to create an interactive Powershell shell. Kali Listener # socat - tcp4-listen:1338 Windows (socat.exe used from here: https://...
user avatar
0 votes
1 answer
143 views

Why Invoke-ReflectivePEInjection not recognized [closed]

I was trying Invoke-ReflectivePEInjection by doing .\Convert-BinaryToString Convert-BinaryToString C:\file.exe $InputString="base64string" $PEBytes=[System.Convert]::FromBase64String($InputString) ...
user avatar
  • 3
0 votes
0 answers
599 views

Powershell (WinRM) and cmd.exe: reg query output deviation

during a CTF I encountered the following anomaly regarding PS & cmd.exe: I got access to a Windows x86 server through WinRM Port 5985 using evil-winrm. (https://github.com/Hackplayers/evil-winrm) ...
user avatar
2 votes
1 answer
155 views

Is running Powershell always as administrator a good practice?

I work as software engineer in a company. The IT deparment has decided to forbid powershell execution from our computers as part of the actions they are implementing to avoid Emotet malware. As ...
user avatar
  • 131
2 votes
1 answer
374 views

Would my USB interface be infected if I attached and immediately detached an infected USB device?

Two days ago, someone gave me their pen drive to copy some songs from. As soon as I inserted the drive into my laptop's USB interface, Windows Defender immediately warned me that the drive was ...
user avatar
1 vote
0 answers
112 views

Calling Powershell script from external program passing an argument

I have an external program which calls a PowerShell script with a random secret identifier as a single argument. The PowerShell script needs to return the same random secret id when it calls the REST ...
user avatar
  • 11
1 vote
0 answers
311 views

gpg won't find public key if not in interactive session

How to make imported public key available after logging off? I have a Powershell process that encrypts the file (recipient was masked): Start-Process "gpg.exe" -ArgumentList "--batch --yes --always-...
user avatar
  • 11
0 votes
2 answers
1k views

Can a PowerShell script inside a Zip file execute automatically upon unzipping?

I have a zip file that has a Powershell script inside that I want to look at. Is it possible that the Powershell script could execute automatically just by unzipping the file? This is not something I ...
user avatar
  • 1
1 vote
2 answers
225 views

What causes Windows security logs saying an attempt was made to reset an account's password?

This falls under the category of eliminating what might be normal activity from my attention. I'm looking at Windows 7 security event logs. I don't have context to know if the following event is a ...
user avatar
  • 6,797
0 votes
1 answer
432 views

How to obtain Service Tickets (TGS) for Service Accounts with no SPNs (ServicePrincipalName) set?

The first step in a kerberoasting attack is to discover Service Accounts via AD enumeration. One way to do so is searching LDAP for any registered SPNs (Service Principal Names). However, from my ...
user avatar
  • 445
1 vote
0 answers
257 views

How should you configure PowerShell logs permissions?

I'm currently trying to figure out the best way to configure Windows PowerShell logging, so that it is secure (Attackers cannot gain sensitive data out of it) it helps in DFIR (digital forensic and ...
user avatar
  • 19
1 vote
2 answers
138 views

Insider threat mitigation sql databases

I support a number of applications some of which have sql databases. There's a number of scripts (mostly powershell/bash) to check the state of an application to see if it's considered healthy. Some ...
user avatar
4 votes
1 answer
876 views

What security implications are involved when using a CSV file to fill a SQL table?

I have some data on CSV files and I want automate the input of this data into an SQL database using Powershell. The data is mostly, if not completely, numbers. I am using a script based on the one ...
user avatar
-1 votes
1 answer
203 views

Java web app hosted in tomcat hanged for more than 10 min with logs containing powershell attack

We have a java web application running in tomcat which is hosted in AWS. The operating system used in the server is Centos. Today it become inaccessible for more than 10 minutes. When we got access, ...
user avatar
  • 1
0 votes
1 answer
198 views

How do I prevent someone from using my certificate to sign a malicious script on my PC?

The first step to make Powershell more secure is to create a certificate to sign my scripts. Then you actually sign it with this command: Set-AuthenticodeSignature -FilePath myScript.ps1 -Certificate ...
user avatar
2 votes
1 answer
1k views

How to retrieve Kerberos Service tickets?

I am learning Kerberoasting see below are my steps that I am following. Step:1. Attacker will find the SPN's Step:2. After identifying we will request for TGS for that SPN. This is the script for ...
user avatar
1 vote
1 answer
818 views

What is this PowerShell script sending Discord info to random server?

Upon turning on my personal Windows 10 computer tonight, I was greeted with ConEmu telling me that two PowerShell commands were run at startup. Both commands were the same thing: powershell -...
user avatar
0 votes
2 answers
626 views

Windows - How to restrict access to VBScript.dll and JScript.dll?

In a recent blog post from a company called Recorded Future, which specializes in data protection, details were provided on commonly exploited vulnerabilities on the Windows platform. Recorded Future ...
user avatar
1 vote
0 answers
441 views

How do use ArcSight ESM to monitor powershell logs? [closed]

I have read mixed reviews, our team within our DoD sector suggest that ingestion the logs directly into the SIEM platform would be best and I feel that having a third party tool with signatures, look ...
user avatar
0 votes
1 answer
64 views

Extensions and Modules and Packages, Oh My! [closed]

How do you know if extensions (e.g., Code, Chrome, Firefox), modules (e.g., PowerShell), or packages (e.g., Python, R) are not malicious? How can you control or monitor that in an environment? Stuff ...
user avatar
  • 125
4 votes
2 answers
561 views

Did I just infect my machine?

I just ran an AVI file that was sent to me, thinking AVIs were safe. Turns out it was a windows shortcut with this in the path: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoPr -WINd 1 ...
user avatar
  • 141
2 votes
1 answer
76 views

Block AzureRM PowerShell Module

Is there a way to block AzureRM PowerShell module commands from being executed by certain Azure AD users somewhere in Azure group policy? Or is there a way to do this with PowerShell tools?
user avatar
1 vote
4 answers
227 views

why do I get an email with address of Me'.exe'

I am wondering if there is a security issue with this. I use Mozilla, and I got an email with Me, '.exe' <myemail@server.com>. I have never seen this. What is it? Is it a way to send mass email? ...
user avatar
  • 11
4 votes
2 answers
1k views

Powershell says microsoft's own ps1 script is insecure, should I proceed with running the script?

I am trying to update Powershell to version 5.1 which I have downloaded directly from Microsoft's website. The download's are signed from Microsoft (although the signatures are expired by a few ...
user avatar
0 votes
1 answer
398 views

Is this type of encryption one-way?

I am writing a Powershell script that requires a privileged account to do something. Of course, I'm not going to include the password of this account in the .ps1 file in clear text so I am following ...
user avatar
  • 115
3 votes
0 answers
250 views

Cortana password bypass CVE-2018-8140

Recently a vulnerability in Microsoft's Cortana (CVE2018-8140) has been patched. Mcafee made a blog post about it explaining some background information. There is also a video showing a Proof of ...
user avatar
  • 594
1 vote
0 answers
62 views

Are the interactive methods of credential gathering listed here actually secure, since they dont store the credentials on disk?

I found an article about different ways to collect and pass credentials in powershell. The author states that some of these methods are 100% secure (which is obviously an exaderation) but for ...
user avatar
  • 1,237
1 vote
0 answers
567 views

How can I safely use Get-Credential to obtain a username and password for a set period of time for use as command line arguments?

Credentials in the form of SSH keys can be stored in memory using SSH Agent; However, if clicking the wrong link, or running a malicious program they can also be snatched from memory and sent ...
user avatar
  • 1,237
1 vote
3 answers
14k views

How can I track executed PowerShell commands within a network?

I wanto to track PowerShell commands which are executed by users in the intranet. How can I do this? I need the user's information and their executed commands. Is it possible? Edit 1: I guess I can ...
user avatar
  • 111
0 votes
2 answers
358 views

Have I created some kind of malware? [closed]

I am quite new to this type of stuff and I'm experimenting a little bit. This weekend I had some spare time and decided to joke around with VBScript and powershell. What I did is I wrote a VBScript ...
user avatar
0 votes
2 answers
326 views

Defending Against Empire

My understand of Empire is a framework that allows hackers to create listeners, and run code over the internet with the help of power shell through the use of DLL injections, Thread Injections, and ...
user avatar
-1 votes
1 answer
768 views

Does C# code running with PowerShell Add-Type set off anti-virus?

C# code can be included and executed in a PowerShell script using Add-Type. According to Microsoft: "Add-Type compiles the specified source code and generates an in-memory assembly that contains ...
user avatar
1 vote
1 answer
265 views

Give users a powershell script to run - Secure?

Is there a secure and practical way to give a group of users a powershell script to run on their laptops? The users all have active directory accounts, but their computers are not joined to any ...
user avatar
-1 votes
4 answers
797 views

Does a Turing complete shell means equal secure?

I have heard that Linux is more secure than Windows. Is that true? I think they are equally secure because both has a Turing complete shell so if you management to do harm on one system, there is a ...
user avatar
  • 25
2 votes
2 answers
202 views

How do you find out if your PC is reverse shelled?

I am just wondering, how do you find out is your PC is reverse shelled or not? Does your antivirus protect against it?
user avatar