bellingcat / telegram-phone-number-checker

Check if phone numbers are connected to Telegram accounts.
https://pypi.org/project/telegram-phone-number-checker/
MIT License
1.02k stars 172 forks source link

Return richer information about accounts #16

Closed GalenReich closed 3 months ago

GalenReich commented 4 months ago

At the moment, the tool makes the id, username, first_name, last_name fields available for each account that is successfully found.

Telethon returns several more fields associated with a User, as detailed in their api.

Some of these fields (fake, scam, premium,verified, etc...) look like they could be of interest to researchers. This may need some research, as it is unclear how widely these fields are used and if they are likely to be accurate.

It would be good if useful fields could be identified and returned to the tool user.

BDFL669 commented 4 months ago

I would really love to work on this issue! Please assign it to me

GalenReich commented 4 months ago

Hi @BDFL669 👋 Thanks for reaching out - we'd really welcome a pull request on this issue - I'm happy to assign it to you for now. If you don't have time to work on it, just let me know and I'll unassign you later!

Also, if you're interested in being part of the wider Bellingcat community, you can join our Bellingcat Discord too.

BDFL669 commented 4 months ago

I'm happy to help! Lemme get to work

GalenReich commented 4 months ago

Looking at the other issues here, this might solve #9 too, though finding a banned number for testing might be difficult.

GalenReich commented 4 months ago

Hi @BDFL669, just wanted to check in and see how you were getting on. Have you found anything of interest about the fields?

GalenReich commented 4 months ago

@BDFL669 said:

hi @GalenReich, sorry for the late response. I've been playing around with the app and most of the entries are not relevant to our usecase. However, I've added new fields I think you might find useful.

Checking: '{Phone Number Removed}' ...Done
{
"{Phone number removed}": {
"id": {ID removed},
"username": "{Username removed}" ,
"first name": "{Name removed}" ,
"last name" : null,
"fake": false,
"scam": null,
"verified": false,
"premium": false,
"mutual contact": false,
"user status" : null,
"bot": false,
"bot chat history": false,
"restricted": false,
"restriction_reason": [ ]
}
}

Great stuff! Just wanted to check in! I've deleted your last message so that the image with the phone number and user information is not preserved, but have quoted it above - it looks good👍

BDFL669 commented 4 months ago

Awesome, thank you so much! Would you like me to submit a PR with the latest changes?

On Fri, 1 Mar 2024, 12:47 Galen Reich, @.***> wrote:

@BDFL669 https://github.com/BDFL669 said:

hi @GalenReich https://github.com/GalenReich, sorry for the late response. I've been playing around with the app and most of the entries are not relevant to our usecase. However, I've added new fields I think you might find useful.

Checking: '{Phone Number Removed}' ...Done { "{Phone number removed}": { "id": {ID removed}, "username": "{Username removed}" , "first name": "{Name removed}" , "last name" : null, "fake": false, "scam": null, "verified": false, "premium": false, "mutual contact": false, "user status" : null, "bot": false, "bot chat history": false, "restricted": false, "restriction_reason": [ ] } }

Great stuff! Just wanted to check in! I'm going to delete your last message so that the image with the phone number and user information is not preserved, but have quoted it above - it looks good👍

— Reply to this email directly, view it on GitHub https://github.com/bellingcat/telegram-phone-number-checker/issues/16#issuecomment-1972858155, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOZBHUWTG2EZRXN54N6HILTYWBFCBAVCNFSM6AAAAABDBXQNI2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZSHA2TQMJVGU . You are receiving this because you were mentioned.Message ID: @.***>

GalenReich commented 4 months ago

Feel free to open a PR or a Draft PR - that would be good - the main thing will be to understand to how common those fields are. For example, does Telegram ever set the scam field?

It might be good to include status.was_online and have some parsing to make it human readable

BDFL669 commented 4 months ago

Thanks for the tip!

On Fri, 1 Mar 2024, 14:25 Galen Reich, @.***> wrote:

Feel free to open a PR or a Draft PR - that would be good - the main thing will be to understand to how common those fields are. For example, does Telegram ever set the scam field?

It might be good to include status.was_online and have some parsing to make it human readable

— Reply to this email directly, view it on GitHub https://github.com/bellingcat/telegram-phone-number-checker/issues/16#issuecomment-1973014250, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOZBHUQZUKJCQ3UGT6RZOXLYWBQRNAVCNFSM6AAAAABDBXQNI2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZTGAYTIMRVGA . You are receiving this because you were mentioned.Message ID: @.***>

BDFL669 commented 3 months ago

Greetings! The API seldom provides information for the scam parameter so I've had to remove it. Moreover, After parsing status.was_online data, I assume this covers the user status field so I've also removed this one as well (telegram rarely propagates this field as well). Here is a screenshot of my output after redacting any revealing details about my telegram account. If the results are satisfactory I shall proceed to open a PR

image

GalenReich commented 3 months ago

Please open a PR! ⭐