Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
more reasonable defaults
  • Loading branch information
kylemcdonald committed Oct 22, 2014
1 parent dc29fab commit f3caf6c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Sniffing/ForceDirectedGraph.pde
Expand Up @@ -43,7 +43,7 @@ class ForceDirectedGraph extends ParticleSystem {
for(int i = 0; i < numberOfParticles(); i++) {
Particle t = getParticle(i);
if(t != p)
makeAttraction(p, t, -SPACER_STRENGTH, 20);
makeAttraction(p, t, -SPACER_STRENGTH, 0);
}
makeAttraction(p, center, CENTER_STRENGTH, min(width, height) / 2);
return p;
Expand Down
3 changes: 2 additions & 1 deletion Sniffing/Sniffing.pde
Expand Up @@ -14,7 +14,8 @@ void setup() {
}

void draw() {
while(monitor.hasNewProbeRequestFrame()) {
// while(monitor.hasNewProbeRequestFrame())
{
ProbeRequestFrame cur = monitor.getNextProbeRequestFrame();
if(cur != null) {
cur.mac = cur.mac.toUpperCase();
Expand Down
9 changes: 7 additions & 2 deletions Sniffing/WifiMonitor.pde
Expand Up @@ -15,6 +15,7 @@ class WifiMonitor extends Thread {
int newData = 0;

String command = "/usr/sbin/tcpdump -l -e -I -i en0";
// String command = "/usr/sbin/tcpdump -l -e -I -i en0 'type mgt subtype probe-req'";
String patternString = ".+SA:([^ ]+) .+? Probe Request \\(([^)]*?)\\) .+";
Pattern pattern;

Expand Down Expand Up @@ -44,7 +45,11 @@ class WifiMonitor extends Thread {
if(line != null) {
Matcher matcher = pattern.matcher(line);
if (matcher.matches()) {
probeRequestFrames.add(new ProbeRequestFrame(matcher.group(1), matcher.group(2)));
String mac = matcher.group(1);
String ssid = matcher.group(2);
if(!ssid.contains("^")) { // no glitches
probeRequestFrames.add(new ProbeRequestFrame(mac, ssid));
}
}
}
}
Expand All @@ -63,7 +68,7 @@ class WifiMonitor extends Thread {
}

ProbeRequestFrame getNextProbeRequestFrame() {
return probeRequestFrames.remove(0);
return hasNewProbeRequestFrame() ? probeRequestFrames.remove(0) : null;
}

void quit() {
Expand Down
2 changes: 2 additions & 0 deletions Sniffing/channel-hop.py 100644 → 100755
@@ -1,3 +1,5 @@
#!/usr/bin/env python

import re
from threading import Timer
import subprocess
Expand Down

0 comments on commit f3caf6c

Please sign in to comment.