Parrot Community

Community portal of the Parrot Project.

You are not logged in.

Announcement

Welcome Aboard Pirate!

Support us on Patreon and contribute to our project!

HappyHacking!

#1 2017-06-09 03:55:30

Jeff
Administrator
From: USA
Registered: 2017-02-11
Posts: 297
Website

Python Script Issue From a Member

 
#!/usr/bin/python
#
#

import os
import sys, traceback
import time
import uniclear

print "#" * 71
print "#######==Welcome to Uni-Brute a Universal Bruteforcing Program==#######"
print "#" * 71
print """\nim a newbie so bear with me if the script is'nt perfect, this scipt
is based on the idea of 'cupp' [https://github.com/Mebus/cupp]
a password profiler, but i wanted to take it
a little further and make a script that creats a wordlist of the most common
password formats with the givin intel about the taget, as well as a user-name
generater, and last but not least a brute-force tool that currently supports
the following protocols:
\n[HTTP/HTTPS] \n[SMTP]
\n\nIRC will be comming soon hopefully in the next Version
"""
print "Version 1.2017"
print "\nAuthor: [Brut0s] \nGithub: [https://github.com/brut0s]"
print "\nContributers: [TheCryptek] \nGithub: [https://github.com/TheCryptek]"

#Maine Menu

def print_menu():
    print ""
    print 30 * "-" , "Main-Menu" , 30 * "-"
    print ""
    print "[1]...Create custom list of Passwords"
    print "[2]...Create custom list of User-Names"
    print "[3]...Crack account"
    print "[4]...Exit Uni-Brute"
    print ""
    print 71 * "-"

loop=True

while loop:
    print_menu()
    choice = input("\nSelect From One of the Fallowing [1-4]: ")

    if choice==1:

	uniclear.clear()
	import unipass
        cont = raw_input("\nPress 'Return' to Continue")
	uniclear.clear()

    elif choice==2:

	uniclear.clear()
	import uniusers
        cont = raw_input("\nPress 'Return' to Continue")
	uniclear.clear()

    elif choice==3:

	    uniclear.clear()
	    print 30 * "-", "Cracking Menu", 30 * "-"
	    print "[1]...HTTP/HTTPS"
	    print "[2]...IRC"
	    print "[3]...SMPT"
	    print 75 * "-"

	    choice = input("\nSelect from One of the following protocols [1-4]: ")

	    if choice==1:

		uniclear.clear()
		import unihttp
            cont = raw_input("\nPress 'Return' to Continue")
		#uniclear.clear()

	   elif choice==2:

		uniclear.clear()
		import uniirc
            cont = raw_input("\nPress 'Return' to Continue")
		uniclear.clear()

	    elif choice==3:

		uniclear.clear()
		import unismtp
            cont = raw_input("\nPress 'Return' to Continue")
		uniclear.clear()

	    else:

	        raw_input("\n[!]-Error That was a invalid Number, Select from [1-3]")

    elif choice==4:

	print "\nThanks for Using Uni-Brute"
        loop=False

    else:

        raw_input("\n[!]-Error That was a invalid Number, Select from [1-4]")

-Jeff Szydel

*Parrot Ambassador   *Social Groups Manager   *Helpdesk   *Wiki Editor   
*Parrot Telegram Group Administrator   *Parrot Community Administrator

Offline

#2 2017-06-09 10:47:33

disrupt_the_flow
Community Member
Registered: 2017-05-31
Posts: 34

Re: Python Script Issue From a Member

I don't know what the errors you had was but almost every indentation was wrong.It wasn't the most beautiful code i've seen so it had a lot of syntax errors.Two huge errors.One was the last loop=Flase just before the last else: shouldn't be there and the choice keyword was not defined.So yeah always check for correct indentation..It was spaces and not tabs.See this code.Runs perfectly for me but it's missing the uniclear module.So run it with uniclear and tell me if there are any errors.And i don't even get why you used loop:Flse.Or what is it.

#!/usr/bin/python
#
#

import os
import sys, traceback
import time
import uniclear

