OpenWrt Forum Archive

Topic: install netsed

The content of this topic has been archived on 1 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Please pardon my ignorance as im a newbie.

I would like to install netsed  how do I go about doing that? I cant find and ipk file.

Thanks

Install SDK on linux x64 system and compile yourself. No other option.  Creating packages howto

(Last edited by bolvan on 29 Oct 2016, 08:48)

If someone could compile for me, I would greatly appreciate it. I have not had success trying to do it my self.
thanks

stern0m1 wrote:

If someone could compile for me, I would greatly appreciate it. I have not had success trying to do it my self.
thanks

Then you have to specify arch and openwrt ver

(Last edited by bolvan on 30 Oct 2016, 08:07)

I would like to use netsed on a dlink dir-860l which has the MIPS32 arch Im using  OpenWrt Chaos Calmer 15.05.1.

Thanks

Here is your binarie  https://www.sendspace.com/file/f45xm3
I compiled it as MIPS32 LSB rel 1  so it would run on all MIPS32 LSB devices with openwrt <=CC. It will not run on DD+.

(Last edited by bolvan on 30 Oct 2016, 14:15)

Got it working! thanks!

bolvan wrote:

Here is your binarie  https://www.sendspace.com/file/f45xm3
I compiled it as MIPS32 LSB rel 1  so it would run on all MIPS32 LSB devices with openwrt <=CC. It will not run on DD+.

Why not submit makefile/package to LEDE repo?

bolvan:

What am i doing wrong?


I tried like this:
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 10000

netsed tcp 10000 0 0 s/Hello/bbbbb

but this is what i get:

root@OpenWrt:~# /root/netsed tcp 10000 0 0 s/Hello/bbbbb
netsed 1.00b by Julien VdG <julien@silicone.homelinux.org>
      based on 0.01c from Michal Zalewski <lcamtuf@ids.pl>
Parsing rule s/Hello/bbbbb...
[+] Loaded 1 rule...
getaddrinfo(): Name or service not known
[-] Error: Impossible to resolve remote address or port.
netsed: exiting.

What am i doing wrong?

Thanks

I compiled newer ver 1.2 https://www.sendspace.com/file/mp23sx . But the error is the same.
I looked into the code and found the following code at the very beginning of main() :

  if ((ret = getaddrinfo(rhost, rport, &hints, &reslist))) {
    ERR("getaddrinfo(): %s\n", gai_strerror(ret));
    error("Impossible to resolve remote address or port.");
  }

rhost and rport are char*  of what you specify as 3rd and 4th parameters (host,port).
looks like on traditional linux getaddrinfo accepts "0" as host but openwrt does not.
what the difference ? Openwrt use different libc which cant take that. Glibc interprets 0 as "0.0.0.0", meaning of "0" must be decimal form of IP address without dots, in this case zero address which means "any ip" or "all ips on the host".
So, on other libc dont specify "0" but full "0.0.0.0" instead

netsed tcp 10000 0.0.0.0 0 s/Hello/bbbbb

(Last edited by bolvan on 31 Oct 2016, 14:07)

Thanks a lot, that works. I spent so many hours but couldn't figure it out....

My  goal is build on netsed to  filter images in real time based on the actual content of the images. I want to create a router based content filter that filters pornographic images. There many filters available that filter based on key words and ip addresses but that only really works on straight porn but there  is a lot of images on regular web sites that are not porn in the strict sense but are pornographic in nature. You have naked pictures or cladly dressed...

How do you filter images based on their content with simple regexp replacer ?

bolvan wrote:
stern0m1 wrote:

If someone could compile for me, I would greatly appreciate it. I have not had success trying to do it my self.
thanks

Then you have to specify arch and openwrt ver

Hey Bolvan,

if you have a minute I would greatly appreciate it you could compile netsed for my router.

I am using the tl-wr841nd v7 (MIPS?) and OpenWrt Chaos Calmer 15.05.1

I tried to use the binary posted by you but I only get

./netsed: line 1: syntax error: unexpected "("

So I guess they differ at some point.

hamba wrote:

I tried to use the binary posted by you but I only get
./netsed: line 1: syntax error: unexpected "("
So I guess they differ at some point.

tplink is ar71xx which is MIPS32r2 big-endian
I compiled for rampis which is little endian.

https://www.sendspace.com/file/somvqr

bolvan wrote:
hamba wrote:

I tried to use the binary posted by you but I only get
./netsed: line 1: syntax error: unexpected "("
So I guess they differ at some point.

tplink is ar71xx which is MIPS32r2 big-endian
I compiled for rampis which is little endian.

Oh you replied !

Thanks a ton man , and it seems to work too smile

Alright it worked , again thanks a lot - saved my day.

bolvan wrote:

tplink is ar71xx which is MIPS32r2 big-endian
I compiled for rampis which is little endian.

Can you upload this one again? Need it too. Thanks!

The discussion might have continued from here.