What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Skynet Skynet adding local file .txt

jayz

Occasional Visitor
Hello All Sorry to ask newbie here, i used skynet for ipblocking question how do i import .txt file saved on my pc (ex: download folder) to skynet firewall. or what is the proper way to import a local file to skynet? thanks in advance
 
Hello All Sorry to ask newbie here, i used skynet for ipblocking question how do i import .txt file saved on my pc (ex: download folder) to skynet firewall. or what is the proper way to import a local file to skynet? thanks in advance
Here are some steps to import a file from a local location... :)

 
Here are some steps to import a file from a local location... :)

Thank you so much very appreciated. i am working on my own blocklist now :)
 
Hello!
Please tell me the exact structure of recording multiple IP addresses for importing into the blacklist from a file (local & https://... ).
I tried this form of recording IP addresses in a text file (UTF8):
var #1 (to column)
1.2.3.4
5.6.7.8.
...
var #2 (into a single line with separated by ",")
1.2.3.4, 5.6.7.8 ...
In both cases there is an error message: 404 error... or only one IP address is read out of all!
If you enter IP addresses in the console, then naturally no problems arise:
1. for exapmle: firewall ban range 1.2.3.0/24 comment "abc"
2. for exapmle: firewall ban ip 1.2.3.4 comment "abc"
I need to enter more than 1000 IP addresses and it is very tedious to do by hand.
Thanks for the help.
P.S Is there any limit on the number of IP addresses in the blacklist?
 
Last edited:
Hello!
Please tell me the exact structure of recording multiple IP addresses for importing into the blacklist from a file (local & https://... ).
I tried this form of recording IP addresses in a text file (UTF8):
var #1 (to column)
1.2.3.4
5.6.7.8.
...
var #2 (into a single line with separated by ",")
1.2.3.4, 5.6.7.8 ...
In both cases there is an error message: 404 error... or only one IP address is read out of all!
If you enter IP addresses in the console, then naturally no problems arise:
1. for exapmle: firewall ban range 1.2.3.0/24 comment "abc"
2. for exapmle: firewall ban ip 1.2.3.4 comment "abc"
I need to enter more than 1000 IP addresses and it is very tedious to do by hand.
Thanks for the help.
P.S Is there any limit on the number of IP addresses in the blacklist?
Why go through all this trouble? Why not use an already well-established list?
 
Why go through all this trouble? Why not use an already well-established list?
Why do I even need other people’s problems related to bruteforce of other people’s servers?
I have my own server and I want to take from the log of my server the IP addresses of those who engage in bruteforce and block them at the entrance to the router.
That's all...
Don't enter this manually, instead of importing from a file!
P.S Moreover, such a possibility is declared on Skynet!
Then there must be an exact specificatio of file for importing multiple IP addresses, but I can't find it anywhere!
 
Last edited:
Why do I even need other people’s problems related to bruteforce of other people’s servers?
I have my own server and I want to take from the log of my server the IP addresses of those who engage in bruteforce and block them at the entrance to the router.
That's all...
Don't enter this manually, instead of importing from a file!
What service/port are they trying to brute force on your end exactly?
 
Why do I even need other people’s problems related to bruteforce of other people’s servers?
I have my own server and I want to take from the log of my server the IP addresses of those who engage in bruteforce and block them at the entrance to the router.
That's all...
It's possible that your server is more powerful than your router. In which case it might make more sense to run something like fail2ban directly on the server rather than exporting/importing files for Skynet.

 
It's possible that your server is more powerful than your router. In which case it might make more sense to run something like fail2ban directly on the server rather than exporting/importing files for Skynet.

I want to make sure that they do not even reach the server and are blocked at the entrance to the router.Otherwise, the server log is like an endless tape. The server software allows me to upload the IP addresses of those who do bruteforce into a file that I want to import every day into Skynet.
 
Last edited:
I don't use Skynet but looking at the source code it appears that the format of the import file is a single CIDR per line. There must be no other characters in front or after each address. For example,
Code:
216.58.213.0/24
45.77.76.174/32

I don't know what the meaning is for the "comment" option of the import command. Perhaps that's just some arbitrary string you need to specify.
  • firewall import blacklist file.txt "Apples": Ban all IPs from the URL/local file with the comment "Apples".
 
I don't use Skynet but looking at the source code it appears that the format of the import file is a single CIDR per line. There must be no other characters in front or after each address. For example,
Code:
216.58.213.0/24
45.77.76.174/32

I don't know what the meaning is for the "comment" option of the import command. Perhaps that's just some arbitrary string you need to specify.
  • firewall import blacklist file.txt "Apples": Ban all IPs from the URL/local file with the comment "Apples".
No, this doesn't work:
firewall import blacklist https://mysite.abc/catalog/file.txt
I tried it, but I got an error: 404 error!
Although the file.txt from the https://mysite.abc/catalog/file.txt can be opened in any browser without any problems!
 
Try putting the same file on the router and importing it from there instead. The 404 error suggests a curl error has occurred.
Code:
firewall import blacklist /tmp/file.txt "Apples"
 
Try putting the same file on the router and importing it from there instead. The 404 error suggests a curl error has occurred.
Code:
firewall import blacklist /tmp/file.txt "Apples"
I already wrote earlier that when importing from a local file, it only imports one IP address, which is the latest in the file!
All other IP addresses are not imported at all!
My command:
firewall import blacklist /mnt/sda1/entware/tmp/banlist.txt "abc"
 
I already wrote earlier that when importing from a local file, it only imports one IP address, which is the latest in the file!
All other IP addresses are not imported at all!
This is the command I use to import large lists of IP addresses to Skynet's whitelist:

Code:
firewall import whitelist /jffs/addons/vpnmon-r3.d/vr3svr1.txt "VPNMON-R3 VPN Slot 1 Import"

The list is formatted in a single column of IP addresses, like:

33.46.33.66
11.60.223.22
...

I don't have any CIDR notations in there, like the /24's... they're all just straight IPs. I'd have to check the MAN to see if that would be possible for white/blacklisting.
 
I already wrote earlier that when importing from a local file, it only imports one IP address, which is the latest in the file!
All other IP addresses are not imported at all!
My command:
firewall import blacklist /mnt/sda1/entware/tmp/banlist.txt "abc"
Make sure the file is using Unix line endings and not DOS/Windows. e.g.
Code:
dos2unix /mnt/sda1/entware/tmp/banlist.txt
 
Make sure the file is using Unix line endings and not DOS/Windows. e.g.
Code:
dos2unix /mnt/sda1/entware/tmp/banlist.txt
The file is created using NotePad++ only and is saved in UTF8 encoding, not NotePad for Windows.
 
The file is created using NotePad++ only and is saved in UTF8 encoding, not NotePad for Windows.
Notepad++ has the option to save files in either end of line format (EDIT > EOL Conversion), which is unrelated to the encoding.

This is the command I use to import large lists of IP addresses to Skynet's whitelist:

Code:
firewall import whitelist /jffs/addons/vpnmon-r3.d/vr3svr1.txt "VPNMON-R3 VPN Slot 1 Import"

The list is formatted in a single column of IP addresses, like:

33.46.33.66
11.60.223.22
...

I don't have any CIDR notations in there, like the /24's... they're all just straight IPs. I'd have to check the MAN to see if that would be possible for white/blacklisting.
Yes. Looking at the code more closely the bitmask part is optional.
 
Last edited:
Hello ALL!
Yes, that's right - the problem was incorrect file encoding.
I converted the file to UNIX UTF8 (EOL for UNIX) and all IP addresses from the file were imported completely.
Thanks everyone for your help.
 
Last edited:
Hello ALL!
Yes, that's right - the problem was incorrect file encoding.
I converted the file to UNIX UTF8 (EOL for UNIX) and all IP addresses from the file were imported completely.
Thanks everyone for your help.
I would be interested in your methods of how exactly you're extracting IPs of devices attempting brute force attempts, and how you're getting these back over onto your router in single columned lists for import into Skynet? Do you have any code you can share so I can get a better understanding?
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top