Monday, June 4, 2012

Finals Calculator in Autoit


#include <GUIConstantsEx.au3>

Opt("GUIOnEventMode", 1)


$mainwindow = GUICreate("Finals Calculator", 900, 175) ; Create window called prank dialer with the dementions 600 x 350


GUICtrlCreateLabel("% of grade that final is worth (eg. the final is worth 10% of your grade, then enter 10 here)", 450 ,10)

GUICtrlCreateLabel("*NOTE: Hit clear after every calculation for exact results", 450 ,130)

GUICtrlCreateLabel("Please enter 2 out of the 3 values (Current Course Grade, Final Exam Grade, or Final Course Grade) and then press Calculate!", 5 ,100)

$fWorth = GUICtrlCreateInput("",500,30,50)

$cCourseGrade = GUICtrlCreateInput("",200,10,200)

GUICtrlCreateLabel("Current Course Grade (eg. 95)", 5, 10,200)

$fExamGrade = GUICtrlCreateInput("",200,30,200)

GUICtrlCreateLabel("Final Exam Grade (eg. 90)", 5, 30)

$fCourseGrade = GUICtrlCreateInput("",200,50,200)

GUICtrlCreateLabel("Final Course Grade (eg. 91)", 5, 50)

$calculate = GUICtrlCreateButton("Calculate!", 300, 120)

$clear = GUICtrlCreateButton("Clear", 200, 120)



;ON EVENT FUNCS
GUICtrlSetOnEvent($clear,"clear")
GUICtrlSetOnEvent($calculate,"calculate")
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked");DEFINE FUNCTION NAME
;END ON EVENT FUNCS

GUISetState(@SW_SHOW)

While 1
  Sleep(1000)  ; Idle around
WEnd

Func calculate()
$cCourseGradeNum = GUICtrlRead($cCourseGrade)
$fExamGradeNum = GUICtrlRead($fExamGrade)
$fCourseGradeNum = GUICtrlRead($fCourseGrade)
$fWorth = GUICtrlRead($fWorth)
if $fWorth = "" Then
MsgBox(0,"","Error, no value for the percentage of your grade that your final is worth")
Exit
EndIf
$fWorth = $fWorth/100
$cWorth = 1 - $fWorth

if $fCourseGradeNum == "" Then
$fCourseGradeNum = ($cWorth * $cCourseGradeNum) + ($fWorth * $fExamGradeNum)
GUICtrlDelete($fCourseGrade)
$fCourseGrade = GUICtrlCreateInput($fCourseGradeNum,200,50,200)
ElseIf $fExamGradeNum == "" Then
$fExamGradeNum = ($fCourseGradeNum - ($cWorth * $cCourseGradeNum))/($fWorth)
GUICtrlDelete($fExamGrade)
$fExamGrade = GUICtrlCreateInput($fExamGradeNum,200,30,200)
ElseIf $cCourseGradeNum == "" Then
$cCourseGradeNum = ($fCourseGradeNum - ($fWorth * $fExamGradeNum))/($cWorth)
GUICtrlDelete($cCourseGrade)
$cCourseGrade = GUICtrlCreateInput($cCourseGradeNum,200,10,200)
EndIf

EndFunc
Func CLOSEClicked()
  ;Note: at this point @GUI_CTRLID would equal $GUI_EVENT_CLOSE,
  ;and @GUI_WINHANDLE would equal $mainwindow
  Exit
EndFunc
Func clear()
GUICtrlCreateLabel("Please enter 2 out of the 3 values (Current Course Grade, Fianl Exam Grade, or Final Course Grade) and then press Calculate!", 5 ,100)

GUICtrlDelete($cCourseGrade)
GUICtrlDelete($fExamGrade)
GUICtrlDelete($fCourseGrade)
GUICtrlDelete($fWorth)

$fWorth = GUICtrlCreateInput("",500,30,50)

$cCourseGrade = GUICtrlCreateInput("",200,10,200)

GUICtrlCreateLabel("Current Course Grade (eg. 95)", 5, 10,200)

$fExamGrade = GUICtrlCreateInput("",200,30,200)

GUICtrlCreateLabel("Final Exam Grade (eg. 90)", 5, 30)

$fCourseGrade = GUICtrlCreateInput("",200,50,200)

GUICtrlCreateLabel("Final Course Grade (eg. 91)", 5, 50)
Run("Finals Calculator.exe")
exit
EndFunc

;END DEFINE FUNCTION CODE

Monday, May 21, 2012

Google Survey Bot Autoit

Google Survey Bot in Autoit


Global $coords[2]
Global $coord[2]


$stop = 100
$timesrepeated = 0


Func GetSleep()
$select = Random(1,4,1)
if $select = 1 Then
$coords[0] = 362
$coords[1] = 217
ElseIf $select = 2 then
$coords[0] = 362
$coords[1] = 241
ElseIf $select = 3 then
$coords[0] = 362
$coords[1] = 265
ElseIf $select = 4 then
$coords[0] = 362
$coords[1] = 289
EndIf
EndFunc


Func GetGender()
$select = Random(1,2,1)
if $select = 1 Then
$coord[0] = 362
$coord[1] = 367
ElseIf $select = 2 then
$coord[0] = 362
$coord[1] = 392
EndIf
EndFunc


Func Submit()
MouseClick("left",384,452)
EndFunc


Func Again()
MouseClick("left",467,236)
EndFunc


Func Quit()
Exit
EndFunc


HotKeySet("{ESC}", "Quit")


While $stop > 0
GetSleep()
MouseClick("left", $coords[0],$coords[1])

GetGender()
MouseClick("left",$coord[0],$coord[1])

Submit()


WinWaitActive("Thanks! - Google Chrome")


Sleep(500)

$timesrepeated = $timesrepeated + 1
$stop = $stop - 1


ToolTip($timesrepeated,0,0)

Again()

Sleep(1000)
WEnd

Wednesday, October 12, 2011

Reset Max OS password


1. Boot into single user mode (press Command-S at power on)
2. Type fsck -fy
3. Type mount -uw /
4. Type launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist
5. Type dscl . -passwd /Users/username password, replacing username with the targeted user and password with the desired password.
6.Reboot

