Showing posts with label Neurology. Show all posts
Showing posts with label Neurology. Show all posts

Monday, August 24, 2015

PfishBot:Autophishing: The Request: Part I

So we will jump back to messaging in a minute but first we need to go here:

https://m.facebook.com/findfriends/browser/

Where we can "find friends".


Now the JS here is really simple whip open console and we can do a test before we loop it


Successful

And now we use the location.reload(), this will reset the suggestions:



 and now time to automate:

1
2
3
4
5
6
7
8
9
while(1){

document.querySelectorAll("button[type='submit']")[0].click();
  setTimeout(func, 3000);
  function func(){
location.reload();
}
  
}
It may be best to use a for loop though but it works. You actually need a significant delay apparently facebook thinks the public is rather slow. So put as long as you need, a minute so that they never try to block you might be a good idea.

PfishBot:Auto Phishing: Messaging: Part I

Phishing is the process of creating fake IDs and making them appear real. I decided to automate the whole process from replying to messages to adding "friends".

First thing to do is set up the messaging system as this is doubtless to be the most difficult part.

First we find a weakpoint in the site to launch from, in the case of Facebook the page with the most functionality and least html to scan and possibly parse is:


Now I should mention that in order to create a fake account you will probably need a phone number, and getting past this is just not worth it as free applications such as text+ work just fine. Or use a payphone. I don't care.

Great now finding the  message box name is easy:

"composerInput"

however the button for send is a bit more dynamic, it changes each time and there is a convoluted js and php script which hides it unless text was dynamically entered". Two ways past, JS or .Net.


JS

So the JS code is real simple:

Inspect the text box. Lets say for our example it is running under the ID of "u_0_5":


 The errors happened because of button ID change. Now we can text the click again, once we have entered text so as to fake the button(we will get to doing this automatically shortly):
So our code is:

1
2
3
4
5
6
7
8
var content = document.body.textContent || document.body.innerText;
var hasText = content.indexOf("Way to go")!==-1;
if(hasText){
   setTimeout(function(){
       document.getElementById('composerInput').value="Second Check";
    document.getElementById('u_3p_5').click();
   },5000);
}

But that really is not too useful because we have not been able to send it free of user interaction, due to that messy script(or set of scripts) we have left to tackle.

Saturday, May 2, 2015

Neural Synchronizer Application



Meant to follow the idea that the waves can be synced (right and left hemispheres of the brain) through stimuli, using audio and visual. Going to add a physical piece for the palms with a high speed solenoid. I used VB because of the libs for audio(.Beep())
Vis with Processing:
void setup() {
  size(600,600);
}
void draw(){
  noCursor();
background(random(0,255));

}
The rest is using VB:
Auditory:
1
2
3
4
5
6
Public Class Form2

    Private Sub audodd_Click(sender As Object, e As EventArgs) Handles audodd.Click
        Console.Beep(250, 900000000)
    End Sub
End Class
The auditory is emmitting at 250Hz and the 900000000 is for timing.

Visual:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Public Class Form1
    Dim I As Integer

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Sync_Click(sender As Object, e As EventArgs) Handles Sync.Click
        vis.Visible = True
        Dim SecondForm As New Form2
        SecondForm.Show()
        visual.Enabled = True
        visualone.Enabled = True



    End Sub

    Private Sub visual_Tick(sender As Object, e As EventArgs) Handles visual.Tick
        vis.Visible = True


    End Sub

    Private Sub visualone_Tick(sender As Object, e As EventArgs) Handles visualone.Tick
        vis.Visible = False
    End Sub
End Class

Wednesday, April 1, 2015

Warm and Fuzzy Electroencephalography Setup Hat


Yes, those are the audio-video cables which were so popular in the 90's, and they are wired directly into the hat. I will be posting more of the details on finished product later, I need to pick up some op amps for the final wires, the signal fidelity is obviously always a problem, especially at such low power. Anyway, if you choose to just go ahead with it, then ground thyself to prevent uncomfortable metal-skin contact if you wire your intake up with a ground(microchip side).

In the meantime though, the code, but before I begin, there is background noise(cyclic) on the Analog INPUT pins, but if we use the op amp we won't have to mess with this in the software. So, we will follow the old Russian R&D method and make better hardware and not do the American software approach,although we may make a nice and fancy GUI for it. But for now:



int sensorPin = A0;        
float sensorValue = 0;

