Git Product home page Git Product logo

playing-with-scapy-and-stem's Introduction

playing with scapy and stem

https://stem.torproject.org/api.html no explanation to give malicious users no dangerous script in their hands, want help me please?

the idea,

it is only an idea for the head of a MasterCode in TerminalApp

from scapy.all import *
import csv
import time
import re
import stem.control
import stem
from stem.control import Controller
from stem import StreamListener
# set controller
with Controller.from_port(port=9051) as controller:
    controller.authenticate()
# set Stream Listener
class MaliciousTrafficListener(StreamListener):
    def __init__(self, keywords):
        self.keywords = keywords

    def stream_new(self, stream):
        if any(re.search(keyword, stream.target_host) for keyword in self.keywords):
            print(f"Malicious traffic detected to {stream.target_host}")
   #  extract destination IP from user of the evil 
    #def check_destination(pkt):
   # if IP in pkt:
      #  ip_src = pkt[IP].src
      #  ip_dst = pkt[IP].dst
      #  print(f'Potential intruder detected: {ip_src} -> {ip_dst}')
    # contoller:  keywords e.g abuse, crime...
    with Controller.from_port(port=9051) as controller:
    controller.authenticate()
    controller.add_event_listener(MaliciousTrafficListener(["abuse", "crime"]))
    input("Press Enter to exit")

    # authenticat
    with stem.control.Controller.from_port() as controller:
    controller.authenticate()

    # Get the current circuit and its hops
    circuit_id = controller.get_circuit_id()
    hops = controller.get_circuit(circuit_id).path

    # Add malicious relays to circuit blacklist
    for hop in hops:
        if hop.fingerprint in malicious_relays:
            controller.set_conf(f"ExcludeExitNodes {hop.fingerprint}")

### Idea by, still yet
- [VolkanSah on Github](https://github.com/volkansah)
- [Developer Site](https://volkansah.github.io)
- [Become a 'Sponsor'](https://github.com/sponsors/volkansah)

playing-with-scapy-and-stem's People

Contributors

volkansah avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.