Sunday, November 3, 2019

domain name system - DNS Server using bind on CentOS - does not resolve

I am trying to setup a DNS for a standard lan zone.
I have now read every bit of info available but still the DNS server does not resolve
with nslookup or dig

e.g. "nslookup router.local.lan"
=> ** server can't find router.local.lan: NXDOMAIN



named.conf file:



options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";


// Forward any unresolved requests to DNS of ISP
allow-recursion {
localhost;
192.168.1.0/24;
};
forwarders {
217.237.151.51;
};
};


zone "local.lan" {
type master;
file "lan.zone";
notify yes;
};


lan.zone File




$TTL 3600
@ IN SOA romeo0.local.lan. admin.local.lan. (
2013061001 ; Serial
3H ; refresh after 3 hours
1H ; retry after 1 hour
1W ; expire after 1 week
1D) ; minimum TTL of 1 day
@ IN NS romeo0.
@ IN A 192.168.1.160
router IN A 192.168.1.1

romeo1 IN A 192.168.1.161


Can someone help me finding the mistake I am making?
Any help is much appreciated.



Edit:
I found the solution:
I the DNS server in resolve.conf was wrong
And I needed to remove the dot as yoonix pointed out

Saturday, November 2, 2019

spam - Which E-Mail software generates these spammy mails?



I notice a lot of spammy looking e-mails from suspicious sources. They are not real spam but are unsolicited. You can identify them by containing these headers:




X-Mailer-LID: 5
List-Unsubscribe:
X-Mailer-RecptId: 605065
X-Mailer-SID: 4
X-Mailer-Sent-By: 1


Does anyone know the software that generates those mails? They are sent out afterwards via real MTAs like Postfix or Exim.



If one could verify the software you can use that information for spam filtering.



Answer



Seems to be Interspire Email Marketer:



https://www.interspire.com/forum/showthread.php?t=16759
http://www.interspire.com/emailmarketer/


Friday, November 1, 2019

linux - Why 777 cause problem but 644 was fine

I have a VPS, for some reason php can only exec when permission is 644.



If I changed the php file to 777 or 755, it would throw me an Error 500 internal server error.



I thought 777 give everybody greatest permission, what makes a web server behave like that?



Thank you for your time.

accounting - How can I enable pid and ppid fields in psacct dump-acct?



I am currently using the psacct package on Centos to perform accounting on processes run by users.



The info file1 suggests that it is possible to output pid and ppid depending on what information your operating system provides in it's struct acct.




pid and ppid are listed in /usr/include/linux/acct.h on my system:



struct acct_v3
{
char ac_flag; /* Flags */
char ac_version; /* Always set to ACCT_VERSION */
__u16 ac_tty; /* Control Terminal */
__u32 ac_exitcode; /* Exitcode */
__u32 ac_uid; /* Real User ID */
__u32 ac_gid; /* Real Group ID */

__u32 ac_pid; /* Process ID */
__u32 ac_ppid; /* Parent Process ID */
...


But pid and ppid are not output when I run dump-acct:



# dump-acct /var/account/pacct.1 | tail
awk | 0.0| 0.0| 81.0| 0| 0|8792.0|Thu Nov 24 04:03:04 2011
tmpwatch | 0.0| 0.0| 1.0| 0| 0|3816.0|Thu Nov 24 04:03:04 2011

cups | 0.0| 0.0| 4.0| 0| 0|8728.0|Thu Nov 24 04:03:04 2011
awk | 0.0| 0.0| 4.0| 0| 0|8792.0|Thu Nov 24 04:03:04 2011
runlevel | 0.0| 0.0| 0.0| 0| 0|3804.0|Thu Nov 24 04:03:04 2011
chkconfig | 0.0| 0.0| 0.0| 0| 0|3840.0|Thu Nov 24 04:03:04 2011
inn-cron-expire | 0.0| 0.0| 0.0| 0| 0|8728.0|Thu Nov 24 04:03:04 2011
awk | 0.0| 0.0| 0.0| 0| 0|8792.0|Thu Nov 24 04:03:04 2011
gzip | 5.0| 0.0| 9.0| 0| 0|4044.0|Thu Nov 24 04:03:04 2011
accton | 0.0| 0.0| 1.0| 0| 0| 0.0|Thu Nov 24 04:03:04 2011



Is it likely that there is no support in my kernel for this feature or that my psacct version does not support this?



How can I add pid and ppid to my accounting logs?



CentOS release 5.6



Kernel 2.6.18-238.19.1.el5



psacct 6.3.2


Answer




I just found this in the changelog for the psacct RPM:



* Fri Nov 13 2009 Ivana Varekova  - 6.3.2-56
- fix the psacct to deal with all acct types and
if it is possible and wanted then add the possibility
to display the pid and ppid number


So it looks like it depends in exactly which release you are using.


Thursday, October 31, 2019

raid - ZFS on top of Hardware Mirroring, or just mirror in ZFS?



I have an IBM x346 with dual 3.2Ghz Xeons and 2x36GB 15k SCSI disks. I'm running an entirely ZFS-based install of FreeBSD 8.1.




I can configure the bios to mirror the two disks, and then put ZFS on that "single" drive, or I can mirror the drives using ZFS, and install to that.



If I go the all-ZFS route, I suppose I have a little more freedom with how I use the devices (I could set up a fast non-redundant striped area, in addition to my mirrored system install, for example). Do I gain anything as far as error correction goes? Rebuild performance/ease/time?



I know that both configurations are probably the same to within a gnat's eyelash, but I'd like a second opinion.


Answer



Don't know about the speed, but here is what I believe running ZFS on RAID would means:





