lanmaster53 / recon-ng

Open Source Intelligence gathering tool aimed at reducing the time spent harvesting information from open sources.
GNU General Public License v3.0
4.1k stars 646 forks source link

Add Phone Number Column for contacts #43

Closed cam-barts closed 4 years ago

cam-barts commented 5 years ago

I am not much of a sqlite expert, so I mostly copied the methodology from #33. Hoping to be able to build in some modules using this functionality in the future.

Closes #35

nullJaX commented 4 years ago

Actually, intelx.io enhancement would use it in the future as it returns a lot of various data. My only question: Is there any specific reason to keep all records' data as text? Does it have to be TEXT?

cam-barts commented 4 years ago

@nullJaX That's a great question, and for the most part, I put it as text because the rest of the schema is text. This might be coming from a place of ignorance, but wouldn't the only benefit to it NOT being text be the ability to aggregate? I don't think user will need averages or sums of phone numbers, and I am pretty sure you can still get distinct counts of text fields? What are your thoughts?

lanmaster53 commented 4 years ago

@nullJaX That's a great question, and for the most part, I put it as text because the rest of the schema is text. This might be coming from a place of ignorance, but wouldn't the only benefit to it NOT being text be the ability to aggregate? I don't think user will need averages or sums of phone numbers, and I am pretty sure you can still get distinct counts of text fields? What are your thoughts?

Databases do treat different types more efficiently for things like searching, indexing, etc. but with data sets as small as those created by Recon-ng, it's negligible. I use text because it's the most flexible. People put all kinds of stuff in these fields.

nullJaX commented 4 years ago

Thank you, both @lanmaster53 and @cam-barts for reply. I suspected that the reason is to maintain type flexibility (ie. latitude and longitude can be in different formats). However, studying sqlite architecture and code several months ago I found out that it may be better to keep types as accurate as it can be.

My suggestion is (just for a case when a workspace is big in terms of records) to match fields/columns to their exact type only when we are sure that they will contain specific data, such as port number or date/timestamps. What do you guys think about my idea?

lanmaster53 commented 4 years ago

Thank you, both @lanmaster53 and @cam-barts for reply. I suspected that the reason is to maintain type flexibility (ie. latitude and longitude can be in different formats). However, studying sqlite architecture and code several months ago I found out that it may be better to keep types as accurate as it can be.

My suggestion is (just for a case when a workspace is big in terms of records) to match fields/columns to their exact type only when we are sure that they will contain specific data, such as port number or date/timestamps. What do you guys think about my idea?

Nothing will ever qualify as "sure that they will contain specific data" without forcing module developers to make sure something is the right type before they attempt to store it. Honestly, knowing the type of people that develop Recon-ng modules, and the unpredictability of the resources that provide the data, this will cause more problems than it is worth.

lanmaster53 commented 4 years ago

Since this was submitted as a pull to the master branch, I went ahead and merged it manually. I needed to make a small change anyway. It's in staging now and will be pushed to master later today. Thanks!