Pular para o conteúdo principal

RFI – LFI File Inclusion Attacks – Mitigations

Similar to all other cyber attacks RFI – LFI file inclusion attacks also carries a strong importance when it comes to data breach. In other words we can describe it as why the server isn’t working to load my webpages.

File Inclusion

File inclusion is a type of vulnerability that allows an attacker to include a file on the Server without proper sanitization.
The act of uploading a malicious file on the server and executing it through directory traversal is know as file inclusion.
The type of attack occurs on PHP based websites where the developers have no enough information about how to sanitize and validate the user inputs. In file inclusion the user supplied input leads to file inclusion attack. Beside this, the file inclusion can exploit the functionality of web server and thus can often leads to most serious attacks.
  1. Danial of Service Attack
  2. Cross Site Scripting
  3. Code Execution
  4. Data Manipulation

Example

In a usual case, the web server allows a users to upload a file of below 100kb e.g an image.
The malicious user take advantage in such a way that instead of normal file the user upload a web shell, which is nothing else but a command prompt or shell excess to the server remotely when executed. If the web shell exceeds 100kb, the attacker changes the run time environment for the file.
file inclusion
On a successful upload the server responds back with a success message, stating the uploading path. For example
../../hacked/uploads/shell.php
ddOnce the file path is known it can be accessed remotely over the web by traversing to the file location using the uploaded path. Now if the file is accessed it allows remote administration such as creating, uploading, deleting the files and folders over the server which can take the advantage to deface the website. This is called Local File Inclusion.
The same malicious file can be accessed from different server e.g server X, by allowing the URL of the malicious file along with the URL of server X. This now allows the attacker to remotely execute the shell from server X. This is called Remote File Inclusion.
e.g http://www.ServerX.com/page?”http://www.MaliciousSite.com/hacked/uploads/shell.php”

Mitigations

The following are some of the mechanisms by which File Inclusion can be mitigated:
  1. Use the tightest possible permissions when developing and deploying web
    applications.
  2. Consider using chroot jails and code access security policies to restrict and control
    the location and type of file operations, even if the system is miss-configured.
  3. Remove all “Everyone: Full Control” ACLs on Windows, and all mode 777 (world
    write-able directories) or mode 666 files (world write-able files) on Unix systems.
  4. Strongly consider removing “Guest”, “everyone,” and world readable permissions wherever possible.
File Inclusion attack: LFI and RFI is a result of allowing unsecure data into a secure context.
The best way to prevent this attack is to never use arbitrary input data in a literal file include
request.

Comentários

Postagens mais visitadas deste blog

MKBRUTUS – Brute Force para MikroTik e dispositivos com RouterOS

O MKBRUTUS é uma ferramenta desenvolvida em Python 3 que realiza ataques de força bruta em sistemas (baseados em dicionário) contra RouterOS (ver. 3.x ou superior), que têm a porta 8728/TCP aberto. O MKBRUTUS é uma ferramenta desenvolvida em Python 3 que realiza ataques de força bruta em sistemas (baseados em dicionário) contra RouterOS (ver. 3.x ou superior), que têm a porta 8728/TCP aberto. Desenvolvedores: Ramiro Caire  | ramiro.caire@gmail.com | Twitter: @rcaire Federico Massa | fgmassa@vanguardsec.com | Twitter: @fgmassa Projeto:   github.com/mkbrutusproject/mkbrutus 01 Passo Verifique a versão atual do python em seguida realiza a instalação da versão 3 root@kali:~# python –version (Exibe a versão do Python) root@kali:~# apt-get install python3 (Realiza a instalação do Python 3) 02 Passo Execute o comando de verificação da versão do Python novamente e observe que a versão não mudou mas a instalação da ver...

WiFiPhisher - Ataques Automatizados de Phishing Contra Redes Wi-Fi

Um pesquisador de segurança grego, chamado George Chatzisofroniou, desenvolveu uma ferramenta de engenharia social WiFi que é projetado para roubar credenciais de usuários de redes Wi-Fi segura. A ferramenta, batizada WiFiPhisher, foi lançado no site do desenvolvimento de software GitHub no domingo e está disponível gratuitamente para os usuários.   "É um ataque de engenharia social que não usa força bruta, em contraste com outros métodos. É uma maneira fácil de obter senhas WPA", disse George Chatzisofroniou. No entanto, existem várias ferramentas de hacker disponíveis na Internet que pode cortar de uma rede Wi-Fi segura, mas esta ferramenta automatiza múltipla Wi-Fi técnicas que o tornam um pouco diferente dos outros hackers. Ferramenta WiFiPhisher usa ataque "gêmeo do mal " cenário. O mesmo que o gêmeo do mal, a ferramenta cria primeiro um ponto de acesso sem fio falso (AP) mascarar-se como o legítimo Wi-Fi AP. Em seguida, ele dirige uma negação de...

Como Hackear WPA / WPA2 WIFI senha usando reaver em 1-2 horas

  Reaver é grande em rachar / WPA2 protegido senhas WPA e por força bruta os pinos WPS nos roteadores que possuem botão WPS / push ativado no-los, mas o problema é que existem milhares de pinos que tem para reaver força bruta e isso requer muito tempo hackear a senha. Mas eu comprei uma solução para você em que você vai ser capaz de quebrar a senha Wi-Fi em apenas 2-3 horas de tempo médio que tenho considerado. Qual é a lógica? A lógica é simples se você pode entender, Reaver atual versão da força bruta código PIN de 8 dígitos (código PIN WPS) e levou mais tempo em rachar o código PIN de 8 dígitos, mas se nós comandamos reaver a rachar de 4 dígitos de código pin na primeira sessão e o resto do código PIN de 4 dígitos na segunda sessão e, desta forma podemos quebrar a senha Wi-Fi facilmente em 2-3 horas e ainda menos, em seguida, na hora, como eu me rachou minha senha wi-fi em apenas 1 hora e meia. Comando! reaver -i mon0 -f -c "canal No...