osdir.com
mailing list archive
Mozy Online Backup: 2GB Free. Automatic. Secure.

Subject: Fwd: shortport function - msg#00071

List: security.nmap.devel

Date: Prev Next Index Thread: Prev Next Index
I am not sure why this email didn't make it onto nmap-dev so i am
resending it.

Begin forwarded message:

> From: Diman Todorov <diman.todorov@xxxxxxxxxxxx>
> Date: 12. Juli 2007 12:52:03 GMT+02:00
> To: Nmap Dev <nmap-dev@xxxxxxxxxxxx>
> Subject: Re: shortport function
>
>
> On 12.07.2007, at 10:21, Ferdy Riphagen wrote:
>
>> Hi all,
>>
>> I have a problem with the parsing of the shortport.* function
>> It doesn't pare code like this right I'll think. portrule =
>> shortport.portnumber(69, "udp", {"open", "open|filtered"}
>> I can use a table for the port, but not for the state and service.
>>
>> Can someone verify this? Possible there must be a check for _state is
>> "string", " table" or "nil"
>>
>> --Ferdy--
>>
>
> yes, this is true. The shortport.portnumber doesn't take a table
> for the port state, only a string. I commited a fix for that to the
> soc07 svn (svn://diman@xxxxxxxxxxxxxxxx/nmap-exp/soc07/). The only
> parameter which doesn't take a table now is the protocol. I will
> leave it that way until someone comes up with a scenario in which
> you don't care if the open port is a tcp or udp port ;)
>
> cheers,
> Diman


_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org



Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Re: shortport function

On 12.07.2007, at 12:45, Eddie Bell wrote: > You could do something like this: > > portrule = function() > return shortport.portnumber(69, 'udp', 'open') or > shortport.portnumber(69, 'udp', 'open|filtered') > end yes you could do that but it is inelegant and i have already fixed the issue ;) cheers, Diman _______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://SecLists.Org

Next Message by Date: click to view message preview

[NSE] robots

Hey all, committed a new script that downloads a http server's robots.txt file and displays all disallowed entries eddie@tesla ~/nmap> ./nmap -sT -p80 --script=./scripts/robots.nse nytimes.com Interesting ports on 199.239.136.245: PORT STATE SERVICE 80/tcp open http | robots.txt: /pages/college/ /library/ /aponline/ /cnet/ |_ /archives/ /thestreet/ /financialtimes/ cheers - eddie _______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://SecLists.Org

Previous Message by Thread: click to view message preview

Re: shortport function

On 12.07.2007, at 12:45, Eddie Bell wrote: > You could do something like this: > > portrule = function() > return shortport.portnumber(69, 'udp', 'open') or > shortport.portnumber(69, 'udp', 'open|filtered') > end yes you could do that but it is inelegant and i have already fixed the issue ;) cheers, Diman _______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://SecLists.Org

Next Message by Thread: click to view message preview

Re: Fwd: shortport function

Diman Todorov wrote: > >> From: Diman Todorov <diman.todorov@xxxxxxxxxxxx> >> Date: 12. Juli 2007 12:52:03 GMT+02:00 >> To: Nmap Dev <nmap-dev@xxxxxxxxxxxx> >> Subject: Re: shortport function >> >> >> >> yes, this is true. The shortport.portnumber doesn't take a table >> for the port state, only a string. I commited a fix for that to the >> soc07 svn (svn://diman@xxxxxxxxxxxxxxxx/nmap-exp/soc07/). The only >> parameter which doesn't take a table now is the protocol. I will >> leave it that way until someone comes up with a scenario in which >> you don't care if the open port is a tcp or udp port ;) >> >> > Thanks Eddie and Diman, I've seen that line form the MSSQL.nse script 'portrule = shortport.portnumber({1433, 1434}, "udp", {"open", "open|filtered"})' and started a little testing. So, in the end I tried to port the function a bit, maybe not that good and not needed, I'll update to just committed changes.. My experiment, just like you did with the port: local state_table; if(type(_state) == "string") then state_table = {_state, "open"} elseif(type(_state) == "table") then state_table = _state" elseif(type(_state) == "nil") then state_table = {"open"} end return function(host, port) if(port.protocol == proto) then for _, _s in ipairs(state_table) do if(port.state == _s) then for _, _port in ipairs(port_table) do if(port.number == _port) then return true end end end end end return false end end _______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://SecLists.Org
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by