exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Trickfire Spoofing Script

Trickfire Spoofing Script
Posted Jul 25, 2013
Authored by Vittorio Milazzo

Bash script that permits spoofing of LAN connections and deceive firewalls, proxies, and IDS/NIDS traffic logging.

tags | tool, spoof, bash
systems | linux, unix
SHA-256 | 15c6799ab16cd99792a8c63e30913b42b5ff3d802a554e339bb9f51cb44423a9

Trickfire Spoofing Script

Change Mirror Download
#!/bin/bash

# Version: 0.1 (24/07/2013)
# Author: Vittorio Milazzo - vittorio.milazzo at gmail.com
#
# Notes: Bash script that permit to spoof Lan connections
# and deceive firewall,proxy,IDS/NIDS traffic logging.
#
# Prerequisite packages: macchanger, netfilter


# ============
# Intended use
# ============
# The script purpose is to test how is possible to deceive firewall/proxy/NIDS logging in a local network.


# ==========
# Disclaimer
# ==========
# The author published this script and the information under the condition that them
# will not be used for to bring to himself or others a profit or to bring to others damage.
# The author is not responsible for any damage or losses of any kind caused by the use or
# misuse of the script and from the information contained therein.
# Author is not liable in any case of damage, including direct, indirect, incidental,
# consequential loss of business profits or special damages.


# =======
# Details
# =======
# Three-way handshake completition:
# This script assign ip alias ($spoof_ip) to network interface card, and change mac-address
# using macchanger. After wich, iptables SNAT will send outgoing packets with ip alias address
# and mac-address that we have changed. Hosts that will receive SYN spoofed packets,
# will response with ACK flags to our ip alias (so packets will reach us), and SYN/ACK packets will be send
# from our ip alias to target hosts.
#
# BE CAREFULL:
# When spoofed ip/mac address is an alive host in our Lan, it may happen that both (we and spoofed host)
# will lose some packets and some established connections will drop.




clear
BANNER="trickfire v.0.1: Spoofing Lan connection - Firewall and IDS/NIDS deception logging"




#########################
# 1.) NETWORK VARIABLES #
#########################

# Set Lan default gateway ip address
router="192.168.0.200"



# Set network interface card used for spoofing
interface="eth0"



# Our real ip address
real_ip=`ifconfig $interface | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}';`



# Our authentic mac address
real_mac="c8:0a:a9:c0:49:a4"







##########################
# 2.) SPOOFING VARIABLES #
##########################
#
# VARIANTS:
#
# A.) SPOOF LAN CONNECTION AND DECEIVE INTERNET TRAFFIC LOGGING
#
# For deceive firewall/proxy or IDS/NIDS logging, you need to send spoofed packets to their.
#
# But if you are not sure about firewall or Nids ip address, or you don't know if in Lan there are some other NIDS
# or sniffer with ip address on a different class, will be better to send spoofed packets to all (0/0).
# This setting will permit to spoof connection vs all Lan hosts too.
#
#
# B.) DECEIVE ONLY INTERNET TRAFFIC LOGGING
#
# Otherwise, if in your network is not present a proxy server or IDS/NIDS, or you are not interested
# to test spoofing Lan connections, you can deceive Firewall Internet traffic logging specifying your
# Lan class ID with net prefix. (Ex: lan_id="192.168.0.0/24").
# With this option, iptables SNAT doesn't will send spoofed packets on entire Lan network ( ! -d $lan_id ),
# and spoofed packets will arrive (and will log) only from default gateway (firewall or router).
#
# If you will use this setting, remember to comment/uncomment too appropriate iptables command below (in functions section).
lan_id="0/0"



# Ip address that you want to spoof
spoof_ip="192.168.0.216"



# Mac address that you want to spoof
spoof_mac="ec:9a:74:64:f6:33"








#################
# 3.) FUNCTIONS #
#################


enable_spoof ()
{
ifconfig $interface down

macchanger -m $spoof_mac $interface >/dev/null

ifconfig $interface:1 $spoof_ip

ifconfig $interface up

# A.) SPOOF LAN CONNECTION AND DECEIVE INTERNET TRAFFIC LOGGING
# Use this if you have set variable lan_id="0/0"
#
iptables -t nat -I POSTROUTING -d $lan_id -j SNAT --to $spoof_ip


# B.) DECEIVE ONLY INTERNET TRAFFIC LOGGING
# Use this if you have set variable lan_id="x.x.x.x/net_prefix"
# (and comment iptables command above).
#
#iptables -t nat -I POSTROUTING ! -d $lan_id -j SNAT --to $spoof_ip

# Block incoming connection (to avoid to be detected by possible listening services)
iptables -I INPUT -i $interface -d $spoof_ip -p tcp --syn -m state --state NEW -j DROP
iptables -I INPUT -i $interface -d $spoof_ip -p udp -m state --state NEW -j DROP

route add default gw $router
}






disable_spoof ()
{
ifconfig $interface down >/dev/null

macchanger -m $real_mac $interface >/dev/null

ifconfig $interface:1 down 2>/dev/null

iptables -t nat -F

ifconfig $interface up

echo -e "\033[0;32mDefault gateway: $router\033[m"
route add default gw $router
}



case "$1" in




start)

echo; echo -e "\033[31m$BANNER\033[m"; echo
echo; echo -e "\033[31m- Spoofing started"; echo
echo -e "\033[0;32mInterface: $interface\033[m"
echo -e "\033[0;32mSpoofed ip: $spoof_ip\033[m"
echo -e "\033[0;32mSpoofed mac address: $spoof_mac\033[m"
echo
enable_spoof
echo
exit 0
;;




stop)
echo; echo -e "\033[31m$BANNER\033[m"; echo
echo; echo -e "\033[31m- Spoofing stopped\033[m";echo
echo -e "\033[31mBack to normal configuration:\033[m"; echo
echo -e "\033[0;32mInterface: $interface\033[m"
echo -e "\033[0;32mIp address: $real_ip\033[m"
echo -e "\033[0;32mMac adress: $real_mac\033[m"
disable_spoof
echo
exit 0
;;



*)
echo
echo -e " \033[31m#####################################################################\033[m"
echo -e " \033[31m# trickfire v.0.1 #\033[m"
echo -e " \033[31m# #\033[m"
echo -e " \033[31m# Spoofing Lan connection - Firewall and IDS/NIDS deception logging #\033[m"
echo -e " \033[31m# #\033[m"
echo -e " \033[31m# Vittorio Milazzo - vittorio.milazzo at gmail.com #\033[m"
echo -e " \033[31m#####################################################################\033[m"
echo;echo -e "\033[36m1.) Change variables inside the script\033[m"
echo;echo -e "\033[36m2.) Usage: ./trickfire.sh {start|stop}\033[m"
echo
exit 1
;;

esac

exit 0
Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    14 Files
  • 12
    Nov 12th
    20 Files
  • 13
    Nov 13th
    63 Files
  • 14
    Nov 14th
    18 Files
  • 15
    Nov 15th
    8 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    18 Files
  • 19
    Nov 19th
    7 Files
  • 20
    Nov 20th
    13 Files
  • 21
    Nov 21st
    6 Files
  • 22
    Nov 22nd
    48 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    0 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close