smbmap.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:pentestly 作者: praetorian-inc 项目源码 文件源码
def upload_file(self, host, src, dst): 
        dst = string.replace(dst,'/','\\')
        dst = ntpath.normpath(dst)
        dst = dst.split('\\')
        share = dst[0]
        dst = '\\'.join(dst[1:])
        if os.path.exists(src):
            color('[+] Starting upload: %s (%s bytes)' % (src, os.path.getsize(src)))
            upFile = open(src, 'rb')
            try:
                self.smbconn[host].putFile(share, dst, upFile.read)
                color('[+] Upload complete' )
            except Exception as e:
                color('[!]', e)
                color('[!] Error uploading file, you need to include destination file name in the path')
            upFile.close() 
        else:
            color('[!] Invalid source. File does not exist')
            sys.exit()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号