how to import Breaches into MongoDB
by blackboar - Sunday February 25, 2024 at 02:30 AM
#1
I feel most people could benefit how to import Breaches into MongoDB with this one single command (Assuming located in /mnt/data/Pemiblanc_BF/data/ )

% strings * | sed 's/:/,/g'|sed 's/"/DQUOTE/g'|mongoimport -c pemiblanc -d pemiblanc --host myhost --fields email,password --type csv --drop

Why:

- strings => display the file(s) but get rid of binary characters that can hang up "cat"

- sed 's/:/,/g'|sed 's/"/DQUOTE/g' => gets rid of the colon punctuation to be of type CSV

- mongoimport -c pemiblanc -d pemiblanc --host myhost --fields email,password --type csv --drop

Then once in MongoDB
% mongo --host myhost

Opening MongoDB
>> use pemiblanc
>> db.pemiblanc.find()
>> db.pemiblanc.createIndex({email:1})

Now you can query from the MongoDB client OR have ChatGPT/Microsoft Edge write you python/perl code to query every collection you have
Reply
#2
thanks appreciate it
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Hide executable like a normal file (JPG, PDF, DOCX) | Best way to spread your RAT HackingRealm 753 39,991 36 minutes ago
Last Post: breacher_boss
  [REAL-SHIT] $1000/Day Hacking Wordpress Websites On Automation GlitchPool 188 7,092 40 minutes ago
Last Post: breacher_boss
  [FREE] Dark Library (guides and books) (repost from old forum) TH098 229 27,972 41 minutes ago
Last Post: breacher_boss
  [FREE] OSCP, OSEP, eWPTX, eCPPT, SANS, OSWE Courses rastamice3 247 6,718 43 minutes ago
Last Post: breacher_boss
  [FREE] OffSec PEN-200 (OSCP course) 2025 version - PDF + videos Tamarisk 1,716 175,237 44 minutes ago
Last Post: breacher_boss

Forum Jump:


 Users browsing this forum: 1 Guest(s)