Writing an essay script.
So Unmap offers group support on many topics.
Now, since it is open source scripts are constantly increasing by the day or even the existing scripts
are improved.
Therefore, that means that you can write your own and map script.
And of course, it may indeed be necessary if you can't find a script that is more relevant to a crawl
that you want to do.
So all information about Intermap scripting engine or NSC can be found here and Map Maddog.
The unmap scripts are written in the Lewa programming language.
If you're not necessarily familiar, I'll tell you that some rules must be followed when writing script.
There are certain parts that must be included in the script.
And this is because Unmap Runge each script in a certain sequence, starting from the first line of
the script, it'll run step by step according to the rules.
So a script that is not written correctly will fail.
So when writing scripts with N Map, we don't have to write everything ourselves.
There is an API support, which means that many processes that we will be using are already defined
and in MAP.
And we need to do is call the relevant process with the help of the and map API.
So you can access the unmap API libraries at this site.
Now, the NSC script consists of the following main pains, the head description categories, dependencies,
author and Lycett.
Description feel.
The description field tells the subject of the script and what it does.
Depending on the length and complexity of the script, the description can be several lines.
I think a brief summary would often be more understandable.
Categories.
So the fields that the script is included in our specify, so one or more fields can be included.
There's no case sensitivity when specifying names.
Four domains you can go to and mayberg at this address.
For example, categories equals.
Default, discovery, safe, et cetera.
Author field information about the person who wrote the script using an email address is not recommended.
License for.
The license information is required to use a script and all scripts use and map licenses because an
map is open source software.
So it's sufficient to specify the following in the script.
License equals same as Inmet.
So you can look at this page to get that.
Dependancy Fields'.
So if there is another script in this field that will be used beforehand, before the execution of the
script, it's going to be specified here.
So when writing scripts, you should list the scripts that should work in advance, according to the
scenario that we have determined, for example, dependencies equals SMB boot.
The rule.
The rules that will be executed in the script here are specified.
Rules are Lua commands that run in sequence and return true or false?
So a script must contain one or more of the following functions that determine when to run the script.
Free Rule A.
Just rule the host.
What rule host port and post rule A?
So pretty rule scripts are executed once before any host is scanned in the script pre scan phase.
So after each host is scanned, the hosts rule, import rule scripts are executed.
Most rural scripts run once, after all, the hosts are scanned.
And a script can run in multiple stages if it has several rules.
Pretty rule and post rule do not accept arguments.
Host rule accepts a host table and can, for example, test the IP address or host name of the destination
port rule open open except support table for any port and filtered or unfiltered port states.
Court rules often test factors such as port no port status or listening service name when deciding a
port.
And some example rules are shown in the section entitled Rule.
The standard to choose between a pre rule or a post rule is.
If this script is doing computer discovery or other network operation, then the rule should be use.
Most rule is reserved for reporting, data and statistics collected during scanning.
The action.
Action is the heart of an NSC script.
The script preparation includes all instructions that must be executed in the courtroom, host rule
or post rule triggers.
A Lua function that accepts the same arguments as a rule.
The value returned by the action value can be a table of name value pairs, a string or a zero.
Environment variables, so each script has its own set of environment variables.
Script path, obviously, the script path, script name is the name, and this variable can be used
in a debug output.
Script type two.
So since a script can have more than one rule function.
This environment variable indicates which rule has enabled the script, which is very useful if the
script wants to share some code between different script scanning phases.
So how about some examples, scriptwriting?
Now, that's a great example, script and then scan with a script.
So let's write a script to show if the DNA sport is on or off.
So the script must be registered in this directory in order to be used by the unmap program.
So open VMS, open login, actually, user root password tours, open terminal now right in leaf pad,
user share and map scripts test that NFC.
Of course, you can use it in another text editor.
Will will speed up by using the the notes I've prepared before.
So versus right head.
Description equals.
So this is a simple script example that determines if a DNS port is open or not.
Right.
Author equals non byte.
Now, let's right rule, so here our script will scan unless DP and UDP ports on the target system rule.
What rule equals function of support?
Return port, that protocol equals equals TCP and port, not state equals equals open.
Return port protocol equals equals UDP and Port St. equals equals open and.
So an action will list the results.
Action equals function Mooseport return, this port is open.
So this record, what we do now, so on the command line and map script test 10 zero two dot four p.
53 us, you just press enter.
OK, so as you can see, our script works and the results were listed.
So the subject of scripts is completely dependent on your programming, knowledge and your imagination.
So if you define what you want to do, you will have completed really the most important stage.
The Internet's going to help you with the rest.
Well, I'll help you with this anyway.
So remember, you can always contribute to Inmet by sharing your scripts.