Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of ssh://git@github.com/gelendir/bitduckspoof

  • Loading branch information...
commit 57401ed956f80d844ab0f5c868f9b12359861918 2 parents 38961a3 + a2751b7
@gelendir authored
Showing with 128 additions and 22 deletions.
  1. +6 −1 attacker/src/org/bitducks/spoofing/{main → }/Launcher.java
  2. +8 −3 attacker/src/org/bitducks/spoofing/gui/Gui.java
  3. +5 −0 attacker/src/org/bitducks/spoofing/gui/serviceView/ARPReplySpoofingView.java
  4. +5 −0 attacker/src/org/bitducks/spoofing/gui/serviceView/BroadcastARPServiceView.java
  5. +5 −0 attacker/src/org/bitducks/spoofing/gui/serviceView/DNSServiceView.java
  6. +5 −0 attacker/src/org/bitducks/spoofing/gui/serviceView/IPStealerServiceView.java
  7. +5 −0 attacker/src/org/bitducks/spoofing/gui/serviceView/RogueDHCPServiceView.java
  8. +5 −5 attacker/src/org/bitducks/spoofing/services/DNSService.java
  9. +1 −3 attacker/src/org/bitducks/spoofing/{main → test}/Tests.java
  10. +8 −0 core/src/org/bitducks/spoofing/core/rules/DNSIpv4Rule.java
  11. +8 −4 core/src/org/bitducks/spoofing/core/rules/DNSQueryrule.java
  12. +21 −1 core/src/org/bitducks/spoofing/gui/View.java
  13. +6 −1 defender/src/org/bitducks/spoofing/{main → }/Launcher.java
  14. +12 −0 defender/src/org/bitducks/spoofing/gui/Gui.java
  15. +7 −1 defender/src/org/bitducks/spoofing/gui/{ → serviceView}/ARPReplyRateServiceView.java
  16. +7 −1 defender/src/org/bitducks/spoofing/gui/{ → serviceView}/ActiveARPProtectionServiceView.java
  17. +7 −1 defender/src/org/bitducks/spoofing/gui/{ → serviceView}/DNSProtectionServiceView.java
  18. +7 −1 defender/src/org/bitducks/spoofing/gui/{ → serviceView}/RogueDHCPDetectionServiceView.java
