How Darknet Vendors Use Telegram Bots

Updated on:
942
Person chat with chat bots on his smartphone.
Despite additional risks, more and more people use Telegram bots for buying illicit substances.

The trade of drugs via Telegram has greatly evolved recently. Hundreds of bots are created by vendors as an addition to their shops on darknet markets.

Telegram’s function contributes to easing dealers’ work, allowing to fully automate the process of trade.

In this article, we are answering the main questions concerning both vendors and customers, including “How to create a Telegram bot?” and “Is shopping on the messenger safe?”

Creating a Telegram Bot

Currently, you can choose among three options to create a bot:

  1. Use a constructor. It can be a messenger’s service (for example, Manybot) or a bot platform such as Chatfuel.
  2. Develop it yourself, if you have basic programming skills and time.
  3. Simply buy it. There are plenty of companies and developers offering Telegram bots, the prices vary greatly, from $10 up to $250.

In case you decide you want to develop a bot yourself, follow these simple steps:

Registration

Before creating a bot, you need to register a new Telegram account and get its ID. After the messenger is launched, do the following:

Your TOR usage is being watched
  1. Find and add to your contacts @BotFather.
Botfather nickname.
Most Telegram bots keep logs, storing information on users’ IDs and purchases.
Newbot chat.
Shopping on Telegram is more risky for buyers, compared to darknet markets.

2. Type /newbot command.3. Pick a new bot’s name, ending with “bot.”

Chat  with HTML link.
Telegram’s function contributes to easing dealers’ work, allowing to fully automate the process of trade.

4. Save a unique token.5. Type /setuserpic command for setting a profile picture. Further setting up can be done using @ManyBot.

Programming

For this example, we are going to use Python3, however its algorithms are easily transferred to any other programming language.

For Python, we recommend to use a web framework tornado.web. The bot’s framework should look like this:      

 

 

URL = "https://api.telegram.org/bot%s/" % BOT_TOKEN
MyURL = "https://example.com/hook"

api = requests.Session()
application = tornado.web.Application([
    (r"/", Handler),
])

if __name__ == '__main__':
    signal.signal(signal.SIGTERM, signal_term_handler)
    try:
        set_hook = api.get(URL + "setWebhook?url=%s" % MyURL)
        if set_hook.status_code != 200:
            logging.error("Can't set hook: %s. Quit." % set_hook.text)
            exit(1)
        application.listen(8888)
        tornado.ioloop.IOLoop.current().start()
    except KeyboardInterrupt:
        signal_term_handler(signal.SIGTERM, None)

For processing requests, Tornado application uses tornado.web.RequestHandler, which contains the bot’s logic.

class Handler(tornado.web.RequestHandler):
        def post(self):
            try:
                logging.debug("Got request: %s" % self.request.body)
                update = tornado.escape.json_decode(self.request.body)
                message = update['message']
                text = message.get('text')
                if text:
                    logging.info("MESSAGE\t%s\t%s" % (message['chat']['id'], text))

                    if text[0] == '/':
                        command, *arguments = text.split(" ", 1)
                        response = CMD.get(command, not_found)(arguments, message)
                        logging.info("REPLY\t%s\t%s" % (message['chat']['id'], response))
                        send_reply(response)
            except Exception as e:
                logging.warning(str(e))

“CMD” is a list of available commands; “send_reply” is a function for sending a response with a simple code:

 

def send_reply(response):
    if 'text' in response:
        api.post(URL + "sendMessage", data=response)

Commands

After the bot’s logic is formed, you can equip it with commands. First of all, add two commands /start and /help:

 

def help_message(arguments, message):
    response = {'chat_id': message['chat']['id']}
    result = ["Hey, %s!" % message["from"].get("first_name"),
              "\rI can accept only these commands:"]
    for command in CMD:
        result.append(command)
    response['text'] = "\n\t".join(result)
    return response

The structure “message[‘from’]” is an object providing data on the user’s ID and name.

The command /start is intended for displaying information about the bot, or identification if used with certain parameters.

After it, you can add your own command, for example /base64:

 

def base64_decode(arguments, message):
    response = {'chat_id': message['chat']['id']}
    try:
        response['text'] = b64decode(" ".join(arguments).encode("utf8"))
    except:
        response['text'] = "Can't decode it"
    finally:
        return response

Automated shops, able to get payment and provide addresses of dead drops, are required to have the following functions:

  • Show price list.
  • Provide payment information.
  • Accept payment.
  • Provide the address of a dead drop.

A set of functions is fully customizable and depends completely on developers. Each function can be implemented differently. For example, a bot can get payment automatically or send a buyer a list of payment options.

You can also program a bot using blocks. In this case, the algorithm is much easier—you have just to add required data (stock, payment information, etc.) in already-written program code.

Are Telegram Bots Safe?

Most Telegram bots keep logs, storing information on users’ IDs and purchases. Vendors claim that this data is solely used for sending newsletters to their customers and does not compromise their anonymity. However, in case law enforcement agencies get control over your device and Telegram account, they get access to unencrypted data concerning your activity. Obviously, it can be used as circumstantial evidence against you.

Shopping on Telegram is more risky for buyers, compared to darknet markets. Sales on the messenger are not protected with the escrow option, and that is why customers face a possibility of being scammed, losing their money. Disputes are solved by dealers.

Furthermore, a customer cannot view feedback and the number of successfully completed orders, thereby it is impossible to have an objective measure regarding a vendor’s liability. Admins of reputable markets, such as Dream Market for example, monitor the buying process attentively and protect customers from scammers.

Despite additional risks, more and more people use Telegram bots for buying illicit substances. This tendency is primarily explained due to simplicity and lower prices compared to darknet markets. Higher risks can be lessened to a considerable degree if you buy from a vendor with a strong reputation on a well-established marketplace, as many of them use bots for trade.

For example, Ant1biotik Shop, one of Hydra’s most reputable shops, has a Telegram bot working 24/7. Their activity both on the market and messenger is based on the same policy, meaning that every dispute is handled in accordance with the shop’s rules.

Teonanacatl

Teonanacatl

I know that many Western people still believe that Russian flag is red, bears walk across the streets, people drink vodka and sell Matryoshkas. In order to change this opinion, to make Russia "closer" to the rest of the world I focus on writing articles about Russian segment of darkweb and news connected with it. I understand that the country lags behind in terms of technology and conscientiousness, but nevertheless, we have got something native, which, as I hope, can be interesting for you, guys!
Teonanacatl
Write for us

Disclaimer:

The articles and content found on Dark Web News are for general information purposes only and are not intended to solicit illegal activity or constitute legal advice. Using drugs is harmful to your health and can cause serious problems including death and imprisonment, and any treatment should not be undertaken without medical supervision.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.