Skip to content

Commit

Permalink
modify ui
Browse files Browse the repository at this point in the history
  • Loading branch information
qiuwei committed Dec 9, 2022
1 parent 3cadaf8 commit 74efb54
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 29 deletions.
10 changes: 5 additions & 5 deletions ArpGhostGateway.sln → ARPSpoofing.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32811.315
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArpGhostGateway", "ArpGhostGateway\ArpGhostGateway.csproj", "{E1AAF889-8219-4C16-A78A-08457884B0DF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ARPSpoofing", "ARPSpoofing\ARPSpoofing.csproj", "{50EB6363-FCD4-461E-9D22-58EC53FBCEA2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E1AAF889-8219-4C16-A78A-08457884B0DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E1AAF889-8219-4C16-A78A-08457884B0DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E1AAF889-8219-4C16-A78A-08457884B0DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E1AAF889-8219-4C16-A78A-08457884B0DF}.Release|Any CPU.Build.0 = Release|Any CPU
{50EB6363-FCD4-461E-9D22-58EC53FBCEA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{50EB6363-FCD4-461E-9D22-58EC53FBCEA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{50EB6363-FCD4-461E-9D22-58EC53FBCEA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{50EB6363-FCD4-461E-9D22-58EC53FBCEA2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions ArpGhostGateway/App.xaml → ARPSpoofing/App.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Application x:Class="ArpGhostGateway.App"
<Application x:Class="ARPSpoofing.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ArpGhostGateway"
xmlns:local="clr-namespace:ARPSpoofing"
StartupUri="MainWindow.xaml">
<Application.Resources>

Expand Down
2 changes: 1 addition & 1 deletion ArpGhostGateway/App.xaml.cs → ARPSpoofing/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Threading.Tasks;
using System.Windows;

namespace ArpGhostGateway
namespace ARPSpoofing
{
/// <summary>
/// Interaction logic for App.xaml
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Windows;
using System.Windows.Data;

namespace ArpGhostGateway.Converts
namespace ARPSpoofing.Converts
{
public class BoolVisibilityConveter : IValueConverter
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Windows;
using System.Windows.Data;

namespace ArpGhostGateway.Converts
namespace ARPSpoofing.Converts
{
public class BoolVisibilityReConveter : IValueConverter
{
Expand Down
2 changes: 1 addition & 1 deletion ArpGhostGateway/IPObject.cs → ARPSpoofing/IPObject.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Net;

namespace ArpGhostGateway
namespace ARPSpoofing
{
public class IPObject
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Window x:Class="ArpGhostGateway.MainWindow"
<Window x:Class="ARPSpoofing.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ArpGhostGateway"
xmlns:local="clr-namespace:ARPSpoofing"
xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
xmlns:convert="clr-namespace:ArpGhostGateway.Converts"
xmlns:convert="clr-namespace:ARPSpoofing.Converts"
mc:Ignorable="d"
ResizeMode="CanMinimize"
Title="ARP欺诈工具" Height="510" Width="750">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ArpGhostGateway
namespace ARPSpoofing
{
/// <summary>
/// Interaction logic for MainWindow.xaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using SharpPcap;
using SharpPcap.LibPcap;
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
Expand All @@ -15,7 +14,7 @@
using System.Threading.Tasks;
using System.Windows;

namespace ArpGhostGateway
namespace ARPSpoofing
{
public class MainWindowViewModel : ObservableObject
{
Expand Down Expand Up @@ -470,7 +469,7 @@ private void CallTargetComputer()
MacAddress = compute.MacAddress,
};

attackComputer.AttackTask = Task.Run(async () =>
attackComputer.ArpAttackTask = Task.Run(async () =>
{
while (true)
{
Expand All @@ -481,15 +480,26 @@ private void CallTargetComputer()
try
{
LibPcapLiveDevice.SendPacket(packet);
if (!attackComputer.Succeed)
{
attackComputer.Succeed = true;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
attackComputer.Succeed = false;
//MessageBox.Show(ex.Message);
}

await Task.Delay(1000);
}
}, attackComputer.CancellationTokenSource.Token);

attackComputer.DnsAttackTask = Task.Run(() =>
{
//Todo dns attack
});

ArpAttackComputers.Add(attackComputer);
}
}
Expand Down Expand Up @@ -555,10 +565,12 @@ public class Computer
/// </summary>
public class ArpAttackComputer : ObservableObject
{
public bool Succeed { get; set; } //是否攻击成功
public string IPAddress { get; set; }
public string MacAddress { get; set; }
public bool IsSelected { get; set; }
public Task AttackTask { get; set; }
public Task ArpAttackTask { get; set; }
public Task DnsAttackTask { get; set; } //todo define dns attack
public CancellationTokenSource CancellationTokenSource { get; set; }

private double _value;
Expand All @@ -575,13 +587,16 @@ public ArpAttackComputer()
{
while (true)
{
await Task.Delay(500);
Application.Current.Dispatcher.Invoke(() =>
if (Succeed)
{
Value += 33;
if (Value > 100)
Value = 0;
});
await Task.Delay(500);
Application.Current.Dispatcher.Invoke(() =>
{
Value += 33;
if (Value > 100)
Value = 0;
});
}
}
});
}
Expand All @@ -591,7 +606,7 @@ public ArpAttackComputer()
/// </summary>
internal void SendArpSpoofing()
{
AttackTask?.Start();
ArpAttackTask?.Start();
}

internal void CancelTask()
Expand Down
Binary file added Images/main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#### 代码说明文档:
https://www.cnblogs.com/qwqwQAQ/p/16955123.html

![image](Images/main.png)
#### 如何运行?
##### 1.安装winpcap
https://www.winpcap.org/install/default.htm
Expand All @@ -13,4 +13,7 @@ vs2022+.net6
##### 3.如何使用
1.切换最上面网卡下拉框直到能够自动加载ip和mac地址
2.设置网段,然后扫描
3.选择ip,攻击它。
3.选择ip,攻击它。

#### TODO
dns劫持

0 comments on commit 74efb54

Please sign in to comment.