diff --git a/.env.example b/.env similarity index 100% rename from .env.example rename to .env diff --git a/.gitignore b/.gitignore index 89fa065..18ba531 100644 --- a/.gitignore +++ b/.gitignore @@ -73,10 +73,6 @@ typings/ # Yarn Integrity file .yarn-integrity -# dotenv environment variables file -.env -.env.test - # parcel-bundler cache (https://parceljs.org/) .cache diff --git a/README.md b/README.md index 5d67397..1b60064 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Using this on a user account is prohibited by the Discord TOS and can lead to th ## Usage: - By using binaries: - - Download binary from [Releases](https://github.com/MrBoombastic/OSINTCord/releases) tab. + - Download binary from the [Releases](https://github.com/MrBoombastic/OSINTCord/releases) tab. - Fill in the `.env` file. - Run the binary. - By using source code: @@ -23,23 +23,26 @@ Using this on a user account is prohibited by the Discord TOS and can lead to th - Fill in the `.env` file and place it in `src` directory. - Run `npm start`. +All results will be stored in the `logs` and `media` directories. + ## Options: -You can use some default options from [.env.example](.env.example). +You can use some default options from the already provided [.env](.env) file. -- When using "MEMBERS" mode: +- When you want to dump guild members, set `MODE` to `MEMBERS` and set - `GUILD_ID`: The guild ID you want to get data from. - `CHANNEL_ID`: The channel ID, which also will be used to get data from. - `SPACING`: Spacing between columns in output file. - `TOKEN`: Your Discord account token. - `DELAY`: Delay between *some* requests. - - `DICTIONARY`: Characters used by the bruteforce method. Case-insensitive, duplicates are ignored. + - `DICTIONARY`: Characters used by the bruteforce method. Case-insensitive, duplicates are ignored, sorted + alphabetically. - `DATE_FORMAT`: format of the parsed date (refer to the [Day.js manual](https://day.js.org/docs/en/display/format)). - `DATE_LOCALE`: locale used in the parsed date ([list of supported locales](https://github.com/iamkun/dayjs/tree/dev/src/locale)). -- When using "WATCHDOG" mode: - - `GUILD_ID`: The guild ID you want to get data from. Set to `all`, if you want to receive data from all members' +- When you want to trace deleted and edited messages, set `MODE` to `WATCHDOG` and set + - `GUILD_ID`: The guild ID you want to get data from. Set to `all`, if you want to receive data from all available guilds. - `TOKEN`: Your Discord account token. diff --git a/src/events/members/ready.js b/src/events/members/ready.js index 0c774ca..6868258 100644 --- a/src/events/members/ready.js +++ b/src/events/members/ready.js @@ -1,4 +1,4 @@ -const {welcome, exit} = require("../../utils"); +const {welcome, exit, saveMembers} = require("../../utils"); const {perms, overlap, bruteforce} = require("../../steps"); module.exports = async (client) => { @@ -24,5 +24,6 @@ module.exports = async (client) => { // Done! console.log(`Fetching done! Found ${guild.members.cache.size}/${guild.memberCount} => ${guild.members.cache.size / guild.memberCount * 100}% members.`); + saveMembers(client, guild); exit(client); }; diff --git a/src/events/watchdog/messageDelete.js b/src/events/watchdog/messageDelete.js index c3e276b..2ac61bc 100644 --- a/src/events/watchdog/messageDelete.js +++ b/src/events/watchdog/messageDelete.js @@ -9,6 +9,6 @@ module.exports = async (client, message) => { downloadFile(x.proxyURL); }); } - client.logger.info(info); + client.logger.log(info); } }; diff --git a/src/events/watchdog/messageUpdate.js b/src/events/watchdog/messageUpdate.js index 6989950..8f151cd 100644 --- a/src/events/watchdog/messageUpdate.js +++ b/src/events/watchdog/messageUpdate.js @@ -2,6 +2,7 @@ const {downloadFile} = require("../../utils"); module.exports = async (client, oldMsg, newMsg) => { if (oldMsg.guildId === process.env.GUILD_ID || process.env.GUILD_ID.toLowerCase() === "all") { + if (oldMsg.embeds.length === 0 && newMsg.embeds.length > 0) return; //ignoring generating thumbnails for images let info = `[EDITED MESSAGE] Guild: ${oldMsg.guild.name} Channel: ${oldMsg.channel.name} Author: ${oldMsg.author?.tag} Bot: ${oldMsg.author?.bot} OLD CONTENT: ${oldMsg.content} NEW CONTENT: ${newMsg.content}`; @@ -13,6 +14,6 @@ NEW CONTENT: ${newMsg.content}`; downloadFile(x.proxyURL); }); } - client.logger.info(info); + client.logger.log(info); } }; diff --git a/src/events/watchdog/ready.js b/src/events/watchdog/ready.js index d92c37c..7e04ab6 100644 --- a/src/events/watchdog/ready.js +++ b/src/events/watchdog/ready.js @@ -13,7 +13,7 @@ module.exports = async (client) => { watchdog: { type: "file", layout: {type: "pattern", pattern: "[%d] %m%n"}, - filename: `${process.env.GUILD_ID}.log` + filename: `logs/watchdog-${process.env.GUILD_ID}.log` } }, categories: {default: {appenders: ["watchdog"], level: "info"}}, diff --git a/src/index.js b/src/index.js index afbc1e1..03341d5 100644 --- a/src/index.js +++ b/src/index.js @@ -2,14 +2,13 @@ const {Client} = require("discord.js-selfbot-v13"); global.dayjs = require("dayjs"); dayjs.extend(require("dayjs/plugin/localizedFormat")); -const {checkConfig, exit} = require("./utils.js"); -const {saveMembers} = require("./utils"); +const {checkConfig, exit, saveMembers} = require("./utils.js"); require('dotenv').config(); // Setting up client const client = new Client({ - checkUpdate: false, partials: ["GUILD_MEMBER"] + checkUpdate: false, }); // Config file validation @@ -39,7 +38,7 @@ for (const file of events[process.env.MODE.toLowerCase()]) { process.on("SIGINT", async () => { console.log("\nStopping at user's request!"); - if (process.env.MODE === "MEMBERS") saveMembers(client, client.guilds.cache.get(process.env.GUILD_ID)); + if (process.env.MODE.toLowerCase() === "members") saveMembers(client, client.guilds.cache.get(process.env.GUILD_ID)); exit(client); }); diff --git a/src/utils.js b/src/utils.js index 2992b31..44717a6 100644 --- a/src/utils.js +++ b/src/utils.js @@ -49,7 +49,7 @@ module.exports = { data += guild.members.cache.map(member => module.exports.formatUserData(member, process.env.SPACING, process.env.DATE_FORMAT)).join("\n"); // Save to file - const filename = `members-${Date.now()}.txt`; + const filename = `logs/members-${guild.id}-${Date.now()}.txt`; try { fs.writeFileSync(filename, data); console.log(`Saved data to ${filename}!`);