This allows you to reset the password in single user mode without booting from the install media.
from 
http://hints.macworld.com/article.php?story=20080414140636495

Friday, October 7, 2011

Making a Free Remote Ftp Site to Drop Files

domain: matthewdowney20.comyr.com
username: a1166258
password: normal pass
eg:
root@root:~# ftp matthewdowney.comyr.com
Connected to matthewdowney.comyr.com.
220---------- Welcome to Pure-FTPd [privsep] ----------
220-You are user number 17 of 500 allowed.
220-Local time is now 00:17. Server port: 21.
220-This is a private system - No anonymous login
220 You will be disconnected after 3 minutes of inactivity.
Name (matthewdowney.comyr.com:root): a1166258
331 User a1166258 OK. Password required
Password:
230-OK. Current restricted directory is /
230-2 files used (0%) - authorized: 10000 files
230 28 Kbytes used (0%) - authorized: 1536000 Kb
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>  binary mode to transfer files.
200 TYPE is now 8-bit binary
ftp> ftp>
?Invalid command
ftp>



Ok, so we all know that it can be useful to have a place to store files online- especially when they can be easily accessed through a command line or program. This post will cover how to set this up for free, how to access it from command line or programs, and how to to perform basic operations, such as uploading and downloading programs-- anonymously.

NOTE: If you want to do this anonymously you must have tsocks up and running. Check out how here.

Anonymous Install Instructions:

Ok, these are instructions on how to set up this anonymously, meaning that this is what you would use for sensitive information uploads.

First you must keep in mind that every time you access your ftp server in any way your information will be logged, meaning you must always access it through tor.

Step 1: Make sure you have tor setup for firefox, and tsocks setup. tsocks tutorial is here, and google the tor thing if you dont have it.

Step 2: Create your account. USING TOR/TSOCKS go to http://www.000webhost.com/order.php
to create your account use a fake name and email, but make sure you remember it, as you will use it to login.

Step 3: once you have created your account, go to the members area and sign in(http://members.000webhost.com/login.php)

Step 4: Click 'go to c-panel'

Step 5: On the far right you will see a chart with your account info, where it says username, that will be your ftp username, it will be kind of abstract(mine is a1166258) and the password is your normal password.

Step 6: access- you can access your ftp server with the following command(note i will be using the subdomain i registered for, just replace mine with yours)
root@root:~# tsocks ftp matthewdowney20.comyr.com
then it will ask you for your username and password

basic commands:
get filename //downloads a file from server
put filename //puts a file from your home folder to server
ls //display files
mkdir //make a directory
bye //exit

for a non anonymous server:
do everything the same, except no tor or tsocks necessary, nor is a fake email.

Setting Up Linux

first of all, you may want to add these to your .bashrc file in your home folder:

    #user aliases
    alias mitmsetup='echo "1" > /proc/sys/net/ipv4/ip_forward; iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8080; echo "Setup Complete."; echo "ip_forward:"; more /proc/sys/net/ipv4/ip_forward'

    alias mitmcleanup='echo "0" > /proc/sys/net/ipv4/ip_forward; iptables --flush; iptables --table nat --flush; iptables --delete-chain; iptables --table nat --delete-chain; echo "Cleanup complete"; echo "ip_forward:"; more /proc/sys/net/ipv4/ip_forward'

a good SAM file cracking tutorial:

    http://themostboringblogintheworld.wordpress.com/2006/09/21/how-to-crack-windows-passwords-from-sam-and-system-files-with-backtrack-installed/

code to make uncooperatvie pentest programs run from anywhere:


    ln /pentest/passwords/chntpw/chntpw /usr/bin/

 This is a sample .bashrc file:

    # ~/.bashrc: executed by bash(1) for non-login shells.
    # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
    # for examples

    # If not running interactively, don't do anything
    [ -z "$PS1" ] && return

    # don't put duplicate lines in the history. See bash(1) for more options
    # ... or force ignoredups and ignorespace
    HISTCONTROL=ignoredups:ignorespace

    # append to the history file, don't overwrite it
    shopt -s histappend

    # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
    HISTSIZE=1000
    HISTFILESIZE=2000

    # check the window size after each command and, if necessary,
    # update the values of LINES and COLUMNS.
    shopt -s checkwinsize

    # make less more friendly for non-text input files, see lesspipe(1)
    [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

    # set variable identifying the chroot you work in (used in the prompt below)
    if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
        debian_chroot=$(cat /etc/debian_chroot)
    fi

    # set a fancy prompt (non-color, unless we know we "want" color)
    case "$TERM" in
        xterm-color) color_prompt=yes;;
    esac

    # uncomment for a colored prompt, if the terminal has the capability; turned
    # off by default to not distract the user: the focus in a terminal window
    # should be on the output of commands, not on the prompt
    #force_color_prompt=yes

    if [ -n "$force_color_prompt" ]; then
        if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
        # We have color support; assume it's compliant with Ecma-48
        # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
        # a case would tend to support setf rather than setaf.)
        color_prompt=yes
        else
        color_prompt=
        fi
    fi

    if [ "$color_prompt" = yes ]; then
        PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
    else
        PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
    fi
    unset color_prompt force_color_prompt

    # If this is an xterm set the title to user@host:dir
    case "$TERM" in
    xterm*|rxvt*)
        PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
        ;;
    *)
        ;;
    esac

    # enable color support of ls and also add handy aliases
    if [ -x /usr/bin/dircolors ]; then
        test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
        alias ls='ls --color=auto'
        #alias dir='dir --color=auto'
        #alias vdir='vdir --color=auto'

        alias grep='grep --color=auto'
        alias fgrep='fgrep --color=auto'
        alias egrep='egrep --color=auto'
    fi

    # some more ls aliases
    alias ll='ls -alF'
    alias la='ls -A'
    alias l='ls -CF'

    # Add an "alert" alias for long running commands.  Use like so:
    #   sleep 10; alert
    alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

    # Alias definitions.
    # You may want to put all your additions into a separate file like
    # ~/.bash_aliases, instead of adding them here directly.
    # See /usr/share/doc/bash-doc/examples in the bash-doc package.

    if [ -f ~/.bash_aliases ]; then
        . ~/.bash_aliases
    fi

    # enable programmable completion features (you don't need to enable
    # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
    # sources /etc/bash.bashrc).
    if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
        . /etc/bash_completion
    fi
    alias roku='cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd home/matthew/Desktop/Remote; python Remote.py'
    alias findroku='nmap -sV 192.168.0.1/24 | grep -B4 -A5 Roku'
    alias scanme='sudo nmap -sC -sV -O 192.168.0.1/24 | grep -B10 "0 hops"'
    alias scanall='sudo nmap -sC -sV -O -PN 192.168.0.1/24; echo "nmap scan of 192.168.0.1/24 with parameters service detection(-sC) version detection (-sV) and OS detection (-O): sudo nmap -sC -sV -O -PN 192.168.0.1/24"'
    alias cdfull='cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..;cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..;cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..;cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..;cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..'
    alias findlocalip='ifconfig | grep "inet addr:"'
    alias findip="wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'"
    d ..; cd ..; cd ..;cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..'
    alias findlocalip='ifconfig | grep "inet addr:"'
    alias findip="wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'"

    d ..; cd ..; cd ..;cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..'
    alias findlocalip='ifconfig | grep "inet addr:"'
    alias findip="wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'"

