Pothuri Vijay Varma
2005-Dec-20 09:37 UTC
[Samba] Remote Command Execution using jarapac,jcifs.etc.
Hi, I need to install windows services remotely from linux. Given that the windows server is running with minimum credentials. On reading hte previous mails, I found that it is possible using jarapac, midlc, jcifs etc. So I started with jcifs. I am able to transfer a file(service) from linux to windows using jcifs API. Now I want to start that service. First I tried with installing midlc compiler. But it's giving the error. I have installed libmba, but it's not installing library files in "/usr/local/lib" and installing header files in "/usr/local/lib". And when I try to install midlc, I'm getting following error. gcc -Wall -W -g -O2 -DMSGNO -D_XOPEN_SOURCE=500 -D_DATADIR=\"/usr/local/share/mi dlc\" src/emit_stub_samba.o src/emit_hdr_c.o src/emit_svr_stub_c.o src/emit_svr_ dec_c.o src/emit_svr_enc_c.o src/emit_enc_java.o src/emit_dec_java.o src/emit_st ub_java.o src/preproc.o src/parse.o src/sym.o src/tok.o -lmba -o midlc src/midlc.c src/midlc.c: In function `main': src/midlc.c:394: warning: implicit declaration of function `MSG' /usr/bin/ld: cannot find -lmba collect2: ld returned 1 exit status make: *** [midlc] Error 1 And I read Michael Melham mails, so I started with svcctl.java and TestCntrl.java. I compiled both the files successfully. And I am trying to execute TestCntrl using following command. "java -classpath jarapac.jar:ncacn_np.jar:ntlm-security.jar:lib/jcifs-1.1.2.jar:. TestCntrl 229.227.153.158 example.properties" I am getting following error. : retval00000000-0000-0000-0000-000000000000 00000: B2 97 68 01 11 00 00 00 00 00 00 00 11 00 00 00 |?.h.............| 00010: 5C 00 5C 00 31 00 32 00 39 00 2E 00 32 00 32 00 |\.\.1.2.9...2.2.| 00020: 37 00 2E 00 31 00 35 00 33 00 2E 00 35 00 38 00 |7...1.5.3...5.8.| 00030: 00 00 00 00 00 00 00 00 3F 00 0F 00 |........?... | Exception in thread "main" jcifs.smb.SmbException: No process is on the other end of the pipe. at jcifs.smb.SmbTransport.sendTransaction(SmbTransport.java:869) at jcifs.smb.SmbSession.sendTransaction(SmbSession.java:219) at jcifs.smb.SmbTree.sendTransaction(SmbTree.java:74) at jcifs.smb.SmbFile.sendTransaction(SmbFile.java:688) at jcifs.smb.TransactNamedPipeOutputStream.write( TransactNamedPipeOutputStream.java:65) at jcifs.smb.RpcTransport.send(RpcTransport.java:107) at rpc.DefaultConnection.transmitFragment(DefaultConnection.java :107) at rpc.DefaultConnection.transmit(DefaultConnection.java:57) at rpc.ConnectionOrientedEndpoint.send( ConnectionOrientedEndpoint.java:140) at rpc.ConnectionOrientedEndpoint.call( ConnectionOrientedEndpoint.java:86) at rpc.Stub.call(Stub.java:113) at TestCntrl.doOpenSCManagerW(TestCntrl.java:28) at TestCntrl.main(TestCntrl.java:61) Seems login is successfull, if I change login, then it's giving wrong username/password. Any help would be much appreciated. Thanks in Advance, Varma
Pothuri Vijay Varma
2005-Dec-21 06:11 UTC
[Samba] Remote Command Execution using jarapac,jcifs.etc.
Hi, Little update from my last post. MIDLC is working fine for me. I generated the stub atsvc.java using midlc. Then I compiled TestAtsvc.java. And I am trying to execute TestAtsvc using following command. "java -classpath jarapac.jar:ncacn_np.jar:ntlm-security.jar:lib/jcifs-1.1.2.jar:. TestAtsvc 229.227.153.158 example.properties" I am getting following error. 00000: 55 13 C5 00 10 00 00 00 00 00 00 00 10 00 00 00 |U.?.............| 00010: 5C 00 5C 00 31 00 32 00 39 00 2E 00 32 00 32 00 |\.\.1.2.9...2.2.| 00020: 37 00 2E 00 31 00 35 00 38 00 2E 00 38 00 00 00 |7...1.5.8...8...| Exception in thread "main" jcifs.smb.SmbException: No process is on the other end of the pipe. at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:503) at jcifs.smb.SmbTransport.send(SmbTransport.java:580) at jcifs.smb.SmbSession.send(SmbSession.java:229) at jcifs.smb.SmbTree.send(SmbTree.java:102) at jcifs.smb.SmbFile.send(SmbFile.java:688) at jcifs.smb.TransactNamedPipeOutputStream.write( TransactNamedPipeOutputStream.java:65) at jcifs.smb.RpcTransport.send(RpcTransport.java:107) at rpc.DefaultConnection.transmitFragment(DefaultConnection.java :107) at rpc.DefaultConnection.transmit(DefaultConnection.java:57) at rpc.ConnectionOrientedEndpoint.send( ConnectionOrientedEndpoint.java:140) at rpc.ConnectionOrientedEndpoint.call( ConnectionOrientedEndpoint.java:86) at rpc.Stub.call(Stub.java:113) at TestSrvsvc.doRemoteTOD(TestSrvsvc.java:47) at TestAtsvc.atsvcScheduleJobAdd(TestAtsvc.java:21) at TestAtsvc.main(TestAtsvc.java:73) Seems login is successfull, if I change login, then it's giving wrong username/password. Any help would be much appreciated. Thanks in Advance, Varma