  • You loose the benefits of atomic writes because now the RAID controller has the last say on when a write happens to the disk. Which means you rely on the RAID controllers NVRAM.


  • ZFS also may get lied to if the data was written inporperly, ZFS would have to take the RAID controllers word for it.


  • You would also loose repairing files because, from ZFS's point of view, you have a single disk, if the data's integrity is bad, ZFS would have no way to repair it because there is no second copy. (assuming you don't set copies=2)


  • If the RAID drives fall out of sync the RAID drive may take some time to sync depending on the journaling ability. ZFS will resilver the data it finds bad and at least some OSs may run a resilver periodically to ensure the integrity. Again because the RAID will only display one drive to ZFS, ZFS can't help with the repair/rebuild.


  • You would be able to expand the RAID (if the RAID has the capability) and maybe rebuild the ZFS data across more drives. (For me not a big plus considering the negatives so far.)


  • Of course all the snapshot functionality of ZFS would be unaffected (assuming the data doesn't silently get corrupted).




Hardware RAID would almost negate any advantages that ZFS would have. Personally, I wouldn't recommend using anything under ZFS, I would run ZFS on bare metal.




However, if there is an advantage I hadn't consider I'm open to hearing it.


raid1 - How does Rebuild in host-raid RAID-1 works?



I am testing a Non-Hardware Raid with 3 1TB Disks.
I create a RAID-1 Array with my first 2 Disks and installed Windows 7 on the Raid disk that i'd created. I unplugged the first disk SATA cable in RAID Array and reboot the system. When i entered the RAID Controller by pressing "Ctrl+I" I get the message which asked me to add the free disk to the array. after i add that disk The Raid Volume status changed to Rebuild. under the Screen there is a yellow message : "Volumes with Rebuild status will be rebuilt within the operating system".



Here are my questions:





  1. What does it mean by that message ? does it mean that i just need to boot into my windows and all the Rebuild happens automatically or do I need any kind of software ?

  2. How can i monitor how much the Rebuilding process is completed ?


Answer



You are using an Intel Rapid Storage RAID controller. This is not hardware RAID. Like most onboard/motherboard RAID controllers it is host-RAID.



"Volumes with Rebuild status will be rebuilt within the operating system" means exactly that, Rapid Storage relies on a driver within the OS to perform it's work. It is incapable of doing any actual RAID'ing by itself.



Status will be shown using the Intel Rapid Storage console which normally comes bundled with the RAID driver. You're also better off adding/removing/replacing disks using the Windows software and not the very limited BIOS interface.


Wednesday, October 30, 2019

How botmaster use Domain Generating Algorithms (DGA)?


Domain Generation Algorithms(DGAs) are used in malware to generate a large number of domain names that can be used in communications to the malware’s command and control servers



For example, an infected computer could create thousands of domain names such as: www.(gibberish).com and would attempt to contact a portion of these with the purpose of receiving an update or commands. - Wikipedia




But my question is we need to buy and register a domain name before we want to use. Then how hacker can generate 10 Thousand of domain name ? and use them ?

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...