print "#" * 71
print "#######==Welcome to Uni-Brute a Universal Bruteforcing Program==#######"
print "#" * 71
print """\nim a newbie so bear with me if the script is'nt perfect, this scipt
is based on the idea of 'cupp' [https://github.com/Mebus/cupp]
a password profiler, but i wanted to take it
a little further and make a script that creats a wordlist of the most common
password formats with the givin intel about the taget, as well as a user-name
generater, and last but not least a brute-force tool that currently supports
the following protocols:
\n[HTTP/HTTPS] \n[SMTP]
\n\nIRC will be comming soon hopefully in the next Version
"""
print "Version 1.2017"
print "\nAuthor: [Brut0s] \nGithub: [https://github.com/brut0s]"
print "\nContributers: [TheCryptek] \nGithub: [https://github.com/TheCryptek]"

#Maine Menu

def print_menu():
	print ""
	print 30 * "-" , "Main-Menu" , 30 * "-"
	print ""
	print "[1]...Create custom list of Passwords"
	print "[2]...Create custom list of User-Names"
	print "[3]...Crack account"
	print "[4]...Exit Uni-Brute"
	print ""
	print 71 * "-"

loop=True

while loop:
	print_menu()
choice = input("\nSelect From One of the Fallowing [1-4]: ")

if choice==1:

	uniclear.clear()
	import unipass
	cont = raw_input("\nPress 'Return' to Continue")
	uniclear.clear()

elif choice==2:

	uniclear.clear()
	import uniusers
	cont = raw_input("\nPress 'Return' to Continue")
	uniclear.clear()

elif choice==3:

	uniclear.clear()
	print 30 * "-", "Cracking Menu", 30 * "-"
	print "[1]...HTTP/HTTPS"
	print "[2]...IRC"
	print "[3]...SMPT"
	print 75 * "-"

choice = input("\nSelect from One of the following protocols [1-4]: ")

if choice==1:

	uniclear.clear()
	import unihttp
	cont = raw_input("\nPress 'Return' to Continue")
	#uniclear.clear()

elif choice==2:

	uniclear.clear()
	import uniirc
	cont = raw_input("\nPress 'Return' to Continue")
	uniclear.clear()

elif choice==3:

	uniclear.clear()
	import unismtp
	cont = raw_input("\nPress 'Return' to Continue")
	uniclear.clear()

elif choice != True:
	raw_input("\n[!]-Error That was a invalid Number, Select from [1-3]")

elif choice == 4:

	print "\nThanks for Using Uni-Brute"


else:

	raw_input("\n[!]-Error That was a invalid Number, Select from [1-4]")

Last edited by disrupt_the_flow (2017-06-09 10:54:22)

Offline

#3 2017-06-12 02:48:22

GRX78FL
Administrator
From: Somewhere In Time
Registered: 2017-02-17
Posts: 11

Re: Python Script Issue From a Member

