DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2009-05-08 10:25:17

metal450
Member
Registered: 2009-05-02
Posts: 29

PopTop, PPPD, and LibCrypt

Hey all,

I've been trying without success to get PopTop running on my DNS321 (ffp), and would love any wisdom you might have to offer...

After downloading and building PopTop itself (which worked fine), I grabbed pppd (which poptop requires) from here: http://www.samba.org/ppp/  However, when building I got the error "undefined reference to `crypt'".

After some googling, I THINK that means I need LibgCrypt.  Which I then downloaded, compiled, and installed from here: http://www.gnupg.org/download/index.en.html.  Now my ffp/include directory contains crypt.h, and ffp/lib has libcrypt.a (among others), as expected.

Yet, I'm still getting the same "undefined reference to `crypt'" error when building pppd.

I thought perhaps that the problem was uclibc needing to be built with crypt support, but I had little success down that path either (couldn't get uclibc to build).

Any tips would be greatly appreciated...I've spent way too long pulling my hair out over this one smile

Offline

 

#2 2009-05-10 20:53:22

metal450
Member
Registered: 2009-05-02
Posts: 29

Re: PopTop, PPPD, and LibCrypt

Nobody has ANY idea how I could get pppd on my fffp'ed device...?

Offline

 

#3 2009-05-11 03:50:37

Electrocut
Member
From: France
Registered: 2009-04-05
Posts: 195

Re: PopTop, PPPD, and LibCrypt

I succeffuly built ppp-2.4.3 on my DNS-313

As far as I know, it was a linking problem with libgcrypt

So I modified pppd/Makefile this way:

Makefile

Code:

[...]

# CC = gcc
#
COPTS = -O2 -pipe -Wall -g
LIBS =

#ADDED BY ME !
LIBS += -lcrypt

# Uncomment the next 2 lines to include support for Microsoft's
# MS-CHAP authentication protocol.  Also, edit plugins/radius/Makefile.linux.
CHAPMS=y
USE_CRYPT=y
# Don't use MSLANMAN unless you really know what you're doing.
#MSLANMAN=y
# Uncomment the next line to include support for MPPE.  CHAPMS (above) must
# also be enabled.  Also, edit plugins/radius/Makefile.linux.
MPPE=y

[...]

If you haven't already done, I think you will also need to build "ppp_async.ko" and "ppp_generic.ko" kernel modules, from kernel source ... in order to use pppd.

But even with all this things, I still have little problems to run pptpd (which also depends on ppp)  on my DNS-313 Device (for Native Windows VPN) ...

Last edited by Electrocut (2009-05-11 09:32:24)


DNS-313

Offline

 

#4 2009-05-12 20:30:28

Electrocut
Member
From: France
Registered: 2009-04-05
Posts: 195

Re: PopTop, PPPD, and LibCrypt

Any feedback ?

Did you manage to get pppd working ?


DNS-313

Offline

 

#5 2009-05-12 22:16:22

metal450
Member
Registered: 2009-05-02
Posts: 29

Re: PopTop, PPPD, and LibCrypt

Hey Electrocut,

Thanx a TON for the tip...that did indeed get it to compile big_smile  Sorry for taking so long to reply,  i've actually been away from home for about a week and outside my router which wasn't setup to forward the necessary VPN ports/protocols - so I wasn't able to test. 

Just got home today, will see what I can figure out & report back smile

Offline

 

#6 2009-05-13 00:12:42

Electrocut
Member
From: France
Registered: 2009-04-05
Posts: 195

Re: PopTop, PPPD, and LibCrypt

Thanks for the feedback !

We must be at the same step right now.

My tries to get pptpd VPN server (pppd + pptpd) to work:
- build ppp-2.4.3 from source -> OK
- build pptpd-1.3.4 from source -> OK
- build slhc.ko, ppp_generic.ko, ppp_async.ko kernel modules from source -> OK

Connection try, from Windows XP native pptp client :

Code:

May 12 21:11:09 terabox daemon.info pptpd[4195]: MGR: Maximum of 100 connections reduced to 6, not enough IP addresses given
May 12 21:11:09 terabox daemon.info pptpd[4197]: MGR: Manager process started
May 12 21:11:09 terabox daemon.info pptpd[4197]: MGR: Maximum of 6 connections available
May 12 21:11:15 terabox daemon.info pptpd[4198]: CTRL: Client 10.10.10.5 control connection started
May 12 21:11:15 terabox daemon.info pptpd[4198]: CTRL: Starting call (launching pppd, opening GRE)
May 12 21:11:15 terabox daemon.info pppd[4199]: Plugin /usr/lib/pptpd/pptpd-logwtmp.so loaded.
May 12 21:11:15 terabox daemon.notice pppd[4199]: pppd 2.4.3 started by root, uid 0
May 12 21:11:16 terabox daemon.info pppd[4199]: Using interface ppp0
May 12 21:11:16 terabox daemon.notice pppd[4199]: Connect: ppp0 <--> /dev/pts/7
May 12 21:11:19 terabox daemon.err pptpd[4198]: CTRL: Ignored a SET LINK INFO packet with real ACCMs!
May 12 21:11:19 terabox daemon.err pppd[4199]: MPPE required, but kernel has no support.
May 12 21:11:19 terabox daemon.notice pppd[4199]: Connection terminated.
May 12 21:11:19 terabox daemon.info pppd[4199]: Connect time 0.1 minutes.
May 12 21:11:19 terabox daemon.info pppd[4199]: Sent 0 bytes, received 0 bytes.

So now I must be missing MPPE kernel module (ppp_mppe.ko ?)

The problem:

- I can't find MPPE support in "make menuconfig", from dlink DNS-313 kernel source provided my Dlink
- I can find MPPE support option, in official kernel 2.6.15 source (downloaded from kernel.org), but then ... I can't compile the module ...

make modules

Code:

[...]
include/asm/locks.h:15:5: warning: "__LINUX_ARM_ARCH__" is not defined
In file included from include/asm/page.h:27,
                 from include/linux/sched.h:21,
                 from arch/arm/kernel/asm-offsets.c:13:
include/asm/glue.h:111:2: #error Unknown data abort handler type
In file included from include/linux/sched.h:21,
                 from arch/arm/kernel/asm-offsets.c:13:
include/asm/page.h:92:2: #error Unknown user operations model
In file included from include/linux/sched.h:23,
                 from arch/arm/kernel/asm-offsets.c:13:
include/asm/mmu.h:5:5: warning: "__LINUX_ARM_ARCH__" is not defined
include/asm/mmu.h:10:5: warning: "__LINUX_ARM_ARCH__" is not defined
arch/arm/kernel/asm-offsets.c:87:5: warning: "__LINUX_ARM_ARCH__" is not defined
make[1]: *** [arch/arm/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2

DNS-313

Offline

 

#7 2009-05-13 01:15:45

metal450
Member
Registered: 2009-05-02
Posts: 29

Re: PopTop, PPPD, and LibCrypt

Damn, that sucks...I just tried mine out, and it worked right out of the box, with require-mschap-v2 and require-mppe-128 both enabled!

What kernel version is your device running?  Mine is 2.6.22.7, and according to here: http://poptop.sourceforge.net/dox/redhat-howto.phtml, it seems that only 2.6.15-rc1 and below require MPPE to be specifically added.

I didn't have to build slhc.ko, ppp_generic.ko, ppp_async.ko either...

Offline

 

#8 2009-05-13 01:59:40

Electrocut
Member
From: France
Registered: 2009-04-05
Posts: 195

Re: PopTop, PPPD, and LibCrypt

Wow ! So with DNS-323 / 321, ppp is already included in the kernel ? You are so lucky !!

DNS-313 is running kernel 2.6.15:

root@terabox:/# uname -a
Linux terabox 2.6.15 #235 Sun Dec 7 14:20:05 EST 2008 armv4l unknown

Yes, you are right, I read on the internet that MPPE is supposed to be available in kernel source from 2.6.15 ...
I can see the files ppp_mppe.c and .h, but can't enable the module in dlink kernel config ...

Dlink may have patched its kernel source (downloaded from there), so that it is not possible to enable this module anymore ?

I'm trying to force ppp_mppe.ko kernel module building, by directly editing autoconf.h, after running "make menuconfig" (not the casual way, I agree)

Let's see what happens ...


DNS-313

Offline

 

#9 2009-05-13 02:08:54

Electrocut
Member
From: France
Registered: 2009-04-05
Posts: 195

Re: PopTop, PPPD, and LibCrypt

Got my ppp_mppe.ko kernel module ...

but now, when I try to load it, I'm still missing another kernel module ... GRR

Code:

root@terabox:/# logread -f
May 13 01:07:03 terabox user.warn kernel: ppp_mppe: Unknown symbol crypto_alloc_tfm
May 13 01:07:03 terabox user.warn kernel: ppp_mppe: Unknown symbol crypto_alg_available
May 13 01:07:03 terabox user.warn kernel: ppp_mppe: Unknown symbol crypto_free_tfm

The good thing is: as with the DNS-313, I need to build everything by myself, I'm will also improve my (from now) poor linux skills lol

Last edited by Electrocut (2009-05-13 02:25:36)


DNS-313

Offline

 

#10 2009-05-13 02:38:49

talkingRock
Member
Registered: 2009-03-26
Posts: 100

Re: PopTop, PPPD, and LibCrypt

Just curious, what are you using ppp to do?
The last time I used it was to get ethernet over a shell account. 
I'm sure it's come a long way since then?

Offline

 

#11 2009-05-13 03:07:16

Electrocut
Member
From: France
Registered: 2009-04-05
Posts: 195

Re: PopTop, PPPD, and LibCrypt

I'm just using ppp for the same things as you do:
using it PopTop (pptpd) as VPN PPTP Server ...

But the DNS-313 Kernel seems to be missing many many options ... usually set by default.

All theses options (Crypt, MPPE, PPP Kernel support ...) seems to be already integrated in your kernel version ... not mine sad

I still don't understand why I can't load ppp_mppe.ko.
I'm afraid that the kernel was built without crypt support ... (same error, when I try to load md5.ko, aes.ko etc ...)

Maybe I will try more tomorrow ...

Last edited by Electrocut (2009-05-13 03:07:58)


DNS-313

Offline

 

#12 2009-05-13 05:30:52

metal450
Member
Registered: 2009-05-02
Posts: 29

Re: PopTop, PPPD, and LibCrypt

Another option you might try: when i had to compile the tun.ko module; i did so from the kernel source direct from kernel.org.  You could try downloading the same kernel version and just compiling that one module from there with "make modules"

Offline

 

#13 2009-05-13 07:01:14

metal450
Member
Registered: 2009-05-02
Posts: 29

Re: PopTop, PPPD, and LibCrypt

Offline

 

#14 2009-05-13 18:00:48

Electrocut
Member
From: France
Registered: 2009-04-05
Posts: 195

Re: PopTop, PPPD, and LibCrypt

metal450 wrote:

Another option you might try: when i had to compile the tun.ko module; i did so from the kernel source direct from kernel.org.  You could try downloading the same kernel version and just compiling that one module from there with "make modules"

According to this topic, 2.6.15 kernel source from kernel.org can't be used, for DNS-313, because the DNS-313 kernel is based on a patch from Storlink which is not integrated into the linux kernel mainline.

That explains why I couldn't built ppp-mppe.ko kernel module from source downloaded from kernel.org. Cf 5 posts earlier :

- I can find MPPE support option, in official kernel 2.6.15 source (downloaded from kernel.org), but then ... I can't compile the module ...

My kernel must be missing crypt support, so I'm not able to load ppp-mppe.ko. As crypt support can not be built as module, I should build and install a new kernel on the DNS-313.

But I was wondering something:

How did you build ppp ? Which version ? Which configure arguments ?

Because maybe your pppd program doesn't depends on ppp / mppe kernel support, as mine does ...
But it is more likely, that your pppd program depends on ppp and mppe kernel features, already integrated in your kernel version ... (I don't know which linux command can tell us if your kernel as ppp support ...)

Last edited by Electrocut (2009-05-13 18:29:20)


DNS-313

Offline

 

#15 2009-05-13 19:07:56

metal450
Member
Registered: 2009-05-02
Posts: 29

Re: PopTop, PPPD, and LibCrypt

My PPP is 2.4.4, from http://www.samba.org/ppp...

Offline

 

#16 2009-05-13 23:01:48

Electrocut
Member
From: France
Registered: 2009-04-05
Posts: 195

Re: PopTop, PPPD, and LibCrypt

Ok

Definitively, Dlink DNS-313 Kernel must be lacking crypt support.

So, the only way to make pptpd + ppp (for PPTP VPN), or xl2tpd + openswan + ppp (for IPSEC/L2TP VPN) working on the DNS-313 ... will be to replace default kernel with a new one.

Maybe I will try later ... just to know,

But for now, I will keep OpenVPN as VPN Server. (OpenVPN hopefully doesn't depends on cryptographic kernel features)


DNS-313

Offline

 

#17 2009-05-13 23:03:36

metal450
Member
Registered: 2009-05-02
Posts: 29

Re: PopTop, PPPD, and LibCrypt

That sux tongue

I built OpenVPN first, before I knew about PopTop.  It took me awhile to get the latter working, but it's worth it to not have to deal with installing client software on every windows machine as well smile

Offline

 

#18 2009-05-17 05:51:37

metal450
Member
Registered: 2009-05-02
Posts: 29

Re: PopTop, PPPD, and LibCrypt

Did you ever figure out how to do this?

I have my VPN up and running "sort of" - the remaining problem is that I need to use iptables to set it up such that I can access the other machines on my network, as well as the Internet itself (through the VPN).  But I *think* I can't add iptables without a fully rebuilt kernel (there doesn't seem to be a way to just insmod ip_tables - it always fails due to unresolved dependencies).

Do you know if this is true - or if there's some other way to achieve my desired behavior?  If not, any pointers on how I could tackle this...?  ONLY being able to access the NAS itself wasn't really what I was after...

Thx again!

Offline

 

#19 2009-05-17 19:01:17

Electrocut
Member
From: France
Registered: 2009-04-05
Posts: 195

Re: PopTop, PPPD, and LibCrypt

Hi ! I think all you need is to enable "routing", on your DNS Linux Box, so requests sent to the other devices on the remote network will be forwarded.

"echo 1 > /proc/sys/net/ipv4/ip_forward"

should be enough.


DNS-313

Offline

 

#20 2009-05-17 20:04:54

metal450
Member
Registered: 2009-05-02
Posts: 29

Re: PopTop, PPPD, and LibCrypt

Whoa, you're right!! In fact, by doing that I'm able to access other network shares as well as PING websites.  However, I although I can ping websites, for some reason I'm not able to actually access them.  Also, I can't access any shares by name - only by IP (including the NAS box itself, so obviously this is a different problem...).

The reason I thought I needed iptables was based on what I read in this article:

http://www.aminehaddad.com/2008/11/09/h … r-on-linux (see Step 6)

One thing I noticed for Checkpoint 1.  When I run ifconfig, I get:

inet addr:192.168.0.235  P-t-P:192.168.1.235  Mask:255.255.255.255

I'm able to ping 192.168.0.235 from the server, but not 192.168.1.235.  Could this be a problem...?

If not, any ideas on why I can't get to the 'net, and to other PC's by name?

Thanx so much again for ur tip...probably saved me immeasurable hassle big_smile

Offline

 

#21 2009-05-17 20:38:27

metal450
Member
Registered: 2009-05-02
Posts: 29

Re: PopTop, PPPD, and LibCrypt

Update: I got name resolution working by entering the IP of an internal windows client (i.e. "ms-wins 192.168.1.3") in ppp/options.pptp.  Still, however, I cannot access websites.  I can ping them by URL thru VPN (yep I remembered to ipconfig /flushdns on the client PC first), so I would infer that my ms-dns setting is correct on the VPN server (it's the IP of my router).  But when I try to visit them in a web browser, I just get an indefinite "waiting for www.google.com..."

Offline

 

#22 2009-05-17 20:59:25

Electrocut
Member
From: France
Registered: 2009-04-05
Posts: 195

Re: PopTop, PPPD, and LibCrypt

Could you make a picture, that illustrates your network configuration ? I'm a little lost with all your network addresses ... :s

For the DNS resolution (websites etc..), you should check:

> on the DNS-323 side:
- that in /etc/ppp/options.pptpd, "ms-dns" value in pointing on the Default Internet Getway

> on the PPTP Windows client side:
- that ipconfig /all shows the address defined as "ms-dns" before, as DNS server, for the current dialup connection
- that you can PING the address defined as "ms-dns" before

Then, you can try to install Wireshark on the Windows client, to sniff what is going on about DNS resolution, inside the VPN.

Last edited by Electrocut (2009-05-17 21:00:06)


DNS-313

Offline

 

#23 2009-05-17 21:35:39

metal450
Member
Registered: 2009-05-02
Posts: 29

Re: PopTop, PPPD, and LibCrypt

It's just a simple network with the router (gateway) at 192.168.1.1.  The NAS box is 192.168.1.4, and there are some other static clients 192.168.1.2, 192.168.1.3, 192.168.1.5, ...

There's also a DHCP pool 192.168.1.100-200 for wifi clients.

in options.pptpd, ms-wins is 192.168.1.2 and 192.168.1.3 (always-on windows clients), which does allow me to access windows machines by name through the VPN.

in options.pptpd, ms-dns is 192.168.1.1, the gateway, which does allow me to ping www.google.com from vpn clients after flushing the dns - so dns resolutin must be working.  ipconfig /all confirms that it's getting this address as the dns server.  For some reason, though, I just can't visit websites in the browser of the client.

However, I think that the problem MAY be unrelated.  In order to test everything, i'm tethering a laptop to my cellphone and using its 3g connection to connect to the vpn from an IP completely outside the network.  It's possible that something stupid is going on here...so I'll put this on hold for a couple days and try it out from an "actual" internet connection at a remote location early next week.  Hopefully it's already working, and my cellphone is the real cause of the problem smile

Offline

 

#24 2009-05-17 21:56:53

Electrocut
Member
From: France
Registered: 2009-04-05
Posts: 195

Re: PopTop, PPPD, and LibCrypt

Yes, as you said, it's strange. As you can PING google.fr after flushing local DNS cache, surfing on the web throw the VPN shouldn't be a problem.

Maybe some (not disabled) proxy settings, or "automatic proxy detection", on your client Browser ?


By the way, sometimes 3G providers are blocking PPTP traffic, but as your VPN is establishing correctly, it doesn't seem to be the case.


DNS-313

Offline

 

#25 2009-05-17 22:06:53

metal450
Member
Registered: 2009-05-02
Posts: 29

Re: PopTop, PPPD, and LibCrypt

Yep...in any case, thanx so much for the tip (u saved me so much time trying to get that iptables stuff working - i wonder why that site, and several others, said they were necessary??)

I'll try it from outside as soon as I get the chance smile

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB