Coder Social home page Coder Social logo

Comments (2)

evildrummer avatar evildrummer commented on June 19, 2024

I used a workaround.

  • Copied the wordlists in hashview/control/wordlists/
  • Did an INSERT on the wordlists table in mysql
  • INSERT INTO wordlists(id,name,last_updated,owner_id,type,path,size,checksum) VALUES ('4','RockYou2021.txt','2021-04-16 12:54:00',1,'static','hashview/control/wordlists/rockyou2021.txt',98378212907,'912545075b5db4cc1c37562ffeb61d9c0bf859f6cfa0695f3171a795ea0d45a6');
  • Restarted the hashview.py

To avoid a internal syncing when using agent and hashview on the same system i commented out the wordlist syncing in the hashview-agent.py

from hashview.

salmon85 avatar salmon85 commented on June 19, 2024

This is basically what I use to work around (after I noticed it removes the gz extension on zipped wordlists while still leaving them compressed).

The script checks to see if the file has already been added to the database and skips it if it already exists.

import mysql.connector
import os, glob, time
from hashlib import sha256


database = "hashview"
username = "hashview"
password = "DoNotUseThisPassword123!"

wordlistdir = "/home/user/hashview/hashview/control/wordlists/"

def wtiimw():#What time is it mr wolf
	return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())

files = glob.glob(wordlistdir+"*")

connector = mysql.connector.connect(user=username, password=password, host='127.0.0.1', database=database)
sql = connector.cursor()

for file in files:
	filename = file.replace(wordlistdir, "")
	sql.execute("""SELECT * FROM wordlists WHERE path='"""+file.replace(wordlistdir, "hashview/control/wordlists/")+"""'""")
	existing = sql.fetchall()
	if not (existing):
		sha256sum = sha256()
		with open(file, 'rb') as fd:
			data_chunk = fd.read(1024)
			while data_chunk:
				sha256sum.update(data_chunk)
				data_chunk = fd.read(1024)
		sql.execute("""INSERT INTO wordlists (name, last_updated, owner_id, type, path, size, checksum) VALUES ('"""+filename+"""','"""+wtiimw()+"""','1','static','"""+file.replace(wordlistdir, "hashview/control/wordlists/")+"""','"""+str(os.path.getsize(file))+"""','"""+sha256sum.hexdigest()+"""')""")
connector.commit()
connector.close()

from hashview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.