├── .gitignore ├── .nojekyll ├── LICENSE ├── README.md ├── _navbar.md ├── _sidebar.md ├── configurations.md ├── develop.md ├── docker_options.md ├── dynamic_analyzer_docker.md ├── extras.md ├── faq.md ├── index.html ├── running_mobsf_docker.md └── sso.md /.gitignore: -------------------------------------------------------------------------------- 1 | **/.DS_Store -------------------------------------------------------------------------------- /.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MobSF/docs/ea89a55d6f3979addf3b35db5a9e10773b35e0e9/.nojekyll -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Getting Started 3 | 4 | ![MobSF](https://cloud.githubusercontent.com/assets/4301109/20019521/cc61f7fc-a2f2-11e6-95f3-407030d9fdde.png) 5 | 6 | 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. 7 | 8 | --- 9 | 10 | ### Project Developers 11 | 12 | [Ajin Abraham](https://in.linkedin.com/in/ajinabraham) ![India](https://user-images.githubusercontent.com/4301109/37564171-6549d678-2ab6-11e8-9b9d-21327c7f5d5b.png) | [Magaofei](https://github.com/magaofei) ![China](https://user-images.githubusercontent.com/4301109/44515364-00bbe880-a6e0-11e8-944d-5b48a86427da.png) | [Matan Dobrushin](https://github.com/matandobr) ![Israel](https://user-images.githubusercontent.com/4301109/37564177-782f1758-2ab6-11e8-91e5-c76bde37b330.png) | [Vincent Nadal](https://github.com/superpoussin22) ![France](https://user-images.githubusercontent.com/4301109/37564175-71d6d92c-2ab6-11e8-89d7-d21f5aa0bda8.png) 13 | 14 | --- 15 | 16 | ### Support MobSF 17 | 18 | [![Donate to MobSF](https://user-images.githubusercontent.com/4301109/117404264-7aab5480-aebe-11eb-9cbd-da82d7346bb3.png)](https://opensecurity.in/donate) 19 | 20 | > Has MobSF made a difference for you? Show your support and help us innovate with a donation. It's easy to build open source, maintaining one is a different story. 21 | 22 | --- 23 | 24 | ### MobSF e-Learning Courses & Certification 25 | 26 | We offer two self-paced e-learning courses that cover MobSF and other Android security tools: 27 | 28 | - ![MobSF Course](https://user-images.githubusercontent.com/4301109/76344880-ad68b580-62d8-11ea-8cde-9e3475fc92f6.png) [Automated Mobile Application Security Assessment with MobSF - MAS](https://opsecx.com/index.php/product/automated-mobile-application-security-assessment-with-mobsf/) 29 | - ![Android Security Tools Course](https://user-images.githubusercontent.com/4301109/76344939-c709fd00-62d8-11ea-8208-774f1d5a7c52.png) [Android Security Tools Expert - ATX](https://opsecx.com/index.php/product/android-security-tools-expert-atx/) 30 | 31 | --- 32 | 33 | ### MobSF Support 34 | 35 | - **Free Support**: For limited support, questions, and discussions, join our Slack channel. 36 | [![Join MobSF Slack](https://img.shields.io/badge/mobsf%20slack-join-green?logo=slack&labelColor=4A154B)](https://join.slack.com/t/mobsf/shared_invite/zt-2umjnqlsm-sNSh9g4GFraPUBPqatwTxw) 37 | 38 | - **Enterprise Support**: For priority feature requests, live support, and onsite training, check our [Support Packages](https://opensecurity.in/#support). 39 | [![MobSF Support Packages](https://img.shields.io/badge/enterprise-support%20package-blue?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGMAAABaCAMAAACbkBjCAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAkNQTFRFAAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////o1yoNQAAAMF0Uk5TAAQ1YH6IXzYFAUqq9P/1rU4CPdHWQ4X+jgOkro+hVWYR6vIajJvz+XN/z9sjLW6lrNPX+PsGHyE5TE9XWV1hW0k6LC7hs7SEhgr2sGRiFBCXJf38sgwOtmpoIiDf68vSGS+Z9yeR70RNvUEVfOa/WgdCR8XuUeeA8Du7Vporrx66SwlcqWV92g2HY+2Ki/GQJjxpM8TVcIGodjJ3ybETJOjUyiop4sxYkkVSGJ/pD6cdwlTOHNnIZ+B13bXkKL7NMOC0/xQAAAPPSURBVHic7dn5PxVRFADwY0sPN0t4Uj0vLQq9lkelRVFRKklZs+RRiiTtSbRoD9GuhdK+Ky3S9qf1Zu68bczcO5rjhz4f5yfnOud9mTszd+Y+gLH4f8PL28fXz893nP/4UQIMAYFBRIoJwSGho0CETSQeER6BLYRGGoksjFGTcIlouSDEZNRpmaJEEDIVkTApE4TEoBHmaWpG7HQsY4YaQchMJMI8S92IQ/pHZqsThMzBMeJZRgIKkcgiCJmLYcSwDQuGMY9tzMcwFrCNhQiEl5VtJCXrNxaxCUIW6zf8ecYS/UYKz1iq31jGM5brN1bwDB/9RirPQFhDuMdqpX5jFc9I0W+k8Yww/UY6z1it3zDzDLN+A9awiTUIBKxlGxkYRibbWIdhLGUbCLcrgPUTWETWegyDPSEbUAjYyDI24RjZWepE7GYcA3LUjSlIBGzJVSO2JmIZsG2UZ1wI1TUEYZ11RJ7KrFvz8Qy1S6QAkYBCZaMI0yhWNrZjGlCiRJSiElCmZJSPGWOGrtiheKFjGhW2yiVVO+XL+i6bz9pqHCB09x77B9YA1O6tcwHGffX7oYGQsnr9+2R5MeHiZx4QkmTTQSocsqUL+WHh5yNHs3UJxVHHpL87RBo5HphkbDwhvS770N9lNZ38Z6Gm2bXGmpyjLa7l1eI8cqdO/8tW7JmNHnutZ6XhtJzA1nOOx7bzbgUXLBdHKLRcKvU8iS4Lo2YL3de4cpXe1Ns8Sto7ro1A6AxMkl8KXQDXbc5tapLbuNsA0CSvumHy0gTkF96Ut9rjFtyWjRwFuDO8ruRuLVfoblLePLwH4bKRmwAFSpXW6E4WYC66rwjYw3fYY8MDgIMqxeWWh8qAobq1Uk0gJBJ6ej0GensAHqmWW1urDQoH6bE6YI82gD53pPeJvecpq+OZt5x4ztkJewEeSG+f0NTObIlL9SReDjtZZWEDd4QSoaqP2jRyX7kTr49wCPJGrKuqE5O34h0R3vGaYqvcjAxeNXlPC+k7biZNPnC7+l1EA7eYBNPKVjG5QxPuLgchH51GP79YetP/JCbxNDnOb5voIE7ya0kjvYboTSCInvsBGvocG5odGmrpkR2QsgF6vmvos0nGZw21X8TKCClrELOvGvq+UYK7SSwEnYIiKesSs0EtjXSl6dZSGi6WOr5ei3I7kTnRrd34LpYOSdmQmL1ANn6IpQlSRr+8mYpsiK9MyY672lbx4acZ2WgXKp84059C+gvZsAqVrt0ycWPsN7JhNHicrIPus6PBMJu0hPAcWOHM/giNKVr6zDAWI4i/nmw15nhs85kAAAAASUVORK5CYII=)](https://opensecurity.in/#support) 40 | -------------------------------------------------------------------------------- /_navbar.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | *
4 | -------------------------------------------------------------------------------- /_sidebar.md: -------------------------------------------------------------------------------- 1 | 2 | * [Getting Started](/) 3 | * [Running MobSF](running_mobsf_docker.md) 4 | * [Dynamic Analyzer](dynamic_analyzer_docker.md) 5 | * [Docker Options](docker_options.md) 6 | * [Configurations](configurations.md) 7 | * [Extras](extras.md) 8 | * [Develop](develop.md) 9 | * [SSO](sso.md) 10 | * [FAQ](faq.md) 11 | -------------------------------------------------------------------------------- /configurations.md: -------------------------------------------------------------------------------- 1 | 2 | # MobSF Configurations 3 | 4 | MobSF supports a range of environment variable configurations to customize its behaviour and adapt to various deployment scenarios. 5 | Here is a list of supported environment variables. 6 | 7 | ## General 8 | - **`MOBSF_DEBUG`**: Enables debug mode when set to `1`. 9 | - **`MOBSF_SECRET_KEY`**: Configure a static django secret. 10 | - **`MOBSF_USE_X_FORWARDED_HOST`**: Enables `X-Forwarded-Host` header support when set to `1`. 11 | - **`MOBSF_USE_X_FORWARDED_PORT`**: Enables `X-Forwarded-Port` header support when set to `1`. 12 | - **`TIME_ZONE`**: Configure a timezone for the server, defaults to `UTC`. 13 | - **`MOBSF_PLATFORM`**: Specify the operating environment for MobSF, such as `docker`. 14 | - **`MOBSF_HOME_DIR`**: Specify MobSF home directory to store analysis data, defaults to `~/` or `$HOME`. 15 | 16 | ## Database Configuration 17 | PostgreSQL is configured only if the required environment variables are set; otherwise, MobSF defaults to using the sqlite3 database. 18 | - **`POSTGRES_USER`**: Username for the PostgreSQL database. 19 | - **`POSTGRES_PASSWORD`**: Password for the PostgreSQL database. 20 | - **`POSTGRES_PASSWORD_FILE`**: Path to a file containing the PostgreSQL password (docker secrets mount). 21 | - **`POSTGRES_HOST`**: Hostname or IP address of the PostgreSQL server. 22 | - **`POSTGRES_PORT`**: Port for connecting to the PostgreSQL server (default: `5432`). 23 | - **`POSTGRES_DB`**: Name of the PostgreSQL database (default: `mobsf`). 24 | 25 | ## Asynchronous Scan Queue 26 | - **`MOBSF_ASYNC_ANALYSIS`**: Enables asynchronous analysis when set to `1`. This is used to support Async task queues with DjangoQ2. 27 | - **`MOBSF_ASYNC_ANALYSIS_TIMEOUT`**: Asynchronous task timeout in minutes, defaults to 60 minutes. 28 | - **`MOBSF_ASYNC_WORKERS`**: No of asynchronous scans supported at a time, default to 3 workers. 29 | - **`MOBSF_MULTIPROCESSING`**: Specifies multiprocessing mode (`billiard`, `thread`, `default`). 30 | 31 | ## Tool Timeouts 32 | - **`MOBSF_JADX_TIMEOUT`**: Timeout in seconds for JADX/apktool operations (default: `1000` seconds). 33 | - **`MOBSF_SAST_TIMEOUT`**: Timeout in seconds for static analysis (default: `1000` seconds). 34 | - **`MOBSF_BINARY_ANALYSIS_TIMEOUT`**: Timeout in seconds for binary analysis (default: `600` seconds). 35 | 36 | ## Authentication and Rate Limiting 37 | - **`MOBSF_DISABLE_AUTHENTICATION`**: Disables authentication when set. 38 | - **`MOBSF_RATELIMIT`**: Rate limit for API requests (default: `7/m`). 39 | - **`MOBSF_API_ONLY`**: Enables REST API-only mode when set to `1`. The Web UI endpoints will be disabled. 40 | - **`MOBSF_API_KEY`**: Set a custom static authentication key for MobSF REST APIs. 41 | - **`MOBSF_API_KEY_FILE`**: Read REST API authentication key from a file (docker secrets mount). 42 | 43 | ## Proxy Configuration 44 | - **`MOBSF_PROXY_IP`**: IP address for the HTTPS proxy run by MobSF(httptools) (default: `127.0.0.1`). 45 | - **`MOBSF_PROXY_PORT`**: Port for the HTTPS proxy run by MobSF(httptools) (default: `1337`). 46 | 47 | ## Upstream Proxy Settings 48 | - **`MOBSF_UPSTREAM_PROXY_ENABLED`**: Enables upstream proxy support when set to `1`. 49 | - **`MOBSF_UPSTREAM_PROXY_SSL_VERIFY`**: Verifies SSL for upstream proxy when set to `1`. 50 | - **`MOBSF_UPSTREAM_PROXY_TYPE`**: Type of upstream proxy (default: `http`). 51 | - **`MOBSF_UPSTREAM_PROXY_IP`**: IP address for the upstream proxy (default: `127.0.0.1`). 52 | - **`MOBSF_UPSTREAM_PROXY_PORT`**: Port for the upstream proxy (default: `3128`). 53 | - **`MOBSF_UPSTREAM_PROXY_USERNAME`**: Username for upstream proxy authentication. 54 | - **`MOBSF_UPSTREAM_PROXY_PASSWORD`**: Password for upstream proxy authentication. 55 | 56 | ## Static Analysis Configuration 57 | - **`MOBSF_DOMAIN_MALWARE_SCAN`**: Enables domain malware scan, defaults to `1`. 58 | - **`MOBSF_APKID_ENABLED`**: Enables APKiD scan, defaults to `1`. 59 | - **`MOBSF_DYLIB_ANALYSIS_ENABLED`**: Enables dylib analysis, defaults to `1`. 60 | - **`MOBSF_SO_ANALYSIS_ENABLED`**: Enables shared object analysis, defaults to `1`. 61 | - **`MOBSF_DEX2SMALI_ENABLED`**: Enables dex to smali conversion for Android binaries, defaults to `1`. 62 | - **`MOBSF_PERM_MAPPING_ENABLED`**: Enables permission to code mapping for Android scans, defaults to `1`. 63 | - **`MOBSF_NIAP_ENABLED`**: Enables NIAP scan when set to `1`. This is disabled by default. 64 | - **`MOBSF_CVSS_SCORE_ENABLED`**: Show CVSSV2 scores when set to `1`. This is disabled by default. 65 | 66 | ## Dynamic Analysis Configuration 67 | - **`MOBSF_ANALYZER_IDENTIFIER`**: Android Debug Bridge (adb) compatible device identifier. 68 | - **`MOBSF_FRIDA_TIMEOUT`**: Frida connection timeout, defaults to `4` seconds. 69 | - **`MOBSF_ACTIVITY_TESTER_SLEEP`**: Wait defined seconds before invoking an activity, defaults to `4` seconds. This is used by Activity tester. 70 | - **`MOBSF_ADB/MOBSF_ADB_BINARY`**: Specify the path to the `adb` binary that MobSF should use for Android dynamic analysis. 71 | 72 | ## VirusTotal Integration 73 | - **`MOBSF_VT_ENABLED`**: Enables VirusTotal integration when set to `1`. 74 | - **`MOBSF_VT_API_KEY`**: API key for VirusTotal integration. 75 | - **`MOBSF_VT_UPLOAD`**: Enables file uploads to VirusTotal when set to `1`. Otherwise, only hash values are sent to VirusTotal. 76 | 77 | ## Corellium Integration 78 | - **`MOBSF_CORELLIUM_API_DOMAIN`**: API domain for Corellium integration. 79 | - **`MOBSF_CORELLIUM_API_KEY`**: API key for Corellium integration. 80 | - **`MOBSF_CORELLIUM_PROJECT_ID`**: Project ID for Corellium integration (optional). 81 | 82 | ## AppMonsta Integration 83 | - **`MOBSF_APPMONSTA_API`**: AppMonsta API key to fetch package details 84 | 85 | ## SAML SSO Integration 86 | - **`MOBSF_IDP_METADATA_URL`**: Metadata URL for SAML IdP. 87 | - **`MOBSF_IDP_ENTITY_ID`**: Entity ID for SAML IdP. 88 | - **`MOBSF_IDP_SSO_URL`**: Single Sign-On (SSO) URL for SAML IdP. 89 | - **`MOBSF_IDP_X509CERT`**: X.509 certificate for SAML IdP. 90 | - **`MOBSF_IDP_IS_ADFS`**: Set ADFS as IdP when set to `1`. 91 | - **`MOBSF_SP_HOST`**: Hostname for SAML Service Provider (SP). 92 | - **`MOBSF_SP_ALLOW_PASSWORD`**: Enables password-based login for SAML SP when set to `1`. 93 | - **`MOBSF_IDP_MAINTAINER_GROUP`**: Custom group name for Read/Write maintainers, defaults to `Maintainer`. 94 | - **`MOBSF_IDP_VIEWER_GROUP`**: Custom group name for Read-only viewers, defaults to `Viewer`. 95 | 96 | ## Custom binaries for Android SAST 97 | - **`MOBSF_BUNDLE_TOOL`**: Path to the BundleTool binary. 98 | - **`MOBSF_JADX_BINARY`**: Path to the JADX binary. 99 | - **`MOBSF_BACKSMALI_BINARY`**: Path to the Backsmali binary. 100 | - **`MOBSF_VD2SVG_BINARY`**: Path to the VD2SVG binary. 101 | - **`MOBSF_APKTOOL_BINARY`**: Path to the apktool binary. 102 | - **`MOBSF_ADB_BINARY`**: Path to the ADB binary. 103 | - **`MOBSF_AAPT2_BINARY`**: Path to the AAPT2 binary. 104 | - **`MOBSF_AAPT_BINARY`**: Path to the AAPT binary. 105 | - **`MOBSF_JAVA_DIRECTORY`**: Path to the Java directory. 106 | 107 | #### Custom binaries for Android SASTCustom binary for iOS SAST 108 | - **`MOBSF_JTOOL_BINARY`**: Path to the jtool binary. 109 | - **`MOBSF_CLASSDUMP_BINARY`**: Path to the class-dump binary. 110 | - **`MOBSF_CLASSDUMP_SWIFT_BINARY`**: Path to the class-dump-swift binary. 111 | 112 | ## Misc 113 | - **`EFR_01`**: Enables a custom enterprise feature request when set to `1`. 114 | -------------------------------------------------------------------------------- /develop.md: -------------------------------------------------------------------------------- 1 | # Requirements 2 | Requirements for setting up MobSF locally. 3 | 4 | System Requirements: 8GB+ RAM, 3GHz CPU, 80GB+ Free Disk Space 5 | 6 | Operating Systems: Mac, Linux, Windows 7 | 8 | ## Static Analysis 9 | * **Mac** 10 | 11 | * Install Git 12 | 13 | `brew install git` 14 | * Install [Python **3.10+**](https://github.com/pyenv/pyenv) 15 | * Install [OpenJDK 21+](https://jdk.java.net/) and configure `JAVA_HOME` environment variable 16 | * Install command line tools 17 | 18 | ```bash 19 | xcode-select --install 20 | sudo xcode-select --switch /Applications/Xcode.app 21 | ``` 22 | * Install [wkhtmltopdf](https://wkhtmltopdf.org/downloads.html) as per the [wiki instructions](https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf) 23 | * Windows App Static analysis requires a Windows Host or Windows VM for Mac and Linux. [More Info](https://github.com/MobSF/Mobile-Security-Framework-MobSF/blob/master/mobsf/install/windows/readme.md) 24 | 25 | 26 | * **Ubuntu/Debian based Linux** 27 | 28 | * Install Git 29 | 30 | `sudo apt install git -y` 31 | * Install [Python **3.10+**](https://github.com/pyenv/pyenv) 32 | * Install OpenJDK 21+ and configure `JAVA_HOME` environment variable. 33 | 34 | `sudo apt install openjdk-21-jdk -y` 35 | * Install the following dependencies: 36 | ```bash 37 | sudo apt install python3-dev python3-venv python3-pip build-essential \ 38 | libffi-dev libssl-dev libxml2-dev libxslt1-dev \ 39 | libjpeg8-dev zlib1g-dev wkhtmltopdf -y 40 | ``` 41 | 42 | * Windows App Static analysis requires a Windows Host or Windows VM for Mac and Linux. [More Info](https://github.com/MobSF/Mobile-Security-Framework-MobSF/blob/master/mobsf/install/windows/readme.md) 43 | 44 | * **Windows** 45 | 46 | * Install [Git](https://git-scm.com/download/win) 47 | * Install [Python **3.10+**](https://www.python.org/) 48 | * Install [OpenJDK 21+](https://www.microsoft.com/openjdk) and configure `JAVA_HOME` environment variable. 49 | * Install [Microsoft Visual C++ Build Tools](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16) 50 | * Install [OpenSSL (non-light)](https://slproweb.com/products/Win32OpenSSL.html) 51 | * Download & Install [wkhtmltopdf](https://wkhtmltopdf.org/downloads.html) as per the [wiki instructions](https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf) 52 | * Add the folder that contains `wkhtmltopdf` binary to environment variable PATH. 53 | 54 | 55 | ?> **IMPORTANT:** iOS IPA Analysis works only on **Mac, Linux and Docker containers**. 56 | 57 | *** 58 | 59 | # Installation 60 | 61 | **Tested on Windows 10, Ubuntu 22.04 , macOS 14.3 (M3)** 62 | 63 | !> Please make sure that all the requirements mentioned are installed first. 64 | 65 | ```bash 66 | # Clone the MobSF repo 67 | git clone https://github.com/MobSF/Mobile-Security-Framework-MobSF.git 68 | cd Mobile-Security-Framework-MobSF 69 | 70 | # Linux or Mac 71 | ./setup.sh 72 | 73 | # Windows 74 | setup.bat 75 | ``` 76 | 77 | ?> Windows users, before running `setup.bat` close any opened folders of MobSF or text editors with MobSF opened. Either of these can interrupt the setup by causing permission errors. 78 | 79 | *** 80 | 81 | # Running MobSF 82 | 83 | ```bash 84 | # Linux or Mac 85 | ./run.sh 127.0.0.1:8000 86 | 87 | # Windows 88 | run.bat 127.0.0.1:8000 89 | ``` 90 | 91 | !> MobSF server will listen on `0.0.0.0:8000` if you use the run script without arguments. 92 | 93 | In your web browser, navigate to `http://localhost:8000/` to access MobSF web interface. The default credentials are `mobsf/mobsf`. 94 | *** 95 | 96 | # Asynchronous Scan Queues 97 | 98 | MobSF also supports asynchronous task queues. 99 | 100 | ```bash 101 | # Linux or Mac 102 | MOBSF_ASYNC_ANALYSIS=1 ./run.sh 103 | 104 | # Windows 105 | set MOBSF_ASYNC_ANALYSIS=1 106 | run.bat 107 | 108 | # Run DjangoQ2 cluster to accept scan jobs. 109 | poetry run python manage.py qcluster 110 | ``` 111 | 112 | # Dynamic Analysis 113 | 114 | You need one of the following Android/iOS virtual device for Dynamic Analysis. 115 | 116 | * [Genymotion Desktop](https://www.genymotion.com/download/) 117 | * [Genymotion Cloud](https://www.genymotion.com/cloud/) 118 | * [Android Studio Emulator](https://developer.android.com/studio) 119 | * [Corellium Android](https://support.corellium.com/devices/android) 120 | * [Corellium iOS](https://support.corellium.com/devices/ios) 121 | 122 | !> Dynamic analysis using real mobile device is possible for Android, **but not supported by us.** 123 | 124 | ## Genymotion Android 125 | ?> Supports arm64, x86, x86_64 architecture Android **4.1 - 11.0**, upto **API 30** 126 | 127 | Genymotion is the preferred dynamic analysis environment that you can setup with the least friction. Run a Genymotion Android VM **before starting MobSF.** Everything will be configured automatically at runtime. We recommend using **Android 7.0** and above. 128 | 129 | * **Android 5.0 - 11.0** - These versions uses **Frida** and works out of the box with zero configuration or setup. 130 | * **Android 4.1 - 4.4** - These versions uses **Xposed Framework** and requires that you should MobSFy the runtime prior to Dynamic Analysis for the first time. These versions also require VM reboot after installing Xposed Modules. 131 | 132 | Click **MobSFy Android Runtime** button in Android Dynamic Analyzer page to MobSFy the android runtime environment. 133 | 134 | ![MobSFy](https://user-images.githubusercontent.com/4301109/77839885-11033780-714f-11ea-9d52-df7b0bd314a0.png) 135 | 136 | **HTTPS Proxy** 137 | 138 | * For Android versions **4.4 - 11.0**, global proxy settings are automatically applied at runtime. 139 | * For Android version **4.1 - 4.3**, set Android VM proxy as displayed in Dynamic Analyzer page. 140 | 141 | If MobSF Dynamic Analyzer doesn't detect your android device, set the device identifier via the environment variable `MOBSF_ANALYZER_IDENTIFIER` before running MobSF. 142 | 143 | Example: `MOBSF_ANALYZER_IDENTIFIER='192.168.56.101:5555'`. 144 | You can find the Android Device IP from the Genymotion title bar and the default port is `5555`. 145 | 146 | ![Dynamic Analyzer IP](https://user-images.githubusercontent.com/4301109/65379210-0b312300-dce2-11e9-8827-f63d3b95dfd1.png) 147 | 148 | ## Android Studio Emulator 149 | ?> Supports arm, arm64, x86 and x86_64 architecture Android **5.0 - 11.0**, upto **API 30** 150 | 151 | Install or upgrade your Android Studio to the latest. Android Emulator image with Google Play Store is considered as production image and you cannot use that with MobSF. 152 | 153 | Create an Android Virtual Device (AVD) **without Google Play Store**. 154 | 155 | !> You must not choose non-rooted **production** images. MobSF requires rooted images without Google Playstore pre-installed. 156 | 157 | ![Create AVD](https://github.com/user-attachments/assets/5871ff00-2386-4f32-be37-1d749825b069) 158 | 159 | 160 | After creating the AVD, run it once and make sure everything is alright. Close it along with Android Studio if it's running. 161 | 162 | **Run Android Virtual Device (AVD)** 163 | 164 | Run an AVD **before starting MobSF** using `scripts/start_avd.sh` or `scripts/start_avd.ps1` 165 | 166 | ```bash 167 | # Run the script to list out available AVDs 168 | scripts/start_avd.sh 169 | Available AVDs: 170 | 171 | Medium_Phone_API_35 172 | Pixel_5_API_30 173 | Pixel_6a_API_29 174 | 175 | Use any Android AVD 5.0 - 11.0, up to API 30 without Google Play (production image). 176 | Usage: scripts/start_avd.sh AVD_NAME [START_PORT] [open_gapps.zip path] 177 | Example: scripts/start_avd.sh Pixel_6_Pro_API_28 5554 /path/to/open_gapps.zip 178 | 179 | # Choose the AVD you created, make sure it is a non-production AVD. 180 | # MobSF will not work with production AVDs. 181 | 182 | sscripts/start_avd.sh Pixel_5_API_30 183 | ``` 184 | 185 | Everything will be configured automatically at runtime. MobSF requires AVD version **5.0 to 11.0** for dynamic analysis. 186 | 187 | **HTTPS Proxy** 188 | 189 | * For Android versions **5.0 - 8.0**, MobSF attempts to set global proxy, but might fail due to a bug in adb. Configure proxy settings manually in such cases. 190 | * For Android version **9.0** and above, global proxy settings are automatically applied at runtime. 191 | 192 | **GApps on AVD (Optional)** 193 | 194 | If you need Google Playstore, download the appropriate package from . 195 | Run the `start_avd` script with path to the GApps zip file. This is currently not supported in Windows. You will have to manually do the necessary steps. 196 | 197 | ```bash 198 | scripts/start_avd.sh Pixel_6a_API_29 5554 ~/Downloads/open_gapps-arm64-10.0-stock-20220215.zip 199 | ``` 200 | 201 | If MobSF Dynamic Analyzer doesn't detect your android device, idenify the emulator serial number. 202 | 203 | ![Android AVD](https://github.com/MobSF/Mobile-Security-Framework-MobSF/assets/4301109/e9e849b6-69ad-47a4-8693-c75a0e1aa7cb) 204 | 205 | You can set the device identifier via the environment variable `MOBSF_ANALYZER_IDENTIFIER` before running MobSF. 206 | 207 | Example: `MOBSF_ANALYZER_IDENTIFIER='emulator-5554'` 208 | 209 | 210 | ## Genymotion Cloud Android 211 | ?> Supports arm64, x86, x86_64 architecture Android **5.1 - 11.0**, upto **API 30** 212 | 213 | Run a Genymotion Android VM in cloud and connect to it via adb **before starting MobSF.** Everything will be configured automatically at runtime. We recommend using **Android 7.0** and above. 214 | 215 | This documentation uses Amazon Web Services (AWS) as an example. You need to follow similar steps in Genymotion Cloud SaaS, Microsoft Azure, Google Cloud Platform, or Alibaba Cloud. 216 | 217 | 1. Launch an EC2 instance with [Genymotion AMI](https://aws.amazon.com/marketplace/seller-profile?id=933724b4-d35f-4266-905e-e52e4792bc45) 218 | 219 | ![AWS Genymotion AMI](https://user-images.githubusercontent.com/4301109/81505732-7bb3a100-92bf-11ea-9ba5-b1899810db2e.png) 220 | 221 | 2. Modify the **Security Group** of the AMI to allow inbound TCP connections to port **5555**. This is required for remote adb connection to Genymotion Cloud VM. 222 | 223 | ![Allow ADB Connection](https://user-images.githubusercontent.com/4301109/81505878-9b979480-92c0-11ea-9456-32cf5254d381.png) 224 | 225 | 3. Access Genymotion Cloud VM by navigating to it's Public IP. The default username is `genymotion` and the password is EC2 instance id. 226 | [More Info](https://docs.genymotion.com/paas/8.0/02_Getting_Started/021_AWS.html#create-and-set-up-an-instance) 227 | 228 | 4. Go to Configuration and Enable ADB 229 | 230 | ![Enable ADB in Genymotion Cloud](https://user-images.githubusercontent.com/4301109/81505975-46a84e00-92c1-11ea-82a5-8912f96849b1.png) 231 | 232 | 5. From your local machine, ensure that you can connect to Genymotion Cloud VM via adb. 233 | 234 | ```bash 235 | adb connect :5555 236 | adb devices 237 | ``` 238 | ![ADB connect](https://user-images.githubusercontent.com/4301109/81506018-9be45f80-92c1-11ea-8486-fcac8daee7be.png) 239 | 240 | 6. You can now perform MobSF Dynamic Analysis with Genymotion Cloud VM in AWS. 241 | 242 | If MobSF Dynamic Analyzer doesn't detect your Cloud VM, set the device identifier via the environment variable `MOBSF_ANALYZER_IDENTIFIER` before running MobSF. 243 | 244 | Example: `MOBSF_ANALYZER_IDENTIFIER=':5555'`. 245 | 246 | If MobSF cannot detect adb, you need to configure `ADB_BINARY` in `/.MobSF/config.py`. 247 | 248 | Example: `ADB_BINARY='/Applications/Genymotion.app/Contents/MacOS/tools/adb'`. 249 | 250 | ## Corellium Android VM 251 | 252 | ?> Supports **rooted userdebug** builds, arm64 architecture Android **7.1.2 - 11.0**, upto **API 30** 253 | 254 | !> You must not choose non-rooted **user** builds. MobSF requires rooted **userdebug** builds. 255 | 256 | 1. After creating a supported rooted **userdebug** Android device, Follow Corellium's `Connect via VPN` instructions. 257 | 258 | ![Corellium Android](https://github.com/MobSF/Mobile-Security-Framework-MobSF/assets/4301109/f384421c-98af-47b1-8d98-29641d9ca974) 259 | 260 | 2. Do connect to Corellium network using provided VPN configuration. 261 | 262 | 3. Run `adb connect` locally to ensure that the connection is working from your host. 263 | 264 | ![Corellium adb](https://github.com/MobSF/Mobile-Security-Framework-MobSF/assets/4301109/c6f1135e-b1ef-4a14-b9bf-6ebfab2e3cca) 265 | 266 | 4. Set the environment variable `MOBSF_ANALYZER_IDENTIFIER` as `:` of Corellium Android device before running MobSF. (Example: `10.11.1.1:5001`). 267 | 268 | 269 | ## Corellium iOS VM 270 | 271 | Supports jailbroken Corellium iOS VMs from MobSF v3.8.0 onwards. 272 | 273 | !> Non jailbroken devices cannot be used with MobSF. Real devices are not supported at this time. 274 | 275 | 1. After setting up Corellium account, create an API key from https://app.corellium.com/profile/api 276 | 277 | ![Corellium API](https://user-images.githubusercontent.com/4301109/289017703-b6f25054-d1b5-4c0e-a781-68b18260fb6a.png) 278 | 279 | 2. Set the API key in the environment variable `MOBSF_CORELLIUM_API_KEY`. If you are using enterprise version of Corellium using a different domain. You must also supply the environment variable `MOBSF_CORELLIUM_API_DOMAIN` with the correct domain value. 280 | 281 | 3. To enable MobSF HTTPs proxying, You will have to configure the proxy settings in the iOS VM. Go to iPhone `Settings` -> `Wi-Fi` -> Choose the `Corellium` WiFi -> Scroll down and choose `Configure Proxy` -> Choose`Manual configuration` -> Set the `Server` as `127.0.0.1` and `Port` as `1337` -> Click `Save`. 282 | 283 | ![iOS HTTPS Proxy](https://user-images.githubusercontent.com/4301109/289017713-ffc54f0e-1c23-484d-a612-0318ad41e7a3.png) 284 | 285 | 4. Run MobSF and now you can create or manage jailbroken iOS VMs with Corellium for Dynamic Analysis. 286 | 287 | *** 288 | 289 | # Updating MobSF 290 | 291 | ```bash 292 | cd Mobile-Security-Framework-MobSF/ 293 | git pull origin master 294 | poetry update 295 | poetry run python manage.py makemigrations 296 | poetry run python manage.py makemigrations StaticAnalyzer 297 | poetry run python manage.py migrate 298 | poetry run python manage.py create_roles 299 | # For Linux/Mac 300 | poetry run python mobsf/MobSF/tools_download.py ~/.MobSF 301 | DJANGO_SUPERUSER_PASSWORD=mobsf poetry run python manage.py createsuperuser --noinput --username "mobsf" --email "" 302 | # For Windows 303 | poetry run python mobsf/MobSF/tools_download.py %USERPROFILE%\.MobSF 304 | set DJANGO_SUPERUSER_PASSWORD=mobsf && poetry run python manage.py createsuperuser --noinput --username "mobsf" --email "" 305 | ``` 306 | 307 | !> If database migration fails, delete the MobSF directory (`~/.MobSF` on Linux & Mac, `C:\Users\\.MobSF` on Windows) and rerun the setup script (`setup.sh` for Linux & Mac or `setup.bat` for Windows). Note that this will remove all previous scan results and data. 308 | *** 309 | 310 | # Running Tests 311 | 312 | We use tox for running tests. 313 | ```bash 314 | pip install tox 315 | 316 | #For linting 317 | tox -e lint 318 | 319 | # For running lint + test 320 | tox -e lint,test 321 | ``` -------------------------------------------------------------------------------- /docker_options.md: -------------------------------------------------------------------------------- 1 | # Docker Options 2 | 3 | ## Docker 4 | #### Prebuilt Docker image from DockerHub 5 | 6 | ```bash 7 | docker pull opensecurity/mobile-security-framework-mobsf:latest 8 | docker run -it --rm -p 8000:8000 opensecurity/mobile-security-framework-mobsf:latest 9 | ``` 10 | 11 | #### For persistence 12 | 13 | ```bash 14 | # On Linux 15 | mkdir 16 | sudo chown -R 9901:9901 17 | 18 | docker run -it --rm --name mobsf -p 8000:8000 -v :/home/mobsf/.MobSF opensecurity/mobile-security-framework-mobsf:latest 19 | ``` 20 | 21 | #### Updating MobSF version when volume mount is used 22 | 23 | ```bash 24 | # On Linux 25 | docker pull opensecurity/mobile-security-framework-mobsf:latest 26 | # Apply database migrations 27 | docker run --rm -v :/home/mobsf/.MobSF opensecurity/mobile-security-framework-mobsf:latest scripts/migrate.sh 28 | ``` 29 | 30 | #### Configuring Asynchronous Scan Queues 31 | 32 | Asynchronous scan queues require a shared volume mount to enable data sharing between MobSF and the scan queue orchestrator, DjangoQ2. 33 | 34 | ```bash 35 | # Run MobSF container with Asynchronous scan support. 36 | docker run -it --rm --name mobsf -v ~/.MobSF:/home/mobsf/.MobSF -e MOBSF_ASYNC_ANALYSIS=1 -p 8000:8000 opensecurity/mobile-security-framework-mobsf:latest 37 | 38 | # Run DjangoQ2 cluster to accept scan jobs. 39 | docker run -it --rm --name djangoq -v ~/.MobSF:/home/mobsf/.MobSF opensecurity/mobile-security-framework-mobsf:latest scripts/qcluster.sh 40 | ``` 41 | 42 | #### Building Image from Dockerfile 43 | 44 | ```bash 45 | git clone https://github.com/MobSF/Mobile-Security-Framework-MobSF.git 46 | cd Mobile-Security-Framework-MobSF 47 | docker build -t mobsf . 48 | docker run -it --rm -p 8000:8000 mobsf 49 | ``` 50 | 51 | #### Building Image behind a proxy from Dockerfile 52 | 53 | ```bash 54 | docker build --build-arg https_proxy="https://${PROXY_IP}:${PROXY_PORT}" --build-arg http_proxy="${PROXY_IP}:${PROXY_PORT}" --build-arg NO_PROXY="127.0.0.1" -t mobsf . 55 | ``` 56 | 57 | Set the environment variable `PROXY_IP` with the value of your proxy ip address and `PROXY_PORT` with the proxy port used. 58 | 59 | #### Rebuilding Image from Dockerfile from Scratch 60 | 61 | ```bash 62 | docker build --no-cache --rm -t mobsf . 63 | ``` 64 | 65 | #### To see the mobsf container logs 66 | 67 | ```bash 68 | docker logs -f --tail 100 mobsf 69 | ``` 70 | ## Docker Compose 71 | #### For Postgres database, DjangoQ2 task queue, and Nginx reverse proxy support 72 | 73 | ```bash 74 | # On Linux 75 | mkdir -p $HOME/MobSF/mobsf_data 76 | sudo chown -R 9901:9901 $HOME/MobSF/mobsf_data 77 | 78 | cd docker 79 | 80 | # Download the latest images 81 | docker compose pull 82 | 83 | # Launch the services 84 | docker compose up 85 | 86 | # or run in the background 87 | docker compose up -d 88 | 89 | # See logs from mobsf container 90 | docker compose logs -f mobsf 91 | 92 | # See scan logs from the djangoq container 93 | docker compose logs -f djangoq 94 | 95 | # Stop the containers 96 | docker compose down 97 | 98 | # Updating MobSF 99 | docker compose pull 100 | docker compose run mobsf scripts/migrate.sh 101 | ``` 102 | 103 | ### Architecture 104 | 105 | ```mermaid 106 | graph TB 107 | %% Define the Docker Network 108 | subgraph DockerNetwork ["Docker Network"] 109 | direction LR 110 | postgres[(Postgres DB)] 111 | nginx[/Nginx Server/] 112 | mobsf{{MobSF Framework}} 113 | djangoq[/DjangoQ Worker/] 114 | end 115 | 116 | %% Define the Host Machine 117 | host[/Host Machine/] 118 | 119 | %% Host Volume Mappings 120 | host --> |"Volume:
$HOME/MobSF/postgresql_data
to
/var/lib/postgresql/data"| postgres 121 | host --> |"Volume:
./nginx.conf
to
/etc/nginx/nginx.conf:ro"| nginx 122 | host --> |"Volume:
$HOME/MobSF/mobsf_data
to
/home/mobsf/.MobSF"| mobsf 123 | host --> |"Volume:
$HOME/MobSF/mobsf_data
to
/home/mobsf/.MobSF"| djangoq 124 | 125 | %% Dependencies 126 | nginx -.- |"Depends on"| mobsf 127 | mobsf -.- |"Depends on"| postgres 128 | mobsf -.- |"Depends on"| djangoq 129 | djangoq -.- |"Depends on"| postgres 130 | 131 | %% Ports and Connections 132 | nginx === |"Exposes Ports:
80:4000
1337:4001"| host 133 | mobsf -.- |"Extra Host:
host.docker.internal"| host 134 | 135 | %% Styling Definitions 136 | classDef container fill:#e0f7fa,stroke:#006064,stroke-width:2px,rx:5,ry:5; 137 | classDef network fill:#e8f5e9,stroke:#1b5e20,stroke-width:2px,rx:10,ry:10; 138 | classDef host fill:#fff3e0,stroke:#e65100,stroke-width:2px,rx:10,ry:10; 139 | classDef dashed stroke-dasharray: 5 5; 140 | 141 | %% Assign Styles 142 | class postgres,nginx,mobsf,djangoq container; 143 | class DockerNetwork network; 144 | class host host; 145 | 146 | %% Link Styles 147 | linkStyle 0 stroke:#1565c0,stroke-width:2px; 148 | linkStyle 1 stroke:#1565c0,stroke-width:2px; 149 | linkStyle 2 stroke:#1565c0,stroke-width:2px; 150 | linkStyle 3 stroke:#1565c0,stroke-width:2px; 151 | linkStyle 4 stroke:#7b1fa2,stroke-width:2px,stroke-dasharray: 5 5; 152 | linkStyle 5 stroke:#c62828,stroke-width:3px; 153 | linkStyle 6 stroke:#2e7d32,stroke-width:2px,stroke-dasharray: 5 5; 154 | 155 | ``` 156 | 157 | **Docker Compose Configuration for MobSF** 158 | 159 | This configuration runs MobSF with PostgreSQL as the database, Nginx as the reverse proxy, and supports asynchronous scans using DjangoQ2. 160 | 161 | Services: 162 | 163 | 1. postgres 164 | - Image: PostgreSQL 13 image 165 | - Purpose: Provides the database backend for MobSF 166 | - Configuration: 167 | * Persistent volume for data storage 168 | * Environment variables for database credentials 169 | * Connected to mobsf_network 170 | 171 | 2. nginx 172 | - Image: Latest Nginx image 173 | - Purpose: Acts as a reverse proxy and web server 174 | - Configuration: 175 | * Exposes ports 80 and 1337 176 | * Custom Nginx configuration file mounted 177 | * Depends on mobsf service 178 | * Connected to mobsf_network 179 | 180 | 3. mobsf 181 | - Image: Latest MobSF image 182 | - Purpose: Runs the Mobile Security Framework application 183 | - Configuration: 184 | * Volume mounted for MobSF data persistence at /home/mobsf/.MobSF 185 | * Environment variables for PostgreSQL connection 186 | * Depends on postgres service 187 | * Extra host configuration for Docker host access required for adb connectivity 188 | * Connected to mobsf_network 189 | 190 | 4. djangoq 191 | - Image: Latest MobSF image 192 | - Purpose: Runs DjangoQ2 to manage asynchronous task queues for MobSF 193 | - Configuration: 194 | * Command: Runs qcluster.sh to start DjangoQ2 clusters 195 | * Volume mounted for MobSF data persistence at /home/mobsf/.MobSF 196 | * Environment variables for PostgreSQL connection 197 | * Depends on the postgres service. 198 | * Connected to mobsf_network. 199 | 200 | Network: 201 | - A custom bridge network 'mobsf_network' is created for inter-service communication 202 | 203 | Note: All services are set to restart automatically in case of failures, except DjangoQ, which is configured to restart unless stopped. 204 | -------------------------------------------------------------------------------- /dynamic_analyzer_docker.md: -------------------------------------------------------------------------------- 1 | # Dynamic Analyzer 2 | 3 | MobSF supports **certain** rooted Android VMs/emulators and jailbroken iOS VMs created with: 4 | 5 | * [Genymotion Desktop](https://www.genymotion.com/download/) 6 | * [Genymotion Cloud](https://www.genymotion.com/cloud/) 7 | * [Android Studio Emulator](https://developer.android.com/studio) 8 | * [Corellium Android](https://support.corellium.com/devices/android) 9 | * [Corellium iOS](https://support.corellium.com/devices/ios) 10 | 11 | ## Genymotion Android 12 | ?> Supports arm64, x86, x86_64 architecture Android **4.1 - 11.0**, upto **API 30** 13 | 14 | Genymotion is the preferred dynamic analysis environment that you can setup with the least friction. Run a Genymotion Android VM **before starting MobSF.** We recommend using **Android 7.0** and above. 15 | 16 | * **Android 5.0 - 11.0** - These versions uses **Frida** and works out of the box with zero configuration or setup. 17 | * **Android 4.1 - 4.4** - These versions uses **Xposed Framework** and requires that you should MobSFy the runtime prior to Dynamic Analysis for the first time. These versions also require VM reboot after installing Xposed Modules. 18 | 19 | After running the Android VM, you can see the device identifier from the title bar. 20 | 21 | ![Analyzer Identifier](https://github.com/MobSF/Mobile-Security-Framework-MobSF/assets/4301109/6204cdf4-1bc6-4b9a-a9f6-99db64c2f8e2) 22 | 23 | Set the environment variable `MOBSF_ANALYZER_IDENTIFIER` as the VM's device identifier when you run the MobSF docker image (Example: `192.168.58.102:5555`). 24 | 25 | **HTTPS Proxy** 26 | 27 | * For Android versions **4.4 - 11.0**, global proxy settings are automatically applied at runtime. 28 | * For Android version **4.1 - 4.3**, set Android VM proxy as displayed in Dynamic Analyzer page. 29 | 30 | 31 | ## Android Studio Emulator 32 | ?> Supports arm, arm64, x86 and x86_64 architecture Android **5.0 - 11.0**, upto **API 30** 33 | 34 | Install or upgrade your Android Studio to the latest. Android Emulator image with Google Play Store is considered as production image and you cannot use that with MobSF as those images **does not have root** access. 35 | 36 | Create an Android Virtual Device (AVD) **without Google Play Store**. 37 | 38 | !> You must not choose non-rooted **production** images. MobSF requires rooted images without Google Playstore pre-installed. 39 | 40 | ![Create AVD](https://github.com/user-attachments/assets/5871ff00-2386-4f32-be37-1d749825b069) 41 | 42 | 43 | After creating the AVD, run it once and make sure everything is alright. Close it along with Android Studio if it's running. 44 | 45 | !> Only Android AVDs upto **version 11, API 30** is supported! Newer Android AVDs does not offer a writable `/system` and hence cannot work with MobSF. 46 | 47 | **Run Android Virtual Device (AVD)** 48 | 49 | Run an AVD **before starting MobSF** using `scripts/start_avd.sh` or `scripts/start_avd.ps1` 50 | 51 | ```bash 52 | # Run the script to list out available AVDs 53 | scripts/start_avd.sh 54 | Available AVDs: 55 | 56 | Medium_Phone_API_35 57 | Pixel_5_API_30 58 | Pixel_6a_API_29 59 | 60 | Use any Android AVD 5.0 - 11.0, up to API 30 without Google Play (production image). 61 | Usage: scripts/start_avd.sh AVD_NAME [START_PORT] [open_gapps.zip path] 62 | Example: scripts/start_avd.sh Pixel_6_Pro_API_28 5554 /path/to/open_gapps.zip 63 | 64 | # Choose the AVD you created, make sure it is a non-production AVD. 65 | # MobSF will not work with production AVDs. 66 | 67 | scripts/start_avd.sh Pixel_5_API_30 68 | ``` 69 | Identify the emulator serial number. In this example, the identifier is `emulator-5554`. 70 | 71 | ![Android AVD](https://github.com/MobSF/Mobile-Security-Framework-MobSF/assets/4301109/e9e849b6-69ad-47a4-8693-c75a0e1aa7cb) 72 | 73 | 74 | Set the environment variable `MOBSF_ANALYZER_IDENTIFIER` as `emulator-5554` when running MobSF docker image. 75 | 76 | 77 | **HTTPS Proxy** 78 | 79 | * For Android versions **5.0 - 8.0**, MobSF attempts to set global proxy, but might fail due to a bug in adb. Configure proxy settings manually in such cases. 80 | * For Android version **9.0** and above, global proxy settings are automatically applied at runtime. 81 | 82 | **GApps on AVD (Optional)** 83 | 84 | If you need Google Playstore, download the appropriate package from . 85 | Run the `start_avd` script with path to the GApps zip file. This is currently not supported in Windows. You will have to manually do the necessary steps. 86 | 87 | ```bash 88 | $ scripts/start_avd.sh Pixel_6a_API_29 5554 ~/Downloads/open_gapps-arm64-10.0-stock-20220215.zip 89 | ``` 90 | 91 | ## Genymotion Cloud VM 92 | ?> Supports arm64, x86, x86_64 architecture Android **5.1 - 11.0**, upto **API 30** 93 | 94 | Run a Genymotion Android VM in the cloud **before running MobSF.** We recommend using **Android 7.0** and above. 95 | 96 | This documentation uses Amazon Web Services (AWS) as an example. You need to follow similar steps in Genymotion Cloud SaaS, Microsoft Azure, Google Cloud Platform, or Alibaba Cloud. 97 | 98 | 1. Launch an EC2 instance with [Genymotion AMI](https://aws.amazon.com/marketplace/seller-profile?id=933724b4-d35f-4266-905e-e52e4792bc45) 99 | 100 | ![AWS Genymotion AMI](https://user-images.githubusercontent.com/4301109/81505732-7bb3a100-92bf-11ea-9ba5-b1899810db2e.png) 101 | 102 | 2. Modify the **Security Group** of the AMI to allow inbound TCP connections to port **5555**. This is required for remote adb connection to Genymotion Cloud VM. 103 | 104 | ![Allow ADB Connection](https://user-images.githubusercontent.com/4301109/81505878-9b979480-92c0-11ea-9456-32cf5254d381.png) 105 | 106 | 3. Access Genymotion Cloud VM by navigating to it's Public IP. The default username is `genymotion` and the password is EC2 instance id. 107 | [More Info](https://docs.genymotion.com/paas/02_Getting_Started/021_AWS/) 108 | 109 | 4. Go to Configuration and Enable ADB 110 | 111 | ![Enable ADB in Genymotion Cloud](https://user-images.githubusercontent.com/4301109/81505975-46a84e00-92c1-11ea-82a5-8912f96849b1.png) 112 | 113 | 5. From your local machine, ensure that you can connect to Genymotion Cloud VM via adb. 114 | 115 | ```bash 116 | adb connect :5555 117 | adb devices 118 | ``` 119 | ![ADB connect](https://user-images.githubusercontent.com/4301109/81506018-9be45f80-92c1-11ea-8486-fcac8daee7be.png) 120 | 121 | 6. Set the environment variable `MOBSF_ANALYZER_IDENTIFIER` as `:5555` when you run the MobSF docker image (Example: `3.81.202.69:5555`). 122 | 123 | 7. You can now perform MobSF Dynamic Analysis with Genymotion Cloud VM in AWS. 124 | 125 | ## Corellium Android VM 126 | 127 | ?> Supports **rooted userdebug** builds, arm64 architecture Android **7.1.2 - 11.0**, upto **API 30** 128 | 129 | !> You must not choose non-rooted **user** builds. MobSF requires rooted **userdebug** builds. 130 | 131 | 1. After creating a supported rooted **userdebug** Android device, Follow Corellium's `Connect via VPN` instructions. 132 | 133 | ![Corellium Android](https://github.com/MobSF/Mobile-Security-Framework-MobSF/assets/4301109/f384421c-98af-47b1-8d98-29641d9ca974) 134 | 135 | 2. Do connect to Corellium network using provided VPN configuration. 136 | 137 | 3. Run `adb connect` locally to ensure that the connection is working from your host. 138 | 139 | ![Corellium adb](https://github.com/MobSF/Mobile-Security-Framework-MobSF/assets/4301109/c6f1135e-b1ef-4a14-b9bf-6ebfab2e3cca) 140 | 141 | 4. Set the environment variable `MOBSF_ANALYZER_IDENTIFIER` as `:` of Corellium Android device when you run the MobSF docker image (Example: `10.11.1.1:5001`). 142 | 143 | 144 | ## Corellium iOS VM 145 | 146 | Supports jailbroken Corellium iOS VMs from MobSF v3.8.0 onwards. 147 | 148 | !> Non jailbroken devices cannot be used with MobSF. 149 | 150 | 1. After setting up Corellium account, create an API key from https://app.corellium.com/profile/api 151 | 152 | ![Corellium API](https://user-images.githubusercontent.com/4301109/289017703-b6f25054-d1b5-4c0e-a781-68b18260fb6a.png) 153 | 154 | 2. Set the API key in the environment variable `MOBSF_CORELLIUM_API_KEY`. If you are using enterprise version of Corellium using a different domain. You must also supply the environment variable `MOBSF_CORELLIUM_API_DOMAIN` with the correct domain value. 155 | 156 | 3. To enable MobSF HTTPs proxying, You will have to configure the proxy settings in the iOS VM. Go to iPhone `Settings` -> `Wi-Fi` -> Choose the `Corellium` WiFi -> Scroll down and choose `Configure Proxy` -> Choose`Manual configuration` -> Set the `Server` as `127.0.0.1` and `Port` as `1337` -> Click `Save`. 157 | 158 | ![iOS HTTPS Proxy](https://user-images.githubusercontent.com/4301109/289017713-ffc54f0e-1c23-484d-a612-0318ad41e7a3.png) 159 | 160 | 4. Run MobSF and now you can create or manage jailbroken iOS VMs with Corellium for Dynamic Analysis. 161 | -------------------------------------------------------------------------------- /extras.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | # Extra Features 6 | 7 | ## REST API 8 | 9 | MobSF offers REST APIs, and you can view the latest API documentation directly within the app at the `/api_docs` route. 10 | *** 11 | ## CI/CD 12 | 13 | For CI/CD you can take advantage of MobSF REST API 14 | 15 | **MobSF CI/CD pipeline integration** 16 | 17 | * **MobSF - Bitrise** - [iOS Security Analysis with MobSF](https://www.netguru.com/codestories/ios-security-analysis-with-mobsf) | [Run your security static analysis tests on the cloud with MobSF, AWS, and Bitrise](https://bitrise.io/blog/post/run-your-security-static-analysis-tests-on-the-cloud-with-mobsf-aws-and-bitrise) 18 | * **MobSF - OWASP Glue** - [How To: (Continuously) Hacking Your App](https://medium.com/@omerlh/how-to-continuously-hacking-your-app-c8b32d1633ad) 19 | * **MobSF - Jenkins** - [Achieving DevSecOps: Mobile App Security Integration Using Jenkins and MobSF](https://medium.com/@debasishkumardas5/achieving-devsecops-mobile-app-security-integration-using-jenkins-and-mobsf-187568f74d4c) 20 | * **MobSF - Gitlab CI** [Running MobSF SAST using Gitlab CI Service](https://waristea.medium.com/running-mobsf-sast-using-gitlab-ci-service-7c3ac3a48648) | [GitLab CI template for MobSF](https://to-be-continuous.gitlab.io/doc/ref/mobsf/) 21 | * **mobsfscan SAST CI/CD** - [mobsfscan](https://github.com/MobSF/mobsfscan) 22 | *** 23 | 24 | 25 | ## Mass Static Analysis 26 | 27 | * Run MobSF server. 28 | `./run.sh` or `run.bat` 29 | * Obtain the **REST API key** from console. 30 | * Run [mass_static_analysis.py](https://github.com/MobSF/Mobile-Security-Framework-MobSF/blob/master/scripts/mass_static_analysis.py) 31 | 32 | ```bash 33 | pip install requests 34 | python mass_static_analysis.py 35 | usage: mass_static_analysis.py [-h] [-d DIRECTORY] [-s IPPORT] [-k APIKEY] 36 | [-r RESCAN] 37 | 38 | optional arguments: 39 | -h, --help show this help message and exit 40 | -d DIRECTORY, --directory DIRECTORY 41 | Path to the directory that contains mobile app 42 | binary/zipped source code 43 | -s IPPORT, --ipport IPPORT 44 | IP address and Port number of a running MobSF Server. 45 | (ex: 127.0.0.1:8000) 46 | -k APIKEY, --apikey APIKEY 47 | MobSF REST API Key 48 | -r RESCAN, --rescan RESCAN 49 | Run a fresh scan. Value can be 1 or 0 (Default: 0) 50 | ``` 51 | 52 | Example: 53 | ```bash 54 | python mass_static_analysis.py -s 127.0.0.1:8000 -k -d /home/files/ 55 | ``` 56 | *** 57 | ## VirusTotal Scan 58 | 59 | VirusTotal Scan is disabled by default. You need to add your VirusTotal API Key before enabling it. 60 | 61 | * Get VirusTotal API Key [here](https://www.virustotal.com/#/join-us) 62 | * Access your API Key from https://www.virustotal.com/en/user/[username]/apikey/. 63 | * Set the environment variable `MOBSF_VT_ENABLED=1` and `MOBSF_VT_API_KEY=` before running MobSF. 64 | * You can enable binary uploads to VirusTotal by setting the environment variable `MOBSF_VT_UPLOAD=1`. This option is disabled by default. 65 | *** 66 | ## AppMonsta Play Store Info 67 | 68 | We use AppMonsta API to fetch details from Google Play Store as a fail safe to our primary implementation. It is disabled by default. To enable it, you need AppMonsta API Key. 69 | 70 | * Get AppMonsta API Key from: [AppMonsta API Key](https://appmonsta.com/dashboard/get_api_key/) 71 | * Set the environment variable `MOBSF_APPMONSTA_API=` before running MobSF. 72 | *** 73 | ## Using Postgres DB instead of SQLite 74 | 75 | By default, MobSF uses SQLite as its database. However, you can switch to a PostgreSQL backend if needed. 76 | 77 | To configure PostgreSQL, set the following environment variables before starting MobSF: 78 | 79 | POSTGRES_USER=postgres 80 | POSTGRES_PASSWORD=password 81 | POSTGRES_DB=mobsf 82 | POSTGRES_HOST=postgres 83 | POSTGRES_PORT=5432 84 | 85 | **Apply Migrations** 86 | 87 | ```bash 88 | poetry run python manage.py makemigrations 89 | poetry run python manage.py makemigrations StaticAnalyzer 90 | poetry run python manage.py migrate 91 | poetry run python manage.py create_roles 92 | ``` 93 | 94 | You can now restart the MobSF server, and PostgreSQL will be successfully configured as the database. 95 | 96 | You can also take a look at the docker compose template that use Postgres and Nginx with MobSF [here](docker_options.md?id=for-postgres-and-nginx-reverse-proxy-support) -------------------------------------------------------------------------------- /faq.md: -------------------------------------------------------------------------------- 1 | # Frequently Asked Questions 2 | 3 | ## Disable Authentication, I would like to run MobSF without authentication. 4 | 5 | ### Solution 6 | 7 | Set environment variable `MOBSF_DISABLE_AUTHENTICATION=1` to disable Authentication and Authorization in MobSF. The REST APIs always requires the API Key. This cannot be disabled, however you can configure your own API key using the environment variable `MOBSF_API_KEY`. 8 | 9 | ## Database related exceptions when running Static Analysis 10 | 11 | ``` 12 | [ERROR] Saving to DB (E:\Mobile-Security-Framework-MobSF\StaticAnalyzer\views\android\db_interaction.py, 13 | LINE 236 "static_db.save()"): table StaticAnalyzer_staticanalyzerandroid has no column named 14 | ``` 15 | 16 | ### Solution 17 | 18 | If you see exceptions like the one above, most probably it is because you have a newer version of MobSF with database scheme changes. Follow the instructions for database migration depending on your deployment type. 19 | 20 | * [Updating MobSF (for host installations)](develop.md#updating-mobsf) 21 | * [Updating MobSF (for volume mount docker containers)](docker_options.md#updating-mobsf-version-when-volume-mount-is-used) 22 | 23 | ## Dynamic Analysis: APK Failed to Install 24 | 25 | 26 | ``` 27 | [INFO] 24/Sep/2020 13:50:56 - Installing APK 28 | adb: failed to install C:/Users/XXXX/Mobile-Security-Framework-MobSF/uploads/xxxx/xxxx.apk: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113] 29 | [ERROR] 24/Sep/2020 13:50:59 - This APK cannot be installed. Is this APK compatible the Android VM/Emulator? 30 | ``` 31 | 32 | ``` 33 | [INFO] 24/Sep/2020 13:50:56 - Installing APK 34 | adb: failed to install /x/xxx/xxx.apk: Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY: Package couldn't be installed in /data/app/com.xxx.xxx-1: Package com.xxx.xxxx requires unavailable shared library com.google.android.maps; failing!] 35 | ``` 36 | 37 | ### Solution 38 | The `INSTALL_FAILED_NO_MATCHING_ABIS` error is shown when you are trying to install an app that has native libraries which targets an unsupported architecture like ARM. 39 | Genymotion or Android Studio Emulator x86 runs x86 or x86_64 architecture of Android and hence ARM libraries cannot work. So you need to provide the right APK targetting the right platform or use an ARM architecture based Android Studio Emulator for Dynamic Analysis. 40 | 41 | 42 | You could make some ARM targetted apps work with Genymotion by using an ARM translation module. See [Genymotion ARM Translation](https://github.com/m9rco/Genymotion_ARM_Translation) 43 | Sometimes you need Google Apps like the Playstore service for you app to run. In such cases, you will have to install the correct version of GApps for the Android version that you are using for dynamic analysis. See: [Open GApps](https://opengapps.org/) 44 | 45 | 46 | ## Dynamic Analysis: MobSF docker in Linux host cannot talk with AVD/Genymotion in host 47 | 48 | When you attempt to perform dynamic analysis with AVD or Genymotion emulator running in your Ubuntu or Linux based host, after running the docker image, 49 | 50 | ```bash 51 | docker run -it --rm \ 52 | -e MOBSF_ANALYZER_IDENTIFIER=127.0.0.1:6555 \ 53 | -p 8000:8000 \ 54 | -p 1337:1337 \ 55 | opensecurity/mobile-security-framework-mobsf:latest 56 | ``` 57 | you are seeing connectivity error messages such as `failed to connect to 'host.docker.internal:6555': Connection refused`. 58 | 59 | ### Solution 60 | The `MOBSF_ANALYZER_IDENTIFIER` contains a localhost IP address. In order for the docker image to communicate correctly with the AVD or Genymotion running in the localhost, it need to use `host.docker.internal` to correctly route the traffic to the host operating system. In Linux based OS, this will not work out of the box. To fix this, first you need to ensure that your Docker version is `>=20.10.0`. Now run the MobSF docker image with the extra docker flags `--add-host=host.docker.internal:host-gateway`. 61 | This should fix the network connectivity between adb inside the MobSF container and your AVD/Genymotion emulator in the Linux host running on a localhost IP. 62 | 63 | Example: 64 | ```bash 65 | docker run -it --rm \ 66 | -e MOBSF_ANALYZER_IDENTIFIER=127.0.0.1:6555 \ 67 | -p 8000:8000 \ 68 | -p 1337:1337 \ 69 | --add-host=host.docker.internal:host-gateway \ 70 | opensecurity/mobile-security-framework-mobsf:latest 71 | ``` 72 | 73 | The above might not work for Android Studio AVDs. For AVDs, run the `scripts/start_avd.sh` script to obtain the correct `MOBSF_ANALYZER_IDENTIFIER`. 74 | 75 | Example: 76 | ```bash 77 | scripts/start_avd.sh Pixel_5_API_30 78 | ... 79 | ... 80 | socat listener started on port 5556 forwarding to 5555 in the host. 81 | Docker users please set the environment variable MOBSF_ANALYZER_IDENTIFIER=host.docker.internal:5556 for adb connectivity. 82 | 83 | docker run -it --rm \ 84 | -p 8000:8000 \ 85 | -p 1337:1337 \ 86 | --add-host=host.docker.internal:host-gateway \ 87 | -e MOBSF_ANALYZER_IDENTIFIER=host.docker.internal:5556 \ 88 | opensecurity/mobile-security-framework-mobsf:latest 89 | ``` 90 | 91 | If the above does not work, you can try running the docker container in the host network. 92 | 93 | Example: 94 | ```bash 95 | docker run -it --rm \ 96 | --net=host \ 97 | -e MOBSF_PLATFORM=linux \ 98 | -e MOBSF_ANALYZER_IDENTIFIER=127.0.0.1:6555 \ 99 | -p 8000:8000 \ 100 | -p 1337:1337 \ 101 | opensecurity/mobile-security-framework-mobsf:latest 102 | ``` 103 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Document 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 46 | 47 | 48 |
49 |
50 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /running_mobsf_docker.md: -------------------------------------------------------------------------------- 1 | # Running MobSF 2 | 3 | ?> You'll need to have [Docker](https://docs.docker.com/get-docker/) installed to run MobSF, and it’s recommended to use version 20.10.0 or higher for the best experience. 4 | 5 | To ensure you have the latest features, security updates, and bug fixes, it's best to download the most recent `latest` tagged MobSF Docker image. We also provide versioned [releases](https://hub.docker.com/r/opensecurity/mobile-security-framework-mobsf/tags), though they may not include the latest updates. 6 | 7 | ## Static Analysis 8 | 9 | ### Run MobSF with Static Analysis Support 10 | 11 | Download the latest docker image and run the MobSF container. 12 | 13 | ``` 14 | docker pull opensecurity/mobile-security-framework-mobsf:latest 15 | docker run -it --rm \ 16 | -p 8000:8000 \ 17 | opensecurity/mobile-security-framework-mobsf:latest 18 | ``` 19 | 20 | You can now access the MobSF web interface by opening `http://127.0.0.1:8000` in your browser. Use the default login credentials: `mobsf/mobsf`. 21 | 22 | ## Dynamic Analysis 23 | ### Run MobSF with Static & Dynamic Analysis Support 24 | 25 | You must run any of the **[supported](dynamic_analyzer_docker.md)** (Genymotion Android VM/ Android Studio Emulator/ Corellium VM) and obtain the `MOBSF_ANALYZER_IDENTIFIER` before running MobSF. 26 | 27 | ``` 28 | docker run -it --rm \ 29 | -p 8000:8000 \ 30 | -p 1337:1337 \ 31 | -e MOBSF_ANALYZER_IDENTIFIER= \ 32 | opensecurity/mobile-security-framework-mobsf:latest 33 | ``` 34 | 35 | See how you can obtain the correct value for `` [here](dynamic_analyzer_docker.md). 36 | 37 | !> On Ubuntu and other Linux-based systems, make sure your Docker version is >= `20.10.0`. When running the MobSF Docker container, add the extra option `--add-host=host.docker.internal:host-gateway`. Without this setting, the MobSF Docker container will be unable to communicate with the Android VM/emulator running on `localhost` of the host machine. You may also need to forward traffic to the emulator by following the instructions below. 38 | 39 | ``` 40 | # Install socat 41 | sudo apt install socat 42 | 43 | # Run start_avd script 44 | scripts/start_avd.sh 45 | # The script will output the MOBSF_ANALYZER_IDENTIFIER 46 | ``` 47 | ``` 48 | # Example usage: 49 | $ scripts/start_avd.sh Pixel_5_API_30 50 | ... 51 | ... 52 | socat listener started on port 5556 forwarding to 5555 in the host. 53 | Docker users please set the environment variable MOBSF_ANALYZER_IDENTIFIER=host.docker.internal:5556 for adb connectivity. 54 | 55 | docker run -it --rm \ 56 | -p 8000:8000 \ 57 | -p 1337:1337 \ 58 | --add-host=host.docker.internal:host-gateway \ 59 | -e MOBSF_ANALYZER_IDENTIFIER=host.docker.internal:5556 \ 60 | opensecurity/mobile-security-framework-mobsf:latest 61 | ``` 62 | 63 | 64 | ?> MobSF only supports Dynamic Analysis with **rooted** Android version `4.1` to `11.0` upto `API 30`. Android version `12` and above are not supported. 65 | 66 | 67 | ### Run MobSF with iOS Dynamic Analysis Support 68 | 69 | Obtain a Corellium [API key](https://app.corellium.com/login) before running MobSF. 70 | 71 | ``` 72 | docker run -it --rm \ 73 | -p 8000:8000 \ 74 | -p 1337:1337 \ 75 | -e MOBSF_CORELLIUM_API_KEY= \ 76 | opensecurity/mobile-security-framework-mobsf:latest 77 | ``` 78 | 79 | ## MobSF Tutorials 80 | 81 | This video from Defcon Demo Labs 2020 explains some of the basic features of MobSF. 82 | 83 | 84 | 85 | Live HTTPs Traffic Interception of a Mobile App with MobSF and ZAP. 86 | 87 | 88 | 89 | Solving an Android CTF with MobSF, Frida and ChatGPT. 90 | 91 | 92 | 93 | If you're just getting started with MobSF, the [Automated Mobile Application Security Assessment with MobSF](https://opsecx.com/index.php/product/automated-mobile-application-security-assessment-with-mobsf/) course is a great way to dive in. It’s designed to walk you through MobSF’s key features and show you how to get the most out of the tool, making it perfect for beginners. 94 | 95 | ### Other Resources 96 | 97 | * [Past MobSF Presentations & Slides](https://mobsf.github.io/Mobile-Security-Framework-MobSF/presentations.html) 98 | * [Community Generated Playlist](https://youtube.com/playlist?list=PLX3EwmWe0cS9SRHpuuiRA-CsxevX3hh6o&si=5o3Mt6a6q9lmvuDn) 99 | -------------------------------------------------------------------------------- /sso.md: -------------------------------------------------------------------------------- 1 | ## SSO support in MobSF 2 | 3 | MobSF now supports SSO using SAML2, starting with version 4.0.1. 4 | 5 | There are three user roles: 6 | 7 | 1. `Admin`: This is the primary administrator account created during the initial setup. This role can manage users with other roles. 8 | 2. `Maintainer`: This role has permission to scan, suppress, and delete. 9 | 3. `Viewer`: This role is read-only and can only view the scan results. 10 | 11 | For SSO integration, we only support `Maintainer` and `Viewer` roles. 12 | 13 | 14 | !> When SSO is enabled, password authentication and `Admin` role is turned off by default. To allow password login or admin account, set the environment variable `MOBSF_SP_ALLOW_PASSWORD` to `1` before running MobSF. 15 | 16 | 17 | ### How to Setup Okta SSO? 18 | 19 | The section covers how you can set up MobSF with Okta for SSO. 20 | 21 | To setup Okta SSO, you need the Assertion Consumer Service URL from MobSF 22 | 23 | * **Assertion Consumer Service (ACS) URL** - This is where Okta sends the SAML assertion via HTTP POST. The ACS URL is `://:/sso/acs/`. For example, if you have MobSF running in your local environment, the ACS URL will be `http://localhost:8000/sso/acs/` 24 | 25 | To enable Okta SSO in MobSF, you need the Metadata URL from Okta. 26 | 27 | * **Metadata URL** - This Okta URL contains metadata information required by MobSF, such as the entity ID, X509 Certificate, and SSO URL. 28 | 29 | #### Okta Configuration 30 | 31 | 1. Log in to your Okta Admin account. 32 | 2. Under **Applications**, click on **Create App Integration**. 33 | 3. Choose **SAML 2.0** and click **Next**. 34 | 4. In the **General Settings**, configure the following: 35 | * **App Name**: `MobSF` 36 | * **App logo**: [Use the MobSF Logo](https://github.com/MobSF/Mobile-Security-Framework-MobSF/assets/4301109/9925f41c-bd53-4ef5-a4e5-e6b18ce4ba6d) 37 | 38 | MobSF App Integration 39 | 40 | 5. In the next **Configure SAML** tab, configure the following: 41 | * **Single sign-on URL**: `` 42 | * Check the box `Use this for Recipient URL and Destination URL` 43 | * **Audience URI (SP Entity ID)**: `` 44 | * **Name ID format**: `EmailAddress` 45 | * **Application username**: `Email` 46 | * **Update application username on**: `Create and Update` 47 | 6. Under the **Attribute Statements (optional)** section, create a new attribute statement to send the user email to MobSF. 48 | * **Name**: `email` 49 | * **Name format**: `Unspecified` 50 | * **Value**: `user.email` 51 | 7. Under the **Group Attribute Statements (optional)** section, create a new attribute statement to send appropriate roles to MobSF. 52 | * **Name**: `role` 53 | * **Name format**: `Unspecified` 54 | * **Filter**: `Matches Regex`, `.*` 55 | 56 | SAML settings 57 | 58 | 8. In the next **Feedback** screen, tick the `This is an internal app that we have created` option and click **Finish** to create the MobSF Okta integration. 59 | 60 | 9. You must create at least two Okta groups for the MobSF roles `Maintainer` and `Viewer`. The group name should contain the string `maintainer` in it to be associated with the `Maintainer` role, and any other group name will be assigned to the Read-Only `Viewer` role. You can add corresponding users to each group. 61 | 62 | 10. Go to the **Assignment** tab of the MobSF app and assign the groups corresponding to `Maintainer` and `Viewer` roles. 63 | 64 | Screenshot 2024-05-22 at 8 36 41 PM 65 | 66 | 67 | 11. Now Go to the **Sign On** tab of the created app and copy the `Metadata URL`. 68 | Metadata URL 69 | 70 | 71 | 72 | #### MobSF Configuration 73 | 74 | 1. After you have created the Okta MobSF app integration, Set the environment variable `MOBSF_IDP_METADATA_URL` to the Okta `Metadata URL`. 75 | 76 | 2. Run MobSF, and now SSO with Okta is enabled. 77 | 78 | 79 | ### SSO FAQ 80 | 81 | #### MobSF behind reverse proxy 82 | 83 | When running MobSF behind a reverse proxy such as Nginx, ensure that the actual domain name reaches MobSF by setting headers such as `X-Forwarded-Host`, `X-Forwarded-Port` and 84 | `X-Forwarded-For`. 85 | 86 | **Example Nginx settings** 87 | 88 | ``` 89 | location / { 90 | proxy_set_header X-Forwarded-Host $host; 91 | proxy_set_header X-Forwarded-Port 443; 92 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 93 | .... 94 | } 95 | ``` 96 | 97 | Alternatively, you can directly set the hostname using the environment variable `MOBSF_SP_HOST`. Example: `MOBSF_SP_HOST=https://mobsf.yourdomain.com` 98 | 99 | 100 | Errors such as `Invalid dict settings: sp_acs_url_invalid` is an indication that MobSF couldn't find the correct hostname. --------------------------------------------------------------------------------