Giter Club home page Giter Club logo

Comments (5)

IntellexApps avatar IntellexApps commented on June 9, 2024

Maybe it would be a better option to create an additional script that will iterate over a list, which will generate summary? We might create it and add it to the repository, what do you think?

from blcheck.

pavs avatar pavs commented on June 9, 2024

I think that would be awesome. I gave it a shot, but bash fu isn't that great.

Created a ip.txt files with each ip for each line.

Made a script (auto.sh) to run through the ip list like this:

while read ip ; do
    ./blacklist.sh $ip
done < block.txt

It does what it should but I can't seem figure out how to print out the summary.
I tried this:

./auto.sh > 12_temp.txt
grep -q 'Blacklisted:[ \t]*0$' 12_temp.txt || cat 12_temp.txt >> 12.txt
rm -f 12_temp.txt

But it doesn't seem to work, The idea was to isolate the ips that scanned positive on a blacklist.

from blcheck.

pavs avatar pavs commented on June 9, 2024

ooh I think I found the solution.

New Script:

pavs@octopus:/var/www/html/test$ cat auto2.sh

while read ip ; do
        ./blacklist.sh -p $ip > result.txt
grep 'Blacklisted:[ \t]*0$' result.txt 
done < block.txt

Had two ip on the block.txt, one blacklisted one non blacklisted. Only the blacklisted one got written to txt file. Result:

pavs@octopus:/var/www/html/test$ sudo sh -x auto2.sh
+ read ip
+ ./blacklist.sh -p <non-blacklisted-ip>
+ grep Blacklisted:[ \t]*0$ result.txt
Blacklisted:   0
+ read ip
+ ./blacklist.sh -p <blacklisted-ip>
+ grep Blacklisted:[ \t]*0$ result.txt
+ read ip
pavs@octopus:/var/www/html/test$ cat result.txt
Warning: PTR lookup failed
b.barracudacentral.org : 127.0.0.2
bb.barracudacentral.org : 127.0.0.2
black.junkemailfilter.com : 127.0.0.2
dnsbl.justspam.org : 127.0.0.2
hostkarma.junkemailfilter.com : 127.0.0.2

----------------------------------------------------------
Results for <blacklistedip>

Tested:        117
Passed:        112
Invalid:       0
Blacklisted:   5
----------------------------------------------------------

I have 2500+ ips, if I run tem though one script, with an avg of 90 seconds per ip it will take a little more than 2 day (+6 hours), so I think I will break down the ips in to smaller section and run them through cron job.

Let me know what you think or if I could make it better.

from blcheck.

hunsheridan avatar hunsheridan commented on June 9, 2024

Hmmm... Starting to think about implementing Thread support... may give it a go in the weekend unless a better solution appears...

from blcheck.

lunarsoap5 avatar lunarsoap5 commented on June 9, 2024

When I try to run the program, I keep getting told that there is no DNS record found for any IP addresses. Any idea why this is happening?

from blcheck.

Related Issues (17)

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.