in reply to processing a module result
Reading the documentation for Masscan::Scanner may help. If it doesn't you might try showing the code you have tried using to process the results and tell us how it has failed.
You say you are not a "good programmer in perl", but I suspect that means you are not an experienced Perl programmer. If you show us some code that will help us asses what you do know and the level of help you need. Read I know what I mean. Why don't you? for some hints about how you should go about writing something to show us. Most of us will not easily be able to use the Masscan::Scanner module!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: processing a module result
by averlon (Sexton) on May 18, 2022 at 06:12 UTC | |
Hi GrandFather, in this case I have tried to understand the documentation but failed so far.
The first line to get the result from the object obviously works. It is according to the documentation. It looks like the second line also brings one part of the result to a variable. But to access the IP (and print it) and the array of port is still not working. The documentation of the module shows some example data structure provided as result.
with:
I geht the data structure into a scalar - so far so good now I would like e.g. to print the IP-Address as part of the data structure or move the whole result into an array or just run a foreach ... to process the results list. but I don't know how
Regards
Kallewirsch
| [reply] [d/l] [select] |
by Discipulus (Canon) on May 18, 2022 at 06:39 UTC | |
mainly our goal is to help you in learning, not providing solutions, so I'd start with:
They are sligltly different... where? \@ports is a reference to an array while @av_arr_PORTS is an array. Look carefully at the documentation: arguments are always passed as a single scalar like in $mas->add_port(25) or as array reference like in $mas->ports(['22', '80', '443']); but never as list or array.
Consider the following oneliner (pay attention to windows double quotes around the code, single quote needed for Linux):
You are in a similar situation: perldsc is definitevely a good read. Modify your program and share your achievements: they will probably bring up new questions L*
There are no rules, there are no thumbs.. Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS. | [reply] [d/l] [select] |
by averlon (Sexton) on May 18, 2022 at 08:04 UTC | |
Hi I guess, I found a solution myself I will post it once it is completely working
Regards
Kallewirsch
| [reply] |
by GrandFather (Saint) on May 18, 2022 at 12:05 UTC | |
Crafting a good question often provides the answer you are looking for without needing to actually ask it. This is a Good Thing™! You already have a little feedback on your solution: Always use strictures (use strict; use warnings; - see The strictures, according to Seuss). If I get time tomorrow night I'll run through your code and provide what I hope is helpful feedback.
Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
| [reply] |
by averlon (Sexton) on May 18, 2022 at 15:06 UTC | |
by averlon (Sexton) on May 18, 2022 at 08:17 UTC | |
Hi here is my code:
I am sure there is a lot of optimization and shortening of commands possible - but one step after another probably it will help also others struggling with this issue - if some
Regards
Kallewirsch
| [reply] [d/l] |
by Discipulus (Canon) on May 18, 2022 at 09:49 UTC | |
by averlon (Sexton) on May 18, 2022 at 14:54 UTC | |