Comments (5)
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.
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.
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.
Hmmm... Starting to think about implementing Thread support... may give it a go in the weekend unless a better solution appears...
from blcheck.
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)
- Shellcheck found a lot of problems HOT 1
- problem with shebang HOT 3
- Email Notification HOT 3
- Doesn't work
- multiple "not found" HOT 2
- Remove nszones.com
- Invalid blacklist for hostkarma.junkemailfilter.com HOT 1
- Unable to interpret results HOT 2
- xargs or gnu parallel for parallel processing HOT 1
- IPv6 support HOT 2
- -bash: blcheck: command not found HOT 3
- What is the purpose of -d option? HOT 1
- Spamhaus error codes treated as blacklist HOT 1
- dig throws error HOT 2
- License HOT 3
- Yellow listed is mark as blacklisted HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blcheck.