SapperNet

SAPPERNET CYBERSECURITY

Insider Insights on Cybersecurity

An introduction to Metasploit Framework via TryHackMe

As part of the Hacking with Hayden series: Metasploit Framework is the most popular and one of the most powerful exploitation frameworks

Featured video: https://www.youtube.com/watch?v=8lR27r8Y_ik&ab_channel=HackerSploit

Metasploit Framework is the most popular and one of the most powerful exploitation frameworks. It is broken into three parts; msfconsole – the main command-line interface, modules – exploits, scanners, payloads, etc, tools – independent tools that help discover vulnerabilities such as msfvenom, pattern_create, and pattern_offset.  

Interacting with Metasploit Framework is done by using the ‘msfconsole’ command on a linux machine. This will bring you to the main interface called the console. From here you are able to interact with the different modules within the framework. The msfconsole has many similar commands as the Linux terminal. Metasploit uses tab completion. Meaning if you start typing a command and press the tab key, metasploit will auto complete the command Modules are individual components that each perform a task. 

Auxiliary – supporting modules like scanners, fuzzers, and crawlers. 

Encoders – allow you to encode the exploit and payload to attempt to mask it from signature-based antivirus protection. Often have a limited success rate as antivirus compare suspicious files to a database of known threats. 

Evasion – modules that directly try to evade antivirus software. 

Exploits – code that uses a vulnerability on a target system, neatly organized by target system 

No Operation (NOPs) – Used as a buffer to achieve consistent payload sizes. 

Payloads – code that will run on the target system. There are 3 payload directories: Singles – self-contained payloads that do not need additional components to run. Stagers – Set up a communication channel between Metasploit and the target system. After establishing communication, it will download the rest of the payload (stage). Stages – downloaded by the stagers. Larger downloadable payloads. 

Post – Used during post exploitation to maintain some level of access on the target computer and potentially break into the network. 

Msfconsole is managed by context. Unless you set a global variable, all settings will return to default if you change modules. 

The ‘use’ command followed by the module and module name will change the command prompt from msf6 to the module you have selected. The exploit in the screenshot below is allegedly developed by the NSA and is just used as an example. With the new command prompt, we can still run the previously mentioned commands as we did not enter a folder like with other command lines. 

The ‘show’ command followed by a module (payload, exploit, etc) will list available modules. ‘info’ will provide more information on any module. 

Search – this is the most useful command. Based on the inputted parameters, it will search the Metasploit Framework database. Example searches can include target systems, exploit names, or common vulnerability and exposures (CVE) numbers. An important piece of information given by the search command is the “rank” column. This column ranks exploits by their reliability and is categorized by the screenshot below taken from https://docs.metasploit.com/docs/using-metasploit/intermediate/exploit-ranking.html. These rankings are to be taken with a grain of salt as sometimes low ranking exploits work perfectly and excellent ranked exploits may not work. 

For some exploits to work, they require a value for the parameter. Some are pre-populated, but double check to make sure they are the same for your target. Parameters can be overridden by using the set command again with a different value. ‘setg’ sets a global command that will be used by default for all modules. You can clear a global set value with ‘unsetg’ A list of the more popular parameters: 

RHOSTS – “Remote host”, the IP address of the target system. You can input a single IP address or a network range. This supports the CIDR notation or network ranges. 

RPORT – “remote port”, the port on the target system the vulnerable application is running on. 

PAYLOAD – the name of the payload you will use for the exploit. 

LHOST – “Localhost”, the attacking machine (your machines) IP address. 

SESSION – All connections established with target systems will have a session ID. This will be used for post-exploitation modules. 

Once all module parameters are set, you can launch the module using ‘exploit’ or ‘run’. These parameters can be run on their own or with the ‘-z’ parameter. ‘exploit -z’ will run the exploit and background the session when it opens. After a vulnerability has been successfully exploited, a communication channel is established between the target and Metasploit. 

https://tryhackme.com/room/metasploitintro

How-To Hub

Check out these related posts

Leave a comment Cancel reply

Website Powered by WordPress.com.

两个鬼故事五行属金起名男孩名字100分杨姓起名大全长白山特产店起名两字起名游戏姓包男孩起什么名字儿童起小名字大全免费淘宝起名哪家靠谱司空见惯的意思春天生的少女起名字起名字带梦的通讯商店起名三通起名网免费八字姓名测试打分波波鱼加盟费梦见屎八字缺土怎么起名小学生消防知识伦字起名大同刀削面加盟万不得已的意思好寓意的成语可起名字卢姓男孩起名属鼠ndsrom文具商店 起名国产动画片大全方姓男孩取名起名大全狗年刘姓女宝宝起名大全真正的免费起名字凌空的意思给姓景的女孩起名字叶楚月夜墨寒小说免费阅读无弹跳窗口少年生前被连续抽血16次?多部门介入两大学生合买彩票中奖一人不认账让美丽中国“从细节出发”淀粉肠小王子日销售额涨超10倍高中生被打伤下体休学 邯郸通报单亲妈妈陷入热恋 14岁儿子报警何赛飞追着代拍打雅江山火三名扑火人员牺牲系谣言张家界的山上“长”满了韩国人?男孩8年未见母亲被告知被遗忘中国拥有亿元资产的家庭达13.3万户19岁小伙救下5人后溺亡 多方发声315晚会后胖东来又人满为患了张立群任西安交通大学校长“重生之我在北大当嫡校长”男子被猫抓伤后确诊“猫抓病”测试车高速逃费 小米:已补缴周杰伦一审败诉网易网友洛杉矶偶遇贾玲今日春分倪萍分享减重40斤方法七年后宇文玥被薅头发捞上岸许家印被限制高消费萧美琴窜访捷克 外交部回应联合利华开始重组专访95后高颜值猪保姆胖东来员工每周单休无小长假男子被流浪猫绊倒 投喂者赔24万小米汽车超级工厂正式揭幕黑马情侣提车了西双版纳热带植物园回应蜉蝣大爆发当地回应沈阳致3死车祸车主疑毒驾恒大被罚41.75亿到底怎么缴妈妈回应孩子在校撞护栏坠楼外国人感慨凌晨的中国很安全杨倩无缘巴黎奥运校方回应护栏损坏小学生课间坠楼房客欠租失踪 房东直发愁专家建议不必谈骨泥色变王树国卸任西安交大校长 师生送别手机成瘾是影响睡眠质量重要因素国产伟哥去年销售近13亿阿根廷将发行1万与2万面值的纸币兔狲“狲大娘”因病死亡遭遇山火的松茸之乡“开封王婆”爆火:促成四五十对奥巴马现身唐宁街 黑色着装引猜测考生莫言也上北大硕士复试名单了德国打算提及普京时仅用姓名天水麻辣烫把捣辣椒大爷累坏了

两个鬼故事 XML地图 TXT地图 虚拟主机 SEO 网站制作 网站优化