useful sites to setup your linux:

    http://www.donkboy.com/html/vol6.htm
    http://nmap.org/nmap-fingerprinting-article.txt
    http://blog.sudobits.com/2010/05/23/hacking-website-with-ubuntu-1004/
    http://www.amazon.com/Gray-Hat-Python-Programming-Engineers/dp/1593271921
    http://www.amazon.com/Ghost-Wires-Adventures-Worlds-Wanted/dp/0316037702
    http://hidemyass.com/proxy-list/
    http://www.phenoelit-us.org/dpl/dpl.html
    http://www.routerpasswords.com/
    http://corvillus.com/2006/09/18/how-to-set-up-tor-and-privoxy-on-ubuntu-linux/
    http://www.go2linux.org/what-is-my-public-ip-address-with-linux
    http://udayallala.blogspot.com/2011/03/cracking-passwords-3.html
    http://www.backtrack-linux.org/tutorials/

a setup file:

import os
bashmods = """

#user aliases
alias mitmsetup='echo "1" > /proc/sys/net/ipv4/ip_forward; iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8080; echo "Setup Complete."; echo "ip_forward:"; more /proc/sys/net/ipv4/ip_forward'

alias mitmcleanup='echo "0" > /proc/sys/net/ipv4/ip_forward; iptables --flush; iptables --table nat --flush; iptables --delete-chain; iptables --table nat --delete-chain; echo "Cleanup complete"; echo "ip_forward:"; more /proc/sys/net/ipv4/ip_forward'

alias roku='cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; python /remote/rokuremote.py'

alias findroku='nmap -sV 192.168.0.1/24 | grep -B4 -A5 Roku'

alias scanme='sudo nmap -sC -sV -O 192.168.0.1/24 | grep -B10 "0 hops"'

alias scanall='sudo nmap -sC -sV -O -PN 192.168.0.1/24; echo "nmap scan of 192.1
68.0.1/24 with parameters service detection(-sC) version detection (-sV) and OS detection (-O): sudo nmap -sC -sV -O -PN 192.168.0.1/24"'

alias cdfull='cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..;cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..;cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..;cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..;cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..'

alias findlocalip='ifconfig | grep "inet addr:"'

alias findip="wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //
' -e 's/<.*$//'"
"""

