How to detect a couple of pings transmitted from a virtual machine to another by using Snort, which is integrated in AlienVault? - snort

For the record: I did the following instruction (found them on a website)
I enabled snort sensors (snort_syslog and snortunified).
In alienvault: ~# nano /etc/snort/rules/local.rules
I did the following rule
alert icmp 192.168.1.130 192.168.1.120 -> any any
(msg:"blablabla"; sid:1000004)
Save and exit
After that I did:
alienvault:~# perl /usr/share/ossim/scripts/create_sidmap.pl /etc/snort/rules/
alienvault:~# /etc/init.d/ossim-server restart
For some reasons nothing happens in AlienVault interface in SIEM when I ping 192.168.1.120 from 192.168.1.130.
Any ideas??

I don't know wether it is still relevant but in my opinion there is a mistake in your Snort rule:
The rule in Snort cannot consist of two IP-adresses in the first part of the rule header.
At the point where you declared the IP '192.168.1.120' you have to declare a port.
The solution you need looks like the following (if i get you right):
alert icmp 192.168.120 any -> 192.168.1.130 any (msg:"blablabla"; sid:1000004)
And also the other way:
alert icmp 192.168.1.130 any -> 192.168.1.120 any (msg:"blablabla"; sid:1000005)
For writing rules in the correct syntax take a look at the manual of snort: http://manual.snort.org/node29.html#SECTION00423000000000000000
I hope that this can help you.
/Chris

Related

Why does BitBake error if it can't find www.example.com?

BitBake fails for me because it can't find https://www.example.com.
My computer is an x86-64 running native Xubuntu 18.04. Network connection is via DSL. I'm using the latest versions of the OpenEmbedded/Yocto toolchain.
This is the response I get when I run BitBake:
$ bitbake -k core-image-sato
WARNING: Host distribution "ubuntu-18.04" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
ERROR: OE-core's config sanity checker detected a potential misconfiguration.
Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
Following is the list of potential problems / advisories:
Fetcher failure for URL: 'https://www.example.com/'. URL https://www.example.com/ doesn't work.
Please ensure your host's network is configured correctly,
or set BB_NO_NETWORK = "1" to disable network access if
all required sources are on local disk.
Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
The networking issue, the reason why I can't access www.example.com, is a question for the SuperUser forum. My question here is, why does BitBake rely on the existence of www.example.com? What is it about that website that is so vital to BitBake's operation? Why does BitBake post an Error if it cannot find https://www.example.com?
At this time, I don't wish to set BB_NO_NETWORK = "1". I would rather understand and resolve the root cause of the problem first.
Modifying poky.conf didn't work for me (and from what I read, modifying anything under Poky is a no-no for a long term solution).
Modifying /conf/local.conf was the only solution that worked for me. Simply add one of the two options:
#check connectivity using google
CONNECTIVITY_CHECK_URIS = "https://www.google.com/"
#skip connectivity checks
CONNECTIVITY_CHECK_URIS = ""
This solution was originally found here.
For me, this appears to be a problem with my ISP (CenturyLink) not correctly resolving www.example.com. If I try to navigate to https://www.example.com in the browser address bar I just get taken to the ISP's "this is not a valid address" page.
Technically speaking, this isn't supposed to happen, but for whatever reason it does. I was able to work around this temporarily by modifying the CONNECTIVITY_CHECK_URIS in poky/meta-poky/conf/distro/poky.conf to something that actually resolves:
# The CONNECTIVITY_CHECK_URI's are used to test whether we can succesfully
# fetch from the network (and warn you if not). To disable the test set
# the variable to be empty.
# Git example url: git://git.yoctoproject.org/yocto-firewall-test;protocol=git;rev=master
CONNECTIVITY_CHECK_URIS ?= "https://www.google.com/"
See this commit for more insight and discussion on the addition of the www.example.com check. Not sure what the best long-term fix is, but the change above allowed me to build successfully.
If you want to resolve this issue without modifying poky.conf or local.conf or any of the files for that matter, just do:
$touch conf/sanity.conf
It is clearly written in meta/conf/sanity.conf that:
Expert users can confirm their sanity with "touch conf/sanity.conf"
If you don't want to execute this command on every session or build, you can comment out the line INHERIT += "sanity" from meta/conf/sanity.conf, so the file looks something like this:
Had same issue with Bell ISP when accessing example.com gave DNS error.
Solved by switching ISP's DNS IP to Google's DNS (to avoid making changes to configs):
https://developers.google.com/speed/public-dns/docs/using

port binding debugging in specman

