[Python] How do i configure cowrie to accept read_iacs telnet connections instead of...

Discussão em 'Python' iniciado por Stack, Março 16, 2025.

  1. Stack

    Stack Membro Participativo

    I'm working on a college project(ethical in virtual environment) involving the mirai botnet. Very simply, mirai tries to connect to bots but also hits cowrie (honeypot) in the process. The mirai code uses a telnet connection that involves specifying a state . Read_iacs(works for connecting with bots) and user_prompt works with connecting with cowrie. I need to be able to connect to both at the same time. I don't think adjusting mirai code makes sense as a result, Instead i want to adjust the cowrie code to accept read_iacs state instead of user_prompt but not sure how to do this. Any ideas? would appreciate any help.

    I tried looking at the cowrie code but the only reference to the telnet state I can see is changing between a string indicating the current parse state. It can take on the values "data", "escaped", "command", "newline", "subnegotiation", and "subnegotiation-escaped". However, these dont obviously match the telnet connection types in the mirai code(user_prompt and read_iacs). Im using twisted.conch for the cowrie implementation btw. Here is the implementation : https://github.com/cowrie/cowrie/tree/main/src/cowrie/telnet

    Here are some of the links that I have been working with also:

    https://github.com/twonds/twisted/blob/master/twisted/conch/telnet.py.

    https://github.com/cowrie/cowrie/blob/main/src/cowrie/telnet/transport.py.

    https://pub.fh-campuswien.ac.at/obvfcwhsacc/download/pdf/10439878

    https://docs.twisted.org/en/stable/api/twisted.conch.telnet.html

    https://docs.twisted.org/en/stable/api/twisted.conch.telnet.Telnet.html#state

    Continue reading...

Compartilhe esta Página