postuf / telegram-osint-lib Goto Github PK
View Code? Open in Web Editor NEWTelegram scenario-based API aimed at OSINT
Home Page: https://habr.com/ru/post/486322
License: MIT License
Telegram scenario-based API aimed at OSINT
Home Page: https://habr.com/ru/post/486322
License: MIT License
В статье на habr.com сказано:
"... однако его массовое применение несколько затруднительно “из коробки“"
А как добиться массового применения?
Какой формат должен быть у ключа? Можно ли как-то получить его из tdata?
Hello! what am I doing wrong?
Fatal error: Declaration of TelegramOSINT\Registration\RegistrationFromTgApp::onMessage(TelegramOSINT\MTSerialization\AnonymousMessage $message) must be compatible with TelegramOSINT\TGConnection\SocketMessenger\MessageListener::onMessage(TelegramOSINT\MTSerialization\AnonymousMessage $message): void in /app/src/Registration/RegistrationFromTgApp.php on line 285
Hey guys!
In the sourcecode I can see a bunch of hardcoded usernames -
Asen_17
asensio_17
phuketrusa
a_averyanova_m
ru2chnews
and phone numbers -
79265558802
79803100357
79264598639
What was the reason for putting them there and have you obtained any permission from the original owners of these accounts?
Hey there,
As there isn't a SECURITY.md
with an email on your repository, I am unsure how to contact you regarding a potential security issue.
Would you kindly add a SECURITY.md
file with an e-mail to your repository? GitHub recommends this as the best way to ensure security issues are responsibly disclosed, and it would massively help security researchers get in touch next time.
Thank you so much and I look forward to hearing from you!
How to disable logging in console using docker? Thanks!
PHP Fatal error: Uncaught TelegramOSINT\Exception\TGException: ERR_TL_CONTAINER_BAD_AUTHKEY_ID: in C:\Program Files\Ampps\www\telegram\vendor\postuf\telegram-api-lib\src\TGConnection\SocketMessenger\EncryptedSocketMessenger.php:189
Stack trace:
#0 C:\Program Files\Ampps\www\telegram\vendor\postuf\telegram-api-lib\src\TGConnection\SocketMessenger\EncryptedSocketMessenger.php(155): TelegramOSINT\TGConnection\SocketMessenger\EncryptedSocketMessenger->decryptPayload(false)
#1 C:\Program Files\Ampps\www\telegram\vendor\postuf\telegram-api-lib\src\TGConnection\SocketMessenger\EncryptedSocketMessenger.php(133): TelegramOSINT\TGConnection\SocketMessenger\EncryptedSocketMessenger->readMessageFromSocket()
#2 C:\Program Files\Ampps\www\telegram\vendor\postuf\telegram-api-lib\src\Registration\RegistrationFromTgApp.php(287): TelegramOSINT\TGConnection\SocketMessenger\EncryptedSocketMessenger->readMessage()
#3 C:\Program Files\Ampps\www\telegram\vendor\postuf\telegram-api-lib\src\Registration\AccountRegistrar.php(27): TelegramOSINT\Regist in C:\Program Files\Ampps\www\telegram\vendor\postuf\telegram-api-lib\src\TGConnection\SocketMessenger\EncryptedSocketMessenger.php on line 189
Fatal error: Uncaught TelegramOSINT\Exception\TGException: ERR_TL_CONTAINER_BAD_AUTHKEY_ID: in C:\Program Files\Ampps\www\telegram\vendor\postuf\telegram-api-lib\src\TGConnection\SocketMessenger\EncryptedSocketMessenger.php:189
Stack trace:
#0 C:\Program Files\Ampps\www\telegram\vendor\postuf\telegram-api-lib\src\TGConnection\SocketMessenger\EncryptedSocketMessenger.php(155): TelegramOSINT\TGConnection\SocketMessenger\EncryptedSocketMessenger->decryptPayload(false)
#1 C:\Program Files\Ampps\www\telegram\vendor\postuf\telegram-api-lib\src\TGConnection\SocketMessenger\EncryptedSocketMessenger.php(133): TelegramOSINT\TGConnection\SocketMessenger\EncryptedSocketMessenger->readMessageFromSocket()
#2 C:\Program Files\Ampps\www\telegram\vendor\postuf\telegram-api-lib\src\Registration\RegistrationFromTgApp.php(287): TelegramOSINT\TGConnection\SocketMessenger\EncryptedSocketMessenger->readMessage()
#3 C:\Program Files\Ampps\www\telegram\vendor\postuf\telegram-api-lib\src\Registration\AccountRegistrar.php(27): TelegramOSINT\Regist in C:\Program Files\Ampps\www\telegram\vendor\postuf\telegram-api-lib\src\TGConnection\SocketMessenger\EncryptedSocketMessenger.php on line 189
При попытке регистрации через examples/registration.php без остановки бежит лог, при этом sms не приходит. В чем может быть дело? Лог прикрепляю ниже
https://pastebin.com/KiaJA0BF
root@f3a47aeb7681:/app# php examples/registration.php
Phone number: **********
Fatal error: Uncaught Error: Typed property TelegramOSINT\Registration\RegistrationFromTgApp::$socketMessenger must not be accessed before initialization in /app/src/Registration/RegistrationFromTgApp.php:314
Stack trace:
#0 /app/src/Registration/AccountRegistrar.php(45): TelegramOSINT\Registration\RegistrationFromTgApp->pollMessages()
#1 /app/examples/registration.php(33): TelegramOSINT\Registration\AccountRegistrar->pollMessages()
#2 /app/examples/registration.php(50): {closure}(Object(TelegramOSINT\Registration\AccountRegistrar))
#3 {main}
thrown in /app/src/Registration/RegistrationFromTgApp.php on line 314
root@f3a47aeb7681:/app#
Hi! Thank you very much for the library. I tried running the registration script with a phone number that had not been registered in Telegram, but with no success.
This is what I did:
php examples/registration.php
This is the last piece of the output I saw:
I then tried adding this phone number to my Telegram contacts. It wasn't found, which means the registration process wasn't finished.
After that I also tried logging in with the same phone using the official app. I wanted to see if maybe the phone got banned after the signup attempt. However, the app didn't say that the phone was banned.
Please see the full logs attached too.
postuf-osint-registration-logs.txt
Fatal error: Uncaught TelegramOSINT\Exception\TGException: ERR_REG_USER_ALREADY_EXISTS: TelegramOSINT\MTSerialization\OwnImplementation\OwnAnonymousMessage Object
(
[object:TelegramOSINT\MTSerialization\OwnImplementation\OwnAnonymousMessage:private] => Array
(
[] => auth.sentCode
[flags] => 2
[type] => Array
(
[] => auth.sentCodeTypeApp
[length] => 5
)
[phone_code_hash] => 258747dd89b4c93658
[next_type] => Array
(
[_] => auth.codeTypeSms
)
[timeout] =>
)
[type:TelegramOSINT\MTSerialization\OwnImplementation\OwnAnonymousMessage:private] => auth.sentCode
)
in /app/src/Registration/RegistrationFromTgApp.php:120
Stack trace:
#0 /app/src/TGConnection/SocketMessenger/EncryptedSocketCallbacks/CallbackMessageListener.php(22): TelegramOSINT\Registration\RegistrationFromTgApp->TelegramOSINT\Registration{clos in /app/src/Registration/RegistrationFromTgApp.php on line 120
I have already logged in mobile telegram client with this phone number. Does it mean I can't use the number in lib?
I use your docker container with my proxy settings, and I can curl telegram API inside container. But when I'm trying to register using php examples/registration.php
an error appears:
Fatal error: Uncaught TelegramOSINT\Exception\TGException: ERR_CANT_CONNECT: in /app/src/TGConnection/Socket/TcpSocket.php:37 Stack trace: #0 /app/src/Auth/Protocol/BaseAuthorization.php(85): TelegramOSINT\TGConnection\Socket\TcpSocket->__construct(Object(TelegramOSINT\TGConnection\DataCentre)) #1 /app/src/Auth/Protocol/AppAuthorization.php(20): TelegramOSINT\Auth\Protocol\BaseAuthorization->__construct(Object(TelegramOSINT\TGConnection\DataCentre)) #2 /app/src/Registration/RegistrationFromTgApp.php(171): TelegramOSINT\Auth\Protocol\AppAuthorization->__construct(Object(TelegramOSINT\TGConnection\DataCentre)) #3 /app/src/Registration/RegistrationFromTgApp.php(119): TelegramOSINT\Registration\RegistrationFromTgApp->requestBlankAuthKey(Object(Closure)) #4 /app/src/Registration/AccountRegistrar.php(39): TelegramOSINT\Registration\RegistrationFromTgApp->requestCodeForPhone('******', Object(Closure)) #5 /app/examples/registration.php(24): TelegramOSINT\Registration\AccountRegistrar->requestCodeForPhone('********', Obje in /app/src/TGConnection/Socket/TcpSocket.php on line 37 root@ac21a5713014:/app# php examples/registration.php
Getting the following after I enter phone number when running examples/registration
in Docker.
Fatal error: Uncaught TelegramOSINT\Exception\TGException: ERR_MSG_PHONE_MIGRATE: phone n2xzIwQuwaUVXybXwzv4nuLAgbXR7q9Yu/mrkzoxC5hAxRrsM33zl2fsTOgh+MB1/1icuMt0pV9NRTM/mP5CrhvxVpjZjleuOEwro3Nabu7FgYajeKHwm9QJlaoV61OWZCUdyWDdYC0MGu+SfFWyvB5bKOVZHFR/qGiQXKgebS+dHULEyYTh76r3fu2ff0ljaPrL7xAbffN68ENyYF45ZhI6ryvEnXLMTai9TuRTg0tfP9szNayh4ZOb2h+sKvvFS/0VCodDTw3vEPCIYdFSg3Ic6/iKZvsCGhZSGRSpDzu3HGGVlVyZmFzKFJC0hSGGm6aRGItDjivWKnDjBu6+2g== already used in another DataCenter in /app/src/TGConnection/SocketMessenger/EncryptedSocketMessenger.php:356
Stack trace:
#0 /app/src/TGConnection/SocketMessenger/EncryptedSocketMessenger.php(299): TelegramOSINT\TGConnection\SocketMessenger\EncryptedSocketMessenger->analyzeRpcError(Object(TelegramOSINT\TLMessage\TLMessage\ServerMessages\Rpc\RpcError))
#1 /app/src/TGConnection/SocketMessenger/EncryptedSocketMessenger.php(147): TelegramOSINT\TGConnection\SocketMessenger\EncryptedSocketMessenger->processServiceMessage(Object(TelegramOSINT\MTSerialization\OwnImplementation\OwnAnonymousMessage))
#2 /ap in /app/src/TGConnection/SocketMessenger/EncryptedSocketMessenger.php on line 356
v
i tried to login with an account that already exists but the library fails at throwing ERR_REG_USER_ALREADY_EXISTS
can you please make it to allow login ? i guess library only allows to create auth key for fresh account?
Trying to run php examples/registration.php without success
20.05.2021 14:52:09 | Read_Message_Binary: 016d5cf318ac07009977a6600225005e020000008659bb3d0500000012656134353865623664613731653237303739008c15a372
20.05.2021 14:52:09 | Read_Message_TL: Array
(
[_] => rpc_result
[req_msg_id] => 6964385372789255192
[result] => Array
(
[_] => auth.sentCode
[flags] => 2
[type] => Array
(
[_] => auth.sentCodeTypeApp
[length] => 5
)
[phone_code_hash] => ea458eb6da71e27079
[next_type] => Array
(
[_] => auth.codeTypeSms
)
[timeout] =>
)
)
Fatal error: Uncaught TelegramOSINT\Exception\TGException: ERR_REG_USER_ALREADY_EXISTS: TelegramOSINT\MTSerialization\OwnImplementation\OwnAnonymousMessage Object
(
[object:TelegramOSINT\MTSerialization\OwnImplementation\OwnAnonymousMessage:private] => Array
(
[_] => auth.sentCode
[flags] => 2
[type] => Array
(
[_] => auth.sentCodeTypeApp
[length] => 5
)
[phone_code_hash] => ea458eb6da71e27079
[next_type] => Array
(
[_] => auth.codeTypeSms
)
[timeout] =>
)
[type:TelegramOSINT\MTSerialization\OwnImplementation\OwnAnonymousMessage:private] => auth.sentCode
)
in /app/src/Registration/RegistrationFromTgApp.php:122
Stack trace:
#0 /app/src/TGConnection/SocketMessenger/EncryptedSocketCallbacks/CallbackMessageListener.php(22): TelegramOSINT\Registration\RegistrationFromTgApp->TelegramOSINT\Registration\{clos in /app/src/Registration/RegistrationFromTgApp.php on line 122
I see only this while registration
`SMS code: 12592
05.11.2020 12:27:50 | Write_Message_Binary: 8115d5bc0b373931363030353637353912306566656562386235643162343963306632000531323539320000
05.11.2020 12:27:50 | Write_Message_ID: 6891553640960966000
05.11.2020 12:27:50 | Write_Message_TL: Array
(
[_] => auth.signIn
[phone_number] => 79160056759
[phone_code_hash] => 0efeeb8b5d1b49c0f2
[phone_code] => 12592
)
`
for example
if i want to use this library to get response of this mtproto method messages.getStickerSet how to do that?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.