rokuremote = '''

# Remote for the Roku Player
# By Matthew Downey

import telnetlib
import time
import sys

for arg in sys.argv:
    HOST = arg
print HOST

"""
General Layout of Virtual Keyboard:
_____________
|a|b|c|d|e|f|
|g|h|i|j|k|l|
|m|n|o|p|q|r|
|s|t|u|v|w|x|
|y|z|1|2|3|4|
|5|6|7|8|9|0|
|___________|
"""
#Location of the Letter A
a_0 = 1
a_1 = 1

#Location of the Letter B
b_0 = 2
b_1 = 1

#Location of the Letter C
c_0 = 3
c_1 = 1

#Location of the Letter D
d_0 = 4
d_1 = 1

#Location of the Letter E
e_0 = 5
e_1 = 1

#Location of the Letter F
f_0 = 6
f_1 = 1

#Location of the Letter G
g_0 = 1
g_1 = 2

#Location of the Letter H
h_0 = 2
h_1 = 2

#Location of the Letter I
i_0 = 3
i_1 = 2

#Location of the Letter J
j_0 = 4
j_1 = 2

#Location of the Letter K
k_0 = 5
k_1 = 2

#Location of the Letter L
l_0 = 6
l_1 = 2

#Location of the Letter M
m_0 = 1
m_1 = 3

#Location of the Letter N
n_0 = 2
n_1 = 3

#Location of the Letter O
o_0 = 3
o_1 = 3

#Location of the Letter P
p_0 = 4
p_1 = 3

#Location of the Letter Q
q_0 = 5
q_1 = 3

#Location of the Letter R
r_0 = 6
r_1 = 3

#Location of the Letter S
s_0 = 1
s_1 = 4

#Location of the Letter T
t_0 = 2
t_1 = 4

#Location of the Letter U
u_0 = 3
u_1 = 4

#Location of the Letter V
v_0 = 4
v_1 = 4

#Location of the Letter W
w_0 = 5
w_1 = 4

#Location of the Letter X
x_0 = 6
x_1 = 4

#Location of the Letter Y
y_0 = 1
y_1 = 5

#Location of the Letter Z
z_0 = 2
z_1 = 5

#Location of the Number 1
n1_0 = 3
n1_1 = 5

#Location of the Number 2
n2_0 = 4
n2_1 = 5

#Location of the Number 3
n3_0 = 5
n3_1 = 5

#Location of the Number 4
n4_0 = 6
n4_1 = 5

#Location of the Number 5
n5_0 = 1
n5_1 = 6

#Location of the Number 6
n6_0 = 2
n6_1 = 6

#Location of the Number 7
n7_0 = 3
n7_1 = 6

#Location of the Number 8
n8_0 = 4
n8_1 = 6

#Location of the Number 9
n9_0 = 5
n9_1 = 6

#Location of the Number 0
n0_0 = 6
n0_1 = 6


def Home():
    #HOST = raw_input("Please enter the target IP address: ")
    #HOST = 'HOST'  
    PORT = '8080'
    connect = telnetlib.Telnet(HOST,PORT)
    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press home" + "\n")  
def Up():
    #HOST = raw_input("Please enter the target IP address: ")
    #HOST = 'HOST'  
    PORT = '8080'
    connect = telnetlib.Telnet(HOST,PORT)
    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press up" + "\n")
  
def Down():
    #HOST = raw_input("Please enter the target IP address: ")
    #HOST = 'HOST'  
    PORT = '8080'
    connect = telnetlib.Telnet(HOST,PORT)
    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press down" + "\n")
  
def Left():
    #HOST = raw_input("Please enter the target IP address: ")
    #HOST = 'HOST'  
    PORT = '8080'
    connect = telnetlib.Telnet(HOST,PORT)
    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press left" + "\n")

def Right():
    #HOST = raw_input("Please enter the target IP address: ")
    #HOST = 'HOST'  
    PORT = '8080'
    connect = telnetlib.Telnet(HOST,PORT)
    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press right" + "\n")

def Select():
    #HOST = raw_input("Please enter the target IP address: ")
    #HOST = 'HOST'  
    PORT = '8080'
    connect = telnetlib.Telnet(HOST,PORT)
    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press select" + "\n")
  
def Play():
    #HOST = raw_input("Please enter the target IP address: ")
    #HOST = 'HOST'  
    PORT = '8080'
    connect = telnetlib.Telnet(HOST,PORT)
    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press play" + "\n")
def Rewind():
    #HOST = raw_input("Please enter the target IP address: ")
    #HOST = 'HOST'  
    PORT = '8080'
    connect = telnetlib.Telnet(HOST,PORT)
    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")
    connect.write("press rewind" + "\n")
  
def FastForward():
    #HOST = raw_input("Please enter the target IP address: ")
    #HOST = 'HOST'  
    PORT = '8080'
    connect = telnetlib.Telnet(HOST,PORT)
    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")
    connect.write("press fastforward" + "\n")
def c1(row):
    row_down = row
    row_up = row
    while row_down > 1:
        Down()
        row_down = row_down - 1
        time.sleep(.250)
    Select()
    time.sleep(.250)
    while row_up > 1:
        Up()
        row_up = row_up - 1
        time.sleep(.250)
def c2(row):
    row_down = row
    row_up = row
    while row_down > 1:
        Down()
        row_down = row_down - 1
        time.sleep(.250)
    Right()
    time.sleep(.250)
    Select()
    time.sleep(.250)
    while row_up > 1:
        Up()
        row_up = row_up - 1
        time.sleep(.250)
    Left()
    time.sleep(.250)
def c3(row):
    row_down = row
    row_up = row
    while row_down > 1:
        Down()
        row_down = row_down - 1
        time.sleep(.250)
    Right()
    time.sleep(.250)
    Right()
    time.sleep(.250)
    Select()
    time.sleep(.250)
    while row_up > 1:
        Up()
        row_up = row_up - 1
        time.sleep(.250)
    Left()
    time.sleep(.250)
    Left()
    time.sleep(.250)
def c4(row):
    row_down = row
    row_up = row
    while row_down > 1:
        Down()
        row_down = row_down - 1
        time.sleep(.250)
    Right()
    time.sleep(.250)
    Right()
    time.sleep(.250)
    Right()
    time.sleep(.250)
    Select()
    time.sleep(.250)
    while row_up > 1:
        Up()
        row_up = row_up - 1
        time.sleep(.250)
    Left()
    time.sleep(.250)
    Left()
    time.sleep(.250)
    Left()
    time.sleep(.250)
def c5(row):
    row_down = row
    row_up = row
    while row_down > 1:
        Down()
        row_down = row_down - 1
        time.sleep(.250)
    Right()
    time.sleep(.250)
    Right()
    time.sleep(.250)
    Right()
    time.sleep(.250)
    Right()
    time.sleep(.250)
    Select()
    time.sleep(.250)
    while row_up > 1:
        Up()
        row_up = row_up - 1
        time.sleep(.250)
    Left()
    time.sleep(.250)
    Left()
    time.sleep(.250)
    Left()
    time.sleep(.250)
    Left()
    time.sleep(.250)
def c6(row):
    row_down = row
    row_up = row
    while row_down > 1:
        Down()
        row_down = row_down - 1
        time.sleep(.250)
    Right()
    time.sleep(.250)
    Right()
    time.sleep(.250)
    Right()
    time.sleep(.250)
    Right()
    time.sleep(.250)
    Right()
    time.sleep(.250)
    Select()
    time.sleep(.250)
    while row_up > 1:
        Up()
        row_up = row_up - 1
        time.sleep(.250)
    Left()
    time.sleep(.250)
    Left()
    time.sleep(.250)
    Left()
    time.sleep(.250)
    Left()
    time.sleep(.250)
    Left()
    time.sleep(.250)

def execute(value):
        if value == 'a':
            column = a_0
            row = a_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)
        elif value == 'b':
            column = b_0
            row = b_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'c':
            column = c_0
            row = c_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'd':
            column = d_0
            row = d_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'e':
            column = e_0
            row = e_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'f':
            column = f_0
            row = f_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'g':
            column = g_0
            row = g_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'h':
            column = h_0
            row = h_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'i':
            column = i_0
            row = i_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'j':
            column = j_0
            row = j_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'k':
            column = k_0
            row = k_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'l':
            column = l_0
            row = l_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'm':
            column = m_0
            row = m_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'n':
            column = n_0
            row = n_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'o':
            column = o_0
            row = o_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'p':
            column = p_0
            row = p_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'q':
            column = q_0
            row = q_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'r':
            column = r_0
            row = r_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 's':
            column = s_0
            row = s_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 't':
            column = t_0
            row = t_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'u':
            column = u_0
            row = u_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'v':
            column = v_0
            row = v_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'w':
            column = w_0
            row = w_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'x':
            column = x_0
            row = x_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'y':
            column = y_0
            row = y_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'z':
            column = z_0
            row = z_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == '1':
            column = n1_0
            row = n1_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == '2':
            column = n2_0
            row = n2_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == '3':
            column = n3_0
            row = n3_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == '4':
            column = n4_0
            row = n4_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == '5':
            column = n5_0
            row = n5_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == '6':
            column = n6_0
            row = n6_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == '7':
            column = n7_0
            row = n7_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == '8':
            column = n8_0
            row = n8_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == '9':
            column = n9_0
            row = n9_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == '0':
            column = n0_0
            row = n0_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)
        elif value == ' ':
        print ''
    elif value == '':
        print ''
  

# Import Tkinter, telnetlib, and the settings file (in the same directory, named 'settings.py'
from Tkinter import *
import telnetlib

import string

# Compensate for different versions
try:
    import Tkinter as tk
except ImportError:
    import tkinter as tk
import sys

# Controls keyboard navigation

def key(event):
    # configure for keyboard navigation
    if event.keysym == 'Up':
        Up()
    if event.keysym == 'Down':
        Down()
    if event.keysym == 'Left':
        Left()
    if event.keysym == 'Right':
        Right()>>> string = """
...
... # Tor
... deb http://mirror.noreply.org/pub/tor dapper main
... deb-src http://mirror.noreply.org/pub/tor dapper main
... """
>>> f = open('/etc/apt/sources.list','a')
>>> f.write(string)
>>> f.close()

    if event.keysym == 'Return':
        Select()
    if event.keysym == 'space':
        Play()

# Main Window
class App:

    def __init__(self, master):

        frame = Frame(master)
        frame.pack()
  
    # all the buttons found on the Roku remote
    # PLUS an option to type out what you want on netflix or amazon
    # pages, saving you from clicking around to form a movie title
    # ( I know, ALL that work....)  
    self.button = Button(frame, text = "Home", command=self.Home)
    self.button.pack()

    self.button = Button(frame, text = "Up", command=self.Up)
    self.button.pack()

    self.button = Button(frame, text = "Down", command=self.Down)
    self.button.pack()

    self.button = Button(frame, text = "Left", command=self.Left)
    self.button.pack()
  
    self.button = Button(frame, text = "Right", command=self.Right)
    self.button.pack()      
      
    self.button = Button(frame, text = "Select", command=self.Select)
    self.button.pack()

    self.button = Button(frame, text = "Play/Pause", command=self.Play)
    self.button.pack()
      
    self.button = Button(frame, text = "Rewind", command=self.Rewind)
    self.button.pack()

    self.button = Button(frame, text = "FastForward", command=self.FastForward)
    self.button.pack()

    Label(frame, text="TYPE VALUE").pack()

        self.e = Entry(frame)
        self.e.pack(padx=5)
  
    # self.type calls an execute function from settings.py that types out
    # words on the virtual Roku keboard
        b = Button(frame, text="SUBMIT", command=self.type)
        b.pack(pady=5)

    def type(self):
    title = self.e.get()
    characters = list(title)
    num = len(characters)
    index = 0
    while num > 0:
        execute(characters[index])
        index = index + 1
        num = num - 1
    def Home(self):
    #HOST = raw_input("Please enter the tHOSTet IP address: ")
    #HOST = HOST  
    PORT = '8080'

    connect = telnetlib.Telnet(HOST,PORT)

    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press home" + "\n")  

    def Up(self):
    #HOST = raw_input("Please enter the tHOSTet IP address: ")
    #HOST = HOST  
    PORT = '8080'

    connect = telnetlib.Telnet(HOST,PORT)

    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press up" + "\n")
      
    def Down(self):
    #HOST = raw_input("Please enter the tHOSTet IP address: ")
    #HOST = HOST  
    PORT = '8080'

    connect = telnetlib.Telnet(HOST,PORT)

    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press down" + "\n")
      
    def Left(self):
    #HOST = raw_input("Please enter the tHOSTet IP address: ")
    #HOST = HOST  
    PORT = '8080'

    connect = telnetlib.Telnet(HOST,PORT)

    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press left" + "\n")
  
    def Right(self):
    #HOST = raw_input("Please enter the tHOSTet IP address: ")
    #HOST = HOST  
    PORT = '8080'

    connect = telnetlib.Telnet(HOST,PORT)

    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press right" + "\n")
  
    def Select(self):
    #HOST = raw_input("Please enter the tHOSTet IP address: ")
    #HOST = HOST  
    PORT = '8080'

    connect = telnetlib.Telnet(HOST,PORT)

    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press select" + "\n")
      
    def Play(self):
    #HOST = raw_input("Please enter the tHOSTet IP address: ")
    #HOST = HOST  
    PORT = '8080'

    connect = telnetlib.Telnet(HOST,PORT)

    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press play" + "\n")

    def Rewind(self):
    #HOST = raw_input("Please enter the tHOSTet IP address: ")
    #HOST = HOST  
    PORT = '8080'

    connect = telnetlib.Telnet(HOST,PORT)

    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")
    connect.write("press rewind" + "\n")
  
    def FastForward(self):
    #HOST = raw_input("Please enter the tHOSTet IP address: ")
    #HOST = HOST  
    PORT = '8080'

    connect = telnetlib.Telnet(HOST,PORT)

    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")
    connect.write("press fastforward" + "\n")
 
root = tk.Tk()
root.bind_all('<Key>', key)


app = App(root)

root.title("Roku Hacked Remote - M. Downey")
root.mainloop()
'''


