MongoDB Query after loading piZap Breach
by blackboar - Saturday September 16, 2023 at 10:35 PM
#1
{ "_id" : ObjectId("6506104587c3282b491c57b9"), "Code" : { "S" : "18590b272a5efb22cd9367ea2d40c2eaab7ab611" }, "FBUserId" : { "S" : "123" }, "PointCount" : { "N" : "27" }, "NumberPhotos" : { "N" : "2" }, "TotalShares" : { "N" : "1" }, "GalleryStyle" : { "S" : "237,235,241," }, "UserName" : { "S" : "345" }, "Created" : { "N" : "1424721619" }, "Email" : { "S" : "[email protected]" }, "LastEmail" : { "N" : "1450929178" }, "EmailOptIn" : { "N" : "1" }, "CountryCode" : { "S" : "US" }, "LastLogin" : { "N" : "1431274471" }, "Active" : { "N" : "1" }, "Name" : { "S" : "Jennifer nett" } }

This is the JSON for one of the leaks.

1) If this is loaded into mongodb, how do we search on the "Email" -> S = "[email protected]"
2) how do I create an Index for Email->S

Anyone know?
Reply
#2
To search for the "Email" field with the value "[email protected]" in MongoDB, you can use the following query:

db.collectionName.find({ "Email.S": "[email protected]" })

To create an index for the "Email" field in MongoDB, you can use the `createIndex()` method. Here's an example:

db.collectionName.createIndex({ "Email.S": 1 })

The `1` in the `createIndex()` method specifies that the index should be created in ascending order. If you want to create the index in descending order, you can use `-1` instead.
telegram: @ynx01
[Image: giphy.webp]
Reply
#3
Nice. I didn't think I'd get an answer. Looks like I gave up and dropped the DB. But I'll load it again and create the Index and try to requery.

Thanks!
Reply
#4
(09-18-2023, 06:49 PM)blackboar Wrote: Nice. I didn't think I'd get an answer. Looks like I gave up and dropped the DB. But I'll load it again and create the Index and try to requery.

Thanks!

Np Good luck!
telegram: @ynx01
[Image: giphy.webp]
Reply
#5
(09-18-2023, 04:57 PM)yni Wrote: To search for the "Email" field with the value "[email protected]" in MongoDB, you can use the following query:

db.collectionName.find({ "Email.S": "[email protected]" })

To create an index for the "Email" field in MongoDB, you can use the `createIndex()` method. Here's an example:

db.collectionName.createIndex({ "Email.S": 1 })

The `1` in the `createIndex()` method specifies that the index should be created in ascending order. If you want to create the index in descending order, you can use `-1` instead.

Does this account for case-sensitivity in queries?
Reply
#6
No,

db.collectionName.find({ "Email.S": "[email protected]" }) 

would have to change to


db.collectionName.find({ "Email.S": /[email protected]/i })

if memory serves.
Reply
#7
Looks like I reloaded it without the substructures so I don't need a nested query.

But thanks for your help. Good to know if I have other breaches like it.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  $100 MONGODB Atlas credit problem 2 893 09-18-2023, 06:28 AM
Last Post: Yaddmin
  SHARING: Periscope C2 system for breach ops dredd 0 792 09-18-2023, 04:21 AM
Last Post: dredd



 Users browsing this thread: 1 Guest(s)