View
7 ...cker/src/org/bitducks/spoofing/main/Launcher.java → attacker/src/org/bitducks/spoofing/Launcher.java
@@ -1,4 +1,4 @@
-package org.bitducks.spoofing.main;
+package org.bitducks.spoofing;
import javax.swing.WindowConstants;
@@ -8,6 +8,11 @@
import org.bitducks.spoofing.gui.DeviceSelection;
import org.bitducks.spoofing.gui.Gui;
+/**
+ * Used to lauch the main UI for the Attacker.
+ * @author Simon Perreault
+ *
+ */
public class Launcher {
public static void main(String[] args) throws Exception {
View
11 attacker/src/org/bitducks/spoofing/gui/Gui.java
@@ -15,6 +15,11 @@
import org.bitducks.spoofing.gui.serviceView.ARPReplySpoofingView;
import org.bitducks.spoofing.gui.serviceView.RogueDHCPServiceView;
+/**
+ * The main Ui witch contain tab of views.
+ * @author Simon Perreault
+ *
+ */
public class Gui extends JFrame {
/**
@@ -32,12 +37,12 @@ public Gui(NetworkInterface myInterface) throws IOException {
}
this.setUpUi();
- //this.setSize(500, 500);
- //this.repaint();
- //this.revalidate();
this.pack();
}
+ /**
+ * Setup the Tab for the main Ui
+ */
private void setUpUi() {
View view = new DNSServiceView();
View
5 attacker/src/org/bitducks/spoofing/gui/serviceView/ARPReplySpoofingView.java
@@ -18,6 +18,11 @@
import org.bitducks.spoofing.services.RedirectNAT;
import org.bitducks.spoofing.services.ReplyARPService;
+/**
+ * The view for Arp Reply Spoofing service
+ * @author Simon Perreault
+ *
+ */
public class ARPReplySpoofingView extends View implements ActionListener {
/**
View
5 attacker/src/org/bitducks/spoofing/gui/serviceView/BroadcastARPServiceView.java
@@ -8,6 +8,11 @@
import org.bitducks.spoofing.gui.View;
import org.bitducks.spoofing.services.BroadcastARPService;
+/**
+ * The view for Broadcast Arp Service.
+ * @author Simon Perreault
+ *
+ */
public class BroadcastARPServiceView extends View {
/**
View
5 attacker/src/org/bitducks/spoofing/gui/serviceView/DNSServiceView.java
@@ -24,6 +24,11 @@
import org.bitducks.spoofing.gui.View;
import org.bitducks.spoofing.services.DNSService;
+/**
+ * The view for Dns poisoning service.
+ * @author Simon Perreault
+ *
+ */
public class DNSServiceView extends View implements ActionListener{
/**
View
5 attacker/src/org/bitducks/spoofing/gui/serviceView/IPStealerServiceView.java
@@ -8,6 +8,11 @@
import org.bitducks.spoofing.gui.View;
import org.bitducks.spoofing.services.IpStealer;
+/**
+ * The view for Ip starvation service.
+ * @author Simon Perreault
+ *
+ */
public class IPStealerServiceView extends View {
/**
View
5 attacker/src/org/bitducks/spoofing/gui/serviceView/RogueDHCPServiceView.java
@@ -17,6 +17,11 @@
import org.bitducks.spoofing.gui.View;
import org.bitducks.spoofing.services.RogueDHCPService;
+/**
+ * The view for Rogue DHCP Service
+ * @author Simon Perreault
+ *
+ */
public class RogueDHCPServiceView extends View implements ActionListener{
/**
View
10 attacker/src/org/bitducks/spoofing/services/DNSService.java
@@ -16,8 +16,12 @@
import org.bitducks.spoofing.packet.DNSPacket;
import org.bitducks.spoofing.packet.PacketFactory;
+/**
+ * DNS Service will poison all the dns query receive and answer to them with false information.
+ * @author Simon Perreault
+ *
+ */
public class DNSService extends Service {
- //private InetAddress falseDefaultIpAddr = null;
private Map<String, InetAddress> dnsPacketFilter = new HashMap<String, InetAddress>();
public DNSService() {
@@ -26,9 +30,6 @@ public DNSService() {
this.getPolicy().addRule(new NotMyIpPacketRule(Server.getInstance().getInfo().getAddress()));
this.getPolicy().setStrict(true);
-
- // TODO Get our IP or the IP provided
- //this.setDNSFalseIp(Server.getInstance().getInfo().getAddress());
}
public void addDnsPacketFilter(String regex, InetAddress addr) {
@@ -103,7 +104,6 @@ public void run() {
public InetAddress isDNSPacketMatchingWithFilter(Packet p) {
// If empty --
if (this.dnsPacketFilter.isEmpty()) {
- //return this.falseDefaultIpAddr;
return null;
}
View
4 attacker/src/org/bitducks/spoofing/main/Tests.java → attacker/src/org/bitducks/spoofing/test/Tests.java
@@ -1,4 +1,4 @@
-package org.bitducks.spoofing.main;
+package org.bitducks.spoofing.test;
import java.net.InetAddress;
import java.net.UnknownHostException;
@@ -25,8 +25,6 @@
import org.bitducks.spoofing.services.ArpRecieveService;
import org.bitducks.spoofing.services.ArpScanService;
import org.bitducks.spoofing.services.arp.ArpCache;
-import org.bitducks.spoofing.test.CustomAppender;
-import org.bitducks.spoofing.test.DummyService;
import org.bitducks.spoofing.util.Constants;
import org.bitducks.spoofing.util.IpRange;
import org.bitducks.spoofing.util.IpUtil;
View
8 core/src/org/bitducks/spoofing/core/rules/DNSIpv4Rule.java
@@ -2,8 +2,16 @@
import jpcap.packet.Packet;
+/**
+ * Check if the DNS Query is an Ipv4 query
+ * @author Simon Perreault
+ *
+ */
public class DNSIpv4Rule extends DNSQueryrule {
+ /**
+ * Return true if the dns query is an ipv4 query, otherwise false;
+ */
@Override
public boolean checkRule(Packet p) {
return (super.checkRule(p) &&
View
12 core/src/org/bitducks/spoofing/core/rules/DNSQueryrule.java
@@ -2,15 +2,19 @@
import jpcap.packet.Packet;
+/**
+ * Rules that check if the Dns packet is a query.
+ * @author Simon Perreault
+ *
+ */
public class DNSQueryrule extends DNSRule {
+ /**
+ * Return true if the Dns packet is a query, otherwise false.
+ */
@Override
public boolean checkRule(Packet p) {
- /*System.out.println("Checking Rule " + (p instanceof UDPPacket &&
- (p.data[2] & 0xF0) == (byte) 0x00 ));
- System.out.println(p);*/
-
return (super.checkRule(p) &&
(p.data[2] & 0x80) == (byte) 0x00); // First bit == 0
}
View
22 core/src/org/bitducks/spoofing/gui/View.java
@@ -17,6 +17,11 @@
import org.bitducks.spoofing.core.Server;
import org.bitducks.spoofing.core.Service;
+/**
+ * Basic view for a service
+ * @author Simon Perreault
+ *
+ */
public abstract class View extends JPanel implements ActionListener {
/**
@@ -49,10 +54,17 @@ public View(String title) {
setUpUI();
}
+ /**
+ * Get Title
+ * @return the title
+ */
public String getTitle() {
return this.title;
}
+ /**
+ * Setup the ui for all views.
+ */
private void setUpUI() {
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
@@ -68,12 +80,14 @@ private void setUpUI() {
this.add(Box.createRigidArea(new Dimension(0, 5)));
this.setUpTerminal();
- //this.add(this.terminal);
this.add(Box.createRigidArea(new Dimension(0, 5)));
}
+ /**
+ * Setup Start, Stop and Clear button.
+ */
private void setUpStartStopClearButton() {
this.startStopbuttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
@@ -95,6 +109,9 @@ private void setUpStartStopClearButton() {
this.startStopbuttonPanel.add(this.clear);
}
+ /**
+ * Setup Terminal for each different views.
+ */
private void setUpTerminal() {
this.terminal.setEditable(false);
JScrollPane scroll = new JScrollPane(this.terminal);
@@ -107,6 +124,9 @@ private void setUpTerminal() {
this.add(scroll, BorderLayout.CENTER);
}
+ /**
+ * Callback when an action is performed.
+ */
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
View
7 ...nder/src/org/bitducks/spoofing/main/Launcher.java → defender/src/org/bitducks/spoofing/Launcher.java
@@ -1,4 +1,4 @@
-package org.bitducks.spoofing.main;
+package org.bitducks.spoofing;
import javax.swing.WindowConstants;
@@ -8,6 +8,11 @@
import org.bitducks.spoofing.gui.DeviceSelection;
import org.bitducks.spoofing.gui.Gui;
+/**
+ * Used to lauch the main UI for the Defender.
+ * @author Simon Perreault
+ *
+ */
public class Launcher {
public static void main(String[] args) throws Exception {
View
12 defender/src/org/bitducks/spoofing/gui/Gui.java
@@ -7,9 +7,18 @@
import javax.swing.JTabbedPane;
import org.bitducks.spoofing.core.Server;
+import org.bitducks.spoofing.gui.serviceView.ARPReplyRateServiceView;
+import org.bitducks.spoofing.gui.serviceView.ActiveARPProtectionServiceView;
+import org.bitducks.spoofing.gui.serviceView.DNSProtectionServiceView;
+import org.bitducks.spoofing.gui.serviceView.RogueDHCPDetectionServiceView;
import jpcap.NetworkInterface;
+/**
+ * The main Ui witch contain tab of views.
+ * @author Simon Perreault
+ *
+ */
public class Gui extends JFrame {
/**
@@ -30,6 +39,9 @@ public Gui(NetworkInterface myInterface) throws IOException {
this.pack();
}
+ /**
+ * Setup the Tab for the main Ui
+ */
private void setUpUi() {
View view = new DNSProtectionServiceView();
View
8 ...itducks/spoofing/gui/ARPReplyRateServiceView.java → ...fing/gui/serviceView/ARPReplyRateServiceView.java
@@ -1,4 +1,4 @@
-package org.bitducks.spoofing.gui;
+package org.bitducks.spoofing.gui.serviceView;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
@@ -11,8 +11,14 @@
import javax.swing.JPanel;
import org.bitducks.spoofing.core.Service;
+import org.bitducks.spoofing.gui.View;
import org.bitducks.spoofing.services.ARPReplyRateService;
+/**
+ * The view for Arp Reply Rate Service.
+ * @author Simon Perreault
+ *
+ */
public class ARPReplyRateServiceView extends View implements ActionListener {
View
8 .../spoofing/gui/ActiveARPProtectionServiceView.java → ...i/serviceView/ActiveARPProtectionServiceView.java
@@ -1,12 +1,18 @@
-package org.bitducks.spoofing.gui;
+package org.bitducks.spoofing.gui.serviceView;
import java.awt.BorderLayout;
import javax.swing.JLabel;
import org.bitducks.spoofing.core.Service;
+import org.bitducks.spoofing.gui.View;
import org.bitducks.spoofing.services.ActiveARPProtectionService;
+/**
+ * The view for Active Arp Protection Service.
+ * @author Simon Perreault
+ *
+ */
public class ActiveARPProtectionServiceView extends View {
/**
View
8 ...tducks/spoofing/gui/DNSProtectionServiceView.java → ...ing/gui/serviceView/DNSProtectionServiceView.java
@@ -1,12 +1,18 @@
-package org.bitducks.spoofing.gui;
+package org.bitducks.spoofing.gui.serviceView;
import java.awt.BorderLayout;
import javax.swing.JLabel;
import org.bitducks.spoofing.core.Service;
+import org.bitducks.spoofing.gui.View;
import org.bitducks.spoofing.services.DNSProtectionService;
+/**
+ * The view for Dns protection Service
+ * @author Simon Perreault
+ *
+ */
public class DNSProtectionServiceView extends View {
/**
View
8 ...s/spoofing/gui/RogueDHCPDetectionServiceView.java → ...ui/serviceView/RogueDHCPDetectionServiceView.java
@@ -1,4 +1,4 @@
-package org.bitducks.spoofing.gui;
+package org.bitducks.spoofing.gui.serviceView;
import java.awt.BorderLayout;
import java.awt.Dimension;
@@ -21,8 +21,14 @@
import javax.swing.JScrollPane;
import org.bitducks.spoofing.core.Service;
+import org.bitducks.spoofing.gui.View;
import org.bitducks.spoofing.services.RogueDHCPDetectionService;
+/**
+ * The view for Rogue DHCP Detection service.3
+ * @author Simon Perreault
+ *
+ */
public class RogueDHCPDetectionServiceView extends View implements ActionListener {
/**
Please sign in to comment.
Something went wrong with that request. Please try again.