void setup() {
 Serial.begin(9600); 
}
void loop() {
  sensorValue = analogRead(sensorPin);
  sensorValue=(sensorValue+analogRead(sensorPin));
   sensorValue=(sensorValue+analogRead(sensorPin));
  sensorValue=(sensorValue+analogRead(sensorPin));
    sensorValue=(sensorValue+analogRead(sensorPin));
   sensorValue=(sensorValue+analogRead(sensorPin));
  sensorValue=(sensorValue+analogRead(sensorPin));
if(sensorValue!=0.00){
  delay(22);
  

  if((sensorValue/22)>300){
  
    Serial.println(("10"));
  }else{
      sensorValue = analogRead(sensorPin);
  sensorValue=(sensorValue+analogRead(sensorPin));
   sensorValue=(sensorValue+analogRead(sensorPin));
  sensorValue=(sensorValue+analogRead(sensorPin));
    sensorValue=(sensorValue+analogRead(sensorPin));
   sensorValue=(sensorValue+analogRead(sensorPin));
  sensorValue=(sensorValue+analogRead(sensorPin));
    if(sensorValue/22>300){
    
    Serial.println("70");
  }
  }
sensorValue=0;
}
}

Okay, this is the Computer(display) side:


int a=1; 
 import processing.serial.*;
 
 Serial myPort;        // The serial port
 int xPos = 1;         // horizontal position of the graph
 
 void setup () {
 // set the window size:
 size(600, 600);        
 
 // List all the available serial ports
 println(Serial.list());
 // I know that the first port in the serial list on my mac
 // is always my  Arduino, so I open Serial.list()[0].
 // Open whatever port is the one you're using.
 myPort = new Serial(this, Serial.list()[0], 9600);
 // don't generate a serialEvent() unless you get a newline character:
 myPort.bufferUntil('\n');
 // set inital background:
 background(0);
 }
 void draw () {
 // everything happens in the serialEvent()
 }
 
 void serialEvent (Serial myPort) {
 // get the ASCII string:
 String inString = myPort.readStringUntil('\n');
 
 if (inString != null) {
 // trim off any whitespace:
 inString = trim(inString);
 // convert to an int and map to the screen height:
 float inByte = float(inString); 
 inByte = map(inByte, 0, 1023, 0, height);
 
 // draw the line:
 stroke(127,34,255);
 line(xPos, height, xPos, height - inByte);
 
 // at the edge of the screen, go back to the beginning:
 if (xPos &rt;= width) {
  //save(a+".png");
 a=a+1;
 xPos = 0;
 background(0); 

 } 
 else {
 // increment the horizontal position:
 xPos=xPos+2;
 
 }
 }
 }

Friday, March 27, 2015

Muscular Contractions w/ microphone



Microphone wired up to graph changes in skin surface potential as changes in muscle contraction. Using Audacity(an audio editor that I use for all of my "sick dubstep beats")  one can use the amplifier at about X57dB and then use the noise removal tool. Be sure to take a sample of empty electrodes or in other words, electrodes not in contact with a contracting muscle. This will give plenty of noise sampling space for algorithm. The longer incipit section the better.

One can also take an EKG, now remember that you should place the electrodes on the opposite side of the body for each pair, so across whichever line of symmetry, so:
should be wired in the following pattern(same colors means each is an element of the same pair of electrodes):
There are multiples for the black set which is symmetric across the transverse, but that is okay, the resistance of one side should be equal to the other if the path is the same(one cannot use displacement obviously).

Now for the actual measurement system:


The microphone is used only because it has an op amp and USB converter built directly in, which is quite useful, because the data can be easily stored and manipulated. Now I recommend using well insulated cables for the electrodes, perhaps even negative feedback(to a control sample ground) however this is unnecessary if one uses the standard av cables which were all the rage in the 1990's. I then coated the majority of the head in wax leaving only a small point exposed. I recommend keeping the wax at the melting threshold, that way it quickly solidifies on contact with the electrode and then we can build up multiple layers.


Now if you already looked at the eeg project, you could use those wet electrodes, made with a sponge,solution(salt),and wires. For a gel, you could use something with a glycerol like viscosity possibly mixed with an ionic or make conductivity an innate property of the substance a thick polar substance like the mucilage of plants, but very conductive. Any who, this gel issue can be avoided by using these dry electrodes.
One could also modify the electrodes but be careful because the more surface area exposed the more noise. However these electrodes easily mount to the wrists and arm for measuring contractions of the forearm muscle region.