for one
from shutil import which
import time
import os
import sys
print(G + '[+]' + C + ' Checking Dependencies And Packages...' + W)
pkgs = ['python3', 'php', 'git',]
inst = True
for pkg in pkgs:
present = which(pkg)
if present == None:
print(R + '[-] ' + W + pkg + C + ' is not Installed!')
inst = False
else:
pass
if inst == False:
exit()
else:
pass
import csv
import json
import argparse
import requests
import subprocess as subp
imports should NOT be seperated you do not need to go line by line unless your doing something like
from colorama import Fore, Back, Style, init
from scapy.all import *
----------------
instead of doing that do this it makes the code work alot faster than reading imports later in the code ( ive made this mistake many times )
import os, sys, time, threading, requests, json, csv, etc etc etc
second thing to not
for list in $( < $wordlist ); do
if [[ $(( $thread % $count )) = 0 && $count > 0 ]]; then
sleep 2
fi
scan "${web}" "${list}" &
(( count++ ))
done
why is this neaither placed in a function, bash is a very very easy language and can be manipulated in many ways for many things, a quick way to write a main function would be writting fucntions and make sure to indent them for example in golang and rust
func main() {
fmt.Println("hello world")
}
function main() {
Println("hello world");
}
but accept you can do this as well in bash
main() {
for list in $( < $wordlist ); do
if [[ $(( $thread % $count )) = 0 && $count > 0 ]]; then
sleep 2
fi
scan "${web}" "${list}" &
(( count++ ))
done
}
also one last thing to note is to never use time.sleep like you did in this function here, i have stopped using sleep overtime cause i realized its a useless VERY useless function unless your making A, Process monitors, Process watchers, or live updates on stuff like weather, time, date, clock GUI's etc etc
just some new tips to help out a fellow programmer
( use functions when the code is big, in smaller chunks its not really NEEDED but its suggested to help organize your code and make it 100% more better