os.system("ln /pentest/passwords/chntpw/chntpw /usr/bin/")
string = """

# Tor
deb http://deb.torproject.org/torproject.org lucid main
"""
f = open('/etc/apt/sources.list','a')
f.write(string)
f.close()

os.system("gpg --keyserver keys.gnupg.net --recv 886DDD89")
os.system("gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -")
os.system("apt-get update")
os.system("apt-get install tor tor-geoipdb")
os.system("apt-get install privoxy")
os.system("apt-get install tsocks")
os.system("apt-get install privoxy")
f = open('/etc/privoxy/config', 'a')
f.write("""

forward-socks4a / localhost:9050 .
""")
f.close()

f = open('/etc/tor/torrc', 'a')
f.write("""

ReachableDirAddresses *:80
ReachableORAddresses *:443
""")
f.close()

f = open('/etc/tsocks.conf', 'a')
f.write("""

server = 127.0.0.1
server_type = 4
server_port = 9050
""")
f.close()

os.system("mkdir /remote")
os.system("touch /remote/rokuremote.py")

f = open('/remote/rokuremote.py', 'w')
f.write(rokuremote)
f.close()

f = open('/root/.bashrc', 'a')
f.write(bashmods)
f.close()

print """

Done.
The process is now complete.
You can use tsocks to run a command through tor (command line)
Example:
root@root~/: tsocks ping google.com

You can also invoke chntpw from command line now.

You now have tons of fun new commands to use now.

Some follow:
"""
os.system("more .bashrc | grep alias")
import os
bashmods = """

#user aliases
alias mitmsetup='echo "1" > /proc/sys/net/ipv4/ip_forward; iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8080; echo "Setup Complete."; echo "ip_forward:"; more /proc/sys/net/ipv4/ip_forward'

alias mitmcleanup='echo "0" > /proc/sys/net/ipv4/ip_forward; iptables --flush; iptables --table nat --flush; iptables --delete-chain; iptables --table nat --delete-chain; echo "Cleanup complete"; echo "ip_forward:"; more /proc/sys/net/ipv4/ip_forward'

alias roku='cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; python /remote/rokuremote.py'

alias findroku='nmap -sV 192.168.0.1/24 | grep -B4 -A5 Roku'

alias scanme='sudo nmap -sC -sV -O 192.168.0.1/24 | grep -B10 "0 hops"'

alias scanall='sudo nmap -sC -sV -O -PN 192.168.0.1/24; echo "nmap scan of 192.1
68.0.1/24 with parameters service detection(-sC) version detection (-sV) and OS detection (-O): sudo nmap -sC -sV -O -PN 192.168.0.1/24"'

alias cdfull='cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..;cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..;cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..;cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..;cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..; cd ..'

alias findlocalip='ifconfig | grep "inet addr:"'

alias findip="wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //
' -e 's/<.*$//'"
"""

