Phishing

A Nice Day Phishing : Exploring Portable Python For Covert Execution

Scripting Interpreters are agreat method to achieve Command or Shellcode Execution, but one of many problems is that they:

  • Are not Native to Windows
  • Not always easy to use
  • Limited to Command or Shellcode execution, some have both!!
  • We requiere these to not be installed on the Users workstation

Python

Python is a strong language to demonstrate the capabilities of these interpreters the following screenshot demonstrates how just printing out STRINGS in their language will not get flagged, it seems that this behavior is caused because AMSI has a better grasp on Windows Native Files.

To make python feasable to our needs we have to consider this:

  • Size
  • Modules
  • Version

We encounter the issue that some Modules are missing when trying to go beyond to executing Win32 apis now the challenge is to:

  • Compile a portable version with the needed modules

Now with some debugging and lots of banging the portable version of pytohn works correctly and the modules that I needed were in the binary

With this fully functional we can utilize the portable version of python, a loader and call our payload, since the files and binary won’t run our files via double-click we need to use a parent program that will call these, and a great alternative is LNK files

For more information click here.

Varshini

Varshini is a Cyber Security expert in Threat Analysis, Vulnerability Assessment, and Research. Passionate about staying ahead of emerging Threats and Technologies.

Recent Posts

Install Mono on Ubuntu 18.04: C# Compiler and Runtime Guide

Running programs built for Microsoft's framework on a Linux system is easier than you think. Mono is…

11 hours ago

Install OpenCV on Ubuntu 18.04: Step-by-Step Setup Guide

Computer vision technology powers many modern applications, from image editors to facial scanners. OpenCV (Open Source Computer…

11 hours ago

Install VNC on Ubuntu 18.04: Step-by-Step TigerVNC Setup

A remote desktop interface makes it easy to manage a remote computer. VNC (Virtual Network Computing) is…

12 hours ago

Install Gitea on Ubuntu 18.04: Self-Hosted Git Service Guide

Hosting your own code repositories is a great way to keep your projects private. Gitea is a…

12 hours ago

Install Java on Ubuntu 18.04: OpenJDK 11 and OpenJDK 8

Many modern programs require Java to run. From development tools like Eclipse to search systems…

12 hours ago

Configure a Static IP Address on Ubuntu 18.04: Netplan Guide

Setting a static IP address on your server is a smart move. It ensures your…

1 day ago