Announcement

Collapse
No announcement yet.

Deleting browser histories

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PremJkumar
    replied
    Hi hguler07,

    We are glad to hear that script is working good for you. Please reach us if you have any other request or issues, we are happy to assist.

    Kind Regards,
    PremJK

    Leave a comment:


  • hguler07
    replied
    Hello.

    I want to inform you about the latest developments.
    Your support team connected to my computer at 11:00 today. They checked the problem. I normally test a script file first on my own computer. If I see it working properly, I apply it to other computers in the institution. Your developer team asked me to try this code on the test machine. When we close the Browsers on the computer next to me and test the code. Successfully cleared the history of Google Chrome and Firefox browsers. And it did not delete saved passwords as I wanted.

    The code was working properly. Couldn't run the code properly just because of possibilities that I couldn't predict

    Thank you very much for your help and attention.
    I wish you healthy days.
    Best regards.

    Leave a comment:


  • PremJkumar
    replied
    Hi hguler07,

    Can you please check your Inbox for private message and provide requested detail.

    Kind Regards,
    PremJK

    Leave a comment:


  • PremJkumar
    replied
    Hi hguler07,

    Thank you so much. We will create a support ticket to arrange remote session.

    Kind Regards,
    PremJK

    Leave a comment:


  • hguler07
    replied
    Hi

    Of course, I can share my Anydesque Id with you. I'm available until 18:00 today. GMT + 03: 00
    I'm sending you a private message in terms of security

    Kind Regards,

    Leave a comment:


  • PremJkumar
    replied
    Hi hguler07,

    Our script developers want to arrange remote session to test the script in your environment. Can you please help us in remote session.

    Kind Regards,
    PremJK

    Leave a comment:


  • PremJkumar
    replied
    Hi hguler07,

    Thanks for trying and providing your feedback. We have asked our script developers to investigate the issue.

    Kind Regards,
    PremJK

    Leave a comment:


  • hguler07
    replied
    Hello

    Yes I have tested it as you say it does not delete my history in chrome browser in any way.

    I checked in Firefox the result is the same.
    I am sharing the related screenshots



    Click image for larger version

Name:	1.jpg
Views:	38
Size:	58.9 KB
ID:	56741
    Click image for larger version

Name:	2.jpg
Views:	34
Size:	65.1 KB
ID:	56751
    Click image for larger version

Name:	4.jpg
Views:	34
Size:	60.3 KB
ID:	56761


    Click image for larger version