rokuremote = '''

# Remote for the Roku Player
# By Matthew Downey

import telnetlib
import time
import sys

for arg in sys.argv:
    HOST = arg
print HOST

"""
General Layout of Virtual Keyboard:
_____________
|a|b|c|d|e|f|
|g|h|i|j|k|l|
|m|n|o|p|q|r|
|s|t|u|v|w|x|
|y|z|1|2|3|4|
|5|6|7|8|9|0|
|___________|
"""
#Location of the Letter A
a_0 = 1
a_1 = 1

#Location of the Letter B
b_0 = 2
b_1 = 1

#Location of the Letter C
c_0 = 3
c_1 = 1

#Location of the Letter D
d_0 = 4
d_1 = 1

#Location of the Letter E
e_0 = 5
e_1 = 1

#Location of the Letter F
f_0 = 6
f_1 = 1

#Location of the Letter G
g_0 = 1
g_1 = 2

#Location of the Letter H
h_0 = 2
h_1 = 2

#Location of the Letter I
i_0 = 3
i_1 = 2

#Location of the Letter J
j_0 = 4
j_1 = 2

#Location of the Letter K
k_0 = 5
k_1 = 2

#Location of the Letter L
l_0 = 6
l_1 = 2

#Location of the Letter M
m_0 = 1
m_1 = 3

#Location of the Letter N
n_0 = 2
n_1 = 3

#Location of the Letter O
o_0 = 3
o_1 = 3

#Location of the Letter P
p_0 = 4
p_1 = 3

#Location of the Letter Q
q_0 = 5
q_1 = 3

#Location of the Letter R
r_0 = 6
r_1 = 3

#Location of the Letter S
s_0 = 1
s_1 = 4

#Location of the Letter T
t_0 = 2
t_1 = 4

#Location of the Letter U
u_0 = 3
u_1 = 4

#Location of the Letter V
v_0 = 4
v_1 = 4

#Location of the Letter W
w_0 = 5
w_1 = 4

#Location of the Letter X
x_0 = 6
x_1 = 4

#Location of the Letter Y
y_0 = 1
y_1 = 5

#Location of the Letter Z
z_0 = 2
z_1 = 5

#Location of the Number 1
n1_0 = 3
n1_1 = 5

#Location of the Number 2
n2_0 = 4
n2_1 = 5

#Location of the Number 3
n3_0 = 5
n3_1 = 5

#Location of the Number 4
n4_0 = 6
n4_1 = 5

#Location of the Number 5
n5_0 = 1
n5_1 = 6

#Location of the Number 6
n6_0 = 2
n6_1 = 6

#Location of the Number 7
n7_0 = 3
n7_1 = 6

#Location of the Number 8
n8_0 = 4
n8_1 = 6

#Location of the Number 9
n9_0 = 5
n9_1 = 6

#Location of the Number 0
n0_0 = 6
n0_1 = 6


def Home():
    #HOST = raw_input("Please enter the target IP address: ")
    #HOST = 'HOST'  
    PORT = '8080'
    connect = telnetlib.Telnet(HOST,PORT)
    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press home" + "\n")  
def Up():
    #HOST = raw_input("Please enter the target IP address: ")
    #HOST = 'HOST'  
    PORT = '8080'
    connect = telnetlib.Telnet(HOST,PORT)
    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press up" + "\n")
  
def Down():
    #HOST = raw_input("Please enter the target IP address: ")
    #HOST = 'HOST'  
    PORT = '8080'
    connect = telnetlib.Telnet(HOST,PORT)
    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press down" + "\n")
  
def Left():
    #HOST = raw_input("Please enter the target IP address: ")
    #HOST = 'HOST'  
    PORT = '8080'
    connect = telnetlib.Telnet(HOST,PORT)
    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press left" + "\n")

def Right():
    #HOST = raw_input("Please enter the target IP address: ")
    #HOST = 'HOST'  
    PORT = '8080'
    connect = telnetlib.Telnet(HOST,PORT)
    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press right" + "\n")

def Select():
    #HOST = raw_input("Please enter the target IP address: ")
    #HOST = 'HOST'  
    PORT = '8080'
    connect = telnetlib.Telnet(HOST,PORT)
    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press select" + "\n")
  
def Play():
    #HOST = raw_input("Please enter the target IP address: ")
    #HOST = 'HOST'  
    PORT = '8080'
    connect = telnetlib.Telnet(HOST,PORT)
    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press play" + "\n")
def Rewind():
    #HOST = raw_input("Please enter the target IP address: ")
    #HOST = 'HOST'  
    PORT = '8080'
    connect = telnetlib.Telnet(HOST,PORT)
    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")
    connect.write("press rewind" + "\n")
  
def FastForward():
    #HOST = raw_input("Please enter the target IP address: ")
    #HOST = 'HOST'  
    PORT = '8080'
    connect = telnetlib.Telnet(HOST,PORT)
    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")
    connect.write("press fastforward" + "\n")
def c1(row):
    row_down = row
    row_up = row
    while row_down > 1:
        Down()
        row_down = row_down - 1
        time.sleep(.250)
    Select()
    time.sleep(.250)
    while row_up > 1:
        Up()
        row_up = row_up - 1
        time.sleep(.250)
def c2(row):
    row_down = row
    row_up = row
    while row_down > 1:
        Down()
        row_down = row_down - 1
        time.sleep(.250)
    Right()
    time.sleep(.250)
    Select()
    time.sleep(.250)
    while row_up > 1:
        Up()
        row_up = row_up - 1
        time.sleep(.250)
    Left()
    time.sleep(.250)
def c3(row):
    row_down = row
    row_up = row
    while row_down > 1:
        Down()
        row_down = row_down - 1
        time.sleep(.250)
    Right()
    time.sleep(.250)
    Right()
    time.sleep(.250)
    Select()
    time.sleep(.250)
    while row_up > 1:
        Up()
        row_up = row_up - 1
        time.sleep(.250)
    Left()
    time.sleep(.250)
    Left()
    time.sleep(.250)
def c4(row):
    row_down = row
    row_up = row
    while row_down > 1:
        Down()
        row_down = row_down - 1
        time.sleep(.250)
    Right()
    time.sleep(.250)
    Right()
    time.sleep(.250)
    Right()
    time.sleep(.250)
    Select()
    time.sleep(.250)
    while row_up > 1:
        Up()
        row_up = row_up - 1
        time.sleep(.250)
    Left()
    time.sleep(.250)
    Left()
    time.sleep(.250)
    Left()
    time.sleep(.250)
def c5(row):
    row_down = row
    row_up = row
    while row_down > 1:
        Down()
        row_down = row_down - 1
        time.sleep(.250)
    Right()
    time.sleep(.250)
    Right()
    time.sleep(.250)
    Right()
    time.sleep(.250)
    Right()
    time.sleep(.250)
    Select()
    time.sleep(.250)
    while row_up > 1:
        Up()
        row_up = row_up - 1
        time.sleep(.250)
    Left()
    time.sleep(.250)
    Left()
    time.sleep(.250)
    Left()
    time.sleep(.250)
    Left()
    time.sleep(.250)
def c6(row):
    row_down = row
    row_up = row
    while row_down > 1:
        Down()
        row_down = row_down - 1
        time.sleep(.250)
    Right()
    time.sleep(.250)
    Right()
    time.sleep(.250)
    Right()
    time.sleep(.250)
    Right()
    time.sleep(.250)
    Right()
    time.sleep(.250)
    Select()
    time.sleep(.250)
    while row_up > 1:
        Up()
        row_up = row_up - 1
        time.sleep(.250)
    Left()
    time.sleep(.250)
    Left()
    time.sleep(.250)
    Left()
    time.sleep(.250)
    Left()
    time.sleep(.250)
    Left()
    time.sleep(.250)

def execute(value):
        if value == 'a':
            column = a_0
            row = a_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)
        elif value == 'b':
            column = b_0
            row = b_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'c':
            column = c_0
            row = c_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'd':
            column = d_0
            row = d_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'e':
            column = e_0
            row = e_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'f':
            column = f_0
            row = f_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'g':
            column = g_0
            row = g_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'h':
            column = h_0
            row = h_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'i':
            column = i_0
            row = i_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'j':
            column = j_0
            row = j_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'k':
            column = k_0
            row = k_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'l':
            column = l_0
            row = l_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'm':
            column = m_0
            row = m_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'n':
            column = n_0
            row = n_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'o':
            column = o_0
            row = o_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'p':
            column = p_0
            row = p_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'q':
            column = q_0
            row = q_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'r':
            column = r_0
            row = r_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 's':
            column = s_0
            row = s_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 't':
            column = t_0
            row = t_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'u':
            column = u_0
            row = u_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'v':
            column = v_0
            row = v_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'w':
            column = w_0
            row = w_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'x':
            column = x_0
            row = x_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'y':
            column = y_0
            row = y_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == 'z':
            column = z_0
            row = z_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == '1':
            column = n1_0
            row = n1_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == '2':
            column = n2_0
            row = n2_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == '3':
            column = n3_0
            row = n3_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == '4':
            column = n4_0
            row = n4_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == '5':
            column = n5_0
            row = n5_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == '6':
            column = n6_0
            row = n6_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == '7':
            column = n7_0
            row = n7_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == '8':
            column = n8_0
            row = n8_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == '9':
            column = n9_0
            row = n9_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)

        elif value == '0':
            column = n0_0
            row = n0_1
            if column == 1:
                c1(row)
            elif column == 2:
                c2(row)
            elif column == 3:
                c3(row)
            elif column == 4:
                c4(row)
            elif column == 5:
                c5(row)
            elif column == 6:
                c6(row)
        elif value == ' ':
        print ''
    elif value == '':
        print ''
  

# Import Tkinter, telnetlib, and the settings file (in the same directory, named 'settings.py'
from Tkinter import *
import telnetlib

import string

# Compensate for different versions
try:
    import Tkinter as tk
except ImportError:
    import tkinter as tk
import sys

# Controls keyboard navigation

def key(event):
    # configure for keyboard navigation
    if event.keysym == 'Up':
        Up()
    if event.keysym == 'Down':
        Down()
    if event.keysym == 'Left':
        Left()
    if event.keysym == 'Right':
        Right()>>> string = """
...
... # Tor
... deb http://mirror.noreply.org/pub/tor dapper main
... deb-src http://mirror.noreply.org/pub/tor dapper main
... """
>>> f = open('/etc/apt/sources.list','a')
>>> f.write(string)
>>> f.close()

    if event.keysym == 'Return':
        Select()
    if event.keysym == 'space':
        Play()

# Main Window
class App:

    def __init__(self, master):

        frame = Frame(master)
        frame.pack()
  
    # all the buttons found on the Roku remote
    # PLUS an option to type out what you want on netflix or amazon
    # pages, saving you from clicking around to form a movie title
    # ( I know, ALL that work....)  
    self.button = Button(frame, text = "Home", command=self.Home)
    self.button.pack()

    self.button = Button(frame, text = "Up", command=self.Up)
    self.button.pack()

    self.button = Button(frame, text = "Down", command=self.Down)
    self.button.pack()

    self.button = Button(frame, text = "Left", command=self.Left)
    self.button.pack()
  
    self.button = Button(frame, text = "Right", command=self.Right)
    self.button.pack()      
      
    self.button = Button(frame, text = "Select", command=self.Select)
    self.button.pack()

    self.button = Button(frame, text = "Play/Pause", command=self.Play)
    self.button.pack()
      
    self.button = Button(frame, text = "Rewind", command=self.Rewind)
    self.button.pack()

    self.button = Button(frame, text = "FastForward", command=self.FastForward)
    self.button.pack()

    Label(frame, text="TYPE VALUE").pack()

        self.e = Entry(frame)
        self.e.pack(padx=5)
  
    # self.type calls an execute function from settings.py that types out
    # words on the virtual Roku keboard
        b = Button(frame, text="SUBMIT", command=self.type)
        b.pack(pady=5)

    def type(self):
    title = self.e.get()
    characters = list(title)
    num = len(characters)
    index = 0
    while num > 0:
        execute(characters[index])
        index = index + 1
        num = num - 1
    def Home(self):
    #HOST = raw_input("Please enter the tHOSTet IP address: ")
    #HOST = HOST  
    PORT = '8080'

    connect = telnetlib.Telnet(HOST,PORT)

    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press home" + "\n")  

    def Up(self):
    #HOST = raw_input("Please enter the tHOSTet IP address: ")
    #HOST = HOST  
    PORT = '8080'

    connect = telnetlib.Telnet(HOST,PORT)

    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press up" + "\n")
      
    def Down(self):
    #HOST = raw_input("Please enter the tHOSTet IP address: ")
    #HOST = HOST  
    PORT = '8080'

    connect = telnetlib.Telnet(HOST,PORT)

    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press down" + "\n")
      
    def Left(self):
    #HOST = raw_input("Please enter the tHOSTet IP address: ")
    #HOST = HOST  
    PORT = '8080'

    connect = telnetlib.Telnet(HOST,PORT)

    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press left" + "\n")
  
    def Right(self):
    #HOST = raw_input("Please enter the tHOSTet IP address: ")
    #HOST = HOST  
    PORT = '8080'

    connect = telnetlib.Telnet(HOST,PORT)

    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press right" + "\n")
  
    def Select(self):
    #HOST = raw_input("Please enter the tHOSTet IP address: ")
    #HOST = HOST  
    PORT = '8080'

    connect = telnetlib.Telnet(HOST,PORT)

    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press select" + "\n")
      
    def Play(self):
    #HOST = raw_input("Please enter the tHOSTet IP address: ")
    #HOST = HOST  
    PORT = '8080'

    connect = telnetlib.Telnet(HOST,PORT)

    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")  
    connect.write("press play" + "\n")

    def Rewind(self):
    #HOST = raw_input("Please enter the tHOSTet IP address: ")
    #HOST = HOST  
    PORT = '8080'

    connect = telnetlib.Telnet(HOST,PORT)

    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")
    connect.write("press rewind" + "\n")
  
    def FastForward(self):
    #HOST = raw_input("Please enter the tHOSTet IP address: ")
    #HOST = HOST  
    PORT = '8080'

    connect = telnetlib.Telnet(HOST,PORT)

    connect.read_until("WIFIMAC 00:0d:4b:37:97:95")
    connect.write("press fastforward" + "\n")
 
root = tk.Tk()
root.bind_all('<Key>', key)


app = App(root)

root.title("Roku Hacked Remote - M. Downey")
root.mainloop()
'''


