Atexec-pro: Next-Gen Pentesting Tool Leveraging Task Scheduler (No Port 445)

Written by

in

Atexec-pro

Modified based on atexec.py (ATSVC example for some functions implemented, creates, enums, runs and deletes jobs. This example executes a command on the target machine through the Task Scheduler service. Returns the output of such command.)

The TSCH service is used by default(need port 135 a dynamic high port), port 445 is no longer required. The technology is mainly based on this article by zcgonvh.

Feature

  • CMD command execute
  • PS command execute
  • File Upload
  • File Download
  • .Net assembly execute
  • Support ATSVC and TSCH interface.

Note: functions upload, download, and execute-assembly currently only support files up to 1MB in size. All functions do not bypass AMSI.

Download

git clone https://github.com/Ridter/atexec-pro.git

Use

[pastacode lang=”markup” manual=”usage%3A%20atexec-pro.py%20%5B-h%5D%20%5B-i%20%7BTSCH%2CATSVC%7D%5D%20%5B-session-id%20SESSION_ID%5D%20%5B-ts%5D%20%5B-debug%5D%20%5B-codec%20CODEC%5D%20%5B-hashes%20LMHASH%3ANTHASH%5D%20%5B-no-pass%5D%20%5B-k%5D%20%5B-aesKey%20hex%20key%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B-dc-ip%20ip%20address%5D%20%5B-keytab%20KEYTAB%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20target%0A%0Apositional%20arguments%3A%0A%20%20target%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B%5Bdomain%2F%5Dusername%5B%3Apassword%5D%40%5D%3CtargetName%20or%20address%3E%0A%0Aoptions%3A%0A%20%20-h%2C%20–help%20%20%20%20%20%20%20%20%20%20%20%20show%20this%20help%20message%20and%20exit%0A%20%20-i%20%7BTSCH%2CATSVC%7D%2C%20–interface%20%7BTSCH%2CATSVC%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Interface%20to%20use.%0A%20%20-session-id%20SESSION_ID%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20an%20existed%20logon%20session%20to%20use%20(no%20output%2C%20no%20cmd.exe)%0A%20%20-ts%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20adds%20timestamp%20to%20every%20logging%20output%0A%20%20-debug%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Turn%20DEBUG%20output%20ON%0A%20%20-codec%20CODEC%20%20%20%20%20%20%20%20%20%20Sets%20encoding%20used%20(codec)%20from%20the%20target’s%20output%20(default%20%22utf-8%22).%20If%20errors%20are%20detected%2C%20run%20chcp.com%20at%20the%20target%2C%20map%20the%20result%20with%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20https%3A%2F%2Fdocs.python.org%2F3%2Flibrary%2Fcodecs.html%23standard-encodings%20and%20then%20execute%20wmiexec.py%20again%20with%20-codec%20and%20the%20corresponding%20codec%0A%0Aauthentication%3A%0A%20%20-hashes%20LMHASH%3ANTHASH%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20NTLM%20hashes%2C%20format%20is%20LMHASH%3ANTHASH%0A%20%20-no-pass%20%20%20%20%20%20%20%20%20%20%20%20%20%20don’t%20ask%20for%20password%20(useful%20for%20-k)%0A%20%20-k%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Use%20Kerberos%20authentication.%20Grabs%20credentials%20from%20ccache%20file%20(KRB5CCNAME)%20based%20on%20target%20parameters.%20If%20valid%20credentials%20cannot%20be%20found%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20it%20will%20use%20the%20ones%20specified%20in%20the%20command%20line%0A%20%20-aesKey%20hex%20key%20%20%20%20%20%20%20AES%20key%20to%20use%20for%20Kerberos%20Authentication%20(128%20or%20256%20bits)%0A%20%20-dc-ip%20ip%20address%20%20%20%20%20IP%20Address%20of%20the%20domain%20controller.%20If%20omitted%20it%20will%20use%20the%20domain%20part%20(FQDN)%20specified%20in%20the%20target%20parameter%0A%20%20-keytab%20KEYTAB%20%20%20%20%20%20%20%20Read%20keys%20for%20SPN%20from%20keytab%20file” message=”” highlight=”” provider=”manual”/]

Example

GetShell

python atexec-pro.py localhost/administrator:123@10.211.55.3

Command

.Net assembly

Upload/Download