{"id":40,"date":"2008-01-22T00:52:00","date_gmt":"2008-01-22T05:52:00","guid":{"rendered":"http:\/\/www.rajatswarup.com\/blog\/?p=40"},"modified":"2010-02-10T23:47:34","modified_gmt":"2010-02-11T04:47:34","slug":"smbproxy-compilation-issues","status":"publish","type":"post","link":"https:\/\/www.rajatswarup.com\/blog\/2008\/01\/22\/smbproxy-compilation-issues\/","title":{"rendered":"SMBProxy Compilation issues"},"content":{"rendered":"<p>So the other day I was on a pen test and I got hold of the hashes.  Since my laptop got fried I needed a new version of <a href=\"http:\/\/www.cqure.net\/wp\/?page_id=11\">SMBProxy<\/a>.  There were a few issues that I had with the compilation though.  I got a few errors in the file crypto.c.<br \/>Moreover, SMBProxy ues crypto library libdes written by Eric Young available <a href=\"http:\/\/public.www.planetmirror.com\/pub\/ssleay\/DES\/libdes-4.01.tar.gz\">here<\/a>.<br \/>I give here a guide to compiling SMBProxy that worked for me.<\/p>\n<p>First, compile and install libdes<\/p>\n<ol>\n<li>Download <a href=\"http:\/\/public.www.planetmirror.com\/pub\/ssleay\/DES\/libdes-4.01.tar.gz\">libdes 4.01<\/a><\/li>\n<li style=\"font-family: courier new; font-weight: bold; font-style: italic; color: rgb(51, 204, 0);\"><span style=\"font-size:85%;\">tar zxvf libdes-4.01.tar.gz<\/span><\/li>\n<li style=\"font-family: courier new; font-weight: bold; font-style: italic; color: rgb(51, 204, 0);\"><span style=\"font-size:85%;\">cd libdes<\/span><\/li>\n<li style=\"font-family: courier new; font-weight: bold; font-style: italic; color: rgb(51, 204, 0);\"><span style=\"font-size:85%;\">make gcc<\/span><\/li>\n<li style=\"font-family: courier new; font-weight: bold; font-style: italic; color: rgb(51, 204, 0);\"><span style=\"font-size:85%;\">sudo make install<\/span><\/li>\n<\/ol>\n<p>Now, you&#8217;ll find that the file libdes.a is now in \/usr\/local\/lib.<br \/>Second, compile and install SMBProxy.  Now here there were a couple of compilation errors that I had to deal with.<br \/>Here&#8217;s the diff output for crypto.c<\/p>\n<p><span style=\"font-style: italic;\"><span style=\"font-weight: bold; color: rgb(0, 153, 0);font-size:85%;\" >trance@z0n3:~\/Desktop$ diff smbproxy\/crypto.c smbproxy-orig-src\/crypto.c<\/span><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold; color: rgb(0, 153, 0);font-size:85%;\" >40,41c40<\/span><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold; color: rgb(0, 153, 0);font-size:85%;\" >< #include <\/span><openssl h=\"\"><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold; color: rgb(0, 153, 0);font-size:85%;\" >< #define MD4_SIGNATURE_SIZE 16 --- ><\/span><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold; color: rgb(0, 153, 0);font-size:85%;\" >46c45<\/span><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold; color: rgb(0, 153, 0);font-size:85%;\" ><> static u_char Get7Bits(UCHAR *input, int startBit) {<\/span><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold; color: rgb(0, 153, 0);font-size:85%;\" >58c57<\/span><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold; color: rgb(0, 153, 0);font-size:85%;\" ><> static void MakeKey(UCHAR *key, UCHAR *des_key) {<\/span><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold; color: rgb(0, 153, 0);font-size:85%;\" >74c73<\/span><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold; color: rgb(0, 153, 0);font-size:85%;\" ><> void DesEncrypt(UCHAR *clear, UCHAR *key, UCHAR *cipher) {<\/span><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold; color: rgb(0, 153, 0);font-size:85%;\" >85c84<\/span><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold; color: rgb(0, 153, 0);font-size:85%;\" ><> void mkResponse(UCHAR **ntlmhash, UCHAR hash[MD4_SIGNATURE_SIZE], UCHAR* challenge) {<\/span><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold; color: rgb(0, 153, 0);font-size:85%;\" >88c87<\/span><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold; color: rgb(0, 153, 0);font-size:85%;\" ><>   UCHAR               ntlm_response[24];<\/span><br \/><\/openssl><\/span><\/p>\n<p>Having done this there were still a few issues with the make comand.<br \/>The Makefile can be generated by running the following command:<\/p>\n<p><span style=\"font-weight: bold; font-style: italic; color: rgb(0, 153, 0);font-size:85%;\" >trance@z0n3:~\/Desktop\/smbproxy-orig-src$ .\/configure<\/span><span style=\"font-size:85%;\"><br \/><\/span><br \/>Here&#8217;s the diff output of the Makefile:<\/p>\n<p><span style=\"font-weight: bold; font-style: italic; color: rgb(0, 153, 0);font-size:85%;\" >trance@z0n3:~\/Desktop$ diff smbproxy\/Makefile smbproxy-orig-src\/Makefile<\/span><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold; font-style: italic; color: rgb(0, 153, 0);font-size:85%;\" >10,11c10,11<\/span><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold;\"><span style=\"font-style: italic; color: rgb(0, 153, 0);font-size:85%;\" >< smbbf_include =\" -Iinclude\"><\/span><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold;\"><span style=\"font-style: italic;\"><span style=\"color: rgb(0, 153, 0);font-size:85%;\" >< libs =\"\"><br \/><\/span><span style=\"font-weight: bold; font-style: italic; color: rgb(0, 153, 0);font-size:85%;\" >&#8212;<\/span><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold; font-style: italic; color: rgb(0, 153, 0);font-size:85%;\" >> SMBBF_INCLUDE = -Iinclude<\/span><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold; font-style: italic; color: rgb(0, 153, 0);font-size:85%;\" >> LIBS = des<\/span><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold; font-style: italic; color: rgb(0, 153, 0);font-size:85%;\" >31c31<\/span><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold; font-style: italic; color: rgb(0, 153, 0);font-size:85%;\" ><       $(LIBDES) $(LIBS)<\/span><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold; font-style: italic; color: rgb(0, 153, 0);font-size:85%;\" >&#8212;<\/span><span style=\"color: rgb(0, 153, 0);font-size:85%;\" ><br \/><\/span><span style=\"font-weight: bold; font-style: italic; color: rgb(0, 153, 0);font-size:85%;\" >>       $(LIBDES)<\/span><\/p>\n<p><\/span><\/span><\/span><span><span><span>The following libraries are required:  openssl, openssl-dev, libdes for successfully compiling SMBProxy.<\/p>\n<p><span style=\"font-weight: bold; font-style: italic; color: rgb(0, 153, 0);font-size:85%;\" >apt-get install openssl openssl-dev<\/span><br \/><\/span><\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>So the other day I was on a pen test and I got hold of the hashes. Since my laptop got fried I needed a new version of SMBProxy. There were a few issues that I had with the compilation though. I got a few errors in the file crypto.c.Moreover, SMBProxy ues crypto library libdes [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[230,197],"tags":[221,306,307,305,308],"class_list":["post-40","post","type-post","status-publish","format-standard","hentry","category-howto","category-tools","tag-metasploit","tag-samba","tag-sambatng","tag-smb","tag-smbproxy"],"_links":{"self":[{"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/posts\/40","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/comments?post=40"}],"version-history":[{"count":1,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/posts\/40\/revisions"}],"predecessor-version":[{"id":131,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/posts\/40\/revisions\/131"}],"wp:attachment":[{"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/media?parent=40"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/categories?post=40"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/tags?post=40"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}