Forum Kurallarını Okumak İçin Lütfen Tıklayınız .

Recently searched:

Script Python To Extract Url Pass From Fresh Log Logs 

Logs Script Python To Extract Url Pass From Fresh Log

Hihihehe

User
Joined
Jul 13, 2023
Messages
17
Reaction score
31
#CR
2
Here is script. After you download rar log file, you extract rar file then run this script:
Link :
You do not have permission to view link Log in or register now.


===============CONTENT==============
import os


# Get the path to the directory

path = "/home/yourname/logurl/MAY/2023-5-10-147PCS"

f=open("store.txt","a")

print("Extracting...")

# Get a list of all the sub-directories in the directory

sub_directories = os.listdir(path)


# Print the names of the sub-directories

#for sub_directory in sub_directories:

# print(sub_directory)

url=""

username=''

password=''

for sub_directory in sub_directories:


# Get the path to the sub-directory

sub_directory_path = os.path.join(path, sub_directory)


# Get a list of all the files in the sub-directory

files = os.listdir(sub_directory_path)


# Iterate over the files

for file in files:


# Check if the file is named "Passwords.txt"

if file == "Passwords.txt":

#print(file)

full_path = os.path.join(sub_directory_path,file)

f1=open(full_path,'r')

lines=f1.readlines()

for line in lines:

if "http" in line: url=str(line).rstrip()

if "Username" in line: username=str(line).rstrip()

if "Password" in line: password=str(line)

f.write(url+"|"+username+"|"+password+"\n")

f.close()

#print(full_path)

print("DONE")


====================END==============
Enjoy
 
Last edited:
C:\Users\Administrator\Documents>python logs.py File "C:\Users\Administrator\Documents\logs.py", line 34 sub_directory_path = os.path.join(path, sub_directory) ^ IndentationError: expected an indented block after 'for' statement on line 29


what happened with this sir?
 
C:\Users\Administrator\Documents>python logs.py File "C:\Users\Administrator\Documents\logs.py", line 34 sub_directory_path = os.path.join(path, sub_directory) ^ IndentationError: expected an indented block after 'for' statement on line 29


what happened with this sir?
IndentationError: expected an indented block after 'for' statement on line 29
 
C:\Users\Administrator\Documents>python logs.py File "C:\Users\Administrator\Documents\logs.py", line 34 sub_directory_path = os.path.join(path, sub_directory) ^ IndentationError: expected an indented block after 'for' statement on line 29


what happened with this sir?,
Hello, I added link download in post. pls check
 

Users who are viewing this thread

Home Register
Top Bottom