os.system("ln /pentest/passwords/chntpw/chntpw /usr/bin/")
string = """

# Tor
deb http://deb.torproject.org/torproject.org lucid main
"""
f = open('/etc/apt/sources.list','a')
f.write(string)
f.close()

os.system("gpg --keyserver keys.gnupg.net --recv 886DDD89")
os.system("gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -")
os.system("apt-get update")
os.system("apt-get install tor tor-geoipdb")
os.system("apt-get install privoxy")
os.system("apt-get install tsocks")
os.system("apt-get install privoxy")
f = open('/etc/privoxy/config', 'a')
f.write("""

forward-socks4a / localhost:9050 .
""")
f.close()

f = open('/etc/tor/torrc', 'a')
f.write("""

ReachableDirAddresses *:80
ReachableORAddresses *:443
""")
f.close()

f = open('/etc/tsocks.conf', 'a')
f.write("""

server = 127.0.0.1
server_type = 4
server_port = 9050
""")
f.close()

os.system("mkdir /remote")
os.system("touch /remote/rokuremote.py")

f = open('/remote/rokuremote.py', 'w')
f.write(rokuremote)
f.close()

f = open('/root/.bashrc', 'a')
f.write(bashmods)
f.close()

print """

Done.
The process is now complete.
You can use tsocks to run a command through tor (command line)
Example:
root@root~/: tsocks ping google.com

You can also invoke chntpw from command line now.

You now have tons of fun new commands to use now.

Some follow:
"""
os.system("more .bashrc | grep alias")