Script to Simulates seeral simultaneous accesses at Port 25

Posted on 2006-05-17
Last Modified: 2012-06-27

I have a Linux server which runs a Script that analyses all the emails received at Port 25. Whenever it sees more than "n" (say 20) simultaneous accesses from a same IP address, it realizes someone is Spaming at the server. So, it blocks that IP.

My question: I need to test it. Is there any Script I could run in another Server, simulating this situation, so that the Script blocks that IP?


Question by:multisites
    LVL 16

    Expert Comment

    Well, you could simply invoke 20 telnet connections to port 25:
    telnet server 25 &

    This should do the trick
    LVL 16

    Accepted Solution


    To do it you would create a bash script as follows:


    for i in `seq 1 30`;
      echo "Connection $i";
      telnet IP 25

    This will create 30 telnet connections.
    LVL 16

    Expert Comment

    Actually the script xDamox posted does not create any simultaneous connections. Each connection is opened and immediately closed so you have only one simultaneous connection.

    That's why I didn't suggest a bash script for this, but only command prompt command - that way you can create simultaneous connections.

    Author Comment

    Wow, thanks Blaz, it is a pitty I have closed the question. I really was not able to realize this point. Anyway, thanks a lot.
    LVL 15

    Expert Comment

    You can always ask community support to re-open a question for you:

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    ​Being a Managed Services Provider (MSP) has presented you  with challenges in the past— and by meeting those challenges you’ve reaped the rewards of success.  In 2014, challenges and rewards remain; but as the Internet and business environment evol…
    BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (, affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now