Name:	5.jpg
Views:	36
Size:	42.7 KB
ID:	56771



    Code:
    the code I'm running
    
    #Packages
    import os
    import subprocess
    import shutil
    import time
    import re
    #----------------------------------------------------------------------------------------------------
    start_time = time.time()
    #----------------------------------------------------------------------------------------------------
    #Functions
    def remove(path):
    #Remove the file or directory
    if os.path.isdir(path):
    try:
    shutil.rmtree(path)
    except OSError:
    print "Unable to remove folder: %s" % path
    else:
    try:
    if os.path.exists(path):
    os.remove(path)
    except OSError:
    print "Unable to remove file: %s" % path
    
    
    def chrome_cleanup(dirpath,folder_to_exclude):
    for root, dirs, files in os.walk(dirpath, topdown=True):
    for file_ in files:
    full_path = os.path.join(root, file_)
    if folder_to_exclude not in full_path:
    print 'removing -> ' + full_path
    remove(full_path)
    for folder in dirs:
    full_path = os.path.join(root, folder)
    if folder_to_exclude not in full_path:
    remove(full_path)
    
    def firefox_cleanup(dirpath,folder_to_exclude):
    for root, dirs, files in os.walk(dirpath, topdown=True):
    for file_ in files:
    full_path = os.path.join(root, file_)
    if folder_to_exclude[0] not in full_path and folder_to_exclude[1] not in full_path:
    print 'removing -> ' + full_path
    remove(full_path)
    for folder in dirs:
    full_path = os.path.join(root, folder)
    if folder_to_exclude[0] not in full_path and folder_to_exclude[1] not in full_path:
    remove(full_path)
    
    def permissions(dirpath):
    mode=0o777
    if os.path.isdir(dirpath):
    try:
    for root,dirs,files in os.walk(dirpath,topdown=False):
    for dircs in [os.path.join(root,d) for d in dirs]:
    os.chmod(dircs,mode)
    for s_file in [os.path.join(root,f) for f in files]:
    os.chmod(s_file,mode)
    except Exception as E:
    print E
    
    #path_creation
    def path_creation(fil_users):
    fir_ls=[]
    chr_ls=[]
    ls=[]
    #firefox
    for i in fil_users:
    try:
    path="C:\Users\%s\AppData\Roaming\Mozilla\Firefox\ Profiles"%i
    if os.path.exists(path):
    os.chdir(path)
    ls.append(os.popen('cd').read().rstrip())
    except:
    print("No Path")
    
    for i in ls:
    os.chdir(i)
    out=os.popen('dir').read()
    fir_ls.append(re.findall('\w+.default-release',out))
    fir_ls_n=[]
    for i in fir_ls:
    if i[0]:
    fir_ls_n.append(i[0])
    else:pass
    l=[]
    for i,j in zip(fir_ls_n,ls):
    l.append(os.path.join(j,i))
    #chrome
    for i in fil_users:
    chr_path='C:\Users\%s\AppData\Local\Google\Chrome\ User Data\Default'%i
    if os.path.exists(chr_path):
    chr_ls.append(chr_path)
    else:
    pass
    return [l,chr_ls]
    #-----------------------------------------------------------------------------------------------------
    #codes
    users=os.popen("net user").read().split()[5:-5]
    filtered_users=[i for i in users if i!='Guest']
    #print filtered_users
    
    paths=path_creation(filtered_users)
    #print paths[1]
    
    # save_path_chrome=[]
    # for i in paths[1]:
    # save_path_chrome.append(i+"\Login Data")
    # tot_chrome=zip(paths[1],save_path_chrome)
    
    save_path_fire=[]
    for i in paths[0]:
    save_path_fire.append([i+"\logins.json",i+"\key4.db"])
    tot_fire=zip(paths[0],save_path_fire)
    
    #print paths[0]
    #print paths[1]
    #print save_path_chrome
    #print tot_chrome
    #print tot_fire[0][1]
    try:
    #chrome
    for i in paths[1]:
    if os.path.exists(i):
    print("Starting Google Chrome...\n")
    print("Chrome Permission fixing...")
    permissions(i)
    print("Cleaning Up Chrome....\n")
    chrome_cleanup(i,'Login Data')
    print("Chrome Completed!!!\n")
    #firefox
    for i,j in tot_fire:
    if os.path.exists(i):
    print("Starting Mozilla Firefox...\n")
    print("Firefox Permission fixing...")
    permissions(i)
    print("Cleaning Up Firefox....\n")
    firefox_cleanup(i,j)
    print("Firefox Completed!!!\n")
    except Exception as E:
    print E
    finally:
    print "Code Executed"
    print("--- %s seconds ---" % (time.time() - start_time))

    Can you please inform me if there is a mistake I made after the necessary investigations, finally I ran the code as a system user. I wish you good work.

    Best regards

    Leave a comment:


  • PremJkumar
    replied
    Hi hguler07,

    Our script developers wants to know whether you checked with opening browser and check for history and login details ,since it doesn't delete all the folder .The login details will be saved in that folders and also if browser is being used while running the script it cannot delete certain files and folders which is used by browser.

    Only history, cookies, cache will be deleted and login details will be preserved. Please check the image attached

    Click image for larger version

Name:	after_fi.PNG
Views:	40
Size:	45.0 KB
ID:	56582


    Kind Regards,
    PremJK

    Leave a comment:


  • PremJkumar
    replied
    Hi hguler07,

    Thanks for trying and providing output. Will share this with our script developers and update you.

    Kind Regards,
    PremJK

    Leave a comment:


  • hguler07
    replied
    ​​Hello,

    The script works. But it is deleting data from chrome browser of another user on Computer. Instead of logging into the system, I also ran the script as a logged-in user and still failed.

    I'm taking relevant screenshots. The only problem is that the user I am currently using is deleting the data.


    Click image for larger version

Name:	tarayıcı11.jpg
Views:	39
Size:	9.3 KB
ID:	56541


    Click image for larger version

Name:	tarayıcı1.JPG
Views:	41
Size:	36.4 KB
ID:	56551

    Click image for larger version

Name:	33.jpg
Views:	41
Size:	40.6 KB
ID:	56561

    Best regards
    Attached Files

    Leave a comment:


  • PremJkumar
    replied
    Hi hguler07,

    Please run this script and provide your feedback
    https://scripts.itarian.com/frontend...cluding-logins

    Kind Regards,
    PremJK

    Leave a comment:


  • hguler07
    replied
    Hello,

    Chrome and Firefox are generally used in our institution.

    Kind Regards

    Leave a comment:


  • PremJkumar
    replied
    Hi hguler07,

    Our script developers want to know for which browser you want to delete histories.

    Kind Regards,
    PremJK

    Leave a comment:


  • PremJkumar
    replied
    Hi hguler07,

    Thanks for your request. We will update you script once it is prepared by our script developers.

    Kind Regards,
    PremJK

    Leave a comment:

Working...
X