I work with quite a big environment, which I am not familiar with most of it. There is now a DUT error reported by a checker. The problem is - the checker gets data items via ports. Is there an e method that can show which monitors are connected to the checker (so that I can see which monitor drove the bad data)? Also - how can I tell where in the code the checker was connected to the monitors?
there are several ways to debug external and internal port bindings:
1) You can use the get_inbound_set() on a specific port to get all the ports it is bound to.
2) Trace commands:
to debug procedural connections:(do_bind() or connect()) - use “trace bind”.
for static generation binding (keep bind()) - use “trace gen”.
3) we recommend using the procedural approach : connect() & do_bind() , as it simplifies the debugging , and does not burden the generator.
just a side note, you can also use:
"trace esi" : use this trace only up until the run phase , to see the full attribute list that was given to every port in your environment
"show ports" : show you information about a specific port or all ports in your environment , read the doc to see what kind of information can be seen. it is recommended to use this command after all of the port bindings are done.

how to set the port of snmp agentX subagent?

I am working on extending net-snmp to write a subagent with agentX.
Now I use the example codes from net-snmp, and compiled to a subagent.
Below is the codes I get from:
http://www.net-snmp.org/wiki/index.php/TUT:Writing_a_MIB_Module
And I succeed to perform snmpget and snmpset to my subagent using agentX.
My questions:
I think the subagent and master agent are listening on a port, how can I find which port they are listening? I have been told the default port is 705, but when I use "netstat", I can't find any process listening on port 705.
How to change the listening port of subagent? Do I need to change in the example code to set the port?
By default, actually, on "anything but windows" the default is to listen to a unix socket located at /var/agentx/master.
You can change the listening address using the API suggested by the other poster, or even using the snmpd.conf configuration file:
agentXSocket tcp:localhost:705
When you create a subagent, it'll read your FOO.conf file where FOO is what you passed to init_snmp("FOO");
The problem is solved:
http://www.net-snmp.org/wiki/index.php/FAQ%3aAgent_12
By adding
netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
NETSNMP_DS_AGENT_X_SOCKET, "tcp:localhost:705");
in the example codes before the 'init_agent' call.
Thanks!
You need to change the snmpd.conf file
master agentx
AgentXSocket tcp:X.X.X.X:705
And in your agentx code write down these lines before init_agent()
netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_X_SOCKET, "tcp:X.X.X.X:705");

Problems with Exim hosts_require_tls config

I'm trying to enforce TLS for out going mail to a single host. I'm no exim expert, in fact I've never even used it, it was all set up by the previous developer.
I just assumed inserting hosts_require_tls = example.co.uk in exmin.conf and restarting the service would work. But when I add this line the service wont start. I checked in the "panic" error log after trying to start the service and it contains
"2011-08-02 12:20:18 Exim configuration error in line 150 of /etc/exim.conf:
main option "hosts_require_tls" unknown"
So I'm obviously being dumb and putting it in the wrong config file or something. Any help would be greatly appreciated. Thanks! :-)
The setting has to be put in the corresponding transport configuration section, probably
remote_smtp:
driver = smtp
hosts_require_tls = example.co.uk
by default. Not in the main configuration (where it is unknown).

Catchall Router on Exim does not work

I have setup a catchall router on exim (used as last router):
catchall:
driver = redirect
domains = +local_domains
data = ${lookup{*#$domain}lsearch{/etc/aliases}}
retry_use_local_part
This works perfectly when sending emails locally. However, if I login to my GMail account and send an email to whatever#mydomain.com, then I get an "Unrouteable Address".
Thank you for any hints to solve this issue.
In the system_aliases: section of the config file you already have a section which does the lookup in /etc/aliases.
Replace
data = ${lookup{$local_part}lsearch{/etc/aliases}}
with
data = ${lookup{$local_part}lsearch*#{/etc/aliases}}
and make sure you have *:catchall_username* in /etc/aliases
This works great for a single domain mail server which is already using /etc/aliases
For this router to work, make sure that
mydomain.com is in local_domains
there is an entry for *#mydomain.com in /etc/aliases
MX record for mydomain.com is pointing to the server, where you've
configured this
This is old as heck, but I didn't see a good answer posted and someone else might want to know the answer.
This post is geared towards Debian with in single configuration file mode. It should work on any Linux Exim4 install though. For the purpose of explaining things we’ll use test#example.com which is configured with the hostname mail.example.com. The system will have a real user called test and we want to create an alias for test called alias. So the end result will all email sent to alias#example.com forwarded to test#example.com without having to create the user alias on the system.
First we need to create a place to store all of the alias files:
mkdir /etc/exim/aliases.d
vim /etc/exim/aliases.d/mail.example.com
contents of the alias file for mail.example.com alias:test
vim /etc/exim/exim4.conf.template
Now look for the section system_aliases. Here you’ll see data = ${lookup{$local_part}lsearch{/etc/aliases}} or something similar. Change that to
data = ${lookup{$local_part}lsearch{/etc/exim4/aliases.d/$domain}}
Save the file and restart exim. The alias should now work. To add support for other domains just add more alias files in the aliases.d directory with the correct hostname.
I copied and pasted this from my blog:
0xeb.info