The "uniclear" module isn't installed.
That's the problem of the script. But the problem is I didn't find anything online about it... it may be a poorly documented custom library (don't quote me on this, lol).

Offline

#4 2017-06-12 18:20:04

Xc0d3
Community Member
Registered: 2017-05-30
Posts: 7

Re: Python Script Issue From a Member

The problem is that uniclear module does not exist, perhaps the creator of the script had his own module (uniclear.py) in the same folder where the script was and since there he imported uniclear.py as a module. Possible solution --> contact the script developer .

Offline

#5 2017-07-17 12:15:46

actee
Community Member
From: Portugal
Registered: 2017-07-16
Posts: 25

Re: Python Script Issue From a Member

I believe in python you can identify with spaces, just don't identify with both of them ( spaces and tabs ), there is one thing that came to sight, that is the inputs, you're asking for raw_input when you show error messages, not storing that input.

Maybe do a do .. while loop for getting the user input? do .... while choice > 4 and choice < 1


C and Python

Offline

#6 2017-08-12 14:12:50

justin
Community Member
From: India
Registered: 2017-08-01
Posts: 21
Website

Re: Python Script Issue From a Member

Jeff wrote:
 
#!/usr/bin/python
#
#

import os
import sys, traceback
import time
import uniclear

print "#" * 71
print "#######==Welcome to Uni-Brute a Universal Bruteforcing Program==#######"
print "#" * 71
print """\nim a newbie so bear with me if the script is'nt perfect, this scipt
is based on the idea of 'cupp' [https://github.com/Mebus/cupp]
a password profiler, but i wanted to take it
a little further and make a script that creats a wordlist of the most common
password formats with the givin intel about the taget, as well as a user-name
generater, and last but not least a brute-force tool that currently supports
the following protocols:
\n[HTTP/HTTPS] \n[SMTP]
\n\nIRC will be comming soon hopefully in the next Version
"""
print "Version 1.2017"
print "\nAuthor: [Brut0s] \nGithub: [https://github.com/brut0s]"
print "\nContributers: [TheCryptek] \nGithub: [https://github.com/TheCryptek]"

#Maine Menu

def print_menu():
    print ""
    print 30 * "-" , "Main-Menu" , 30 * "-"
    print ""
    print "[1]...Create custom list of Passwords"
    print "[2]...Create custom list of User-Names"
    print "[3]...Crack account"
    print "[4]...Exit Uni-Brute"
    print ""
    print 71 * "-"

loop=True

while loop:
    print_menu()
    choice = input("\nSelect From One of the Fallowing [1-4]: ")

    if choice==1:

	uniclear.clear()
	import unipass
        cont = raw_input("\nPress 'Return' to Continue")
	uniclear.clear()

    elif choice==2:

	uniclear.clear()
	import uniusers
        cont = raw_input("\nPress 'Return' to Continue")
	uniclear.clear()

    elif choice==3:

	    uniclear.clear()
	    print 30 * "-", "Cracking Menu", 30 * "-"
	    print "[1]...HTTP/HTTPS"
	    print "[2]...IRC"
	    print "[3]...SMPT"
	    print 75 * "-"

	    choice = input("\nSelect from One of the following protocols [1-4]: ")

	    if choice==1:

		uniclear.clear()
		import unihttp
            cont = raw_input("\nPress 'Return' to Continue")
		#uniclear.clear()

	   elif choice==2:

		uniclear.clear()
		import uniirc
            cont = raw_input("\nPress 'Return' to Continue")
		uniclear.clear()

	    elif choice==3:

		uniclear.clear()
		import unismtp
            cont = raw_input("\nPress 'Return' to Continue")
		uniclear.clear()

	    else:

	        raw_input("\n[!]-Error That was a invalid Number, Select from [1-3]")

    elif choice==4:

	print "\nThanks for Using Uni-Brute"
        loop=False

    else:

        raw_input("\n[!]-Error That was a invalid Number, Select from [1-4]")

Full script is wrong and its not a python script

Please check the orignal script for the below link
https://github.com/brut0s/Uni-Brute.py


Justin-Community Member

GPG Fingerprint: 737B 4996 0F2B B97C D984  EBD1 6CB8 34F5 990C B6CE
GPG Info: https://pgp.mit.edu/pks/lookup?op=vinde … f5990cb6ce
GPG Key : https://pgp.mit.edu/pks/lookup?op=get&s … f5990cb6ce

Offline

#7 2017-10-17 17:16:45

PoshMagiC0de
Community Member
Registered: 2017-07-06
Posts: 38

Re: Python Script Issue From a Member

Do not know anything about the uniclear module but i can tell you some things to make this cleaner.

If you want a menu command like interface, take a look at the module Cmd.cmd.  Some popular frameworks even use it.  It will make your program resemble the interface metasploit has.  A projects that directly use it is AdaptiveEmpire's Empire and Mame82's P4wnP1.  Adaptive has a more robust implementation of it so looking through their code will give you some awesome ideas.

With all the if else statements, I see a cause for some fancy code.  Python does use switch/case which I would first recommend but for some reason they feel they do not need it so each of those choices you can encapsulate into functions with no input like below.

def choice1():
    uniclear.clear()
    import unipass
    cont = raw_input("\nPress 'Return' to Continue")
    uniclear.clear()

You will enumerate your choice functions into a dict like so:

choices = { 1 : choice1,
    2 : choice2,
    3 : choice3
}

Watch our for naming when naming your choice functions cause I see you have more sets choices so make sure your naming doesn't collide.
Next you will want to make sure the number choice they pick is in range so make sure their choice is equal or greater than the least number choice that can be selected and equal or less than the highest number choice.

Then finally if their number choice is in range you can call that choice like so.

choices[choice]()

Last edited by PoshMagiC0de (2017-10-17 17:23:13)

Offline

Board footer

Powered by FluxBB

Design by Klocek.